fleetbo-svro 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ - @fleetbo/svro
2
+ Le connecteur backend Fleetbo ultra-léger configuré automatiquement depuis votre terminal.
3
+
4
+
5
+ # Expérience Développeur (DX) : De l'installation au code
6
+
7
+ 1. Installation en une commande
8
+ Lencez simplement l'installation à la racine de votre projet Vite (React, Vue, etc.) :
9
+ Bash
10
+ npm install @fleetbo/svro
11
+
12
+ 2. Configuration automatique dans le terminal (Postinstall)
13
+ Dès l'installation terminée, le script de configuration prend le relais :
14
+ Authentification OTP : Le terminal vous demande votre email et un code à 6 chiffres.
15
+ Injection des clés : Les identifiants (VITE_FLEETBO_DB_KEY, etc.) sont écrits directement dans votre fichier .env.
16
+
17
+ Configuration IDE & Build :
18
+ Création de svro.schema.json et initialisation des types TypeScript.
19
+ Patch de tsconfig.json / jsconfig.json pour l'autocomplétion.
20
+ Injection du plugin d'auto-import et du middleware de synchronisation dans vite.config.
21
+ Ajout de fleetbo sql sync dans le script build du package.json.
22
+
23
+ 3. Consommation immédiate dans votre code
24
+ Ouvrez vos composants et utilisez directement l'objet Fleetbo. Grâce à la configuration Vite, aucun import n'est requis (l'import reste possible si vous le préférez) :
25
+ JavaScript
26
+ // Fonctionne directement dans vos composants React / Vue
27
+ const response = await Fleetbo.add('orders', { product: 'Chaise', price: 49 });
28
+
29
+ # Utilisation dans votre code
30
+
31
+ Écrire des données
32
+ JavaScript
33
+
34
+ // 1. Ajouter un document (ID généré automatiquement)
35
+ const response = await Fleetbo.add('orders', { product: 'Chaise', price: 49 });
36
+ console.log(response.documentId);
37
+
38
+ // 2. Ajouter un document avec un ID personnalisé
39
+ await Fleetbo.addWithId('products', { name: 'Bureau Pro' }, 'bureau-123');
40
+
41
+ // 3. Ajouter un document lié à l'utilisateur actuellement connecté
42
+ await Fleetbo.addWithUserId('preferences', { theme: 'dark' });
43
+
44
+ Lire et Supprimer des données
45
+ JavaScript
46
+ // 1. Récupérer tous les documents globaux d'une table
47
+ const responseG = await Fleetbo.getDocsG('orders');
48
+ if (responseG.success) {
49
+ console.log(responseG.data); // Tableau de vos documents
50
+ }
51
+
52
+ // 2. Récupérer les documents spécifiques à l'utilisateur connecté
53
+ const responseU = await Fleetbo.getDocsU('orders');
54
+
55
+ // 3. Récupérer un document unique par son ID
56
+ const singleDoc = await Fleetbo.getDoc('orders', 'bureau-123');
57
+
58
+ // 4. Supprimer un document
59
+ await Fleetbo.delete('orders', 'bureau-123');
60
+
61
+
62
+ # Référence de l'API
63
+
64
+ Méthodes d'Écriture
65
+ Fleetbo.add(table, data) → Ajoute un document.
66
+ Fleetbo.addWithId(table, data, customId) → Ajoute un document avec un ID spécifique.
67
+ Fleetbo.addWithUserId(table, data) → Ajoute un document lié à l'utilisateur connecté.
68
+ Fleetbo.delete(table, docId) → Supprime un document.
69
+
70
+ Méthodes de Lecture
71
+ Fleetbo.getDoc(table, docId) → Récupère un document unique par son ID.
72
+ Fleetbo.getDocsG(table) → Récupère les documents globaux de la table.
73
+ Fleetbo.getDocsU(table) → Récupère les documents de l'utilisateur connecté.
74
+ Fleetbo.getAuthUser(table) → Récupère les données du profil de l'utilisateur connecté.
75
+
76
+
package/dist/cli.cjs ADDED
@@ -0,0 +1,311 @@
1
+ #!/usr/bin/env node
2
+ var _=(t,s)=>()=>{try{return s||t((s={exports:{}}).exports,s),s.exports}catch(n){throw s=0,n}};var C=_((se,P)=>{var d=require("fs"),u=require("path"),U=require("https"),{execSync:j}=require("child_process"),A="\x1B[38;2;231;233;237m",D="\x1B[31m",I="\x1B[0m";function b(t){console.log(` ${A}${t}${I}`)}function p(t){console.error(` ${D}${t}${I}`)}function $(t){let s={};return t.forEach(n=>{if(n.startsWith("--")){let[r,a]=n.slice(2).split("=");r&&a&&(s[r]=a)}}),s}function T(t,s){try{let n=JSON.parse(d.readFileSync(t,"utf8"));return!!(n.dependencies&&n.dependencies[s]||n.devDependencies&&n.devDependencies[s])}catch{return!1}}function J(t,s){if(!T(s,"fleetbo-svro")){b("\u2192 Installing fleetbo-svro into the project...");try{j("npm install fleetbo-svro",{cwd:t,stdio:"inherit"}),b("fleetbo-svro installed successfully!")}catch{p("\u26A0\uFE0F Automatic installation failed. Please run 'npm install fleetbo-svro' manually.")}}}function L(t){let s=u.join(t,"svro.schema.json");if(d.existsSync(s))return;let n=new Date().toISOString(),r={createdAt:n,patchedAt:n,schemaVersion:1,collections:{}};d.writeFileSync(s,JSON.stringify(r,null,2)+`
3
+ `),b("\u2192 Created svro.schema.json at project root.")}function q(t){let s=u.join(t,"src");if(!d.existsSync(s))return;let n=u.join(s,"auto-imports.d.ts");if(d.existsSync(n))return;let r=`/* eslint-disable */
4
+ /* prettier-ignore */
5
+ // @ts-nocheck
6
+ // Generated by fleetbo-svro setup
7
+ export {}
8
+ declare global {
9
+ const Fleetbo: typeof import('fleetbo-svro')['Fleetbo']
10
+ const FleetboUI: typeof import('fleetbo-svro')['FleetboUI']
11
+ }
12
+ `;try{d.writeFileSync(n,r),b("\u2192 Created src/auto-imports.d.ts stub for instant IDE auto-completion.")}catch(a){p(`\u26A0\uFE0F Unable to create src/auto-imports.d.ts: ${a.message}`)}}function B(t){let s=["tsconfig.json","jsconfig.json"];for(let n of s){let r=u.join(t,n);if(d.existsSync(r)){let a=new Date;d.utimesSync(r,a,a);break}}}function W(t){let s=u.join(t,"index.d.ts");if(d.existsSync(s))return;d.writeFileSync(s,`// File generated/synchronized by fleetbo-svro \u2014 do not edit manually
13
+ import type React from 'react';
14
+
15
+ export type FleetboTables = string;
16
+
17
+ declare global {
18
+ interface ImportMetaEnv {
19
+ readonly VITE_FLEETBO_DB_KEY?: string;
20
+ readonly VITE_FLEETBO_ENTERPRISE_ID?: string;
21
+ readonly [key: string]: any;
22
+ }
23
+
24
+ interface ImportMeta {
25
+ readonly env: ImportMetaEnv;
26
+ }
27
+ }
28
+
29
+ export interface FleetboWriteResult { success: boolean; documentId?: string; error?: string; }
30
+ export interface FleetboReadResult<T = any> { success: boolean; data?: T; notFound?: boolean; message?: string; }
31
+
32
+ export interface FleetboAuthUser {
33
+ uid: string;
34
+ email?: string | null;
35
+ isAnonymous: boolean;
36
+ }
37
+
38
+ export interface FleetboAuthResult {
39
+ success: boolean;
40
+ user?: FleetboAuthUser | null;
41
+ error?: string;
42
+ }
43
+
44
+ export declare const FleetboUI: {
45
+ Text: React.FC<{ value?: any; fallback?: string; className?: string }>;
46
+ Number: React.FC<{ value?: any; fallback?: React.ReactNode; invalidFallback?: React.ReactNode; className?: string; format?: Intl.NumberFormatOptions }>;
47
+ Toggle: React.FC<{ value?: any; className?: string; labels?: { true: string; false: string }; invalidFallback?: React.ReactNode }>;
48
+ Date: React.FC<{ value?: any; className?: string; locale?: string; invalidFallback?: React.ReactNode }>;
49
+ Enum: React.FC<{ value?: any; allowed?: any[]; className?: string; invalidFallback?: React.ReactNode }>;
50
+ Reference: React.FC<{
51
+ table: FleetboTables;
52
+ id?: string;
53
+ render?: (doc: any) => React.ReactNode;
54
+ orphanFallback?: React.ReactNode;
55
+ malformedFallback?: React.ReactNode;
56
+ loadingFallback?: React.ReactNode;
57
+ className?: string;
58
+ }>;
59
+ List: React.FC<{ value?: any[]; render?: (item: any, index: number) => React.ReactNode; className?: string }>;
60
+ Media: React.FC<{ value?: any; alt?: string; className?: string; fallback?: React.ReactNode }>;
61
+ Geo: React.FC<{ value?: any; className?: string; render?: (coords: { lat: number; lng: number }) => React.ReactNode }>;
62
+ Smart: React.FC<any>;
63
+ };
64
+
65
+ export interface FleetboAclResult {
66
+ success: boolean;
67
+ error?: string;
68
+ }
69
+
70
+ export interface FleetboJoinOptions {
71
+ innerJoin: {
72
+ collection: FleetboTables;
73
+ on: [string, string, string];
74
+ as?: string;
75
+ select?: string[];
76
+ }
77
+ }
78
+
79
+ export declare const Fleetbo: typeof FleetboUI & {
80
+ call: {
81
+ [key: string]: <T = any>(payload?: Record<string, any>) => Promise<FleetboCallResult<T>>;
82
+ };
83
+ add(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
84
+ addWithId(table: FleetboTables, data: Record<string, any>, customId: string): Promise<FleetboWriteResult>;
85
+ addWithUserId(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
86
+
87
+ getDocsG<T = any>(table: FleetboTables): Promise<T[]>;
88
+ getDocsU<T = any>(table: FleetboTables): Promise<T[]>;
89
+ getDoc<T = any>(table: FleetboTables, docId: string): Promise<T | null>;
90
+ getAuthUser(): Promise<any>;
91
+
92
+ delete(table: FleetboTables, docId: string): Promise<FleetboWriteResult>;
93
+ update(table: FleetboTables, docId: string, data: Record<string, any>): Promise<FleetboWriteResult>;
94
+
95
+ join<T = any>(table: FleetboTables, options: FleetboJoinOptions): Promise<T[]>;
96
+
97
+ sendotpsvro(email: string): Promise<FleetboWriteResult>;
98
+ verifyotpsvro(email: string, code: string): Promise<FleetboAuthResult>;
99
+
100
+ isAuthenticated(forceRefresh?: boolean): Promise<boolean>;
101
+ logout(): Promise<{ success: boolean; error?: string }>;
102
+ getUser(): Promise<FleetboAuthUser | null>;
103
+
104
+ acl: {
105
+ grant(targetUserId: string, action: string, resourceTable: FleetboTables, resourceId?: string): Promise<FleetboAclResult>;
106
+ revoke(targetUserId: string, action: string, resourceTable: FleetboTables, resourceId?: string): Promise<FleetboAclResult>;
107
+ can(action: string, resourceTable: FleetboTables, resourceId?: string): Promise<boolean>;
108
+ };
109
+ };
110
+
111
+ declare global {
112
+ const Fleetbo: typeof import('./index').Fleetbo;
113
+ const FleetboUI: typeof import('./index').FleetboUI;
114
+
115
+ interface Window {
116
+ Fleetbo: typeof Fleetbo;
117
+ FleetboUI: typeof FleetboUI;
118
+ }
119
+ }
120
+ `),b("\u2192 Initialized index.d.ts.")}function M(t){return new Promise((s,n)=>{let r=JSON.stringify({token:t}),a={hostname:"bootstrapproject-jqycakhlxa-uc.a.run.app",path:"/",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(r)}},l=U.request(a,e=>{let i="";e.on("data",o=>{i+=o}),e.on("end",()=>{if(e.statusCode>=200&&e.statusCode<300)try{s(JSON.parse(i))}catch{n(new Error("Invalid response received from Fleetbo server."))}else try{let o=JSON.parse(i);n(new Error(o.error||`Server error ${e.statusCode}`))}catch{n(new Error(`Server error ${e.statusCode}`))}})});l.on("error",e=>n(e)),l.write(r),l.end()})}async function V(t,s=[]){let n=u.join(t,".env");if(d.existsSync(n)&&d.readFileSync(n,"utf8").includes("VITE_FLEETBO_DB_KEY")){b("\u2192 Fleetbo environment variables already present in .env \u2014 skipping step.");return}let r=$(s),a=r.keyApp,l=r.token||r.bootstrapToken,e=r.email||"";(!a||!l)&&(p("\u26A0\uFE0F Missing required parameters."),p("\u{1F449} Usage: npx fleetbo-svro init --keyApp=YOUR_KEY --token=YOUR_TOKEN"),process.exit(1)),b("\u2192 Exchanging bootstrap token for project keys...");let i;try{i=await M(l)}catch(c){p(`\u26A0\uFE0F Token exchange failed: ${c.message}`),p("\u{1F449} The token may have expired (15 min limit) or was already used. Please regenerate one from the Fleetbo dashboard."),process.exit(1)}(!i.enterpriseId||!i.fleetboDBKey)&&(p("\u26A0\uFE0F Incomplete response from Fleetbo server."),process.exit(1));let o=`
121
+ VITE_FLEETBO_DB_KEY=${i.fleetboDBKey}
122
+ VITE_FLEETBO_ENTERPRISE_ID=${i.enterpriseId}
123
+ VITE_FLEETBO_KEY_APP=${a}
124
+ ${e?`VITE_FLEETBO_TESTER_EMAIL=${e}
125
+ `:""}`;d.appendFileSync(n,o),b(".env file updated successfully with Fleetbo keys!")}function x(t){let s=u.join(t,"svro.d.ts");if(d.existsSync(s))try{d.unlinkSync(s),b("\u2192 Removed legacy svro.d.ts from project root.")}catch{}}function O(t,s){if(process.env.FLEETBO_SKIP_TYPECHECK_SETUP)return;let n=u.join(t,"tsconfig.json"),r=u.join(t,"jsconfig.json"),a=d.existsSync(n)?n:r,l=!d.existsSync(a),e={};if(!l)try{e=JSON.parse(d.readFileSync(a,"utf8"))}catch{p(`\u26A0\uFE0F Unable to read ${u.basename(a)} (Invalid JSON).`);return}e.compilerOptions=e.compilerOptions||{};let i=!1,o=T(s,"react"),c=T(s,"vite");l?(e.compilerOptions.checkJs=!0,e.compilerOptions.allowJs=!0,e.compilerOptions.target=e.compilerOptions.target||"ES2020",e.compilerOptions.module=e.compilerOptions.module||"ESNext",e.compilerOptions.moduleResolution=e.compilerOptions.moduleResolution||"bundler",e.include=e.include||["src"],i=!0):(e.compilerOptions.checkJs===void 0&&(e.compilerOptions.checkJs=!0,i=!0),e.compilerOptions.allowJs===void 0&&(e.compilerOptions.allowJs=!0,i=!0)),o&&e.compilerOptions.jsx===void 0&&(e.compilerOptions.jsx="react-jsx",i=!0),c&&e.compilerOptions.types===void 0&&(e.compilerOptions.types=["vite/client"],i=!0),i&&(d.writeFileSync(a,JSON.stringify(e,null,2)+`
126
+ `),b(`\u2192 Updated ${u.basename(a)}.`))}function N(t,s){if(process.env.FLEETBO_SKIP_AUTOIMPORT_SETUP)return;let r=["vite.config.ts","vite.config.js","vite.config.mjs"].map(o=>u.join(t,o)).find(o=>d.existsSync(o));if(!r)return;let a;try{a=d.readFileSync(r,"utf8")}catch{return}let l="fleetbo-svro",e=a,i=`{
127
+ name: 'fleetbo-schema-sync-middleware',
128
+ configureServer(server) {
129
+ server.middlewares.use('/__fleetbo_sync_schema', (req, res) => {
130
+ if (req.method === 'POST') {
131
+ let body = '';
132
+ req.on('data', chunk => { body += chunk; });
133
+ req.on('end', async () => {
134
+ try {
135
+ const { schema } = JSON.parse(body);
136
+ if (schema) {
137
+ const fs = await import('node:fs');
138
+ const path = await import('node:path');
139
+ const { execSync } = await import('node:child_process');
140
+ const schemaPath = path.join(process.cwd(), 'svro.schema.json');
141
+ fs.writeFileSync(schemaPath, JSON.stringify(schema, null, 2) + '\\n');
142
+ try {
143
+ execSync('node ./node_modules/fleetbo-svro/bin/cli.js sql sync', { stdio: 'ignore' });
144
+ } catch (_) {
145
+ execSync('npx fleetbo-svro sql sync', { stdio: 'ignore' });
146
+ }
147
+ }
148
+ res.writeHead(200, { 'Content-Type': 'application/json' });
149
+ res.end(JSON.stringify({ success: true }));
150
+ } catch (e) {
151
+ res.writeHead(500, { 'Content-Type': 'application/json' });
152
+ res.end(JSON.stringify({ success: false, error: e.message }));
153
+ }
154
+ });
155
+ } else {
156
+ res.writeHead(405).end();
157
+ }
158
+ });
159
+ }
160
+ },`;if(e.includes("svro.schema.json")||(e.includes("server:")?e.includes("watch:")?e=e.replace(/watch\s*:\s*\{/,`watch: {
161
+ ignored: ['**/svro.schema.json', '**/src/auto-imports.d.ts'],`):e=e.replace(/server\s*:\s*\{/,`server: {
162
+ watch: {
163
+ ignored: ['**/svro.schema.json', '**/src/auto-imports.d.ts']
164
+ },`):e.includes("defineConfig({")&&(e=e.replace("defineConfig({",`defineConfig({
165
+ server: {
166
+ watch: {
167
+ ignored: ['**/svro.schema.json', '**/src/auto-imports.d.ts']
168
+ }
169
+ },`))),e.includes("unplugin-auto-import"))e.includes("fleetbo-svro")&&!e.includes("FleetboUI")&&(e=e.replace(/imports\s*:\s*\[\s*\{\s*['"]fleetbo-svro(?:|\/vue)['"]\s*:\s*\[[^\]]*\]\s*\}\s*\]/g,`imports: [{ '${l}': ['Fleetbo', 'FleetboUI'] }]`));else{let o=e.match(/plugins\s*:\s*\[/);if(o){let c=o.index+o[0].length,h=`
170
+ AutoImport({
171
+ imports: [{ '${l}': ['Fleetbo', 'FleetboUI'] }],
172
+ dts: 'src/auto-imports.d.ts'
173
+ }),`;if(e=e.slice(0,c)+h+e.slice(c),!e.includes("import AutoImport")){let R=[...e.matchAll(/^import .+;?$/gm)].pop(),v=`import AutoImport from 'unplugin-auto-import/vite';
174
+ `;if(R){let g=R.index+R[0].length;e=e.slice(0,g)+`
175
+ `+v+e.slice(g)}else e=v+e}}}if(e.includes("__fleetbo_sync_schema")){if(e.includes("require('fs')")||e.includes('require("fs")')){let o=/\{\s*name:\s*['"]fleetbo-schema-sync-middleware['"][\s\S]*?\},/g;o.test(e)&&(e=e.replace(o,i),b("\u2192 Updated legacy Fleetbo middleware to modern ESM version."))}}else{let o=e.match(/plugins\s*:\s*\[/);if(o){let c=o.index+o[0].length;e=e.slice(0,c)+`
176
+ `+i+e.slice(c)}}if(e!==a)try{d.writeFileSync(r,e),b(`\u2192 Updated ${u.basename(r)} with Watcher and AutoImport configuration.`)}catch(o){p(`\u26A0\uFE0F Failed to write to ${u.basename(r)}: ${o.message}`)}try{let o=JSON.parse(d.readFileSync(s,"utf8"));o.devDependencies=o.devDependencies||{},o.devDependencies["unplugin-auto-import"]||(o.devDependencies["unplugin-auto-import"]="^0.18.0",d.writeFileSync(s,JSON.stringify(o,null,2)+`
177
+ `),b("\u2192 Added unplugin-auto-import to devDependencies."))}catch(o){p(`\u26A0\uFE0F Failed to update ${u.basename(s)}: ${o.message}`)}}function K(t,s,n={}){let{skipSelfInstall:r=!1}=n,a=u.join(__dirname,"..");r||J(t,s),L(t),W(a),q(t),x(t),O(t,s),N(t,s)}P.exports={touchTsConfig:B,log:b,logError:p,handleAuthAndEnv:V,detectDependency:T,cleanupLegacyRootDts:x,patchJsOrTsConfig:O,attemptViteAutoImportPatch:N,runFullSetup:K}});var m=require("fs"),y=require("path"),k=require("https"),{runFullSetup:Y,handleAuthAndEnv:G,touchTsConfig:H}=C(),z="\x1B[34m",Q="\x1B[31m",w="\x1B[0m";function f(t){console.log(`${z}${t}${w}`)}function F(t){console.error(`${Q}${t}${w}`)}function X(t,s){return new Promise((n,r)=>{let a=JSON.stringify({enterpriseID:t,schema:s}),l={hostname:"fleetbo-gatekeeper.fleetbo.workers.dev",path:"/sync-schema",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(a)}},e=k.request(l,i=>{let o="";i.on("data",c=>{o+=c}),i.on("end",()=>{i.statusCode>=200&&i.statusCode<300?n(JSON.parse(o)):r(new Error(`Edge sync failed with HTTP ${i.statusCode}`))})});e.on("error",i=>r(i)),e.write(a),e.end()})}function Z(t){let s=y.join(t,".env");if(!m.existsSync(s))return{};let n=m.readFileSync(s,"utf8"),r={};return n.split(`
178
+ `).forEach(a=>{let[l,...e]=a.split("=");l&&e.length>0&&(r[l.trim()]=e.join("=").trim())}),r}function ee(t){return new Promise((s,n)=>{let r=JSON.stringify({projectId:t,moduleName:"svro.schema.json"}),a={hostname:"getmodulecache-jqycakhlxa-uc.a.run.app",path:"/",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(r)}},l=k.request(a,e=>{let i="";e.on("data",o=>{i+=o}),e.on("end",()=>{if(e.statusCode>=200&&e.statusCode<300)try{let o=JSON.parse(i);if(o.success&&o.found&&o.module){let c=o.module.code||o.module.mockCode;s(typeof c=="string"?JSON.parse(c):c)}else n(new Error("Schema not found in Fleetbo Cloud."))}catch{n(new Error("Invalid JSON response received from Fleetbo server."))}else n(new Error(`Server error ${e.statusCode}`))})});l.on("error",e=>n(e)),l.write(r),l.end()})}var E=process.argv.slice(2),S=E[0];async function te(){let t=process.cwd(),s=y.join(t,"package.json");if(S==="init"||S==="doctor")f(`
179
+ [Fleetbo] Initializing and configuring Fleetbo...`),await G(t,E),Y(t,s),f(`
180
+ [Fleetbo] Configuration completed successfully!
181
+ `);else if(S==="sql"&&E[1]==="sync"){let n=E.includes("--dry-run");f(`[Fleetbo] Syncing schema...${n?" (dry-run)":""}`);let r=y.join(t,"svro.schema.json"),a=y.join(__dirname,".."),l=y.join(a,"index.d.ts"),e=y.join(t,"src","auto-imports.d.ts"),o=Z(t).VITE_FLEETBO_ENTERPRISE_ID;if(o)try{f("\u2192 Fetching latest svro.schema.json from Fleetbo OS...");let c=await ee(o);m.writeFileSync(r,JSON.stringify(c,null,2)+`
182
+ `),f("\u2192 Local svro.schema.json updated from FLeetbo OS.")}catch(c){F(`\u26A0\uFE0F Cloud fetch bypassed: ${c.message}. Using local file fallback.`)}else F("\u26A0\uFE0F VITE_FLEETBO_ENTERPRISE_ID missing in .env. Skipping cloud fetch.");(!m.existsSync(r)||!m.existsSync(l))&&(F("Error: Required system files not found."),process.exit(1));try{let c=JSON.parse(m.readFileSync(r,"utf8")),h=Object.keys(c.collections||{});if(o)try{await X(o,c),f("\u2192 Schema successfully sealed at Fleetbo Global Edge (O(1)).")}catch(g){F(`\u26A0\uFE0F Fleetbo Edge Shield sync warning: ${g.message}`)}let R=h.length>0?h.map(g=>`'${g}'`).join(" | "):"string",v=`// Generated by @fleetbo/svro \u2014 Updated via fleetbo sql sync
183
+ import type React from 'react';
184
+
185
+ export type FleetboTables = ${R};
186
+
187
+ declare global {
188
+ interface ImportMetaEnv {
189
+ readonly VITE_FLEETBO_DB_KEY?: string;
190
+ readonly VITE_FLEETBO_ENTERPRISE_ID?: string;
191
+ readonly [key: string]: any;
192
+ }
193
+
194
+ interface ImportMeta {
195
+ readonly env: ImportMetaEnv;
196
+ }
197
+ }
198
+
199
+ export interface FleetboWriteResult {
200
+ success: boolean;
201
+ documentId?: string;
202
+ mediaUrl?: string;
203
+ error?: string;
204
+ }
205
+
206
+ export interface FleetboCallResult<T = any> {
207
+ success: boolean;
208
+ data?: T;
209
+ error?: string;
210
+ }
211
+
212
+ export interface FleetboAuthUser {
213
+ uid: string;
214
+ email?: string | null;
215
+ isAnonymous: boolean;
216
+ }
217
+
218
+ export interface FleetboAuthResult {
219
+ success: boolean;
220
+ user?: FleetboAuthUser | null;
221
+ error?: string;
222
+ }
223
+
224
+ export declare const FleetboUI: {
225
+ Text: React.FC<{ value?: any; fallback?: string; className?: string }>;
226
+ Number: React.FC<{ value?: any; fallback?: React.ReactNode; invalidFallback?: React.ReactNode; className?: string; format?: Intl.NumberFormatOptions }>;
227
+ Toggle: React.FC<{ value?: any; className?: string; labels?: { true: string; false: string }; invalidFallback?: React.ReactNode }>;
228
+ Date: React.FC<{ value?: any; className?: string; locale?: string; invalidFallback?: React.ReactNode }>;
229
+ Enum: React.FC<{ value?: any; allowed?: any[]; className?: string; invalidFallback?: React.ReactNode }>;
230
+ Reference: React.FC<{
231
+ table: FleetboTables;
232
+ id?: string;
233
+ render?: (doc: any) => React.ReactNode;
234
+ orphanFallback?: React.ReactNode;
235
+ malformedFallback?: React.ReactNode;
236
+ loadingFallback?: React.ReactNode;
237
+ className?: string;
238
+ }>;
239
+ List: React.FC<{ value?: any[]; render?: (item: any, index: number) => React.ReactNode; className?: string }>;
240
+ Media: React.FC<{ value?: any; alt?: string; className?: string; fallback?: React.ReactNode }>;
241
+ Geo: React.FC<{ value?: any; className?: string; render?: (coords: { lat: number; lng: number }) => React.ReactNode }>;
242
+ Smart: React.FC<any>;
243
+ };
244
+
245
+ export interface FleetboAclResult {
246
+ success: boolean;
247
+ error?: string;
248
+ }
249
+
250
+ export interface FleetboJoinOptions {
251
+ innerJoin: {
252
+ collection: FleetboTables;
253
+ on: [string, string, string];
254
+ as?: string;
255
+ select?: string[];
256
+ }
257
+ }
258
+
259
+ export declare const Fleetbo: typeof FleetboUI & {
260
+ call: {
261
+ [key: string]: <T = any>(payload?: Record<string, any>) => Promise<FleetboCallResult<T>>;
262
+ };
263
+ add(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
264
+ addWithId(table: FleetboTables, data: Record<string, any>, customId: string): Promise<FleetboWriteResult>;
265
+ addWithUserId(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
266
+ addWithMedia(table: FleetboTables, data: Record<string, any>, fileBase64?: string, fileName?: string): Promise<FleetboWriteResult>;
267
+
268
+ getDocsG<T = any>(table: FleetboTables): Promise<T[]>;
269
+ getDocsU<T = any>(table: FleetboTables): Promise<T[]>;
270
+ getDoc<T = any>(table: FleetboTables, docId: string): Promise<T | null>;
271
+ getAuthUser(): Promise<any>;
272
+
273
+ delete(table: FleetboTables, docId: string): Promise<FleetboWriteResult>;
274
+ update(table: FleetboTables, docId: string, data: Record<string, any>): Promise<FleetboWriteResult>;
275
+
276
+ join<T = any>(table: FleetboTables, options: FleetboJoinOptions): Promise<T[]>;
277
+
278
+ sendotpsvro(email: string): Promise<FleetboWriteResult>;
279
+ verifyotpsvro(email: string, code: string): Promise<FleetboAuthResult>;
280
+
281
+ isAuthenticated(forceRefresh?: boolean): Promise<boolean>;
282
+ logout(): Promise<{ success: boolean; error?: string }>;
283
+ getUser(): Promise<FleetboAuthUser | null>;
284
+
285
+ acl: {
286
+ grant(targetUserId: string, action: string, resourceTable: FleetboTables, resourceId?: string): Promise<FleetboAclResult>;
287
+ revoke(targetUserId: string, action: string, resourceTable: FleetboTables, resourceId?: string): Promise<FleetboAclResult>;
288
+ can(action: string, resourceTable: FleetboTables, resourceId?: string): Promise<boolean>;
289
+ };
290
+ };
291
+
292
+ declare global {
293
+ const Fleetbo: typeof import('./index').Fleetbo;
294
+ const FleetboUI: typeof import('./index').FleetboUI;
295
+
296
+ interface Window {
297
+ Fleetbo: typeof Fleetbo;
298
+ FleetboUI: typeof FleetboUI;
299
+ }
300
+ }
301
+ `;if(m.writeFileSync(l,v),m.existsSync(y.dirname(e))){let g=`/* eslint-disable */
302
+ /* prettier-ignore */
303
+ // @ts-nocheck
304
+ // Generated by @fleetbo/svro \u2014 Updated via fleetbo sql sync
305
+ export {}
306
+ declare global {
307
+ type FleetboTables = ${R};
308
+ const Fleetbo: typeof import('@fleetbo/svro')['Fleetbo'];
309
+ const FleetboUI: typeof import('@fleetbo/svro')['FleetboUI'];
310
+ }
311
+ `;m.writeFileSync(e,g)}H(t),f(`[Fleetbo] Schema synced successfully (${h.length} collection(s)).`),n&&f("\u2192 [Dry-run] Schema is valid.")}catch(c){F(`Error during synchronization: ${c.message}`),process.exit(1)}}else F('Unknown command. Usage: "npx @fleetbo/svro init --keyApp=xxx --token=yyy"'),process.exit(1)}te().catch(t=>{F(`Fleetbo CLI Error: ${t.message}`),process.exit(1)});
package/dist/index.js ADDED
@@ -0,0 +1,319 @@
1
+ var va=Object.defineProperty;var P=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(r){throw t=[r],r}};var Or=(n,e)=>{for(var t in e)va(n,t,{get:e[t],enumerable:!0})};var Nr,Dr=P(()=>{Nr=()=>{}});function ka(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}function v(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Fr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function Vr(){return typeof window<"u"||tn()}function tn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Hr(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Wr(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Br(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function $r(){let n=v();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function jr(){try{return typeof indexedDB=="object"}catch{return!1}}function zr(){return new Promise((n,e)=>{try{let t=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{e(i.error?.message||"")}}catch(t){e(t)}})}function Na(n,e){return n.replace(Da,(t,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}function qr(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function K(n,e){if(n===e)return!0;let t=Object.keys(n),r=Object.keys(e);for(let i of t){if(!r.includes(i))return!1;let s=n[i],a=e[i];if(Lr(s)&&Lr(a)){if(!K(s,a))return!1}else if(s!==a)return!1}for(let i of r)if(!t.includes(i))return!1;return!0}function Lr(n){return n!==null&&typeof n=="object"}function ne(n){let e=[];for(let[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function fe(n){let e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){let[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function pe(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function Gr(n,e){let t=new Xt(n,e);return t.subscribe.bind(t)}function La(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Jt(){}function h(n){return n&&n._delegate?n._delegate:n}function Ze(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Kr(n){return(await fetch(n,{credentials:"include"})).ok}var Mr,Aa,Ur,Yt,Sa,Qt,Re,Ra,Ca,Pa,Zt,xr,Qe,en,he,Oa,R,V,Da,Xt,cl,me=P(()=>{Dr();Mr=function(n){let e=[],t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},Aa=function(n){let e=[],t=0,r=0;for(;t<n.length;){let i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){let s=n[t++],a=n[t++],o=n[t++],c=((i&7)<<18|(s&63)<<12|(a&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{let s=n[t++],a=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|a&63)}}return e.join("")},Ur={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){let s=n[i],a=i+1<n.length,o=a?n[i+1]:0,c=i+2<n.length,u=c?n[i+2]:0,d=s>>2,f=(s&3)<<4|o>>4,m=(o&15)<<2|u>>6,F=u&63;c||(F=64,a||(m=64)),r.push(t[d],t[f],t[m],t[F])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Mr(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Aa(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){let s=t[n.charAt(i++)],o=i<n.length?t[n.charAt(i)]:0;++i;let u=i<n.length?t[n.charAt(i)]:64;++i;let f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||o==null||u==null||f==null)throw new Yt;let m=s<<2|o>>4;if(r.push(m),u!==64){let F=o<<4&240|u>>2;if(r.push(F),f!==64){let te=u<<6&192|f;r.push(te)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},Yt=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},Sa=function(n){let e=Mr(n);return Ur.encodeByteArray(e,!0)},Qt=function(n){return Sa(n).replace(/\./g,"")},Re=function(n){try{return Ur.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};Ra=()=>ka().__FIREBASE_DEFAULTS__,Ca=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Pa=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&Re(n[1]);return e&&JSON.parse(e)},Zt=()=>{try{return Nr()||Ra()||Ca()||Pa()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},xr=n=>Zt()?.emulatorHosts?.[n],Qe=()=>Zt()?.config,en=n=>Zt()?.[`_${n}`];he=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}};Oa="FirebaseError",R=class n extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Oa,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,V.prototype.create)}},V=class{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?Na(s,r):"Error",o=`${this.serviceName}: ${a} (${i}).`;return new R(i,o,r)}};Da=/\{\$([^}]+)}/g;Xt=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");La(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Jt),i.error===void 0&&(i.error=Jt),i.complete===void 0&&(i.complete=Jt);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};cl=14400*1e3;});function Ma(n){return n===re?void 0:n}function Ua(n){return n.instantiationMode==="EAGER"}var D,re,nn,Ce,et=P(()=>{me();D=class{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};re="[DEFAULT]";nn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let r=new he;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Ua(e))try{this.getOrInitializeService({instanceIdentifier:re})}catch{}for(let[t,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=re){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=re){return this.instances.has(e)}getOptions(e=re){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[s,a]of this.instancesDeferred.entries()){let o=this.normalizeInstanceIdentifier(s);r===o&&a.resolve(i)}return i}onInit(e,t){let r=this.normalizeInstanceIdentifier(t),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Ma(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=re){return this.component?this.component.multipleInstances?e:re:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};Ce=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new nn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}});function Yr(n){rn.forEach(e=>{e.setLogLevel(n)})}function Xr(n,e){for(let t of rn){let r=null;e&&e.level&&(r=Jr[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(i,s,...a)=>{let o=a.map(c=>{if(c==null)return null;if(typeof c=="string")return c;if(typeof c=="number"||typeof c=="boolean")return c.toString();if(c instanceof Error)return c.message;try{return JSON.stringify(c)}catch{return null}}).filter(c=>c).join(" ");s>=(r??i.logLevel)&&n({level:p[s].toLowerCase(),message:o,args:a,type:i.name})}}}var rn,p,Jr,xa,Fa,Va,ge,tt=P(()=>{rn=[];(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(p||(p={}));Jr={debug:p.DEBUG,verbose:p.VERBOSE,info:p.INFO,warn:p.WARN,error:p.ERROR,silent:p.SILENT},xa=p.INFO,Fa={[p.DEBUG]:"log",[p.VERBOSE]:"log",[p.INFO]:"info",[p.WARN]:"warn",[p.ERROR]:"error"},Va=(n,e,...t)=>{if(e<n.logLevel)return;let r=new Date().toISOString(),i=Fa[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},ge=class{constructor(e){this.name=e,this._logLevel=xa,this._logHandler=Va,this._userLogHandler=null,rn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in p))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Jr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,p.DEBUG,...e),this._logHandler(this,p.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,p.VERBOSE,...e),this._logHandler(this,p.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,p.INFO,...e),this._logHandler(this,p.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,p.WARN,...e),this._logHandler(this,p.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,p.ERROR,...e),this._logHandler(this,p.ERROR,...e)}}});function Wa(){return Qr||(Qr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ba(){return Zr||(Zr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}function $a(n){let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",a)},s=()=>{t(L(n.result)),i()},a=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",a)});return e.then(t=>{t instanceof IDBCursor&&ei.set(t,n)}).catch(()=>{}),cn.set(e,n),e}function ja(n){if(an.has(n))return;let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",a),n.removeEventListener("abort",a)},s=()=>{t(),i()},a=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",a),n.addEventListener("abort",a)});an.set(n,e)}function ni(n){on=n(on)}function za(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let r=n.call(nt(this),e,...t);return ti.set(r,e.sort?e.sort():[e]),L(r)}:Ba().includes(n)?function(...e){return n.apply(nt(this),e),L(ei.get(this))}:function(...e){return L(n.apply(nt(this),e))}}function qa(n){return typeof n=="function"?za(n):(n instanceof IDBTransaction&&ja(n),Ha(n,Wa())?new Proxy(n,on):n)}function L(n){if(n instanceof IDBRequest)return $a(n);if(sn.has(n))return sn.get(n);let e=qa(n);return e!==n&&(sn.set(n,e),cn.set(e,n)),e}var Ha,Qr,Zr,ei,an,ti,sn,cn,on,nt,un=P(()=>{Ha=(n,e)=>e.some(t=>n instanceof t);ei=new WeakMap,an=new WeakMap,ti=new WeakMap,sn=new WeakMap,cn=new WeakMap;on={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return an.get(n);if(e==="objectStoreNames")return n.objectStoreNames||ti.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return L(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};nt=n=>cn.get(n)});function ii(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){let a=indexedDB.open(n,e),o=L(a);return r&&a.addEventListener("upgradeneeded",c=>{r(L(a.result),c.oldVersion,c.newVersion,L(a.transaction),c)}),t&&a.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),o.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}function ri(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(ln.get(e))return ln.get(e);let t=e.replace(/FromIndex$/,""),r=e!==t,i=Ka.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ga.includes(t)))return;let s=async function(a,...o){let c=this.transaction(a,i?"readwrite":"readonly"),u=c.store;return r&&(u=u.index(o.shift())),(await Promise.all([u[t](...o),i&&c.done]))[0]};return ln.set(e,s),s}var Ga,Ka,ln,si=P(()=>{un();un();Ga=["get","getKey","getAll","getAllKeys","count"],Ka=["put","add","delete","clear"],ln=new Map;ni(n=>({...n,get:(e,t,r)=>ri(e,t)||n.get(e,t,r),has:(e,t)=>!!ri(e,t)||n.has(e,t)}))});function Ja(n){return n.getComponent()?.type==="VERSION"}function pn(n,e){try{n.container.addComponent(e)}catch(t){H.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Ao(n,e){n.container.addOrOverwriteComponent(e)}function ie(n){let e=n.name;if(Ie.has(e))return H.debug(`There were multiple attempts to register component ${e}.`),!1;Ie.set(e,n);for(let t of J.values())pn(t,n);for(let t of _e.values())pn(t,n);return!0}function Ne(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function So(n,e,t=Pe){Ne(n,e).clearInstance(t)}function In(n){return n.options!==void 0}function li(n){return In(n)?!1:"authIdToken"in n||"appCheckToken"in n||"releaseOnDeref"in n||"automaticDataCollectionEnabled"in n}function I(n){return n==null?!1:n.settings!==void 0}function ko(){Ie.clear()}function ai(n,e){let t=Re(n.split(".")[1]);if(t===null){console.error(`FirebaseServerApp ${e} is invalid: second part could not be parsed.`);return}if(JSON.parse(t).exp===void 0){console.error(`FirebaseServerApp ${e} is invalid: expiration claim could not be parsed`);return}let i=JSON.parse(t).exp*1e3,s=new Date().getTime();i-s<=0&&console.error(`FirebaseServerApp ${e} is invalid: the token has expired.`)}function di(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let r={name:Pe,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw k.create("bad-app-name",{appName:String(i)});if(t||(t=Qe()),!t)throw k.create("no-options");let s=J.get(i);if(s){if(K(t,s.options)&&K(r,s.config))return s;throw k.create("duplicate-app",{appName:i})}let a=new Ce(i);for(let c of Ie.values())a.addComponent(c);let o=new it(t,r,a);return J.set(i,o),o}function Co(n,e={}){if(Vr()&&!tn())throw k.create("invalid-server-app-environment");let t,r=e||{};if(n&&(In(n)?t=n.options:li(n)?r=n:t=n),r.automaticDataCollectionEnabled===void 0&&(r.automaticDataCollectionEnabled=!0),t||(t=Qe()),!t)throw k.create("no-options");let i={...r,...t};i.releaseOnDeref!==void 0&&delete i.releaseOnDeref;let s=d=>[...d].reduce((f,m)=>Math.imul(31,f)+m.charCodeAt(0)|0,0);if(r.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw k.create("finalization-registry-not-supported",{});let a=""+s(JSON.stringify(i)),o=_e.get(a);if(o)return o.incRefCount(r.releaseOnDeref),o;let c=new Ce(a);for(let d of Ie.values())c.addComponent(d);let u=new mn(t,r,a,c);return _e.set(a,u),u}function En(n=Pe){let e=J.get(n);if(!e&&n===Pe&&Qe())return di();if(!e)throw k.create("no-app",{appName:n});return e}function Po(){return Array.from(J.values())}async function hi(n){let e=!1,t=n.name;J.has(t)?(e=!0,J.delete(t)):_e.has(t)&&n.decRefCount()<=0&&(_e.delete(t),e=!0),e&&(await Promise.all(n.container.getProviders().map(r=>r.delete())),n.isDeleted=!0)}function M(n,e,t){let r=vo[n]??n;t&&(r+=`-${t}`);let i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){let a=[`Unable to register library "${r}" with version "${e}":`];i&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),H.warn(a.join(" "));return}ie(new D(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function Oo(n,e){if(n!==null&&typeof n!="function")throw k.create("invalid-log-argument");Xr(n,e)}function No(n){Yr(n)}function fi(){return dn||(dn=ii(Do,Lo,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(Oe)}catch(t){console.warn(t)}}}}).catch(n=>{throw k.create("idb-open",{originalErrorMessage:n.message})})),dn}async function Mo(n){try{let t=(await fi()).transaction(Oe),r=await t.objectStore(Oe).get(pi(n));return await t.done,r}catch(e){if(e instanceof R)H.warn(e.message);else{let t=k.create("idb-get",{originalErrorMessage:e?.message});H.warn(t.message)}}}async function oi(n,e){try{let r=(await fi()).transaction(Oe,"readwrite");await r.objectStore(Oe).put(e,pi(n)),await r.done}catch(t){if(t instanceof R)H.warn(t.message);else{let r=k.create("idb-set",{originalErrorMessage:t?.message});H.warn(r.message)}}}function pi(n){return`${n.name}!${n.options.appId}`}function ci(){return new Date().toISOString().substring(0,10)}function Fo(n,e=Uo){let t=[],r=n.slice();for(let i of n){let s=t.find(a=>a.agent===i.agent);if(s){if(s.dates.push(i.date),ui(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ui(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}function ui(n){return Qt(JSON.stringify({version:2,heartbeats:n})).length}function Vo(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;r<n.length;r++)n[r].date<t&&(t=n[r].date,e=r);return e}function Ho(n){ie(new D("platform-logger",e=>new hn(e),"PRIVATE")),ie(new D("heartbeat",e=>new gn(e),"PRIVATE")),M(rt,fn,n),M(rt,fn,"esm2020"),M("fire-js","")}var hn,rt,fn,H,Ya,Xa,Qa,Za,eo,to,no,ro,io,so,ao,oo,co,uo,lo,ho,fo,po,mo,go,_o,Io,Eo,yo,wo,To,bo,Pe,vo,J,_e,Ie,Ro,k,it,mn,se,Do,Lo,Oe,dn,Uo,xo,gn,_n,De=P(()=>{et();tt();me();me();si();hn=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Ja(t)){let r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}};rt="@firebase/app",fn="0.15.1";H=new ge("@firebase/app"),Ya="@firebase/app-compat",Xa="@firebase/analytics-compat",Qa="@firebase/analytics",Za="@firebase/app-check-compat",eo="@firebase/app-check",to="@firebase/auth",no="@firebase/auth-compat",ro="@firebase/database",io="@firebase/data-connect",so="@firebase/database-compat",ao="@firebase/functions",oo="@firebase/functions-compat",co="@firebase/installations",uo="@firebase/installations-compat",lo="@firebase/messaging",ho="@firebase/messaging-compat",fo="@firebase/performance",po="@firebase/performance-compat",mo="@firebase/remote-config",go="@firebase/remote-config-compat",_o="@firebase/storage",Io="@firebase/storage-compat",Eo="@firebase/firestore",yo="@firebase/ai",wo="@firebase/firestore-compat",To="firebase",bo="12.16.0";Pe="[DEFAULT]",vo={[rt]:"fire-core",[Ya]:"fire-core-compat",[Qa]:"fire-analytics",[Xa]:"fire-analytics-compat",[eo]:"fire-app-check",[Za]:"fire-app-check-compat",[to]:"fire-auth",[no]:"fire-auth-compat",[ro]:"fire-rtdb",[io]:"fire-data-connect",[so]:"fire-rtdb-compat",[ao]:"fire-fn",[oo]:"fire-fn-compat",[co]:"fire-iid",[uo]:"fire-iid-compat",[lo]:"fire-fcm",[ho]:"fire-fcm-compat",[fo]:"fire-perf",[po]:"fire-perf-compat",[mo]:"fire-rc",[go]:"fire-rc-compat",[_o]:"fire-gcs",[Io]:"fire-gcs-compat",[Eo]:"fire-fst",[wo]:"fire-fst-compat",[yo]:"fire-vertex","fire-js":"fire-js",[To]:"fire-js-all"};J=new Map,_e=new Map,Ie=new Map;Ro={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},k=new V("app","Firebase",Ro);it=class{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new D("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw k.create("app-deleted",{appName:this._name})}};mn=class extends it{constructor(e,t,r,i){let s=t.automaticDataCollectionEnabled!==void 0?t.automaticDataCollectionEnabled:!0,a={name:r,automaticDataCollectionEnabled:s};if(e.apiKey!==void 0)super(e,a,i);else{let o=e;super(o.options,a,i)}this._serverConfig={automaticDataCollectionEnabled:s,...t},this._serverConfig.authIdToken&&ai(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&ai(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,typeof FinalizationRegistry<"u"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,M(rt,fn,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){hi(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw k.create("server-app-deleted")}};se=bo;Do="firebase-heartbeat-database",Lo=1,Oe="firebase-heartbeat-store",dn=null;Uo=1024,xo=30,gn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new _n(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{let t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=ci();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats.length>xo){let i=Vo(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){H.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";let e=ci(),{heartbeatsToSend:t,unsentEntries:r}=Fo(this._heartbeatsCache.heartbeats),i=Qt(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return H.warn(e),""}}};_n=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return jr()?zr().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let t=await Mo(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return oi(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return oi(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}};Ho("")});var mi={};Or(mi,{FirebaseError:()=>R,SDK_VERSION:()=>se,_DEFAULT_ENTRY_NAME:()=>Pe,_addComponent:()=>pn,_addOrOverwriteComponent:()=>Ao,_apps:()=>J,_clearComponents:()=>ko,_components:()=>Ie,_getProvider:()=>Ne,_isFirebaseApp:()=>In,_isFirebaseServerApp:()=>I,_isFirebaseServerAppSettings:()=>li,_registerComponent:()=>ie,_removeServiceInstance:()=>So,_serverApps:()=>_e,deleteApp:()=>hi,getApp:()=>En,getApps:()=>Po,initializeApp:()=>di,initializeServerApp:()=>Co,onLog:()=>Oo,registerVersion:()=>M,setLogLevel:()=>No});var Wo,Bo,gi=P(()=>{De();De();Wo="firebase",Bo="12.16.0";M(Wo,Bo,"app")});function $o(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}}function Bi(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}function jo(n,...e){dt.logLevel<=p.WARN&&dt.warn(`Auth (${se}): ${n}`,...e)}function ot(n,...e){dt.logLevel<=p.ERROR&&dt.error(`Auth (${se}): ${n}`,...e)}function S(n,...e){throw tr(n,...e)}function A(n,...e){return tr(n,...e)}function er(n,e,t){let r={...Zn(),[e]:t};return new V("auth","Firebase",r).create(e,{appName:n.name})}function w(n){return er(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Se(n,e,t){let r=t;if(!(e instanceof r))throw r.name!==e.constructor.name&&S(n,"argument-error"),er(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function tr(n,...e){if(typeof n!="string"){let t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return ji.create(n,...e)}function l(n,e,...t){if(!n)throw tr(e,...t)}function U(n){let e="INTERNAL ASSERTION FAILED: "+n;throw ot(e),new Error(e)}function $(n,e){n||U(e)}function He(){return typeof self<"u"&&self.location?.href||""}function nr(){return _i()==="http:"||_i()==="https:"}function _i(){return typeof self<"u"&&self.location?.protocol||null}function zo(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(nr()||Wr()||"connection"in navigator)?navigator.onLine:!0}function qo(){if(typeof navigator>"u")return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}function rr(n,e){$(n.emulator,"Emulator should always be set here");let{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}function g(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function _(n,e,t,r,i={}){return qi(n,i,async()=>{let s={},a={};r&&(e==="GET"?a=r:s={body:JSON.stringify(r)});let o=ne({...a,key:n.config.apiKey}).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);let u={method:e,headers:c,...s};return Hr()||(u.referrerPolicy="strict-origin-when-cross-origin"),n.emulatorConfig&&Ze(n.emulatorConfig.host)&&(u.credentials="include"),ht.fetch()(await Gi(n,n.config.apiHost,t,o),u)})}async function qi(n,e,t){n._canInitEmulator=!1;let r={...Go,...e};try{let i=new kn(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();let a=await s.json();if("needConfirmation"in a)throw Me(n,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{let o=s.ok?a.errorMessage:a.error.message,[c,u]=o.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Me(n,"credential-already-in-use",a);if(c==="EMAIL_EXISTS")throw Me(n,"email-already-in-use",a);if(c==="USER_DISABLED")throw Me(n,"user-disabled",a);let d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw er(n,d,u);S(n,d)}}catch(i){if(i instanceof R)throw i;S(n,"network-request-failed",{message:String(i)})}}async function G(n,e,t,r,i={}){let s=await _(n,e,t,r,i);return"mfaPendingCredential"in s&&S(n,"multi-factor-auth-required",{_serverResponse:s}),s}async function Gi(n,e,t,r){let i=`${e}${t}?${r}`,s=n,a=s.config.emulator?rr(n.config,i):`${n.config.apiScheme}://${i}`;return Ko.includes(t)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(a).toString():a}function Yo(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}function Me(n,e,t){let r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);let i=A(n,e,r);return i.customData._tokenResponse=t,i}function Ii(n){return n!==void 0&&n.getResponse!==void 0}function Ei(n){return n!==void 0&&n.enterprise!==void 0}async function Xo(n){return(await _(n,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function Ki(n,e){return _(n,"GET","/v2/recaptchaConfig",g(n,e))}async function Qo(n,e){return _(n,"POST","/v1/accounts:delete",e)}async function Zo(n,e){return _(n,"POST","/v1/accounts:update",e)}async function pt(n,e){return _(n,"POST","/v1/accounts:lookup",e)}function Ue(n){if(n)try{let e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function Ji(n,e=!1){return h(n).getIdToken(e)}async function ir(n,e=!1){let t=h(n),r=await t.getIdToken(e),i=xt(r);l(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");let s=typeof i.firebase=="object"?i.firebase:void 0,a=s?.sign_in_provider;return{claims:i,token:r,authTime:Ue(yn(i.auth_time)),issuedAtTime:Ue(yn(i.iat)),expirationTime:Ue(yn(i.exp)),signInProvider:a||null,signInSecondFactor:s?.sign_in_second_factor||null}}function yn(n){return Number(n)*1e3}function xt(n){let[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ot("JWT malformed, contained fewer than 3 sections"),null;try{let i=Re(t);return i?JSON.parse(i):(ot("Failed to decode base64 JWT payload"),null)}catch(i){return ot("Caught error parsing JWT payload as JSON",i?.toString()),null}}function yi(n){let e=xt(n);return l(e,"internal-error"),l(typeof e.exp<"u","internal-error"),l(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function j(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof R&&ec(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function ec({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}async function Be(n){let e=n.auth,t=await n.getIdToken(),r=await j(n,pt(e,{idToken:t}));l(r?.users.length,e,"internal-error");let i=r.users[0];n._notifyReloadListener(i);let s=i.providerUserInfo?.length?Yi(i.providerUserInfo):[],a=tc(n.providerData,s),o=n.isAnonymous,c=!(n.email&&i.passwordHash)&&!a?.length,u=o?c:!1,d={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new We(i.createdAt,i.lastLoginAt),isAnonymous:u};Object.assign(n,d)}async function sr(n){let e=h(n);await Be(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function tc(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Yi(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function nc(n,e){let t=await qi(n,{},async()=>{let r=ne({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,a=await Gi(n,i,"/v1/token",`key=${s}`),o=await n._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";let c={method:"POST",headers:o,body:r};return n.emulatorConfig&&Ze(n.emulatorConfig.host)&&(c.credentials="include"),ht.fetch()(a,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function rc(n,e){return _(n,"POST","/v2/accounts:revokeToken",g(n,e))}function Y(n,e){l(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}function W(n){$(n instanceof Function,"Expected a class definition");let e=wi.get(n);return e?($(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,wi.set(n,e),e)}function ct(n,e,t){return`firebase:${n}:${e}:${t}`}function Ti(n){let e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(es(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Xi(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(ns(e))return"Blackberry";if(rs(e))return"Webos";if(Qi(e))return"Safari";if((e.includes("chrome/")||Zi(e))&&!e.includes("edge/"))return"Chrome";if(ts(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Xi(n=v()){return/firefox\//i.test(n)}function Qi(n=v()){let e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Zi(n=v()){return/crios\//i.test(n)}function es(n=v()){return/iemobile/i.test(n)}function ts(n=v()){return/android/i.test(n)}function ns(n=v()){return/blackberry/i.test(n)}function rs(n=v()){return/webos/i.test(n)}function ar(n=v()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function ic(n=v()){return ar(n)&&!!window.navigator?.standalone}function sc(){return $r()&&document.documentMode===10}function is(n=v()){return ar(n)||ts(n)||rs(n)||ns(n)||/windows phone/i.test(n)||es(n)}function ss(n,e=[]){let t;switch(n){case"Browser":t=Ti(v());break;case"Worker":t=`${Ti(v())}-${n}`;break;default:t=n}let r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${se}/${r}`}async function ac(n,e={}){return _(n,"GET","/v2/passwordPolicy",g(n,e))}function E(n){return h(n)}function cc(n){Je=n}function or(n){return Je.loadJS(n)}function uc(){return Je.recaptchaV2Script}function lc(){return Je.recaptchaEnterpriseScript}function dc(){return Je.gapiScript}function as(n){return`__${n}${Math.floor(Math.random()*1e6)}`}function pc(n){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<n;r++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}async function Le(n,e,t,r=!1,i=!1){let s=new $e(n),a;if(i)a=Fe;else try{a=await s.verify(t)}catch{a=await s.verify(t,!0)}let o={...e};if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in o){let c=o.phoneEnrollmentInfo.phoneNumber,u=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:u,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){let c=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return r?Object.assign(o,{captchaResp:a}):Object.assign(o,{captchaResponse:a}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Q(n,e,t,r,i){if(i==="EMAIL_PASSWORD_PROVIDER")if(n._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let s=await Le(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let a=await Le(n,e,t,t==="getOobCode");return r(n,a)}else return Promise.reject(s)});else if(i==="PHONE_PROVIDER")if(n._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let s=await Le(n,e,t);return r(n,s).catch(async a=>{if(n._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&(a.code==="auth/missing-recaptcha-token"||a.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${t} flow.`);let o=await Le(n,e,t,!1,!0);return r(n,o)}return Promise.reject(a)})}else{let s=await Le(n,e,t,!1,!0);return r(n,s)}else return Promise.reject(i+" provider is not supported.")}async function os(n){let e=E(n),t=await Ki(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new ft(t);e.tenantId==null?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.isAnyProviderEnabled()&&new $e(e).verify()}function cr(n,e){let t=Ne(n,"auth");if(t.isInitialized()){let i=t.getImmediate(),s=t.getOptions();if(K(s,e??{}))return i;S(i,"already-initialized")}return t.initialize({options:e})}function gc(n,e){let t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(W);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function ur(n,e,t){let r=E(n);l(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");let i=!!t?.disableWarnings,s=cs(e),{host:a,port:o}=_c(e),c=o===null?"":`:${o}`,u={url:`${s}//${a}${c}/`},d=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){l(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),l(K(u,r.config.emulator)&&K(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,Ze(a)?Kr(`${s}//${a}${c}`):i||Ic()}function cs(n){let e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function _c(n){let e=cs(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};let r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let s=i[1];return{host:s,port:vi(r.substr(s.length+1))}}else{let[s,a]=r.split(":");return{host:s,port:vi(a)}}}function vi(n){if(!n)return null;let e=Number(n);return isNaN(e)?null:e}function Ic(){function n(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}async function us(n,e){return _(n,"POST","/v1/accounts:resetPassword",g(n,e))}async function Ec(n,e){return _(n,"POST","/v1/accounts:update",e)}async function yc(n,e){return _(n,"POST","/v1/accounts:signUp",e)}async function wc(n,e){return _(n,"POST","/v1/accounts:update",g(n,e))}async function Tc(n,e){return G(n,"POST","/v1/accounts:signInWithPassword",g(n,e))}async function Ft(n,e){return _(n,"POST","/v1/accounts:sendOobCode",g(n,e))}async function bc(n,e){return Ft(n,e)}async function vc(n,e){return Ft(n,e)}async function Ac(n,e){return Ft(n,e)}async function Sc(n,e){return Ft(n,e)}async function kc(n,e){return G(n,"POST","/v1/accounts:signInWithEmailLink",g(n,e))}async function Rc(n,e){return G(n,"POST","/v1/accounts:signInWithEmailLink",g(n,e))}async function B(n,e){return G(n,"POST","/v1/accounts:signInWithIdp",g(n,e))}async function Ai(n,e){return _(n,"POST","/v1/accounts:sendVerificationCode",g(n,e))}async function Pc(n,e){return G(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,e))}async function Oc(n,e){let t=await G(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,e));if(t.temporaryProof)throw Me(n,"account-exists-with-different-credential",t);return t}async function Dc(n,e){let t={...e,operation:"REAUTH"};return G(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,t),Nc)}function Lc(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Mc(n){let e=fe(pe(n)).link,t=e?fe(pe(e)).deep_link_id:null,r=fe(pe(n)).deep_link_id;return(r?fe(pe(r)).link:null)||r||t||e||n}function ls(n){return ce.parseLink(n)}async function ds(n,e){return G(n,"POST","/v1/accounts:signUp",g(n,e))}function Si(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}async function hs(n){if(I(n.app))return Promise.reject(w(n));let e=E(n);if(await e._initializationPromise,e.currentUser?.isAnonymous)return new N({user:e.currentUser,providerId:null,operationType:"signIn"});let t=await ds(e,{returnSecureToken:!0}),r=await N._fromIdTokenResponse(e,"signIn",t,!0);return await e._updateCurrentUser(r.user),r}function fs(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Un._fromErrorAndOperation(n,s,e,r):s})}function ps(n){return new Set(n.map(({providerId:e})=>e).filter(e=>!!e))}async function ms(n,e){let t=h(n);await Vt(!0,t,e);let{providerUserInfo:r}=await Zo(t.auth,{idToken:await t.getIdToken(),deleteProvider:[e]}),i=ps(r||[]);return t.providerData=t.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(t.phoneNumber=null),await t.auth._persistUserIfCurrent(t),t}async function lr(n,e,t=!1){let r=await j(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return N._forOperation(n,"link",r)}async function Vt(n,e,t){await Be(e);let r=ps(e.providerData),i=n===!1?"provider-already-linked":"no-such-provider";l(r.has(t)===n,e.auth,i)}async function gs(n,e,t=!1){let{auth:r}=n;if(I(r.app))return Promise.reject(w(r));let i="reauthenticate";try{let s=await j(n,fs(r,i,e,n),t);l(s.idToken,r,"internal-error");let a=xt(s.idToken);l(a,r,"internal-error");let{sub:o}=a;return l(n.uid===o,r,"user-mismatch"),N._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&S(r,"user-mismatch"),s}}async function _s(n,e,t=!1){if(I(n.app))return Promise.reject(w(n));let r="signIn",i=await fs(n,r,e),s=await N._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Ye(n,e){return _s(E(n),e)}async function dr(n,e){let t=h(n);return await Vt(!1,t,e.providerId),lr(t,e)}async function hr(n,e){return gs(h(n),e)}async function Fc(n,e){return G(n,"POST","/v1/accounts:signInWithCustomToken",g(n,e))}async function Is(n,e){if(I(n.app))return Promise.reject(w(n));let t=E(n),r=await Fc(t,{token:e,returnSecureToken:!0}),i=await N._fromIdTokenResponse(t,"signIn",r);return await t._updateCurrentUser(i.user),i}function Ht(n,e,t){l(t.url?.length>0,n,"invalid-continue-uri"),l(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),l(typeof t.linkDomain>"u"||t.linkDomain.length>0,n,"invalid-hosting-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.linkDomain=t.linkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(l(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(l(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}async function fr(n){let e=E(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Es(n,e,t){let r=E(n),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};t&&Ht(r,i,t),await Q(r,i,"getOobCode",vc,"EMAIL_PASSWORD_PROVIDER")}async function ys(n,e,t){await us(h(n),{oobCode:e,newPassword:t}).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&fr(n),r})}async function ws(n,e){await wc(h(n),{oobCode:e})}async function pr(n,e){let t=h(n),r=await us(t,{oobCode:e}),i=r.requestType;switch(l(i,t,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":l(r.newEmail,t,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":l(r.mfaInfo,t,"internal-error");default:l(r.email,t,"internal-error")}let s=null;return r.mfaInfo&&(s=ue._fromServerResponse(E(t),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:s},operation:i}}async function Ts(n,e){let{data:t}=await pr(h(n),e);return t.email}async function bs(n,e,t){if(I(n.app))return Promise.reject(w(n));let r=E(n),a=await Q(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ds,"EMAIL_PASSWORD_PROVIDER").catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&fr(n),c}),o=await N._fromIdTokenResponse(r,"signIn",a);return await r._updateCurrentUser(o.user),o}function vs(n,e,t){return I(n.app)?Promise.reject(w(n)):Ye(h(n),q.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&fr(n),r})}async function As(n,e,t){let r=E(n),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(a,o){l(o.handleCodeInApp,r,"argument-error"),o&&Ht(r,a,o)}s(i,t),await Q(r,i,"getOobCode",Ac,"EMAIL_PASSWORD_PROVIDER")}function Ss(n,e){return ce.parseLink(e)?.operation==="EMAIL_SIGNIN"}async function ks(n,e,t){if(I(n.app))return Promise.reject(w(n));let r=h(n),i=q.credentialWithLink(e,t||He());return l(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Ye(r,i)}async function Vc(n,e){return _(n,"POST","/v1/accounts:createAuthUri",g(n,e))}async function Rs(n,e){let t=nr()?He():"http://localhost",r={identifier:e,continueUri:t},{signinMethods:i}=await Vc(h(n),r);return i||[]}async function Cs(n,e){let t=h(n),i={requestType:"VERIFY_EMAIL",idToken:await n.getIdToken()};e&&Ht(t.auth,i,e);let{email:s}=await bc(t.auth,i);s!==n.email&&await n.reload()}async function Ps(n,e,t){let r=h(n),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await n.getIdToken(),newEmail:e};t&&Ht(r.auth,s,t);let{email:a}=await Sc(r.auth,s);a!==n.email&&await n.reload()}async function Hc(n,e){return _(n,"POST","/v1/accounts:update",e)}async function Os(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;let r=h(n),s={idToken:await r.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},a=await j(r,Hc(r.auth,s));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;let o=r.providerData.find(({providerId:c})=>c==="password");o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function Ns(n,e){let t=h(n);return I(t.auth.app)?Promise.reject(w(t.auth)):Ls(t,e,null)}function Ds(n,e){return Ls(h(n),null,e)}async function Ls(n,e,t){let{auth:r}=n,s={idToken:await n.getIdToken(),returnSecureToken:!0};e&&(s.email=e),t&&(s.password=t);let a=await j(n,Ec(r,s));await n._updateTokensIfNecessary(a,!0)}function Wc(n){if(!n)return null;let{providerId:e}=n,t=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},r=n.isNewUser||n.kind==="identitytoolkit#SignupNewUserResponse";if(!e&&n?.idToken){let i=xt(n.idToken)?.firebase?.sign_in_provider;if(i){let s=i!=="anonymous"&&i!=="custom"?i:null;return new Z(r,s)}}if(!e)return null;switch(e){case"facebook.com":return new Vn(r,t);case"github.com":return new Hn(r,t);case"google.com":return new Wn(r,t);case"twitter.com":return new Bn(r,t,n.screenName||null);case"custom":case"anonymous":return new Z(r,null);default:return new Z(r,e,t)}}function Ms(n){let{user:e,_tokenResponse:t}=n;return e.isAnonymous&&!t?{providerId:null,isNewUser:!1,profile:null}:Wc(t)}function Us(n,e){return h(n).setPersistence(e)}function xs(n){return os(n)}async function Fs(n,e){return E(n).validatePassword(e)}function mr(n,e,t,r){return h(n).onIdTokenChanged(e,t,r)}function gr(n,e,t){return h(n).beforeAuthStateChanged(e,t)}function Vs(n,e,t,r){return h(n).onAuthStateChanged(e,t,r)}function Hs(n){h(n).useDeviceLanguage()}function Ws(n,e){return h(n).updateCurrentUser(e)}function Bs(n){return h(n).signOut()}function $s(n,e){return E(n).revokeAccessToken(e)}async function js(n){return h(n).delete()}function zs(n,e){let t=h(n),r=e;return l(e.customData.operationType,t,"argument-error"),l(r.customData._serverResponse?.mfaPendingCredential,t,"argument-error"),$n._fromError(t,r)}function ki(n,e){return _(n,"POST","/v2/accounts/mfaEnrollment:start",g(n,e))}function Bc(n,e){return _(n,"POST","/v2/accounts/mfaEnrollment:finalize",g(n,e))}function $c(n,e){return _(n,"POST","/v2/accounts/mfaEnrollment:start",g(n,e))}function jc(n,e){return _(n,"POST","/v2/accounts/mfaEnrollment:finalize",g(n,e))}function zc(n,e){return _(n,"POST","/v2/accounts/mfaEnrollment:withdraw",g(n,e))}function qs(n){let e=h(n);return wn.has(e)||wn.set(e,jn._fromUser(e)),wn.get(e)}function Tn(n){let e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),t=RegExp(`${e}=([^;]+)`);return document.cookie.match(t)?.[1]??null}function bn(n){return`${window.location.protocol==="http:"?"__dev_":"__HOST-"}FIREBASE_${n.split(":")[3]}`}function Jc(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}function Bt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}function y(){return window}function Yc(n){y().location.href=n}function Ir(){return typeof y().WorkerGlobalScope<"u"&&typeof y().importScripts=="function"}async function Xc(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Qc(){return navigator?.serviceWorker?.controller||null}function Zc(){return Ir()?self:null}function $t(n,e){return n.transaction([Pt],e?"readwrite":"readonly").objectStore(Pt)}function tu(){let n=indexedDB.deleteDatabase(Ks);return new le(n).toPromise()}function Ys(){let n=indexedDB.open(Ks,eu);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{let r=n.result;try{r.createObjectStore(Pt,{keyPath:Js})}catch(i){t(i)}}),n.addEventListener("success",async()=>{let r=n.result;r.objectStoreNames.contains(Pt)?e(r):(r.close(),await tu(),e(await Ys()))})})}async function Ri(n,e,t){let r=$t(n,!0).put({[Js]:e,value:t});return new le(r).toPromise()}async function nu(n,e){let t=$t(n,!1).get(e),r=await new le(t).toPromise();return r===void 0?null:r.value}function Ci(n,e){let t=$t(n,!0).delete(e);return new le(t).toPromise()}function Pi(n,e){return _(n,"POST","/v2/accounts/mfaSignIn:start",g(n,e))}function su(n,e){return _(n,"POST","/v2/accounts/mfaSignIn:finalize",g(n,e))}function au(n,e){return _(n,"POST","/v2/accounts/mfaSignIn:finalize",g(n,e))}function cu(n){return n.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n)}function lu(){let n=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}n=()=>e(),window.addEventListener("load",n)}).catch(e=>{throw n&&window.removeEventListener("load",n),e})}async function Xs(n,e,t){if(I(n.app))return Promise.reject(w(n));let r=E(n),i=await jt(r,e,h(t));return new je(i,s=>Ye(r,s))}async function Qs(n,e,t){let r=h(n);await Vt(!1,r,"phone");let i=await jt(r.auth,e,h(t));return new je(i,s=>dr(r,s))}async function Zs(n,e,t){let r=h(n);if(I(r.auth.app))return Promise.reject(w(r.auth));let i=await jt(r.auth,e,h(t));return new je(i,s=>hr(r,s))}async function jt(n,e,t){if(!n._getRecaptchaConfig())try{await os(n)}catch{console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(typeof e=="string"?r={phoneNumber:e}:r=e,"session"in r){let i=r.session;if("phoneNumber"in r){l(i.type==="enroll",n,"internal-error");let s={idToken:i.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}};return(await Q(n,s,"mfaSmsEnrollment",async(u,d)=>{if(d.phoneEnrollmentInfo.captchaResponse===Fe){l(t?.type===Ve,u,"argument-error");let f=await An(u,d,t);return ki(u,f)}return ki(u,d)},"PHONE_PROVIDER").catch(u=>Promise.reject(u))).phoneSessionInfo.sessionInfo}else{l(i.type==="signin",n,"internal-error");let s=r.multiFactorHint?.uid||r.multiFactorUid;l(s,n,"missing-multi-factor-info");let a={mfaPendingCredential:i.credential,mfaEnrollmentId:s,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}};return(await Q(n,a,"mfaSmsSignIn",async(d,f)=>{if(f.phoneSignInInfo.captchaResponse===Fe){l(t?.type===Ve,d,"argument-error");let m=await An(d,f,t);return Pi(d,m)}return Pi(d,f)},"PHONE_PROVIDER").catch(d=>Promise.reject(d))).phoneResponseInfo.sessionInfo}}else{let i={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"};return(await Q(n,i,"sendVerificationCode",async(c,u)=>{if(u.captchaResponse===Fe){l(t?.type===Ve,c,"argument-error");let d=await An(c,u,t);return Ai(c,d)}return Ai(c,u)},"PHONE_PROVIDER").catch(c=>Promise.reject(c))).sessionInfo}}finally{t?._reset()}}async function ea(n,e){let t=h(n);if(I(t.auth.app))return Promise.reject(w(t.auth));await lr(t,e)}async function An(n,e,t){l(t.type===Ve,n,"argument-error");let r=await t.verify();l(typeof r=="string",n,"argument-error");let i={...e};if("phoneEnrollmentInfo"in i){let s=i.phoneEnrollmentInfo.phoneNumber,a=i.phoneEnrollmentInfo.captchaResponse,o=i.phoneEnrollmentInfo.clientType,c=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:s,recaptchaToken:r,captchaResponse:a,clientType:o,recaptchaVersion:c}}),i}else if("phoneSignInInfo"in i){let s=i.phoneSignInInfo.captchaResponse,a=i.phoneSignInInfo.clientType,o=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:s,clientType:a,recaptchaVersion:o}}),i}else return Object.assign(i,{recaptchaToken:r}),i}function de(n,e){return e?W(e):(l(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}function du(n){return _s(n.auth,new ze(n),n.bypassAuthState)}function hu(n){let{auth:e,user:t}=n;return l(t,e,"internal-error"),gs(t,new ze(n),n.bypassAuthState)}async function fu(n){let{auth:e,user:t}=n;return l(t,e,"internal-error"),lr(t,new ze(n),n.bypassAuthState)}async function ta(n,e,t){if(I(n.app))return Promise.reject(A(n,"operation-not-supported-in-this-environment"));let r=E(n);Se(n,e,O);let i=de(r,t);return new Ae(r,"signInViaPopup",e,i).executeNotNull()}async function na(n,e,t){let r=h(n);if(I(r.auth.app))return Promise.reject(A(r.auth,"operation-not-supported-in-this-environment"));Se(r.auth,e,O);let i=de(r.auth,t);return new Ae(r.auth,"reauthViaPopup",e,i,r).executeNotNull()}async function ra(n,e,t){let r=h(n);Se(r.auth,e,O);let i=de(r.auth,t);return new Ae(r.auth,"linkViaPopup",e,i,r).executeNotNull()}async function gu(n,e){let t=sa(e),r=ia(n);if(!await r._isAvailable())return!1;let i=await r._get(t)==="true";return await r._remove(t),i}async function yr(n,e){return ia(n)._set(sa(e),"true")}function _u(n,e){ut.set(n._key(),e)}function ia(n){return W(n._redirectPersistence)}function sa(n){return ct(mu,n.config.apiKey,n.name)}function aa(n,e,t){return Iu(n,e,t)}async function Iu(n,e,t){if(I(n.app))return Promise.reject(w(n));let r=E(n);Se(n,e,O),await r._initializationPromise;let i=de(r,t);return await yr(i,r),i._openRedirect(r,e,"signInViaRedirect")}function oa(n,e,t){return Eu(n,e,t)}async function Eu(n,e,t){let r=h(n);if(Se(r.auth,e,O),I(r.auth.app))return Promise.reject(w(r.auth));await r.auth._initializationPromise;let i=de(r.auth,t);await yr(i,r.auth);let s=await da(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)}function ca(n,e,t){return yu(n,e,t)}async function yu(n,e,t){let r=h(n);Se(r.auth,e,O),await r.auth._initializationPromise;let i=de(r.auth,t);await Vt(!1,r,e.providerId),await yr(i,r.auth);let s=await da(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)}async function ua(n,e){return await E(n)._initializationPromise,la(n,e,!1)}async function la(n,e,t=!1){if(I(n.app))return Promise.reject(w(n));let r=E(n),i=de(r,e),a=await new Kn(r,i,t).execute();return a&&!t&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,e)),a}async function da(n){let e=Bt(`${n.uid}:::`);return n._redirectEventId=e,await n.auth._setRedirectUser(n),await n.auth._persistUserIfCurrent(n),e}function Oi(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function ha({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Tu(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ha(n);default:return!1}}async function bu(n,e={}){return _(n,"GET","/v1/projects",e)}async function Su(n){if(n.config.emulator)return;let{authorizedDomains:e}=await bu(n);for(let t of e)try{if(ku(t))return}catch{}S(n,"unauthorized-domain")}function ku(n){let e=He(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){let a=new URL(n);return a.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&a.hostname===r}if(!Au.test(t))return!1;if(vu.test(n))return r===n;let i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}function Ni(){let n=y().___jsl;if(n?.H){for(let e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function Cu(n){return new Promise((e,t)=>{function r(){Ni(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ni(),t(A(n,"network-request-failed"))},timeout:Ru.get()})}if(y().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(y().gapi?.load)r();else{let i=as("iframefcb");return y()[i]=()=>{gapi.load?r():t(A(n,"network-request-failed"))},or(`${dc()}?onload=${i}`).catch(s=>t(s))}}).catch(e=>{throw lt=null,e})}function Pu(n){return lt=lt||Cu(n),lt}function Uu(n){let e=n.config;l(e.authDomain,n,"auth-domain-config-required");let t=e.emulator?rr(e,Du):`https://${n.config.authDomain}/${Nu}`,r={apiKey:e.apiKey,appName:n.name,v:se},i=Mu.get(n.config.apiHost);i&&(r.eid=i);let s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ne(r).slice(1)}`}async function xu(n){let e=await Pu(n),t=y().gapi;return l(t,n,"internal-error"),e.open({where:document.body,url:Uu(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Lu,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});let a=A(n,"network-request-failed"),o=y().setTimeout(()=>{s(a)},Ou.get());function c(){y().clearTimeout(o),i(r)}r.ping(c).then(c,()=>{s(a)})}))}function $u(n,e,t,r=Vu,i=Hu){let s=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString(),o="",c={...Fu,width:r.toString(),height:i.toString(),top:s,left:a},u=v().toLowerCase();t&&(o=Zi(u)?Wu:t),Xi(u)&&(e=e||Bu,c.scrollbars="yes");let d=Object.entries(c).reduce((m,[F,te])=>`${m}${F}=${te},`,"");if(ic(u)&&o!=="_self")return ju(e||"",o),new Lt(null);let f=window.open(e||"",o,d);l(f,n,"popup-blocked");try{f.focus()}catch{}return new Lt(f)}function ju(n,e){let t=document.createElement("a");t.href=n,t.target=e;let r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}async function Di(n,e,t,r,i,s){l(n.config.authDomain,n,"auth-domain-config-required"),l(n.config.apiKey,n,"invalid-api-key");let a={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:se,eventId:i};if(e instanceof O){e.setDefaultLanguage(n.languageCode),a.providerId=e.providerId||"",qr(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(let[d,f]of Object.entries(s||{}))a[d]=f}if(e instanceof ee){let d=e.getScopes().filter(f=>f!=="");d.length>0&&(a.scopes=d.join(","))}n.tenantId&&(a.tid=n.tenantId);let o=a;for(let d of Object.keys(o))o[d]===void 0&&delete o[d];let c=await n._getAppCheckToken(),u=c?`#${Gu}=${encodeURIComponent(c)}`:"";return`${Ku(n)}?${ne(o).slice(1)}${u}`}function Ku({config:n}){return n.emulator?rr(n,qu):`https://${n.authDomain}/${zu}`}function at(n){return typeof n>"u"||n?.length===0}function Ju(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Yu(n){ie(new D("auth",(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:o}=r.options;l(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});let c={apiKey:a,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ss(n)},u=new On(r,i,s,c);return gc(u,t),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),ie(new D("auth-internal",e=>{let t=E(e.getProvider("auth").getImmediate());return(r=>new Qn(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),M(Li,Mi,Ju(n)),M(Li,Mi,"esm2020")}function fa(n=En()){let e=Ne(n,"auth");if(e.isInitialized())return e.getImmediate();let t=cr(n,{popupRedirectResolver:wr,persistence:[Er,_r,Wt]}),r=en("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){let s=new URL(r,location.origin);if(location.origin===s.origin){let a=Zu(s.toString());gr(t,a,()=>a(t.currentUser)),mr(t,o=>a(o))}}let i=xr("auth");return i&&ur(t,`http://${i}`),t}function el(){return document.getElementsByTagName("head")?.[0]??document}var xi,Fi,Vi,Hi,Wi,$i,Zn,ji,zi,dt,ae,ht,Go,Ko,Jo,kn,ft,Rn,We,xe,X,wi,mt,gt,_t,Cn,oc,Pn,On,It,Je,hc,fc,st,Nn,Dn,Ln,Mn,mc,Fe,bi,$e,z,Ee,Cc,x,Nc,oe,ce,q,O,ee,Et,ye,we,Te,Uc,yt,xc,wt,be,N,Un,ue,xn,Fn,Z,Tt,Vn,Hn,Wn,Bn,bt,$n,jn,wn,vt,At,qc,Gc,St,_r,Kc,kt,Gs,Rt,Wt,Ct,zn,Ks,eu,Pt,Js,le,ru,iu,Ot,Er,vn,ou,qn,Gn,Ve,uu,Nt,je,ve,ze,Dt,pu,Ae,mu,ut,Kn,wu,Jn,vu,Au,Ru,lt,Ou,Nu,Du,Lu,Mu,Fu,Vu,Hu,Wu,Bu,Lt,zu,qu,Gu,Sn,Yn,wr,Mt,Xn,qe,Ge,Ut,Ke,Li,Mi,Qn,Xu,Qu,Ui,Zu,pa=P(()=>{De();me();tt();et();xi={PHONE:"phone",TOTP:"totp"},Fi={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},Vi={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},Hi={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},Wi={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};$i=$o,Zn=Bi,ji=new V("auth","Firebase",Bi()),zi={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_PASSWORD:"auth/missing-password",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type",INVALID_HOSTING_LINK_DOMAIN:"auth/invalid-hosting-link-domain"};dt=new ge("@firebase/auth");ae=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,$(t>e,"Short delay should be less than long delay!"),this.isMobile=Fr()||Br()}get(){return zo()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};ht=class{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;U("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;U("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;U("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};Go={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};Ko=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Jo=new ae(3e4,6e4);kn=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(A(this.auth,"network-request-failed")),Jo.get())})}};ft=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Yo(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}};Rn=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){let t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}else{this.errorBackoff=3e4;let r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};We=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ue(this.lastLoginAt),this.creationTime=Ue(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};xe=class n{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){l(e.idToken,"internal-error"),l(typeof e.idToken<"u","internal-error"),l(typeof e.refreshToken<"u","internal-error");let t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):yi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){l(e.length!==0,"internal-error");let t=yi(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(l(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:r,refreshToken:i,expiresIn:s}=await nc(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){let{refreshToken:r,accessToken:i,expirationTime:s}=t,a=new n;return r&&(l(typeof r=="string","internal-error",{appName:e}),a.refreshToken=r),i&&(l(typeof i=="string","internal-error",{appName:e}),a.accessToken=i),s&&(l(typeof s=="number","internal-error",{appName:e}),a.expirationTime=s),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new n,this.toJSON())}_performRefresh(){return U("not implemented")}};X=class n{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new Rn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new We(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await j(this,this.stsTokenManager.getToken(this.auth,e));return l(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return ir(this,e)}reload(){return sr(this)}_assign(e){this!==e&&(l(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new n({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){l(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Be(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(I(this.auth.app))return Promise.reject(w(this.auth));let e=await this.getIdToken();return await j(this,Qo(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){let r=t.displayName??void 0,i=t.email??void 0,s=t.phoneNumber??void 0,a=t.photoURL??void 0,o=t.tenantId??void 0,c=t._redirectEventId??void 0,u=t.createdAt??void 0,d=t.lastLoginAt??void 0,{uid:f,emailVerified:m,isAnonymous:F,providerData:te,stsTokenManager:Pr}=t;l(f&&Pr,e,"internal-error");let Ta=xe.fromJSON(this.name,Pr);l(typeof f=="string",e,"internal-error"),Y(r,e.name),Y(i,e.name),l(typeof m=="boolean",e,"internal-error"),l(typeof F=="boolean",e,"internal-error"),Y(s,e.name),Y(a,e.name),Y(o,e.name),Y(c,e.name),Y(u,e.name),Y(d,e.name);let Kt=new n({uid:f,auth:e,email:i,emailVerified:m,displayName:r,isAnonymous:F,photoURL:a,phoneNumber:s,tenantId:o,stsTokenManager:Ta,createdAt:u,lastLoginAt:d});return te&&Array.isArray(te)&&(Kt.providerData=te.map(ba=>({...ba}))),c&&(Kt._redirectEventId=c),Kt}static async _fromIdTokenResponse(e,t,r=!1){let i=new xe;i.updateFromServerResponse(t);let s=new n({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Be(s),s}static async _fromGetAccountInfoResponse(e,t,r){let i=t.users[0];l(i.localId!==void 0,"internal-error");let s=i.providerUserInfo!==void 0?Yi(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!s?.length,o=new xe;o.updateFromIdToken(r);let c=new n({uid:i.localId,auth:e,stsTokenManager:o,isAnonymous:a}),u={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new We(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(c,u),c}};wi=new Map;mt=class{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}};mt.type="NONE";gt=mt;_t=class n{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;let{config:i,name:s}=this.auth;this.fullUserKey=ct(this.userKey,i.apiKey,s),this.fullPersistenceKey=ct("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){let t=await pt(this.auth,{idToken:e}).catch(()=>{});return t?X._fromGetAccountInfoResponse(this.auth,t,e):null}return X._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new n(W(gt),e,r);let i=(await Promise.all(t.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u),s=i[0]||W(gt),a=ct(r,e.config.apiKey,e.name),o=null;for(let u of t)try{let d=await u._get(a);if(d){let f;if(typeof d=="string"){let m=await pt(e,{idToken:d}).catch(()=>{});if(!m)break;f=await X._fromGetAccountInfoResponse(e,m,d)}else f=X._fromJSON(e,d);u!==s&&(o=f),s=u;break}}catch{}let c=i.filter(u=>u._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new n(s,e,r):(s=c[0],o&&await s._set(a,o.toJSON()),await Promise.all(t.map(async u=>{if(u!==s)try{await u._remove(a)}catch{}})),new n(s,e,r))}};Cn=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=s=>new Promise((a,o)=>{try{let c=e(s);a(c)}catch(c){o(c)}});r.onAbort=t,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(let i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}};oc=6,Pn=class{constructor(e){let t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??oc,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}};On=class{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new It(this),this.idTokenSubscription=new It(this),this.beforeStateQueue=new Cn(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=ji,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=W(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await _t.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await pt(this,{idToken:e}),r=await X._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(I(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),r=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let s=this.redirectUser?._redirectEventId,a=r?._redirectEventId,o=await this.tryRedirectSignIn(e);(!s||s===a)&&o?.user&&(r=o.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return l(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Be(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=qo()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(I(this.app))return Promise.reject(w(this));let t=e?h(e):null;return t&&l(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&l(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return I(this.app)?Promise.reject(w(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return I(this.app)?Promise.reject(w(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(W(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=await ac(this),t=new Pn(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new V("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await rc(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&W(e)||this._popupRedirectResolver;l(t,this,"argument-error"),this.redirectPersistenceManager=await _t.create(this,[W(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};let s=typeof t=="function"?t:t.next.bind(t),a=!1,o=this._isInitialized?Promise.resolve():this._initializationPromise;if(l(o,this,"internal-error"),o.then(()=>{a||s(this.currentUser)}),typeof t=="function"){let c=e.addObserver(t,r,i);return()=>{a=!0,c()}}else{let c=e.addObserver(t);return()=>{a=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return l(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ss(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);let r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(I(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&jo(`Error while retrieving App Check token: ${e.error}`),e?.token}};It=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=Gr(t=>this.observer=t)}get next(){return l(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};Je={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};hc=500,fc=6e4,st=1e12,Nn=class{constructor(e){this.auth=e,this.counter=st,this._widgets=new Map}render(e,t){let r=this.counter;return this._widgets.set(r,new Mn(e,this.auth.name,t||{})),this.counter++,r}reset(e){let t=e||st;this._widgets.get(t)?.delete(),this._widgets.delete(t)}getResponse(e){let t=e||st;return this._widgets.get(t)?.getResponse()||""}async execute(e){let t=e||st;return this._widgets.get(t)?.execute(),""}},Dn=class{constructor(){this.enterprise=new Ln}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}},Ln=class{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}},Mn=class{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let i=typeof e=="string"?document.getElementById(e):e;l(i,"argument-error",{appName:t}),this.container=i,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=pc(50);let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},fc)},hc))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}};mc="recaptcha-enterprise",Fe="NO_RECAPTCHA",bi="onFirebaseAuthREInstanceReady",$e=class n{constructor(e){this.type=mc,this.auth=E(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(a,o)=>{Ki(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)o(new Error("recaptcha Enterprise site key undefined"));else{let u=new ft(c);return s.tenantId==null?s._agentRecaptchaConfig=u:s._tenantRecaptchaConfigs[s.tenantId]=u,a(u.siteKey)}}).catch(c=>{o(c)})})}function i(s,a,o){let c=window.grecaptcha;Ei(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(u=>{a(u)}).catch(()=>{a(Fe)})}):o(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new Dn().execute("siteKey",{action:"verify"}):new Promise((s,a)=>{r(this.auth).then(async o=>{if(!t&&Ei(window.grecaptcha)&&n.scriptInjectionDeferred)await n.scriptInjectionDeferred.promise,i(o,s,a);else{if(typeof window>"u"){a(new Error("RecaptchaVerifier is only supported in browser"));return}let c=lc();c.length!==0&&(c+=o+`&onload=${bi}`),n.scriptInjectionDeferred=new he,window[bi]=()=>{n.scriptInjectionDeferred?.resolve()},or(c).then(()=>n.scriptInjectionDeferred?.promise).then(()=>{i(o,s,a)}).catch(u=>{a(u)})}}).catch(o=>{a(o)})})}};$e.scriptInjectionDeferred=null;z=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return U("not implemented")}_getIdTokenResponse(e){return U("not implemented")}_linkToIdToken(e,t){return U("not implemented")}_getReauthenticationResolver(e){return U("not implemented")}};Ee=class n extends z{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new n(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new n(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":let t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Q(e,t,"signInWithPassword",Tc,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return kc(e,{email:this._email,oobCode:this._password});default:S(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":let r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Q(e,r,"signUpPassword",yc,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Rc(e,{idToken:t,email:this._email,oobCode:this._password});default:S(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};Cc="http://localhost",x=class n extends z{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):S("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=t;if(!r||!i)return null;let a=new n(r,i);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){let t=this.buildRequest();return B(e,t)}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,B(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,B(e,t)}buildRequest(){let e={requestUri:Cc,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ne(t)}return e}};Nc={USER_NOT_FOUND:"user-not-found"};oe=class n extends z{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new n({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new n({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return Pc(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return Oc(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return Dc(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return!r&&!t&&!i&&!s?null:new n({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s})}};ce=class n{constructor(e){let t=fe(pe(e)),r=t.apiKey??null,i=t.oobCode??null,s=Lc(t.mode??null);l(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t=Mc(e);try{return new n(t)}catch{return null}}};q=class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(e,t){return Ee._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=ce.parseLink(t);return l(r,"argument-error"),Ee._fromEmailAndCode(e,r.code,r.tenantId)}};q.PROVIDER_ID="password";q.EMAIL_PASSWORD_SIGN_IN_METHOD="password";q.EMAIL_LINK_SIGN_IN_METHOD="emailLink";O=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};ee=class extends O{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Et=class n extends ee{static credentialFromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return l("providerId"in t&&"signInMethod"in t,"argument-error"),x._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return l(e.idToken||e.accessToken,"argument-error"),x._fromParams({...e,providerId:this.providerId,signInMethod:this.providerId})}static credentialFromResult(e){return n.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return n.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:a,providerId:o}=e;if(!r&&!i&&!t&&!s||!o)return null;try{return new n(o)._credential({idToken:t,accessToken:r,nonce:a,pendingToken:s})}catch{return null}}};ye=class n extends ee{constructor(){super("facebook.com")}static credential(e){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return n.credentialFromTaggedObject(e)}static credentialFromError(e){return n.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return n.credential(e.oauthAccessToken)}catch{return null}}};ye.FACEBOOK_SIGN_IN_METHOD="facebook.com";ye.PROVIDER_ID="facebook.com";we=class n extends ee{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return n.credentialFromTaggedObject(e)}static credentialFromError(e){return n.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return n.credential(t,r)}catch{return null}}};we.GOOGLE_SIGN_IN_METHOD="google.com";we.PROVIDER_ID="google.com";Te=class n extends ee{constructor(){super("github.com")}static credential(e){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return n.credentialFromTaggedObject(e)}static credentialFromError(e){return n.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return n.credential(e.oauthAccessToken)}catch{return null}}};Te.GITHUB_SIGN_IN_METHOD="github.com";Te.PROVIDER_ID="github.com";Uc="http://localhost",yt=class n extends z{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){let t=this.buildRequest();return B(e,t)}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,B(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,B(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=t;return!r||!i||!s||r!==i?null:new n(r,s)}static _create(e,t){return new n(e,t)}buildRequest(){return{requestUri:Uc,returnSecureToken:!0,pendingToken:this.pendingToken}}};xc="saml.",wt=class n extends O{constructor(e){l(e.startsWith(xc),"argument-error"),super(e)}static credentialFromResult(e){return n.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return n.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=yt.fromJSON(e);return l(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return yt._create(r,t)}catch{return null}}};be=class n extends ee{constructor(){super("twitter.com")}static credential(e,t){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return n.credentialFromTaggedObject(e)}static credentialFromError(e){return n.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return n.credential(t,r)}catch{return null}}};be.TWITTER_SIGN_IN_METHOD="twitter.com";be.PROVIDER_ID="twitter.com";N=class n{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){let s=await X._fromIdTokenResponse(e,r,i),a=Si(r);return new n({user:s,providerId:a,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);let i=Si(r);return new n({user:e,providerId:i,_tokenResponse:r,operationType:t})}};Un=class n extends R{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,n.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new n(e,t,r,i)}};ue=class{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?xn._fromServerResponse(e,t):"totpInfo"in t?Fn._fromServerResponse(e,t):S(e,"internal-error")}},xn=class n extends ue{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new n(t)}},Fn=class n extends ue{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new n(t)}};Z=class{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}},Tt=class extends Z{constructor(e,t,r,i){super(e,t,r),this.username=i}},Vn=class extends Z{constructor(e,t){super(e,"facebook.com",t)}},Hn=class extends Tt{constructor(e,t){super(e,"github.com",t,typeof t?.login=="string"?t?.login:null)}},Wn=class extends Z{constructor(e,t){super(e,"google.com",t)}},Bn=class extends Tt{constructor(e,t,r){super(e,"twitter.com",t,r)}};bt=class n{constructor(e,t,r){this.type=e,this.credential=t,this.user=r}static _fromIdtoken(e,t){return new n("enroll",e,t)}static _fromMfaPendingCredential(e){return new n("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return n._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(e.multiFactorSession?.idToken)return n._fromIdtoken(e.multiFactorSession.idToken)}return null}};$n=class n{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){let r=E(e),i=t.customData._serverResponse,s=(i.mfaInfo||[]).map(o=>ue._fromServerResponse(r,o));l(i.mfaPendingCredential,r,"internal-error");let a=bt._fromMfaPendingCredential(i.mfaPendingCredential);return new n(a,s,async o=>{let c=await o._process(r,a);delete i.mfaInfo,delete i.mfaPendingCredential;let u={...i,idToken:c.idToken,refreshToken:c.refreshToken};switch(t.operationType){case"signIn":let d=await N._fromIdTokenResponse(r,t.operationType,u);return await r._updateCurrentUser(d.user),d;case"reauthenticate":return l(t.user,r,"internal-error"),N._forOperation(t.user,t.operationType,u);default:S(r,"internal-error")}})}async resolveSignIn(e){let t=e;return this.signInResolver(t)}};jn=class n{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(r=>ue._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new n(e)}async getSession(){return bt._fromIdtoken(await this.user.getIdToken(),this.user)}async enroll(e,t){let r=e,i=await this.getSession(),s=await j(this.user,r._process(this.user.auth,i,t));return await this.user._updateTokensIfNecessary(s),this.user.reload()}async unenroll(e){let t=typeof e=="string"?e:e.uid,r=await this.user.getIdToken();try{let i=await j(this.user,zc(this.user.auth,{idToken:r,mfaEnrollmentId:t}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==t),await this.user._updateTokensIfNecessary(i),await this.user.reload()}catch(i){throw i}}},wn=new WeakMap;vt="__sak";At=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(vt,"1"),this.storage.removeItem(vt),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};qc=1e3,Gc=10,St=class extends At{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=is(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((a,o,c)=>{this.notifyListeners(a,c)});return}let r=e.key;t?this.detachListener():this.stopPolling();let i=()=>{let a=this.storage.getItem(r);!t&&this.localCache[r]===a||this.notifyListeners(r,a)},s=this.storage.getItem(r);sc()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Gc):i()}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},qc)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}};St.type="LOCAL";_r=St;Kc=1e3;kt=class{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(typeof window===void 0)return e;let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set("finalTarget",e),t}async _isAvailable(){return typeof isSecureContext=="boolean"&&!isSecureContext||typeof navigator>"u"||typeof document>"u"?!1:navigator.cookieEnabled??!0}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=bn(e);return window.cookieStore?(await window.cookieStore.get(t))?.value:Tn(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let r=bn(e);document.cookie=`${r}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,t){if(!this._isAvailable())return;let r=bn(e);if(window.cookieStore){let o=(u=>{let d=u.changed.find(m=>m.name===r);d&&t(d.value),u.deleted.find(m=>m.name===r)&&t(null)}),c=()=>window.cookieStore.removeEventListener("change",o);return this.listenerUnsubscribes.set(t,c),window.cookieStore.addEventListener("change",o)}let i=Tn(r),s=setInterval(()=>{let o=Tn(r);o!==i&&(t(o),i=o)},Kc),a=()=>clearInterval(s);this.listenerUnsubscribes.set(t,a)}_removeListener(e,t){let r=this.listenerUnsubscribes.get(t);r&&(r(),this.listenerUnsubscribes.delete(t))}};kt.type="COOKIE";Gs=kt;Rt=class extends At{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}};Rt.type="SESSION";Wt=Rt;Ct=class n{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;let r=new n(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let t=e,{eventId:r,eventType:i,data:s}=t.data,a=this.handlersMap[i];if(!a?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});let o=Array.from(a).map(async u=>u(t.origin,s)),c=await Jc(o);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};Ct.receivers=[];zn=class{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){let i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,a;return new Promise((o,c)=>{let u=Bt("",20);i.port1.start();let d=setTimeout(()=>{c(new Error("unsupported_event"))},r);a={messageChannel:i,onMessage(f){let m=f;if(m.data.eventId===u)switch(m.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),o(m.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}};Ks="firebaseLocalStorageDb",eu=1,Pt="firebaseLocalStorage",Js="fbase_key",le=class{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}};ru=800,iu=3,Ot=class{constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise?this.dbPromise:(this.dbPromise=Ys(),this.dbPromise.catch(()=>{this.dbPromise=null}),this.dbPromise)}async _withRetries(e){let t=0;for(;;)try{let r=await this._openDb();return await e(r)}catch(r){if(t++>iu)throw r;this.dbPromise&&((await this.dbPromise).close(),this.dbPromise=null)}}async initializeServiceWorkerMessaging(){return Ir()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ct._getInstance(Zc()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await Xc(),!this.activeServiceWorker)return;this.sender=new zn(this.activeServiceWorker);let e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Qc()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return indexedDB?(await this._withRetries(async e=>{await Ri(e,vt,"1"),await Ci(e,vt)}),!0):!1}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Ri(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(r=>nu(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Ci(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(i=>{let s=$t(i,!1).getAll();return new le(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];let t=[],r=new Set;if(e.length!==0)for(let{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(let i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),ru)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}};Ot.type="LOCAL";Er=Ot;vn=as("rcb"),ou=new ae(3e4,6e4),qn=class{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!y().grecaptcha?.render}load(e,t=""){return l(cu(t),e,"argument-error"),this.shouldResolveImmediately(t)&&Ii(y().grecaptcha)?Promise.resolve(y().grecaptcha):new Promise((r,i)=>{let s=y().setTimeout(()=>{i(A(e,"network-request-failed"))},ou.get());y()[vn]=()=>{y().clearTimeout(s),delete y()[vn];let o=y().grecaptcha;if(!o||!Ii(o)){i(A(e,"internal-error"));return}let c=o.render;o.render=(u,d)=>{let f=c(u,d);return this.counter++,f},this.hostLanguage=t,r(o)};let a=`${uc()}?${ne({onload:vn,render:"explicit",hl:t})}`;or(a).catch(()=>{clearTimeout(s),i(A(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!y().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};Gn=class{async load(e){return new Nn(e)}clearedOneInstance(){}};Ve="recaptcha",uu={theme:"light",type:"image"},Nt=class{constructor(e,t,r={...uu}){this.parameters=r,this.type=Ve,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=E(e),this.isInvisible=this.parameters.size==="invisible",l(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");let i=typeof t=="string"?document.getElementById(t):t;l(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Gn:new qn,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha(),r=t.getResponse(e);return r||new Promise(i=>{let s=a=>{a&&(this.tokenChangeListeners.delete(s),i(a))};this.tokenChangeListeners.add(s),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){l(!this.parameters.sitekey,this.auth,"argument-error"),l(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),l(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(r=>r(t)),typeof e=="function")e(t);else if(typeof e=="string"){let r=y()[e];typeof r=="function"&&r(t)}}}assertNotDestroyed(){l(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){l(nr()&&!Ir(),this.auth,"internal-error"),await lu(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=await Xo(this.auth);l(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return l(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};je=class{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=oe._fromVerification(this.verificationId,e);return this.onConfirmation(t)}};ve=class n{constructor(e){this.providerId=n.PROVIDER_ID,this.auth=E(e)}verifyPhoneNumber(e,t){return jt(this.auth,e,h(t))}static credential(e,t){return oe._fromVerification(e,t)}static credentialFromResult(e){let t=e;return n.credentialFromTaggedObject(t)}static credentialFromError(e){return n.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?oe._fromTokenResponse(t,r):null}};ve.PROVIDER_ID="phone";ve.PHONE_SIGN_IN_METHOD="phone";ze=class extends z{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return B(e,this._buildIdpRequest())}_linkToIdToken(e,t){return B(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return B(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}};Dt=class{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:a,type:o}=e;if(a){this.reject(a);return}let c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(c))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return du;case"linkViaPopup":case"linkViaRedirect":return fu;case"reauthViaPopup":case"reauthViaRedirect":return hu;default:S(this.auth,"internal-error")}}resolve(e){$(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){$(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};pu=new ae(2e3,1e4);Ae=class n extends Dt{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return l(e,this.auth,"internal-error"),e}async onExecution(){$(this.filter.length===1,"Popup operations only handle one event");let e=Bt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(A(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(A(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(A(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,pu.get())};e()}};Ae.currentPopupAction=null;mu="pendingRedirect",ut=new Map,Kn=class extends Dt{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ut.get(this.auth._key());if(!e){try{let r=await gu(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ut.set(this.auth._key(),e)}return this.bypassAuthState||ut.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};wu=600*1e3,Jn=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Tu(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!ha(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(A(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=wu&&this.cachedEventUids.clear(),this.cachedEventUids.has(Oi(e))}saveEventToCache(e){this.cachedEventUids.add(Oi(e)),this.lastProcessedEventTime=Date.now()}};vu=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Au=/^https?/;Ru=new ae(3e4,6e4);lt=null;Ou=new ae(5e3,15e3),Nu="__/auth/iframe",Du="emulator/auth/iframe",Lu={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Mu=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);Fu={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Vu=500,Hu=600,Wu="_blank",Bu="http://localhost",Lt=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};zu="__/auth/handler",qu="emulator/auth/handler",Gu=encodeURIComponent("fac");Sn="webStorageSupport",Yn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Wt,this._completeRedirectFn=la,this._overrideRedirectResult=_u}async _openPopup(e,t,r,i){$(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");let s=await Di(e,t,r,He(),i);return $u(e,s,Bt())}async _openRedirect(e,t,r,i){await this._originValidation(e);let s=await Di(e,t,r,He(),i);return Yc(s),new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):($(s,"If manager is not set, promise should be"),s)}let r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){let t=await xu(e),r=new Jn(e);return t.register("authEvent",i=>(l(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Sn,{type:Sn},i=>{let s=i?.[0]?.[Sn];s!==void 0&&t(!!s),S(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Su(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return is()||Qi()||ar()}},wr=Yn,Mt=class{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return U("unexpected MultiFactorSessionType")}}},Xn=class n extends Mt{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new n(e)}_finalizeEnroll(e,t,r){return Bc(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return su(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},qe=class{constructor(){}static assertion(e){return Xn._fromCredential(e)}};qe.FACTOR_ID="phone";Ge=class{static assertionForEnrollment(e,t){return Ut._fromSecret(e,t)}static assertionForSignIn(e,t){return Ut._fromEnrollmentId(e,t)}static async generateSecret(e){let t=e;l(typeof t.user?.auth<"u","internal-error");let r=await $c(t.user.auth,{idToken:t.credential,totpEnrollmentInfo:{}});return Ke._fromStartTotpMfaEnrollmentResponse(r,t.user.auth)}};Ge.FACTOR_ID="totp";Ut=class n extends Mt{constructor(e,t,r){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=r}static _fromSecret(e,t){return new n(t,void 0,e)}static _fromEnrollmentId(e,t){return new n(t,e)}async _finalizeEnroll(e,t,r){return l(typeof this.secret<"u",e,"argument-error"),jc(e,{idToken:t,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,t){l(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");let r={verificationCode:this.otp};return au(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r})}},Ke=class n{constructor(e,t,r,i,s,a,o){this.sessionInfo=a,this.auth=o,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=s}static _fromStartTotpMfaEnrollmentResponse(e,t){return new n(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){let r=!1;return(at(e)||at(t))&&(r=!0),r&&(at(e)&&(e=this.auth.currentUser?.email||"unknownuser"),at(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};Li="@firebase/auth",Mi="1.13.3";Qn=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){l(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};Xu=300,Qu=en("authIdTokenMaxAge")||Xu,Ui=null,Zu=n=>async e=>{let t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Qu)return;let i=t?.token;Ui!==i&&(Ui=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};cc({loadJS(n){return new Promise((e,t)=>{let r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{let s=A("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",el().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Yu("Browser")});var ma=P(()=>{pa();De();me();tt();et()});var zt={};Or(zt,{ActionCodeOperation:()=>Wi,ActionCodeURL:()=>ce,AuthCredential:()=>z,AuthErrorCodes:()=>zi,EmailAuthCredential:()=>Ee,EmailAuthProvider:()=>q,FacebookAuthProvider:()=>ye,FactorId:()=>xi,GithubAuthProvider:()=>Te,GoogleAuthProvider:()=>we,OAuthCredential:()=>x,OAuthProvider:()=>Et,OperationType:()=>Hi,PhoneAuthCredential:()=>oe,PhoneAuthProvider:()=>ve,PhoneMultiFactorGenerator:()=>qe,ProviderId:()=>Fi,RecaptchaVerifier:()=>Nt,SAMLAuthProvider:()=>wt,SignInMethod:()=>Vi,TotpMultiFactorGenerator:()=>Ge,TotpSecret:()=>Ke,TwitterAuthProvider:()=>be,applyActionCode:()=>ws,beforeAuthStateChanged:()=>gr,browserCookiePersistence:()=>Gs,browserLocalPersistence:()=>_r,browserPopupRedirectResolver:()=>wr,browserSessionPersistence:()=>Wt,checkActionCode:()=>pr,confirmPasswordReset:()=>ys,connectAuthEmulator:()=>ur,createUserWithEmailAndPassword:()=>bs,debugErrorMap:()=>$i,deleteUser:()=>js,fetchSignInMethodsForEmail:()=>Rs,getAdditionalUserInfo:()=>Ms,getAuth:()=>fa,getIdToken:()=>Ji,getIdTokenResult:()=>ir,getMultiFactorResolver:()=>zs,getRedirectResult:()=>ua,inMemoryPersistence:()=>gt,indexedDBLocalPersistence:()=>Er,initializeAuth:()=>cr,initializeRecaptchaConfig:()=>xs,isSignInWithEmailLink:()=>Ss,linkWithCredential:()=>dr,linkWithPhoneNumber:()=>Qs,linkWithPopup:()=>ra,linkWithRedirect:()=>ca,multiFactor:()=>qs,onAuthStateChanged:()=>Vs,onIdTokenChanged:()=>mr,parseActionCodeURL:()=>ls,prodErrorMap:()=>Zn,reauthenticateWithCredential:()=>hr,reauthenticateWithPhoneNumber:()=>Zs,reauthenticateWithPopup:()=>na,reauthenticateWithRedirect:()=>oa,reload:()=>sr,revokeAccessToken:()=>$s,sendEmailVerification:()=>Cs,sendPasswordResetEmail:()=>Es,sendSignInLinkToEmail:()=>As,setPersistence:()=>Us,signInAnonymously:()=>hs,signInWithCredential:()=>Ye,signInWithCustomToken:()=>Is,signInWithEmailAndPassword:()=>vs,signInWithEmailLink:()=>ks,signInWithPhoneNumber:()=>Xs,signInWithPopup:()=>ta,signInWithRedirect:()=>aa,signOut:()=>Bs,unlink:()=>ms,updateCurrentUser:()=>Ws,updateEmail:()=>Ns,updatePassword:()=>Ds,updatePhoneNumber:()=>ea,updateProfile:()=>Os,useDeviceLanguage:()=>Hs,validatePassword:()=>Fs,verifyBeforeUpdateEmail:()=>Ps,verifyPasswordResetCode:()=>Ts});var qt=P(()=>{ma()});var tl={apiKey:"AIzaSyAC5ROxI3bnIO1DyNflMhFRrtnR-45p4RE",authDomain:"myapp-259bf.firebaseapp.com",projectId:"myapp-259bf"},Tr=null,Gt=null;async function Xe(){return typeof window>"u"?null:(Tr||(Tr=(async()=>{let{initializeApp:n,getApps:e}=await Promise.resolve().then(()=>(gi(),mi)),{getAuth:t,signInAnonymously:r,onAuthStateChanged:i}=await Promise.resolve().then(()=>(qt(),zt)),s=e().length?e()[0]:n(tl);if(Gt=t(s),!await new Promise(o=>{let c=i(Gt,u=>{c(),o(u)})}))try{await r(Gt)}catch(o){console.warn("[Fleetbo Auth] Anonymous session created in offline mode or delayed:",o.message)}return Gt})()),Tr)}async function ga(){try{let n=await Xe();return!n||!n.currentUser?null:await n.currentUser.getIdToken()}catch(n){return console.error("[Fleetbo Auth Debug]",n),null}}async function _a(n){let e=await Xe(),{signInWithCustomToken:t}=await Promise.resolve().then(()=>(qt(),zt)),r=await t(e,n);return{uid:r.user.uid,email:r.user.email,isAnonymous:r.user.isAnonymous}}async function Ia(){let n=await Xe(),{signOut:e,signInAnonymously:t}=await Promise.resolve().then(()=>(qt(),zt));return await e(n),await t(n),!0}async function Ea(){let n=await Xe();return!n||!n.currentUser?null:{uid:n.currentUser.uid,email:n.currentUser.email,isAnonymous:n.currentUser.isAnonymous}}async function ya(n=!1){try{let e=await Xe();return!e||!e.currentUser?!1:(await e.currentUser.getIdTokenResult(n)).claims.elog===!0}catch(e){return console.error("[Fleetbo Auth Debug]",e),!1}}var nl="https://fleetbo-gatekeeper.fleetbo.workers.dev/",T=async(n,e=null)=>{try{let t=typeof import.meta<"u"&&import.meta.env?import.meta.env.VITE_FLEETBO_DB_KEY:process.env.VITE_FLEETBO_DB_KEY,r=typeof import.meta<"u"&&import.meta.env?import.meta.env.VITE_FLEETBO_ENTERPRISE_ID:process.env.VITE_FLEETBO_ENTERPRISE_ID,i=n.replace("https://","").split("-")[0]||"add",s={"Content-Type":"application/json"},a=await ga();a&&(s.Authorization=`Bearer ${a}`);let o={targetFunction:i,enterpriseID:r,fleetboDB:t,fleetboTable:e?.fleetboTable||null,jsonData:e?.jsonData||e,data:{fleetboDB:t,enterpriseID:r,...e}},c=await fetch(nl,{method:"POST",headers:s,body:JSON.stringify(o)}),u=await c.json(),d=u.result||u;return{success:c.ok,...d}}catch(t){return{success:!1,error:t.message}}};var br=class extends HTMLElement{static get observedAttributes(){return["value","fallback"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=this.getAttribute("fallback")||"\u2014";this.textContent=e!=null&&e!=="null"&&e!=="undefined"?String(e):t}},vr=class extends HTMLElement{static get observedAttributes(){return["value","invalid-fallback","currency"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=this.getAttribute("invalid-fallback")||"0",r=Number(e);if(e===null||e===""||Number.isNaN(r)){this.textContent=t;return}let i=this.getAttribute("currency");i?this.textContent=new Intl.NumberFormat("fr-FR",{style:"currency",currency:i}).format(r):this.textContent=String(r)}},Ar=class extends HTMLElement{static get observedAttributes(){return["value","label-true","label-false","invalid-fallback"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=this.getAttribute("label-true")||"Oui",r=this.getAttribute("label-false")||"Non",i=this.getAttribute("invalid-fallback")||"Inconnu";e==="true"||e==="1"?this.textContent=t:e==="false"||e==="0"?this.textContent=r:this.textContent=i}},Sr=class extends HTMLElement{static get observedAttributes(){return["value","locale","invalid-fallback"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=this.getAttribute("invalid-fallback")||"Date invalide",r=this.getAttribute("locale")||"fr-FR",i=new Date(e);if(!e||Number.isNaN(i.getTime())){this.textContent=t;return}this.textContent=i.toLocaleDateString(r)}},kr=class extends HTMLElement{static get observedAttributes(){return["value","allowed","invalid-fallback"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=(this.getAttribute("allowed")||"").split(",").map(i=>i.trim()),r=this.getAttribute("invalid-fallback")||"Statut non autoris\xE9";if(!t.includes(e)){this.textContent=r;return}this.textContent=String(e)}},Rr=class extends HTMLElement{static get observedAttributes(){return["value","alt","fallback"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let e=this.getAttribute("value"),t=this.getAttribute("fallback")||"",r=this.getAttribute("alt")||"Media";this.innerHTML="";let i=document.createElement("img");i.src=e&&e!=="null"?e:t,i.alt=r,this.appendChild(i)}},Cr=class extends HTMLElement{static get observedAttributes(){return["table","id","field","orphan-fallback","loading-fallback","malformed-fallback"]}attributeChangedCallback(){this.fetchAndRender()}connectedCallback(){this.fetchAndRender()}async fetchAndRender(){let e=this.getAttribute("table"),t=this.getAttribute("id"),r=this.getAttribute("field")||"name",i=this.getAttribute("orphan-fallback")||"Supprim\xE9",s=this.getAttribute("loading-fallback")||"Chargement...",a=this.getAttribute("malformed-fallback")||"ID invalide";if(!t||typeof t!="string"||t.trim()===""||t==="null"||t==="undefined"){this.textContent=a;return}if(!e){this.textContent=a;return}this.textContent=s;try{let o=await window.Fleetbo.getDoc(e,t);o&&o[r]!==void 0?this.textContent=String(o[r]):o?this.textContent=o.name||o.title||o.label||JSON.stringify(o):this.textContent=i}catch{this.textContent=i}}};if(typeof window<"u"&&typeof customElements<"u"){let n=(e,t)=>{customElements.get(e)||customElements.define(e,t)};n("fleetbo-text",br),n("fleetbo-number",vr),n("fleetbo-toggle",Ar),n("fleetbo-date",Sr),n("fleetbo-enum",kr),n("fleetbo-media",Rr),n("fleetbo-reference",Cr)}var wa={Text:"fleetbo-text",Number:"fleetbo-number",Toggle:"fleetbo-toggle",Date:"fleetbo-date",Enum:"fleetbo-enum",Media:"fleetbo-media",Reference:"fleetbo-reference"};function ke(n){typeof window>"u"&&typeof process<"u"&&process.env}async function C(n){if(n&&n._schemaVersion&&n._schemaData){let e=n._schemaVersion,t=n._schemaData;if(typeof window<"u")try{await fetch("/__fleetbo_sync_schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({schema:t,version:e})})}catch{}else typeof process<"u"&&process.env}return n}var b=n=>`https://${n.toLowerCase()}-jqycakhlxa-uc.a.run.app`,rl=()=>new Proxy({},{get(n,e){let t=String(e);return async(r={})=>{let i=await T(b("call"),{functionName:t,payload:r});return C(i)}}}),il={...wa,call:rl(),add:async(n,e)=>{ke(n);let t=await T(b("add"),{fleetboTable:n,jsonData:e});return C(t)},addWithId:async(n,e,t)=>{ke(n);let r=await T(b("addWithId"),{fleetboTable:n,id:t,jsonData:e});return C(r)},addWithUserId:async(n,e)=>{ke(n);let t=await T(b("addWithUserId"),{fleetboTable:n,jsonData:e});return C(t)},addWithMedia:async(n,e,t,r=null)=>{ke(n);let i=await T(b("addWithMedia"),{fleetboTable:n,jsonData:e,fileBase64:t,fileName:r});return C(i)},delete:async(n,e)=>{let t=await T(b("delete"),{fleetboTable:n,id:e});return C(t)},getDocsG:async n=>{let e=await T(b("getDocsG"),{fleetboTable:n}),t=await C(e);return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},getDocsU:async n=>{let e=await T(b("getDocsU"),{fleetboTable:n}),t=await C(e);return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},getDoc:async(n,e)=>{let t=await T(b("getDoc"),{fleetboTable:n,id:e}),r=await C(t);return r?r.data!==void 0?r.data:r.success===!1?null:r:null},getUser:async()=>await Ea(),getAuthUser:async()=>{let n=await T(b("getAuthUser")),e=await C(n);return e?e.data!==void 0?e.data:e.success===!1?null:e:null},update:async(n,e,t)=>{let r=await T(b("update"),{fleetboTable:n,id:e,...t});return C(r)},join:async(n,e)=>{ke(n),e?.innerJoin?.collection&&ke(e.innerJoin.collection);let t=await T(b("join"),{fleetboTable:n,joinOptions:e}),r=await C(t);return Array.isArray(r)?r:r&&Array.isArray(r.data)?r.data:[]},sendotpsvro:async n=>await T(b("sendOtpSvro"),{email:n}),verifyotpsvro:async(n,e)=>{let t=await T(b("verifyOtpSvro"),{email:n,code:e});if(t.success&&t.customToken)try{return{success:!0,user:await _a(t.customToken)}}catch(r){return{success:!1,error:r.message}}return t},isAuthenticated:async(n=!1)=>await ya(n),logout:async()=>{try{return await Ia(),{success:!0}}catch(n){return{success:!1,error:n.message}}},acl:{grant:async(n,e,t,r="*")=>await T(b("grantAcl"),{targetUserId:n,action:e,resourceTable:t,resourceId:r}),revoke:async(n,e,t,r="*")=>await T(b("revokeAcl"),{targetUserId:n,action:e,resourceTable:t,resourceId:r}),can:async(n,e,t="*")=>{let r=await T(b("checkAcl"),{action:n,resourceTable:e,resourceId:t});return!!(r&&(r.allowed===!0||r.can===!0))}}};typeof window<"u"&&(window.Fleetbo=il,window.FleetboUI=wa);export{il as Fleetbo,wa as FleetboUI};
2
+ /*! Bundled license information:
3
+
4
+ @firebase/util/dist/index.esm.js:
5
+ (**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ *)
21
+ (**
22
+ * @license
23
+ * Copyright 2022 Google LLC
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ *)
37
+ (**
38
+ * @license
39
+ * Copyright 2021 Google LLC
40
+ *
41
+ * Licensed under the Apache License, Version 2.0 (the "License");
42
+ * you may not use this file except in compliance with the License.
43
+ * You may obtain a copy of the License at
44
+ *
45
+ * http://www.apache.org/licenses/LICENSE-2.0
46
+ *
47
+ * Unless required by applicable law or agreed to in writing, software
48
+ * distributed under the License is distributed on an "AS IS" BASIS,
49
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
+ * See the License for the specific language governing permissions and
51
+ * limitations under the License.
52
+ *)
53
+ (**
54
+ * @license
55
+ * Copyright 2019 Google LLC
56
+ *
57
+ * Licensed under the Apache License, Version 2.0 (the "License");
58
+ * you may not use this file except in compliance with the License.
59
+ * You may obtain a copy of the License at
60
+ *
61
+ * http://www.apache.org/licenses/LICENSE-2.0
62
+ *
63
+ * Unless required by applicable law or agreed to in writing, software
64
+ * distributed under the License is distributed on an "AS IS" BASIS,
65
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
+ * See the License for the specific language governing permissions and
67
+ * limitations under the License.
68
+ *)
69
+ (**
70
+ * @license
71
+ * Copyright 2020 Google LLC
72
+ *
73
+ * Licensed under the Apache License, Version 2.0 (the "License");
74
+ * you may not use this file except in compliance with the License.
75
+ * You may obtain a copy of the License at
76
+ *
77
+ * http://www.apache.org/licenses/LICENSE-2.0
78
+ *
79
+ * Unless required by applicable law or agreed to in writing, software
80
+ * distributed under the License is distributed on an "AS IS" BASIS,
81
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82
+ * See the License for the specific language governing permissions and
83
+ * limitations under the License.
84
+ *)
85
+ (**
86
+ * @license
87
+ * Copyright 2025 Google LLC
88
+ *
89
+ * Licensed under the Apache License, Version 2.0 (the "License");
90
+ * you may not use this file except in compliance with the License.
91
+ * You may obtain a copy of the License at
92
+ *
93
+ * http://www.apache.org/licenses/LICENSE-2.0
94
+ *
95
+ * Unless required by applicable law or agreed to in writing, software
96
+ * distributed under the License is distributed on an "AS IS" BASIS,
97
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
98
+ * See the License for the specific language governing permissions and
99
+ * limitations under the License.
100
+ *)
101
+
102
+ @firebase/component/dist/esm/index.esm.js:
103
+ (**
104
+ * @license
105
+ * Copyright 2019 Google LLC
106
+ *
107
+ * Licensed under the Apache License, Version 2.0 (the "License");
108
+ * you may not use this file except in compliance with the License.
109
+ * You may obtain a copy of the License at
110
+ *
111
+ * http://www.apache.org/licenses/LICENSE-2.0
112
+ *
113
+ * Unless required by applicable law or agreed to in writing, software
114
+ * distributed under the License is distributed on an "AS IS" BASIS,
115
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
+ * See the License for the specific language governing permissions and
117
+ * limitations under the License.
118
+ *)
119
+
120
+ @firebase/logger/dist/esm/index.esm.js:
121
+ (**
122
+ * @license
123
+ * Copyright 2017 Google LLC
124
+ *
125
+ * Licensed under the Apache License, Version 2.0 (the "License");
126
+ * you may not use this file except in compliance with the License.
127
+ * You may obtain a copy of the License at
128
+ *
129
+ * http://www.apache.org/licenses/LICENSE-2.0
130
+ *
131
+ * Unless required by applicable law or agreed to in writing, software
132
+ * distributed under the License is distributed on an "AS IS" BASIS,
133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
+ * See the License for the specific language governing permissions and
135
+ * limitations under the License.
136
+ *)
137
+
138
+ @firebase/app/dist/esm/index.esm.js:
139
+ (**
140
+ * @license
141
+ * Copyright 2019 Google LLC
142
+ *
143
+ * Licensed under the Apache License, Version 2.0 (the "License");
144
+ * you may not use this file except in compliance with the License.
145
+ * You may obtain a copy of the License at
146
+ *
147
+ * http://www.apache.org/licenses/LICENSE-2.0
148
+ *
149
+ * Unless required by applicable law or agreed to in writing, software
150
+ * distributed under the License is distributed on an "AS IS" BASIS,
151
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
152
+ * See the License for the specific language governing permissions and
153
+ * limitations under the License.
154
+ *)
155
+ (**
156
+ * @license
157
+ * Copyright 2023 Google LLC
158
+ *
159
+ * Licensed under the Apache License, Version 2.0 (the "License");
160
+ * you may not use this file except in compliance with the License.
161
+ * You may obtain a copy of the License at
162
+ *
163
+ * http://www.apache.org/licenses/LICENSE-2.0
164
+ *
165
+ * Unless required by applicable law or agreed to in writing, software
166
+ * distributed under the License is distributed on an "AS IS" BASIS,
167
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
168
+ * See the License for the specific language governing permissions and
169
+ * limitations under the License.
170
+ *)
171
+ (**
172
+ * @license
173
+ * Copyright 2021 Google LLC
174
+ *
175
+ * Licensed under the Apache License, Version 2.0 (the "License");
176
+ * you may not use this file except in compliance with the License.
177
+ * You may obtain a copy of the License at
178
+ *
179
+ * http://www.apache.org/licenses/LICENSE-2.0
180
+ *
181
+ * Unless required by applicable law or agreed to in writing, software
182
+ * distributed under the License is distributed on an "AS IS" BASIS,
183
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
184
+ * See the License for the specific language governing permissions and
185
+ * limitations under the License.
186
+ *)
187
+
188
+ firebase/app/dist/esm/index.esm.js:
189
+ (**
190
+ * @license
191
+ * Copyright 2020 Google LLC
192
+ *
193
+ * Licensed under the Apache License, Version 2.0 (the "License");
194
+ * you may not use this file except in compliance with the License.
195
+ * You may obtain a copy of the License at
196
+ *
197
+ * http://www.apache.org/licenses/LICENSE-2.0
198
+ *
199
+ * Unless required by applicable law or agreed to in writing, software
200
+ * distributed under the License is distributed on an "AS IS" BASIS,
201
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ * See the License for the specific language governing permissions and
203
+ * limitations under the License.
204
+ *)
205
+
206
+ @firebase/auth/dist/esm/index-d90d2ee5.js:
207
+ (**
208
+ * @license
209
+ * Copyright 2021 Google LLC
210
+ *
211
+ * Licensed under the Apache License, Version 2.0 (the "License");
212
+ * you may not use this file except in compliance with the License.
213
+ * You may obtain a copy of the License at
214
+ *
215
+ * http://www.apache.org/licenses/LICENSE-2.0
216
+ *
217
+ * Unless required by applicable law or agreed to in writing, software
218
+ * distributed under the License is distributed on an "AS IS" BASIS,
219
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
+ * See the License for the specific language governing permissions and
221
+ * limitations under the License.
222
+ *)
223
+ (**
224
+ * @license
225
+ * Copyright 2020 Google LLC
226
+ *
227
+ * Licensed under the Apache License, Version 2.0 (the "License");
228
+ * you may not use this file except in compliance with the License.
229
+ * You may obtain a copy of the License at
230
+ *
231
+ * http://www.apache.org/licenses/LICENSE-2.0
232
+ *
233
+ * Unless required by applicable law or agreed to in writing, software
234
+ * distributed under the License is distributed on an "AS IS" BASIS,
235
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
236
+ * See the License for the specific language governing permissions and
237
+ * limitations under the License.
238
+ *)
239
+ (**
240
+ * @license
241
+ * Copyright 2019 Google LLC
242
+ *
243
+ * Licensed under the Apache License, Version 2.0 (the "License");
244
+ * you may not use this file except in compliance with the License.
245
+ * You may obtain a copy of the License at
246
+ *
247
+ * http://www.apache.org/licenses/LICENSE-2.0
248
+ *
249
+ * Unless required by applicable law or agreed to in writing, software
250
+ * distributed under the License is distributed on an "AS IS" BASIS,
251
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
252
+ * See the License for the specific language governing permissions and
253
+ * limitations under the License.
254
+ *)
255
+ (**
256
+ * @license
257
+ * Copyright 2022 Google LLC
258
+ *
259
+ * Licensed under the Apache License, Version 2.0 (the "License");
260
+ * you may not use this file except in compliance with the License.
261
+ * You may obtain a copy of the License at
262
+ *
263
+ * http://www.apache.org/licenses/LICENSE-2.0
264
+ *
265
+ * Unless required by applicable law or agreed to in writing, software
266
+ * distributed under the License is distributed on an "AS IS" BASIS,
267
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
268
+ * See the License for the specific language governing permissions and
269
+ * limitations under the License.
270
+ *)
271
+ (**
272
+ * @license
273
+ * Copyright 2023 Google LLC
274
+ *
275
+ * Licensed under the Apache License, Version 2.0 (the "License");
276
+ * you may not use this file except in compliance with the License.
277
+ * You may obtain a copy of the License at
278
+ *
279
+ * http://www.apache.org/licenses/LICENSE-2.0
280
+ *
281
+ * Unless required by applicable law or agreed to in writing, software
282
+ * distributed under the License is distributed on an "AS IS" BASIS,
283
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
+ * See the License for the specific language governing permissions and
285
+ * limitations under the License.
286
+ *)
287
+ (**
288
+ * @license
289
+ * Copyright 2025 Google LLC
290
+ *
291
+ * Licensed under the Apache License, Version 2.0 (the "License");
292
+ * you may not use this file except in compliance with the License.
293
+ * You may obtain a copy of the License at
294
+ *
295
+ * http://www.apache.org/licenses/LICENSE-2.0
296
+ *
297
+ * Unless required by applicable law or agreed to in writing, software
298
+ * distributed under the License is distributed on an "AS IS" BASIS,
299
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
300
+ * See the License for the specific language governing permissions and
301
+ * limitations under the License.
302
+ *)
303
+ (**
304
+ * @license
305
+ * Copyright 2020 Google LLC.
306
+ *
307
+ * Licensed under the Apache License, Version 2.0 (the "License");
308
+ * you may not use this file except in compliance with the License.
309
+ * You may obtain a copy of the License at
310
+ *
311
+ * http://www.apache.org/licenses/LICENSE-2.0
312
+ *
313
+ * Unless required by applicable law or agreed to in writing, software
314
+ * distributed under the License is distributed on an "AS IS" BASIS,
315
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
+ * See the License for the specific language governing permissions and
317
+ * limitations under the License.
318
+ *)
319
+ */
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "fleetbo-svro",
3
+ "version": "1.0.0",
4
+ "main": "dist/index.js",
5
+ "type": "module",
6
+ "types": "index.d.ts",
7
+ "bin": {
8
+ "fleetbo-svro": "./dist/cli.cjs",
9
+ "fleetbo": "./dist/cli.cjs",
10
+ "svro": "./dist/cli.cjs"
11
+ },
12
+ "scripts": {
13
+ "build:pkg": "node package-build.js",
14
+ "prepublishOnly": "npm run build:pkg"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "index.d.ts"
19
+ ],
20
+ "dependencies": {
21
+ "firebase": "^12.16.0",
22
+ "unplugin-auto-import": "^0.18.0"
23
+ },
24
+ "devDependencies": {
25
+ "esbuild": "^0.28.1"
26
+ }
27
+ }