@isardsat/editorial-admin 6.0.3 → 6.0.5
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/build/client/assets/{authSlice-5XZo_yNS.js → authSlice-B3Tyl-Nw.js} +181 -181
- package/build/client/assets/button-Da66T3Bb.js +1 -0
- package/build/client/assets/{chevron-down-BMtosYlL.js → chevron-down-D_Gla76b.js} +1 -1
- package/build/client/assets/chunk-KNED5TY2-DAA_sFzt.js +51 -0
- package/build/client/assets/{createLucideIcon-TQsNVzYU.js → createLucideIcon-R2-3a7hN.js} +1 -1
- package/build/client/assets/dashboard-BTu7-8Ba.js +1 -0
- package/build/client/assets/dashboard._collection-MtSHvYYW.js +16 -0
- package/build/client/assets/dashboard._collection._document-CRkC98aa.js +1 -0
- package/build/client/assets/dashboard._collection.new-BFe8yV0Z.js +1 -0
- package/build/client/assets/dashboard._layout-BjRnQPQr.js +66 -0
- package/build/client/assets/dashboard.files-DKh39mcB.js +36 -0
- package/build/client/assets/editorialApi-fQchmMa9.js +1 -0
- package/build/client/assets/entry.client-BGu2H8xv.js +34 -0
- package/build/client/assets/home-C2nWtN4c.js +11 -0
- package/build/client/assets/index-Bd1u2_LZ.js +45 -0
- package/build/client/assets/{index-D4Mj6Lef.js → index-BvKqmqc2.js} +1 -1
- package/build/client/assets/index-C-vcF2DZ.js +9 -0
- package/build/client/assets/{index-DZxX-xes.js → index-DeO5nu0f.js} +2 -2
- package/build/client/assets/{input-D-kT9R-x.js → input-BmmdOdbj.js} +2 -2
- package/build/client/assets/itemForm-CDbHkFXh.css +1 -0
- package/build/client/assets/itemForm-DlRBjBsd.js +90 -0
- package/build/client/assets/manifest-2ff77582.js +1 -0
- package/build/client/assets/react-redux-kbMjYGuQ.js +9 -0
- package/build/client/assets/root-DS7N36v7.css +1 -0
- package/build/client/assets/root-wKvfXBjk.js +1 -0
- package/build/client/assets/{trash-B3lfbu-5.js → trash-wq_ppIxP.js} +1 -1
- package/build/client/assets/{tslib.es6-De9GV7Vy.js → tslib.es6-CDuPK5Eb.js} +1 -1
- package/build/client/assets/utils-DslUJpbf.js +1 -0
- package/build/client/index.html +10 -18
- package/package.json +13 -11
- package/build/client/__spa-fallback.html +0 -13
- package/build/client/admin/index.html +0 -22
- package/build/client/assets/button-V-1j5t4f.js +0 -1
- package/build/client/assets/chunk-KNED5TY2-CXj9yqcQ.js +0 -51
- package/build/client/assets/dashboard-Be6nTcTN.js +0 -1
- package/build/client/assets/dashboard._collection-DppEZSog.js +0 -16
- package/build/client/assets/dashboard._collection._document-DX_V-XK4.js +0 -1
- package/build/client/assets/dashboard._collection.new-CocdSIiG.js +0 -1
- package/build/client/assets/dashboard._layout-Df-C65Il.js +0 -65
- package/build/client/assets/dashboard.files-Doq5nv7_.js +0 -36
- package/build/client/assets/editorialApi-CykQGjTu.js +0 -1
- package/build/client/assets/entry.client-B5Ca3clj.js +0 -34
- package/build/client/assets/home-ZtJfV8P0.js +0 -11
- package/build/client/assets/index-B7e3fQ32.js +0 -9
- package/build/client/assets/index-CMEgjExU.js +0 -46
- package/build/client/assets/itemForm-CcPfHU2b.css +0 -1
- package/build/client/assets/itemForm-ChV6tjGl.js +0 -99
- package/build/client/assets/manifest-a1ca6f8e.js +0 -1
- package/build/client/assets/react-redux-D9l7ZD4q.js +0 -9
- package/build/client/assets/root-BvXgIVX7.js +0 -1
- package/build/client/assets/root-DhulzpWQ.css +0 -1
- package/build/client/assets/utils-BJX_0rcU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_ as pi}from"./tslib.es6-CDuPK5Eb.js";import{u as Da,b as Ma,d as La,e as xa,f as Fa}from"./react-redux-kbMjYGuQ.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
*
|
|
@@ -13,7 +13,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
13
13
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
|
-
*/const
|
|
16
|
+
*/const Ua=()=>{};var os={};/**
|
|
17
17
|
* @license
|
|
18
18
|
* Copyright 2017 Google LLC
|
|
19
19
|
*
|
|
@@ -28,7 +28,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
28
28
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
29
|
* See the License for the specific language governing permissions and
|
|
30
30
|
* limitations under the License.
|
|
31
|
-
*/const
|
|
31
|
+
*/const _r={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2017 Google LLC
|
|
34
34
|
*
|
|
@@ -43,7 +43,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
43
43
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
44
|
* See the License for the specific language governing permissions and
|
|
45
45
|
* limitations under the License.
|
|
46
|
-
*/const f=function(n,e){if(!n)throw
|
|
46
|
+
*/const f=function(n,e){if(!n)throw Je(e)},Je=function(n){return new Error("Firebase Database ("+_r.SDK_VERSION+") INTERNAL ASSERT FAILED: "+n)};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
*
|
|
@@ -58,7 +58,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
58
58
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
59
|
* See the License for the specific language governing permissions and
|
|
60
60
|
* limitations under the License.
|
|
61
|
-
*/const
|
|
61
|
+
*/const gr=function(n){const e=[];let t=0;for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=s&63|128):(s&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(s=65536+((s&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=s&63|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=s&63|128)}return e},Wa=function(n){const e=[];let t=0,i=0;for(;t<n.length;){const s=n[t++];if(s<128)e[i++]=String.fromCharCode(s);else if(s>191&&s<224){const r=n[t++];e[i++]=String.fromCharCode((s&31)<<6|r&63)}else if(s>239&&s<365){const r=n[t++],o=n[t++],a=n[t++],l=((s&7)<<18|(r&63)<<12|(o&63)<<6|a&63)-65536;e[i++]=String.fromCharCode(55296+(l>>10)),e[i++]=String.fromCharCode(56320+(l&1023))}else{const r=n[t++],o=n[t++];e[i++]=String.fromCharCode((s&15)<<12|(r&63)<<6|o&63)}}return e.join("")},_i={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_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let s=0;s<n.length;s+=3){const r=n[s],o=s+1<n.length,a=o?n[s+1]:0,l=s+2<n.length,c=l?n[s+2]:0,u=r>>2,h=(r&3)<<4|a>>4;let d=(a&15)<<2|c>>6,p=c&63;l||(p=64,o||(d=64)),i.push(t[u],t[h],t[d],t[p])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(gr(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Wa(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let s=0;s<n.length;){const r=t[n.charAt(s++)],a=s<n.length?t[n.charAt(s)]:0;++s;const c=s<n.length?t[n.charAt(s)]:64;++s;const h=s<n.length?t[n.charAt(s)]:64;if(++s,r==null||a==null||c==null||h==null)throw new Ba;const d=r<<2|a>>4;if(i.push(d),c!==64){const p=a<<4&240|c>>2;if(i.push(p),h!==64){const _=c<<6&192|h;i.push(_)}}}return i},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)}}};class Ba extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const mr=function(n){const e=gr(n);return _i.encodeByteArray(e,!0)},Kt=function(n){return mr(n).replace(/\./g,"")},Yt=function(n){try{return _i.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright 2017 Google LLC
|
|
64
64
|
*
|
|
@@ -73,7 +73,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
73
73
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
74
|
* See the License for the specific language governing permissions and
|
|
75
75
|
* limitations under the License.
|
|
76
|
-
*/function
|
|
76
|
+
*/function Ha(n){return vr(void 0,n)}function vr(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(const t in e)!e.hasOwnProperty(t)||!Va(t)||(n[t]=vr(n[t],e[t]));return n}function Va(n){return n!=="__proto__"}/**
|
|
77
77
|
* @license
|
|
78
78
|
* Copyright 2022 Google LLC
|
|
79
79
|
*
|
|
@@ -88,7 +88,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
88
88
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
89
89
|
* See the License for the specific language governing permissions and
|
|
90
90
|
* limitations under the License.
|
|
91
|
-
*/function
|
|
91
|
+
*/function $a(){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.")}/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2022 Google LLC
|
|
94
94
|
*
|
|
@@ -103,7 +103,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
103
103
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104
104
|
* See the License for the specific language governing permissions and
|
|
105
105
|
* limitations under the License.
|
|
106
|
-
*/const
|
|
106
|
+
*/const Ga=()=>$a().__FIREBASE_DEFAULTS__,ja=()=>{if(typeof process>"u"||typeof os>"u")return;const n=os.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},za=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Yt(n[1]);return e&&JSON.parse(e)},gi=()=>{try{return Ua()||Ga()||ja()||za()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},yr=n=>{var e,t;return(t=(e=gi())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},qa=n=>{const e=yr(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},Er=()=>{var n;return(n=gi())===null||n===void 0?void 0:n.config},Ir=n=>{var e;return(e=gi())===null||e===void 0?void 0:e[`_${n}`]};/**
|
|
107
107
|
* @license
|
|
108
108
|
* Copyright 2017 Google LLC
|
|
109
109
|
*
|
|
@@ -118,7 +118,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
118
118
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
119
|
* See the License for the specific language governing permissions and
|
|
120
120
|
* limitations under the License.
|
|
121
|
-
*/class
|
|
121
|
+
*/class mi{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}}/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright 2021 Google LLC
|
|
124
124
|
*
|
|
@@ -133,7 +133,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
133
133
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
134
|
* See the License for the specific language governing permissions and
|
|
135
135
|
* limitations under the License.
|
|
136
|
-
*/function
|
|
136
|
+
*/function Ka(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},i=e||"demo-project",s=n.iat||0,r=n.sub||n.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${i}`,aud:i,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},n);return[Kt(JSON.stringify(t)),Kt(JSON.stringify(o)),""].join(".")}/**
|
|
137
137
|
* @license
|
|
138
138
|
* Copyright 2017 Google LLC
|
|
139
139
|
*
|
|
@@ -148,7 +148,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
148
148
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
149
149
|
* See the License for the specific language governing permissions and
|
|
150
150
|
* limitations under the License.
|
|
151
|
-
*/function x(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function
|
|
151
|
+
*/function x(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function vi(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(x())}function Ya(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Qa(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function wr(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Ja(){const n=x();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Xa(){return _r.NODE_ADMIN===!0}function Za(){try{return typeof indexedDB=="object"}catch{return!1}}function el(){return new Promise((n,e)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(i);s.onsuccess=()=>{s.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},s.onupgradeneeded=()=>{t=!1},s.onerror=()=>{var r;e(((r=s.error)===null||r===void 0?void 0:r.message)||"")}}catch(t){e(t)}})}/**
|
|
152
152
|
* @license
|
|
153
153
|
* Copyright 2017 Google LLC
|
|
154
154
|
*
|
|
@@ -163,7 +163,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
163
163
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
164
164
|
* See the License for the specific language governing permissions and
|
|
165
165
|
* limitations under the License.
|
|
166
|
-
*/const
|
|
166
|
+
*/const tl="FirebaseError";class Ee extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=tl,Object.setPrototypeOf(this,Ee.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,kt.prototype.create)}}class kt{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){const i=t[0]||{},s=`${this.service}/${e}`,r=this.errors[e],o=r?nl(r,i):"Error",a=`${this.serviceName}: ${o} (${s}).`;return new Ee(s,a,i)}}function nl(n,e){return n.replace(il,(t,i)=>{const s=e[i];return s!=null?String(s):`<${i}?>`})}const il=/\{\$([^}]+)}/g;/**
|
|
167
167
|
* @license
|
|
168
168
|
* Copyright 2017 Google LLC
|
|
169
169
|
*
|
|
@@ -178,7 +178,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
178
178
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
179
|
* See the License for the specific language governing permissions and
|
|
180
180
|
* limitations under the License.
|
|
181
|
-
*/function
|
|
181
|
+
*/function gt(n){return JSON.parse(n)}function N(n){return JSON.stringify(n)}/**
|
|
182
182
|
* @license
|
|
183
183
|
* Copyright 2017 Google LLC
|
|
184
184
|
*
|
|
@@ -193,7 +193,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
193
193
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
194
194
|
* See the License for the specific language governing permissions and
|
|
195
195
|
* limitations under the License.
|
|
196
|
-
*/const
|
|
196
|
+
*/const Cr=function(n){let e={},t={},i={},s="";try{const r=n.split(".");e=gt(Yt(r[0])||""),t=gt(Yt(r[1])||""),s=r[2],i=t.d||{},delete t.d}catch{}return{header:e,claims:t,data:i,signature:s}},sl=function(n){const e=Cr(n),t=e.claims;return!!t&&typeof t=="object"&&t.hasOwnProperty("iat")},rl=function(n){const e=Cr(n).claims;return typeof e=="object"&&e.admin===!0};/**
|
|
197
197
|
* @license
|
|
198
198
|
* Copyright 2017 Google LLC
|
|
199
199
|
*
|
|
@@ -208,7 +208,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
208
208
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
209
209
|
* See the License for the specific language governing permissions and
|
|
210
210
|
* limitations under the License.
|
|
211
|
-
*/function se(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function
|
|
211
|
+
*/function se(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function je(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}function zn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Qt(n,e,t){const i={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=e.call(t,n[s],s,n));return i}function ke(n,e){if(n===e)return!0;const t=Object.keys(n),i=Object.keys(e);for(const s of t){if(!i.includes(s))return!1;const r=n[s],o=e[s];if(as(r)&&as(o)){if(!ke(r,o))return!1}else if(r!==o)return!1}for(const s of i)if(!t.includes(s))return!1;return!0}function as(n){return n!==null&&typeof n=="object"}/**
|
|
212
212
|
* @license
|
|
213
213
|
* Copyright 2017 Google LLC
|
|
214
214
|
*
|
|
@@ -223,7 +223,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
223
223
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
224
224
|
* See the License for the specific language governing permissions and
|
|
225
225
|
* limitations under the License.
|
|
226
|
-
*/function
|
|
226
|
+
*/function Xe(n){const e=[];for(const[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(s=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function lt(n){const e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){const[s,r]=i.split("=");e[decodeURIComponent(s)]=decodeURIComponent(r)}}),e}function ct(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}/**
|
|
227
227
|
* @license
|
|
228
228
|
* Copyright 2017 Google LLC
|
|
229
229
|
*
|
|
@@ -238,7 +238,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
238
238
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
239
239
|
* See the License for the specific language governing permissions and
|
|
240
240
|
* limitations under the License.
|
|
241
|
-
*/class
|
|
241
|
+
*/class ol{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const i=this.W_;if(typeof e=="string")for(let h=0;h<16;h++)i[h]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let h=0;h<16;h++)i[h]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let h=16;h<80;h++){const d=i[h-3]^i[h-8]^i[h-14]^i[h-16];i[h]=(d<<1|d>>>31)&4294967295}let s=this.chain_[0],r=this.chain_[1],o=this.chain_[2],a=this.chain_[3],l=this.chain_[4],c,u;for(let h=0;h<80;h++){h<40?h<20?(c=a^r&(o^a),u=1518500249):(c=r^o^a,u=1859775393):h<60?(c=r&o|a&(r|o),u=2400959708):(c=r^o^a,u=3395469782);const d=(s<<5|s>>>27)+c+l+u+i[h]&4294967295;l=a,a=o,o=(r<<30|r>>>2)&4294967295,r=s,s=d}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+r&4294967295,this.chain_[2]=this.chain_[2]+o&4294967295,this.chain_[3]=this.chain_[3]+a&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295}update(e,t){if(e==null)return;t===void 0&&(t=e.length);const i=t-this.blockSize;let s=0;const r=this.buf_;let o=this.inbuf_;for(;s<t;){if(o===0)for(;s<=i;)this.compress_(e,s),s+=this.blockSize;if(typeof e=="string"){for(;s<t;)if(r[o]=e.charCodeAt(s),++o,++s,o===this.blockSize){this.compress_(r),o=0;break}}else for(;s<t;)if(r[o]=e[s],++o,++s,o===this.blockSize){this.compress_(r),o=0;break}}this.inbuf_=o,this.total_+=t}digest(){const e=[];let t=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let s=this.blockSize-1;s>=56;s--)this.buf_[s]=t&255,t/=256;this.compress_(this.buf_);let i=0;for(let s=0;s<5;s++)for(let r=24;r>=0;r-=8)e[i]=this.chain_[s]>>r&255,++i;return e}}function al(n,e){const t=new ll(n,e);return t.subscribe.bind(t)}class ll{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(i=>{this.error(i)})}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,i){let s;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");cl(e,["next","error","complete"])?s=e:s={next:e,error:t,complete:i},s.next===void 0&&(s.next=An),s.error===void 0&&(s.error=An),s.complete===void 0&&(s.complete=An);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),r}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(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function cl(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function An(){}function Tr(n,e){return`${n} failed: ${e} argument `}/**
|
|
242
242
|
* @license
|
|
243
243
|
* Copyright 2017 Google LLC
|
|
244
244
|
*
|
|
@@ -253,7 +253,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
253
253
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
254
254
|
* See the License for the specific language governing permissions and
|
|
255
255
|
* limitations under the License.
|
|
256
|
-
*/const
|
|
256
|
+
*/const hl=function(n){const e=[];let t=0;for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);if(s>=55296&&s<=56319){const r=s-55296;i++,f(i<n.length,"Surrogate pair missing trail surrogate.");const o=n.charCodeAt(i)-56320;s=65536+(r<<10)+o}s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=s&63|128):s<65536?(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=s&63|128):(e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=s&63|128)}return e},gn=function(n){let e=0;for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);i<128?e++:i<2048?e+=2:i>=55296&&i<=56319?(e+=4,t++):e+=3}return e};/**
|
|
257
257
|
* @license
|
|
258
258
|
* Copyright 2021 Google LLC
|
|
259
259
|
*
|
|
@@ -283,7 +283,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
283
283
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
284
284
|
* See the License for the specific language governing permissions and
|
|
285
285
|
* limitations under the License.
|
|
286
|
-
*/const
|
|
286
|
+
*/const Se="[DEFAULT]";/**
|
|
287
287
|
* @license
|
|
288
288
|
* Copyright 2019 Google LLC
|
|
289
289
|
*
|
|
@@ -298,7 +298,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
298
298
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
299
299
|
* See the License for the specific language governing permissions and
|
|
300
300
|
* limitations under the License.
|
|
301
|
-
*/class
|
|
301
|
+
*/class ul{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){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const i=new mi;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:t});s&&i.resolve(s)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const i=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(r){if(s)return null;throw r}else{if(s)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(fl(e))try{this.getOrInitializeService({instanceIdentifier:Se})}catch{}for(const[t,i]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(t);try{const r=this.getOrInitializeService({instanceIdentifier:s});i.resolve(r)}catch{}}}}clearInstance(e=Se){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const 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=Se){return this.instances.has(e)}getOptions(e=Se){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:i,options:t});for(const[r,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(r);i===a&&o.resolve(s)}return s}onInit(e,t){var i;const s=this.normalizeInstanceIdentifier(t),r=(i=this.onInitCallbacks.get(s))!==null&&i!==void 0?i:new Set;r.add(e),this.onInitCallbacks.set(s,r);const o=this.instances.get(s);return o&&e(o,s),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const s of i)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:dl(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=Se){return this.component?this.component.multipleInstances?e:Se:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function dl(n){return n===Se?void 0:n}function fl(n){return n.instantiationMode==="EAGER"}/**
|
|
302
302
|
* @license
|
|
303
303
|
* Copyright 2019 Google LLC
|
|
304
304
|
*
|
|
@@ -313,7 +313,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
313
313
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
314
314
|
* See the License for the specific language governing permissions and
|
|
315
315
|
* limitations under the License.
|
|
316
|
-
*/class
|
|
316
|
+
*/class pl{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const 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);const t=new ul(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
|
|
317
317
|
* @license
|
|
318
318
|
* Copyright 2017 Google LLC
|
|
319
319
|
*
|
|
@@ -328,7 +328,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
328
328
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
329
329
|
* See the License for the specific language governing permissions and
|
|
330
330
|
* limitations under the License.
|
|
331
|
-
*/var C;(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"})(C||(C={}));const
|
|
331
|
+
*/var C;(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"})(C||(C={}));const _l={debug:C.DEBUG,verbose:C.VERBOSE,info:C.INFO,warn:C.WARN,error:C.ERROR,silent:C.SILENT},gl=C.INFO,ml={[C.DEBUG]:"log",[C.VERBOSE]:"log",[C.INFO]:"info",[C.WARN]:"warn",[C.ERROR]:"error"},vl=(n,e,...t)=>{if(e<n.logLevel)return;const i=new Date().toISOString(),s=ml[e];if(s)console[s](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class yi{constructor(e){this.name=e,this._logLevel=gl,this._logHandler=vl,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in C))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?_l[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,C.DEBUG,...e),this._logHandler(this,C.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,C.VERBOSE,...e),this._logHandler(this,C.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,C.INFO,...e),this._logHandler(this,C.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,C.WARN,...e),this._logHandler(this,C.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,C.ERROR,...e),this._logHandler(this,C.ERROR,...e)}}const yl=(n,e)=>e.some(t=>n instanceof t);let ls,cs;function El(){return ls||(ls=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Il(){return cs||(cs=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Sr=new WeakMap,qn=new WeakMap,br=new WeakMap,Pn=new WeakMap,Ei=new WeakMap;function wl(n){const e=new Promise((t,i)=>{const s=()=>{n.removeEventListener("success",r),n.removeEventListener("error",o)},r=()=>{t(ue(n.result)),s()},o=()=>{i(n.error),s()};n.addEventListener("success",r),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Sr.set(t,n)}).catch(()=>{}),Ei.set(e,n),e}function Cl(n){if(qn.has(n))return;const e=new Promise((t,i)=>{const s=()=>{n.removeEventListener("complete",r),n.removeEventListener("error",o),n.removeEventListener("abort",o)},r=()=>{t(),s()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),s()};n.addEventListener("complete",r),n.addEventListener("error",o),n.addEventListener("abort",o)});qn.set(n,e)}let Kn={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return qn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||br.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ue(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}};function Tl(n){Kn=n(Kn)}function Sl(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(On(this),e,...t);return br.set(i,e.sort?e.sort():[e]),ue(i)}:Il().includes(n)?function(...e){return n.apply(On(this),e),ue(Sr.get(this))}:function(...e){return ue(n.apply(On(this),e))}}function bl(n){return typeof n=="function"?Sl(n):(n instanceof IDBTransaction&&Cl(n),yl(n,El())?new Proxy(n,Kn):n)}function ue(n){if(n instanceof IDBRequest)return wl(n);if(Pn.has(n))return Pn.get(n);const e=bl(n);return e!==n&&(Pn.set(n,e),Ei.set(e,n)),e}const On=n=>Ei.get(n);function Rl(n,e,{blocked:t,upgrade:i,blocking:s,terminated:r}={}){const o=indexedDB.open(n,e),a=ue(o);return i&&o.addEventListener("upgradeneeded",l=>{i(ue(o.result),l.oldVersion,l.newVersion,ue(o.transaction),l)}),t&&o.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),a.then(l=>{r&&l.addEventListener("close",()=>r()),s&&l.addEventListener("versionchange",c=>s(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const kl=["get","getKey","getAll","getAllKeys","count"],Nl=["put","add","delete","clear"],Dn=new Map;function hs(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Dn.get(e))return Dn.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,s=Nl.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(s||kl.includes(t)))return;const r=async function(o,...a){const l=this.transaction(o,s?"readwrite":"readonly");let c=l.store;return i&&(c=c.index(a.shift())),(await Promise.all([c[t](...a),s&&l.done]))[0]};return Dn.set(e,r),r}Tl(n=>({...n,get:(e,t,i)=>hs(e,t)||n.get(e,t,i),has:(e,t)=>!!hs(e,t)||n.has(e,t)}));/**
|
|
332
332
|
* @license
|
|
333
333
|
* Copyright 2019 Google LLC
|
|
334
334
|
*
|
|
@@ -343,7 +343,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
343
343
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
344
344
|
* See the License for the specific language governing permissions and
|
|
345
345
|
* limitations under the License.
|
|
346
|
-
*/class
|
|
346
|
+
*/class Al{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Pl(t)){const i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}}function Pl(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Yn="@firebase/app",us="0.11.2";/**
|
|
347
347
|
* @license
|
|
348
348
|
* Copyright 2019 Google LLC
|
|
349
349
|
*
|
|
@@ -358,7 +358,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
358
358
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
359
359
|
* See the License for the specific language governing permissions and
|
|
360
360
|
* limitations under the License.
|
|
361
|
-
*/const te=new
|
|
361
|
+
*/const te=new yi("@firebase/app"),Ol="@firebase/app-compat",Dl="@firebase/analytics-compat",Ml="@firebase/analytics",Ll="@firebase/app-check-compat",xl="@firebase/app-check",Fl="@firebase/auth",Ul="@firebase/auth-compat",Wl="@firebase/database",Bl="@firebase/data-connect",Hl="@firebase/database-compat",Vl="@firebase/functions",$l="@firebase/functions-compat",Gl="@firebase/installations",jl="@firebase/installations-compat",zl="@firebase/messaging",ql="@firebase/messaging-compat",Kl="@firebase/performance",Yl="@firebase/performance-compat",Ql="@firebase/remote-config",Jl="@firebase/remote-config-compat",Xl="@firebase/storage",Zl="@firebase/storage-compat",ec="@firebase/firestore",tc="@firebase/vertexai",nc="@firebase/firestore-compat",ic="firebase",sc="11.4.0";/**
|
|
362
362
|
* @license
|
|
363
363
|
* Copyright 2019 Google LLC
|
|
364
364
|
*
|
|
@@ -373,7 +373,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
373
373
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
374
374
|
* See the License for the specific language governing permissions and
|
|
375
375
|
* limitations under the License.
|
|
376
|
-
*/const
|
|
376
|
+
*/const Qn="[DEFAULT]",rc={[Yn]:"fire-core",[Ol]:"fire-core-compat",[Ml]:"fire-analytics",[Dl]:"fire-analytics-compat",[xl]:"fire-app-check",[Ll]:"fire-app-check-compat",[Fl]:"fire-auth",[Ul]:"fire-auth-compat",[Wl]:"fire-rtdb",[Bl]:"fire-data-connect",[Hl]:"fire-rtdb-compat",[Vl]:"fire-fn",[$l]:"fire-fn-compat",[Gl]:"fire-iid",[jl]:"fire-iid-compat",[zl]:"fire-fcm",[ql]:"fire-fcm-compat",[Kl]:"fire-perf",[Yl]:"fire-perf-compat",[Ql]:"fire-rc",[Jl]:"fire-rc-compat",[Xl]:"fire-gcs",[Zl]:"fire-gcs-compat",[ec]:"fire-fst",[nc]:"fire-fst-compat",[tc]:"fire-vertex","fire-js":"fire-js",[ic]:"fire-js-all"};/**
|
|
377
377
|
* @license
|
|
378
378
|
* Copyright 2019 Google LLC
|
|
379
379
|
*
|
|
@@ -388,7 +388,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
388
388
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
389
389
|
* See the License for the specific language governing permissions and
|
|
390
390
|
* limitations under the License.
|
|
391
|
-
*/const
|
|
391
|
+
*/const Jt=new Map,oc=new Map,Jn=new Map;function ds(n,e){try{n.container.addComponent(e)}catch(t){te.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function ze(n){const e=n.name;if(Jn.has(e))return te.debug(`There were multiple attempts to register component ${e}.`),!1;Jn.set(e,n);for(const t of Jt.values())ds(t,n);for(const t of oc.values())ds(t,n);return!0}function Ii(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function H(n){return n==null?!1:n.settings!==void 0}/**
|
|
392
392
|
* @license
|
|
393
393
|
* Copyright 2019 Google LLC
|
|
394
394
|
*
|
|
@@ -403,7 +403,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
403
403
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
404
404
|
* See the License for the specific language governing permissions and
|
|
405
405
|
* limitations under the License.
|
|
406
|
-
*/const
|
|
406
|
+
*/const ac={"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."},de=new kt("app","Firebase",ac);/**
|
|
407
407
|
* @license
|
|
408
408
|
* Copyright 2019 Google LLC
|
|
409
409
|
*
|
|
@@ -418,7 +418,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
418
418
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
419
419
|
* See the License for the specific language governing permissions and
|
|
420
420
|
* limitations under the License.
|
|
421
|
-
*/class
|
|
421
|
+
*/class lc{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Ne("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 de.create("app-deleted",{appName:this._name})}}/**
|
|
422
422
|
* @license
|
|
423
423
|
* Copyright 2019 Google LLC
|
|
424
424
|
*
|
|
@@ -433,7 +433,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
433
433
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
434
434
|
* See the License for the specific language governing permissions and
|
|
435
435
|
* limitations under the License.
|
|
436
|
-
*/const
|
|
436
|
+
*/const Ze=sc;function Rr(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i=Object.assign({name:Qn,automaticDataCollectionEnabled:!1},e),s=i.name;if(typeof s!="string"||!s)throw de.create("bad-app-name",{appName:String(s)});if(t||(t=Er()),!t)throw de.create("no-options");const r=Jt.get(s);if(r){if(ke(t,r.options)&&ke(i,r.config))return r;throw de.create("duplicate-app",{appName:s})}const o=new pl(s);for(const l of Jn.values())o.addComponent(l);const a=new lc(t,i,o);return Jt.set(s,a),a}function kr(n=Qn){const e=Jt.get(n);if(!e&&n===Qn&&Er())return Rr();if(!e)throw de.create("no-app",{appName:n});return e}function fe(n,e,t){var i;let s=(i=rc[n])!==null&&i!==void 0?i:n;t&&(s+=`-${t}`);const r=s.match(/\s|\//),o=e.match(/\s|\//);if(r||o){const a=[`Unable to register library "${s}" with version "${e}":`];r&&a.push(`library name "${s}" contains illegal characters (whitespace or "/")`),r&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),te.warn(a.join(" "));return}ze(new Ne(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}/**
|
|
437
437
|
* @license
|
|
438
438
|
* Copyright 2021 Google LLC
|
|
439
439
|
*
|
|
@@ -448,7 +448,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
448
448
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
449
449
|
* See the License for the specific language governing permissions and
|
|
450
450
|
* limitations under the License.
|
|
451
|
-
*/const
|
|
451
|
+
*/const cc="firebase-heartbeat-database",hc=1,mt="firebase-heartbeat-store";let Mn=null;function Nr(){return Mn||(Mn=Rl(cc,hc,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(mt)}catch(t){console.warn(t)}}}}).catch(n=>{throw de.create("idb-open",{originalErrorMessage:n.message})})),Mn}async function uc(n){try{const t=(await Nr()).transaction(mt),i=await t.objectStore(mt).get(Ar(n));return await t.done,i}catch(e){if(e instanceof Ee)te.warn(e.message);else{const t=de.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});te.warn(t.message)}}}async function fs(n,e){try{const i=(await Nr()).transaction(mt,"readwrite");await i.objectStore(mt).put(e,Ar(n)),await i.done}catch(t){if(t instanceof Ee)te.warn(t.message);else{const i=de.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});te.warn(i.message)}}}function Ar(n){return`${n.name}!${n.options.appId}`}/**
|
|
452
452
|
* @license
|
|
453
453
|
* Copyright 2021 Google LLC
|
|
454
454
|
*
|
|
@@ -463,7 +463,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
463
463
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
464
464
|
* See the License for the specific language governing permissions and
|
|
465
465
|
* limitations under the License.
|
|
466
|
-
*/const
|
|
466
|
+
*/const dc=1024,fc=30;class pc{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new gc(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){var e,t;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=ps();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(o=>o.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:s}),this._heartbeatsCache.heartbeats.length>fc){const o=mc(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(i){te.warn(i)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=ps(),{heartbeatsToSend:i,unsentEntries:s}=_c(this._heartbeatsCache.heartbeats),r=Kt(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(t){return te.warn(t),""}}}function ps(){return new Date().toISOString().substring(0,10)}function _c(n,e=dc){const t=[];let i=n.slice();for(const s of n){const r=t.find(o=>o.agent===s.agent);if(r){if(r.dates.push(s.date),_s(t)>e){r.dates.pop();break}}else if(t.push({agent:s.agent,dates:[s.date]}),_s(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}class gc{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Za()?el().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await uc(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const s=await this.read();return fs(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const s=await this.read();return fs(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function _s(n){return Kt(JSON.stringify({version:2,heartbeats:n})).length}function mc(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let i=1;i<n.length;i++)n[i].date<t&&(t=n[i].date,e=i);return e}/**
|
|
467
467
|
* @license
|
|
468
468
|
* Copyright 2019 Google LLC
|
|
469
469
|
*
|
|
@@ -478,7 +478,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
478
478
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
479
479
|
* See the License for the specific language governing permissions and
|
|
480
480
|
* limitations under the License.
|
|
481
|
-
*/function
|
|
481
|
+
*/function vc(n){ze(new Ne("platform-logger",e=>new Al(e),"PRIVATE")),ze(new Ne("heartbeat",e=>new pc(e),"PRIVATE")),fe(Yn,us,n),fe(Yn,us,"esm2017"),fe("fire-js","")}vc("");var yc="firebase",Ec="11.4.0";/**
|
|
482
482
|
* @license
|
|
483
483
|
* Copyright 2020 Google LLC
|
|
484
484
|
*
|
|
@@ -493,7 +493,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
493
493
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
494
494
|
* See the License for the specific language governing permissions and
|
|
495
495
|
* limitations under the License.
|
|
496
|
-
*/fe(Ec,
|
|
496
|
+
*/fe(yc,Ec,"app");function Pr(){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."}}const Ic=Pr,Or=new kt("auth","Firebase",Pr());/**
|
|
497
497
|
* @license
|
|
498
498
|
* Copyright 2020 Google LLC
|
|
499
499
|
*
|
|
@@ -508,7 +508,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
508
508
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
509
509
|
* See the License for the specific language governing permissions and
|
|
510
510
|
* limitations under the License.
|
|
511
|
-
*/const
|
|
511
|
+
*/const Xt=new yi("@firebase/auth");function wc(n,...e){Xt.logLevel<=C.WARN&&Xt.warn(`Auth (${Ze}): ${n}`,...e)}function $t(n,...e){Xt.logLevel<=C.ERROR&&Xt.error(`Auth (${Ze}): ${n}`,...e)}/**
|
|
512
512
|
* @license
|
|
513
513
|
* Copyright 2020 Google LLC
|
|
514
514
|
*
|
|
@@ -523,7 +523,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
523
523
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
524
524
|
* See the License for the specific language governing permissions and
|
|
525
525
|
* limitations under the License.
|
|
526
|
-
*/function
|
|
526
|
+
*/function z(n,...e){throw wi(n,...e)}function q(n,...e){return wi(n,...e)}function Dr(n,e,t){const i=Object.assign(Object.assign({},Ic()),{[e]:t});return new kt("auth","Firebase",i).create(e,{appName:n.name})}function pe(n){return Dr(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function wi(n,...e){if(typeof n!="string"){const t=e[0],i=[...e.slice(1)];return i[0]&&(i[0].appName=n.name),n._errorFactory.create(t,...i)}return Or.create(n,...e)}function g(n,e,...t){if(!n)throw wi(e,...t)}function Q(n){const e="INTERNAL ASSERTION FAILED: "+n;throw $t(e),new Error(e)}function ne(n,e){n||Q(e)}/**
|
|
527
527
|
* @license
|
|
528
528
|
* Copyright 2020 Google LLC
|
|
529
529
|
*
|
|
@@ -538,7 +538,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
538
538
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
539
539
|
* See the License for the specific language governing permissions and
|
|
540
540
|
* limitations under the License.
|
|
541
|
-
*/function
|
|
541
|
+
*/function Xn(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function Cc(){return gs()==="http:"||gs()==="https:"}function gs(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
|
|
542
542
|
* @license
|
|
543
543
|
* Copyright 2020 Google LLC
|
|
544
544
|
*
|
|
@@ -553,7 +553,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
553
553
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
554
554
|
* See the License for the specific language governing permissions and
|
|
555
555
|
* limitations under the License.
|
|
556
|
-
*/function
|
|
556
|
+
*/function Tc(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Cc()||Qa()||"connection"in navigator)?navigator.onLine:!0}function Sc(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
|
|
557
557
|
* @license
|
|
558
558
|
* Copyright 2020 Google LLC
|
|
559
559
|
*
|
|
@@ -568,7 +568,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
568
568
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
569
569
|
* See the License for the specific language governing permissions and
|
|
570
570
|
* limitations under the License.
|
|
571
|
-
*/class Nt{constructor(e,t){this.shortDelay=e,this.longDelay=t,ne(t>e,"Short delay should be less than long delay!"),this.isMobile=
|
|
571
|
+
*/class Nt{constructor(e,t){this.shortDelay=e,this.longDelay=t,ne(t>e,"Short delay should be less than long delay!"),this.isMobile=vi()||wr()}get(){return Tc()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
572
572
|
* @license
|
|
573
573
|
* Copyright 2020 Google LLC
|
|
574
574
|
*
|
|
@@ -583,7 +583,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
583
583
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
584
584
|
* See the License for the specific language governing permissions and
|
|
585
585
|
* limitations under the License.
|
|
586
|
-
*/function
|
|
586
|
+
*/function Ci(n,e){ne(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
|
|
587
587
|
* @license
|
|
588
588
|
* Copyright 2020 Google LLC
|
|
589
589
|
*
|
|
@@ -598,7 +598,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
598
598
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
599
599
|
* See the License for the specific language governing permissions and
|
|
600
600
|
* limitations under the License.
|
|
601
|
-
*/class
|
|
601
|
+
*/class Mr{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}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;Q("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;Q("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;Q("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
602
602
|
* @license
|
|
603
603
|
* Copyright 2020 Google LLC
|
|
604
604
|
*
|
|
@@ -613,7 +613,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
613
613
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
614
614
|
* See the License for the specific language governing permissions and
|
|
615
615
|
* limitations under the License.
|
|
616
|
-
*/const
|
|
616
|
+
*/const bc={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"};/**
|
|
617
617
|
* @license
|
|
618
618
|
* Copyright 2020 Google LLC
|
|
619
619
|
*
|
|
@@ -628,7 +628,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
628
628
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
629
629
|
* See the License for the specific language governing permissions and
|
|
630
630
|
* limitations under the License.
|
|
631
|
-
*/const
|
|
631
|
+
*/const Rc=new Nt(3e4,6e4);function Me(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function Ie(n,e,t,i,s={}){return Lr(n,s,async()=>{let r={},o={};i&&(e==="GET"?o=i:r={body:JSON.stringify(i)});const a=Xe(Object.assign({key:n.config.apiKey},o)).slice(1),l=await n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c=Object.assign({method:e,headers:l},r);return Ya()||(c.referrerPolicy="no-referrer"),Mr.fetch()(xr(n,n.config.apiHost,t,a),c)})}async function Lr(n,e,t){n._canInitEmulator=!1;const i=Object.assign(Object.assign({},bc),e);try{const s=new Nc(n),r=await Promise.race([t(),s.promise]);s.clearNetworkTimeout();const o=await r.json();if("needConfirmation"in o)throw Bt(n,"account-exists-with-different-credential",o);if(r.ok&&!("errorMessage"in o))return o;{const a=r.ok?o.errorMessage:o.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Bt(n,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw Bt(n,"email-already-in-use",o);if(l==="USER_DISABLED")throw Bt(n,"user-disabled",o);const u=i[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw Dr(n,u,c);z(n,u)}}catch(s){if(s instanceof Ee)throw s;z(n,"network-request-failed",{message:String(s)})}}async function mn(n,e,t,i,s={}){const r=await Ie(n,e,t,i,s);return"mfaPendingCredential"in r&&z(n,"multi-factor-auth-required",{_serverResponse:r}),r}function xr(n,e,t,i){const s=`${e}${t}?${i}`;return n.config.emulator?Ci(n.config,s):`${n.config.apiScheme}://${s}`}function kc(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Nc{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(q(this.auth,"network-request-failed")),Rc.get())})}}function Bt(n,e,t){const i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);const s=q(n,e,i);return s.customData._tokenResponse=t,s}function ms(n){return n!==void 0&&n.enterprise!==void 0}class Ac{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(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return kc(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")}}async function Pc(n,e){return Ie(n,"GET","/v2/recaptchaConfig",Me(n,e))}/**
|
|
632
632
|
* @license
|
|
633
633
|
* Copyright 2020 Google LLC
|
|
634
634
|
*
|
|
@@ -643,7 +643,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
643
643
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
644
644
|
* See the License for the specific language governing permissions and
|
|
645
645
|
* limitations under the License.
|
|
646
|
-
*/async function
|
|
646
|
+
*/async function Oc(n,e){return Ie(n,"POST","/v1/accounts:delete",e)}async function Fr(n,e){return Ie(n,"POST","/v1/accounts:lookup",e)}/**
|
|
647
647
|
* @license
|
|
648
648
|
* Copyright 2020 Google LLC
|
|
649
649
|
*
|
|
@@ -658,7 +658,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
658
658
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
659
659
|
* See the License for the specific language governing permissions and
|
|
660
660
|
* limitations under the License.
|
|
661
|
-
*/function
|
|
661
|
+
*/function ht(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Dc(n,e=!1){const t=F(n),i=await t.getIdToken(e),s=Ti(i);g(s&&s.exp&&s.auth_time&&s.iat,t.auth,"internal-error");const r=typeof s.firebase=="object"?s.firebase:void 0,o=r==null?void 0:r.sign_in_provider;return{claims:s,token:i,authTime:ht(Ln(s.auth_time)),issuedAtTime:ht(Ln(s.iat)),expirationTime:ht(Ln(s.exp)),signInProvider:o||null,signInSecondFactor:(r==null?void 0:r.sign_in_second_factor)||null}}function Ln(n){return Number(n)*1e3}function Ti(n){const[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return $t("JWT malformed, contained fewer than 3 sections"),null;try{const s=Yt(t);return s?JSON.parse(s):($t("Failed to decode base64 JWT payload"),null)}catch(s){return $t("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function vs(n){const e=Ti(n);return g(e,"internal-error"),g(typeof e.exp<"u","internal-error"),g(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
|
|
662
662
|
* @license
|
|
663
663
|
* Copyright 2020 Google LLC
|
|
664
664
|
*
|
|
@@ -673,7 +673,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
673
673
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
674
674
|
* See the License for the specific language governing permissions and
|
|
675
675
|
* limitations under the License.
|
|
676
|
-
*/async function
|
|
676
|
+
*/async function vt(n,e,t=!1){if(t)return e;try{return await e}catch(i){throw i instanceof Ee&&Mc(i)&&n.auth.currentUser===n&&await n.auth.signOut(),i}}function Mc({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
|
|
677
677
|
* @license
|
|
678
678
|
* Copyright 2020 Google LLC
|
|
679
679
|
*
|
|
@@ -688,7 +688,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
688
688
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
689
689
|
* See the License for the specific language governing permissions and
|
|
690
690
|
* limitations under the License.
|
|
691
|
-
*/class
|
|
691
|
+
*/class Lc{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){var t;if(e){const i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;const s=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,s)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
|
|
692
692
|
* @license
|
|
693
693
|
* Copyright 2020 Google LLC
|
|
694
694
|
*
|
|
@@ -703,7 +703,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
703
703
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
704
704
|
* See the License for the specific language governing permissions and
|
|
705
705
|
* limitations under the License.
|
|
706
|
-
*/class
|
|
706
|
+
*/class Zn{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ht(this.lastLoginAt),this.creationTime=ht(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
707
707
|
* @license
|
|
708
708
|
* Copyright 2019 Google LLC
|
|
709
709
|
*
|
|
@@ -718,7 +718,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
718
718
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
719
719
|
* See the License for the specific language governing permissions and
|
|
720
720
|
* limitations under the License.
|
|
721
|
-
*/async function
|
|
721
|
+
*/async function Zt(n){var e;const t=n.auth,i=await n.getIdToken(),s=await vt(n,Fr(t,{idToken:i}));g(s==null?void 0:s.users.length,t,"internal-error");const r=s.users[0];n._notifyReloadListener(r);const o=!((e=r.providerUserInfo)===null||e===void 0)&&e.length?Ur(r.providerUserInfo):[],a=Fc(n.providerData,o),l=n.isAnonymous,c=!(n.email&&r.passwordHash)&&!(a!=null&&a.length),u=l?c:!1,h={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new Zn(r.createdAt,r.lastLoginAt),isAnonymous:u};Object.assign(n,h)}async function xc(n){const e=F(n);await Zt(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Fc(n,e){return[...n.filter(i=>!e.some(s=>s.providerId===i.providerId)),...e]}function Ur(n){return n.map(e=>{var{providerId:t}=e,i=pi(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}/**
|
|
722
722
|
* @license
|
|
723
723
|
* Copyright 2020 Google LLC
|
|
724
724
|
*
|
|
@@ -733,7 +733,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
733
733
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
734
734
|
* See the License for the specific language governing permissions and
|
|
735
735
|
* limitations under the License.
|
|
736
|
-
*/async function
|
|
736
|
+
*/async function Uc(n,e){const t=await Lr(n,{},async()=>{const i=Xe({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:r}=n.config,o=xr(n,s,"/v1/token",`key=${r}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Mr.fetch()(o,{method:"POST",headers:a,body:i})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Wc(n,e){return Ie(n,"POST","/v2/accounts:revokeToken",Me(n,e))}/**
|
|
737
737
|
* @license
|
|
738
738
|
* Copyright 2020 Google LLC
|
|
739
739
|
*
|
|
@@ -748,7 +748,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
748
748
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
749
749
|
* See the License for the specific language governing permissions and
|
|
750
750
|
* limitations under the License.
|
|
751
|
-
*/class
|
|
751
|
+
*/class Be{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){g(e.idToken,"internal-error"),g(typeof e.idToken<"u","internal-error"),g(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):vs(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){g(e.length!==0,"internal-error");const t=vs(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(g(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){const{accessToken:i,refreshToken:s,expiresIn:r}=await Uc(e,t);this.updateTokensAndExpiration(i,s,Number(r))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+i*1e3}static fromJSON(e,t){const{refreshToken:i,accessToken:s,expirationTime:r}=t,o=new Be;return i&&(g(typeof i=="string","internal-error",{appName:e}),o.refreshToken=i),s&&(g(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),r&&(g(typeof r=="number","internal-error",{appName:e}),o.expirationTime=r),o}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 Be,this.toJSON())}_performRefresh(){return Q("not implemented")}}/**
|
|
752
752
|
* @license
|
|
753
753
|
* Copyright 2020 Google LLC
|
|
754
754
|
*
|
|
@@ -763,7 +763,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
763
763
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
764
764
|
* See the License for the specific language governing permissions and
|
|
765
765
|
* limitations under the License.
|
|
766
|
-
*/function oe(n,e){g(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class J{constructor(e){var{uid:t,auth:i,stsTokenManager:s}=e,r=
|
|
766
|
+
*/function oe(n,e){g(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class J{constructor(e){var{uid:t,auth:i,stsTokenManager:s}=e,r=pi(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Lc(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=s,this.accessToken=s.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new Zn(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){const t=await vt(this,this.stsTokenManager.getToken(this.auth,e));return g(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Dc(this,e)}reload(){return xc(this)}_assign(e){this!==e&&(g(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=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new J(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){g(!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 i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await Zt(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(H(this.auth.app))return Promise.reject(pe(this.auth));const e=await this.getIdToken();return await vt(this,Oc(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({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=>Object.assign({},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){var i,s,r,o,a,l,c,u;const h=(i=t.displayName)!==null&&i!==void 0?i:void 0,d=(s=t.email)!==null&&s!==void 0?s:void 0,p=(r=t.phoneNumber)!==null&&r!==void 0?r:void 0,_=(o=t.photoURL)!==null&&o!==void 0?o:void 0,w=(a=t.tenantId)!==null&&a!==void 0?a:void 0,k=(l=t._redirectEventId)!==null&&l!==void 0?l:void 0,Y=(c=t.createdAt)!==null&&c!==void 0?c:void 0,Ce=(u=t.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:Te,emailVerified:Wt,isAnonymous:ss,providerData:kn,stsTokenManager:rs}=t;g(Te&&rs,e,"internal-error");const Pa=Be.fromJSON(this.name,rs);g(typeof Te=="string",e,"internal-error"),oe(h,e.name),oe(d,e.name),g(typeof Wt=="boolean",e,"internal-error"),g(typeof ss=="boolean",e,"internal-error"),oe(p,e.name),oe(_,e.name),oe(w,e.name),oe(k,e.name),oe(Y,e.name),oe(Ce,e.name);const Nn=new J({uid:Te,auth:e,email:d,emailVerified:Wt,displayName:h,isAnonymous:ss,photoURL:_,phoneNumber:p,tenantId:w,stsTokenManager:Pa,createdAt:Y,lastLoginAt:Ce});return kn&&Array.isArray(kn)&&(Nn.providerData=kn.map(Oa=>Object.assign({},Oa))),k&&(Nn._redirectEventId=k),Nn}static async _fromIdTokenResponse(e,t,i=!1){const s=new Be;s.updateFromServerResponse(t);const r=new J({uid:t.localId,auth:e,stsTokenManager:s,isAnonymous:i});return await Zt(r),r}static async _fromGetAccountInfoResponse(e,t,i){const s=t.users[0];g(s.localId!==void 0,"internal-error");const r=s.providerUserInfo!==void 0?Ur(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!(r!=null&&r.length),a=new Be;a.updateFromIdToken(i);const l=new J({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:r,metadata:new Zn(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(r!=null&&r.length)};return Object.assign(l,c),l}}/**
|
|
767
767
|
* @license
|
|
768
768
|
* Copyright 2020 Google LLC
|
|
769
769
|
*
|
|
@@ -778,7 +778,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
778
778
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
779
779
|
* See the License for the specific language governing permissions and
|
|
780
780
|
* limitations under the License.
|
|
781
|
-
*/const
|
|
781
|
+
*/const ys=new Map;function X(n){ne(n instanceof Function,"Expected a class definition");let e=ys.get(n);return e?(ne(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,ys.set(n,e),e)}/**
|
|
782
782
|
* @license
|
|
783
783
|
* Copyright 2019 Google LLC
|
|
784
784
|
*
|
|
@@ -793,7 +793,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
793
793
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
794
794
|
* See the License for the specific language governing permissions and
|
|
795
795
|
* limitations under the License.
|
|
796
|
-
*/class
|
|
796
|
+
*/class Wr{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Wr.type="NONE";const ei=Wr;/**
|
|
797
797
|
* @license
|
|
798
798
|
* Copyright 2019 Google LLC
|
|
799
799
|
*
|
|
@@ -808,7 +808,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
808
808
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
809
809
|
* See the License for the specific language governing permissions and
|
|
810
810
|
* limitations under the License.
|
|
811
|
-
*/function
|
|
811
|
+
*/function Gt(n,e,t){return`firebase:${n}:${e}:${t}`}class He{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const{config:s,name:r}=this.auth;this.fullUserKey=Gt(this.userKey,s.apiKey,r),this.fullPersistenceKey=Gt("persistence",s.apiKey,r),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(){const e=await this.persistence._get(this.fullUserKey);return e?J._fromJSON(this.auth,e):null}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;const 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,i="authUser"){if(!t.length)return new He(X(ei),e,i);const s=(await Promise.all(t.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let r=s[0]||X(ei);const o=Gt(i,e.config.apiKey,e.name);let a=null;for(const c of t)try{const u=await c._get(o);if(u){const h=J._fromJSON(e,u);c!==r&&(a=h),r=c;break}}catch{}const l=s.filter(c=>c._shouldAllowMigration);return!r._shouldAllowMigration||!l.length?new He(r,e,i):(r=l[0],a&&await r._set(o,a.toJSON()),await Promise.all(t.map(async c=>{if(c!==r)try{await c._remove(o)}catch{}})),new He(r,e,i))}}/**
|
|
812
812
|
* @license
|
|
813
813
|
* Copyright 2020 Google LLC
|
|
814
814
|
*
|
|
@@ -823,7 +823,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
823
823
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
824
824
|
* See the License for the specific language governing permissions and
|
|
825
825
|
* limitations under the License.
|
|
826
|
-
*/function
|
|
826
|
+
*/function Es(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if($r(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Br(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(jr(e))return"Blackberry";if(zr(e))return"Webos";if(Hr(e))return"Safari";if((e.includes("chrome/")||Vr(e))&&!e.includes("edge/"))return"Chrome";if(Gr(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if((i==null?void 0:i.length)===2)return i[1]}return"Other"}function Br(n=x()){return/firefox\//i.test(n)}function Hr(n=x()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Vr(n=x()){return/crios\//i.test(n)}function $r(n=x()){return/iemobile/i.test(n)}function Gr(n=x()){return/android/i.test(n)}function jr(n=x()){return/blackberry/i.test(n)}function zr(n=x()){return/webos/i.test(n)}function Si(n=x()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Bc(n=x()){var e;return Si(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Hc(){return Ja()&&document.documentMode===10}function qr(n=x()){return Si(n)||Gr(n)||zr(n)||jr(n)||/windows phone/i.test(n)||$r(n)}/**
|
|
827
827
|
* @license
|
|
828
828
|
* Copyright 2020 Google LLC
|
|
829
829
|
*
|
|
@@ -838,7 +838,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
838
838
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
839
839
|
* See the License for the specific language governing permissions and
|
|
840
840
|
* limitations under the License.
|
|
841
|
-
*/function
|
|
841
|
+
*/function Kr(n,e=[]){let t;switch(n){case"Browser":t=Es(x());break;case"Worker":t=`${Es(x())}-${n}`;break;default:t=n}const i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ze}/${i}`}/**
|
|
842
842
|
* @license
|
|
843
843
|
* Copyright 2022 Google LLC
|
|
844
844
|
*
|
|
@@ -853,7 +853,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
853
853
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
854
854
|
* See the License for the specific language governing permissions and
|
|
855
855
|
* limitations under the License.
|
|
856
|
-
*/class
|
|
856
|
+
*/class Vc{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const i=r=>new Promise((o,a)=>{try{const l=e(r);o(l)}catch(l){a(l)}});i.onAbort=t,this.queue.push(i);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(i){t.reverse();for(const s of t)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:i==null?void 0:i.message})}}}/**
|
|
857
857
|
* @license
|
|
858
858
|
* Copyright 2023 Google LLC
|
|
859
859
|
*
|
|
@@ -868,7 +868,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
868
868
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
869
869
|
* See the License for the specific language governing permissions and
|
|
870
870
|
* limitations under the License.
|
|
871
|
-
*/async function
|
|
871
|
+
*/async function $c(n,e={}){return Ie(n,"GET","/v2/passwordPolicy",Me(n,e))}/**
|
|
872
872
|
* @license
|
|
873
873
|
* Copyright 2023 Google LLC
|
|
874
874
|
*
|
|
@@ -883,7 +883,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
883
883
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
884
884
|
* See the License for the specific language governing permissions and
|
|
885
885
|
* limitations under the License.
|
|
886
|
-
*/const
|
|
886
|
+
*/const Gc=6;class jc{constructor(e){var t,i,s,r;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Gc,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(s=(i=e.allowedNonAlphanumericCharacters)===null||i===void 0?void 0:i.join(""))!==null&&s!==void 0?s:"",this.forceUpgradeOnSignin=(r=e.forceUpgradeOnSignin)!==null&&r!==void 0?r:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,s,r,o,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=(t=l.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),l.isValid&&(l.isValid=(i=l.meetsMaxPasswordLength)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(s=l.containsLowercaseLetter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(r=l.containsUppercaseLetter)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(o=l.containsNumericCharacter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(a=l.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),l}validatePasswordLengthOptions(e,t){const i=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),s&&(t.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let i;for(let s=0;s<e.length;s++)i=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,s,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}/**
|
|
887
887
|
* @license
|
|
888
888
|
* Copyright 2020 Google LLC
|
|
889
889
|
*
|
|
@@ -898,7 +898,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
898
898
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
899
899
|
* See the License for the specific language governing permissions and
|
|
900
900
|
* limitations under the License.
|
|
901
|
-
*/class zc{constructor(e,t,i,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new
|
|
901
|
+
*/class zc{constructor(e,t,i,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Is(this),this.idTokenSubscription=new Is(this),this.beforeStateQueue=new Vc(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=Or,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=X(t)),this._initializationPromise=this.queue(async()=>{var i,s;if(!this._deleted&&(this.persistenceManager=await He.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const 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{const t=await Fr(this,{idToken:e}),i=await J._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(H(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let s=i,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=s==null?void 0:s._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(s=l.user,r=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(s)}catch(o){s=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return g(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}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 Zt(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Sc()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(H(this.app))return Promise.reject(pe(this));const t=e?F(e):null;return t&&g(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&&g(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 H(this.app)?Promise.reject(pe(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return H(this.app)?Promise.reject(pe(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(X(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const 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(){const e=await $c(this),t=new jc(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new kt("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await Wc(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&X(e)||this._popupRedirectResolver;g(t,this,"argument-error"),this.redirectPersistenceManager=await He.create(this,[X(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._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(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,s){if(this._deleted)return()=>{};const r=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(g(a,this,"internal-error"),a.then(()=>{o||r(this.currentUser)}),typeof t=="function"){const l=e.addObserver(t,i,s);return()=>{o=!0,l()}}else{const l=e.addObserver(t);return()=>{o=!0,l()}}}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 g(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Kr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const s=await this._getAppCheckToken();return s&&(t["X-Firebase-AppCheck"]=s),t}async _getAppCheckToken(){var e;if(H(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&wc(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function et(n){return F(n)}class Is{constructor(e){this.auth=e,this.observer=null,this.addObserver=al(t=>this.observer=t)}get next(){return g(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
902
902
|
* @license
|
|
903
903
|
* Copyright 2020 Google LLC
|
|
904
904
|
*
|
|
@@ -913,7 +913,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
913
913
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
914
914
|
* See the License for the specific language governing permissions and
|
|
915
915
|
* limitations under the License.
|
|
916
|
-
*/let
|
|
916
|
+
*/let vn={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function qc(n){vn=n}function Yr(n){return vn.loadJS(n)}function Kc(){return vn.recaptchaEnterpriseScript}function Yc(){return vn.gapiScript}function Qc(n){return`__${n}${Math.floor(Math.random()*1e6)}`}class Jc{constructor(){this.enterprise=new Xc}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Xc{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Zc="recaptcha-enterprise",Qr="NO_RECAPTCHA";class eh{constructor(e){this.type=Zc,this.auth=et(e)}async verify(e="verify",t=!1){async function i(r){if(!t){if(r.tenantId==null&&r._agentRecaptchaConfig!=null)return r._agentRecaptchaConfig.siteKey;if(r.tenantId!=null&&r._tenantRecaptchaConfigs[r.tenantId]!==void 0)return r._tenantRecaptchaConfigs[r.tenantId].siteKey}return new Promise(async(o,a)=>{Pc(r,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new Ac(l);return r.tenantId==null?r._agentRecaptchaConfig=c:r._tenantRecaptchaConfigs[r.tenantId]=c,o(c.siteKey)}}).catch(l=>{a(l)})})}function s(r,o,a){const l=window.grecaptcha;ms(l)?l.enterprise.ready(()=>{l.enterprise.execute(r,{action:e}).then(c=>{o(c)}).catch(()=>{o(Qr)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new Jc().execute("siteKey",{action:"verify"}):new Promise((r,o)=>{i(this.auth).then(a=>{if(!t&&ms(window.grecaptcha))s(a,r,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=Kc();l.length!==0&&(l+=a),Yr(l).then(()=>{s(a,r,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function ws(n,e,t,i=!1,s=!1){const r=new eh(n);let o;if(s)o=Qr;else try{o=await r.verify(t)}catch{o=await r.verify(t,!0)}const a=Object.assign({},e);if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const l=a.phoneEnrollmentInfo.phoneNumber,c=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:l,recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const l=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return i?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Cs(n,e,t,i,s){var r;if(!((r=n._getRecaptchaConfig())===null||r===void 0)&&r.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await ws(n,e,t,t==="getOobCode");return i(n,o)}else return i(n,e).catch(async o=>{if(o.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.`);const a=await ws(n,e,t,t==="getOobCode");return i(n,a)}else return Promise.reject(o)})}/**
|
|
917
917
|
* @license
|
|
918
918
|
* Copyright 2020 Google LLC
|
|
919
919
|
*
|
|
@@ -928,7 +928,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
928
928
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
929
929
|
* See the License for the specific language governing permissions and
|
|
930
930
|
* limitations under the License.
|
|
931
|
-
*/function
|
|
931
|
+
*/function th(n,e){const t=Ii(n,"auth");if(t.isInitialized()){const s=t.getImmediate(),r=t.getOptions();if(ke(r,e??{}))return s;z(s,"already-initialized")}return t.initialize({options:e})}function nh(n,e){const t=(e==null?void 0:e.persistence)||[],i=(Array.isArray(t)?t:[t]).map(X);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e==null?void 0:e.popupRedirectResolver)}function ih(n,e,t){const i=et(n);g(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");const s=!1,r=Jr(e),{host:o,port:a}=sh(e),l=a===null?"":`:${a}`,c={url:`${r}//${o}${l}/`},u=Object.freeze({host:o,port:a,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!i._canInitEmulator){g(i.config.emulator&&i.emulatorConfig,i,"emulator-config-failed"),g(ke(c,i.config.emulator)&&ke(u,i.emulatorConfig),i,"emulator-config-failed");return}i.config.emulator=c,i.emulatorConfig=u,i.settings.appVerificationDisabledForTesting=!0,rh()}function Jr(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function sh(n){const e=Jr(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const i=t[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(i);if(s){const r=s[1];return{host:r,port:Ts(i.substr(r.length+1))}}else{const[r,o]=i.split(":");return{host:r,port:Ts(o)}}}function Ts(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function rh(){function n(){const 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())}/**
|
|
932
932
|
* @license
|
|
933
933
|
* Copyright 2020 Google LLC
|
|
934
934
|
*
|
|
@@ -943,7 +943,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
943
943
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
944
944
|
* See the License for the specific language governing permissions and
|
|
945
945
|
* limitations under the License.
|
|
946
|
-
*/class
|
|
946
|
+
*/class bi{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Q("not implemented")}_getIdTokenResponse(e){return Q("not implemented")}_linkToIdToken(e,t){return Q("not implemented")}_getReauthenticationResolver(e){return Q("not implemented")}}async function oh(n,e){return Ie(n,"POST","/v1/accounts:signUp",e)}/**
|
|
947
947
|
* @license
|
|
948
948
|
* Copyright 2020 Google LLC
|
|
949
949
|
*
|
|
@@ -958,7 +958,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
958
958
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
959
959
|
* See the License for the specific language governing permissions and
|
|
960
960
|
* limitations under the License.
|
|
961
|
-
*/async function
|
|
961
|
+
*/async function ah(n,e){return mn(n,"POST","/v1/accounts:signInWithPassword",Me(n,e))}/**
|
|
962
962
|
* @license
|
|
963
963
|
* Copyright 2020 Google LLC
|
|
964
964
|
*
|
|
@@ -973,7 +973,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
973
973
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
974
974
|
* See the License for the specific language governing permissions and
|
|
975
975
|
* limitations under the License.
|
|
976
|
-
*/async function
|
|
976
|
+
*/async function lh(n,e){return mn(n,"POST","/v1/accounts:signInWithEmailLink",Me(n,e))}async function ch(n,e){return mn(n,"POST","/v1/accounts:signInWithEmailLink",Me(n,e))}/**
|
|
977
977
|
* @license
|
|
978
978
|
* Copyright 2020 Google LLC
|
|
979
979
|
*
|
|
@@ -988,7 +988,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
988
988
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
989
989
|
* See the License for the specific language governing permissions and
|
|
990
990
|
* limitations under the License.
|
|
991
|
-
*/class
|
|
991
|
+
*/class yt extends bi{constructor(e,t,i,s=null){super("password",i),this._email=e,this._password=t,this._tenantId=s}static _fromEmailAndPassword(e,t){return new yt(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new yt(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t!=null&&t.email&&(t!=null&&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":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Cs(e,t,"signInWithPassword",ah);case"emailLink":return lh(e,{email:this._email,oobCode:this._password});default:z(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const i={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Cs(e,i,"signUpPassword",oh);case"emailLink":return ch(e,{idToken:t,email:this._email,oobCode:this._password});default:z(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
|
|
992
992
|
* @license
|
|
993
993
|
* Copyright 2020 Google LLC
|
|
994
994
|
*
|
|
@@ -1003,7 +1003,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1003
1003
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1004
1004
|
* See the License for the specific language governing permissions and
|
|
1005
1005
|
* limitations under the License.
|
|
1006
|
-
*/async function
|
|
1006
|
+
*/async function Ve(n,e){return mn(n,"POST","/v1/accounts:signInWithIdp",Me(n,e))}/**
|
|
1007
1007
|
* @license
|
|
1008
1008
|
* Copyright 2020 Google LLC
|
|
1009
1009
|
*
|
|
@@ -1018,7 +1018,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1018
1018
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1019
1019
|
* See the License for the specific language governing permissions and
|
|
1020
1020
|
* limitations under the License.
|
|
1021
|
-
*/const
|
|
1021
|
+
*/const hh="http://localhost";class Ae extends bi{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Ae(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):z("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){const t=typeof e=="string"?JSON.parse(e):e,{providerId:i,signInMethod:s}=t,r=pi(t,["providerId","signInMethod"]);if(!i||!s)return null;const o=new Ae(i,s);return o.idToken=r.idToken||void 0,o.accessToken=r.accessToken||void 0,o.secret=r.secret,o.nonce=r.nonce,o.pendingToken=r.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return Ve(e,t)}_linkToIdToken(e,t){const i=this.buildRequest();return i.idToken=t,Ve(e,i)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ve(e,t)}buildRequest(){const e={requestUri:hh,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const 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=Xe(t)}return e}}/**
|
|
1022
1022
|
* @license
|
|
1023
1023
|
* Copyright 2020 Google LLC
|
|
1024
1024
|
*
|
|
@@ -1033,7 +1033,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1033
1033
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1034
1034
|
* See the License for the specific language governing permissions and
|
|
1035
1035
|
* limitations under the License.
|
|
1036
|
-
*/function
|
|
1036
|
+
*/function uh(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 dh(n){const e=lt(ct(n)).link,t=e?lt(ct(e)).deep_link_id:null,i=lt(ct(n)).deep_link_id;return(i?lt(ct(i)).link:null)||i||t||e||n}class Ri{constructor(e){var t,i,s,r,o,a;const l=lt(ct(e)),c=(t=l.apiKey)!==null&&t!==void 0?t:null,u=(i=l.oobCode)!==null&&i!==void 0?i:null,h=uh((s=l.mode)!==null&&s!==void 0?s:null);g(c&&u&&h,"argument-error"),this.apiKey=c,this.operation=h,this.code=u,this.continueUrl=(r=l.continueUrl)!==null&&r!==void 0?r:null,this.languageCode=(o=l.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=l.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=dh(e);try{return new Ri(t)}catch{return null}}}/**
|
|
1037
1037
|
* @license
|
|
1038
1038
|
* Copyright 2020 Google LLC
|
|
1039
1039
|
*
|
|
@@ -1048,7 +1048,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1048
1048
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1049
1049
|
* See the License for the specific language governing permissions and
|
|
1050
1050
|
* limitations under the License.
|
|
1051
|
-
*/class
|
|
1051
|
+
*/class tt{constructor(){this.providerId=tt.PROVIDER_ID}static credential(e,t){return yt._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const i=Ri.parseLink(t);return g(i,"argument-error"),yt._fromEmailAndCode(e,i.code,i.tenantId)}}tt.PROVIDER_ID="password";tt.EMAIL_PASSWORD_SIGN_IN_METHOD="password";tt.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
|
|
1052
1052
|
* @license
|
|
1053
1053
|
* Copyright 2020 Google LLC
|
|
1054
1054
|
*
|
|
@@ -1063,7 +1063,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1063
1063
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1064
1064
|
* See the License for the specific language governing permissions and
|
|
1065
1065
|
* limitations under the License.
|
|
1066
|
-
*/class
|
|
1066
|
+
*/class Xr{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}}/**
|
|
1067
1067
|
* @license
|
|
1068
1068
|
* Copyright 2019 Google LLC
|
|
1069
1069
|
*
|
|
@@ -1078,7 +1078,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1078
1078
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1079
1079
|
* See the License for the specific language governing permissions and
|
|
1080
1080
|
* limitations under the License.
|
|
1081
|
-
*/class
|
|
1081
|
+
*/class At extends Xr{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
|
|
1082
1082
|
* @license
|
|
1083
1083
|
* Copyright 2020 Google LLC
|
|
1084
1084
|
*
|
|
@@ -1093,7 +1093,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1093
1093
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1094
1094
|
* See the License for the specific language governing permissions and
|
|
1095
1095
|
* limitations under the License.
|
|
1096
|
-
*/class ae extends
|
|
1096
|
+
*/class ae extends At{constructor(){super("facebook.com")}static credential(e){return Ae._fromParams({providerId:ae.PROVIDER_ID,signInMethod:ae.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ae.credentialFromTaggedObject(e)}static credentialFromError(e){return ae.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ae.credential(e.oauthAccessToken)}catch{return null}}}ae.FACEBOOK_SIGN_IN_METHOD="facebook.com";ae.PROVIDER_ID="facebook.com";/**
|
|
1097
1097
|
* @license
|
|
1098
1098
|
* Copyright 2020 Google LLC
|
|
1099
1099
|
*
|
|
@@ -1108,7 +1108,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1108
1108
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1109
1109
|
* See the License for the specific language governing permissions and
|
|
1110
1110
|
* limitations under the License.
|
|
1111
|
-
*/class le extends
|
|
1111
|
+
*/class le extends At{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Ae._fromParams({providerId:le.PROVIDER_ID,signInMethod:le.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return le.credentialFromTaggedObject(e)}static credentialFromError(e){return le.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:i}=e;if(!t&&!i)return null;try{return le.credential(t,i)}catch{return null}}}le.GOOGLE_SIGN_IN_METHOD="google.com";le.PROVIDER_ID="google.com";/**
|
|
1112
1112
|
* @license
|
|
1113
1113
|
* Copyright 2020 Google LLC
|
|
1114
1114
|
*
|
|
@@ -1123,7 +1123,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1123
1123
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1124
1124
|
* See the License for the specific language governing permissions and
|
|
1125
1125
|
* limitations under the License.
|
|
1126
|
-
*/class ce extends
|
|
1126
|
+
*/class ce extends At{constructor(){super("github.com")}static credential(e){return Ae._fromParams({providerId:ce.PROVIDER_ID,signInMethod:ce.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ce.credentialFromTaggedObject(e)}static credentialFromError(e){return ce.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ce.credential(e.oauthAccessToken)}catch{return null}}}ce.GITHUB_SIGN_IN_METHOD="github.com";ce.PROVIDER_ID="github.com";/**
|
|
1127
1127
|
* @license
|
|
1128
1128
|
* Copyright 2020 Google LLC
|
|
1129
1129
|
*
|
|
@@ -1138,7 +1138,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1138
1138
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1139
1139
|
* See the License for the specific language governing permissions and
|
|
1140
1140
|
* limitations under the License.
|
|
1141
|
-
*/class he extends
|
|
1141
|
+
*/class he extends At{constructor(){super("twitter.com")}static credential(e,t){return Ae._fromParams({providerId:he.PROVIDER_ID,signInMethod:he.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return he.credentialFromTaggedObject(e)}static credentialFromError(e){return he.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:i}=e;if(!t||!i)return null;try{return he.credential(t,i)}catch{return null}}}he.TWITTER_SIGN_IN_METHOD="twitter.com";he.PROVIDER_ID="twitter.com";/**
|
|
1142
1142
|
* @license
|
|
1143
1143
|
* Copyright 2020 Google LLC
|
|
1144
1144
|
*
|
|
@@ -1153,7 +1153,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1153
1153
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1154
1154
|
* See the License for the specific language governing permissions and
|
|
1155
1155
|
* limitations under the License.
|
|
1156
|
-
*/class
|
|
1156
|
+
*/class qe{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,s=!1){const r=await J._fromIdTokenResponse(e,i,s),o=Ss(i);return new qe({user:r,providerId:o,_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){await e._updateTokensIfNecessary(i,!0);const s=Ss(i);return new qe({user:e,providerId:s,_tokenResponse:i,operationType:t})}}function Ss(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
|
|
1157
1157
|
* @license
|
|
1158
1158
|
* Copyright 2020 Google LLC
|
|
1159
1159
|
*
|
|
@@ -1168,7 +1168,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1168
1168
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1169
1169
|
* See the License for the specific language governing permissions and
|
|
1170
1170
|
* limitations under the License.
|
|
1171
|
-
*/class
|
|
1171
|
+
*/class en extends Ee{constructor(e,t,i,s){var r;super(t.code,t.message),this.operationType=i,this.user=s,Object.setPrototypeOf(this,en.prototype),this.customData={appName:e.name,tenantId:(r=e.tenantId)!==null&&r!==void 0?r:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,s){return new en(e,t,i,s)}}function Zr(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(r=>{throw r.code==="auth/multi-factor-auth-required"?en._fromErrorAndOperation(n,r,e,i):r})}async function fh(n,e,t=!1){const i=await vt(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return qe._forOperation(n,"link",i)}/**
|
|
1172
1172
|
* @license
|
|
1173
1173
|
* Copyright 2019 Google LLC
|
|
1174
1174
|
*
|
|
@@ -1183,7 +1183,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1183
1183
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1184
1184
|
* See the License for the specific language governing permissions and
|
|
1185
1185
|
* limitations under the License.
|
|
1186
|
-
*/async function
|
|
1186
|
+
*/async function ph(n,e,t=!1){const{auth:i}=n;if(H(i.app))return Promise.reject(pe(i));const s="reauthenticate";try{const r=await vt(n,Zr(i,s,e,n),t);g(r.idToken,i,"internal-error");const o=Ti(r.idToken);g(o,i,"internal-error");const{sub:a}=o;return g(n.uid===a,i,"user-mismatch"),qe._forOperation(n,s,r)}catch(r){throw(r==null?void 0:r.code)==="auth/user-not-found"&&z(i,"user-mismatch"),r}}/**
|
|
1187
1187
|
* @license
|
|
1188
1188
|
* Copyright 2020 Google LLC
|
|
1189
1189
|
*
|
|
@@ -1198,7 +1198,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1198
1198
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1199
1199
|
* See the License for the specific language governing permissions and
|
|
1200
1200
|
* limitations under the License.
|
|
1201
|
-
*/async function
|
|
1201
|
+
*/async function eo(n,e,t=!1){if(H(n.app))return Promise.reject(pe(n));const i="signIn",s=await Zr(n,i,e),r=await qe._fromIdTokenResponse(n,i,s);return t||await n._updateCurrentUser(r.user),r}async function _h(n,e){return eo(et(n),e)}/**
|
|
1202
1202
|
* @license
|
|
1203
1203
|
* Copyright 2020 Google LLC
|
|
1204
1204
|
*
|
|
@@ -1213,7 +1213,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1213
1213
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1214
1214
|
* See the License for the specific language governing permissions and
|
|
1215
1215
|
* limitations under the License.
|
|
1216
|
-
*/async function
|
|
1216
|
+
*/async function gh(n){const e=et(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function mh(n,e,t){return H(n.app)?Promise.reject(pe(n)):_h(F(n),tt.credential(e,t)).catch(async i=>{throw i.code==="auth/password-does-not-meet-requirements"&&gh(n),i})}/**
|
|
1217
1217
|
* @license
|
|
1218
1218
|
* Copyright 2020 Google LLC
|
|
1219
1219
|
*
|
|
@@ -1228,7 +1228,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1228
1228
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1229
1229
|
* See the License for the specific language governing permissions and
|
|
1230
1230
|
* limitations under the License.
|
|
1231
|
-
*/function
|
|
1231
|
+
*/function vh(n,e){return F(n).setPersistence(e)}function yh(n,e,t,i){return F(n).onIdTokenChanged(e,t,i)}function Eh(n,e,t){return F(n).beforeAuthStateChanged(e,t)}function Jp(n,e,t,i){return F(n).onAuthStateChanged(e,t,i)}function Ih(n){return F(n).signOut()}const tn="__sak";/**
|
|
1232
1232
|
* @license
|
|
1233
1233
|
* Copyright 2019 Google LLC
|
|
1234
1234
|
*
|
|
@@ -1243,7 +1243,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1243
1243
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1244
1244
|
* See the License for the specific language governing permissions and
|
|
1245
1245
|
* limitations under the License.
|
|
1246
|
-
*/class
|
|
1246
|
+
*/class to{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(tn,"1"),this.storage.removeItem(tn),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){const 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()}}/**
|
|
1247
1247
|
* @license
|
|
1248
1248
|
* Copyright 2020 Google LLC
|
|
1249
1249
|
*
|
|
@@ -1258,7 +1258,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1258
1258
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1259
1259
|
* See the License for the specific language governing permissions and
|
|
1260
1260
|
* limitations under the License.
|
|
1261
|
-
*/const
|
|
1261
|
+
*/const wh=1e3,Ch=10;class no extends to{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=qr(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),s=this.localCache[t];i!==s&&e(t,s,i)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const i=e.key;t?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(i);!t&&this.localCache[i]===o||this.notifyListeners(i,o)},r=this.storage.getItem(i);Hc()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,Ch):s()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const s of Array.from(i))s(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},wh)}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){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}no.type="LOCAL";const io=no;/**
|
|
1262
1262
|
* @license
|
|
1263
1263
|
* Copyright 2020 Google LLC
|
|
1264
1264
|
*
|
|
@@ -1273,7 +1273,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1273
1273
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1274
1274
|
* See the License for the specific language governing permissions and
|
|
1275
1275
|
* limitations under the License.
|
|
1276
|
-
*/class
|
|
1276
|
+
*/class so extends to{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}so.type="SESSION";const ro=so;/**
|
|
1277
1277
|
* @license
|
|
1278
1278
|
* Copyright 2019 Google LLC
|
|
1279
1279
|
*
|
|
@@ -1288,7 +1288,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1288
1288
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1289
1289
|
* See the License for the specific language governing permissions and
|
|
1290
1290
|
* limitations under the License.
|
|
1291
|
-
*/function
|
|
1291
|
+
*/function Th(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
|
|
1292
1292
|
* @license
|
|
1293
1293
|
* Copyright 2019 Google LLC
|
|
1294
1294
|
*
|
|
@@ -1303,7 +1303,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1303
1303
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1304
1304
|
* See the License for the specific language governing permissions and
|
|
1305
1305
|
* limitations under the License.
|
|
1306
|
-
*/class
|
|
1306
|
+
*/class yn{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(s=>s.isListeningto(e));if(t)return t;const i=new yn(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:i,eventType:s,data:r}=t.data,o=this.handlersMap[s];if(!(o!=null&&o.size))return;t.ports[0].postMessage({status:"ack",eventId:i,eventType:s});const a=Array.from(o).map(async c=>c(t.origin,r)),l=await Th(a);t.ports[0].postMessage({status:"done",eventId:i,eventType:s,response:l})}_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)}}yn.receivers=[];/**
|
|
1307
1307
|
* @license
|
|
1308
1308
|
* Copyright 2020 Google LLC
|
|
1309
1309
|
*
|
|
@@ -1318,7 +1318,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1318
1318
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1319
1319
|
* See the License for the specific language governing permissions and
|
|
1320
1320
|
* limitations under the License.
|
|
1321
|
-
*/function
|
|
1321
|
+
*/function ki(n="",e=10){let t="";for(let i=0;i<e;i++)t+=Math.floor(Math.random()*10);return n+t}/**
|
|
1322
1322
|
* @license
|
|
1323
1323
|
* Copyright 2019 Google LLC
|
|
1324
1324
|
*
|
|
@@ -1333,7 +1333,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1333
1333
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1334
1334
|
* See the License for the specific language governing permissions and
|
|
1335
1335
|
* limitations under the License.
|
|
1336
|
-
*/class
|
|
1336
|
+
*/class Sh{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,i=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let r,o;return new Promise((a,l)=>{const c=ki("",20);s.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},i);o={messageChannel:s,onMessage(h){const d=h;if(d.data.eventId===c)switch(d.data.status){case"ack":clearTimeout(u),r=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(d.data.response);break;default:clearTimeout(u),clearTimeout(r),l(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
|
|
1337
1337
|
* @license
|
|
1338
1338
|
* Copyright 2020 Google LLC
|
|
1339
1339
|
*
|
|
@@ -1348,7 +1348,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1348
1348
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1349
1349
|
* See the License for the specific language governing permissions and
|
|
1350
1350
|
* limitations under the License.
|
|
1351
|
-
*/function K(){return window}function
|
|
1351
|
+
*/function K(){return window}function bh(n){K().location.href=n}/**
|
|
1352
1352
|
* @license
|
|
1353
1353
|
* Copyright 2020 Google LLC.
|
|
1354
1354
|
*
|
|
@@ -1363,7 +1363,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1363
1363
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1364
1364
|
* See the License for the specific language governing permissions and
|
|
1365
1365
|
* limitations under the License.
|
|
1366
|
-
*/function
|
|
1366
|
+
*/function oo(){return typeof K().WorkerGlobalScope<"u"&&typeof K().importScripts=="function"}async function Rh(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function kh(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Nh(){return oo()?self:null}/**
|
|
1367
1367
|
* @license
|
|
1368
1368
|
* Copyright 2019 Google LLC
|
|
1369
1369
|
*
|
|
@@ -1378,7 +1378,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1378
1378
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1379
1379
|
* See the License for the specific language governing permissions and
|
|
1380
1380
|
* limitations under the License.
|
|
1381
|
-
*/const
|
|
1381
|
+
*/const ao="firebaseLocalStorageDb",Ah=1,nn="firebaseLocalStorage",lo="fbase_key";class Pt{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)})})}}function En(n,e){return n.transaction([nn],e?"readwrite":"readonly").objectStore(nn)}function Ph(){const n=indexedDB.deleteDatabase(ao);return new Pt(n).toPromise()}function ti(){const n=indexedDB.open(ao,Ah);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const i=n.result;try{i.createObjectStore(nn,{keyPath:lo})}catch(s){t(s)}}),n.addEventListener("success",async()=>{const i=n.result;i.objectStoreNames.contains(nn)?e(i):(i.close(),await Ph(),e(await ti()))})})}async function bs(n,e,t){const i=En(n,!0).put({[lo]:e,value:t});return new Pt(i).toPromise()}async function Oh(n,e){const t=En(n,!1).get(e),i=await new Pt(t).toPromise();return i===void 0?null:i.value}function Rs(n,e){const t=En(n,!0).delete(e);return new Pt(t).toPromise()}const Dh=800,Mh=3;class co{constructor(){this.type="LOCAL",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.db?this.db:(this.db=await ti(),this.db)}async _withRetries(e){let t=0;for(;;)try{const i=await this._openDb();return await e(i)}catch(i){if(t++>Mh)throw i;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return oo()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=yn._getInstance(Nh()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Rh(),!this.activeServiceWorker)return;this.sender=new Sh(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&!((e=i[0])===null||e===void 0)&&e.fulfilled&&!((t=i[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||kh()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await ti();return await bs(e,tn,"1"),await Rs(e,tn),!0}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(i=>bs(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(i=>Oh(i,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Rs(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const r=En(s,!1).getAll();return new Pt(r).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],i=new Set;if(e.length!==0)for(const{fbase_key:s,value:r}of e)i.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(r)&&(this.notifyListeners(s,r),t.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!i.has(s)&&(this.notifyListeners(s,null),t.push(s));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const s of Array.from(i))s(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Dh)}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()}}co.type="LOCAL";const Lh=co;new Nt(3e4,6e4);/**
|
|
1382
1382
|
* @license
|
|
1383
1383
|
* Copyright 2021 Google LLC
|
|
1384
1384
|
*
|
|
@@ -1393,7 +1393,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1393
1393
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1394
1394
|
* See the License for the specific language governing permissions and
|
|
1395
1395
|
* limitations under the License.
|
|
1396
|
-
*/function
|
|
1396
|
+
*/function xh(n,e){return e?X(e):(g(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
|
|
1397
1397
|
* @license
|
|
1398
1398
|
* Copyright 2019 Google LLC
|
|
1399
1399
|
*
|
|
@@ -1408,7 +1408,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1408
1408
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1409
1409
|
* See the License for the specific language governing permissions and
|
|
1410
1410
|
* limitations under the License.
|
|
1411
|
-
*/class Ni extends
|
|
1411
|
+
*/class Ni extends bi{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ve(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Ve(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Ve(e,this._buildIdpRequest())}_buildIdpRequest(e){const 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}}function Fh(n){return eo(n.auth,new Ni(n),n.bypassAuthState)}function Uh(n){const{auth:e,user:t}=n;return g(t,e,"internal-error"),ph(t,new Ni(n),n.bypassAuthState)}async function Wh(n){const{auth:e,user:t}=n;return g(t,e,"internal-error"),fh(t,new Ni(n),n.bypassAuthState)}/**
|
|
1412
1412
|
* @license
|
|
1413
1413
|
* Copyright 2020 Google LLC
|
|
1414
1414
|
*
|
|
@@ -1423,7 +1423,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1423
1423
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1424
1424
|
* See the License for the specific language governing permissions and
|
|
1425
1425
|
* limitations under the License.
|
|
1426
|
-
*/class
|
|
1426
|
+
*/class ho{constructor(e,t,i,s,r=!1){this.auth=e,this.resolver=i,this.user=s,this.bypassAuthState=r,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(i){this.reject(i)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:i,postBody:s,tenantId:r,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:t,sessionId:i,tenantId:r||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Fh;case"linkViaPopup":case"linkViaRedirect":return Wh;case"reauthViaPopup":case"reauthViaRedirect":return Uh;default:z(this.auth,"internal-error")}}resolve(e){ne(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ne(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()}}/**
|
|
1427
1427
|
* @license
|
|
1428
1428
|
* Copyright 2020 Google LLC
|
|
1429
1429
|
*
|
|
@@ -1438,7 +1438,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1438
1438
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1439
1439
|
* See the License for the specific language governing permissions and
|
|
1440
1440
|
* limitations under the License.
|
|
1441
|
-
*/const
|
|
1441
|
+
*/const Bh=new Nt(2e3,1e4);class Fe extends ho{constructor(e,t,i,s,r){super(e,t,s,r),this.provider=i,this.authWindow=null,this.pollId=null,Fe.currentPopupAction&&Fe.currentPopupAction.cancel(),Fe.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return g(e,this.auth,"internal-error"),e}async onExecution(){ne(this.filter.length===1,"Popup operations only handle one event");const e=ki();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(q(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(q(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fe.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,i;if(!((i=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||i===void 0)&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(q(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Bh.get())};e()}}Fe.currentPopupAction=null;/**
|
|
1442
1442
|
* @license
|
|
1443
1443
|
* Copyright 2020 Google LLC
|
|
1444
1444
|
*
|
|
@@ -1453,7 +1453,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1453
1453
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1454
1454
|
* See the License for the specific language governing permissions and
|
|
1455
1455
|
* limitations under the License.
|
|
1456
|
-
*/const
|
|
1456
|
+
*/const Hh="pendingRedirect",jt=new Map;class Vh extends ho{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=jt.get(this.auth._key());if(!e){try{const i=await $h(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}jt.set(this.auth._key(),e)}return this.bypassAuthState||jt.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){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function $h(n,e){const t=zh(e),i=jh(n);if(!await i._isAvailable())return!1;const s=await i._get(t)==="true";return await i._remove(t),s}function Gh(n,e){jt.set(n._key(),e)}function jh(n){return X(n._redirectPersistence)}function zh(n){return Gt(Hh,n.config.apiKey,n.name)}async function qh(n,e,t=!1){if(H(n.app))return Promise.reject(pe(n));const i=et(n),s=xh(i,e),o=await new Vh(i,s,t).execute();return o&&!t&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,e)),o}/**
|
|
1457
1457
|
* @license
|
|
1458
1458
|
* Copyright 2020 Google LLC
|
|
1459
1459
|
*
|
|
@@ -1468,7 +1468,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1468
1468
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1469
1469
|
* See the License for the specific language governing permissions and
|
|
1470
1470
|
* limitations under the License.
|
|
1471
|
-
*/const
|
|
1471
|
+
*/const Kh=10*60*1e3;class Yh{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(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Qh(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!uo(e)){const s=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(q(this.auth,s))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Kh&&this.cachedEventUids.clear(),this.cachedEventUids.has(ks(e))}saveEventToCache(e){this.cachedEventUids.add(ks(e)),this.lastProcessedEventTime=Date.now()}}function ks(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function uo({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Qh(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return uo(n);default:return!1}}/**
|
|
1472
1472
|
* @license
|
|
1473
1473
|
* Copyright 2020 Google LLC
|
|
1474
1474
|
*
|
|
@@ -1483,7 +1483,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1483
1483
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1484
1484
|
* See the License for the specific language governing permissions and
|
|
1485
1485
|
* limitations under the License.
|
|
1486
|
-
*/async function
|
|
1486
|
+
*/async function Jh(n,e={}){return Ie(n,"GET","/v1/projects",e)}/**
|
|
1487
1487
|
* @license
|
|
1488
1488
|
* Copyright 2020 Google LLC
|
|
1489
1489
|
*
|
|
@@ -1498,7 +1498,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1498
1498
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1499
1499
|
* See the License for the specific language governing permissions and
|
|
1500
1500
|
* limitations under the License.
|
|
1501
|
-
*/const
|
|
1501
|
+
*/const Xh=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zh=/^https?/;async function eu(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Jh(n);for(const t of e)try{if(tu(t))return}catch{}z(n,"unauthorized-domain")}function tu(n){const e=Xn(),{protocol:t,hostname:i}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&i===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===i}if(!Zh.test(t))return!1;if(Xh.test(n))return i===n;const s=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(i)}/**
|
|
1502
1502
|
* @license
|
|
1503
1503
|
* Copyright 2020 Google LLC.
|
|
1504
1504
|
*
|
|
@@ -1513,7 +1513,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1513
1513
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1514
1514
|
* See the License for the specific language governing permissions and
|
|
1515
1515
|
* limitations under the License.
|
|
1516
|
-
*/const
|
|
1516
|
+
*/const nu=new Nt(3e4,6e4);function Ns(){const n=K().___jsl;if(n!=null&&n.H){for(const 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 iu(n){return new Promise((e,t)=>{var i,s,r;function o(){Ns(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ns(),t(q(n,"network-request-failed"))},timeout:nu.get()})}if(!((s=(i=K().gapi)===null||i===void 0?void 0:i.iframes)===null||s===void 0)&&s.Iframe)e(gapi.iframes.getContext());else if(!((r=K().gapi)===null||r===void 0)&&r.load)o();else{const a=Qc("iframefcb");return K()[a]=()=>{gapi.load?o():t(q(n,"network-request-failed"))},Yr(`${Yc()}?onload=${a}`).catch(l=>t(l))}}).catch(e=>{throw zt=null,e})}let zt=null;function su(n){return zt=zt||iu(n),zt}/**
|
|
1517
1517
|
* @license
|
|
1518
1518
|
* Copyright 2020 Google LLC.
|
|
1519
1519
|
*
|
|
@@ -1528,7 +1528,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1528
1528
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1529
1529
|
* See the License for the specific language governing permissions and
|
|
1530
1530
|
* limitations under the License.
|
|
1531
|
-
*/const
|
|
1531
|
+
*/const ru=new Nt(5e3,15e3),ou="__/auth/iframe",au="emulator/auth/iframe",lu={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},cu=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function hu(n){const e=n.config;g(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Ci(e,au):`https://${n.config.authDomain}/${ou}`,i={apiKey:e.apiKey,appName:n.name,v:Ze},s=cu.get(n.config.apiHost);s&&(i.eid=s);const r=n._getFrameworks();return r.length&&(i.fw=r.join(",")),`${t}?${Xe(i).slice(1)}`}async function uu(n){const e=await su(n),t=K().gapi;return g(t,n,"internal-error"),e.open({where:document.body,url:hu(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:lu,dontclear:!0},i=>new Promise(async(s,r)=>{await i.restyle({setHideOnLeave:!1});const o=q(n,"network-request-failed"),a=K().setTimeout(()=>{r(o)},ru.get());function l(){K().clearTimeout(a),s(i)}i.ping(l).then(l,()=>{r(o)})}))}/**
|
|
1532
1532
|
* @license
|
|
1533
1533
|
* Copyright 2020 Google LLC.
|
|
1534
1534
|
*
|
|
@@ -1543,7 +1543,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1543
1543
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1544
1544
|
* See the License for the specific language governing permissions and
|
|
1545
1545
|
* limitations under the License.
|
|
1546
|
-
*/const
|
|
1546
|
+
*/const du={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},fu=500,pu=600,_u="_blank",gu="http://localhost";class As{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function mu(n,e,t,i=fu,s=pu){const r=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const l=Object.assign(Object.assign({},du),{width:i.toString(),height:s.toString(),top:r,left:o}),c=x().toLowerCase();t&&(a=Vr(c)?_u:t),Br(c)&&(e=e||gu,l.scrollbars="yes");const u=Object.entries(l).reduce((d,[p,_])=>`${d}${p}=${_},`,"");if(Bc(c)&&a!=="_self")return vu(e||"",a),new As(null);const h=window.open(e||"",a,u);g(h,n,"popup-blocked");try{h.focus()}catch{}return new As(h)}function vu(n,e){const t=document.createElement("a");t.href=n,t.target=e;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}/**
|
|
1547
1547
|
* @license
|
|
1548
1548
|
* Copyright 2021 Google LLC
|
|
1549
1549
|
*
|
|
@@ -1558,7 +1558,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1558
1558
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1559
1559
|
* See the License for the specific language governing permissions and
|
|
1560
1560
|
* limitations under the License.
|
|
1561
|
-
*/const
|
|
1561
|
+
*/const yu="__/auth/handler",Eu="emulator/auth/handler",Iu=encodeURIComponent("fac");async function Ps(n,e,t,i,s,r){g(n.config.authDomain,n,"auth-domain-config-required"),g(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:Ze,eventId:s};if(e instanceof Xr){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",zn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,h]of Object.entries({}))o[u]=h}if(e instanceof At){const u=e.getScopes().filter(h=>h!=="");u.length>0&&(o.scopes=u.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await n._getAppCheckToken(),c=l?`#${Iu}=${encodeURIComponent(l)}`:"";return`${wu(n)}?${Xe(a).slice(1)}${c}`}function wu({config:n}){return n.emulator?Ci(n,Eu):`https://${n.authDomain}/${yu}`}/**
|
|
1562
1562
|
* @license
|
|
1563
1563
|
* Copyright 2020 Google LLC
|
|
1564
1564
|
*
|
|
@@ -1573,7 +1573,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1573
1573
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1574
1574
|
* See the License for the specific language governing permissions and
|
|
1575
1575
|
* limitations under the License.
|
|
1576
|
-
*/const
|
|
1576
|
+
*/const xn="webStorageSupport";class Cu{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ro,this._completeRedirectFn=qh,this._overrideRedirectResult=Gh}async _openPopup(e,t,i,s){var r;ne((r=this.eventManagers[e._key()])===null||r===void 0?void 0:r.manager,"_initialize() not called before _openPopup()");const o=await Ps(e,t,i,Xn(),s);return mu(e,o,ki())}async _openRedirect(e,t,i,s){await this._originValidation(e);const r=await Ps(e,t,i,Xn(),s);return bh(r),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:s,promise:r}=this.eventManagers[t];return s?Promise.resolve(s):(ne(r,"If manager is not set, promise should be"),r)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await uu(e),i=new Yh(e);return t.register("authEvent",s=>(g(s==null?void 0:s.authEvent,e,"invalid-auth-event"),{status:i.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(xn,{type:xn},s=>{var r;const o=(r=s==null?void 0:s[0])===null||r===void 0?void 0:r[xn];o!==void 0&&t(!!o),z(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=eu(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return qr()||Hr()||Si()}}const Tu=Cu;var Os="@firebase/auth",Ds="1.9.1";/**
|
|
1577
1577
|
* @license
|
|
1578
1578
|
* Copyright 2020 Google LLC
|
|
1579
1579
|
*
|
|
@@ -1588,7 +1588,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1588
1588
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1589
1589
|
* See the License for the specific language governing permissions and
|
|
1590
1590
|
* limitations under the License.
|
|
1591
|
-
*/class
|
|
1591
|
+
*/class Su{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.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;const t=this.auth.onIdTokenChanged(i=>{e((i==null?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){g(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1592
1592
|
* @license
|
|
1593
1593
|
* Copyright 2020 Google LLC
|
|
1594
1594
|
*
|
|
@@ -1603,7 +1603,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1603
1603
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1604
1604
|
* See the License for the specific language governing permissions and
|
|
1605
1605
|
* limitations under the License.
|
|
1606
|
-
*/function
|
|
1606
|
+
*/function bu(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 Ru(n){ze(new Ne("auth",(e,{options:t})=>{const i=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),r=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=i.options;g(o&&!o.includes(":"),"invalid-api-key",{appName:i.name});const l={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Kr(n)},c=new zc(i,s,r,l);return nh(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),ze(new Ne("auth-internal",e=>{const t=et(e.getProvider("auth").getImmediate());return(i=>new Su(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),fe(Os,Ds,bu(n)),fe(Os,Ds,"esm2017")}/**
|
|
1607
1607
|
* @license
|
|
1608
1608
|
* Copyright 2021 Google LLC
|
|
1609
1609
|
*
|
|
@@ -1618,7 +1618,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1618
1618
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1619
1619
|
* See the License for the specific language governing permissions and
|
|
1620
1620
|
* limitations under the License.
|
|
1621
|
-
*/const
|
|
1621
|
+
*/const ku=5*60,Nu=Ir("authIdTokenMaxAge")||ku;let Ms=null;const Au=n=>async e=>{const t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>Nu)return;const s=t==null?void 0:t.token;Ms!==s&&(Ms=s,await fetch(n,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function Pu(n=kr()){const e=Ii(n,"auth");if(e.isInitialized())return e.getImmediate();const t=th(n,{popupRedirectResolver:Tu,persistence:[Lh,io,ro]}),i=Ir("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){const r=new URL(i,location.origin);if(location.origin===r.origin){const o=Au(r.toString());Eh(t,o,()=>o(t.currentUser)),yh(t,a=>o(a))}}const s=yr("auth");return s&&ih(t,`http://${s}`),t}function Ou(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}qc({loadJS(n){return new Promise((e,t)=>{const i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=s=>{const r=q("internal-error");r.customData=s,t(r)},i.type="text/javascript",i.charset="UTF-8",Ou().appendChild(i)})},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="});Ru("Browser");var Ls={};const xs="@firebase/database",Fs="1.0.13";/**
|
|
1622
1622
|
* @license
|
|
1623
1623
|
* Copyright 2019 Google LLC
|
|
1624
1624
|
*
|
|
@@ -1633,7 +1633,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1633
1633
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1634
1634
|
* See the License for the specific language governing permissions and
|
|
1635
1635
|
* limitations under the License.
|
|
1636
|
-
*/let
|
|
1636
|
+
*/let fo="";function Du(n){fo=n}/**
|
|
1637
1637
|
* @license
|
|
1638
1638
|
* Copyright 2017 Google LLC
|
|
1639
1639
|
*
|
|
@@ -1648,7 +1648,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1648
1648
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1649
1649
|
* See the License for the specific language governing permissions and
|
|
1650
1650
|
* limitations under the License.
|
|
1651
|
-
*/class
|
|
1651
|
+
*/class Mu{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){t==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),N(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:gt(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}/**
|
|
1652
1652
|
* @license
|
|
1653
1653
|
* Copyright 2017 Google LLC
|
|
1654
1654
|
*
|
|
@@ -1663,7 +1663,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1663
1663
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1664
1664
|
* See the License for the specific language governing permissions and
|
|
1665
1665
|
* limitations under the License.
|
|
1666
|
-
*/class
|
|
1666
|
+
*/class Lu{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return se(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}/**
|
|
1667
1667
|
* @license
|
|
1668
1668
|
* Copyright 2017 Google LLC
|
|
1669
1669
|
*
|
|
@@ -1678,7 +1678,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1678
1678
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1679
1679
|
* See the License for the specific language governing permissions and
|
|
1680
1680
|
* limitations under the License.
|
|
1681
|
-
*/const
|
|
1681
|
+
*/const po=function(n){try{if(typeof window<"u"&&typeof window[n]<"u"){const e=window[n];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new Mu(e)}}catch{}return new Lu},Re=po("localStorage"),xu=po("sessionStorage");/**
|
|
1682
1682
|
* @license
|
|
1683
1683
|
* Copyright 2017 Google LLC
|
|
1684
1684
|
*
|
|
@@ -1693,7 +1693,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1693
1693
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1694
1694
|
* See the License for the specific language governing permissions and
|
|
1695
1695
|
* limitations under the License.
|
|
1696
|
-
*/const
|
|
1696
|
+
*/const $e=new yi("@firebase/database"),Fu=function(){let n=1;return function(){return n++}}(),_o=function(n){const e=hl(n),t=new ol;t.update(e);const i=t.digest();return _i.encodeByteArray(i)},Ot=function(...n){let e="";for(let t=0;t<n.length;t++){const i=n[t];Array.isArray(i)||i&&typeof i=="object"&&typeof i.length=="number"?e+=Ot.apply(null,i):typeof i=="object"?e+=N(i):e+=i,e+=" "}return e};let ut=null,Us=!0;const Uu=function(n,e){f(!0,"Can't turn on custom loggers persistently."),$e.logLevel=C.VERBOSE,ut=$e.log.bind($e)},M=function(...n){if(Us===!0&&(Us=!1,ut===null&&xu.get("logging_enabled")===!0&&Uu()),ut){const e=Ot.apply(null,n);ut(e)}},Dt=function(n){return function(...e){M(n,...e)}},ni=function(...n){const e="FIREBASE INTERNAL ERROR: "+Ot(...n);$e.error(e)},ie=function(...n){const e=`FIREBASE FATAL ERROR: ${Ot(...n)}`;throw $e.error(e),new Error(e)},B=function(...n){const e="FIREBASE WARNING: "+Ot(...n);$e.warn(e)},Wu=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&B("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},go=function(n){return typeof n=="number"&&(n!==n||n===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY)},Bu=function(n){if(document.readyState==="complete")n();else{let e=!1;const t=function(){if(!document.body){setTimeout(t,Math.floor(10));return}e||(e=!0,n())};document.addEventListener?(document.addEventListener("DOMContentLoaded",t,!1),window.addEventListener("load",t,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()}),window.attachEvent("onload",t))}},Ke="[MIN_NAME]",Pe="[MAX_NAME]",nt=function(n,e){if(n===e)return 0;if(n===Ke||e===Pe)return-1;if(e===Ke||n===Pe)return 1;{const t=Ws(n),i=Ws(e);return t!==null?i!==null?t-i===0?n.length-e.length:t-i:-1:i!==null?1:n<e?-1:1}},Hu=function(n,e){return n===e?0:n<e?-1:1},st=function(n,e){if(e&&n in e)return e[n];throw new Error("Missing required key ("+n+") in object: "+N(e))},Ai=function(n){if(typeof n!="object"||n===null)return N(n);const e=[];for(const i in n)e.push(i);e.sort();let t="{";for(let i=0;i<e.length;i++)i!==0&&(t+=","),t+=N(e[i]),t+=":",t+=Ai(n[e[i]]);return t+="}",t},mo=function(n,e){const t=n.length;if(t<=e)return[n];const i=[];for(let s=0;s<t;s+=e)s+e>t?i.push(n.substring(s,t)):i.push(n.substring(s,s+e));return i};function W(n,e){for(const t in n)n.hasOwnProperty(t)&&e(t,n[t])}const vo=function(n){f(!go(n),"Invalid JSON number");const e=11,t=52,i=(1<<e-1)-1;let s,r,o,a,l;n===0?(r=0,o=0,s=1/n===-1/0?1:0):(s=n<0,n=Math.abs(n),n>=Math.pow(2,1-i)?(a=Math.min(Math.floor(Math.log(n)/Math.LN2),i),r=a+i,o=Math.round(n*Math.pow(2,t-a)-Math.pow(2,t))):(r=0,o=Math.round(n/Math.pow(2,1-i-t))));const c=[];for(l=t;l;l-=1)c.push(o%2?1:0),o=Math.floor(o/2);for(l=e;l;l-=1)c.push(r%2?1:0),r=Math.floor(r/2);c.push(s?1:0),c.reverse();const u=c.join("");let h="";for(l=0;l<64;l+=8){let d=parseInt(u.substr(l,8),2).toString(16);d.length===1&&(d="0"+d),h=h+d}return h.toLowerCase()},Vu=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},$u=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function Gu(n,e){let t="Unknown Error";n==="too_big"?t="The data requested exceeds the maximum size that can be accessed with a single request.":n==="permission_denied"?t="Client doesn't have permission to access the desired data.":n==="unavailable"&&(t="The service is unavailable");const i=new Error(n+" at "+e._path.toString()+": "+t);return i.code=n.toUpperCase(),i}const ju=new RegExp("^-?(0*)\\d{1,10}$"),zu=-2147483648,qu=2147483647,Ws=function(n){if(ju.test(n)){const e=Number(n);if(e>=zu&&e<=qu)return e}return null},Mt=function(n){try{n()}catch(e){setTimeout(()=>{const t=e.stack||"";throw B("Exception was thrown by user callback.",t),e},Math.floor(0))}},Ku=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},dt=function(n,e){const t=setTimeout(n,e);return typeof t=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(t):typeof t=="object"&&t.unref&&t.unref(),t};/**
|
|
1697
1697
|
* @license
|
|
1698
1698
|
* Copyright 2021 Google LLC
|
|
1699
1699
|
*
|
|
@@ -1708,7 +1708,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1708
1708
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1709
1709
|
* See the License for the specific language governing permissions and
|
|
1710
1710
|
* limitations under the License.
|
|
1711
|
-
*/class
|
|
1711
|
+
*/class Yu{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,H(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t==null?void 0:t.getImmediate({optional:!0}),this.appCheck||t==null||t.get().then(i=>this.appCheck=i)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,i)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){var t;(t=this.appCheckProvider)===null||t===void 0||t.get().then(i=>i.addTokenListener(e))}notifyForInvalidToken(){B(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}/**
|
|
1712
1712
|
* @license
|
|
1713
1713
|
* Copyright 2017 Google LLC
|
|
1714
1714
|
*
|
|
@@ -1723,7 +1723,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1723
1723
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1724
1724
|
* See the License for the specific language governing permissions and
|
|
1725
1725
|
* limitations under the License.
|
|
1726
|
-
*/class
|
|
1726
|
+
*/class Qu{constructor(e,t,i){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit(s=>this.auth_=s)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(t=>t&&t.code==="auth/token-not-initialized"?(M("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((t,i)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',B(e)}}class qt{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}qt.OWNER="owner";/**
|
|
1727
1727
|
* @license
|
|
1728
1728
|
* Copyright 2017 Google LLC
|
|
1729
1729
|
*
|
|
@@ -1738,7 +1738,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1738
1738
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1739
1739
|
* See the License for the specific language governing permissions and
|
|
1740
1740
|
* limitations under the License.
|
|
1741
|
-
*/const
|
|
1741
|
+
*/const Pi="5",yo="v",Eo="s",Io="r",wo="f",Co=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,To="ls",So="p",ii="ac",bo="websocket",Ro="long_polling";/**
|
|
1742
1742
|
* @license
|
|
1743
1743
|
* Copyright 2017 Google LLC
|
|
1744
1744
|
*
|
|
@@ -1753,7 +1753,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1753
1753
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1754
1754
|
* See the License for the specific language governing permissions and
|
|
1755
1755
|
* limitations under the License.
|
|
1756
|
-
*/class
|
|
1756
|
+
*/class ko{constructor(e,t,i,s,r=!1,o="",a=!1,l=!1,c=null){this.secure=t,this.namespace=i,this.webSocketOnly=s,this.nodeAdmin=r,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=l,this.emulatorOptions=c,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Re.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Re.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}}function Ju(n){return n.host!==n.internalHost||n.isCustomHost()||n.includeNamespaceInQueryParams}function No(n,e,t){f(typeof e=="string","typeof type must == string"),f(typeof t=="object","typeof params must == object");let i;if(e===bo)i=(n.secure?"wss://":"ws://")+n.internalHost+"/.ws?";else if(e===Ro)i=(n.secure?"https://":"http://")+n.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);Ju(n)&&(t.ns=n.namespace);const s=[];return W(t,(r,o)=>{s.push(r+"="+o)}),i+s.join("&")}/**
|
|
1757
1757
|
* @license
|
|
1758
1758
|
* Copyright 2017 Google LLC
|
|
1759
1759
|
*
|
|
@@ -1768,7 +1768,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1768
1768
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1769
1769
|
* See the License for the specific language governing permissions and
|
|
1770
1770
|
* limitations under the License.
|
|
1771
|
-
*/class
|
|
1771
|
+
*/class Xu{constructor(){this.counters_={}}incrementCounter(e,t=1){se(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return Ha(this.counters_)}}/**
|
|
1772
1772
|
* @license
|
|
1773
1773
|
* Copyright 2017 Google LLC
|
|
1774
1774
|
*
|
|
@@ -1783,7 +1783,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1783
1783
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1784
1784
|
* See the License for the specific language governing permissions and
|
|
1785
1785
|
* limitations under the License.
|
|
1786
|
-
*/const
|
|
1786
|
+
*/const Fn={},Un={};function Oi(n){const e=n.toString();return Fn[e]||(Fn[e]=new Xu),Fn[e]}function Zu(n,e){const t=n.toString();return Un[t]||(Un[t]=e()),Un[t]}/**
|
|
1787
1787
|
* @license
|
|
1788
1788
|
* Copyright 2017 Google LLC
|
|
1789
1789
|
*
|
|
@@ -1798,7 +1798,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1798
1798
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1799
1799
|
* See the License for the specific language governing permissions and
|
|
1800
1800
|
* limitations under the License.
|
|
1801
|
-
*/class
|
|
1801
|
+
*/class ed{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){const i=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let s=0;s<i.length;++s)i[s]&&Mt(()=>{this.onMessage_(i[s])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/**
|
|
1802
1802
|
* @license
|
|
1803
1803
|
* Copyright 2017 Google LLC
|
|
1804
1804
|
*
|
|
@@ -1813,7 +1813,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1813
1813
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1814
1814
|
* See the License for the specific language governing permissions and
|
|
1815
1815
|
* limitations under the License.
|
|
1816
|
-
*/const
|
|
1816
|
+
*/const Bs="start",td="close",nd="pLPCommand",id="pRTLPCB",Ao="id",Po="pw",Oo="ser",sd="cb",rd="seg",od="ts",ad="d",ld="dframe",Do=1870,Mo=30,cd=Do-Mo,hd=25e3,ud=3e4;class Ue{constructor(e,t,i,s,r,o,a){this.connId=e,this.repoInfo=t,this.applicationId=i,this.appCheckToken=s,this.authToken=r,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Dt(e),this.stats_=Oi(t),this.urlFn=l=>(this.appCheckToken&&(l[ii]=this.appCheckToken),No(t,Ro,l))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new ed(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(ud)),Bu(()=>{if(this.isClosed_)return;this.scriptTagHolder=new Di((...r)=>{const[o,a,l,c,u]=r;if(this.incrementIncomingBytes_(r),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,o===Bs)this.id=a,this.password=l;else if(o===td)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+o)},(...r)=>{const[o,a]=r;this.incrementIncomingBytes_(r),this.myPacketOrderer.handleResponse(o,a)},()=>{this.onClosed_()},this.urlFn);const i={};i[Bs]="t",i[Oo]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(i[sd]=this.scriptTagHolder.uniqueCallbackIdentifier),i[yo]=Pi,this.transportSessionId&&(i[Eo]=this.transportSessionId),this.lastSessionId&&(i[To]=this.lastSessionId),this.applicationId&&(i[So]=this.applicationId),this.appCheckToken&&(i[ii]=this.appCheckToken),typeof location<"u"&&location.hostname&&Co.test(location.hostname)&&(i[Io]=wo);const s=this.urlFn(i);this.log_("Connecting via long-poll to "+s),this.scriptTagHolder.addTag(s,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){Ue.forceAllow_=!0}static forceDisallow(){Ue.forceDisallow_=!0}static isAvailable(){return Ue.forceAllow_?!0:!Ue.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!Vu()&&!$u()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=N(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=mr(t),s=mo(i,cd);for(let r=0;r<s.length;r++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,s.length,s[r]),this.curSegmentNum++}addDisconnectPingFrame(e,t){this.myDisconnFrame=document.createElement("iframe");const i={};i[ld]="t",i[Ao]=e,i[Po]=t,this.myDisconnFrame.src=this.urlFn(i),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const t=N(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}}class Di{constructor(e,t,i,s){this.onDisconnect=i,this.urlFn=s,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=Fu(),window[nd+this.uniqueCallbackIdentifier]=e,window[id+this.uniqueCallbackIdentifier]=t,this.myIFrame=Di.createIFrame_();let r="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(r='<script>document.domain="'+document.domain+'";<\/script>');const o="<html><body>"+r+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(o),this.myIFrame.doc.close()}catch(a){M("frame writing exception"),a.stack&&M(a.stack),M(a)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||M("No IE domain setting required")}catch{const i=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+i+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[Ao]=this.myID,e[Po]=this.myPW,e[Oo]=this.currentSerial;let t=this.urlFn(e),i="",s=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+Mo+i.length<=Do;){const o=this.pendingSegs.shift();i=i+"&"+rd+s+"="+o.seg+"&"+od+s+"="+o.ts+"&"+ad+s+"="+o.d,s++}return t=t+i,this.addLongPollTag_(t,this.currentSerial),!0}else return!1}enqueueSegment(e,t,i){this.pendingSegs.push({seg:e,ts:t,d:i}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const i=()=>{this.outstandingRequests.delete(t),this.newRequest_()},s=setTimeout(i,Math.floor(hd)),r=()=>{clearTimeout(s),i()};this.addTag(e,r)}addTag(e,t){setTimeout(()=>{try{if(!this.sendNewPolls)return;const i=this.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){const s=i.readyState;(!s||s==="loaded"||s==="complete")&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=()=>{M("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(i)}catch{}},Math.floor(1))}}/**
|
|
1817
1817
|
* @license
|
|
1818
1818
|
* Copyright 2017 Google LLC
|
|
1819
1819
|
*
|
|
@@ -1828,7 +1828,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1828
1828
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1829
1829
|
* See the License for the specific language governing permissions and
|
|
1830
1830
|
* limitations under the License.
|
|
1831
|
-
*/const
|
|
1831
|
+
*/const dd=16384,fd=45e3;let sn=null;typeof MozWebSocket<"u"?sn=MozWebSocket:typeof WebSocket<"u"&&(sn=WebSocket);class V{constructor(e,t,i,s,r,o,a){this.connId=e,this.applicationId=i,this.appCheckToken=s,this.authToken=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Dt(this.connId),this.stats_=Oi(t),this.connURL=V.connectionURL_(t,o,a,s,i),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,i,s,r){const o={};return o[yo]=Pi,typeof location<"u"&&location.hostname&&Co.test(location.hostname)&&(o[Io]=wo),t&&(o[Eo]=t),i&&(o[To]=i),s&&(o[ii]=s),r&&(o[So]=r),No(e,bo,o)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Re.set("previous_websocket_failure",!0);try{let i;Xa(),this.mySock=new sn(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");const s=i.message||i.data;s&&this.log_(s),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");const s=i.message||i.data;s&&this.log_(s),this.onClosed_()}}start(){}static forceDisallow(){V.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(t);i&&i.length>1&&parseFloat(i[1])<4.4&&(e=!0)}return!e&&sn!==null&&!V.forceDisallow_}static previouslyFailed(){return Re.isInMemoryStorage||Re.get("previous_websocket_failure")===!0}markConnectionHealthy(){Re.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const t=this.frames.join("");this.frames=null;const i=gt(t);this.onMessage(i)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(f(this.frames===null,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(t);else{const i=this.extractFrameCount_(t);i!==null&&this.appendFrame_(i)}}send(e){this.resetKeepAlive();const t=N(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=mo(t,dd);i.length>1&&this.sendString_(String(i.length));for(let s=0;s<i.length;s++)this.sendString_(i[s])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(fd))}sendString_(e){try{this.mySock.send(e)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}V.responsesRequiredToBeHealthy=2;V.healthyTimeout=3e4;/**
|
|
1832
1832
|
* @license
|
|
1833
1833
|
* Copyright 2017 Google LLC
|
|
1834
1834
|
*
|
|
@@ -1843,7 +1843,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1843
1843
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1844
1844
|
* See the License for the specific language governing permissions and
|
|
1845
1845
|
* limitations under the License.
|
|
1846
|
-
*/class
|
|
1846
|
+
*/class Et{static get ALL_TRANSPORTS(){return[Ue,V]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const t=V&&V.isAvailable();let i=t&&!V.previouslyFailed();if(e.webSocketOnly&&(t||B("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[V];else{const s=this.transports_=[];for(const r of Et.ALL_TRANSPORTS)r&&r.isAvailable()&&s.push(r);Et.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}Et.globalTransportInitialized_=!1;/**
|
|
1847
1847
|
* @license
|
|
1848
1848
|
* Copyright 2017 Google LLC
|
|
1849
1849
|
*
|
|
@@ -1858,7 +1858,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1858
1858
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1859
1859
|
* See the License for the specific language governing permissions and
|
|
1860
1860
|
* limitations under the License.
|
|
1861
|
-
*/const
|
|
1861
|
+
*/const pd=6e4,_d=5e3,gd=10*1024,md=100*1024,Wn="t",Hs="d",vd="s",Vs="r",yd="e",$s="o",Gs="a",js="n",zs="p",Ed="h";class Id{constructor(e,t,i,s,r,o,a,l,c,u){this.id=e,this.repoInfo_=t,this.applicationId_=i,this.appCheckToken_=s,this.authToken_=r,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=l,this.onKill_=c,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Dt("c:"+this.id+":"),this.transportManager_=new Et(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,i)},Math.floor(0));const s=e.healthyTimeout||0;s>0&&(this.healthyTimeout_=dt(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>md?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>gd?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(s)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Wn in e){const t=e[Wn];t===Gs?this.upgradeIfSecondaryHealthy_():t===Vs?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===$s&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=st("t",e),i=st("d",e);if(t==="c")this.onSecondaryControl_(i);else if(t==="d")this.pendingDataMessages.push(i);else throw new Error("Unknown protocol layer: "+t)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:zs,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:Gs,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:js,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=st("t",e),i=st("d",e);t==="c"?this.onControl_(i):t==="d"&&this.onDataMessage_(i)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=st(Wn,e);if(Hs in e){const i=e[Hs];if(t===Ed){const s=Object.assign({},i);this.repoInfo_.isUsingEmulator&&(s.h=this.repoInfo_.host),this.onHandshake_(s)}else if(t===js){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let s=0;s<this.pendingDataMessages.length;++s)this.onDataMessage_(this.pendingDataMessages[s]);this.pendingDataMessages=[],this.tryCleanupConnection()}else t===vd?this.onConnectionShutdown_(i):t===Vs?this.onReset_(i):t===yd?ni("Server Error: "+i):t===$s?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):ni("Unknown control packet command: "+t)}}onHandshake_(e){const t=e.ts,i=e.v,s=e.h;this.sessionId=e.s,this.repoInfo_.host=s,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),Pi!==i&&B("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.secondaryConn_),i=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,i),dt(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(pd))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):dt(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(_d))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:zs,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Re.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/**
|
|
1862
1862
|
* @license
|
|
1863
1863
|
* Copyright 2017 Google LLC
|
|
1864
1864
|
*
|
|
@@ -1873,7 +1873,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1873
1873
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1874
1874
|
* See the License for the specific language governing permissions and
|
|
1875
1875
|
* limitations under the License.
|
|
1876
|
-
*/class
|
|
1876
|
+
*/class Lo{put(e,t,i,s){}merge(e,t,i,s){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,i){}onDisconnectMerge(e,t,i){}onDisconnectCancel(e,t){}reportStats(e){}}/**
|
|
1877
1877
|
* @license
|
|
1878
1878
|
* Copyright 2017 Google LLC
|
|
1879
1879
|
*
|
|
@@ -1888,7 +1888,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1888
1888
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1889
1889
|
* See the License for the specific language governing permissions and
|
|
1890
1890
|
* limitations under the License.
|
|
1891
|
-
*/class
|
|
1891
|
+
*/class xo{constructor(e){this.allowedEvents_=e,this.listeners_={},f(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){const i=[...this.listeners_[e]];for(let s=0;s<i.length;s++)i[s].callback.apply(i[s].context,t)}}on(e,t,i){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:i});const s=this.getInitialEvent(e);s&&t.apply(i,s)}off(e,t,i){this.validateEventType_(e);const s=this.listeners_[e]||[];for(let r=0;r<s.length;r++)if(s[r].callback===t&&(!i||i===s[r].context)){s.splice(r,1);return}}validateEventType_(e){f(this.allowedEvents_.find(t=>t===e),"Unknown event: "+e)}}/**
|
|
1892
1892
|
* @license
|
|
1893
1893
|
* Copyright 2017 Google LLC
|
|
1894
1894
|
*
|
|
@@ -1903,7 +1903,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1903
1903
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1904
1904
|
* See the License for the specific language governing permissions and
|
|
1905
1905
|
* limitations under the License.
|
|
1906
|
-
*/class
|
|
1906
|
+
*/class rn extends xo{static getInstance(){return new rn}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!vi()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return f(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}/**
|
|
1907
1907
|
* @license
|
|
1908
1908
|
* Copyright 2017 Google LLC
|
|
1909
1909
|
*
|
|
@@ -1918,7 +1918,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1918
1918
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1919
1919
|
* See the License for the specific language governing permissions and
|
|
1920
1920
|
* limitations under the License.
|
|
1921
|
-
*/const
|
|
1921
|
+
*/const qs=32,Ks=768;class T{constructor(e,t){if(t===void 0){this.pieces_=e.split("/");let i=0;for(let s=0;s<this.pieces_.length;s++)this.pieces_[s].length>0&&(this.pieces_[i]=this.pieces_[s],i++);this.pieces_.length=i,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)this.pieces_[t]!==""&&(e+="/"+this.pieces_[t]);return e||"/"}}function I(){return new T("")}function E(n){return n.pieceNum_>=n.pieces_.length?null:n.pieces_[n.pieceNum_]}function me(n){return n.pieces_.length-n.pieceNum_}function S(n){let e=n.pieceNum_;return e<n.pieces_.length&&e++,new T(n.pieces_,e)}function Fo(n){return n.pieceNum_<n.pieces_.length?n.pieces_[n.pieces_.length-1]:null}function wd(n){let e="";for(let t=n.pieceNum_;t<n.pieces_.length;t++)n.pieces_[t]!==""&&(e+="/"+encodeURIComponent(String(n.pieces_[t])));return e||"/"}function Uo(n,e=0){return n.pieces_.slice(n.pieceNum_+e)}function Wo(n){if(n.pieceNum_>=n.pieces_.length)return null;const e=[];for(let t=n.pieceNum_;t<n.pieces_.length-1;t++)e.push(n.pieces_[t]);return new T(e,0)}function A(n,e){const t=[];for(let i=n.pieceNum_;i<n.pieces_.length;i++)t.push(n.pieces_[i]);if(e instanceof T)for(let i=e.pieceNum_;i<e.pieces_.length;i++)t.push(e.pieces_[i]);else{const i=e.split("/");for(let s=0;s<i.length;s++)i[s].length>0&&t.push(i[s])}return new T(t,0)}function y(n){return n.pieceNum_>=n.pieces_.length}function L(n,e){const t=E(n),i=E(e);if(t===null)return e;if(t===i)return L(S(n),S(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+n+")")}function Bo(n,e){if(me(n)!==me(e))return!1;for(let t=n.pieceNum_,i=e.pieceNum_;t<=n.pieces_.length;t++,i++)if(n.pieces_[t]!==e.pieces_[i])return!1;return!0}function $(n,e){let t=n.pieceNum_,i=e.pieceNum_;if(me(n)>me(e))return!1;for(;t<n.pieces_.length;){if(n.pieces_[t]!==e.pieces_[i])return!1;++t,++i}return!0}class Cd{constructor(e,t){this.errorPrefix_=t,this.parts_=Uo(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let i=0;i<this.parts_.length;i++)this.byteLength_+=gn(this.parts_[i]);Ho(this)}}function Td(n,e){n.parts_.length>0&&(n.byteLength_+=1),n.parts_.push(e),n.byteLength_+=gn(e),Ho(n)}function Sd(n){const e=n.parts_.pop();n.byteLength_-=gn(e),n.parts_.length>0&&(n.byteLength_-=1)}function Ho(n){if(n.byteLength_>Ks)throw new Error(n.errorPrefix_+"has a key path longer than "+Ks+" bytes ("+n.byteLength_+").");if(n.parts_.length>qs)throw new Error(n.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+qs+") or object contains a cycle "+be(n))}function be(n){return n.parts_.length===0?"":"in property '"+n.parts_.join(".")+"'"}/**
|
|
1922
1922
|
* @license
|
|
1923
1923
|
* Copyright 2017 Google LLC
|
|
1924
1924
|
*
|
|
@@ -1933,7 +1933,7 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1933
1933
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1934
1934
|
* See the License for the specific language governing permissions and
|
|
1935
1935
|
* limitations under the License.
|
|
1936
|
-
*/class
|
|
1936
|
+
*/class Mi extends xo{static getInstance(){return new Mi}constructor(){super(["visible"]);let e,t;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(t="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(t="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(t="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{const i=!document[e];i!==this.visible_&&(this.visible_=i,this.trigger("visible",i))},!1)}getInitialEvent(e){return f(e==="visible","Unknown event type: "+e),[this.visible_]}}/**
|
|
1937
1937
|
* @license
|
|
1938
1938
|
* Copyright 2017 Google LLC
|
|
1939
1939
|
*
|
|
@@ -1948,10 +1948,10 @@ import{a as _i}from"./tslib.es6-De9GV7Vy.js";import{c as Se,u as Ma,d as La,e as
|
|
|
1948
1948
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1949
1949
|
* See the License for the specific language governing permissions and
|
|
1950
1950
|
* limitations under the License.
|
|
1951
|
-
*/const
|
|
1952
|
-
Are you using the latest client?`)}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){f(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=
|
|
1951
|
+
*/const rt=1e3,bd=60*5*1e3,Ys=30*1e3,Rd=1.3,kd=3e4,Nd="server_kill",Qs=3;class ee extends Lo{constructor(e,t,i,s,r,o,a,l){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=i,this.onConnectStatus_=s,this.onServerInfoUpdate_=r,this.authTokenProvider_=o,this.appCheckTokenProvider_=a,this.authOverride_=l,this.id=ee.nextPersistentConnectionId_++,this.log_=Dt("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=rt,this.maxReconnectDelay_=bd,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Mi.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&rn.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,i){const s=++this.requestNumber_,r={r:s,a:e,b:t};this.log_(N(r)),f(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(r),i&&(this.requestCBHash_[s]=i)}get(e){this.initConnection_();const t=new mi,s={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:o=>{const a=o.d;o.s==="ok"?t.resolve(a):t.reject(a)}};this.outstandingGets_.push(s),this.outstandingGetCount_++;const r=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(r),t.promise}listen(e,t,i,s){this.initConnection_();const r=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+r),this.listens.has(o)||this.listens.set(o,new Map),f(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),f(!this.listens.get(o).has(r),"listen() called twice for same path/queryId.");const a={onComplete:s,hashFn:t,query:e,tag:i};this.listens.get(o).set(r,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,i=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(i)})}sendListen_(e){const t=e.query,i=t._path.toString(),s=t._queryIdentifier;this.log_("Listen on "+i+" for "+s);const r={p:i},o="q";e.tag&&(r.q=t._queryObject,r.t=e.tag),r.h=e.hashFn(),this.sendRequest(o,r,a=>{const l=a.d,c=a.s;ee.warnOnListenWarnings_(l,t),(this.listens.get(i)&&this.listens.get(i).get(s))===e&&(this.log_("listen response",a),c!=="ok"&&this.removeListen_(i,s),e.onComplete&&e.onComplete(c,l))})}static warnOnListenWarnings_(e,t){if(e&&typeof e=="object"&&se(e,"w")){const i=je(e,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){const s='".indexOn": "'+t._queryParams.getIndex().toString()+'"',r=t._path.toString();B(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${s} at ${r} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||rl(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=Ys)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=sl(e)?"auth":"gauth",i={cred:e};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(t,i,s=>{const r=s.s,o=s.d||"error";this.authToken_===e&&(r==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(r,o))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const t=e.s,i=e.d||"error";t==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,i)})}unlisten(e,t){const i=e._path.toString(),s=e._queryIdentifier;this.log_("Unlisten called for "+i+" "+s),f(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,s)&&this.connected_&&this.sendUnlisten_(i,s,e._queryObject,t)}sendUnlisten_(e,t,i,s){this.log_("Unlisten on "+e+" for "+t);const r={p:e},o="n";s&&(r.q=i,r.t=s),this.sendRequest(o,r)}onDisconnectPut(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:i})}onDisconnectMerge(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:i})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,i,s){const r={p:t,d:i};this.log_("onDisconnect "+e,r),this.sendRequest(e,r,o=>{s&&setTimeout(()=>{s(o.s,o.d)},Math.floor(0))})}put(e,t,i,s){this.putInternal("p",e,t,i,s)}merge(e,t,i,s){this.putInternal("m",e,t,i,s)}putInternal(e,t,i,s,r){this.initConnection_();const o={p:t,d:i};r!==void 0&&(o.h=r),this.outstandingPuts_.push({action:e,request:o,onComplete:s}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,i=this.outstandingPuts_[e].request,s=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,i,r=>{this.log_(t+" response",r),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),s&&s(r.s,r.d)})}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,i=>{if(i.s!=="ok"){const r=i.d;this.log_("reportStats","Error sending stats: "+r)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+N(e));const t=e.r,i=this.requestCBHash_[t];i&&(delete this.requestCBHash_[t],i(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),e==="d"?this.onDataUpdate_(t.p,t.d,!1,t.t):e==="m"?this.onDataUpdate_(t.p,t.d,!0,t.t):e==="c"?this.onListenRevoked_(t.p,t.q):e==="ac"?this.onAuthRevoked_(t.s,t.d):e==="apc"?this.onAppCheckRevoked_(t.s,t.d):e==="sd"?this.onSecurityDebugPacket_(t):ni("Unrecognized action received from server: "+N(e)+`
|
|
1952
|
+
Are you using the latest client?`)}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){f(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=rt,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=rt,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>kd&&(this.reconnectDelay_=rt),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*Rd)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),s=this.id+":"+ee.nextConnectionId_++,r=this.lastSessionId;let o=!1,a=null;const l=function(){a?a.close():(o=!0,i())},c=function(h){f(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(h)};this.realtime_={close:l,sendRequest:c};const u=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[h,d]=await Promise.all([this.authTokenProvider_.getToken(u),this.appCheckTokenProvider_.getToken(u)]);o?M("getToken() completed but was canceled"):(M("getToken() completed. Creating connection."),this.authToken_=h&&h.accessToken,this.appCheckToken_=d&&d.token,a=new Id(s,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,i,p=>{B(p+" ("+this.repoInfo_.toString()+")"),this.interrupt(Nd)},r))}catch(h){this.log_("Failed to get token: "+h),o||(this.repoInfo_.nodeAdmin&&B(h),l())}}}interrupt(e){M("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){M("Resuming connection for reason: "+e),delete this.interruptReasons_[e],zn(this.interruptReasons_)&&(this.reconnectDelay_=rt,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let i;t?i=t.map(r=>Ai(r)).join("$"):i="default";const s=this.removeListen_(e,i);s&&s.onComplete&&s.onComplete("permission_denied")}removeListen_(e,t){const i=new T(e).toString();let s;if(this.listens.has(i)){const r=this.listens.get(i);s=r.get(t),r.delete(t),r.size===0&&this.listens.delete(i)}else s=void 0;return s}onAuthRevoked_(e,t){M("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=Qs&&(this.reconnectDelay_=Ys,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){M("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=Qs&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(`
|
|
1953
1953
|
`,`
|
|
1954
|
-
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let t="js";e["sdk."+t+"."+
|
|
1954
|
+
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let t="js";e["sdk."+t+"."+fo.replace(/\./g,"-")]=1,vi()?e["framework.cordova"]=1:wr()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=rn.getInstance().currentlyOnline();return zn(this.interruptReasons_)&&e}}ee.nextPersistentConnectionId_=0;ee.nextConnectionId_=0;/**
|
|
1955
1955
|
* @license
|
|
1956
1956
|
* Copyright 2017 Google LLC
|
|
1957
1957
|
*
|
|
@@ -1981,7 +1981,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
1981
1981
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1982
1982
|
* See the License for the specific language governing permissions and
|
|
1983
1983
|
* limitations under the License.
|
|
1984
|
-
*/class
|
|
1984
|
+
*/class In{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const i=new v(Ke,e),s=new v(Ke,t);return this.compare(i,s)!==0}minPost(){return v.MIN}}/**
|
|
1985
1985
|
* @license
|
|
1986
1986
|
* Copyright 2017 Google LLC
|
|
1987
1987
|
*
|
|
@@ -1996,7 +1996,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
1996
1996
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1997
1997
|
* See the License for the specific language governing permissions and
|
|
1998
1998
|
* limitations under the License.
|
|
1999
|
-
*/let
|
|
1999
|
+
*/let Ht;class Vo extends In{static get __EMPTY_NODE(){return Ht}static set __EMPTY_NODE(e){Ht=e}compare(e,t){return nt(e.name,t.name)}isDefinedOn(e){throw Je("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return v.MIN}maxPost(){return new v(Pe,Ht)}makePost(e,t){return f(typeof e=="string","KeyIndex indexValue must always be a string."),new v(e,Ht)}toString(){return".key"}}const Ge=new Vo;/**
|
|
2000
2000
|
* @license
|
|
2001
2001
|
* Copyright 2017 Google LLC
|
|
2002
2002
|
*
|
|
@@ -2011,7 +2011,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2011
2011
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2012
2012
|
* See the License for the specific language governing permissions and
|
|
2013
2013
|
* limitations under the License.
|
|
2014
|
-
*/class
|
|
2014
|
+
*/class Vt{constructor(e,t,i,s,r=null){this.isReverse_=s,this.resultGenerator_=r,this.nodeStack_=[];let o=1;for(;!e.isEmpty();)if(e=e,o=t?i(e.key,t):1,s&&(o*=-1),o<0)this.isReverse_?e=e.left:e=e.right;else if(o===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),t;if(this.resultGenerator_?t=this.resultGenerator_(e.key,e.value):t={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class O{constructor(e,t,i,s,r){this.key=e,this.value=t,this.color=i??O.RED,this.left=s??U.EMPTY_NODE,this.right=r??U.EMPTY_NODE}copy(e,t,i,s,r){return new O(e??this.key,t??this.value,i??this.color,s??this.left,r??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let s=this;const r=i(e,s.key);return r<0?s=s.copy(null,null,null,s.left.insert(e,t,i),null):r===0?s=s.copy(null,t,null,null,null):s=s.copy(null,null,null,null,s.right.insert(e,t,i)),s.fixUp_()}removeMin_(){if(this.left.isEmpty())return U.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let i,s;if(i=this,t(e,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),t(e,i.key)===0){if(i.right.isEmpty())return U.EMPTY_NODE;s=i.right.min_(),i=i.copy(s.key,s.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,O.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,O.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}O.RED=!0;O.BLACK=!1;class Ad{copy(e,t,i,s,r){return this}insert(e,t,i){return new O(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class U{constructor(e,t=U.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new U(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,O.BLACK,null,null))}remove(e){return new U(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,O.BLACK,null,null))}get(e){let t,i=this.root_;for(;!i.isEmpty();){if(t=this.comparator_(e,i.key),t===0)return i.value;t<0?i=i.left:t>0&&(i=i.right)}return null}getPredecessorKey(e){let t,i=this.root_,s=null;for(;!i.isEmpty();)if(t=this.comparator_(e,i.key),t===0){if(i.left.isEmpty())return s?s.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}else t<0?i=i.left:t>0&&(s=i,i=i.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new Vt(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new Vt(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new Vt(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new Vt(this.root_,null,this.comparator_,!0,e)}}U.EMPTY_NODE=new Ad;/**
|
|
2015
2015
|
* @license
|
|
2016
2016
|
* Copyright 2017 Google LLC
|
|
2017
2017
|
*
|
|
@@ -2026,7 +2026,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2026
2026
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2027
2027
|
* See the License for the specific language governing permissions and
|
|
2028
2028
|
* limitations under the License.
|
|
2029
|
-
*/function
|
|
2029
|
+
*/function Pd(n,e){return nt(n.name,e.name)}function Li(n,e){return nt(n,e)}/**
|
|
2030
2030
|
* @license
|
|
2031
2031
|
* Copyright 2017 Google LLC
|
|
2032
2032
|
*
|
|
@@ -2041,7 +2041,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2041
2041
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2042
2042
|
* See the License for the specific language governing permissions and
|
|
2043
2043
|
* limitations under the License.
|
|
2044
|
-
*/let
|
|
2044
|
+
*/let si;function Od(n){si=n}const $o=function(n){return typeof n=="number"?"number:"+vo(n):"string:"+n},Go=function(n){if(n.isLeafNode()){const e=n.val();f(typeof e=="string"||typeof e=="number"||typeof e=="object"&&se(e,".sv"),"Priority must be a string or number.")}else f(n===si||n.isEmpty(),"priority of unexpected type.");f(n===si||n.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/**
|
|
2045
2045
|
* @license
|
|
2046
2046
|
* Copyright 2017 Google LLC
|
|
2047
2047
|
*
|
|
@@ -2056,7 +2056,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2056
2056
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2057
2057
|
* See the License for the specific language governing permissions and
|
|
2058
2058
|
* limitations under the License.
|
|
2059
|
-
*/let
|
|
2059
|
+
*/let Js;class P{static set __childrenNodeConstructor(e){Js=e}static get __childrenNodeConstructor(){return Js}constructor(e,t=P.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,f(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Go(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new P(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:P.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return y(e)?this:E(e)===".priority"?this.priorityNode_:P.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return e===".priority"?this.updatePriority(t):t.isEmpty()&&e!==".priority"?this:P.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const i=E(e);return i===null?t:t.isEmpty()&&i!==".priority"?this:(f(i!==".priority"||me(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,P.__childrenNodeConstructor.EMPTY_NODE.updateChild(S(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+$o(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",t==="number"?e+=vo(this.value_):e+=this.value_,this.lazyHash_=_o(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===P.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof P.__childrenNodeConstructor?-1:(f(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,i=typeof this.value_,s=P.VALUE_TYPE_ORDER.indexOf(t),r=P.VALUE_TYPE_ORDER.indexOf(i);return f(s>=0,"Unknown leaf type: "+t),f(r>=0,"Unknown leaf type: "+i),s===r?i==="object"?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:r-s}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}else return!1}}P.VALUE_TYPE_ORDER=["object","boolean","number","string"];/**
|
|
2060
2060
|
* @license
|
|
2061
2061
|
* Copyright 2017 Google LLC
|
|
2062
2062
|
*
|
|
@@ -2071,7 +2071,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2071
2071
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2072
2072
|
* See the License for the specific language governing permissions and
|
|
2073
2073
|
* limitations under the License.
|
|
2074
|
-
*/let zo
|
|
2074
|
+
*/let jo,zo;function Dd(n){jo=n}function Md(n){zo=n}class Ld extends In{compare(e,t){const i=e.node.getPriority(),s=t.node.getPriority(),r=i.compareTo(s);return r===0?nt(e.name,t.name):r}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return v.MIN}maxPost(){return new v(Pe,new P("[PRIORITY-POST]",zo))}makePost(e,t){const i=jo(e);return new v(t,new P("[PRIORITY-POST]",i))}toString(){return".priority"}}const R=new Ld;/**
|
|
2075
2075
|
* @license
|
|
2076
2076
|
* Copyright 2017 Google LLC
|
|
2077
2077
|
*
|
|
@@ -2086,7 +2086,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2086
2086
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2087
2087
|
* See the License for the specific language governing permissions and
|
|
2088
2088
|
* limitations under the License.
|
|
2089
|
-
*/const
|
|
2089
|
+
*/const xd=Math.log(2);class Fd{constructor(e){const t=r=>parseInt(Math.log(r)/xd,10),i=r=>parseInt(Array(r+1).join("1"),2);this.count=t(e+1),this.current_=this.count-1;const s=i(this.count);this.bits_=e+1&s}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const on=function(n,e,t,i){n.sort(e);const s=function(l,c){const u=c-l;let h,d;if(u===0)return null;if(u===1)return h=n[l],d=t?t(h):h,new O(d,h.node,O.BLACK,null,null);{const p=parseInt(u/2,10)+l,_=s(l,p),w=s(p+1,c);return h=n[p],d=t?t(h):h,new O(d,h.node,O.BLACK,_,w)}},r=function(l){let c=null,u=null,h=n.length;const d=function(_,w){const k=h-_,Y=h;h-=_;const Ce=s(k+1,Y),Te=n[k],Wt=t?t(Te):Te;p(new O(Wt,Te.node,w,null,Ce))},p=function(_){c?(c.left=_,c=_):(u=_,c=_)};for(let _=0;_<l.count;++_){const w=l.nextBitIsOne(),k=Math.pow(2,l.count-(_+1));w?d(k,O.BLACK):(d(k,O.BLACK),d(k,O.RED))}return u},o=new Fd(n.length),a=r(o);return new U(i||e,a)};/**
|
|
2090
2090
|
* @license
|
|
2091
2091
|
* Copyright 2017 Google LLC
|
|
2092
2092
|
*
|
|
@@ -2101,7 +2101,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2101
2101
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2102
2102
|
* See the License for the specific language governing permissions and
|
|
2103
2103
|
* limitations under the License.
|
|
2104
|
-
*/let
|
|
2104
|
+
*/let Bn;const xe={};class Z{static get Default(){return f(xe&&R,"ChildrenNode.ts has not been loaded"),Bn=Bn||new Z({".priority":xe},{".priority":R}),Bn}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){const t=je(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof U?t:null}hasIndex(e){return se(this.indexSet_,e.toString())}addIndex(e,t){f(e!==Ge,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const i=[];let s=!1;const r=t.getIterator(v.Wrap);let o=r.getNext();for(;o;)s=s||e.isDefinedOn(o.node),i.push(o),o=r.getNext();let a;s?a=on(i,e.getCompare()):a=xe;const l=e.toString(),c=Object.assign({},this.indexSet_);c[l]=e;const u=Object.assign({},this.indexes_);return u[l]=a,new Z(u,c)}addToIndexes(e,t){const i=Qt(this.indexes_,(s,r)=>{const o=je(this.indexSet_,r);if(f(o,"Missing index implementation for "+r),s===xe)if(o.isDefinedOn(e.node)){const a=[],l=t.getIterator(v.Wrap);let c=l.getNext();for(;c;)c.name!==e.name&&a.push(c),c=l.getNext();return a.push(e),on(a,o.getCompare())}else return xe;else{const a=t.get(e.name);let l=s;return a&&(l=l.remove(new v(e.name,a))),l.insert(e,e.node)}});return new Z(i,this.indexSet_)}removeFromIndexes(e,t){const i=Qt(this.indexes_,s=>{if(s===xe)return s;{const r=t.get(e.name);return r?s.remove(new v(e.name,r)):s}});return new Z(i,this.indexSet_)}}/**
|
|
2105
2105
|
* @license
|
|
2106
2106
|
* Copyright 2017 Google LLC
|
|
2107
2107
|
*
|
|
@@ -2116,7 +2116,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2116
2116
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2117
2117
|
* See the License for the specific language governing permissions and
|
|
2118
2118
|
* limitations under the License.
|
|
2119
|
-
*/let
|
|
2119
|
+
*/let ot;class m{static get EMPTY_NODE(){return ot||(ot=new m(new U(Li),null,Z.Default))}constructor(e,t,i){this.children_=e,this.priorityNode_=t,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&Go(this.priorityNode_),this.children_.isEmpty()&&f(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||ot}updatePriority(e){return this.children_.isEmpty()?this:new m(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const t=this.children_.get(e);return t===null?ot:t}}getChild(e){const t=E(e);return t===null?this:this.getImmediateChild(t).getChild(S(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,t){if(f(t,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(t);{const i=new v(e,t);let s,r;t.isEmpty()?(s=this.children_.remove(e),r=this.indexMap_.removeFromIndexes(i,this.children_)):(s=this.children_.insert(e,t),r=this.indexMap_.addToIndexes(i,this.children_));const o=s.isEmpty()?ot:this.priorityNode_;return new m(s,o,r)}}updateChild(e,t){const i=E(e);if(i===null)return t;{f(E(e)!==".priority"||me(e)===1,".priority must be the last token in a path");const s=this.getImmediateChild(i).updateChild(S(e),t);return this.updateImmediateChild(i,s)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let i=0,s=0,r=!0;if(this.forEachChild(R,(o,a)=>{t[o]=a.val(e),i++,r&&m.INTEGER_REGEXP_.test(o)?s=Math.max(s,Number(o)):r=!1}),!e&&r&&s<2*i){const o=[];for(const a in t)o[a]=t[a];return o}else return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+$o(this.getPriority().val())+":"),this.forEachChild(R,(t,i)=>{const s=i.hash();s!==""&&(e+=":"+t+":"+s)}),this.lazyHash_=e===""?"":_o(e)}return this.lazyHash_}getPredecessorChildName(e,t,i){const s=this.resolveIndex_(i);if(s){const r=s.getPredecessorKey(new v(e,t));return r?r.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const i=t.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new v(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const i=t.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new v(t,this.children_.get(t)):null}forEachChild(e,t){const i=this.resolveIndex_(e);return i?i.inorderTraversal(s=>t(s.name,s.node)):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getIteratorFrom(e,s=>s);{const s=this.children_.getIteratorFrom(e.name,v.Wrap);let r=s.peek();for(;r!=null&&t.compare(r,e)<0;)s.getNext(),r=s.peek();return s}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getReverseIteratorFrom(e,s=>s);{const s=this.children_.getReverseIteratorFrom(e.name,v.Wrap);let r=s.peek();for(;r!=null&&t.compare(r,e)>0;)s.getNext(),r=s.peek();return s}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Lt?-1:0}withIndex(e){if(e===Ge||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new m(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===Ge||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority()))if(this.children_.count()===t.children_.count()){const i=this.getIterator(R),s=t.getIterator(R);let r=i.getNext(),o=s.getNext();for(;r&&o;){if(r.name!==o.name||!r.node.equals(o.node))return!1;r=i.getNext(),o=s.getNext()}return r===null&&o===null}else return!1;else return!1}}resolveIndex_(e){return e===Ge?null:this.indexMap_.get(e.toString())}}m.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class Ud extends m{constructor(){super(new U(Li),m.EMPTY_NODE,Z.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return m.EMPTY_NODE}isEmpty(){return!1}}const Lt=new Ud;Object.defineProperties(v,{MIN:{value:new v(Ke,m.EMPTY_NODE)},MAX:{value:new v(Pe,Lt)}});Vo.__EMPTY_NODE=m.EMPTY_NODE;P.__childrenNodeConstructor=m;Od(Lt);Md(Lt);/**
|
|
2120
2120
|
* @license
|
|
2121
2121
|
* Copyright 2017 Google LLC
|
|
2122
2122
|
*
|
|
@@ -2131,7 +2131,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2131
2131
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2132
2132
|
* See the License for the specific language governing permissions and
|
|
2133
2133
|
* limitations under the License.
|
|
2134
|
-
*/const
|
|
2134
|
+
*/const Wd=!0;function D(n,e=null){if(n===null)return m.EMPTY_NODE;if(typeof n=="object"&&".priority"in n&&(e=n[".priority"]),f(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof n=="object"&&".value"in n&&n[".value"]!==null&&(n=n[".value"]),typeof n!="object"||".sv"in n){const t=n;return new P(t,D(e))}if(!(n instanceof Array)&&Wd){const t=[];let i=!1;if(W(n,(o,a)=>{if(o.substring(0,1)!=="."){const l=D(a);l.isEmpty()||(i=i||!l.getPriority().isEmpty(),t.push(new v(o,l)))}}),t.length===0)return m.EMPTY_NODE;const r=on(t,Pd,o=>o.name,Li);if(i){const o=on(t,R.getCompare());return new m(r,D(e),new Z({".priority":o},{".priority":R}))}else return new m(r,D(e),Z.Default)}else{let t=m.EMPTY_NODE;return W(n,(i,s)=>{if(se(n,i)&&i.substring(0,1)!=="."){const r=D(s);(r.isLeafNode()||!r.isEmpty())&&(t=t.updateImmediateChild(i,r))}}),t.updatePriority(D(e))}}Dd(D);/**
|
|
2135
2135
|
* @license
|
|
2136
2136
|
* Copyright 2017 Google LLC
|
|
2137
2137
|
*
|
|
@@ -2146,7 +2146,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2146
2146
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2147
2147
|
* See the License for the specific language governing permissions and
|
|
2148
2148
|
* limitations under the License.
|
|
2149
|
-
*/class
|
|
2149
|
+
*/class Bd extends In{constructor(e){super(),this.indexPath_=e,f(!y(e)&&E(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const i=this.extractChild(e.node),s=this.extractChild(t.node),r=i.compareTo(s);return r===0?nt(e.name,t.name):r}makePost(e,t){const i=D(e),s=m.EMPTY_NODE.updateChild(this.indexPath_,i);return new v(t,s)}maxPost(){const e=m.EMPTY_NODE.updateChild(this.indexPath_,Lt);return new v(Pe,e)}toString(){return Uo(this.indexPath_,0).join("/")}}/**
|
|
2150
2150
|
* @license
|
|
2151
2151
|
* Copyright 2017 Google LLC
|
|
2152
2152
|
*
|
|
@@ -2161,7 +2161,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2161
2161
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2162
2162
|
* See the License for the specific language governing permissions and
|
|
2163
2163
|
* limitations under the License.
|
|
2164
|
-
*/class
|
|
2164
|
+
*/class Hd extends In{compare(e,t){const i=e.node.compareTo(t.node);return i===0?nt(e.name,t.name):i}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return v.MIN}maxPost(){return v.MAX}makePost(e,t){const i=D(e);return new v(t,i)}toString(){return".value"}}const Vd=new Hd;/**
|
|
2165
2165
|
* @license
|
|
2166
2166
|
* Copyright 2017 Google LLC
|
|
2167
2167
|
*
|
|
@@ -2176,7 +2176,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2176
2176
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2177
2177
|
* See the License for the specific language governing permissions and
|
|
2178
2178
|
* limitations under the License.
|
|
2179
|
-
*/function
|
|
2179
|
+
*/function qo(n){return{type:"value",snapshotNode:n}}function Ye(n,e){return{type:"child_added",snapshotNode:e,childName:n}}function It(n,e){return{type:"child_removed",snapshotNode:e,childName:n}}function wt(n,e,t){return{type:"child_changed",snapshotNode:e,childName:n,oldSnap:t}}function $d(n,e){return{type:"child_moved",snapshotNode:e,childName:n}}/**
|
|
2180
2180
|
* @license
|
|
2181
2181
|
* Copyright 2017 Google LLC
|
|
2182
2182
|
*
|
|
@@ -2191,7 +2191,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2191
2191
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2192
2192
|
* See the License for the specific language governing permissions and
|
|
2193
2193
|
* limitations under the License.
|
|
2194
|
-
*/class
|
|
2194
|
+
*/class xi{constructor(e){this.index_=e}updateChild(e,t,i,s,r,o){f(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(t);return a.getChild(s).equals(i.getChild(s))&&a.isEmpty()===i.isEmpty()||(o!=null&&(i.isEmpty()?e.hasChild(t)?o.trackChildChange(It(t,a)):f(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(Ye(t,i)):o.trackChildChange(wt(t,i,a))),e.isLeafNode()&&i.isEmpty())?e:e.updateImmediateChild(t,i).withIndex(this.index_)}updateFullNode(e,t,i){return i!=null&&(e.isLeafNode()||e.forEachChild(R,(s,r)=>{t.hasChild(s)||i.trackChildChange(It(s,r))}),t.isLeafNode()||t.forEachChild(R,(s,r)=>{if(e.hasChild(s)){const o=e.getImmediateChild(s);o.equals(r)||i.trackChildChange(wt(s,r,o))}else i.trackChildChange(Ye(s,r))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?m.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}/**
|
|
2195
2195
|
* @license
|
|
2196
2196
|
* Copyright 2017 Google LLC
|
|
2197
2197
|
*
|
|
@@ -2206,7 +2206,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2206
2206
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2207
2207
|
* See the License for the specific language governing permissions and
|
|
2208
2208
|
* limitations under the License.
|
|
2209
|
-
*/class
|
|
2209
|
+
*/class Ct{constructor(e){this.indexedFilter_=new xi(e.getIndex()),this.index_=e.getIndex(),this.startPost_=Ct.getStartPost_(e),this.endPost_=Ct.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,i=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&i}updateChild(e,t,i,s,r,o){return this.matches(new v(t,i))||(i=m.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,i,s,r,o)}updateFullNode(e,t,i){t.isLeafNode()&&(t=m.EMPTY_NODE);let s=t.withIndex(this.index_);s=s.updatePriority(m.EMPTY_NODE);const r=this;return t.forEachChild(R,(o,a)=>{r.matches(new v(o,a))||(s=s.updateImmediateChild(o,m.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,s,i)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}else return e.getIndex().maxPost()}}/**
|
|
2210
2210
|
* @license
|
|
2211
2211
|
* Copyright 2017 Google LLC
|
|
2212
2212
|
*
|
|
@@ -2221,7 +2221,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2221
2221
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2222
2222
|
* See the License for the specific language governing permissions and
|
|
2223
2223
|
* limitations under the License.
|
|
2224
|
-
*/class
|
|
2224
|
+
*/class Gd{constructor(e){this.withinDirectionalStart=t=>this.reverse_?this.withinEndPost(t):this.withinStartPost(t),this.withinDirectionalEnd=t=>this.reverse_?this.withinStartPost(t):this.withinEndPost(t),this.withinStartPost=t=>{const i=this.index_.compare(this.rangedFilter_.getStartPost(),t);return this.startIsInclusive_?i<=0:i<0},this.withinEndPost=t=>{const i=this.index_.compare(t,this.rangedFilter_.getEndPost());return this.endIsInclusive_?i<=0:i<0},this.rangedFilter_=new Ct(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,i,s,r,o){return this.rangedFilter_.matches(new v(t,i))||(i=m.EMPTY_NODE),e.getImmediateChild(t).equals(i)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,i,s,r,o):this.fullLimitUpdateChild_(e,t,i,r,o)}updateFullNode(e,t,i){let s;if(t.isLeafNode()||t.isEmpty())s=m.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<t.numChildren()&&t.isIndexed(this.index_)){s=m.EMPTY_NODE.withIndex(this.index_);let r;this.reverse_?r=t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):r=t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let o=0;for(;r.hasNext()&&o<this.limit_;){const a=r.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))s=s.updateImmediateChild(a.name,a.node),o++;else break;else continue}}else{s=t.withIndex(this.index_),s=s.updatePriority(m.EMPTY_NODE);let r;this.reverse_?r=s.getReverseIterator(this.index_):r=s.getIterator(this.index_);let o=0;for(;r.hasNext();){const a=r.getNext();o<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?o++:s=s.updateImmediateChild(a.name,m.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,s,i)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,i,s,r){let o;if(this.reverse_){const h=this.index_.getCompare();o=(d,p)=>h(p,d)}else o=this.index_.getCompare();const a=e;f(a.numChildren()===this.limit_,"");const l=new v(t,i),c=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),u=this.rangedFilter_.matches(l);if(a.hasChild(t)){const h=a.getImmediateChild(t);let d=s.getChildAfterChild(this.index_,c,this.reverse_);for(;d!=null&&(d.name===t||a.hasChild(d.name));)d=s.getChildAfterChild(this.index_,d,this.reverse_);const p=d==null?1:o(d,l);if(u&&!i.isEmpty()&&p>=0)return r!=null&&r.trackChildChange(wt(t,i,h)),a.updateImmediateChild(t,i);{r!=null&&r.trackChildChange(It(t,h));const w=a.updateImmediateChild(t,m.EMPTY_NODE);return d!=null&&this.rangedFilter_.matches(d)?(r!=null&&r.trackChildChange(Ye(d.name,d.node)),w.updateImmediateChild(d.name,d.node)):w}}else return i.isEmpty()?e:u&&o(c,l)>=0?(r!=null&&(r.trackChildChange(It(c.name,c.node)),r.trackChildChange(Ye(t,i))),a.updateImmediateChild(t,i).updateImmediateChild(c.name,m.EMPTY_NODE)):e}}/**
|
|
2225
2225
|
* @license
|
|
2226
2226
|
* Copyright 2017 Google LLC
|
|
2227
2227
|
*
|
|
@@ -2236,7 +2236,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2236
2236
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2237
2237
|
* See the License for the specific language governing permissions and
|
|
2238
2238
|
* limitations under the License.
|
|
2239
|
-
*/class
|
|
2239
|
+
*/class Fi{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=R}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return f(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return f(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Ke}hasEnd(){return this.endSet_}getIndexEndValue(){return f(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return f(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Pe}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return f(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===R}copy(){const e=new Fi;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function jd(n){return n.loadsAllData()?new xi(n.getIndex()):n.hasLimit()?new Gd(n):new Ct(n)}function Xs(n){const e={};if(n.isDefault())return e;let t;if(n.index_===R?t="$priority":n.index_===Vd?t="$value":n.index_===Ge?t="$key":(f(n.index_ instanceof Bd,"Unrecognized index type!"),t=n.index_.toString()),e.orderBy=N(t),n.startSet_){const i=n.startAfterSet_?"startAfter":"startAt";e[i]=N(n.indexStartValue_),n.startNameSet_&&(e[i]+=","+N(n.indexStartName_))}if(n.endSet_){const i=n.endBeforeSet_?"endBefore":"endAt";e[i]=N(n.indexEndValue_),n.endNameSet_&&(e[i]+=","+N(n.indexEndName_))}return n.limitSet_&&(n.isViewFromLeft()?e.limitToFirst=n.limit_:e.limitToLast=n.limit_),e}function Zs(n){const e={};if(n.startSet_&&(e.sp=n.indexStartValue_,n.startNameSet_&&(e.sn=n.indexStartName_),e.sin=!n.startAfterSet_),n.endSet_&&(e.ep=n.indexEndValue_,n.endNameSet_&&(e.en=n.indexEndName_),e.ein=!n.endBeforeSet_),n.limitSet_){e.l=n.limit_;let t=n.viewFrom_;t===""&&(n.isViewFromLeft()?t="l":t="r"),e.vf=t}return n.index_!==R&&(e.i=n.index_.toString()),e}/**
|
|
2240
2240
|
* @license
|
|
2241
2241
|
* Copyright 2017 Google LLC
|
|
2242
2242
|
*
|
|
@@ -2251,7 +2251,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2251
2251
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2252
2252
|
* See the License for the specific language governing permissions and
|
|
2253
2253
|
* limitations under the License.
|
|
2254
|
-
*/class
|
|
2254
|
+
*/class an extends Lo{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return t!==void 0?"tag$"+t:(f(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,i,s){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=i,this.appCheckTokenProvider_=s,this.log_=Dt("p:rest:"),this.listens_={}}listen(e,t,i,s){const r=e._path.toString();this.log_("Listen called for "+r+" "+e._queryIdentifier);const o=an.getListenId_(e,i),a={};this.listens_[o]=a;const l=Xs(e._queryParams);this.restRequest_(r+".json",l,(c,u)=>{let h=u;if(c===404&&(h=null,c=null),c===null&&this.onDataUpdate_(r,h,!1,i),je(this.listens_,o)===a){let d;c?c===401?d="permission_denied":d="rest_error:"+c:d="ok",s(d,null)}})}unlisten(e,t){const i=an.getListenId_(e,t);delete this.listens_[i]}get(e){const t=Xs(e._queryParams),i=e._path.toString(),s=new mi;return this.restRequest_(i+".json",t,(r,o)=>{let a=o;r===404&&(a=null,r=null),r===null?(this.onDataUpdate_(i,a,!1,null),s.resolve(a)):s.reject(new Error(a))}),s.promise}refreshAuthToken(e){}restRequest_(e,t={},i){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([s,r])=>{s&&s.accessToken&&(t.auth=s.accessToken),r&&r.token&&(t.ac=r.token);const o=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+Xe(t);this.log_("Sending REST request for "+o);const a=new XMLHttpRequest;a.onreadystatechange=()=>{if(i&&a.readyState===4){this.log_("REST Response for "+o+" received. status:",a.status,"response:",a.responseText);let l=null;if(a.status>=200&&a.status<300){try{l=gt(a.responseText)}catch{B("Failed to parse JSON response for "+o+": "+a.responseText)}i(null,l)}else a.status!==401&&a.status!==404&&B("Got unsuccessful REST response for "+o+" Status: "+a.status),i(a.status);i=null}},a.open("GET",o,!0),a.send()})}}/**
|
|
2255
2255
|
* @license
|
|
2256
2256
|
* Copyright 2017 Google LLC
|
|
2257
2257
|
*
|
|
@@ -2281,7 +2281,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2281
2281
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2282
2282
|
* See the License for the specific language governing permissions and
|
|
2283
2283
|
* limitations under the License.
|
|
2284
|
-
*/function
|
|
2284
|
+
*/function ln(){return{value:null,children:new Map}}function Ko(n,e,t){if(y(e))n.value=t,n.children.clear();else if(n.value!==null)n.value=n.value.updateChild(e,t);else{const i=E(e);n.children.has(i)||n.children.set(i,ln());const s=n.children.get(i);e=S(e),Ko(s,e,t)}}function ri(n,e,t){n.value!==null?t(e,n.value):qd(n,(i,s)=>{const r=new T(e.toString()+"/"+i);ri(s,r,t)})}function qd(n,e){n.children.forEach((t,i)=>{e(i,t)})}/**
|
|
2285
2285
|
* @license
|
|
2286
2286
|
* Copyright 2017 Google LLC
|
|
2287
2287
|
*
|
|
@@ -2296,7 +2296,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2296
2296
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2297
2297
|
* See the License for the specific language governing permissions and
|
|
2298
2298
|
* limitations under the License.
|
|
2299
|
-
*/class
|
|
2299
|
+
*/class Kd{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t=Object.assign({},e);return this.last_&&W(this.last_,(i,s)=>{t[i]=t[i]-s}),this.last_=e,t}}/**
|
|
2300
2300
|
* @license
|
|
2301
2301
|
* Copyright 2017 Google LLC
|
|
2302
2302
|
*
|
|
@@ -2311,7 +2311,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2311
2311
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2312
2312
|
* See the License for the specific language governing permissions and
|
|
2313
2313
|
* limitations under the License.
|
|
2314
|
-
*/const
|
|
2314
|
+
*/const er=10*1e3,Yd=30*1e3,Qd=5*60*1e3;class Jd{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new Kd(e);const i=er+(Yd-er)*Math.random();dt(this.reportStats_.bind(this),Math.floor(i))}reportStats_(){const e=this.statsListener_.get(),t={};let i=!1;W(e,(s,r)=>{r>0&&se(this.statsToReport_,s)&&(t[s]=r,i=!0)}),i&&this.server_.reportStats(t),dt(this.reportStats_.bind(this),Math.floor(Math.random()*2*Qd))}}/**
|
|
2315
2315
|
* @license
|
|
2316
2316
|
* Copyright 2017 Google LLC
|
|
2317
2317
|
*
|
|
@@ -2326,7 +2326,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2326
2326
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2327
2327
|
* See the License for the specific language governing permissions and
|
|
2328
2328
|
* limitations under the License.
|
|
2329
|
-
*/var G;(function(n){n[n.OVERWRITE=0]="OVERWRITE",n[n.MERGE=1]="MERGE",n[n.ACK_USER_WRITE=2]="ACK_USER_WRITE",n[n.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(G||(G={}));function
|
|
2329
|
+
*/var G;(function(n){n[n.OVERWRITE=0]="OVERWRITE",n[n.MERGE=1]="MERGE",n[n.ACK_USER_WRITE=2]="ACK_USER_WRITE",n[n.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(G||(G={}));function Yo(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Ui(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function Wi(n){return{fromUser:!1,fromServer:!0,queryId:n,tagged:!0}}/**
|
|
2330
2330
|
* @license
|
|
2331
2331
|
* Copyright 2017 Google LLC
|
|
2332
2332
|
*
|
|
@@ -2341,7 +2341,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2341
2341
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2342
2342
|
* See the License for the specific language governing permissions and
|
|
2343
2343
|
* limitations under the License.
|
|
2344
|
-
*/class
|
|
2344
|
+
*/class cn{constructor(e,t,i){this.path=e,this.affectedTree=t,this.revert=i,this.type=G.ACK_USER_WRITE,this.source=Yo()}operationForChild(e){if(y(this.path)){if(this.affectedTree.value!=null)return f(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new T(e));return new cn(I(),t,this.revert)}}else return f(E(this.path)===e,"operationForChild called for unrelated child."),new cn(S(this.path),this.affectedTree,this.revert)}}/**
|
|
2345
2345
|
* @license
|
|
2346
2346
|
* Copyright 2017 Google LLC
|
|
2347
2347
|
*
|
|
@@ -2356,7 +2356,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2356
2356
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2357
2357
|
* See the License for the specific language governing permissions and
|
|
2358
2358
|
* limitations under the License.
|
|
2359
|
-
*/class
|
|
2359
|
+
*/class Tt{constructor(e,t){this.source=e,this.path=t,this.type=G.LISTEN_COMPLETE}operationForChild(e){return y(this.path)?new Tt(this.source,I()):new Tt(this.source,S(this.path))}}/**
|
|
2360
2360
|
* @license
|
|
2361
2361
|
* Copyright 2017 Google LLC
|
|
2362
2362
|
*
|
|
@@ -2371,7 +2371,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2371
2371
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2372
2372
|
* See the License for the specific language governing permissions and
|
|
2373
2373
|
* limitations under the License.
|
|
2374
|
-
*/class
|
|
2374
|
+
*/class Oe{constructor(e,t,i){this.source=e,this.path=t,this.snap=i,this.type=G.OVERWRITE}operationForChild(e){return y(this.path)?new Oe(this.source,I(),this.snap.getImmediateChild(e)):new Oe(this.source,S(this.path),this.snap)}}/**
|
|
2375
2375
|
* @license
|
|
2376
2376
|
* Copyright 2017 Google LLC
|
|
2377
2377
|
*
|
|
@@ -2386,7 +2386,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2386
2386
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2387
2387
|
* See the License for the specific language governing permissions and
|
|
2388
2388
|
* limitations under the License.
|
|
2389
|
-
*/class
|
|
2389
|
+
*/class St{constructor(e,t,i){this.source=e,this.path=t,this.children=i,this.type=G.MERGE}operationForChild(e){if(y(this.path)){const t=this.children.subtree(new T(e));return t.isEmpty()?null:t.value?new Oe(this.source,I(),t.value):new St(this.source,I(),t)}else return f(E(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new St(this.source,S(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/**
|
|
2390
2390
|
* @license
|
|
2391
2391
|
* Copyright 2017 Google LLC
|
|
2392
2392
|
*
|
|
@@ -2416,7 +2416,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2416
2416
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2417
2417
|
* See the License for the specific language governing permissions and
|
|
2418
2418
|
* limitations under the License.
|
|
2419
|
-
*/class
|
|
2419
|
+
*/class Xd{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function Zd(n,e,t,i){const s=[],r=[];return e.forEach(o=>{o.type==="child_changed"&&n.index_.indexedValueChanged(o.oldSnap,o.snapshotNode)&&r.push($d(o.childName,o.snapshotNode))}),at(n,s,"child_removed",e,i,t),at(n,s,"child_added",e,i,t),at(n,s,"child_moved",r,i,t),at(n,s,"child_changed",e,i,t),at(n,s,"value",e,i,t),s}function at(n,e,t,i,s,r){const o=i.filter(a=>a.type===t);o.sort((a,l)=>tf(n,a,l)),o.forEach(a=>{const l=ef(n,a,r);s.forEach(c=>{c.respondsTo(a.type)&&e.push(c.createEvent(l,n.query_))})})}function ef(n,e,t){return e.type==="value"||e.type==="child_removed"||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,n.index_)),e}function tf(n,e,t){if(e.childName==null||t.childName==null)throw Je("Should only compare child_ events.");const i=new v(e.childName,e.snapshotNode),s=new v(t.childName,t.snapshotNode);return n.index_.compare(i,s)}/**
|
|
2420
2420
|
* @license
|
|
2421
2421
|
* Copyright 2017 Google LLC
|
|
2422
2422
|
*
|
|
@@ -2431,7 +2431,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2431
2431
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2432
2432
|
* See the License for the specific language governing permissions and
|
|
2433
2433
|
* limitations under the License.
|
|
2434
|
-
*/function
|
|
2434
|
+
*/function wn(n,e){return{eventCache:n,serverCache:e}}function ft(n,e,t,i){return wn(new ve(e,t,i),n.serverCache)}function Qo(n,e,t,i){return wn(n.eventCache,new ve(e,t,i))}function hn(n){return n.eventCache.isFullyInitialized()?n.eventCache.getNode():null}function De(n){return n.serverCache.isFullyInitialized()?n.serverCache.getNode():null}/**
|
|
2435
2435
|
* @license
|
|
2436
2436
|
* Copyright 2017 Google LLC
|
|
2437
2437
|
*
|
|
@@ -2446,7 +2446,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2446
2446
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2447
2447
|
* See the License for the specific language governing permissions and
|
|
2448
2448
|
* limitations under the License.
|
|
2449
|
-
*/let
|
|
2449
|
+
*/let Hn;const nf=()=>(Hn||(Hn=new U(Hu)),Hn);class b{static fromObject(e){let t=new b(null);return W(e,(i,s)=>{t=t.set(new T(i),s)}),t}constructor(e,t=nf()){this.value=e,this.children=t}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(this.value!=null&&t(this.value))return{path:I(),value:this.value};if(y(e))return null;{const i=E(e),s=this.children.get(i);if(s!==null){const r=s.findRootMostMatchingPathAndValue(S(e),t);return r!=null?{path:A(new T(i),r.path),value:r.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(y(e))return this;{const t=E(e),i=this.children.get(t);return i!==null?i.subtree(S(e)):new b(null)}}set(e,t){if(y(e))return new b(t,this.children);{const i=E(e),r=(this.children.get(i)||new b(null)).set(S(e),t),o=this.children.insert(i,r);return new b(this.value,o)}}remove(e){if(y(e))return this.children.isEmpty()?new b(null):new b(null,this.children);{const t=E(e),i=this.children.get(t);if(i){const s=i.remove(S(e));let r;return s.isEmpty()?r=this.children.remove(t):r=this.children.insert(t,s),this.value===null&&r.isEmpty()?new b(null):new b(this.value,r)}else return this}}get(e){if(y(e))return this.value;{const t=E(e),i=this.children.get(t);return i?i.get(S(e)):null}}setTree(e,t){if(y(e))return t;{const i=E(e),r=(this.children.get(i)||new b(null)).setTree(S(e),t);let o;return r.isEmpty()?o=this.children.remove(i):o=this.children.insert(i,r),new b(this.value,o)}}fold(e){return this.fold_(I(),e)}fold_(e,t){const i={};return this.children.inorderTraversal((s,r)=>{i[s]=r.fold_(A(e,s),t)}),t(e,this.value,i)}findOnPath(e,t){return this.findOnPath_(e,I(),t)}findOnPath_(e,t,i){const s=this.value?i(t,this.value):!1;if(s)return s;if(y(e))return null;{const r=E(e),o=this.children.get(r);return o?o.findOnPath_(S(e),A(t,r),i):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,I(),t)}foreachOnPath_(e,t,i){if(y(e))return this;{this.value&&i(t,this.value);const s=E(e),r=this.children.get(s);return r?r.foreachOnPath_(S(e),A(t,s),i):new b(null)}}foreach(e){this.foreach_(I(),e)}foreach_(e,t){this.children.inorderTraversal((i,s)=>{s.foreach_(A(e,i),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,i)=>{i.value&&e(t,i.value)})}}/**
|
|
2450
2450
|
* @license
|
|
2451
2451
|
* Copyright 2017 Google LLC
|
|
2452
2452
|
*
|
|
@@ -2461,7 +2461,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2461
2461
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2462
2462
|
* See the License for the specific language governing permissions and
|
|
2463
2463
|
* limitations under the License.
|
|
2464
|
-
*/class j{constructor(e){this.writeTree_=e}static empty(){return new j(new b(null))}}function
|
|
2464
|
+
*/class j{constructor(e){this.writeTree_=e}static empty(){return new j(new b(null))}}function pt(n,e,t){if(y(e))return new j(new b(t));{const i=n.writeTree_.findRootMostValueAndPath(e);if(i!=null){const s=i.path;let r=i.value;const o=L(s,e);return r=r.updateChild(o,t),new j(n.writeTree_.set(s,r))}else{const s=new b(t),r=n.writeTree_.setTree(e,s);return new j(r)}}}function tr(n,e,t){let i=n;return W(t,(s,r)=>{i=pt(i,A(e,s),r)}),i}function nr(n,e){if(y(e))return j.empty();{const t=n.writeTree_.setTree(e,new b(null));return new j(t)}}function oi(n,e){return Le(n,e)!=null}function Le(n,e){const t=n.writeTree_.findRootMostValueAndPath(e);return t!=null?n.writeTree_.get(t.path).getChild(L(t.path,e)):null}function ir(n){const e=[],t=n.writeTree_.value;return t!=null?t.isLeafNode()||t.forEachChild(R,(i,s)=>{e.push(new v(i,s))}):n.writeTree_.children.inorderTraversal((i,s)=>{s.value!=null&&e.push(new v(i,s.value))}),e}function _e(n,e){if(y(e))return n;{const t=Le(n,e);return t!=null?new j(new b(t)):new j(n.writeTree_.subtree(e))}}function ai(n){return n.writeTree_.isEmpty()}function Qe(n,e){return Jo(I(),n.writeTree_,e)}function Jo(n,e,t){if(e.value!=null)return t.updateChild(n,e.value);{let i=null;return e.children.inorderTraversal((s,r)=>{s===".priority"?(f(r.value!==null,"Priority writes must always be leaf nodes"),i=r.value):t=Jo(A(n,s),r,t)}),!t.getChild(n).isEmpty()&&i!==null&&(t=t.updateChild(A(n,".priority"),i)),t}}/**
|
|
2465
2465
|
* @license
|
|
2466
2466
|
* Copyright 2017 Google LLC
|
|
2467
2467
|
*
|
|
@@ -2476,7 +2476,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2476
2476
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2477
2477
|
* See the License for the specific language governing permissions and
|
|
2478
2478
|
* limitations under the License.
|
|
2479
|
-
*/function
|
|
2479
|
+
*/function Cn(n,e){return ta(e,n)}function sf(n,e,t,i,s){f(i>n.lastWriteId,"Stacking an older write on top of newer ones"),s===void 0&&(s=!0),n.allWrites.push({path:e,snap:t,writeId:i,visible:s}),s&&(n.visibleWrites=pt(n.visibleWrites,e,t)),n.lastWriteId=i}function rf(n,e){for(let t=0;t<n.allWrites.length;t++){const i=n.allWrites[t];if(i.writeId===e)return i}return null}function of(n,e){const t=n.allWrites.findIndex(a=>a.writeId===e);f(t>=0,"removeWrite called with nonexistent writeId.");const i=n.allWrites[t];n.allWrites.splice(t,1);let s=i.visible,r=!1,o=n.allWrites.length-1;for(;s&&o>=0;){const a=n.allWrites[o];a.visible&&(o>=t&&af(a,i.path)?s=!1:$(i.path,a.path)&&(r=!0)),o--}if(s){if(r)return lf(n),!0;if(i.snap)n.visibleWrites=nr(n.visibleWrites,i.path);else{const a=i.children;W(a,l=>{n.visibleWrites=nr(n.visibleWrites,A(i.path,l))})}return!0}else return!1}function af(n,e){if(n.snap)return $(n.path,e);for(const t in n.children)if(n.children.hasOwnProperty(t)&&$(A(n.path,t),e))return!0;return!1}function lf(n){n.visibleWrites=Xo(n.allWrites,cf,I()),n.allWrites.length>0?n.lastWriteId=n.allWrites[n.allWrites.length-1].writeId:n.lastWriteId=-1}function cf(n){return n.visible}function Xo(n,e,t){let i=j.empty();for(let s=0;s<n.length;++s){const r=n[s];if(e(r)){const o=r.path;let a;if(r.snap)$(t,o)?(a=L(t,o),i=pt(i,a,r.snap)):$(o,t)&&(a=L(o,t),i=pt(i,I(),r.snap.getChild(a)));else if(r.children){if($(t,o))a=L(t,o),i=tr(i,a,r.children);else if($(o,t))if(a=L(o,t),y(a))i=tr(i,I(),r.children);else{const l=je(r.children,E(a));if(l){const c=l.getChild(S(a));i=pt(i,I(),c)}}}else throw Je("WriteRecord should have .snap or .children")}}return i}function Zo(n,e,t,i,s){if(!i&&!s){const r=Le(n.visibleWrites,e);if(r!=null)return r;{const o=_e(n.visibleWrites,e);if(ai(o))return t;if(t==null&&!oi(o,I()))return null;{const a=t||m.EMPTY_NODE;return Qe(o,a)}}}else{const r=_e(n.visibleWrites,e);if(!s&&ai(r))return t;if(!s&&t==null&&!oi(r,I()))return null;{const o=function(c){return(c.visible||s)&&(!i||!~i.indexOf(c.writeId))&&($(c.path,e)||$(e,c.path))},a=Xo(n.allWrites,o,e),l=t||m.EMPTY_NODE;return Qe(a,l)}}}function hf(n,e,t){let i=m.EMPTY_NODE;const s=Le(n.visibleWrites,e);if(s)return s.isLeafNode()||s.forEachChild(R,(r,o)=>{i=i.updateImmediateChild(r,o)}),i;if(t){const r=_e(n.visibleWrites,e);return t.forEachChild(R,(o,a)=>{const l=Qe(_e(r,new T(o)),a);i=i.updateImmediateChild(o,l)}),ir(r).forEach(o=>{i=i.updateImmediateChild(o.name,o.node)}),i}else{const r=_e(n.visibleWrites,e);return ir(r).forEach(o=>{i=i.updateImmediateChild(o.name,o.node)}),i}}function uf(n,e,t,i,s){f(i||s,"Either existingEventSnap or existingServerSnap must exist");const r=A(e,t);if(oi(n.visibleWrites,r))return null;{const o=_e(n.visibleWrites,r);return ai(o)?s.getChild(t):Qe(o,s.getChild(t))}}function df(n,e,t,i){const s=A(e,t),r=Le(n.visibleWrites,s);if(r!=null)return r;if(i.isCompleteForChild(t)){const o=_e(n.visibleWrites,s);return Qe(o,i.getNode().getImmediateChild(t))}else return null}function ff(n,e){return Le(n.visibleWrites,e)}function pf(n,e,t,i,s,r,o){let a;const l=_e(n.visibleWrites,e),c=Le(l,I());if(c!=null)a=c;else if(t!=null)a=Qe(l,t);else return[];if(a=a.withIndex(o),!a.isEmpty()&&!a.isLeafNode()){const u=[],h=o.getCompare(),d=r?a.getReverseIteratorFrom(i,o):a.getIteratorFrom(i,o);let p=d.getNext();for(;p&&u.length<s;)h(p,i)!==0&&u.push(p),p=d.getNext();return u}else return[]}function _f(){return{visibleWrites:j.empty(),allWrites:[],lastWriteId:-1}}function un(n,e,t,i){return Zo(n.writeTree,n.treePath,e,t,i)}function Bi(n,e){return hf(n.writeTree,n.treePath,e)}function sr(n,e,t,i){return uf(n.writeTree,n.treePath,e,t,i)}function dn(n,e){return ff(n.writeTree,A(n.treePath,e))}function gf(n,e,t,i,s,r){return pf(n.writeTree,n.treePath,e,t,i,s,r)}function Hi(n,e,t){return df(n.writeTree,n.treePath,e,t)}function ea(n,e){return ta(A(n.treePath,e),n.writeTree)}function ta(n,e){return{treePath:n,writeTree:e}}/**
|
|
2480
2480
|
* @license
|
|
2481
2481
|
* Copyright 2017 Google LLC
|
|
2482
2482
|
*
|
|
@@ -2491,7 +2491,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2491
2491
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2492
2492
|
* See the License for the specific language governing permissions and
|
|
2493
2493
|
* limitations under the License.
|
|
2494
|
-
*/class
|
|
2494
|
+
*/class mf{constructor(){this.changeMap=new Map}trackChildChange(e){const t=e.type,i=e.childName;f(t==="child_added"||t==="child_changed"||t==="child_removed","Only child changes supported for tracking"),f(i!==".priority","Only non-priority child changes can be tracked.");const s=this.changeMap.get(i);if(s){const r=s.type;if(t==="child_added"&&r==="child_removed")this.changeMap.set(i,wt(i,e.snapshotNode,s.snapshotNode));else if(t==="child_removed"&&r==="child_added")this.changeMap.delete(i);else if(t==="child_removed"&&r==="child_changed")this.changeMap.set(i,It(i,s.oldSnap));else if(t==="child_changed"&&r==="child_added")this.changeMap.set(i,Ye(i,e.snapshotNode));else if(t==="child_changed"&&r==="child_changed")this.changeMap.set(i,wt(i,e.snapshotNode,s.oldSnap));else throw Je("Illegal combination of changes: "+e+" occurred after "+s)}else this.changeMap.set(i,e)}getChanges(){return Array.from(this.changeMap.values())}}/**
|
|
2495
2495
|
* @license
|
|
2496
2496
|
* Copyright 2017 Google LLC
|
|
2497
2497
|
*
|
|
@@ -2506,7 +2506,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2506
2506
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2507
2507
|
* See the License for the specific language governing permissions and
|
|
2508
2508
|
* limitations under the License.
|
|
2509
|
-
*/class
|
|
2509
|
+
*/class vf{getCompleteChild(e){return null}getChildAfterChild(e,t,i){return null}}const na=new vf;class Vi{constructor(e,t,i=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=i}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const i=this.optCompleteServerCache_!=null?new ve(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return Hi(this.writes_,e,i)}}getChildAfterChild(e,t,i){const s=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:De(this.viewCache_),r=gf(this.writes_,s,t,1,i,e);return r.length===0?null:r[0]}}/**
|
|
2510
2510
|
* @license
|
|
2511
2511
|
* Copyright 2017 Google LLC
|
|
2512
2512
|
*
|
|
@@ -2521,7 +2521,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2521
2521
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2522
2522
|
* See the License for the specific language governing permissions and
|
|
2523
2523
|
* limitations under the License.
|
|
2524
|
-
*/function
|
|
2524
|
+
*/function yf(n){return{filter:n}}function Ef(n,e){f(e.eventCache.getNode().isIndexed(n.filter.getIndex()),"Event snap not indexed"),f(e.serverCache.getNode().isIndexed(n.filter.getIndex()),"Server snap not indexed")}function If(n,e,t,i,s){const r=new mf;let o,a;if(t.type===G.OVERWRITE){const c=t;c.source.fromUser?o=li(n,e,c.path,c.snap,i,s,r):(f(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered()&&!y(c.path),o=fn(n,e,c.path,c.snap,i,s,a,r))}else if(t.type===G.MERGE){const c=t;c.source.fromUser?o=Cf(n,e,c.path,c.children,i,s,r):(f(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered(),o=ci(n,e,c.path,c.children,i,s,a,r))}else if(t.type===G.ACK_USER_WRITE){const c=t;c.revert?o=bf(n,e,c.path,i,s,r):o=Tf(n,e,c.path,c.affectedTree,i,s,r)}else if(t.type===G.LISTEN_COMPLETE)o=Sf(n,e,t.path,i,r);else throw Je("Unknown operation type: "+t.type);const l=r.getChanges();return wf(e,o,l),{viewCache:o,changes:l}}function wf(n,e,t){const i=e.eventCache;if(i.isFullyInitialized()){const s=i.getNode().isLeafNode()||i.getNode().isEmpty(),r=hn(n);(t.length>0||!n.eventCache.isFullyInitialized()||s&&!i.getNode().equals(r)||!i.getNode().getPriority().equals(r.getPriority()))&&t.push(qo(hn(e)))}}function ia(n,e,t,i,s,r){const o=e.eventCache;if(dn(i,t)!=null)return e;{let a,l;if(y(t))if(f(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const c=De(e),u=c instanceof m?c:m.EMPTY_NODE,h=Bi(i,u);a=n.filter.updateFullNode(e.eventCache.getNode(),h,r)}else{const c=un(i,De(e));a=n.filter.updateFullNode(e.eventCache.getNode(),c,r)}else{const c=E(t);if(c===".priority"){f(me(t)===1,"Can't have a priority with additional path components");const u=o.getNode();l=e.serverCache.getNode();const h=sr(i,t,u,l);h!=null?a=n.filter.updatePriority(u,h):a=o.getNode()}else{const u=S(t);let h;if(o.isCompleteForChild(c)){l=e.serverCache.getNode();const d=sr(i,t,o.getNode(),l);d!=null?h=o.getNode().getImmediateChild(c).updateChild(u,d):h=o.getNode().getImmediateChild(c)}else h=Hi(i,c,e.serverCache);h!=null?a=n.filter.updateChild(o.getNode(),c,h,u,s,r):a=o.getNode()}}return ft(e,a,o.isFullyInitialized()||y(t),n.filter.filtersNodes())}}function fn(n,e,t,i,s,r,o,a){const l=e.serverCache;let c;const u=o?n.filter:n.filter.getIndexedFilter();if(y(t))c=u.updateFullNode(l.getNode(),i,null);else if(u.filtersNodes()&&!l.isFiltered()){const p=l.getNode().updateChild(t,i);c=u.updateFullNode(l.getNode(),p,null)}else{const p=E(t);if(!l.isCompleteForPath(t)&&me(t)>1)return e;const _=S(t),k=l.getNode().getImmediateChild(p).updateChild(_,i);p===".priority"?c=u.updatePriority(l.getNode(),k):c=u.updateChild(l.getNode(),p,k,_,na,null)}const h=Qo(e,c,l.isFullyInitialized()||y(t),u.filtersNodes()),d=new Vi(s,h,r);return ia(n,h,t,s,d,a)}function li(n,e,t,i,s,r,o){const a=e.eventCache;let l,c;const u=new Vi(s,e,r);if(y(t))c=n.filter.updateFullNode(e.eventCache.getNode(),i,o),l=ft(e,c,!0,n.filter.filtersNodes());else{const h=E(t);if(h===".priority")c=n.filter.updatePriority(e.eventCache.getNode(),i),l=ft(e,c,a.isFullyInitialized(),a.isFiltered());else{const d=S(t),p=a.getNode().getImmediateChild(h);let _;if(y(d))_=i;else{const w=u.getCompleteChild(h);w!=null?Fo(d)===".priority"&&w.getChild(Wo(d)).isEmpty()?_=w:_=w.updateChild(d,i):_=m.EMPTY_NODE}if(p.equals(_))l=e;else{const w=n.filter.updateChild(a.getNode(),h,_,d,u,o);l=ft(e,w,a.isFullyInitialized(),n.filter.filtersNodes())}}}return l}function rr(n,e){return n.eventCache.isCompleteForChild(e)}function Cf(n,e,t,i,s,r,o){let a=e;return i.foreach((l,c)=>{const u=A(t,l);rr(e,E(u))&&(a=li(n,a,u,c,s,r,o))}),i.foreach((l,c)=>{const u=A(t,l);rr(e,E(u))||(a=li(n,a,u,c,s,r,o))}),a}function or(n,e,t){return t.foreach((i,s)=>{e=e.updateChild(i,s)}),e}function ci(n,e,t,i,s,r,o,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let l=e,c;y(t)?c=i:c=new b(null).setTree(t,i);const u=e.serverCache.getNode();return c.children.inorderTraversal((h,d)=>{if(u.hasChild(h)){const p=e.serverCache.getNode().getImmediateChild(h),_=or(n,p,d);l=fn(n,l,new T(h),_,s,r,o,a)}}),c.children.inorderTraversal((h,d)=>{const p=!e.serverCache.isCompleteForChild(h)&&d.value===null;if(!u.hasChild(h)&&!p){const _=e.serverCache.getNode().getImmediateChild(h),w=or(n,_,d);l=fn(n,l,new T(h),w,s,r,o,a)}}),l}function Tf(n,e,t,i,s,r,o){if(dn(s,t)!=null)return e;const a=e.serverCache.isFiltered(),l=e.serverCache;if(i.value!=null){if(y(t)&&l.isFullyInitialized()||l.isCompleteForPath(t))return fn(n,e,t,l.getNode().getChild(t),s,r,a,o);if(y(t)){let c=new b(null);return l.getNode().forEachChild(Ge,(u,h)=>{c=c.set(new T(u),h)}),ci(n,e,t,c,s,r,a,o)}else return e}else{let c=new b(null);return i.foreach((u,h)=>{const d=A(t,u);l.isCompleteForPath(d)&&(c=c.set(u,l.getNode().getChild(d)))}),ci(n,e,t,c,s,r,a,o)}}function Sf(n,e,t,i,s){const r=e.serverCache,o=Qo(e,r.getNode(),r.isFullyInitialized()||y(t),r.isFiltered());return ia(n,o,t,i,na,s)}function bf(n,e,t,i,s,r){let o;if(dn(i,t)!=null)return e;{const a=new Vi(i,e,s),l=e.eventCache.getNode();let c;if(y(t)||E(t)===".priority"){let u;if(e.serverCache.isFullyInitialized())u=un(i,De(e));else{const h=e.serverCache.getNode();f(h instanceof m,"serverChildren would be complete if leaf node"),u=Bi(i,h)}u=u,c=n.filter.updateFullNode(l,u,r)}else{const u=E(t);let h=Hi(i,u,e.serverCache);h==null&&e.serverCache.isCompleteForChild(u)&&(h=l.getImmediateChild(u)),h!=null?c=n.filter.updateChild(l,u,h,S(t),a,r):e.eventCache.getNode().hasChild(u)?c=n.filter.updateChild(l,u,m.EMPTY_NODE,S(t),a,r):c=l,c.isEmpty()&&e.serverCache.isFullyInitialized()&&(o=un(i,De(e)),o.isLeafNode()&&(c=n.filter.updateFullNode(c,o,r)))}return o=e.serverCache.isFullyInitialized()||dn(i,I())!=null,ft(e,c,o,n.filter.filtersNodes())}}/**
|
|
2525
2525
|
* @license
|
|
2526
2526
|
* Copyright 2017 Google LLC
|
|
2527
2527
|
*
|
|
@@ -2536,7 +2536,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2536
2536
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2537
2537
|
* See the License for the specific language governing permissions and
|
|
2538
2538
|
* limitations under the License.
|
|
2539
|
-
*/class
|
|
2539
|
+
*/class Rf{constructor(e,t){this.query_=e,this.eventRegistrations_=[];const i=this.query_._queryParams,s=new xi(i.getIndex()),r=jd(i);this.processor_=yf(r);const o=t.serverCache,a=t.eventCache,l=s.updateFullNode(m.EMPTY_NODE,o.getNode(),null),c=r.updateFullNode(m.EMPTY_NODE,a.getNode(),null),u=new ve(l,o.isFullyInitialized(),s.filtersNodes()),h=new ve(c,a.isFullyInitialized(),r.filtersNodes());this.viewCache_=wn(h,u),this.eventGenerator_=new Xd(this.query_)}get query(){return this.query_}}function kf(n){return n.viewCache_.serverCache.getNode()}function Nf(n){return hn(n.viewCache_)}function Af(n,e){const t=De(n.viewCache_);return t&&(n.query._queryParams.loadsAllData()||!y(e)&&!t.getImmediateChild(E(e)).isEmpty())?t.getChild(e):null}function ar(n){return n.eventRegistrations_.length===0}function Pf(n,e){n.eventRegistrations_.push(e)}function lr(n,e,t){const i=[];if(t){f(e==null,"A cancel should cancel all event registrations.");const s=n.query._path;n.eventRegistrations_.forEach(r=>{const o=r.createCancelEvent(t,s);o&&i.push(o)})}if(e){let s=[];for(let r=0;r<n.eventRegistrations_.length;++r){const o=n.eventRegistrations_[r];if(!o.matches(e))s.push(o);else if(e.hasAnyCallback()){s=s.concat(n.eventRegistrations_.slice(r+1));break}}n.eventRegistrations_=s}else n.eventRegistrations_=[];return i}function cr(n,e,t,i){e.type===G.MERGE&&e.source.queryId!==null&&(f(De(n.viewCache_),"We should always have a full cache before handling merges"),f(hn(n.viewCache_),"Missing event cache, even though we have a server cache"));const s=n.viewCache_,r=If(n.processor_,s,e,t,i);return Ef(n.processor_,r.viewCache),f(r.viewCache.serverCache.isFullyInitialized()||!s.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),n.viewCache_=r.viewCache,sa(n,r.changes,r.viewCache.eventCache.getNode(),null)}function Of(n,e){const t=n.viewCache_.eventCache,i=[];return t.getNode().isLeafNode()||t.getNode().forEachChild(R,(r,o)=>{i.push(Ye(r,o))}),t.isFullyInitialized()&&i.push(qo(t.getNode())),sa(n,i,t.getNode(),e)}function sa(n,e,t,i){const s=i?[i]:n.eventRegistrations_;return Zd(n.eventGenerator_,e,t,s)}/**
|
|
2540
2540
|
* @license
|
|
2541
2541
|
* Copyright 2017 Google LLC
|
|
2542
2542
|
*
|
|
@@ -2551,7 +2551,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2551
2551
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2552
2552
|
* See the License for the specific language governing permissions and
|
|
2553
2553
|
* limitations under the License.
|
|
2554
|
-
*/let
|
|
2554
|
+
*/let pn;class ra{constructor(){this.views=new Map}}function Df(n){f(!pn,"__referenceConstructor has already been defined"),pn=n}function Mf(){return f(pn,"Reference.ts has not been loaded"),pn}function Lf(n){return n.views.size===0}function $i(n,e,t,i){const s=e.source.queryId;if(s!==null){const r=n.views.get(s);return f(r!=null,"SyncTree gave us an op for an invalid query."),cr(r,e,t,i)}else{let r=[];for(const o of n.views.values())r=r.concat(cr(o,e,t,i));return r}}function oa(n,e,t,i,s){const r=e._queryIdentifier,o=n.views.get(r);if(!o){let a=un(t,s?i:null),l=!1;a?l=!0:i instanceof m?(a=Bi(t,i),l=!1):(a=m.EMPTY_NODE,l=!1);const c=wn(new ve(a,l,!1),new ve(i,s,!1));return new Rf(e,c)}return o}function xf(n,e,t,i,s,r){const o=oa(n,e,i,s,r);return n.views.has(e._queryIdentifier)||n.views.set(e._queryIdentifier,o),Pf(o,t),Of(o,t)}function Ff(n,e,t,i){const s=e._queryIdentifier,r=[];let o=[];const a=ye(n);if(s==="default")for(const[l,c]of n.views.entries())o=o.concat(lr(c,t,i)),ar(c)&&(n.views.delete(l),c.query._queryParams.loadsAllData()||r.push(c.query));else{const l=n.views.get(s);l&&(o=o.concat(lr(l,t,i)),ar(l)&&(n.views.delete(s),l.query._queryParams.loadsAllData()||r.push(l.query)))}return a&&!ye(n)&&r.push(new(Mf())(e._repo,e._path)),{removed:r,events:o}}function aa(n){const e=[];for(const t of n.views.values())t.query._queryParams.loadsAllData()||e.push(t);return e}function ge(n,e){let t=null;for(const i of n.views.values())t=t||Af(i,e);return t}function la(n,e){if(e._queryParams.loadsAllData())return Tn(n);{const i=e._queryIdentifier;return n.views.get(i)}}function ca(n,e){return la(n,e)!=null}function ye(n){return Tn(n)!=null}function Tn(n){for(const e of n.views.values())if(e.query._queryParams.loadsAllData())return e;return null}/**
|
|
2555
2555
|
* @license
|
|
2556
2556
|
* Copyright 2017 Google LLC
|
|
2557
2557
|
*
|
|
@@ -2566,7 +2566,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2566
2566
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2567
2567
|
* See the License for the specific language governing permissions and
|
|
2568
2568
|
* limitations under the License.
|
|
2569
|
-
*/let
|
|
2569
|
+
*/let _n;function Uf(n){f(!_n,"__referenceConstructor has already been defined"),_n=n}function Wf(){return f(_n,"Reference.ts has not been loaded"),_n}let Bf=1;class hr{constructor(e){this.listenProvider_=e,this.syncPointTree_=new b(null),this.pendingWriteTree_=_f(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function Hf(n,e,t,i,s){return sf(n.pendingWriteTree_,e,t,i,s),s?Ft(n,new Oe(Yo(),e,t)):[]}function We(n,e,t=!1){const i=rf(n.pendingWriteTree_,e);if(of(n.pendingWriteTree_,e)){let r=new b(null);return i.snap!=null?r=r.set(I(),!0):W(i.children,o=>{r=r.set(new T(o),!0)}),Ft(n,new cn(i.path,r,t))}else return[]}function xt(n,e,t){return Ft(n,new Oe(Ui(),e,t))}function Vf(n,e,t){const i=b.fromObject(t);return Ft(n,new St(Ui(),e,i))}function $f(n,e){return Ft(n,new Tt(Ui(),e))}function Gf(n,e,t){const i=Gi(n,t);if(i){const s=ji(i),r=s.path,o=s.queryId,a=L(r,e),l=new Tt(Wi(o),a);return zi(n,r,l)}else return[]}function ha(n,e,t,i,s=!1){const r=e._path,o=n.syncPointTree_.get(r);let a=[];if(o&&(e._queryIdentifier==="default"||ca(o,e))){const l=Ff(o,e,t,i);Lf(o)&&(n.syncPointTree_=n.syncPointTree_.remove(r));const c=l.removed;if(a=l.events,!s){const u=c.findIndex(d=>d._queryParams.loadsAllData())!==-1,h=n.syncPointTree_.findOnPath(r,(d,p)=>ye(p));if(u&&!h){const d=n.syncPointTree_.subtree(r);if(!d.isEmpty()){const p=Kf(d);for(let _=0;_<p.length;++_){const w=p[_],k=w.query,Y=_a(n,w);n.listenProvider_.startListening(_t(k),bt(n,k),Y.hashFn,Y.onComplete)}}}!h&&c.length>0&&!i&&(u?n.listenProvider_.stopListening(_t(e),null):c.forEach(d=>{const p=n.queryToTagMap.get(Sn(d));n.listenProvider_.stopListening(_t(d),p)}))}Yf(n,c)}return a}function ua(n,e,t,i){const s=Gi(n,i);if(s!=null){const r=ji(s),o=r.path,a=r.queryId,l=L(o,e),c=new Oe(Wi(a),l,t);return zi(n,o,c)}else return[]}function jf(n,e,t,i){const s=Gi(n,i);if(s){const r=ji(s),o=r.path,a=r.queryId,l=L(o,e),c=b.fromObject(t),u=new St(Wi(a),l,c);return zi(n,o,u)}else return[]}function zf(n,e,t,i=!1){const s=e._path;let r=null,o=!1;n.syncPointTree_.foreachOnPath(s,(d,p)=>{const _=L(d,s);r=r||ge(p,_),o=o||ye(p)});let a=n.syncPointTree_.get(s);a?(o=o||ye(a),r=r||ge(a,I())):(a=new ra,n.syncPointTree_=n.syncPointTree_.set(s,a));let l;r!=null?l=!0:(l=!1,r=m.EMPTY_NODE,n.syncPointTree_.subtree(s).foreachChild((p,_)=>{const w=ge(_,I());w&&(r=r.updateImmediateChild(p,w))}));const c=ca(a,e);if(!c&&!e._queryParams.loadsAllData()){const d=Sn(e);f(!n.queryToTagMap.has(d),"View does not exist, but we have a tag");const p=Qf();n.queryToTagMap.set(d,p),n.tagToQueryMap.set(p,d)}const u=Cn(n.pendingWriteTree_,s);let h=xf(a,e,t,u,r,l);if(!c&&!o&&!i){const d=la(a,e);h=h.concat(Jf(n,e,d))}return h}function da(n,e,t){const s=n.pendingWriteTree_,r=n.syncPointTree_.findOnPath(e,(o,a)=>{const l=L(o,e),c=ge(a,l);if(c)return c});return Zo(s,e,r,t,!0)}function qf(n,e){const t=e._path;let i=null;n.syncPointTree_.foreachOnPath(t,(c,u)=>{const h=L(c,t);i=i||ge(u,h)});let s=n.syncPointTree_.get(t);s?i=i||ge(s,I()):(s=new ra,n.syncPointTree_=n.syncPointTree_.set(t,s));const r=i!=null,o=r?new ve(i,!0,!1):null,a=Cn(n.pendingWriteTree_,e._path),l=oa(s,e,a,r?o.getNode():m.EMPTY_NODE,r);return Nf(l)}function Ft(n,e){return fa(e,n.syncPointTree_,null,Cn(n.pendingWriteTree_,I()))}function fa(n,e,t,i){if(y(n.path))return pa(n,e,t,i);{const s=e.get(I());t==null&&s!=null&&(t=ge(s,I()));let r=[];const o=E(n.path),a=n.operationForChild(o),l=e.children.get(o);if(l&&a){const c=t?t.getImmediateChild(o):null,u=ea(i,o);r=r.concat(fa(a,l,c,u))}return s&&(r=r.concat($i(s,n,i,t))),r}}function pa(n,e,t,i){const s=e.get(I());t==null&&s!=null&&(t=ge(s,I()));let r=[];return e.children.inorderTraversal((o,a)=>{const l=t?t.getImmediateChild(o):null,c=ea(i,o),u=n.operationForChild(o);u&&(r=r.concat(pa(u,a,l,c)))}),s&&(r=r.concat($i(s,n,i,t))),r}function _a(n,e){const t=e.query,i=bt(n,t);return{hashFn:()=>(kf(e)||m.EMPTY_NODE).hash(),onComplete:s=>{if(s==="ok")return i?Gf(n,t._path,i):$f(n,t._path);{const r=Gu(s,t);return ha(n,t,null,r)}}}}function bt(n,e){const t=Sn(e);return n.queryToTagMap.get(t)}function Sn(n){return n._path.toString()+"$"+n._queryIdentifier}function Gi(n,e){return n.tagToQueryMap.get(e)}function ji(n){const e=n.indexOf("$");return f(e!==-1&&e<n.length-1,"Bad queryKey."),{queryId:n.substr(e+1),path:new T(n.substr(0,e))}}function zi(n,e,t){const i=n.syncPointTree_.get(e);f(i,"Missing sync point for query tag that we're tracking");const s=Cn(n.pendingWriteTree_,e);return $i(i,t,s,null)}function Kf(n){return n.fold((e,t,i)=>{if(t&&ye(t))return[Tn(t)];{let s=[];return t&&(s=aa(t)),W(i,(r,o)=>{s=s.concat(o)}),s}})}function _t(n){return n._queryParams.loadsAllData()&&!n._queryParams.isDefault()?new(Wf())(n._repo,n._path):n}function Yf(n,e){for(let t=0;t<e.length;++t){const i=e[t];if(!i._queryParams.loadsAllData()){const s=Sn(i),r=n.queryToTagMap.get(s);n.queryToTagMap.delete(s),n.tagToQueryMap.delete(r)}}}function Qf(){return Bf++}function Jf(n,e,t){const i=e._path,s=bt(n,e),r=_a(n,t),o=n.listenProvider_.startListening(_t(e),s,r.hashFn,r.onComplete),a=n.syncPointTree_.subtree(i);if(s)f(!ye(a.value),"If we're adding a query, it shouldn't be shadowed");else{const l=a.fold((c,u,h)=>{if(!y(c)&&u&&ye(u))return[Tn(u).query];{let d=[];return u&&(d=d.concat(aa(u).map(p=>p.query))),W(h,(p,_)=>{d=d.concat(_)}),d}});for(let c=0;c<l.length;++c){const u=l[c];n.listenProvider_.stopListening(_t(u),bt(n,u))}}return o}/**
|
|
2570
2570
|
* @license
|
|
2571
2571
|
* Copyright 2017 Google LLC
|
|
2572
2572
|
*
|
|
@@ -2581,7 +2581,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2581
2581
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2582
2582
|
* See the License for the specific language governing permissions and
|
|
2583
2583
|
* limitations under the License.
|
|
2584
|
-
*/class
|
|
2584
|
+
*/class qi{constructor(e){this.node_=e}getImmediateChild(e){const t=this.node_.getImmediateChild(e);return new qi(t)}node(){return this.node_}}class Ki{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){const t=A(this.path_,e);return new Ki(this.syncTree_,t)}node(){return da(this.syncTree_,this.path_)}}const Xf=function(n){return n=n||{},n.timestamp=n.timestamp||new Date().getTime(),n},ur=function(n,e,t){if(!n||typeof n!="object")return n;if(f(".sv"in n,"Unexpected leaf node or priority contents"),typeof n[".sv"]=="string")return Zf(n[".sv"],e,t);if(typeof n[".sv"]=="object")return ep(n[".sv"],e);f(!1,"Unexpected server value: "+JSON.stringify(n,null,2))},Zf=function(n,e,t){switch(n){case"timestamp":return t.timestamp;default:f(!1,"Unexpected server value: "+n)}},ep=function(n,e,t){n.hasOwnProperty("increment")||f(!1,"Unexpected server value: "+JSON.stringify(n,null,2));const i=n.increment;typeof i!="number"&&f(!1,"Unexpected increment value: "+i);const s=e.node();if(f(s!==null&&typeof s<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!s.isLeafNode())return i;const o=s.getValue();return typeof o!="number"?i:o+i},tp=function(n,e,t,i){return Yi(e,new Ki(t,n),i)},np=function(n,e,t){return Yi(n,new qi(e),t)};function Yi(n,e,t){const i=n.getPriority().val(),s=ur(i,e.getImmediateChild(".priority"),t);let r;if(n.isLeafNode()){const o=n,a=ur(o.getValue(),e,t);return a!==o.getValue()||s!==o.getPriority().val()?new P(a,D(s)):n}else{const o=n;return r=o,s!==o.getPriority().val()&&(r=r.updatePriority(new P(s))),o.forEachChild(R,(a,l)=>{const c=Yi(l,e.getImmediateChild(a),t);c!==l&&(r=r.updateImmediateChild(a,c))}),r}}/**
|
|
2585
2585
|
* @license
|
|
2586
2586
|
* Copyright 2017 Google LLC
|
|
2587
2587
|
*
|
|
@@ -2596,7 +2596,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2596
2596
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2597
2597
|
* See the License for the specific language governing permissions and
|
|
2598
2598
|
* limitations under the License.
|
|
2599
|
-
*/class
|
|
2599
|
+
*/class Qi{constructor(e="",t=null,i={children:{},childCount:0}){this.name=e,this.parent=t,this.node=i}}function Ji(n,e){let t=e instanceof T?e:new T(e),i=n,s=E(t);for(;s!==null;){const r=je(i.node.children,s)||{children:{},childCount:0};i=new Qi(s,i,r),t=S(t),s=E(t)}return i}function it(n){return n.node.value}function ga(n,e){n.node.value=e,hi(n)}function ma(n){return n.node.childCount>0}function ip(n){return it(n)===void 0&&!ma(n)}function bn(n,e){W(n.node.children,(t,i)=>{e(new Qi(t,n,i))})}function va(n,e,t,i){t&&e(n),bn(n,s=>{va(s,e,!0)})}function sp(n,e,t){let i=n.parent;for(;i!==null;){if(e(i))return!0;i=i.parent}return!1}function Ut(n){return new T(n.parent===null?n.name:Ut(n.parent)+"/"+n.name)}function hi(n){n.parent!==null&&rp(n.parent,n.name,n)}function rp(n,e,t){const i=ip(t),s=se(n.node.children,e);i&&s?(delete n.node.children[e],n.node.childCount--,hi(n)):!i&&!s&&(n.node.children[e]=t.node,n.node.childCount++,hi(n))}/**
|
|
2600
2600
|
* @license
|
|
2601
2601
|
* Copyright 2017 Google LLC
|
|
2602
2602
|
*
|
|
@@ -2611,7 +2611,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2611
2611
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2612
2612
|
* See the License for the specific language governing permissions and
|
|
2613
2613
|
* limitations under the License.
|
|
2614
|
-
*/const
|
|
2614
|
+
*/const op=/[\[\].#$\/\u0000-\u001F\u007F]/,ap=/[\[\].#$\u0000-\u001F\u007F]/,Vn=10*1024*1024,ya=function(n){return typeof n=="string"&&n.length!==0&&!op.test(n)},Ea=function(n){return typeof n=="string"&&n.length!==0&&!ap.test(n)},lp=function(n){return n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),Ea(n)},Ia=function(n,e,t){const i=t instanceof T?new Cd(t,n):t;if(e===void 0)throw new Error(n+"contains undefined "+be(i));if(typeof e=="function")throw new Error(n+"contains a function "+be(i)+" with contents = "+e.toString());if(go(e))throw new Error(n+"contains "+e.toString()+" "+be(i));if(typeof e=="string"&&e.length>Vn/3&&gn(e)>Vn)throw new Error(n+"contains a string greater than "+Vn+" utf8 bytes "+be(i)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let s=!1,r=!1;if(W(e,(o,a)=>{if(o===".value")s=!0;else if(o!==".priority"&&o!==".sv"&&(r=!0,!ya(o)))throw new Error(n+" contains an invalid key ("+o+") "+be(i)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Td(i,o),Ia(n,a,i),Sd(i)}),s&&r)throw new Error(n+' contains ".value" child '+be(i)+" in addition to actual children.")}},wa=function(n,e,t,i){if(!Ea(t))throw new Error(Tr(n,e)+'was an invalid path = "'+t+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},cp=function(n,e,t,i){t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),wa(n,e,t)},hp=function(n,e){const t=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!ya(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||t.length!==0&&!lp(t))throw new Error(Tr(n,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/**
|
|
2615
2615
|
* @license
|
|
2616
2616
|
* Copyright 2017 Google LLC
|
|
2617
2617
|
*
|
|
@@ -2626,7 +2626,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2626
2626
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2627
2627
|
* See the License for the specific language governing permissions and
|
|
2628
2628
|
* limitations under the License.
|
|
2629
|
-
*/class
|
|
2629
|
+
*/class up{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function dp(n,e){let t=null;for(let i=0;i<e.length;i++){const s=e[i],r=s.getPath();t!==null&&!Bo(r,t.path)&&(n.eventLists_.push(t),t=null),t===null&&(t={events:[],path:r}),t.events.push(s)}t&&n.eventLists_.push(t)}function we(n,e,t){dp(n,t),fp(n,i=>$(i,e)||$(e,i))}function fp(n,e){n.recursionDepth_++;let t=!0;for(let i=0;i<n.eventLists_.length;i++){const s=n.eventLists_[i];if(s){const r=s.path;e(r)?(pp(n.eventLists_[i]),n.eventLists_[i]=null):t=!1}}t&&(n.eventLists_=[]),n.recursionDepth_--}function pp(n){for(let e=0;e<n.events.length;e++){const t=n.events[e];if(t!==null){n.events[e]=null;const i=t.getEventRunner();ut&&M("event: "+t.toString()),Mt(i)}}}/**
|
|
2630
2630
|
* @license
|
|
2631
2631
|
* Copyright 2017 Google LLC
|
|
2632
2632
|
*
|
|
@@ -2641,7 +2641,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2641
2641
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2642
2642
|
* See the License for the specific language governing permissions and
|
|
2643
2643
|
* limitations under the License.
|
|
2644
|
-
*/const
|
|
2644
|
+
*/const _p="repo_interrupt",gp=25;class mp{constructor(e,t,i,s){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=i,this.appCheckProvider_=s,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new up,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=ln(),this.transactionQueueTree_=new Qi,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function vp(n,e,t){if(n.stats_=Oi(n.repoInfo_),n.forceRestClient_||Ku())n.server_=new an(n.repoInfo_,(i,s,r,o)=>{dr(n,i,s,r,o)},n.authTokenProvider_,n.appCheckProvider_),setTimeout(()=>fr(n,!0),0);else{if(typeof t<"u"&&t!==null){if(typeof t!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{N(t)}catch(i){throw new Error("Invalid authOverride provided: "+i)}}n.persistentConnection_=new ee(n.repoInfo_,e,(i,s,r,o)=>{dr(n,i,s,r,o)},i=>{fr(n,i)},i=>{Ep(n,i)},n.authTokenProvider_,n.appCheckProvider_,t),n.server_=n.persistentConnection_}n.authTokenProvider_.addTokenChangeListener(i=>{n.server_.refreshAuthToken(i)}),n.appCheckProvider_.addTokenChangeListener(i=>{n.server_.refreshAppCheckToken(i.token)}),n.statsReporter_=Zu(n.repoInfo_,()=>new Jd(n.stats_,n.server_)),n.infoData_=new zd,n.infoSyncTree_=new hr({startListening:(i,s,r,o)=>{let a=[];const l=n.infoData_.getNode(i._path);return l.isEmpty()||(a=xt(n.infoSyncTree_,i._path,l),setTimeout(()=>{o("ok")},0)),a},stopListening:()=>{}}),Xi(n,"connected",!1),n.serverSyncTree_=new hr({startListening:(i,s,r,o)=>(n.server_.listen(i,r,s,(a,l)=>{const c=o(a,l);we(n.eventQueue_,i._path,c)}),[]),stopListening:(i,s)=>{n.server_.unlisten(i,s)}})}function yp(n){const t=n.infoData_.getNode(new T(".info/serverTimeOffset")).val()||0;return new Date().getTime()+t}function Ca(n){return Xf({timestamp:yp(n)})}function dr(n,e,t,i,s){n.dataUpdateCount++;const r=new T(e);t=n.interceptServerDataCallback_?n.interceptServerDataCallback_(e,t):t;let o=[];if(s)if(i){const l=Qt(t,c=>D(c));o=jf(n.serverSyncTree_,r,l,s)}else{const l=D(t);o=ua(n.serverSyncTree_,r,l,s)}else if(i){const l=Qt(t,c=>D(c));o=Vf(n.serverSyncTree_,r,l)}else{const l=D(t);o=xt(n.serverSyncTree_,r,l)}let a=r;o.length>0&&(a=ts(n,r)),we(n.eventQueue_,a,o)}function fr(n,e){Xi(n,"connected",e),e===!1&&Cp(n)}function Ep(n,e){W(e,(t,i)=>{Xi(n,t,i)})}function Xi(n,e,t){const i=new T("/.info/"+e),s=D(t);n.infoData_.updateSnapshot(i,s);const r=xt(n.infoSyncTree_,i,s);we(n.eventQueue_,i,r)}function Ip(n){return n.nextWriteId_++}function wp(n,e,t){const i=qf(n.serverSyncTree_,e);return i!=null?Promise.resolve(i):n.server_.get(e).then(s=>{const r=D(s).withIndex(e._queryParams.getIndex());zf(n.serverSyncTree_,e,t,!0);let o;if(e._queryParams.loadsAllData())o=xt(n.serverSyncTree_,e._path,r);else{const a=bt(n.serverSyncTree_,e);o=ua(n.serverSyncTree_,e._path,r,a)}return we(n.eventQueue_,e._path,o),ha(n.serverSyncTree_,e,t,null,!0),r},s=>(Zi(n,"get for query "+N(e)+" failed: "+s),Promise.reject(new Error(s))))}function Cp(n){Zi(n,"onDisconnectEvents");const e=Ca(n),t=ln();ri(n.onDisconnect_,I(),(s,r)=>{const o=tp(s,r,n.serverSyncTree_,e);Ko(t,s,o)});let i=[];ri(t,I(),(s,r)=>{i=i.concat(xt(n.serverSyncTree_,s,r));const o=Rp(n,s);ts(n,o)}),n.onDisconnect_=ln(),we(n.eventQueue_,I(),i)}function Tp(n){n.persistentConnection_&&n.persistentConnection_.interrupt(_p)}function Zi(n,...e){let t="";n.persistentConnection_&&(t=n.persistentConnection_.id+":"),M(t,...e)}function Ta(n,e,t){return da(n.serverSyncTree_,e,t)||m.EMPTY_NODE}function es(n,e=n.transactionQueueTree_){if(e||Rn(n,e),it(e)){const t=ba(n,e);f(t.length>0,"Sending zero length transaction queue"),t.every(s=>s.status===0)&&Sp(n,Ut(e),t)}else ma(e)&&bn(e,t=>{es(n,t)})}function Sp(n,e,t){const i=t.map(c=>c.currentWriteId),s=Ta(n,e,i);let r=s;const o=s.hash();for(let c=0;c<t.length;c++){const u=t[c];f(u.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=1,u.retryCount++;const h=L(e,u.path);r=r.updateChild(h,u.currentOutputSnapshotRaw)}const a=r.val(!0),l=e;n.server_.put(l.toString(),a,c=>{Zi(n,"transaction put response",{path:l.toString(),status:c});let u=[];if(c==="ok"){const h=[];for(let d=0;d<t.length;d++)t[d].status=2,u=u.concat(We(n.serverSyncTree_,t[d].currentWriteId)),t[d].onComplete&&h.push(()=>t[d].onComplete(null,!0,t[d].currentOutputSnapshotResolved)),t[d].unwatcher();Rn(n,Ji(n.transactionQueueTree_,e)),es(n,n.transactionQueueTree_),we(n.eventQueue_,e,u);for(let d=0;d<h.length;d++)Mt(h[d])}else{if(c==="datastale")for(let h=0;h<t.length;h++)t[h].status===3?t[h].status=4:t[h].status=0;else{B("transaction at "+l.toString()+" failed: "+c);for(let h=0;h<t.length;h++)t[h].status=4,t[h].abortReason=c}ts(n,e)}},o)}function ts(n,e){const t=Sa(n,e),i=Ut(t),s=ba(n,t);return bp(n,s,i),i}function bp(n,e,t){if(e.length===0)return;const i=[];let s=[];const o=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){const l=e[a],c=L(t,l.path);let u=!1,h;if(f(c!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),l.status===4)u=!0,h=l.abortReason,s=s.concat(We(n.serverSyncTree_,l.currentWriteId,!0));else if(l.status===0)if(l.retryCount>=gp)u=!0,h="maxretry",s=s.concat(We(n.serverSyncTree_,l.currentWriteId,!0));else{const d=Ta(n,l.path,o);l.currentInputSnapshot=d;const p=e[a].update(d.val());if(p!==void 0){Ia("transaction failed: Data returned ",p,l.path);let _=D(p);typeof p=="object"&&p!=null&&se(p,".priority")||(_=_.updatePriority(d.getPriority()));const k=l.currentWriteId,Y=Ca(n),Ce=np(_,d,Y);l.currentOutputSnapshotRaw=_,l.currentOutputSnapshotResolved=Ce,l.currentWriteId=Ip(n),o.splice(o.indexOf(k),1),s=s.concat(Hf(n.serverSyncTree_,l.path,Ce,l.currentWriteId,l.applyLocally)),s=s.concat(We(n.serverSyncTree_,k,!0))}else u=!0,h="nodata",s=s.concat(We(n.serverSyncTree_,l.currentWriteId,!0))}we(n.eventQueue_,t,s),s=[],u&&(e[a].status=2,function(d){setTimeout(d,Math.floor(0))}(e[a].unwatcher),e[a].onComplete&&(h==="nodata"?i.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):i.push(()=>e[a].onComplete(new Error(h),!1,null))))}Rn(n,n.transactionQueueTree_);for(let a=0;a<i.length;a++)Mt(i[a]);es(n,n.transactionQueueTree_)}function Sa(n,e){let t,i=n.transactionQueueTree_;for(t=E(e);t!==null&&it(i)===void 0;)i=Ji(i,t),e=S(e),t=E(e);return i}function ba(n,e){const t=[];return Ra(n,e,t),t.sort((i,s)=>i.order-s.order),t}function Ra(n,e,t){const i=it(e);if(i)for(let s=0;s<i.length;s++)t.push(i[s]);bn(e,s=>{Ra(n,s,t)})}function Rn(n,e){const t=it(e);if(t){let i=0;for(let s=0;s<t.length;s++)t[s].status!==2&&(t[i]=t[s],i++);t.length=i,ga(e,t.length>0?t:void 0)}bn(e,i=>{Rn(n,i)})}function Rp(n,e){const t=Ut(Sa(n,e)),i=Ji(n.transactionQueueTree_,e);return sp(i,s=>{$n(n,s)}),$n(n,i),va(i,s=>{$n(n,s)}),t}function $n(n,e){const t=it(e);if(t){const i=[];let s=[],r=-1;for(let o=0;o<t.length;o++)t[o].status===3||(t[o].status===1?(f(r===o-1,"All SENT items should be at beginning of queue."),r=o,t[o].status=3,t[o].abortReason="set"):(f(t[o].status===0,"Unexpected transaction status in abort"),t[o].unwatcher(),s=s.concat(We(n.serverSyncTree_,t[o].currentWriteId,!0)),t[o].onComplete&&i.push(t[o].onComplete.bind(null,new Error("set"),!1,null))));r===-1?ga(e,void 0):t.length=r+1,we(n.eventQueue_,Ut(e),s);for(let o=0;o<i.length;o++)Mt(i[o])}}/**
|
|
2645
2645
|
* @license
|
|
2646
2646
|
* Copyright 2017 Google LLC
|
|
2647
2647
|
*
|
|
@@ -2656,7 +2656,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2656
2656
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2657
2657
|
* See the License for the specific language governing permissions and
|
|
2658
2658
|
* limitations under the License.
|
|
2659
|
-
*/function
|
|
2659
|
+
*/function kp(n){let e="";const t=n.split("/");for(let i=0;i<t.length;i++)if(t[i].length>0){let s=t[i];try{s=decodeURIComponent(s.replace(/\+/g," "))}catch{}e+="/"+s}return e}function Np(n){const e={};n.charAt(0)==="?"&&(n=n.substring(1));for(const t of n.split("&")){if(t.length===0)continue;const i=t.split("=");i.length===2?e[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):B(`Invalid query segment '${t}' in query '${n}'`)}return e}const pr=function(n,e){const t=Ap(n),i=t.namespace;t.domain==="firebase.com"&&ie(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!i||i==="undefined")&&t.domain!=="localhost"&&ie("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||Wu();const s=t.scheme==="ws"||t.scheme==="wss";return{repoInfo:new ko(t.host,t.secure,i,s,e,"",i!==t.subdomain),path:new T(t.pathString)}},Ap=function(n){let e="",t="",i="",s="",r="",o=!0,a="https",l=443;if(typeof n=="string"){let c=n.indexOf("//");c>=0&&(a=n.substring(0,c-1),n=n.substring(c+2));let u=n.indexOf("/");u===-1&&(u=n.length);let h=n.indexOf("?");h===-1&&(h=n.length),e=n.substring(0,Math.min(u,h)),u<h&&(s=kp(n.substring(u,h)));const d=Np(n.substring(Math.min(n.length,h)));c=e.indexOf(":"),c>=0?(o=a==="https"||a==="wss",l=parseInt(e.substring(c+1),10)):c=e.length;const p=e.slice(0,c);if(p.toLowerCase()==="localhost")t="localhost";else if(p.split(".").length<=2)t=p;else{const _=e.indexOf(".");i=e.substring(0,_).toLowerCase(),t=e.substring(_+1),r=i}"ns"in d&&(r=d.ns)}return{host:e,port:l,domain:t,subdomain:i,secure:o,scheme:a,pathString:s,namespace:r}};/**
|
|
2660
2660
|
* @license
|
|
2661
2661
|
* Copyright 2017 Google LLC
|
|
2662
2662
|
*
|
|
@@ -2671,7 +2671,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2671
2671
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2672
2672
|
* See the License for the specific language governing permissions and
|
|
2673
2673
|
* limitations under the License.
|
|
2674
|
-
*/class
|
|
2674
|
+
*/class Pp{constructor(e,t,i,s){this.eventType=e,this.eventRegistration=t,this.snapshot=i,this.prevName=s}getPath(){const e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+N(this.snapshot.exportVal())}}class Op{constructor(e,t,i){this.eventRegistration=e,this.error=t,this.path=i}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}/**
|
|
2675
2675
|
* @license
|
|
2676
2676
|
* Copyright 2017 Google LLC
|
|
2677
2677
|
*
|
|
@@ -2686,7 +2686,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2686
2686
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2687
2687
|
* See the License for the specific language governing permissions and
|
|
2688
2688
|
* limitations under the License.
|
|
2689
|
-
*/class
|
|
2689
|
+
*/class Dp{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return f(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}/**
|
|
2690
2690
|
* @license
|
|
2691
2691
|
* Copyright 2020 Google LLC
|
|
2692
2692
|
*
|
|
@@ -2701,7 +2701,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2701
2701
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2702
2702
|
* See the License for the specific language governing permissions and
|
|
2703
2703
|
* limitations under the License.
|
|
2704
|
-
*/class
|
|
2704
|
+
*/class ns{constructor(e,t,i,s){this._repo=e,this._path=t,this._queryParams=i,this._orderByCalled=s}get key(){return y(this._path)?null:Fo(this._path)}get ref(){return new re(this._repo,this._path)}get _queryIdentifier(){const e=Zs(this._queryParams),t=Ai(e);return t==="{}"?"default":t}get _queryObject(){return Zs(this._queryParams)}isEqual(e){if(e=F(e),!(e instanceof ns))return!1;const t=this._repo===e._repo,i=Bo(this._path,e._path),s=this._queryIdentifier===e._queryIdentifier;return t&&i&&s}toJSON(){return this.toString()}toString(){return this._repo.toString()+wd(this._path)}}class re extends ns{constructor(e,t){super(e,t,new Fi,!1)}get parent(){const e=Wo(this._path);return e===null?null:new re(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}class Rt{constructor(e,t,i){this._node=e,this.ref=t,this._index=i}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const t=new T(e),i=ui(this.ref,e);return new Rt(this._node.getChild(t),i,R)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(i,s)=>e(new Rt(s,ui(this.ref,i),R)))}hasChild(e){const t=new T(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function Mp(n,e){return n=F(n),n._checkNotDeleted("ref"),e!==void 0?ui(n._root,e):n._root}function ui(n,e){return n=F(n),E(n._path)===null?cp("child","path",e):wa("child","path",e),new re(n._repo,A(n._path,e))}function Lp(n){n=F(n);const e=new Dp(()=>{}),t=new is(e);return wp(n._repo,n,t).then(i=>new Rt(i,new re(n._repo,n._path),n._queryParams.getIndex()))}class is{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,t){const i=t._queryParams.getIndex();return new Pp("value",this,new Rt(e.snapshotNode,new re(t._repo,t._path),i))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Op(this,e,t):null}matches(e){return e instanceof is?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}}Df(re);Uf(re);/**
|
|
2705
2705
|
* @license
|
|
2706
2706
|
* Copyright 2020 Google LLC
|
|
2707
2707
|
*
|
|
@@ -2716,7 +2716,7 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2716
2716
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2717
2717
|
* See the License for the specific language governing permissions and
|
|
2718
2718
|
* limitations under the License.
|
|
2719
|
-
*/const
|
|
2719
|
+
*/const xp="FIREBASE_DATABASE_EMULATOR_HOST",di={};let Fp=!1;function Up(n,e,t,i){n.repoInfo_=new ko(e,!1,n.repoInfo_.namespace,n.repoInfo_.webSocketOnly,n.repoInfo_.nodeAdmin,n.repoInfo_.persistenceKey,n.repoInfo_.includeNamespaceInQueryParams,!0,t),i&&(n.authTokenProvider_=i)}function Wp(n,e,t,i,s){let r=i||n.options.databaseURL;r===void 0&&(n.options.projectId||ie("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),M("Using default host for project ",n.options.projectId),r=`${n.options.projectId}-default-rtdb.firebaseio.com`);let o=pr(r,s),a=o.repoInfo,l;typeof process<"u"&&Ls&&(l=Ls[xp]),l?(r=`http://${l}?ns=${a.namespace}`,o=pr(r,s),a=o.repoInfo):o.repoInfo.secure;const c=new Qu(n.name,n.options,e);hp("Invalid Firebase Database URL",o),y(o.path)||ie("Database URL must point to the root of a Firebase Database (not including a child path).");const u=Hp(a,n,c,new Yu(n,t));return new Vp(u,n)}function Bp(n,e){const t=di[e];(!t||t[n.key]!==n)&&ie(`Database ${e}(${n.repoInfo_}) has already been deleted.`),Tp(n),delete t[n.key]}function Hp(n,e,t,i){let s=di[e.name];s||(s={},di[e.name]=s);let r=s[n.toURLString()];return r&&ie("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),r=new mp(n,Fp,t,i),s[n.toURLString()]=r,r}class Vp{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(vp(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new re(this._repo,I())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Bp(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&ie("Cannot call "+e+" on a deleted database.")}}function $p(n=kr(),e){const t=Ii(n,"database").getImmediate({identifier:e});if(!t._instanceStarted){const i=qa("database");i&&Gp(t,...i)}return t}function Gp(n,e,t,i={}){n=F(n),n._checkNotDeleted("useEmulator");const s=`${e}:${t}`,r=n._repoInternal;if(n._instanceStarted){if(s===n._repoInternal.repoInfo_.host&&ke(i,r.repoInfo_.emulatorOptions))return;ie("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let o;if(r.repoInfo_.nodeAdmin)i.mockUserToken&&ie('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),o=new qt(qt.OWNER);else if(i.mockUserToken){const a=typeof i.mockUserToken=="string"?i.mockUserToken:Ka(i.mockUserToken,n.app.options.projectId);o=new qt(a)}Up(r,s,i,o)}/**
|
|
2720
2720
|
* @license
|
|
2721
2721
|
* Copyright 2021 Google LLC
|
|
2722
2722
|
*
|
|
@@ -2731,4 +2731,4 @@ FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of t
|
|
|
2731
2731
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2732
2732
|
* See the License for the specific language governing permissions and
|
|
2733
2733
|
* limitations under the License.
|
|
2734
|
-
*/function
|
|
2734
|
+
*/function jp(n){Du(Ze),ze(new Ne("database",(e,{instanceIdentifier:t})=>{const i=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return Wp(i,s,r,t)},"PUBLIC").setMultipleInstances(!0)),fe(xs,Fs,n),fe(xs,Fs,"esm2017")}ee.prototype.simpleListen=function(n,e){this.sendRequest("q",{p:n},e)};ee.prototype.echo=function(n,e){this.sendRequest("echo",{d:n},e)};jp();const zp={apiKey:"AIzaSyABCthtosgdR2ccIt8Fi3xfKJhiJo1EzTo",authDomain:"web-editor-ca399.firebaseapp.com",databaseURL:"https://web-editor-ca399.firebaseio.com",projectId:"web-editor-ca399",storageBucket:"",messagingSenderId:"940670473661"},ka=Rr(zp),fi=Pu(ka),qp=$p(ka),Xp=Da.withTypes(),Zp=Ma.withTypes();La.withTypes();const Na=xa.withTypes(),Kp={isLoading:!0},Gn=Na("auth/login",async({email:n,password:e,remember:t},{rejectWithValue:i})=>{var s;try{const r=await vh(fi,t?io:ei).then(()=>mh(fi,n,e)),o=(s=r.user.email)==null?void 0:s.replace(/[.@]/g,"_"),a=Mp(qp,`editors/wekeo-client/${o}`),c=(await Lp(a)).val();return{user:{uid:r.user.uid,email:r.user.email??n},role:c}}catch(r){return typeof r=="object"&&r!==null&&"message"in r?i(r.message):i("Unknown error occured")}}),jn=Na("auth/signOut",async(n,{rejectWithValue:e})=>{try{return await Ih(fi),null}catch(t){return typeof t=="object"&&t!==null&&"message"in t?e(t.message):e("Unknown error occured")}}),Aa=Fa({name:"auth",initialState:Kp,reducers:{setUser:(n,e)=>{n.isLoading=!1,n.user=e.payload},setLoading:(n,e)=>{n.isLoading=e.payload},clearError:n=>{n.error=void 0}},extraReducers:n=>{n.addCase(Gn.pending,e=>{e.isLoading=!0,e.error=void 0}).addCase(Gn.fulfilled,(e,t)=>{e.isLoading=!1,e.user=t.payload.user,e.role=t.payload.role}).addCase(Gn.rejected,(e,t)=>{e.isLoading=!1,e.error=t.payload}).addCase(jn.pending,e=>{e.isLoading=!0}).addCase(jn.fulfilled,e=>{e.isLoading=!1,e.user=void 0,e.role=void 0}).addCase(jn.rejected,(e,t)=>{e.isLoading=!1,e.error=t.payload})}}),{setUser:e_,setLoading:t_,clearError:n_}=Aa.actions,i_=Aa.reducer;export{t_ as a,fi as b,i_ as c,Zp as d,jn as e,Gn as l,Jp as o,e_ as s,Xp as u};
|