everest-npm-features 0.0.1 → 0.0.3

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.
Files changed (250) hide show
  1. package/dist/ArrowDropDown-DRUQbGft.js +8 -0
  2. package/dist/ArrowRight-t-YgAHUn.js +8 -0
  3. package/dist/{Box-wAem3MQD.js → Box-BOgpENcC.js} +11 -11
  4. package/dist/{Button-fWdSk-yh.js → Button-DXdgxFxa.js} +8 -7
  5. package/dist/{ButtonBase-SYP7klDp.js → ButtonBase-AOLUTpPg.js} +204 -211
  6. package/dist/Cancel-BMPJ8ZAg.js +11 -0
  7. package/dist/CardContent-DEA5pnhr.js +141 -0
  8. package/dist/{CircularProgress-DcXA6nAu.js → CircularProgress-BAEiXRSn.js} +31 -30
  9. package/dist/Close-mXCsZSxZ.js +8 -0
  10. package/dist/{Container-CIMHcpEe.js → Container-BOehNoF1.js} +4 -4
  11. package/dist/{ContentCopy-CexUUXuC.js → ContentCopy-HD_Xx6nx.js} +1 -1
  12. package/dist/{createSimplePaletteValueFilter-CsgjlRAs.js → DefaultPropsProvider-DmUB0SYC.js} +54 -69
  13. package/dist/DefaultPropsProvider-tqUom3mB.js +329 -0
  14. package/dist/{DialogContent-JgT9A6nk.js → DialogContent-zttWtNJM.js} +91 -90
  15. package/dist/{Close-CdRA3xUs.js → DialogTitle-BqL8DXBp.js} +16 -21
  16. package/dist/{ArrowRight-C6tjImpU.js → Divider-EGEkrkBH.js} +50 -55
  17. package/dist/{FormControl-D4QuPCnV.js → FormControl-Nd-4LC8N.js} +60 -69
  18. package/dist/FormControlLabel-BMeMEwyK.js +738 -0
  19. package/dist/{GlobalStyles-BOnEiMUE.js → GlobalStyles-CModZHM-.js} +2 -2
  20. package/dist/{Grid-dtT_MVn3.js → Grid-EISqvBSJ.js} +5 -5
  21. package/dist/Grid2-B0mJbwjl.js +374 -0
  22. package/dist/{Grow-B3Swdn2Z.js → Grow-dkRwE_ok.js} +5 -5
  23. package/dist/{IconButton-CRGy76pJ.js → IconButton-DAR3jsEV.js} +12 -11
  24. package/dist/Info-CkE3Gsf2.js +8 -0
  25. package/dist/InputAdornment-DZJP9Njd.js +169 -0
  26. package/dist/ListItemIcon-JAntieDc.js +82 -0
  27. package/dist/{wallet-DN7ej6mj.js → MenuItem-D12FP5Iq.js} +64 -75
  28. package/dist/{Modal-0q_y4zbS.js → Modal-DceAu_d2.js} +324 -397
  29. package/dist/Paper-L8ipwfkc.js +183 -0
  30. package/dist/PlayArrow-D_p2nwO8.js +21 -0
  31. package/dist/Portal-DxdKGEvu.js +86 -0
  32. package/dist/{Select-BNAaKK32.js → Select-DTQDmdn_.js} +39 -33
  33. package/dist/{Slide-BlS6unRJ.js → Slide-CWqC2RDG.js} +4 -3
  34. package/dist/Stack-CkCveRRR.js +174 -0
  35. package/dist/{TextField-CPZo0_di.js → TextField-BqIvz6Zw.js} +23 -21
  36. package/dist/{Typography-kyxogyUq.js → Typography-Dx54MRM5.js} +14 -13
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/assets/index.css +1 -1
  39. package/dist/assets/index10.css +1 -0
  40. package/dist/assets/index2.css +1 -1
  41. package/dist/assets/index3.css +1 -0
  42. package/dist/assets/index4.css +1 -0
  43. package/dist/assets/index5.css +1 -0
  44. package/dist/assets/index6.css +1 -0
  45. package/dist/assets/index7.css +1 -0
  46. package/dist/assets/index8.css +1 -0
  47. package/dist/assets/index9.css +1 -0
  48. package/dist/assets/{withThemeProvider.css → main.css} +1 -1
  49. package/dist/assets/styles.css +1 -1
  50. package/dist/assets/styles3.css +1 -0
  51. package/dist/auth-DDk8JxR-.js +46 -0
  52. package/dist/axios-BEX6n2A7.js +796 -0
  53. package/dist/bank-BvPXd5sM.js +23 -0
  54. package/dist/components/Account/index.d.ts +4 -0
  55. package/dist/components/Account/index.js +310 -0
  56. package/dist/components/History/index.d.ts +2 -0
  57. package/dist/components/History/index.js +804 -0
  58. package/dist/components/MoveToEthereumOrEverChain/index.d.ts +18 -0
  59. package/dist/components/MoveToEthereumOrEverChain/index.js +345 -0
  60. package/dist/components/Profile/documents.js +19 -14
  61. package/dist/components/Profile/index.js +128 -135
  62. package/dist/components/Receive/index.js +25 -23
  63. package/dist/components/RocketRamp/Buy/cardPayment.d.ts +3 -0
  64. package/dist/components/RocketRamp/Buy/cardPayment.js +17 -0
  65. package/dist/components/RocketRamp/Buy/confirmTransaction.d.ts +3 -0
  66. package/dist/components/RocketRamp/Buy/confirmTransaction.js +16 -0
  67. package/dist/components/RocketRamp/Buy/form.d.ts +3 -0
  68. package/dist/components/RocketRamp/Buy/form.js +26 -0
  69. package/dist/components/RocketRamp/Buy/index.d.ts +6 -0
  70. package/dist/components/RocketRamp/Buy/index.js +31 -0
  71. package/dist/components/RocketRamp/Buy/types.d.ts +33 -0
  72. package/dist/components/RocketRamp/Buy/types.js +1 -0
  73. package/dist/components/RocketRamp/Dashboard/balance.d.ts +9 -0
  74. package/dist/components/RocketRamp/Dashboard/balance.js +75 -0
  75. package/dist/components/RocketRamp/Dashboard/index.d.ts +5 -0
  76. package/dist/components/RocketRamp/Dashboard/index.js +36 -0
  77. package/dist/components/RocketRamp/Dashboard/transaction.d.ts +8 -0
  78. package/dist/components/RocketRamp/Dashboard/transaction.js +28 -0
  79. package/dist/components/RocketRamp/MinimalKyc/index.d.ts +6 -0
  80. package/dist/components/RocketRamp/MinimalKyc/index.js +254 -0
  81. package/dist/components/RocketRamp/Shared/Button/index.d.ts +10 -0
  82. package/dist/components/RocketRamp/Shared/Button/index.js +82 -0
  83. package/dist/components/RocketRamp/Shared/Input/index.d.ts +11 -0
  84. package/dist/components/RocketRamp/Shared/Input/index.js +46 -0
  85. package/dist/components/RocketRamp/Shared/backBtn.d.ts +5 -0
  86. package/dist/components/RocketRamp/Shared/backBtn.js +21 -0
  87. package/dist/components/RocketRamp/Shared/transactionItem.d.ts +7 -0
  88. package/dist/components/RocketRamp/Shared/transactionItem.js +125 -0
  89. package/dist/components/RocketRamp/SignIn/index.d.ts +3 -0
  90. package/dist/components/RocketRamp/SignIn/index.js +82 -0
  91. package/dist/components/RocketRamp/SignIn/loginForm.d.ts +3 -0
  92. package/dist/components/RocketRamp/SignIn/loginForm.js +81 -0
  93. package/dist/components/RocketRamp/SignIn/otpForm.d.ts +3 -0
  94. package/dist/components/RocketRamp/SignIn/otpForm.js +112 -0
  95. package/dist/components/RocketRamp/SignIn/types.d.ts +22 -0
  96. package/dist/components/RocketRamp/SignIn/types.js +1 -0
  97. package/dist/components/RocketRamp/SignUp/email.d.ts +3 -0
  98. package/dist/components/RocketRamp/SignUp/email.js +70 -0
  99. package/dist/components/RocketRamp/SignUp/index.d.ts +3 -0
  100. package/dist/components/RocketRamp/SignUp/index.js +163 -0
  101. package/dist/components/RocketRamp/SignUp/personalInfo.d.ts +3 -0
  102. package/dist/components/RocketRamp/SignUp/personalInfo.js +415 -0
  103. package/dist/components/RocketRamp/SignUp/summary.d.ts +3 -0
  104. package/dist/components/RocketRamp/SignUp/summary.js +57 -0
  105. package/dist/components/RocketRamp/SignUp/types.d.ts +50 -0
  106. package/dist/components/RocketRamp/SignUp/types.js +1 -0
  107. package/dist/components/RocketRamp/SignUp/validateEmail.d.ts +3 -0
  108. package/dist/components/RocketRamp/SignUp/validateEmail.js +99 -0
  109. package/dist/components/RocketRamp/Transactions/index.d.ts +5 -0
  110. package/dist/components/RocketRamp/Transactions/index.js +38 -0
  111. package/dist/components/Send/index.js +62 -51
  112. package/dist/components/Shared/ConnectWallet/index.d.ts +20 -0
  113. package/dist/components/Shared/ConnectWallet/index.js +25364 -0
  114. package/dist/components/Shared/HistoryItem/index.d.ts +5 -0
  115. package/dist/components/Shared/HistoryItem/index.js +120 -0
  116. package/dist/components/Shared/Keyboard/keyboard.js +3 -3
  117. package/dist/components/Shared/TokenModal/index.d.ts +10 -0
  118. package/dist/components/Shared/TokenModal/index.js +104 -0
  119. package/dist/components/Shared/TokenModal/tokenGrid.d.ts +7 -0
  120. package/dist/components/Shared/TokenModal/tokenGrid.js +51 -0
  121. package/dist/components/Shared/addBank.d.ts +2 -0
  122. package/dist/components/Shared/addBank.js +172 -0
  123. package/dist/components/Shared/button.js +1 -1
  124. package/dist/components/Shared/connectPlaidBank.d.ts +2 -0
  125. package/dist/components/Shared/connectPlaidBank.js +57 -0
  126. package/dist/components/Shared/incode.js +34 -32
  127. package/dist/components/Shared/inputField.js +1 -1
  128. package/dist/components/Shared/noData.d.ts +4 -0
  129. package/dist/components/Shared/noData.js +14 -0
  130. package/dist/components/Shared/pin.js +3 -3
  131. package/dist/components/Shared/step.js +2 -2
  132. package/dist/components/Shared/tooltip.d.ts +4 -0
  133. package/dist/components/Shared/tooltip.js +2107 -0
  134. package/dist/components/Shared/transition.js +1 -1
  135. package/dist/components/SignIn/index.js +26 -24
  136. package/dist/components/SignUp/index.js +108 -348
  137. package/dist/components/SignUp/pin.js +116 -844
  138. package/dist/components/SignUp/privacy.js +3 -3
  139. package/dist/components/SignUp/terms.js +3 -3
  140. package/dist/components/SignUp/types.d.ts +0 -1
  141. package/dist/components/SignUp/userInfo.js +4 -4
  142. package/dist/components/Stake/gems/index.d.ts +2 -0
  143. package/dist/components/Stake/gems/index.js +214 -0
  144. package/dist/components/Stake/id/index.d.ts +2 -0
  145. package/dist/components/Stake/id/index.js +233 -0
  146. package/dist/components/Stake/index.d.ts +5 -0
  147. package/dist/components/Stake/index.js +346 -0
  148. package/dist/components/Swap/index.d.ts +2 -0
  149. package/dist/components/Swap/index.js +489 -0
  150. package/dist/components/SwapAndUniSwap/index.d.ts +3 -0
  151. package/dist/components/SwapAndUniSwap/index.js +43 -0
  152. package/dist/components/WalletPortfolio/index.js +191 -263
  153. package/dist/components/WalletPortfolio/tokenRow.js +8 -5
  154. package/dist/constants-SKm7VF9k.js +3982 -0
  155. package/dist/countries-BVn1FubK.js +1925 -0
  156. package/dist/createSimplePaletteValueFilter-B7--0ryQ.js +17 -0
  157. package/dist/{createSvgIcon-CAZr4ukt.js → createSvgIcon-jkXneOQN.js} +6 -6
  158. package/dist/{createTheme-NrBCWesw.js → createTheme-F9Dk4FhK.js} +182 -174
  159. package/dist/data/countries.json.d.ts +1925 -0
  160. package/dist/defaultTheme-Bc00Q3Kt.js +5 -0
  161. package/dist/dividerClasses-SUAUDDqL.js +10 -0
  162. package/dist/{documents-CL4Ajr_B.js → documents-7w9u2Oig.js} +123 -122
  163. package/dist/elementTypeAcceptingRef-BufevUW8.js +23 -0
  164. package/dist/emotion-react.browser.esm-CI0uV1W5.js +233 -0
  165. package/dist/{extendSxProp-CuERe1TA.js → extendSxProp-Cm2UBzGf.js} +1 -1
  166. package/dist/generic-token-B_ptO5yb.js +4 -0
  167. package/dist/hoc/withThemeProvider.js +33 -32
  168. package/dist/hooks/useDialog/index.js +4 -4
  169. package/dist/hooks/useSnackBar.js +63 -60
  170. package/dist/icons/buyIcon.d.ts +2 -0
  171. package/dist/icons/buyIcon.js +19 -0
  172. package/dist/icons/canceledBuyIcon.d.ts +2 -0
  173. package/dist/icons/canceledBuyIcon.js +34 -0
  174. package/dist/icons/canceledRedeemIcon.d.ts +2 -0
  175. package/dist/icons/canceledRedeemIcon.js +35 -0
  176. package/dist/icons/failedBuyIcon.d.ts +2 -0
  177. package/dist/icons/failedBuyIcon.js +48 -0
  178. package/dist/icons/failedRedeemIcon.d.ts +2 -0
  179. package/dist/icons/failedRedeemIcon.js +48 -0
  180. package/dist/icons/pendingBuyIcon.d.ts +2 -0
  181. package/dist/icons/pendingBuyIcon.js +38 -0
  182. package/dist/icons/pendingRedeemIcon.d.ts +2 -0
  183. package/dist/icons/pendingRedeemIcon.js +34 -0
  184. package/dist/icons/redeemIcon.d.ts +2 -0
  185. package/dist/icons/redeemIcon.js +19 -0
  186. package/dist/index-B8QKlEgj.js +37095 -0
  187. package/dist/{index-Cq3eHOnB.js → index-BJlsh9ro.js} +1 -1
  188. package/dist/index-BhmBCie8.js +796 -0
  189. package/dist/index-C3FYdQkQ.js +4050 -0
  190. package/dist/index-CrajlEO_.js +576 -0
  191. package/dist/index-TElEjliR.js +9 -0
  192. package/dist/{index-iAyNk1r6.js → index-_kqRfgnc.js} +5 -5
  193. package/dist/index-ceeCtFuh.js +136 -0
  194. package/dist/index.esm-BsMAMhYW.js +237 -0
  195. package/dist/isFocusVisible-CPZqtjv2.js +12 -0
  196. package/dist/isMuiElement-DnSE4qG4.js +13 -0
  197. package/dist/main.d.ts +99 -0
  198. package/dist/main.js +34 -12
  199. package/dist/moment-h96o7c8I.js +2578 -0
  200. package/dist/order-CO4ra5N-.js +27 -0
  201. package/dist/ownerWindow-C-760D__.js +7 -0
  202. package/dist/providers/metaMask.d.ts +6 -0
  203. package/dist/providers/metaMask.js +24 -0
  204. package/dist/react-redux-B4BZippc.js +255 -0
  205. package/dist/react-webcam-B3cXh1XT.js +267 -0
  206. package/dist/resolveComponentProps-BdTgLKBb.js +80 -0
  207. package/dist/rr-primary-logo-CqI24c8v.js +4 -0
  208. package/dist/stake-DHpsHQbJ.js +17 -0
  209. package/dist/store.d.ts +66 -0
  210. package/dist/store.js +1 -0
  211. package/dist/styled-BTIMwpiX.js +5 -0
  212. package/dist/{styles.module-KeND8lCR.js → styles.module-6SB62f3J.js} +1 -1
  213. package/dist/styles.module-O5VVND5e.js +22 -0
  214. package/dist/tokenRow-CgnPD-4U.js +206 -0
  215. package/dist/useControlled-BYdyS7Pn.js +31 -0
  216. package/dist/useFormControl-CfmEP6sW.js +18 -0
  217. package/dist/useSlot-DaP6eodX.js +50 -0
  218. package/dist/useTheme-BghcbbEW.js +9 -0
  219. package/dist/{useTheme-nlj1B_-c.js → useTheme-c0OHvtiA.js} +3 -3
  220. package/dist/{useThemeProps-BqWuFW3z.js → useThemeProps-CV9AmzHf.js} +4 -4
  221. package/dist/{useThemeWithoutDefault-BdYkMk0o.js → useThemeWithoutDefault-D8MaPbCK.js} +1 -1
  222. package/dist/useTimeout-D29bZ7Gz.js +56 -0
  223. package/dist/user-CeKqBfJU.js +24 -0
  224. package/dist/util/constants.d.ts +48 -0
  225. package/dist/util/constants.js +69 -21
  226. package/dist/util/conversions.js +54 -22271
  227. package/dist/util/functions.d.ts +5 -0
  228. package/dist/util/functions.js +81 -24
  229. package/dist/util/regex.d.ts +3 -0
  230. package/dist/util/regex.js +6 -0
  231. package/dist/{utils-_FXWkn40.js → utils-EFg3So7T.js} +163 -168
  232. package/dist/wallet-BtAQ78cv.js +35 -0
  233. package/dist/web3-u4qDZYpo.js +22328 -0
  234. package/package.json +8 -3
  235. package/dist/DefaultPropsProvider-Y8MI-J-I.js +0 -555
  236. package/dist/__vite-browser-external-DYxpcVy9-DYxpcVy9.js +0 -4
  237. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  238. package/dist/auth-Cj5FKr_m.js +0 -19
  239. package/dist/axios-xPiQW9EP.js +0 -118114
  240. package/dist/defaultTheme-OIfL8Ia7.js +0 -5
  241. package/dist/dividerClasses-Z7VLlu5C.js +0 -10
  242. package/dist/index-DKTkUdik.js +0 -6
  243. package/dist/react-redux-VW99uJjf.js +0 -5908
  244. package/dist/react-webcam-Cov1TP0q.js +0 -639
  245. package/dist/styled-Da6GnxEE.js +0 -5
  246. package/dist/tokenRow-Cdd_jFjp.js +0 -206
  247. package/dist/useFormControl-Bo6Tf_xo.js +0 -46
  248. package/dist/useSlot-CURNJ3JC.js +0 -306
  249. package/dist/useTheme-DWRMvRU8.js +0 -9
  250. package/dist/useTimeout-lr7ryrda.js +0 -75
@@ -0,0 +1,3982 @@
1
+ const Kn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", rs = new Uint8Array(256);
2
+ for (let r = 0; r < Kn.length; r++)
3
+ rs[Kn.charCodeAt(r)] = r;
4
+ process.env.NODE_ENV !== "production" && typeof Proxy < "u";
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ /**
22
+ * @license
23
+ * Copyright 2017 Google LLC
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */
37
+ const li = function(r) {
38
+ const i = [];
39
+ let o = 0;
40
+ for (let c = 0; c < r.length; c++) {
41
+ let d = r.charCodeAt(c);
42
+ d < 128 ? i[o++] = d : d < 2048 ? (i[o++] = d >> 6 | 192, i[o++] = d & 63 | 128) : (d & 64512) === 55296 && c + 1 < r.length && (r.charCodeAt(c + 1) & 64512) === 56320 ? (d = 65536 + ((d & 1023) << 10) + (r.charCodeAt(++c) & 1023), i[o++] = d >> 18 | 240, i[o++] = d >> 12 & 63 | 128, i[o++] = d >> 6 & 63 | 128, i[o++] = d & 63 | 128) : (i[o++] = d >> 12 | 224, i[o++] = d >> 6 & 63 | 128, i[o++] = d & 63 | 128);
43
+ }
44
+ return i;
45
+ }, os = function(r) {
46
+ const i = [];
47
+ let o = 0, c = 0;
48
+ for (; o < r.length; ) {
49
+ const d = r[o++];
50
+ if (d < 128)
51
+ i[c++] = String.fromCharCode(d);
52
+ else if (d > 191 && d < 224) {
53
+ const T = r[o++];
54
+ i[c++] = String.fromCharCode((d & 31) << 6 | T & 63);
55
+ } else if (d > 239 && d < 365) {
56
+ const T = r[o++], m = r[o++], y = r[o++], v = ((d & 7) << 18 | (T & 63) << 12 | (m & 63) << 6 | y & 63) - 65536;
57
+ i[c++] = String.fromCharCode(55296 + (v >> 10)), i[c++] = String.fromCharCode(56320 + (v & 1023));
58
+ } else {
59
+ const T = r[o++], m = r[o++];
60
+ i[c++] = String.fromCharCode((d & 15) << 12 | (T & 63) << 6 | m & 63);
61
+ }
62
+ }
63
+ return i.join("");
64
+ }, hs = {
65
+ /**
66
+ * Maps bytes to characters.
67
+ */
68
+ byteToCharMap_: null,
69
+ /**
70
+ * Maps characters to bytes.
71
+ */
72
+ charToByteMap_: null,
73
+ /**
74
+ * Maps bytes to websafe characters.
75
+ * @private
76
+ */
77
+ byteToCharMapWebSafe_: null,
78
+ /**
79
+ * Maps websafe characters to bytes.
80
+ * @private
81
+ */
82
+ charToByteMapWebSafe_: null,
83
+ /**
84
+ * Our default alphabet, shared between
85
+ * ENCODED_VALS and ENCODED_VALS_WEBSAFE
86
+ */
87
+ ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
88
+ /**
89
+ * Our default alphabet. Value 64 (=) is special; it means "nothing."
90
+ */
91
+ get ENCODED_VALS() {
92
+ return this.ENCODED_VALS_BASE + "+/=";
93
+ },
94
+ /**
95
+ * Our websafe alphabet.
96
+ */
97
+ get ENCODED_VALS_WEBSAFE() {
98
+ return this.ENCODED_VALS_BASE + "-_.";
99
+ },
100
+ /**
101
+ * Whether this browser supports the atob and btoa functions. This extension
102
+ * started at Mozilla but is now implemented by many browsers. We use the
103
+ * ASSUME_* variables to avoid pulling in the full useragent detection library
104
+ * but still allowing the standard per-browser compilations.
105
+ *
106
+ */
107
+ HAS_NATIVE_SUPPORT: typeof atob == "function",
108
+ /**
109
+ * Base64-encode an array of bytes.
110
+ *
111
+ * @param input An array of bytes (numbers with
112
+ * value in [0, 255]) to encode.
113
+ * @param webSafe Boolean indicating we should use the
114
+ * alternative alphabet.
115
+ * @return The base64 encoded string.
116
+ */
117
+ encodeByteArray(r, i) {
118
+ if (!Array.isArray(r))
119
+ throw Error("encodeByteArray takes an array as a parameter");
120
+ this.init_();
121
+ const o = i ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, c = [];
122
+ for (let d = 0; d < r.length; d += 3) {
123
+ const T = r[d], m = d + 1 < r.length, y = m ? r[d + 1] : 0, v = d + 2 < r.length, A = v ? r[d + 2] : 0, b = T >> 2, V = (T & 3) << 4 | y >> 4;
124
+ let P = (y & 15) << 2 | A >> 6, W = A & 63;
125
+ v || (W = 64, m || (P = 64)), c.push(o[b], o[V], o[P], o[W]);
126
+ }
127
+ return c.join("");
128
+ },
129
+ /**
130
+ * Base64-encode a string.
131
+ *
132
+ * @param input A string to encode.
133
+ * @param webSafe If true, we should use the
134
+ * alternative alphabet.
135
+ * @return The base64 encoded string.
136
+ */
137
+ encodeString(r, i) {
138
+ return this.HAS_NATIVE_SUPPORT && !i ? btoa(r) : this.encodeByteArray(li(r), i);
139
+ },
140
+ /**
141
+ * Base64-decode a string.
142
+ *
143
+ * @param input to decode.
144
+ * @param webSafe True if we should use the
145
+ * alternative alphabet.
146
+ * @return string representing the decoded value.
147
+ */
148
+ decodeString(r, i) {
149
+ return this.HAS_NATIVE_SUPPORT && !i ? atob(r) : os(this.decodeStringToByteArray(r, i));
150
+ },
151
+ /**
152
+ * Base64-decode a string.
153
+ *
154
+ * In base-64 decoding, groups of four characters are converted into three
155
+ * bytes. If the encoder did not apply padding, the input length may not
156
+ * be a multiple of 4.
157
+ *
158
+ * In this case, the last group will have fewer than 4 characters, and
159
+ * padding will be inferred. If the group has one or two characters, it decodes
160
+ * to one byte. If the group has three characters, it decodes to two bytes.
161
+ *
162
+ * @param input Input to decode.
163
+ * @param webSafe True if we should use the web-safe alphabet.
164
+ * @return bytes representing the decoded value.
165
+ */
166
+ decodeStringToByteArray(r, i) {
167
+ this.init_();
168
+ const o = i ? this.charToByteMapWebSafe_ : this.charToByteMap_, c = [];
169
+ for (let d = 0; d < r.length; ) {
170
+ const T = o[r.charAt(d++)], y = d < r.length ? o[r.charAt(d)] : 0;
171
+ ++d;
172
+ const A = d < r.length ? o[r.charAt(d)] : 64;
173
+ ++d;
174
+ const V = d < r.length ? o[r.charAt(d)] : 64;
175
+ if (++d, T == null || y == null || A == null || V == null)
176
+ throw new as();
177
+ const P = T << 2 | y >> 4;
178
+ if (c.push(P), A !== 64) {
179
+ const W = y << 4 & 240 | A >> 2;
180
+ if (c.push(W), V !== 64) {
181
+ const w = A << 6 & 192 | V;
182
+ c.push(w);
183
+ }
184
+ }
185
+ }
186
+ return c;
187
+ },
188
+ /**
189
+ * Lazy static initialization function. Called before
190
+ * accessing any of the static map variables.
191
+ * @private
192
+ */
193
+ init_() {
194
+ if (!this.byteToCharMap_) {
195
+ this.byteToCharMap_ = {}, this.charToByteMap_ = {}, this.byteToCharMapWebSafe_ = {}, this.charToByteMapWebSafe_ = {};
196
+ for (let r = 0; r < this.ENCODED_VALS.length; r++)
197
+ this.byteToCharMap_[r] = this.ENCODED_VALS.charAt(r), this.charToByteMap_[this.byteToCharMap_[r]] = r, this.byteToCharMapWebSafe_[r] = this.ENCODED_VALS_WEBSAFE.charAt(r), this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[r]] = r, r >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(r)] = r, this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(r)] = r);
198
+ }
199
+ }
200
+ };
201
+ class as extends Error {
202
+ constructor() {
203
+ super(...arguments), this.name = "DecodeBase64StringError";
204
+ }
205
+ }
206
+ const ls = function(r) {
207
+ const i = li(r);
208
+ return hs.encodeByteArray(i, !0);
209
+ }, ui = function(r) {
210
+ return ls(r).replace(/\./g, "");
211
+ };
212
+ function us() {
213
+ try {
214
+ return typeof indexedDB == "object";
215
+ } catch {
216
+ return !1;
217
+ }
218
+ }
219
+ function cs() {
220
+ return new Promise((r, i) => {
221
+ try {
222
+ let o = !0;
223
+ const c = "validate-browser-context-for-indexeddb-analytics-module", d = self.indexedDB.open(c);
224
+ d.onsuccess = () => {
225
+ d.result.close(), o || self.indexedDB.deleteDatabase(c), r(!0);
226
+ }, d.onupgradeneeded = () => {
227
+ o = !1;
228
+ }, d.onerror = () => {
229
+ var T;
230
+ i(((T = d.error) === null || T === void 0 ? void 0 : T.message) || "");
231
+ };
232
+ } catch (o) {
233
+ i(o);
234
+ }
235
+ });
236
+ }
237
+ /**
238
+ * @license
239
+ * Copyright 2017 Google LLC
240
+ *
241
+ * Licensed under the Apache License, Version 2.0 (the "License");
242
+ * you may not use this file except in compliance with the License.
243
+ * You may obtain a copy of the License at
244
+ *
245
+ * http://www.apache.org/licenses/LICENSE-2.0
246
+ *
247
+ * Unless required by applicable law or agreed to in writing, software
248
+ * distributed under the License is distributed on an "AS IS" BASIS,
249
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
250
+ * See the License for the specific language governing permissions and
251
+ * limitations under the License.
252
+ */
253
+ const fs = "FirebaseError";
254
+ class yt extends Error {
255
+ constructor(i, o, c) {
256
+ super(o), this.code = i, this.customData = c, this.name = fs, Object.setPrototypeOf(this, yt.prototype), Error.captureStackTrace && Error.captureStackTrace(this, ci.prototype.create);
257
+ }
258
+ }
259
+ class ci {
260
+ constructor(i, o, c) {
261
+ this.service = i, this.serviceName = o, this.errors = c;
262
+ }
263
+ create(i, ...o) {
264
+ const c = o[0] || {}, d = `${this.service}/${i}`, T = this.errors[i], m = T ? ps(T, c) : "Error", y = `${this.serviceName}: ${m} (${d}).`;
265
+ return new yt(d, y, c);
266
+ }
267
+ }
268
+ function ps(r, i) {
269
+ return r.replace(gs, (o, c) => {
270
+ const d = i[c];
271
+ return d != null ? String(d) : `<${c}?>`;
272
+ });
273
+ }
274
+ const gs = /\{\$([^}]+)}/g;
275
+ class ie {
276
+ /**
277
+ *
278
+ * @param name The public service name, e.g. app, auth, firestore, database
279
+ * @param instanceFactory Service factory responsible for creating the public interface
280
+ * @param type whether the service provided by the component is public or private
281
+ */
282
+ constructor(i, o, c) {
283
+ this.name = i, this.instanceFactory = o, this.type = c, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null;
284
+ }
285
+ setInstantiationMode(i) {
286
+ return this.instantiationMode = i, this;
287
+ }
288
+ setMultipleInstances(i) {
289
+ return this.multipleInstances = i, this;
290
+ }
291
+ setServiceProps(i) {
292
+ return this.serviceProps = i, this;
293
+ }
294
+ setInstanceCreatedCallback(i) {
295
+ return this.onInstanceCreated = i, this;
296
+ }
297
+ }
298
+ /**
299
+ * @license
300
+ * Copyright 2017 Google LLC
301
+ *
302
+ * Licensed under the Apache License, Version 2.0 (the "License");
303
+ * you may not use this file except in compliance with the License.
304
+ * You may obtain a copy of the License at
305
+ *
306
+ * http://www.apache.org/licenses/LICENSE-2.0
307
+ *
308
+ * Unless required by applicable law or agreed to in writing, software
309
+ * distributed under the License is distributed on an "AS IS" BASIS,
310
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
311
+ * See the License for the specific language governing permissions and
312
+ * limitations under the License.
313
+ */
314
+ var D;
315
+ (function(r) {
316
+ r[r.DEBUG = 0] = "DEBUG", r[r.VERBOSE = 1] = "VERBOSE", r[r.INFO = 2] = "INFO", r[r.WARN = 3] = "WARN", r[r.ERROR = 4] = "ERROR", r[r.SILENT = 5] = "SILENT";
317
+ })(D || (D = {}));
318
+ const Es = {
319
+ debug: D.DEBUG,
320
+ verbose: D.VERBOSE,
321
+ info: D.INFO,
322
+ warn: D.WARN,
323
+ error: D.ERROR,
324
+ silent: D.SILENT
325
+ }, ds = D.INFO, _s = {
326
+ [D.DEBUG]: "log",
327
+ [D.VERBOSE]: "log",
328
+ [D.INFO]: "info",
329
+ [D.WARN]: "warn",
330
+ [D.ERROR]: "error"
331
+ }, Ts = (r, i, ...o) => {
332
+ if (i < r.logLevel)
333
+ return;
334
+ const c = (/* @__PURE__ */ new Date()).toISOString(), d = _s[i];
335
+ if (d)
336
+ console[d](`[${c}] ${r.name}:`, ...o);
337
+ else
338
+ throw new Error(`Attempted to log a message with an invalid logType (value: ${i})`);
339
+ };
340
+ class fi {
341
+ /**
342
+ * Gives you an instance of a Logger to capture messages according to
343
+ * Firebase's logging scheme.
344
+ *
345
+ * @param name The name that the logs will be associated with
346
+ */
347
+ constructor(i) {
348
+ this.name = i, this._logLevel = ds, this._logHandler = Ts, this._userLogHandler = null;
349
+ }
350
+ get logLevel() {
351
+ return this._logLevel;
352
+ }
353
+ set logLevel(i) {
354
+ if (!(i in D))
355
+ throw new TypeError(`Invalid value "${i}" assigned to \`logLevel\``);
356
+ this._logLevel = i;
357
+ }
358
+ // Workaround for setter/getter having to be the same type.
359
+ setLogLevel(i) {
360
+ this._logLevel = typeof i == "string" ? Es[i] : i;
361
+ }
362
+ get logHandler() {
363
+ return this._logHandler;
364
+ }
365
+ set logHandler(i) {
366
+ if (typeof i != "function")
367
+ throw new TypeError("Value assigned to `logHandler` must be a function");
368
+ this._logHandler = i;
369
+ }
370
+ get userLogHandler() {
371
+ return this._userLogHandler;
372
+ }
373
+ set userLogHandler(i) {
374
+ this._userLogHandler = i;
375
+ }
376
+ /**
377
+ * The functions below are all based on the `console` interface
378
+ */
379
+ debug(...i) {
380
+ this._userLogHandler && this._userLogHandler(this, D.DEBUG, ...i), this._logHandler(this, D.DEBUG, ...i);
381
+ }
382
+ log(...i) {
383
+ this._userLogHandler && this._userLogHandler(this, D.VERBOSE, ...i), this._logHandler(this, D.VERBOSE, ...i);
384
+ }
385
+ info(...i) {
386
+ this._userLogHandler && this._userLogHandler(this, D.INFO, ...i), this._logHandler(this, D.INFO, ...i);
387
+ }
388
+ warn(...i) {
389
+ this._userLogHandler && this._userLogHandler(this, D.WARN, ...i), this._logHandler(this, D.WARN, ...i);
390
+ }
391
+ error(...i) {
392
+ this._userLogHandler && this._userLogHandler(this, D.ERROR, ...i), this._logHandler(this, D.ERROR, ...i);
393
+ }
394
+ }
395
+ const ms = (r, i) => i.some((o) => r instanceof o);
396
+ let Wn, Yn;
397
+ function ys() {
398
+ return Wn || (Wn = [
399
+ IDBDatabase,
400
+ IDBObjectStore,
401
+ IDBIndex,
402
+ IDBCursor,
403
+ IDBTransaction
404
+ ]);
405
+ }
406
+ function Ss() {
407
+ return Yn || (Yn = [
408
+ IDBCursor.prototype.advance,
409
+ IDBCursor.prototype.continue,
410
+ IDBCursor.prototype.continuePrimaryKey
411
+ ]);
412
+ }
413
+ const pi = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap();
414
+ function vs(r) {
415
+ const i = new Promise((o, c) => {
416
+ const d = () => {
417
+ r.removeEventListener("success", T), r.removeEventListener("error", m);
418
+ }, T = () => {
419
+ o(at(r.result)), d();
420
+ }, m = () => {
421
+ c(r.error), d();
422
+ };
423
+ r.addEventListener("success", T), r.addEventListener("error", m);
424
+ });
425
+ return i.then((o) => {
426
+ o instanceof IDBCursor && pi.set(o, r);
427
+ }).catch(() => {
428
+ }), Qe.set(i, r), i;
429
+ }
430
+ function As(r) {
431
+ if (Fe.has(r))
432
+ return;
433
+ const i = new Promise((o, c) => {
434
+ const d = () => {
435
+ r.removeEventListener("complete", T), r.removeEventListener("error", m), r.removeEventListener("abort", m);
436
+ }, T = () => {
437
+ o(), d();
438
+ }, m = () => {
439
+ c(r.error || new DOMException("AbortError", "AbortError")), d();
440
+ };
441
+ r.addEventListener("complete", T), r.addEventListener("error", m), r.addEventListener("abort", m);
442
+ });
443
+ Fe.set(r, i);
444
+ }
445
+ let je = {
446
+ get(r, i, o) {
447
+ if (r instanceof IDBTransaction) {
448
+ if (i === "done")
449
+ return Fe.get(r);
450
+ if (i === "objectStoreNames")
451
+ return r.objectStoreNames || gi.get(r);
452
+ if (i === "store")
453
+ return o.objectStoreNames[1] ? void 0 : o.objectStore(o.objectStoreNames[0]);
454
+ }
455
+ return at(r[i]);
456
+ },
457
+ set(r, i, o) {
458
+ return r[i] = o, !0;
459
+ },
460
+ has(r, i) {
461
+ return r instanceof IDBTransaction && (i === "done" || i === "store") ? !0 : i in r;
462
+ }
463
+ };
464
+ function Rs(r) {
465
+ je = r(je);
466
+ }
467
+ function Is(r) {
468
+ return r === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(i, ...o) {
469
+ const c = r.call(Me(this), i, ...o);
470
+ return gi.set(c, i.sort ? i.sort() : [i]), at(c);
471
+ } : Ss().includes(r) ? function(...i) {
472
+ return r.apply(Me(this), i), at(pi.get(this));
473
+ } : function(...i) {
474
+ return at(r.apply(Me(this), i));
475
+ };
476
+ }
477
+ function ws(r) {
478
+ return typeof r == "function" ? Is(r) : (r instanceof IDBTransaction && As(r), ms(r, ys()) ? new Proxy(r, je) : r);
479
+ }
480
+ function at(r) {
481
+ if (r instanceof IDBRequest)
482
+ return vs(r);
483
+ if (be.has(r))
484
+ return be.get(r);
485
+ const i = ws(r);
486
+ return i !== r && (be.set(r, i), Qe.set(i, r)), i;
487
+ }
488
+ const Me = (r) => Qe.get(r);
489
+ function Cs(r, i, { blocked: o, upgrade: c, blocking: d, terminated: T } = {}) {
490
+ const m = indexedDB.open(r, i), y = at(m);
491
+ return c && m.addEventListener("upgradeneeded", (v) => {
492
+ c(at(m.result), v.oldVersion, v.newVersion, at(m.transaction), v);
493
+ }), o && m.addEventListener("blocked", (v) => o(
494
+ // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
495
+ v.oldVersion,
496
+ v.newVersion,
497
+ v
498
+ )), y.then((v) => {
499
+ T && v.addEventListener("close", () => T()), d && v.addEventListener("versionchange", (A) => d(A.oldVersion, A.newVersion, A));
500
+ }).catch(() => {
501
+ }), y;
502
+ }
503
+ const Ds = ["get", "getKey", "getAll", "getAllKeys", "count"], Os = ["put", "add", "delete", "clear"], Be = /* @__PURE__ */ new Map();
504
+ function Xn(r, i) {
505
+ if (!(r instanceof IDBDatabase && !(i in r) && typeof i == "string"))
506
+ return;
507
+ if (Be.get(i))
508
+ return Be.get(i);
509
+ const o = i.replace(/FromIndex$/, ""), c = i !== o, d = Os.includes(o);
510
+ if (
511
+ // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
512
+ !(o in (c ? IDBIndex : IDBObjectStore).prototype) || !(d || Ds.includes(o))
513
+ )
514
+ return;
515
+ const T = async function(m, ...y) {
516
+ const v = this.transaction(m, d ? "readwrite" : "readonly");
517
+ let A = v.store;
518
+ return c && (A = A.index(y.shift())), (await Promise.all([
519
+ A[o](...y),
520
+ d && v.done
521
+ ]))[0];
522
+ };
523
+ return Be.set(i, T), T;
524
+ }
525
+ Rs((r) => ({
526
+ ...r,
527
+ get: (i, o, c) => Xn(i, o) || r.get(i, o, c),
528
+ has: (i, o) => !!Xn(i, o) || r.has(i, o)
529
+ }));
530
+ /**
531
+ * @license
532
+ * Copyright 2019 Google LLC
533
+ *
534
+ * Licensed under the Apache License, Version 2.0 (the "License");
535
+ * you may not use this file except in compliance with the License.
536
+ * You may obtain a copy of the License at
537
+ *
538
+ * http://www.apache.org/licenses/LICENSE-2.0
539
+ *
540
+ * Unless required by applicable law or agreed to in writing, software
541
+ * distributed under the License is distributed on an "AS IS" BASIS,
542
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
543
+ * See the License for the specific language governing permissions and
544
+ * limitations under the License.
545
+ */
546
+ class Ps {
547
+ constructor(i) {
548
+ this.container = i;
549
+ }
550
+ // In initial implementation, this will be called by installations on
551
+ // auth token refresh, and installations will send this string.
552
+ getPlatformInfoString() {
553
+ return this.container.getProviders().map((o) => {
554
+ if (Ls(o)) {
555
+ const c = o.getImmediate();
556
+ return `${c.library}/${c.version}`;
557
+ } else
558
+ return null;
559
+ }).filter((o) => o).join(" ");
560
+ }
561
+ }
562
+ function Ls(r) {
563
+ const i = r.getComponent();
564
+ return (i == null ? void 0 : i.type) === "VERSION";
565
+ }
566
+ const He = "@firebase/app", zn = "0.10.10";
567
+ /**
568
+ * @license
569
+ * Copyright 2019 Google LLC
570
+ *
571
+ * Licensed under the Apache License, Version 2.0 (the "License");
572
+ * you may not use this file except in compliance with the License.
573
+ * You may obtain a copy of the License at
574
+ *
575
+ * http://www.apache.org/licenses/LICENSE-2.0
576
+ *
577
+ * Unless required by applicable law or agreed to in writing, software
578
+ * distributed under the License is distributed on an "AS IS" BASIS,
579
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
+ * See the License for the specific language governing permissions and
581
+ * limitations under the License.
582
+ */
583
+ const nt = new fi("@firebase/app"), Ns = "@firebase/app-compat", Us = "@firebase/analytics-compat", bs = "@firebase/analytics", Ms = "@firebase/app-check-compat", Bs = "@firebase/app-check", ks = "@firebase/auth", xs = "@firebase/auth-compat", Fs = "@firebase/database", js = "@firebase/database-compat", Hs = "@firebase/functions", Vs = "@firebase/functions-compat", Qs = "@firebase/installations", $s = "@firebase/installations-compat", Gs = "@firebase/messaging", Ks = "@firebase/messaging-compat", Ws = "@firebase/performance", Ys = "@firebase/performance-compat", Xs = "@firebase/remote-config", zs = "@firebase/remote-config-compat", qs = "@firebase/storage", Js = "@firebase/storage-compat", Zs = "@firebase/firestore", tr = "@firebase/vertexai-preview", er = "@firebase/firestore-compat", nr = "firebase", ir = "10.13.1", sr = {
584
+ [He]: "fire-core",
585
+ [Ns]: "fire-core-compat",
586
+ [bs]: "fire-analytics",
587
+ [Us]: "fire-analytics-compat",
588
+ [Bs]: "fire-app-check",
589
+ [Ms]: "fire-app-check-compat",
590
+ [ks]: "fire-auth",
591
+ [xs]: "fire-auth-compat",
592
+ [Fs]: "fire-rtdb",
593
+ [js]: "fire-rtdb-compat",
594
+ [Hs]: "fire-fn",
595
+ [Vs]: "fire-fn-compat",
596
+ [Qs]: "fire-iid",
597
+ [$s]: "fire-iid-compat",
598
+ [Gs]: "fire-fcm",
599
+ [Ks]: "fire-fcm-compat",
600
+ [Ws]: "fire-perf",
601
+ [Ys]: "fire-perf-compat",
602
+ [Xs]: "fire-rc",
603
+ [zs]: "fire-rc-compat",
604
+ [qs]: "fire-gcs",
605
+ [Js]: "fire-gcs-compat",
606
+ [Zs]: "fire-fst",
607
+ [er]: "fire-fst-compat",
608
+ [tr]: "fire-vertex",
609
+ "fire-js": "fire-js",
610
+ [nr]: "fire-js-all"
611
+ };
612
+ /**
613
+ * @license
614
+ * Copyright 2019 Google LLC
615
+ *
616
+ * Licensed under the Apache License, Version 2.0 (the "License");
617
+ * you may not use this file except in compliance with the License.
618
+ * You may obtain a copy of the License at
619
+ *
620
+ * http://www.apache.org/licenses/LICENSE-2.0
621
+ *
622
+ * Unless required by applicable law or agreed to in writing, software
623
+ * distributed under the License is distributed on an "AS IS" BASIS,
624
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
625
+ * See the License for the specific language governing permissions and
626
+ * limitations under the License.
627
+ */
628
+ const rr = /* @__PURE__ */ new Map(), or = /* @__PURE__ */ new Map(), qn = /* @__PURE__ */ new Map();
629
+ function Jn(r, i) {
630
+ try {
631
+ r.container.addComponent(i);
632
+ } catch (o) {
633
+ nt.debug(`Component ${i.name} failed to register with FirebaseApp ${r.name}`, o);
634
+ }
635
+ }
636
+ function se(r) {
637
+ const i = r.name;
638
+ if (qn.has(i))
639
+ return nt.debug(`There were multiple attempts to register component ${i}.`), !1;
640
+ qn.set(i, r);
641
+ for (const o of rr.values())
642
+ Jn(o, r);
643
+ for (const o of or.values())
644
+ Jn(o, r);
645
+ return !0;
646
+ }
647
+ /**
648
+ * @license
649
+ * Copyright 2019 Google LLC
650
+ *
651
+ * Licensed under the Apache License, Version 2.0 (the "License");
652
+ * you may not use this file except in compliance with the License.
653
+ * You may obtain a copy of the License at
654
+ *
655
+ * http://www.apache.org/licenses/LICENSE-2.0
656
+ *
657
+ * Unless required by applicable law or agreed to in writing, software
658
+ * distributed under the License is distributed on an "AS IS" BASIS,
659
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660
+ * See the License for the specific language governing permissions and
661
+ * limitations under the License.
662
+ */
663
+ const hr = {
664
+ "no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
665
+ "bad-app-name": "Illegal App name: '{$appName}'",
666
+ "duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
667
+ "app-deleted": "Firebase App named '{$appName}' already deleted",
668
+ "server-app-deleted": "Firebase Server App has been deleted",
669
+ "no-options": "Need to provide options, when not being deployed to hosting via source.",
670
+ "invalid-app-argument": "firebase.{$appName}() takes either no argument or a Firebase App instance.",
671
+ "invalid-log-argument": "First argument to `onLog` must be null or a function.",
672
+ "idb-open": "Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",
673
+ "idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
674
+ "idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
675
+ "idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
676
+ "finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
677
+ "invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
678
+ }, $e = new ci("app", "Firebase", hr);
679
+ /**
680
+ * @license
681
+ * Copyright 2019 Google LLC
682
+ *
683
+ * Licensed under the Apache License, Version 2.0 (the "License");
684
+ * you may not use this file except in compliance with the License.
685
+ * You may obtain a copy of the License at
686
+ *
687
+ * http://www.apache.org/licenses/LICENSE-2.0
688
+ *
689
+ * Unless required by applicable law or agreed to in writing, software
690
+ * distributed under the License is distributed on an "AS IS" BASIS,
691
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
692
+ * See the License for the specific language governing permissions and
693
+ * limitations under the License.
694
+ */
695
+ const ar = ir;
696
+ function Tt(r, i, o) {
697
+ var c;
698
+ let d = (c = sr[r]) !== null && c !== void 0 ? c : r;
699
+ o && (d += `-${o}`);
700
+ const T = d.match(/\s|\//), m = i.match(/\s|\//);
701
+ if (T || m) {
702
+ const y = [
703
+ `Unable to register library "${d}" with version "${i}":`
704
+ ];
705
+ T && y.push(`library name "${d}" contains illegal characters (whitespace or "/")`), T && m && y.push("and"), m && y.push(`version name "${i}" contains illegal characters (whitespace or "/")`), nt.warn(y.join(" "));
706
+ return;
707
+ }
708
+ se(new ie(
709
+ `${d}-version`,
710
+ () => ({ library: d, version: i }),
711
+ "VERSION"
712
+ /* ComponentType.VERSION */
713
+ ));
714
+ }
715
+ /**
716
+ * @license
717
+ * Copyright 2021 Google LLC
718
+ *
719
+ * Licensed under the Apache License, Version 2.0 (the "License");
720
+ * you may not use this file except in compliance with the License.
721
+ * You may obtain a copy of the License at
722
+ *
723
+ * http://www.apache.org/licenses/LICENSE-2.0
724
+ *
725
+ * Unless required by applicable law or agreed to in writing, software
726
+ * distributed under the License is distributed on an "AS IS" BASIS,
727
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
728
+ * See the License for the specific language governing permissions and
729
+ * limitations under the License.
730
+ */
731
+ const lr = "firebase-heartbeat-database", ur = 1, xt = "firebase-heartbeat-store";
732
+ let ke = null;
733
+ function Ei() {
734
+ return ke || (ke = Cs(lr, ur, {
735
+ upgrade: (r, i) => {
736
+ switch (i) {
737
+ case 0:
738
+ try {
739
+ r.createObjectStore(xt);
740
+ } catch (o) {
741
+ console.warn(o);
742
+ }
743
+ }
744
+ }
745
+ }).catch((r) => {
746
+ throw $e.create("idb-open", {
747
+ originalErrorMessage: r.message
748
+ });
749
+ })), ke;
750
+ }
751
+ async function cr(r) {
752
+ try {
753
+ const o = (await Ei()).transaction(xt), c = await o.objectStore(xt).get(di(r));
754
+ return await o.done, c;
755
+ } catch (i) {
756
+ if (i instanceof yt)
757
+ nt.warn(i.message);
758
+ else {
759
+ const o = $e.create("idb-get", {
760
+ originalErrorMessage: i == null ? void 0 : i.message
761
+ });
762
+ nt.warn(o.message);
763
+ }
764
+ }
765
+ }
766
+ async function Zn(r, i) {
767
+ try {
768
+ const c = (await Ei()).transaction(xt, "readwrite");
769
+ await c.objectStore(xt).put(i, di(r)), await c.done;
770
+ } catch (o) {
771
+ if (o instanceof yt)
772
+ nt.warn(o.message);
773
+ else {
774
+ const c = $e.create("idb-set", {
775
+ originalErrorMessage: o == null ? void 0 : o.message
776
+ });
777
+ nt.warn(c.message);
778
+ }
779
+ }
780
+ }
781
+ function di(r) {
782
+ return `${r.name}!${r.options.appId}`;
783
+ }
784
+ /**
785
+ * @license
786
+ * Copyright 2021 Google LLC
787
+ *
788
+ * Licensed under the Apache License, Version 2.0 (the "License");
789
+ * you may not use this file except in compliance with the License.
790
+ * You may obtain a copy of the License at
791
+ *
792
+ * http://www.apache.org/licenses/LICENSE-2.0
793
+ *
794
+ * Unless required by applicable law or agreed to in writing, software
795
+ * distributed under the License is distributed on an "AS IS" BASIS,
796
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
797
+ * See the License for the specific language governing permissions and
798
+ * limitations under the License.
799
+ */
800
+ const fr = 1024, pr = 30 * 24 * 60 * 60 * 1e3;
801
+ class gr {
802
+ constructor(i) {
803
+ this.container = i, this._heartbeatsCache = null;
804
+ const o = this.container.getProvider("app").getImmediate();
805
+ this._storage = new dr(o), this._heartbeatsCachePromise = this._storage.read().then((c) => (this._heartbeatsCache = c, c));
806
+ }
807
+ /**
808
+ * Called to report a heartbeat. The function will generate
809
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
810
+ * to IndexedDB.
811
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
812
+ * already logged, subsequent calls to this function in the same day will be ignored.
813
+ */
814
+ async triggerHeartbeat() {
815
+ var i, o;
816
+ try {
817
+ const d = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), T = ti();
818
+ return ((i = this._heartbeatsCache) === null || i === void 0 ? void 0 : i.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((o = this._heartbeatsCache) === null || o === void 0 ? void 0 : o.heartbeats) == null) || this._heartbeatsCache.lastSentHeartbeatDate === T || this._heartbeatsCache.heartbeats.some((m) => m.date === T) ? void 0 : (this._heartbeatsCache.heartbeats.push({ date: T, agent: d }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((m) => {
819
+ const y = new Date(m.date).valueOf();
820
+ return Date.now() - y <= pr;
821
+ }), this._storage.overwrite(this._heartbeatsCache));
822
+ } catch (c) {
823
+ nt.warn(c);
824
+ }
825
+ }
826
+ /**
827
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
828
+ * It also clears all heartbeats from memory as well as in IndexedDB.
829
+ *
830
+ * NOTE: Consuming product SDKs should not send the header if this method
831
+ * returns an empty string.
832
+ */
833
+ async getHeartbeatsHeader() {
834
+ var i;
835
+ try {
836
+ if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((i = this._heartbeatsCache) === null || i === void 0 ? void 0 : i.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
837
+ return "";
838
+ const o = ti(), { heartbeatsToSend: c, unsentEntries: d } = Er(this._heartbeatsCache.heartbeats), T = ui(JSON.stringify({ version: 2, heartbeats: c }));
839
+ return this._heartbeatsCache.lastSentHeartbeatDate = o, d.length > 0 ? (this._heartbeatsCache.heartbeats = d, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), T;
840
+ } catch (o) {
841
+ return nt.warn(o), "";
842
+ }
843
+ }
844
+ }
845
+ function ti() {
846
+ return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
847
+ }
848
+ function Er(r, i = fr) {
849
+ const o = [];
850
+ let c = r.slice();
851
+ for (const d of r) {
852
+ const T = o.find((m) => m.agent === d.agent);
853
+ if (T) {
854
+ if (T.dates.push(d.date), ei(o) > i) {
855
+ T.dates.pop();
856
+ break;
857
+ }
858
+ } else if (o.push({
859
+ agent: d.agent,
860
+ dates: [d.date]
861
+ }), ei(o) > i) {
862
+ o.pop();
863
+ break;
864
+ }
865
+ c = c.slice(1);
866
+ }
867
+ return {
868
+ heartbeatsToSend: o,
869
+ unsentEntries: c
870
+ };
871
+ }
872
+ class dr {
873
+ constructor(i) {
874
+ this.app = i, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
875
+ }
876
+ async runIndexedDBEnvironmentCheck() {
877
+ return us() ? cs().then(() => !0).catch(() => !1) : !1;
878
+ }
879
+ /**
880
+ * Read all heartbeats.
881
+ */
882
+ async read() {
883
+ if (await this._canUseIndexedDBPromise) {
884
+ const o = await cr(this.app);
885
+ return o != null && o.heartbeats ? o : { heartbeats: [] };
886
+ } else
887
+ return { heartbeats: [] };
888
+ }
889
+ // overwrite the storage with the provided heartbeats
890
+ async overwrite(i) {
891
+ var o;
892
+ if (await this._canUseIndexedDBPromise) {
893
+ const d = await this.read();
894
+ return Zn(this.app, {
895
+ lastSentHeartbeatDate: (o = i.lastSentHeartbeatDate) !== null && o !== void 0 ? o : d.lastSentHeartbeatDate,
896
+ heartbeats: i.heartbeats
897
+ });
898
+ } else
899
+ return;
900
+ }
901
+ // add heartbeats
902
+ async add(i) {
903
+ var o;
904
+ if (await this._canUseIndexedDBPromise) {
905
+ const d = await this.read();
906
+ return Zn(this.app, {
907
+ lastSentHeartbeatDate: (o = i.lastSentHeartbeatDate) !== null && o !== void 0 ? o : d.lastSentHeartbeatDate,
908
+ heartbeats: [
909
+ ...d.heartbeats,
910
+ ...i.heartbeats
911
+ ]
912
+ });
913
+ } else
914
+ return;
915
+ }
916
+ }
917
+ function ei(r) {
918
+ return ui(
919
+ // heartbeatsCache wrapper properties
920
+ JSON.stringify({ version: 2, heartbeats: r })
921
+ ).length;
922
+ }
923
+ /**
924
+ * @license
925
+ * Copyright 2019 Google LLC
926
+ *
927
+ * Licensed under the Apache License, Version 2.0 (the "License");
928
+ * you may not use this file except in compliance with the License.
929
+ * You may obtain a copy of the License at
930
+ *
931
+ * http://www.apache.org/licenses/LICENSE-2.0
932
+ *
933
+ * Unless required by applicable law or agreed to in writing, software
934
+ * distributed under the License is distributed on an "AS IS" BASIS,
935
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
936
+ * See the License for the specific language governing permissions and
937
+ * limitations under the License.
938
+ */
939
+ function _r(r) {
940
+ se(new ie(
941
+ "platform-logger",
942
+ (i) => new Ps(i),
943
+ "PRIVATE"
944
+ /* ComponentType.PRIVATE */
945
+ )), se(new ie(
946
+ "heartbeat",
947
+ (i) => new gr(i),
948
+ "PRIVATE"
949
+ /* ComponentType.PRIVATE */
950
+ )), Tt(He, zn, r), Tt(He, zn, "esm2017"), Tt("fire-js", "");
951
+ }
952
+ _r("");
953
+ var Tr = "firebase", mr = "10.13.1";
954
+ /**
955
+ * @license
956
+ * Copyright 2020 Google LLC
957
+ *
958
+ * Licensed under the Apache License, Version 2.0 (the "License");
959
+ * you may not use this file except in compliance with the License.
960
+ * You may obtain a copy of the License at
961
+ *
962
+ * http://www.apache.org/licenses/LICENSE-2.0
963
+ *
964
+ * Unless required by applicable law or agreed to in writing, software
965
+ * distributed under the License is distributed on an "AS IS" BASIS,
966
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
967
+ * See the License for the specific language governing permissions and
968
+ * limitations under the License.
969
+ */
970
+ Tt(Tr, mr, "app");
971
+ var ni = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
972
+ /** @license
973
+ Copyright The Closure Library Authors.
974
+ SPDX-License-Identifier: Apache-2.0
975
+ */
976
+ var _i;
977
+ (function() {
978
+ var r;
979
+ /** @license
980
+
981
+ Copyright The Closure Library Authors.
982
+ SPDX-License-Identifier: Apache-2.0
983
+ */
984
+ function i(p, h) {
985
+ function l() {
986
+ }
987
+ l.prototype = h.prototype, p.D = h.prototype, p.prototype = new l(), p.prototype.constructor = p, p.C = function(u, f, E) {
988
+ for (var a = Array(arguments.length - 2), Z = 2; Z < arguments.length; Z++) a[Z - 2] = arguments[Z];
989
+ return h.prototype[f].apply(u, a);
990
+ };
991
+ }
992
+ function o() {
993
+ this.blockSize = -1;
994
+ }
995
+ function c() {
996
+ this.blockSize = -1, this.blockSize = 64, this.g = Array(4), this.B = Array(this.blockSize), this.o = this.h = 0, this.s();
997
+ }
998
+ i(c, o), c.prototype.s = function() {
999
+ this.g[0] = 1732584193, this.g[1] = 4023233417, this.g[2] = 2562383102, this.g[3] = 271733878, this.o = this.h = 0;
1000
+ };
1001
+ function d(p, h, l) {
1002
+ l || (l = 0);
1003
+ var u = Array(16);
1004
+ if (typeof h == "string") for (var f = 0; 16 > f; ++f) u[f] = h.charCodeAt(l++) | h.charCodeAt(l++) << 8 | h.charCodeAt(l++) << 16 | h.charCodeAt(l++) << 24;
1005
+ else for (f = 0; 16 > f; ++f) u[f] = h[l++] | h[l++] << 8 | h[l++] << 16 | h[l++] << 24;
1006
+ h = p.g[0], l = p.g[1], f = p.g[2];
1007
+ var E = p.g[3], a = h + (E ^ l & (f ^ E)) + u[0] + 3614090360 & 4294967295;
1008
+ h = l + (a << 7 & 4294967295 | a >>> 25), a = E + (f ^ h & (l ^ f)) + u[1] + 3905402710 & 4294967295, E = h + (a << 12 & 4294967295 | a >>> 20), a = f + (l ^ E & (h ^ l)) + u[2] + 606105819 & 4294967295, f = E + (a << 17 & 4294967295 | a >>> 15), a = l + (h ^ f & (E ^ h)) + u[3] + 3250441966 & 4294967295, l = f + (a << 22 & 4294967295 | a >>> 10), a = h + (E ^ l & (f ^ E)) + u[4] + 4118548399 & 4294967295, h = l + (a << 7 & 4294967295 | a >>> 25), a = E + (f ^ h & (l ^ f)) + u[5] + 1200080426 & 4294967295, E = h + (a << 12 & 4294967295 | a >>> 20), a = f + (l ^ E & (h ^ l)) + u[6] + 2821735955 & 4294967295, f = E + (a << 17 & 4294967295 | a >>> 15), a = l + (h ^ f & (E ^ h)) + u[7] + 4249261313 & 4294967295, l = f + (a << 22 & 4294967295 | a >>> 10), a = h + (E ^ l & (f ^ E)) + u[8] + 1770035416 & 4294967295, h = l + (a << 7 & 4294967295 | a >>> 25), a = E + (f ^ h & (l ^ f)) + u[9] + 2336552879 & 4294967295, E = h + (a << 12 & 4294967295 | a >>> 20), a = f + (l ^ E & (h ^ l)) + u[10] + 4294925233 & 4294967295, f = E + (a << 17 & 4294967295 | a >>> 15), a = l + (h ^ f & (E ^ h)) + u[11] + 2304563134 & 4294967295, l = f + (a << 22 & 4294967295 | a >>> 10), a = h + (E ^ l & (f ^ E)) + u[12] + 1804603682 & 4294967295, h = l + (a << 7 & 4294967295 | a >>> 25), a = E + (f ^ h & (l ^ f)) + u[13] + 4254626195 & 4294967295, E = h + (a << 12 & 4294967295 | a >>> 20), a = f + (l ^ E & (h ^ l)) + u[14] + 2792965006 & 4294967295, f = E + (a << 17 & 4294967295 | a >>> 15), a = l + (h ^ f & (E ^ h)) + u[15] + 1236535329 & 4294967295, l = f + (a << 22 & 4294967295 | a >>> 10), a = h + (f ^ E & (l ^ f)) + u[1] + 4129170786 & 4294967295, h = l + (a << 5 & 4294967295 | a >>> 27), a = E + (l ^ f & (h ^ l)) + u[6] + 3225465664 & 4294967295, E = h + (a << 9 & 4294967295 | a >>> 23), a = f + (h ^ l & (E ^ h)) + u[11] + 643717713 & 4294967295, f = E + (a << 14 & 4294967295 | a >>> 18), a = l + (E ^ h & (f ^ E)) + u[0] + 3921069994 & 4294967295, l = f + (a << 20 & 4294967295 | a >>> 12), a = h + (f ^ E & (l ^ f)) + u[5] + 3593408605 & 4294967295, h = l + (a << 5 & 4294967295 | a >>> 27), a = E + (l ^ f & (h ^ l)) + u[10] + 38016083 & 4294967295, E = h + (a << 9 & 4294967295 | a >>> 23), a = f + (h ^ l & (E ^ h)) + u[15] + 3634488961 & 4294967295, f = E + (a << 14 & 4294967295 | a >>> 18), a = l + (E ^ h & (f ^ E)) + u[4] + 3889429448 & 4294967295, l = f + (a << 20 & 4294967295 | a >>> 12), a = h + (f ^ E & (l ^ f)) + u[9] + 568446438 & 4294967295, h = l + (a << 5 & 4294967295 | a >>> 27), a = E + (l ^ f & (h ^ l)) + u[14] + 3275163606 & 4294967295, E = h + (a << 9 & 4294967295 | a >>> 23), a = f + (h ^ l & (E ^ h)) + u[3] + 4107603335 & 4294967295, f = E + (a << 14 & 4294967295 | a >>> 18), a = l + (E ^ h & (f ^ E)) + u[8] + 1163531501 & 4294967295, l = f + (a << 20 & 4294967295 | a >>> 12), a = h + (f ^ E & (l ^ f)) + u[13] + 2850285829 & 4294967295, h = l + (a << 5 & 4294967295 | a >>> 27), a = E + (l ^ f & (h ^ l)) + u[2] + 4243563512 & 4294967295, E = h + (a << 9 & 4294967295 | a >>> 23), a = f + (h ^ l & (E ^ h)) + u[7] + 1735328473 & 4294967295, f = E + (a << 14 & 4294967295 | a >>> 18), a = l + (E ^ h & (f ^ E)) + u[12] + 2368359562 & 4294967295, l = f + (a << 20 & 4294967295 | a >>> 12), a = h + (l ^ f ^ E) + u[5] + 4294588738 & 4294967295, h = l + (a << 4 & 4294967295 | a >>> 28), a = E + (h ^ l ^ f) + u[8] + 2272392833 & 4294967295, E = h + (a << 11 & 4294967295 | a >>> 21), a = f + (E ^ h ^ l) + u[11] + 1839030562 & 4294967295, f = E + (a << 16 & 4294967295 | a >>> 16), a = l + (f ^ E ^ h) + u[14] + 4259657740 & 4294967295, l = f + (a << 23 & 4294967295 | a >>> 9), a = h + (l ^ f ^ E) + u[1] + 2763975236 & 4294967295, h = l + (a << 4 & 4294967295 | a >>> 28), a = E + (h ^ l ^ f) + u[4] + 1272893353 & 4294967295, E = h + (a << 11 & 4294967295 | a >>> 21), a = f + (E ^ h ^ l) + u[7] + 4139469664 & 4294967295, f = E + (a << 16 & 4294967295 | a >>> 16), a = l + (f ^ E ^ h) + u[10] + 3200236656 & 4294967295, l = f + (a << 23 & 4294967295 | a >>> 9), a = h + (l ^ f ^ E) + u[13] + 681279174 & 4294967295, h = l + (a << 4 & 4294967295 | a >>> 28), a = E + (h ^ l ^ f) + u[0] + 3936430074 & 4294967295, E = h + (a << 11 & 4294967295 | a >>> 21), a = f + (E ^ h ^ l) + u[3] + 3572445317 & 4294967295, f = E + (a << 16 & 4294967295 | a >>> 16), a = l + (f ^ E ^ h) + u[6] + 76029189 & 4294967295, l = f + (a << 23 & 4294967295 | a >>> 9), a = h + (l ^ f ^ E) + u[9] + 3654602809 & 4294967295, h = l + (a << 4 & 4294967295 | a >>> 28), a = E + (h ^ l ^ f) + u[12] + 3873151461 & 4294967295, E = h + (a << 11 & 4294967295 | a >>> 21), a = f + (E ^ h ^ l) + u[15] + 530742520 & 4294967295, f = E + (a << 16 & 4294967295 | a >>> 16), a = l + (f ^ E ^ h) + u[2] + 3299628645 & 4294967295, l = f + (a << 23 & 4294967295 | a >>> 9), a = h + (f ^ (l | ~E)) + u[0] + 4096336452 & 4294967295, h = l + (a << 6 & 4294967295 | a >>> 26), a = E + (l ^ (h | ~f)) + u[7] + 1126891415 & 4294967295, E = h + (a << 10 & 4294967295 | a >>> 22), a = f + (h ^ (E | ~l)) + u[14] + 2878612391 & 4294967295, f = E + (a << 15 & 4294967295 | a >>> 17), a = l + (E ^ (f | ~h)) + u[5] + 4237533241 & 4294967295, l = f + (a << 21 & 4294967295 | a >>> 11), a = h + (f ^ (l | ~E)) + u[12] + 1700485571 & 4294967295, h = l + (a << 6 & 4294967295 | a >>> 26), a = E + (l ^ (h | ~f)) + u[3] + 2399980690 & 4294967295, E = h + (a << 10 & 4294967295 | a >>> 22), a = f + (h ^ (E | ~l)) + u[10] + 4293915773 & 4294967295, f = E + (a << 15 & 4294967295 | a >>> 17), a = l + (E ^ (f | ~h)) + u[1] + 2240044497 & 4294967295, l = f + (a << 21 & 4294967295 | a >>> 11), a = h + (f ^ (l | ~E)) + u[8] + 1873313359 & 4294967295, h = l + (a << 6 & 4294967295 | a >>> 26), a = E + (l ^ (h | ~f)) + u[15] + 4264355552 & 4294967295, E = h + (a << 10 & 4294967295 | a >>> 22), a = f + (h ^ (E | ~l)) + u[6] + 2734768916 & 4294967295, f = E + (a << 15 & 4294967295 | a >>> 17), a = l + (E ^ (f | ~h)) + u[13] + 1309151649 & 4294967295, l = f + (a << 21 & 4294967295 | a >>> 11), a = h + (f ^ (l | ~E)) + u[4] + 4149444226 & 4294967295, h = l + (a << 6 & 4294967295 | a >>> 26), a = E + (l ^ (h | ~f)) + u[11] + 3174756917 & 4294967295, E = h + (a << 10 & 4294967295 | a >>> 22), a = f + (h ^ (E | ~l)) + u[2] + 718787259 & 4294967295, f = E + (a << 15 & 4294967295 | a >>> 17), a = l + (E ^ (f | ~h)) + u[9] + 3951481745 & 4294967295, p.g[0] = p.g[0] + h & 4294967295, p.g[1] = p.g[1] + (f + (a << 21 & 4294967295 | a >>> 11)) & 4294967295, p.g[2] = p.g[2] + f & 4294967295, p.g[3] = p.g[3] + E & 4294967295;
1009
+ }
1010
+ c.prototype.u = function(p, h) {
1011
+ h === void 0 && (h = p.length);
1012
+ for (var l = h - this.blockSize, u = this.B, f = this.h, E = 0; E < h; ) {
1013
+ if (f == 0) for (; E <= l; ) d(this, p, E), E += this.blockSize;
1014
+ if (typeof p == "string") {
1015
+ for (; E < h; )
1016
+ if (u[f++] = p.charCodeAt(E++), f == this.blockSize) {
1017
+ d(this, u), f = 0;
1018
+ break;
1019
+ }
1020
+ } else for (; E < h; ) if (u[f++] = p[E++], f == this.blockSize) {
1021
+ d(this, u), f = 0;
1022
+ break;
1023
+ }
1024
+ }
1025
+ this.h = f, this.o += h;
1026
+ }, c.prototype.v = function() {
1027
+ var p = Array((56 > this.h ? this.blockSize : 2 * this.blockSize) - this.h);
1028
+ p[0] = 128;
1029
+ for (var h = 1; h < p.length - 8; ++h) p[h] = 0;
1030
+ var l = 8 * this.o;
1031
+ for (h = p.length - 8; h < p.length; ++h) p[h] = l & 255, l /= 256;
1032
+ for (this.u(p), p = Array(16), h = l = 0; 4 > h; ++h) for (var u = 0; 32 > u; u += 8) p[l++] = this.g[h] >>> u & 255;
1033
+ return p;
1034
+ };
1035
+ function T(p, h) {
1036
+ var l = y;
1037
+ return Object.prototype.hasOwnProperty.call(l, p) ? l[p] : l[p] = h(p);
1038
+ }
1039
+ function m(p, h) {
1040
+ this.h = h;
1041
+ for (var l = [], u = !0, f = p.length - 1; 0 <= f; f--) {
1042
+ var E = p[f] | 0;
1043
+ u && E == h || (l[f] = E, u = !1);
1044
+ }
1045
+ this.g = l;
1046
+ }
1047
+ var y = {};
1048
+ function v(p) {
1049
+ return -128 <= p && 128 > p ? T(p, function(h) {
1050
+ return new m([h | 0], 0 > h ? -1 : 0);
1051
+ }) : new m([p | 0], 0 > p ? -1 : 0);
1052
+ }
1053
+ function A(p) {
1054
+ if (isNaN(p) || !isFinite(p)) return V;
1055
+ if (0 > p) return N(A(-p));
1056
+ for (var h = [], l = 1, u = 0; p >= l; u++) h[u] = p / l | 0, l *= 4294967296;
1057
+ return new m(h, 0);
1058
+ }
1059
+ function b(p, h) {
1060
+ if (p.length == 0) throw Error("number format error: empty string");
1061
+ if (h = h || 10, 2 > h || 36 < h) throw Error("radix out of range: " + h);
1062
+ if (p.charAt(0) == "-") return N(b(p.substring(1), h));
1063
+ if (0 <= p.indexOf("-")) throw Error('number format error: interior "-" character');
1064
+ for (var l = A(Math.pow(h, 8)), u = V, f = 0; f < p.length; f += 8) {
1065
+ var E = Math.min(8, p.length - f), a = parseInt(p.substring(f, f + E), h);
1066
+ 8 > E ? (E = A(Math.pow(h, E)), u = u.j(E).add(A(a))) : (u = u.j(l), u = u.add(A(a)));
1067
+ }
1068
+ return u;
1069
+ }
1070
+ var V = v(0), P = v(1), W = v(16777216);
1071
+ r = m.prototype, r.m = function() {
1072
+ if (M(this)) return -N(this).m();
1073
+ for (var p = 0, h = 1, l = 0; l < this.g.length; l++) {
1074
+ var u = this.i(l);
1075
+ p += (0 <= u ? u : 4294967296 + u) * h, h *= 4294967296;
1076
+ }
1077
+ return p;
1078
+ }, r.toString = function(p) {
1079
+ if (p = p || 10, 2 > p || 36 < p) throw Error("radix out of range: " + p);
1080
+ if (w(this)) return "0";
1081
+ if (M(this)) return "-" + N(this).toString(p);
1082
+ for (var h = A(Math.pow(p, 6)), l = this, u = ""; ; ) {
1083
+ var f = it(l, h).g;
1084
+ l = ft(l, f.j(h));
1085
+ var E = ((0 < l.g.length ? l.g[0] : l.h) >>> 0).toString(p);
1086
+ if (l = f, w(l)) return E + u;
1087
+ for (; 6 > E.length; ) E = "0" + E;
1088
+ u = E + u;
1089
+ }
1090
+ }, r.i = function(p) {
1091
+ return 0 > p ? 0 : p < this.g.length ? this.g[p] : this.h;
1092
+ };
1093
+ function w(p) {
1094
+ if (p.h != 0) return !1;
1095
+ for (var h = 0; h < p.g.length; h++) if (p.g[h] != 0) return !1;
1096
+ return !0;
1097
+ }
1098
+ function M(p) {
1099
+ return p.h == -1;
1100
+ }
1101
+ r.l = function(p) {
1102
+ return p = ft(this, p), M(p) ? -1 : w(p) ? 0 : 1;
1103
+ };
1104
+ function N(p) {
1105
+ for (var h = p.g.length, l = [], u = 0; u < h; u++) l[u] = ~p.g[u];
1106
+ return new m(l, ~p.h).add(P);
1107
+ }
1108
+ r.abs = function() {
1109
+ return M(this) ? N(this) : this;
1110
+ }, r.add = function(p) {
1111
+ for (var h = Math.max(this.g.length, p.g.length), l = [], u = 0, f = 0; f <= h; f++) {
1112
+ var E = u + (this.i(f) & 65535) + (p.i(f) & 65535), a = (E >>> 16) + (this.i(f) >>> 16) + (p.i(f) >>> 16);
1113
+ u = a >>> 16, E &= 65535, a &= 65535, l[f] = a << 16 | E;
1114
+ }
1115
+ return new m(l, l[l.length - 1] & -2147483648 ? -1 : 0);
1116
+ };
1117
+ function ft(p, h) {
1118
+ return p.add(N(h));
1119
+ }
1120
+ r.j = function(p) {
1121
+ if (w(this) || w(p)) return V;
1122
+ if (M(this)) return M(p) ? N(this).j(N(p)) : N(N(this).j(p));
1123
+ if (M(p)) return N(this.j(N(p)));
1124
+ if (0 > this.l(W) && 0 > p.l(W)) return A(this.m() * p.m());
1125
+ for (var h = this.g.length + p.g.length, l = [], u = 0; u < 2 * h; u++) l[u] = 0;
1126
+ for (u = 0; u < this.g.length; u++) for (var f = 0; f < p.g.length; f++) {
1127
+ var E = this.i(u) >>> 16, a = this.i(u) & 65535, Z = p.i(f) >>> 16, St = p.i(f) & 65535;
1128
+ l[2 * u + 2 * f] += a * St, q(l, 2 * u + 2 * f), l[2 * u + 2 * f + 1] += E * St, q(l, 2 * u + 2 * f + 1), l[2 * u + 2 * f + 1] += a * Z, q(l, 2 * u + 2 * f + 1), l[2 * u + 2 * f + 2] += E * Z, q(l, 2 * u + 2 * f + 2);
1129
+ }
1130
+ for (u = 0; u < h; u++) l[u] = l[2 * u + 1] << 16 | l[2 * u];
1131
+ for (u = h; u < 2 * h; u++) l[u] = 0;
1132
+ return new m(l, 0);
1133
+ };
1134
+ function q(p, h) {
1135
+ for (; (p[h] & 65535) != p[h]; ) p[h + 1] += p[h] >>> 16, p[h] &= 65535, h++;
1136
+ }
1137
+ function Y(p, h) {
1138
+ this.g = p, this.h = h;
1139
+ }
1140
+ function it(p, h) {
1141
+ if (w(h)) throw Error("division by zero");
1142
+ if (w(p)) return new Y(V, V);
1143
+ if (M(p)) return h = it(N(p), h), new Y(N(h.g), N(h.h));
1144
+ if (M(h)) return h = it(p, N(h)), new Y(N(h.g), h.h);
1145
+ if (30 < p.g.length) {
1146
+ if (M(p) || M(h)) throw Error("slowDivide_ only works with positive integers.");
1147
+ for (var l = P, u = h; 0 >= u.l(p); ) l = Ft(l), u = Ft(u);
1148
+ var f = J(l, 1), E = J(u, 1);
1149
+ for (u = J(u, 2), l = J(l, 2); !w(u); ) {
1150
+ var a = E.add(u);
1151
+ 0 >= a.l(p) && (f = f.add(l), E = a), u = J(u, 1), l = J(l, 1);
1152
+ }
1153
+ return h = ft(p, f.j(h)), new Y(f, h);
1154
+ }
1155
+ for (f = V; 0 <= p.l(h); ) {
1156
+ for (l = Math.max(1, Math.floor(p.m() / h.m())), u = Math.ceil(Math.log(l) / Math.LN2), u = 48 >= u ? 1 : Math.pow(2, u - 48), E = A(l), a = E.j(h); M(a) || 0 < a.l(p); ) l -= u, E = A(l), a = E.j(h);
1157
+ w(E) && (E = P), f = f.add(E), p = ft(p, a);
1158
+ }
1159
+ return new Y(f, p);
1160
+ }
1161
+ r.A = function(p) {
1162
+ return it(this, p).h;
1163
+ }, r.and = function(p) {
1164
+ for (var h = Math.max(this.g.length, p.g.length), l = [], u = 0; u < h; u++) l[u] = this.i(u) & p.i(u);
1165
+ return new m(l, this.h & p.h);
1166
+ }, r.or = function(p) {
1167
+ for (var h = Math.max(this.g.length, p.g.length), l = [], u = 0; u < h; u++) l[u] = this.i(u) | p.i(u);
1168
+ return new m(l, this.h | p.h);
1169
+ }, r.xor = function(p) {
1170
+ for (var h = Math.max(this.g.length, p.g.length), l = [], u = 0; u < h; u++) l[u] = this.i(u) ^ p.i(u);
1171
+ return new m(l, this.h ^ p.h);
1172
+ };
1173
+ function Ft(p) {
1174
+ for (var h = p.g.length + 1, l = [], u = 0; u < h; u++) l[u] = p.i(u) << 1 | p.i(u - 1) >>> 31;
1175
+ return new m(l, p.h);
1176
+ }
1177
+ function J(p, h) {
1178
+ var l = h >> 5;
1179
+ h %= 32;
1180
+ for (var u = p.g.length - l, f = [], E = 0; E < u; E++) f[E] = 0 < h ? p.i(E + l) >>> h | p.i(E + l + 1) << 32 - h : p.i(E + l);
1181
+ return new m(f, p.h);
1182
+ }
1183
+ c.prototype.digest = c.prototype.v, c.prototype.reset = c.prototype.s, c.prototype.update = c.prototype.u, m.prototype.add = m.prototype.add, m.prototype.multiply = m.prototype.j, m.prototype.modulo = m.prototype.A, m.prototype.compare = m.prototype.l, m.prototype.toNumber = m.prototype.m, m.prototype.toString = m.prototype.toString, m.prototype.getBits = m.prototype.i, m.fromNumber = A, m.fromString = b, _i = m;
1184
+ }).apply(typeof ni < "u" ? ni : typeof self < "u" ? self : typeof window < "u" ? window : {});
1185
+ var ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1186
+ (function() {
1187
+ var r, i = typeof Object.defineProperties == "function" ? Object.defineProperty : function(t, e, n) {
1188
+ return t == Array.prototype || t == Object.prototype || (t[e] = n.value), t;
1189
+ };
1190
+ function o(t) {
1191
+ t = [typeof globalThis == "object" && globalThis, t, typeof window == "object" && window, typeof self == "object" && self, typeof ne == "object" && ne];
1192
+ for (var e = 0; e < t.length; ++e) {
1193
+ var n = t[e];
1194
+ if (n && n.Math == Math) return n;
1195
+ }
1196
+ throw Error("Cannot find global object");
1197
+ }
1198
+ var c = o(this);
1199
+ function d(t, e) {
1200
+ if (e) t: {
1201
+ var n = c;
1202
+ t = t.split(".");
1203
+ for (var s = 0; s < t.length - 1; s++) {
1204
+ var g = t[s];
1205
+ if (!(g in n)) break t;
1206
+ n = n[g];
1207
+ }
1208
+ t = t[t.length - 1], s = n[t], e = e(s), e != s && e != null && i(n, t, { configurable: !0, writable: !0, value: e });
1209
+ }
1210
+ }
1211
+ function T(t, e) {
1212
+ t instanceof String && (t += "");
1213
+ var n = 0, s = !1, g = { next: function() {
1214
+ if (!s && n < t.length) {
1215
+ var _ = n++;
1216
+ return { value: e(_, t[_]), done: !1 };
1217
+ }
1218
+ return s = !0, { done: !0, value: void 0 };
1219
+ } };
1220
+ return g[Symbol.iterator] = function() {
1221
+ return g;
1222
+ }, g;
1223
+ }
1224
+ d("Array.prototype.values", function(t) {
1225
+ return t || function() {
1226
+ return T(this, function(e, n) {
1227
+ return n;
1228
+ });
1229
+ };
1230
+ });
1231
+ /** @license
1232
+
1233
+ Copyright The Closure Library Authors.
1234
+ SPDX-License-Identifier: Apache-2.0
1235
+ */
1236
+ var m = m || {}, y = this || self;
1237
+ function v(t) {
1238
+ var e = typeof t;
1239
+ return e = e != "object" ? e : t ? Array.isArray(t) ? "array" : e : "null", e == "array" || e == "object" && typeof t.length == "number";
1240
+ }
1241
+ function A(t) {
1242
+ var e = typeof t;
1243
+ return e == "object" && t != null || e == "function";
1244
+ }
1245
+ function b(t, e, n) {
1246
+ return t.call.apply(t.bind, arguments);
1247
+ }
1248
+ function V(t, e, n) {
1249
+ if (!t) throw Error();
1250
+ if (2 < arguments.length) {
1251
+ var s = Array.prototype.slice.call(arguments, 2);
1252
+ return function() {
1253
+ var g = Array.prototype.slice.call(arguments);
1254
+ return Array.prototype.unshift.apply(g, s), t.apply(e, g);
1255
+ };
1256
+ }
1257
+ return function() {
1258
+ return t.apply(e, arguments);
1259
+ };
1260
+ }
1261
+ function P(t, e, n) {
1262
+ return P = Function.prototype.bind && Function.prototype.bind.toString().indexOf("native code") != -1 ? b : V, P.apply(null, arguments);
1263
+ }
1264
+ function W(t, e) {
1265
+ var n = Array.prototype.slice.call(arguments, 1);
1266
+ return function() {
1267
+ var s = n.slice();
1268
+ return s.push.apply(s, arguments), t.apply(this, s);
1269
+ };
1270
+ }
1271
+ function w(t, e) {
1272
+ function n() {
1273
+ }
1274
+ n.prototype = e.prototype, t.aa = e.prototype, t.prototype = new n(), t.prototype.constructor = t, t.Qb = function(s, g, _) {
1275
+ for (var S = Array(arguments.length - 2), C = 2; C < arguments.length; C++) S[C - 2] = arguments[C];
1276
+ return e.prototype[g].apply(s, S);
1277
+ };
1278
+ }
1279
+ function M(t) {
1280
+ const e = t.length;
1281
+ if (0 < e) {
1282
+ const n = Array(e);
1283
+ for (let s = 0; s < e; s++) n[s] = t[s];
1284
+ return n;
1285
+ }
1286
+ return [];
1287
+ }
1288
+ function N(t, e) {
1289
+ for (let n = 1; n < arguments.length; n++) {
1290
+ const s = arguments[n];
1291
+ if (v(s)) {
1292
+ const g = t.length || 0, _ = s.length || 0;
1293
+ t.length = g + _;
1294
+ for (let S = 0; S < _; S++) t[g + S] = s[S];
1295
+ } else t.push(s);
1296
+ }
1297
+ }
1298
+ class ft {
1299
+ constructor(e, n) {
1300
+ this.i = e, this.j = n, this.h = 0, this.g = null;
1301
+ }
1302
+ get() {
1303
+ let e;
1304
+ return 0 < this.h ? (this.h--, e = this.g, this.g = e.next, e.next = null) : e = this.i(), e;
1305
+ }
1306
+ }
1307
+ function q(t) {
1308
+ return /^[\s\xa0]*$/.test(t);
1309
+ }
1310
+ function Y() {
1311
+ var t = y.navigator;
1312
+ return t && (t = t.userAgent) ? t : "";
1313
+ }
1314
+ function it(t) {
1315
+ return it[" "](t), t;
1316
+ }
1317
+ it[" "] = function() {
1318
+ };
1319
+ var Ft = Y().indexOf("Gecko") != -1 && !(Y().toLowerCase().indexOf("webkit") != -1 && Y().indexOf("Edge") == -1) && !(Y().indexOf("Trident") != -1 || Y().indexOf("MSIE") != -1) && Y().indexOf("Edge") == -1;
1320
+ function J(t, e, n) {
1321
+ for (const s in t) e.call(n, t[s], s, t);
1322
+ }
1323
+ function p(t, e) {
1324
+ for (const n in t) e.call(void 0, t[n], n, t);
1325
+ }
1326
+ function h(t) {
1327
+ const e = {};
1328
+ for (const n in t) e[n] = t[n];
1329
+ return e;
1330
+ }
1331
+ const l = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
1332
+ function u(t, e) {
1333
+ let n, s;
1334
+ for (let g = 1; g < arguments.length; g++) {
1335
+ s = arguments[g];
1336
+ for (n in s) t[n] = s[n];
1337
+ for (let _ = 0; _ < l.length; _++) n = l[_], Object.prototype.hasOwnProperty.call(s, n) && (t[n] = s[n]);
1338
+ }
1339
+ }
1340
+ function f(t) {
1341
+ var e = 1;
1342
+ t = t.split(":");
1343
+ const n = [];
1344
+ for (; 0 < e && t.length; ) n.push(t.shift()), e--;
1345
+ return t.length && n.push(t.join(":")), n;
1346
+ }
1347
+ function E(t) {
1348
+ y.setTimeout(() => {
1349
+ throw t;
1350
+ }, 0);
1351
+ }
1352
+ function a() {
1353
+ var t = ae;
1354
+ let e = null;
1355
+ return t.g && (e = t.g, t.g = t.g.next, t.g || (t.h = null), e.next = null), e;
1356
+ }
1357
+ class Z {
1358
+ constructor() {
1359
+ this.h = this.g = null;
1360
+ }
1361
+ add(e, n) {
1362
+ const s = St.get();
1363
+ s.set(e, n), this.h ? this.h.next = s : this.g = s, this.h = s;
1364
+ }
1365
+ }
1366
+ var St = new ft(() => new vi(), (t) => t.reset());
1367
+ class vi {
1368
+ constructor() {
1369
+ this.next = this.g = this.h = null;
1370
+ }
1371
+ set(e, n) {
1372
+ this.h = e, this.g = n, this.next = null;
1373
+ }
1374
+ reset() {
1375
+ this.next = this.g = this.h = null;
1376
+ }
1377
+ }
1378
+ let vt, At = !1, ae = new Z(), We = () => {
1379
+ const t = y.Promise.resolve(void 0);
1380
+ vt = () => {
1381
+ t.then(Ai);
1382
+ };
1383
+ };
1384
+ var Ai = () => {
1385
+ for (var t; t = a(); ) {
1386
+ try {
1387
+ t.h.call(t.g);
1388
+ } catch (n) {
1389
+ E(n);
1390
+ }
1391
+ var e = St;
1392
+ e.j(t), 100 > e.h && (e.h++, t.next = e.g, e.g = t);
1393
+ }
1394
+ At = !1;
1395
+ };
1396
+ function st() {
1397
+ this.s = this.s, this.C = this.C;
1398
+ }
1399
+ st.prototype.s = !1, st.prototype.ma = function() {
1400
+ this.s || (this.s = !0, this.N());
1401
+ }, st.prototype.N = function() {
1402
+ if (this.C) for (; this.C.length; ) this.C.shift()();
1403
+ };
1404
+ function B(t, e) {
1405
+ this.type = t, this.g = this.target = e, this.defaultPrevented = !1;
1406
+ }
1407
+ B.prototype.h = function() {
1408
+ this.defaultPrevented = !0;
1409
+ };
1410
+ var Ri = function() {
1411
+ if (!y.addEventListener || !Object.defineProperty) return !1;
1412
+ var t = !1, e = Object.defineProperty({}, "passive", { get: function() {
1413
+ t = !0;
1414
+ } });
1415
+ try {
1416
+ const n = () => {
1417
+ };
1418
+ y.addEventListener("test", n, e), y.removeEventListener("test", n, e);
1419
+ } catch {
1420
+ }
1421
+ return t;
1422
+ }();
1423
+ function Rt(t, e) {
1424
+ if (B.call(this, t ? t.type : ""), this.relatedTarget = this.g = this.target = null, this.button = this.screenY = this.screenX = this.clientY = this.clientX = 0, this.key = "", this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1, this.state = null, this.pointerId = 0, this.pointerType = "", this.i = null, t) {
1425
+ var n = this.type = t.type, s = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : null;
1426
+ if (this.target = t.target || t.srcElement, this.g = e, e = t.relatedTarget) {
1427
+ if (Ft) {
1428
+ t: {
1429
+ try {
1430
+ it(e.nodeName);
1431
+ var g = !0;
1432
+ break t;
1433
+ } catch {
1434
+ }
1435
+ g = !1;
1436
+ }
1437
+ g || (e = null);
1438
+ }
1439
+ } else n == "mouseover" ? e = t.fromElement : n == "mouseout" && (e = t.toElement);
1440
+ this.relatedTarget = e, s ? (this.clientX = s.clientX !== void 0 ? s.clientX : s.pageX, this.clientY = s.clientY !== void 0 ? s.clientY : s.pageY, this.screenX = s.screenX || 0, this.screenY = s.screenY || 0) : (this.clientX = t.clientX !== void 0 ? t.clientX : t.pageX, this.clientY = t.clientY !== void 0 ? t.clientY : t.pageY, this.screenX = t.screenX || 0, this.screenY = t.screenY || 0), this.button = t.button, this.key = t.key || "", this.ctrlKey = t.ctrlKey, this.altKey = t.altKey, this.shiftKey = t.shiftKey, this.metaKey = t.metaKey, this.pointerId = t.pointerId || 0, this.pointerType = typeof t.pointerType == "string" ? t.pointerType : Ii[t.pointerType] || "", this.state = t.state, this.i = t, t.defaultPrevented && Rt.aa.h.call(this);
1441
+ }
1442
+ }
1443
+ w(Rt, B);
1444
+ var Ii = { 2: "touch", 3: "pen", 4: "mouse" };
1445
+ Rt.prototype.h = function() {
1446
+ Rt.aa.h.call(this);
1447
+ var t = this.i;
1448
+ t.preventDefault ? t.preventDefault() : t.returnValue = !1;
1449
+ };
1450
+ var jt = "closure_listenable_" + (1e6 * Math.random() | 0), wi = 0;
1451
+ function Ci(t, e, n, s, g) {
1452
+ this.listener = t, this.proxy = null, this.src = e, this.type = n, this.capture = !!s, this.ha = g, this.key = ++wi, this.da = this.fa = !1;
1453
+ }
1454
+ function Ht(t) {
1455
+ t.da = !0, t.listener = null, t.proxy = null, t.src = null, t.ha = null;
1456
+ }
1457
+ function Vt(t) {
1458
+ this.src = t, this.g = {}, this.h = 0;
1459
+ }
1460
+ Vt.prototype.add = function(t, e, n, s, g) {
1461
+ var _ = t.toString();
1462
+ t = this.g[_], t || (t = this.g[_] = [], this.h++);
1463
+ var S = ue(t, e, s, g);
1464
+ return -1 < S ? (e = t[S], n || (e.fa = !1)) : (e = new Ci(e, this.src, _, !!s, g), e.fa = n, t.push(e)), e;
1465
+ };
1466
+ function le(t, e) {
1467
+ var n = e.type;
1468
+ if (n in t.g) {
1469
+ var s = t.g[n], g = Array.prototype.indexOf.call(s, e, void 0), _;
1470
+ (_ = 0 <= g) && Array.prototype.splice.call(s, g, 1), _ && (Ht(e), t.g[n].length == 0 && (delete t.g[n], t.h--));
1471
+ }
1472
+ }
1473
+ function ue(t, e, n, s) {
1474
+ for (var g = 0; g < t.length; ++g) {
1475
+ var _ = t[g];
1476
+ if (!_.da && _.listener == e && _.capture == !!n && _.ha == s) return g;
1477
+ }
1478
+ return -1;
1479
+ }
1480
+ var ce = "closure_lm_" + (1e6 * Math.random() | 0), fe = {};
1481
+ function Ye(t, e, n, s, g) {
1482
+ if (Array.isArray(e)) {
1483
+ for (var _ = 0; _ < e.length; _++) Ye(t, e[_], n, s, g);
1484
+ return null;
1485
+ }
1486
+ return n = qe(n), t && t[jt] ? t.K(e, n, A(s) ? !!s.capture : !!s, g) : Di(t, e, n, !1, s, g);
1487
+ }
1488
+ function Di(t, e, n, s, g, _) {
1489
+ if (!e) throw Error("Invalid event type");
1490
+ var S = A(g) ? !!g.capture : !!g, C = ge(t);
1491
+ if (C || (t[ce] = C = new Vt(t)), n = C.add(e, n, s, S, _), n.proxy) return n;
1492
+ if (s = Oi(), n.proxy = s, s.src = t, s.listener = n, t.addEventListener) Ri || (g = S), g === void 0 && (g = !1), t.addEventListener(e.toString(), s, g);
1493
+ else if (t.attachEvent) t.attachEvent(ze(e.toString()), s);
1494
+ else if (t.addListener && t.removeListener) t.addListener(s);
1495
+ else throw Error("addEventListener and attachEvent are unavailable.");
1496
+ return n;
1497
+ }
1498
+ function Oi() {
1499
+ function t(n) {
1500
+ return e.call(t.src, t.listener, n);
1501
+ }
1502
+ const e = Pi;
1503
+ return t;
1504
+ }
1505
+ function Xe(t, e, n, s, g) {
1506
+ if (Array.isArray(e)) for (var _ = 0; _ < e.length; _++) Xe(t, e[_], n, s, g);
1507
+ else s = A(s) ? !!s.capture : !!s, n = qe(n), t && t[jt] ? (t = t.i, e = String(e).toString(), e in t.g && (_ = t.g[e], n = ue(_, n, s, g), -1 < n && (Ht(_[n]), Array.prototype.splice.call(_, n, 1), _.length == 0 && (delete t.g[e], t.h--)))) : t && (t = ge(t)) && (e = t.g[e.toString()], t = -1, e && (t = ue(e, n, s, g)), (n = -1 < t ? e[t] : null) && pe(n));
1508
+ }
1509
+ function pe(t) {
1510
+ if (typeof t != "number" && t && !t.da) {
1511
+ var e = t.src;
1512
+ if (e && e[jt]) le(e.i, t);
1513
+ else {
1514
+ var n = t.type, s = t.proxy;
1515
+ e.removeEventListener ? e.removeEventListener(n, s, t.capture) : e.detachEvent ? e.detachEvent(ze(n), s) : e.addListener && e.removeListener && e.removeListener(s), (n = ge(e)) ? (le(n, t), n.h == 0 && (n.src = null, e[ce] = null)) : Ht(t);
1516
+ }
1517
+ }
1518
+ }
1519
+ function ze(t) {
1520
+ return t in fe ? fe[t] : fe[t] = "on" + t;
1521
+ }
1522
+ function Pi(t, e) {
1523
+ if (t.da) t = !0;
1524
+ else {
1525
+ e = new Rt(e, this);
1526
+ var n = t.listener, s = t.ha || t.src;
1527
+ t.fa && pe(t), t = n.call(s, e);
1528
+ }
1529
+ return t;
1530
+ }
1531
+ function ge(t) {
1532
+ return t = t[ce], t instanceof Vt ? t : null;
1533
+ }
1534
+ var Ee = "__closure_events_fn_" + (1e9 * Math.random() >>> 0);
1535
+ function qe(t) {
1536
+ return typeof t == "function" ? t : (t[Ee] || (t[Ee] = function(e) {
1537
+ return t.handleEvent(e);
1538
+ }), t[Ee]);
1539
+ }
1540
+ function k() {
1541
+ st.call(this), this.i = new Vt(this), this.M = this, this.F = null;
1542
+ }
1543
+ w(k, st), k.prototype[jt] = !0, k.prototype.removeEventListener = function(t, e, n, s) {
1544
+ Xe(this, t, e, n, s);
1545
+ };
1546
+ function j(t, e) {
1547
+ var n, s = t.F;
1548
+ if (s) for (n = []; s; s = s.F) n.push(s);
1549
+ if (t = t.M, s = e.type || e, typeof e == "string") e = new B(e, t);
1550
+ else if (e instanceof B) e.target = e.target || t;
1551
+ else {
1552
+ var g = e;
1553
+ e = new B(s, t), u(e, g);
1554
+ }
1555
+ if (g = !0, n) for (var _ = n.length - 1; 0 <= _; _--) {
1556
+ var S = e.g = n[_];
1557
+ g = Qt(S, s, !0, e) && g;
1558
+ }
1559
+ if (S = e.g = t, g = Qt(S, s, !0, e) && g, g = Qt(S, s, !1, e) && g, n) for (_ = 0; _ < n.length; _++) S = e.g = n[_], g = Qt(S, s, !1, e) && g;
1560
+ }
1561
+ k.prototype.N = function() {
1562
+ if (k.aa.N.call(this), this.i) {
1563
+ var t = this.i, e;
1564
+ for (e in t.g) {
1565
+ for (var n = t.g[e], s = 0; s < n.length; s++) Ht(n[s]);
1566
+ delete t.g[e], t.h--;
1567
+ }
1568
+ }
1569
+ this.F = null;
1570
+ }, k.prototype.K = function(t, e, n, s) {
1571
+ return this.i.add(String(t), e, !1, n, s);
1572
+ }, k.prototype.L = function(t, e, n, s) {
1573
+ return this.i.add(String(t), e, !0, n, s);
1574
+ };
1575
+ function Qt(t, e, n, s) {
1576
+ if (e = t.i.g[String(e)], !e) return !0;
1577
+ e = e.concat();
1578
+ for (var g = !0, _ = 0; _ < e.length; ++_) {
1579
+ var S = e[_];
1580
+ if (S && !S.da && S.capture == n) {
1581
+ var C = S.listener, U = S.ha || S.src;
1582
+ S.fa && le(t.i, S), g = C.call(U, s) !== !1 && g;
1583
+ }
1584
+ }
1585
+ return g && !s.defaultPrevented;
1586
+ }
1587
+ function Je(t, e, n) {
1588
+ if (typeof t == "function") n && (t = P(t, n));
1589
+ else if (t && typeof t.handleEvent == "function") t = P(t.handleEvent, t);
1590
+ else throw Error("Invalid listener argument");
1591
+ return 2147483647 < Number(e) ? -1 : y.setTimeout(t, e || 0);
1592
+ }
1593
+ function Ze(t) {
1594
+ t.g = Je(() => {
1595
+ t.g = null, t.i && (t.i = !1, Ze(t));
1596
+ }, t.l);
1597
+ const e = t.h;
1598
+ t.h = null, t.m.apply(null, e);
1599
+ }
1600
+ class Li extends st {
1601
+ constructor(e, n) {
1602
+ super(), this.m = e, this.l = n, this.h = null, this.i = !1, this.g = null;
1603
+ }
1604
+ j(e) {
1605
+ this.h = arguments, this.g ? this.i = !0 : Ze(this);
1606
+ }
1607
+ N() {
1608
+ super.N(), this.g && (y.clearTimeout(this.g), this.g = null, this.i = !1, this.h = null);
1609
+ }
1610
+ }
1611
+ function It(t) {
1612
+ st.call(this), this.h = t, this.g = {};
1613
+ }
1614
+ w(It, st);
1615
+ var tn = [];
1616
+ function en(t) {
1617
+ J(t.g, function(e, n) {
1618
+ this.g.hasOwnProperty(n) && pe(e);
1619
+ }, t), t.g = {};
1620
+ }
1621
+ It.prototype.N = function() {
1622
+ It.aa.N.call(this), en(this);
1623
+ }, It.prototype.handleEvent = function() {
1624
+ throw Error("EventHandler.handleEvent not implemented");
1625
+ };
1626
+ var de = y.JSON.stringify, Ni = y.JSON.parse, Ui = class {
1627
+ stringify(t) {
1628
+ return y.JSON.stringify(t, void 0);
1629
+ }
1630
+ parse(t) {
1631
+ return y.JSON.parse(t, void 0);
1632
+ }
1633
+ };
1634
+ function _e() {
1635
+ }
1636
+ _e.prototype.h = null;
1637
+ function nn(t) {
1638
+ return t.h || (t.h = t.i());
1639
+ }
1640
+ function bi() {
1641
+ }
1642
+ var wt = { OPEN: "a", kb: "b", Ja: "c", wb: "d" };
1643
+ function Te() {
1644
+ B.call(this, "d");
1645
+ }
1646
+ w(Te, B);
1647
+ function me() {
1648
+ B.call(this, "c");
1649
+ }
1650
+ w(me, B);
1651
+ var pt = {}, sn = null;
1652
+ function ye() {
1653
+ return sn = sn || new k();
1654
+ }
1655
+ pt.La = "serverreachability";
1656
+ function rn(t) {
1657
+ B.call(this, pt.La, t);
1658
+ }
1659
+ w(rn, B);
1660
+ function Ct(t) {
1661
+ const e = ye();
1662
+ j(e, new rn(e));
1663
+ }
1664
+ pt.STAT_EVENT = "statevent";
1665
+ function on(t, e) {
1666
+ B.call(this, pt.STAT_EVENT, t), this.stat = e;
1667
+ }
1668
+ w(on, B);
1669
+ function H(t) {
1670
+ const e = ye();
1671
+ j(e, new on(e, t));
1672
+ }
1673
+ pt.Ma = "timingevent";
1674
+ function hn(t, e) {
1675
+ B.call(this, pt.Ma, t), this.size = e;
1676
+ }
1677
+ w(hn, B);
1678
+ function Dt(t, e) {
1679
+ if (typeof t != "function") throw Error("Fn must not be null and must be a function");
1680
+ return y.setTimeout(function() {
1681
+ t();
1682
+ }, e);
1683
+ }
1684
+ function Ot() {
1685
+ this.g = !0;
1686
+ }
1687
+ Ot.prototype.xa = function() {
1688
+ this.g = !1;
1689
+ };
1690
+ function Mi(t, e, n, s, g, _) {
1691
+ t.info(function() {
1692
+ if (t.g) if (_)
1693
+ for (var S = "", C = _.split("&"), U = 0; U < C.length; U++) {
1694
+ var I = C[U].split("=");
1695
+ if (1 < I.length) {
1696
+ var x = I[0];
1697
+ I = I[1];
1698
+ var F = x.split("_");
1699
+ S = 2 <= F.length && F[1] == "type" ? S + (x + "=" + I + "&") : S + (x + "=redacted&");
1700
+ }
1701
+ }
1702
+ else S = null;
1703
+ else S = _;
1704
+ return "XMLHTTP REQ (" + s + ") [attempt " + g + "]: " + e + `
1705
+ ` + n + `
1706
+ ` + S;
1707
+ });
1708
+ }
1709
+ function Bi(t, e, n, s, g, _, S) {
1710
+ t.info(function() {
1711
+ return "XMLHTTP RESP (" + s + ") [ attempt " + g + "]: " + e + `
1712
+ ` + n + `
1713
+ ` + _ + " " + S;
1714
+ });
1715
+ }
1716
+ function gt(t, e, n, s) {
1717
+ t.info(function() {
1718
+ return "XMLHTTP TEXT (" + e + "): " + xi(t, n) + (s ? " " + s : "");
1719
+ });
1720
+ }
1721
+ function ki(t, e) {
1722
+ t.info(function() {
1723
+ return "TIMEOUT: " + e;
1724
+ });
1725
+ }
1726
+ Ot.prototype.info = function() {
1727
+ };
1728
+ function xi(t, e) {
1729
+ if (!t.g) return e;
1730
+ if (!e) return null;
1731
+ try {
1732
+ var n = JSON.parse(e);
1733
+ if (n) {
1734
+ for (t = 0; t < n.length; t++) if (Array.isArray(n[t])) {
1735
+ var s = n[t];
1736
+ if (!(2 > s.length)) {
1737
+ var g = s[1];
1738
+ if (Array.isArray(g) && !(1 > g.length)) {
1739
+ var _ = g[0];
1740
+ if (_ != "noop" && _ != "stop" && _ != "close") for (var S = 1; S < g.length; S++) g[S] = "";
1741
+ }
1742
+ }
1743
+ }
1744
+ }
1745
+ return de(n);
1746
+ } catch {
1747
+ return e;
1748
+ }
1749
+ }
1750
+ var Se = { NO_ERROR: 0, gb: 1, tb: 2, sb: 3, nb: 4, rb: 5, ub: 6, Ia: 7, TIMEOUT: 8, xb: 9 }, Fi = { lb: "complete", Hb: "success", Ja: "error", Ia: "abort", zb: "ready", Ab: "readystatechange", TIMEOUT: "timeout", vb: "incrementaldata", yb: "progress", ob: "downloadprogress", Pb: "uploadprogress" }, ve;
1751
+ function $t() {
1752
+ }
1753
+ w($t, _e), $t.prototype.g = function() {
1754
+ return new XMLHttpRequest();
1755
+ }, $t.prototype.i = function() {
1756
+ return {};
1757
+ }, ve = new $t();
1758
+ function rt(t, e, n, s) {
1759
+ this.j = t, this.i = e, this.l = n, this.R = s || 1, this.U = new It(this), this.I = 45e3, this.H = null, this.o = !1, this.m = this.A = this.v = this.L = this.F = this.S = this.B = null, this.D = [], this.g = null, this.C = 0, this.s = this.u = null, this.X = -1, this.J = !1, this.O = 0, this.M = null, this.W = this.K = this.T = this.P = !1, this.h = new an();
1760
+ }
1761
+ function an() {
1762
+ this.i = null, this.g = "", this.h = !1;
1763
+ }
1764
+ var ln = {}, Ae = {};
1765
+ function Re(t, e, n) {
1766
+ t.L = 1, t.v = Yt(tt(e)), t.m = n, t.P = !0, un(t, null);
1767
+ }
1768
+ function un(t, e) {
1769
+ t.F = Date.now(), Gt(t), t.A = tt(t.v);
1770
+ var n = t.A, s = t.R;
1771
+ Array.isArray(s) || (s = [String(s)]), Rn(n.i, "t", s), t.C = 0, n = t.j.J, t.h = new an(), t.g = Vn(t.j, n ? e : null, !t.m), 0 < t.O && (t.M = new Li(P(t.Y, t, t.g), t.O)), e = t.U, n = t.g, s = t.ca;
1772
+ var g = "readystatechange";
1773
+ Array.isArray(g) || (g && (tn[0] = g.toString()), g = tn);
1774
+ for (var _ = 0; _ < g.length; _++) {
1775
+ var S = Ye(n, g[_], s || e.handleEvent, !1, e.h || e);
1776
+ if (!S) break;
1777
+ e.g[S.key] = S;
1778
+ }
1779
+ e = t.H ? h(t.H) : {}, t.m ? (t.u || (t.u = "POST"), e["Content-Type"] = "application/x-www-form-urlencoded", t.g.ea(
1780
+ t.A,
1781
+ t.u,
1782
+ t.m,
1783
+ e
1784
+ )) : (t.u = "GET", t.g.ea(t.A, t.u, null, e)), Ct(), Mi(t.i, t.u, t.A, t.l, t.R, t.m);
1785
+ }
1786
+ rt.prototype.ca = function(t) {
1787
+ t = t.target;
1788
+ const e = this.M;
1789
+ e && et(t) == 3 ? e.j() : this.Y(t);
1790
+ }, rt.prototype.Y = function(t) {
1791
+ try {
1792
+ if (t == this.g) t: {
1793
+ const F = et(this.g);
1794
+ var e = this.g.Ba();
1795
+ const _t = this.g.Z();
1796
+ if (!(3 > F) && (F != 3 || this.g && (this.h.h || this.g.oa() || Ln(this.g)))) {
1797
+ this.J || F != 4 || e == 7 || (e == 8 || 0 >= _t ? Ct(3) : Ct(2)), Ie(this);
1798
+ var n = this.g.Z();
1799
+ this.X = n;
1800
+ e: if (cn(this)) {
1801
+ var s = Ln(this.g);
1802
+ t = "";
1803
+ var g = s.length, _ = et(this.g) == 4;
1804
+ if (!this.h.i) {
1805
+ if (typeof TextDecoder > "u") {
1806
+ lt(this), Pt(this);
1807
+ var S = "";
1808
+ break e;
1809
+ }
1810
+ this.h.i = new y.TextDecoder();
1811
+ }
1812
+ for (e = 0; e < g; e++) this.h.h = !0, t += this.h.i.decode(s[e], { stream: !(_ && e == g - 1) });
1813
+ s.length = 0, this.h.g += t, this.C = 0, S = this.h.g;
1814
+ } else S = this.g.oa();
1815
+ if (this.o = n == 200, Bi(this.i, this.u, this.A, this.l, this.R, F, n), this.o) {
1816
+ if (this.T && !this.K) {
1817
+ e: {
1818
+ if (this.g) {
1819
+ var C, U = this.g;
1820
+ if ((C = U.g ? U.g.getResponseHeader("X-HTTP-Initial-Response") : null) && !q(C)) {
1821
+ var I = C;
1822
+ break e;
1823
+ }
1824
+ }
1825
+ I = null;
1826
+ }
1827
+ if (n = I) gt(this.i, this.l, n, "Initial handshake response via X-HTTP-Initial-Response"), this.K = !0, we(this, n);
1828
+ else {
1829
+ this.o = !1, this.s = 3, H(12), lt(this), Pt(this);
1830
+ break t;
1831
+ }
1832
+ }
1833
+ if (this.P) {
1834
+ n = !0;
1835
+ let z;
1836
+ for (; !this.J && this.C < S.length; ) if (z = ji(this, S), z == Ae) {
1837
+ F == 4 && (this.s = 4, H(14), n = !1), gt(this.i, this.l, null, "[Incomplete Response]");
1838
+ break;
1839
+ } else if (z == ln) {
1840
+ this.s = 4, H(15), gt(this.i, this.l, S, "[Invalid Chunk]"), n = !1;
1841
+ break;
1842
+ } else gt(this.i, this.l, z, null), we(this, z);
1843
+ if (cn(this) && this.C != 0 && (this.h.g = this.h.g.slice(this.C), this.C = 0), F != 4 || S.length != 0 || this.h.h || (this.s = 1, H(16), n = !1), this.o = this.o && n, !n) gt(this.i, this.l, S, "[Invalid Chunked Response]"), lt(this), Pt(this);
1844
+ else if (0 < S.length && !this.W) {
1845
+ this.W = !0;
1846
+ var x = this.j;
1847
+ x.g == this && x.ba && !x.M && (x.j.info("Great, no buffering proxy detected. Bytes received: " + S.length), Ne(x), x.M = !0, H(11));
1848
+ }
1849
+ } else gt(this.i, this.l, S, null), we(this, S);
1850
+ F == 4 && lt(this), this.o && !this.J && (F == 4 ? xn(this.j, this) : (this.o = !1, Gt(this)));
1851
+ } else is(this.g), n == 400 && 0 < S.indexOf("Unknown SID") ? (this.s = 3, H(12)) : (this.s = 0, H(13)), lt(this), Pt(this);
1852
+ }
1853
+ }
1854
+ } catch {
1855
+ } finally {
1856
+ }
1857
+ };
1858
+ function cn(t) {
1859
+ return t.g ? t.u == "GET" && t.L != 2 && t.j.Ca : !1;
1860
+ }
1861
+ function ji(t, e) {
1862
+ var n = t.C, s = e.indexOf(`
1863
+ `, n);
1864
+ return s == -1 ? Ae : (n = Number(e.substring(n, s)), isNaN(n) ? ln : (s += 1, s + n > e.length ? Ae : (e = e.slice(s, s + n), t.C = s + n, e)));
1865
+ }
1866
+ rt.prototype.cancel = function() {
1867
+ this.J = !0, lt(this);
1868
+ };
1869
+ function Gt(t) {
1870
+ t.S = Date.now() + t.I, fn(t, t.I);
1871
+ }
1872
+ function fn(t, e) {
1873
+ if (t.B != null) throw Error("WatchDog timer not null");
1874
+ t.B = Dt(P(t.ba, t), e);
1875
+ }
1876
+ function Ie(t) {
1877
+ t.B && (y.clearTimeout(t.B), t.B = null);
1878
+ }
1879
+ rt.prototype.ba = function() {
1880
+ this.B = null;
1881
+ const t = Date.now();
1882
+ 0 <= t - this.S ? (ki(this.i, this.A), this.L != 2 && (Ct(), H(17)), lt(this), this.s = 2, Pt(this)) : fn(this, this.S - t);
1883
+ };
1884
+ function Pt(t) {
1885
+ t.j.G == 0 || t.J || xn(t.j, t);
1886
+ }
1887
+ function lt(t) {
1888
+ Ie(t);
1889
+ var e = t.M;
1890
+ e && typeof e.ma == "function" && e.ma(), t.M = null, en(t.U), t.g && (e = t.g, t.g = null, e.abort(), e.ma());
1891
+ }
1892
+ function we(t, e) {
1893
+ try {
1894
+ var n = t.j;
1895
+ if (n.G != 0 && (n.g == t || Ce(n.h, t))) {
1896
+ if (!t.K && Ce(n.h, t) && n.G == 3) {
1897
+ try {
1898
+ var s = n.Da.g.parse(e);
1899
+ } catch {
1900
+ s = null;
1901
+ }
1902
+ if (Array.isArray(s) && s.length == 3) {
1903
+ var g = s;
1904
+ if (g[0] == 0) {
1905
+ t:
1906
+ if (!n.u) {
1907
+ if (n.g) if (n.g.F + 3e3 < t.F) te(n), Jt(n);
1908
+ else break t;
1909
+ Le(n), H(18);
1910
+ }
1911
+ } else n.za = g[1], 0 < n.za - n.T && 37500 > g[2] && n.F && n.v == 0 && !n.C && (n.C = Dt(P(n.Za, n), 6e3));
1912
+ if (1 >= En(n.h) && n.ca) {
1913
+ try {
1914
+ n.ca();
1915
+ } catch {
1916
+ }
1917
+ n.ca = void 0;
1918
+ }
1919
+ } else ct(n, 11);
1920
+ } else if ((t.K || n.g == t) && te(n), !q(e)) for (g = n.Da.g.parse(e), e = 0; e < g.length; e++) {
1921
+ let I = g[e];
1922
+ if (n.T = I[0], I = I[1], n.G == 2) if (I[0] == "c") {
1923
+ n.K = I[1], n.ia = I[2];
1924
+ const x = I[3];
1925
+ x != null && (n.la = x, n.j.info("VER=" + n.la));
1926
+ const F = I[4];
1927
+ F != null && (n.Aa = F, n.j.info("SVER=" + n.Aa));
1928
+ const _t = I[5];
1929
+ _t != null && typeof _t == "number" && 0 < _t && (s = 1.5 * _t, n.L = s, n.j.info("backChannelRequestTimeoutMs_=" + s)), s = n;
1930
+ const z = t.g;
1931
+ if (z) {
1932
+ const ee = z.g ? z.g.getResponseHeader("X-Client-Wire-Protocol") : null;
1933
+ if (ee) {
1934
+ var _ = s.h;
1935
+ _.g || ee.indexOf("spdy") == -1 && ee.indexOf("quic") == -1 && ee.indexOf("h2") == -1 || (_.j = _.l, _.g = /* @__PURE__ */ new Set(), _.h && (De(_, _.h), _.h = null));
1936
+ }
1937
+ if (s.D) {
1938
+ const Ue = z.g ? z.g.getResponseHeader("X-HTTP-Session-Id") : null;
1939
+ Ue && (s.ya = Ue, O(s.I, s.D, Ue));
1940
+ }
1941
+ }
1942
+ n.G = 3, n.l && n.l.ua(), n.ba && (n.R = Date.now() - t.F, n.j.info("Handshake RTT: " + n.R + "ms")), s = n;
1943
+ var S = t;
1944
+ if (s.qa = Hn(s, s.J ? s.ia : null, s.W), S.K) {
1945
+ dn(s.h, S);
1946
+ var C = S, U = s.L;
1947
+ U && (C.I = U), C.B && (Ie(C), Gt(C)), s.g = S;
1948
+ } else Bn(s);
1949
+ 0 < n.i.length && Zt(n);
1950
+ } else I[0] != "stop" && I[0] != "close" || ct(n, 7);
1951
+ else n.G == 3 && (I[0] == "stop" || I[0] == "close" ? I[0] == "stop" ? ct(n, 7) : Pe(n) : I[0] != "noop" && n.l && n.l.ta(I), n.v = 0);
1952
+ }
1953
+ }
1954
+ Ct(4);
1955
+ } catch {
1956
+ }
1957
+ }
1958
+ var Hi = class {
1959
+ constructor(t, e) {
1960
+ this.g = t, this.map = e;
1961
+ }
1962
+ };
1963
+ function pn(t) {
1964
+ this.l = t || 10, y.PerformanceNavigationTiming ? (t = y.performance.getEntriesByType("navigation"), t = 0 < t.length && (t[0].nextHopProtocol == "hq" || t[0].nextHopProtocol == "h2")) : t = !!(y.chrome && y.chrome.loadTimes && y.chrome.loadTimes() && y.chrome.loadTimes().wasFetchedViaSpdy), this.j = t ? this.l : 1, this.g = null, 1 < this.j && (this.g = /* @__PURE__ */ new Set()), this.h = null, this.i = [];
1965
+ }
1966
+ function gn(t) {
1967
+ return t.h ? !0 : t.g ? t.g.size >= t.j : !1;
1968
+ }
1969
+ function En(t) {
1970
+ return t.h ? 1 : t.g ? t.g.size : 0;
1971
+ }
1972
+ function Ce(t, e) {
1973
+ return t.h ? t.h == e : t.g ? t.g.has(e) : !1;
1974
+ }
1975
+ function De(t, e) {
1976
+ t.g ? t.g.add(e) : t.h = e;
1977
+ }
1978
+ function dn(t, e) {
1979
+ t.h && t.h == e ? t.h = null : t.g && t.g.has(e) && t.g.delete(e);
1980
+ }
1981
+ pn.prototype.cancel = function() {
1982
+ if (this.i = _n(this), this.h) this.h.cancel(), this.h = null;
1983
+ else if (this.g && this.g.size !== 0) {
1984
+ for (const t of this.g.values()) t.cancel();
1985
+ this.g.clear();
1986
+ }
1987
+ };
1988
+ function _n(t) {
1989
+ if (t.h != null) return t.i.concat(t.h.D);
1990
+ if (t.g != null && t.g.size !== 0) {
1991
+ let e = t.i;
1992
+ for (const n of t.g.values()) e = e.concat(n.D);
1993
+ return e;
1994
+ }
1995
+ return M(t.i);
1996
+ }
1997
+ function Vi(t) {
1998
+ if (t.V && typeof t.V == "function") return t.V();
1999
+ if (typeof Map < "u" && t instanceof Map || typeof Set < "u" && t instanceof Set) return Array.from(t.values());
2000
+ if (typeof t == "string") return t.split("");
2001
+ if (v(t)) {
2002
+ for (var e = [], n = t.length, s = 0; s < n; s++) e.push(t[s]);
2003
+ return e;
2004
+ }
2005
+ e = [], n = 0;
2006
+ for (s in t) e[n++] = t[s];
2007
+ return e;
2008
+ }
2009
+ function Qi(t) {
2010
+ if (t.na && typeof t.na == "function") return t.na();
2011
+ if (!t.V || typeof t.V != "function") {
2012
+ if (typeof Map < "u" && t instanceof Map) return Array.from(t.keys());
2013
+ if (!(typeof Set < "u" && t instanceof Set)) {
2014
+ if (v(t) || typeof t == "string") {
2015
+ var e = [];
2016
+ t = t.length;
2017
+ for (var n = 0; n < t; n++) e.push(n);
2018
+ return e;
2019
+ }
2020
+ e = [], n = 0;
2021
+ for (const s in t) e[n++] = s;
2022
+ return e;
2023
+ }
2024
+ }
2025
+ }
2026
+ function Tn(t, e) {
2027
+ if (t.forEach && typeof t.forEach == "function") t.forEach(e, void 0);
2028
+ else if (v(t) || typeof t == "string") Array.prototype.forEach.call(t, e, void 0);
2029
+ else for (var n = Qi(t), s = Vi(t), g = s.length, _ = 0; _ < g; _++) e.call(void 0, s[_], n && n[_], t);
2030
+ }
2031
+ var mn = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");
2032
+ function $i(t, e) {
2033
+ if (t) {
2034
+ t = t.split("&");
2035
+ for (var n = 0; n < t.length; n++) {
2036
+ var s = t[n].indexOf("="), g = null;
2037
+ if (0 <= s) {
2038
+ var _ = t[n].substring(0, s);
2039
+ g = t[n].substring(s + 1);
2040
+ } else _ = t[n];
2041
+ e(_, g ? decodeURIComponent(g.replace(/\+/g, " ")) : "");
2042
+ }
2043
+ }
2044
+ }
2045
+ function ut(t) {
2046
+ if (this.g = this.o = this.j = "", this.s = null, this.m = this.l = "", this.h = !1, t instanceof ut) {
2047
+ this.h = t.h, Kt(this, t.j), this.o = t.o, this.g = t.g, Wt(this, t.s), this.l = t.l;
2048
+ var e = t.i, n = new Ut();
2049
+ n.i = e.i, e.g && (n.g = new Map(e.g), n.h = e.h), yn(this, n), this.m = t.m;
2050
+ } else t && (e = String(t).match(mn)) ? (this.h = !1, Kt(this, e[1] || "", !0), this.o = Lt(e[2] || ""), this.g = Lt(e[3] || "", !0), Wt(this, e[4]), this.l = Lt(e[5] || "", !0), yn(this, e[6] || "", !0), this.m = Lt(e[7] || "")) : (this.h = !1, this.i = new Ut(null, this.h));
2051
+ }
2052
+ ut.prototype.toString = function() {
2053
+ var t = [], e = this.j;
2054
+ e && t.push(Nt(e, Sn, !0), ":");
2055
+ var n = this.g;
2056
+ return (n || e == "file") && (t.push("//"), (e = this.o) && t.push(Nt(e, Sn, !0), "@"), t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), n = this.s, n != null && t.push(":", String(n))), (n = this.l) && (this.g && n.charAt(0) != "/" && t.push("/"), t.push(Nt(n, n.charAt(0) == "/" ? Wi : Ki, !0))), (n = this.i.toString()) && t.push("?", n), (n = this.m) && t.push("#", Nt(n, Xi)), t.join("");
2057
+ };
2058
+ function tt(t) {
2059
+ return new ut(t);
2060
+ }
2061
+ function Kt(t, e, n) {
2062
+ t.j = n ? Lt(e, !0) : e, t.j && (t.j = t.j.replace(/:$/, ""));
2063
+ }
2064
+ function Wt(t, e) {
2065
+ if (e) {
2066
+ if (e = Number(e), isNaN(e) || 0 > e) throw Error("Bad port number " + e);
2067
+ t.s = e;
2068
+ } else t.s = null;
2069
+ }
2070
+ function yn(t, e, n) {
2071
+ e instanceof Ut ? (t.i = e, zi(t.i, t.h)) : (n || (e = Nt(e, Yi)), t.i = new Ut(e, t.h));
2072
+ }
2073
+ function O(t, e, n) {
2074
+ t.i.set(e, n);
2075
+ }
2076
+ function Yt(t) {
2077
+ return O(t, "zx", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ Date.now()).toString(36)), t;
2078
+ }
2079
+ function Lt(t, e) {
2080
+ return t ? e ? decodeURI(t.replace(/%25/g, "%2525")) : decodeURIComponent(t) : "";
2081
+ }
2082
+ function Nt(t, e, n) {
2083
+ return typeof t == "string" ? (t = encodeURI(t).replace(e, Gi), n && (t = t.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), t) : null;
2084
+ }
2085
+ function Gi(t) {
2086
+ return t = t.charCodeAt(0), "%" + (t >> 4 & 15).toString(16) + (t & 15).toString(16);
2087
+ }
2088
+ var Sn = /[#\/\?@]/g, Ki = /[#\?:]/g, Wi = /[#\?]/g, Yi = /[#\?@]/g, Xi = /#/g;
2089
+ function Ut(t, e) {
2090
+ this.h = this.g = null, this.i = t || null, this.j = !!e;
2091
+ }
2092
+ function ot(t) {
2093
+ t.g || (t.g = /* @__PURE__ */ new Map(), t.h = 0, t.i && $i(t.i, function(e, n) {
2094
+ t.add(decodeURIComponent(e.replace(/\+/g, " ")), n);
2095
+ }));
2096
+ }
2097
+ r = Ut.prototype, r.add = function(t, e) {
2098
+ ot(this), this.i = null, t = Et(this, t);
2099
+ var n = this.g.get(t);
2100
+ return n || this.g.set(t, n = []), n.push(e), this.h += 1, this;
2101
+ };
2102
+ function vn(t, e) {
2103
+ ot(t), e = Et(t, e), t.g.has(e) && (t.i = null, t.h -= t.g.get(e).length, t.g.delete(e));
2104
+ }
2105
+ function An(t, e) {
2106
+ return ot(t), e = Et(t, e), t.g.has(e);
2107
+ }
2108
+ r.forEach = function(t, e) {
2109
+ ot(this), this.g.forEach(function(n, s) {
2110
+ n.forEach(function(g) {
2111
+ t.call(e, g, s, this);
2112
+ }, this);
2113
+ }, this);
2114
+ }, r.na = function() {
2115
+ ot(this);
2116
+ const t = Array.from(this.g.values()), e = Array.from(this.g.keys()), n = [];
2117
+ for (let s = 0; s < e.length; s++) {
2118
+ const g = t[s];
2119
+ for (let _ = 0; _ < g.length; _++) n.push(e[s]);
2120
+ }
2121
+ return n;
2122
+ }, r.V = function(t) {
2123
+ ot(this);
2124
+ let e = [];
2125
+ if (typeof t == "string") An(this, t) && (e = e.concat(this.g.get(Et(this, t))));
2126
+ else {
2127
+ t = Array.from(this.g.values());
2128
+ for (let n = 0; n < t.length; n++) e = e.concat(t[n]);
2129
+ }
2130
+ return e;
2131
+ }, r.set = function(t, e) {
2132
+ return ot(this), this.i = null, t = Et(this, t), An(this, t) && (this.h -= this.g.get(t).length), this.g.set(t, [e]), this.h += 1, this;
2133
+ }, r.get = function(t, e) {
2134
+ return t ? (t = this.V(t), 0 < t.length ? String(t[0]) : e) : e;
2135
+ };
2136
+ function Rn(t, e, n) {
2137
+ vn(t, e), 0 < n.length && (t.i = null, t.g.set(Et(t, e), M(n)), t.h += n.length);
2138
+ }
2139
+ r.toString = function() {
2140
+ if (this.i) return this.i;
2141
+ if (!this.g) return "";
2142
+ const t = [], e = Array.from(this.g.keys());
2143
+ for (var n = 0; n < e.length; n++) {
2144
+ var s = e[n];
2145
+ const _ = encodeURIComponent(String(s)), S = this.V(s);
2146
+ for (s = 0; s < S.length; s++) {
2147
+ var g = _;
2148
+ S[s] !== "" && (g += "=" + encodeURIComponent(String(S[s]))), t.push(g);
2149
+ }
2150
+ }
2151
+ return this.i = t.join("&");
2152
+ };
2153
+ function Et(t, e) {
2154
+ return e = String(e), t.j && (e = e.toLowerCase()), e;
2155
+ }
2156
+ function zi(t, e) {
2157
+ e && !t.j && (ot(t), t.i = null, t.g.forEach(function(n, s) {
2158
+ var g = s.toLowerCase();
2159
+ s != g && (vn(this, s), Rn(this, g, n));
2160
+ }, t)), t.j = e;
2161
+ }
2162
+ function qi(t, e) {
2163
+ const n = new Ot();
2164
+ if (y.Image) {
2165
+ const s = new Image();
2166
+ s.onload = W(ht, n, "TestLoadImage: loaded", !0, e, s), s.onerror = W(ht, n, "TestLoadImage: error", !1, e, s), s.onabort = W(ht, n, "TestLoadImage: abort", !1, e, s), s.ontimeout = W(ht, n, "TestLoadImage: timeout", !1, e, s), y.setTimeout(function() {
2167
+ s.ontimeout && s.ontimeout();
2168
+ }, 1e4), s.src = t;
2169
+ } else e(!1);
2170
+ }
2171
+ function Ji(t, e) {
2172
+ const n = new Ot(), s = new AbortController(), g = setTimeout(() => {
2173
+ s.abort(), ht(n, "TestPingServer: timeout", !1, e);
2174
+ }, 1e4);
2175
+ fetch(t, { signal: s.signal }).then((_) => {
2176
+ clearTimeout(g), _.ok ? ht(n, "TestPingServer: ok", !0, e) : ht(n, "TestPingServer: server error", !1, e);
2177
+ }).catch(() => {
2178
+ clearTimeout(g), ht(n, "TestPingServer: error", !1, e);
2179
+ });
2180
+ }
2181
+ function ht(t, e, n, s, g) {
2182
+ try {
2183
+ g && (g.onload = null, g.onerror = null, g.onabort = null, g.ontimeout = null), s(n);
2184
+ } catch {
2185
+ }
2186
+ }
2187
+ function Zi() {
2188
+ this.g = new Ui();
2189
+ }
2190
+ function ts(t, e, n) {
2191
+ const s = n || "";
2192
+ try {
2193
+ Tn(t, function(g, _) {
2194
+ let S = g;
2195
+ A(g) && (S = de(g)), e.push(s + _ + "=" + encodeURIComponent(S));
2196
+ });
2197
+ } catch (g) {
2198
+ throw e.push(s + "type=" + encodeURIComponent("_badmap")), g;
2199
+ }
2200
+ }
2201
+ function Xt(t) {
2202
+ this.l = t.Ub || null, this.j = t.eb || !1;
2203
+ }
2204
+ w(Xt, _e), Xt.prototype.g = function() {
2205
+ return new zt(this.l, this.j);
2206
+ }, Xt.prototype.i = /* @__PURE__ */ function(t) {
2207
+ return function() {
2208
+ return t;
2209
+ };
2210
+ }({});
2211
+ function zt(t, e) {
2212
+ k.call(this), this.D = t, this.o = e, this.m = void 0, this.status = this.readyState = 0, this.responseType = this.responseText = this.response = this.statusText = "", this.onreadystatechange = null, this.u = new Headers(), this.h = null, this.B = "GET", this.A = "", this.g = !1, this.v = this.j = this.l = null;
2213
+ }
2214
+ w(zt, k), r = zt.prototype, r.open = function(t, e) {
2215
+ if (this.readyState != 0) throw this.abort(), Error("Error reopening a connection");
2216
+ this.B = t, this.A = e, this.readyState = 1, Mt(this);
2217
+ }, r.send = function(t) {
2218
+ if (this.readyState != 1) throw this.abort(), Error("need to call open() first. ");
2219
+ this.g = !0;
2220
+ const e = { headers: this.u, method: this.B, credentials: this.m, cache: void 0 };
2221
+ t && (e.body = t), (this.D || y).fetch(new Request(this.A, e)).then(this.Sa.bind(this), this.ga.bind(this));
2222
+ }, r.abort = function() {
2223
+ this.response = this.responseText = "", this.u = new Headers(), this.status = 0, this.j && this.j.cancel("Request was aborted.").catch(() => {
2224
+ }), 1 <= this.readyState && this.g && this.readyState != 4 && (this.g = !1, bt(this)), this.readyState = 0;
2225
+ }, r.Sa = function(t) {
2226
+ if (this.g && (this.l = t, this.h || (this.status = this.l.status, this.statusText = this.l.statusText, this.h = t.headers, this.readyState = 2, Mt(this)), this.g && (this.readyState = 3, Mt(this), this.g))) if (this.responseType === "arraybuffer") t.arrayBuffer().then(this.Qa.bind(this), this.ga.bind(this));
2227
+ else if (typeof y.ReadableStream < "u" && "body" in t) {
2228
+ if (this.j = t.body.getReader(), this.o) {
2229
+ if (this.responseType) throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');
2230
+ this.response = [];
2231
+ } else this.response = this.responseText = "", this.v = new TextDecoder();
2232
+ In(this);
2233
+ } else t.text().then(this.Ra.bind(this), this.ga.bind(this));
2234
+ };
2235
+ function In(t) {
2236
+ t.j.read().then(t.Pa.bind(t)).catch(t.ga.bind(t));
2237
+ }
2238
+ r.Pa = function(t) {
2239
+ if (this.g) {
2240
+ if (this.o && t.value) this.response.push(t.value);
2241
+ else if (!this.o) {
2242
+ var e = t.value ? t.value : new Uint8Array(0);
2243
+ (e = this.v.decode(e, { stream: !t.done })) && (this.response = this.responseText += e);
2244
+ }
2245
+ t.done ? bt(this) : Mt(this), this.readyState == 3 && In(this);
2246
+ }
2247
+ }, r.Ra = function(t) {
2248
+ this.g && (this.response = this.responseText = t, bt(this));
2249
+ }, r.Qa = function(t) {
2250
+ this.g && (this.response = t, bt(this));
2251
+ }, r.ga = function() {
2252
+ this.g && bt(this);
2253
+ };
2254
+ function bt(t) {
2255
+ t.readyState = 4, t.l = null, t.j = null, t.v = null, Mt(t);
2256
+ }
2257
+ r.setRequestHeader = function(t, e) {
2258
+ this.u.append(t, e);
2259
+ }, r.getResponseHeader = function(t) {
2260
+ return this.h && this.h.get(t.toLowerCase()) || "";
2261
+ }, r.getAllResponseHeaders = function() {
2262
+ if (!this.h) return "";
2263
+ const t = [], e = this.h.entries();
2264
+ for (var n = e.next(); !n.done; ) n = n.value, t.push(n[0] + ": " + n[1]), n = e.next();
2265
+ return t.join(`\r
2266
+ `);
2267
+ };
2268
+ function Mt(t) {
2269
+ t.onreadystatechange && t.onreadystatechange.call(t);
2270
+ }
2271
+ Object.defineProperty(zt.prototype, "withCredentials", { get: function() {
2272
+ return this.m === "include";
2273
+ }, set: function(t) {
2274
+ this.m = t ? "include" : "same-origin";
2275
+ } });
2276
+ function wn(t) {
2277
+ let e = "";
2278
+ return J(t, function(n, s) {
2279
+ e += s, e += ":", e += n, e += `\r
2280
+ `;
2281
+ }), e;
2282
+ }
2283
+ function Oe(t, e, n) {
2284
+ t: {
2285
+ for (s in n) {
2286
+ var s = !1;
2287
+ break t;
2288
+ }
2289
+ s = !0;
2290
+ }
2291
+ s || (n = wn(n), typeof t == "string" ? n != null && encodeURIComponent(String(n)) : O(t, e, n));
2292
+ }
2293
+ function L(t) {
2294
+ k.call(this), this.headers = /* @__PURE__ */ new Map(), this.o = t || null, this.h = !1, this.v = this.g = null, this.D = "", this.m = 0, this.l = "", this.j = this.B = this.u = this.A = !1, this.I = null, this.H = "", this.J = !1;
2295
+ }
2296
+ w(L, k);
2297
+ var es = /^https?$/i, ns = ["POST", "PUT"];
2298
+ r = L.prototype, r.Ha = function(t) {
2299
+ this.J = t;
2300
+ }, r.ea = function(t, e, n, s) {
2301
+ if (this.g) throw Error("[goog.net.XhrIo] Object is active with another request=" + this.D + "; newUri=" + t);
2302
+ e = e ? e.toUpperCase() : "GET", this.D = t, this.l = "", this.m = 0, this.A = !1, this.h = !0, this.g = this.o ? this.o.g() : ve.g(), this.v = this.o ? nn(this.o) : nn(ve), this.g.onreadystatechange = P(this.Ea, this);
2303
+ try {
2304
+ this.B = !0, this.g.open(e, String(t), !0), this.B = !1;
2305
+ } catch (_) {
2306
+ Cn(this, _);
2307
+ return;
2308
+ }
2309
+ if (t = n || "", n = new Map(this.headers), s) if (Object.getPrototypeOf(s) === Object.prototype) for (var g in s) n.set(g, s[g]);
2310
+ else if (typeof s.keys == "function" && typeof s.get == "function") for (const _ of s.keys()) n.set(_, s.get(_));
2311
+ else throw Error("Unknown input type for opt_headers: " + String(s));
2312
+ s = Array.from(n.keys()).find((_) => _.toLowerCase() == "content-type"), g = y.FormData && t instanceof y.FormData, !(0 <= Array.prototype.indexOf.call(ns, e, void 0)) || s || g || n.set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
2313
+ for (const [_, S] of n) this.g.setRequestHeader(_, S);
2314
+ this.H && (this.g.responseType = this.H), "withCredentials" in this.g && this.g.withCredentials !== this.J && (this.g.withCredentials = this.J);
2315
+ try {
2316
+ Pn(this), this.u = !0, this.g.send(t), this.u = !1;
2317
+ } catch (_) {
2318
+ Cn(this, _);
2319
+ }
2320
+ };
2321
+ function Cn(t, e) {
2322
+ t.h = !1, t.g && (t.j = !0, t.g.abort(), t.j = !1), t.l = e, t.m = 5, Dn(t), qt(t);
2323
+ }
2324
+ function Dn(t) {
2325
+ t.A || (t.A = !0, j(t, "complete"), j(t, "error"));
2326
+ }
2327
+ r.abort = function(t) {
2328
+ this.g && this.h && (this.h = !1, this.j = !0, this.g.abort(), this.j = !1, this.m = t || 7, j(this, "complete"), j(this, "abort"), qt(this));
2329
+ }, r.N = function() {
2330
+ this.g && (this.h && (this.h = !1, this.j = !0, this.g.abort(), this.j = !1), qt(this, !0)), L.aa.N.call(this);
2331
+ }, r.Ea = function() {
2332
+ this.s || (this.B || this.u || this.j ? On(this) : this.bb());
2333
+ }, r.bb = function() {
2334
+ On(this);
2335
+ };
2336
+ function On(t) {
2337
+ if (t.h && typeof m < "u" && (!t.v[1] || et(t) != 4 || t.Z() != 2)) {
2338
+ if (t.u && et(t) == 4) Je(t.Ea, 0, t);
2339
+ else if (j(t, "readystatechange"), et(t) == 4) {
2340
+ t.h = !1;
2341
+ try {
2342
+ const S = t.Z();
2343
+ t: switch (S) {
2344
+ case 200:
2345
+ case 201:
2346
+ case 202:
2347
+ case 204:
2348
+ case 206:
2349
+ case 304:
2350
+ case 1223:
2351
+ var e = !0;
2352
+ break t;
2353
+ default:
2354
+ e = !1;
2355
+ }
2356
+ var n;
2357
+ if (!(n = e)) {
2358
+ var s;
2359
+ if (s = S === 0) {
2360
+ var g = String(t.D).match(mn)[1] || null;
2361
+ !g && y.self && y.self.location && (g = y.self.location.protocol.slice(0, -1)), s = !es.test(g ? g.toLowerCase() : "");
2362
+ }
2363
+ n = s;
2364
+ }
2365
+ if (n) j(t, "complete"), j(t, "success");
2366
+ else {
2367
+ t.m = 6;
2368
+ try {
2369
+ var _ = 2 < et(t) ? t.g.statusText : "";
2370
+ } catch {
2371
+ _ = "";
2372
+ }
2373
+ t.l = _ + " [" + t.Z() + "]", Dn(t);
2374
+ }
2375
+ } finally {
2376
+ qt(t);
2377
+ }
2378
+ }
2379
+ }
2380
+ }
2381
+ function qt(t, e) {
2382
+ if (t.g) {
2383
+ Pn(t);
2384
+ const n = t.g, s = t.v[0] ? () => {
2385
+ } : null;
2386
+ t.g = null, t.v = null, e || j(t, "ready");
2387
+ try {
2388
+ n.onreadystatechange = s;
2389
+ } catch {
2390
+ }
2391
+ }
2392
+ }
2393
+ function Pn(t) {
2394
+ t.I && (y.clearTimeout(t.I), t.I = null);
2395
+ }
2396
+ r.isActive = function() {
2397
+ return !!this.g;
2398
+ };
2399
+ function et(t) {
2400
+ return t.g ? t.g.readyState : 0;
2401
+ }
2402
+ r.Z = function() {
2403
+ try {
2404
+ return 2 < et(this) ? this.g.status : -1;
2405
+ } catch {
2406
+ return -1;
2407
+ }
2408
+ }, r.oa = function() {
2409
+ try {
2410
+ return this.g ? this.g.responseText : "";
2411
+ } catch {
2412
+ return "";
2413
+ }
2414
+ }, r.Oa = function(t) {
2415
+ if (this.g) {
2416
+ var e = this.g.responseText;
2417
+ return t && e.indexOf(t) == 0 && (e = e.substring(t.length)), Ni(e);
2418
+ }
2419
+ };
2420
+ function Ln(t) {
2421
+ try {
2422
+ if (!t.g) return null;
2423
+ if ("response" in t.g) return t.g.response;
2424
+ switch (t.H) {
2425
+ case "":
2426
+ case "text":
2427
+ return t.g.responseText;
2428
+ case "arraybuffer":
2429
+ if ("mozResponseArrayBuffer" in t.g) return t.g.mozResponseArrayBuffer;
2430
+ }
2431
+ return null;
2432
+ } catch {
2433
+ return null;
2434
+ }
2435
+ }
2436
+ function is(t) {
2437
+ const e = {};
2438
+ t = (t.g && 2 <= et(t) && t.g.getAllResponseHeaders() || "").split(`\r
2439
+ `);
2440
+ for (let s = 0; s < t.length; s++) {
2441
+ if (q(t[s])) continue;
2442
+ var n = f(t[s]);
2443
+ const g = n[0];
2444
+ if (n = n[1], typeof n != "string") continue;
2445
+ n = n.trim();
2446
+ const _ = e[g] || [];
2447
+ e[g] = _, _.push(n);
2448
+ }
2449
+ p(e, function(s) {
2450
+ return s.join(", ");
2451
+ });
2452
+ }
2453
+ r.Ba = function() {
2454
+ return this.m;
2455
+ }, r.Ka = function() {
2456
+ return typeof this.l == "string" ? this.l : String(this.l);
2457
+ };
2458
+ function Bt(t, e, n) {
2459
+ return n && n.internalChannelParams && n.internalChannelParams[t] || e;
2460
+ }
2461
+ function Nn(t) {
2462
+ this.Aa = 0, this.i = [], this.j = new Ot(), this.ia = this.qa = this.I = this.W = this.g = this.ya = this.D = this.H = this.m = this.S = this.o = null, this.Ya = this.U = 0, this.Va = Bt("failFast", !1, t), this.F = this.C = this.u = this.s = this.l = null, this.X = !0, this.za = this.T = -1, this.Y = this.v = this.B = 0, this.Ta = Bt("baseRetryDelayMs", 5e3, t), this.cb = Bt("retryDelaySeedMs", 1e4, t), this.Wa = Bt("forwardChannelMaxRetries", 2, t), this.wa = Bt("forwardChannelRequestTimeoutMs", 2e4, t), this.pa = t && t.xmlHttpFactory || void 0, this.Xa = t && t.Tb || void 0, this.Ca = t && t.useFetchStreams || !1, this.L = void 0, this.J = t && t.supportsCrossDomainXhr || !1, this.K = "", this.h = new pn(t && t.concurrentRequestLimit), this.Da = new Zi(), this.P = t && t.fastHandshake || !1, this.O = t && t.encodeInitMessageHeaders || !1, this.P && this.O && (this.O = !1), this.Ua = t && t.Rb || !1, t && t.xa && this.j.xa(), t && t.forceLongPolling && (this.X = !1), this.ba = !this.P && this.X && t && t.detectBufferingProxy || !1, this.ja = void 0, t && t.longPollingTimeout && 0 < t.longPollingTimeout && (this.ja = t.longPollingTimeout), this.ca = void 0, this.R = 0, this.M = !1, this.ka = this.A = null;
2463
+ }
2464
+ r = Nn.prototype, r.la = 8, r.G = 1, r.connect = function(t, e, n, s) {
2465
+ H(0), this.W = t, this.H = e || {}, n && s !== void 0 && (this.H.OSID = n, this.H.OAID = s), this.F = this.X, this.I = Hn(this, null, this.W), Zt(this);
2466
+ };
2467
+ function Pe(t) {
2468
+ if (Un(t), t.G == 3) {
2469
+ var e = t.U++, n = tt(t.I);
2470
+ if (O(n, "SID", t.K), O(n, "RID", e), O(n, "TYPE", "terminate"), kt(t, n), e = new rt(t, t.j, e), e.L = 2, e.v = Yt(tt(n)), n = !1, y.navigator && y.navigator.sendBeacon) try {
2471
+ n = y.navigator.sendBeacon(e.v.toString(), "");
2472
+ } catch {
2473
+ }
2474
+ !n && y.Image && (new Image().src = e.v, n = !0), n || (e.g = Vn(e.j, null), e.g.ea(e.v)), e.F = Date.now(), Gt(e);
2475
+ }
2476
+ jn(t);
2477
+ }
2478
+ function Jt(t) {
2479
+ t.g && (Ne(t), t.g.cancel(), t.g = null);
2480
+ }
2481
+ function Un(t) {
2482
+ Jt(t), t.u && (y.clearTimeout(t.u), t.u = null), te(t), t.h.cancel(), t.s && (typeof t.s == "number" && y.clearTimeout(t.s), t.s = null);
2483
+ }
2484
+ function Zt(t) {
2485
+ if (!gn(t.h) && !t.s) {
2486
+ t.s = !0;
2487
+ var e = t.Ga;
2488
+ vt || We(), At || (vt(), At = !0), ae.add(e, t), t.B = 0;
2489
+ }
2490
+ }
2491
+ function ss(t, e) {
2492
+ return En(t.h) >= t.h.j - (t.s ? 1 : 0) ? !1 : t.s ? (t.i = e.D.concat(t.i), !0) : t.G == 1 || t.G == 2 || t.B >= (t.Va ? 0 : t.Wa) ? !1 : (t.s = Dt(P(t.Ga, t, e), Fn(t, t.B)), t.B++, !0);
2493
+ }
2494
+ r.Ga = function(t) {
2495
+ if (this.s) if (this.s = null, this.G == 1) {
2496
+ if (!t) {
2497
+ this.U = Math.floor(1e5 * Math.random()), t = this.U++;
2498
+ const g = new rt(this, this.j, t);
2499
+ let _ = this.o;
2500
+ if (this.S && (_ ? (_ = h(_), u(_, this.S)) : _ = this.S), this.m !== null || this.O || (g.H = _, _ = null), this.P) t: {
2501
+ for (var e = 0, n = 0; n < this.i.length; n++) {
2502
+ e: {
2503
+ var s = this.i[n];
2504
+ if ("__data__" in s.map && (s = s.map.__data__, typeof s == "string")) {
2505
+ s = s.length;
2506
+ break e;
2507
+ }
2508
+ s = void 0;
2509
+ }
2510
+ if (s === void 0) break;
2511
+ if (e += s, 4096 < e) {
2512
+ e = n;
2513
+ break t;
2514
+ }
2515
+ if (e === 4096 || n === this.i.length - 1) {
2516
+ e = n + 1;
2517
+ break t;
2518
+ }
2519
+ }
2520
+ e = 1e3;
2521
+ }
2522
+ else e = 1e3;
2523
+ e = Mn(this, g, e), n = tt(this.I), O(n, "RID", t), O(n, "CVER", 22), this.D && O(n, "X-HTTP-Session-Id", this.D), kt(this, n), _ && (this.O ? e = "headers=" + encodeURIComponent(String(wn(_))) + "&" + e : this.m && Oe(n, this.m, _)), De(this.h, g), this.Ua && O(n, "TYPE", "init"), this.P ? (O(n, "$req", e), O(n, "SID", "null"), g.T = !0, Re(g, n, null)) : Re(g, n, e), this.G = 2;
2524
+ }
2525
+ } else this.G == 3 && (t ? bn(this, t) : this.i.length == 0 || gn(this.h) || bn(this));
2526
+ };
2527
+ function bn(t, e) {
2528
+ var n;
2529
+ e ? n = e.l : n = t.U++;
2530
+ const s = tt(t.I);
2531
+ O(s, "SID", t.K), O(s, "RID", n), O(s, "AID", t.T), kt(t, s), t.m && t.o && Oe(s, t.m, t.o), n = new rt(t, t.j, n, t.B + 1), t.m === null && (n.H = t.o), e && (t.i = e.D.concat(t.i)), e = Mn(t, n, 1e3), n.I = Math.round(0.5 * t.wa) + Math.round(0.5 * t.wa * Math.random()), De(t.h, n), Re(n, s, e);
2532
+ }
2533
+ function kt(t, e) {
2534
+ t.H && J(t.H, function(n, s) {
2535
+ O(e, s, n);
2536
+ }), t.l && Tn({}, function(n, s) {
2537
+ O(e, s, n);
2538
+ });
2539
+ }
2540
+ function Mn(t, e, n) {
2541
+ n = Math.min(t.i.length, n);
2542
+ var s = t.l ? P(t.l.Na, t.l, t) : null;
2543
+ t: {
2544
+ var g = t.i;
2545
+ let _ = -1;
2546
+ for (; ; ) {
2547
+ const S = ["count=" + n];
2548
+ _ == -1 ? 0 < n ? (_ = g[0].g, S.push("ofs=" + _)) : _ = 0 : S.push("ofs=" + _);
2549
+ let C = !0;
2550
+ for (let U = 0; U < n; U++) {
2551
+ let I = g[U].g;
2552
+ const x = g[U].map;
2553
+ if (I -= _, 0 > I) _ = Math.max(0, g[U].g - 100), C = !1;
2554
+ else try {
2555
+ ts(x, S, "req" + I + "_");
2556
+ } catch {
2557
+ s && s(x);
2558
+ }
2559
+ }
2560
+ if (C) {
2561
+ s = S.join("&");
2562
+ break t;
2563
+ }
2564
+ }
2565
+ }
2566
+ return t = t.i.splice(0, n), e.D = t, s;
2567
+ }
2568
+ function Bn(t) {
2569
+ if (!t.g && !t.u) {
2570
+ t.Y = 1;
2571
+ var e = t.Fa;
2572
+ vt || We(), At || (vt(), At = !0), ae.add(e, t), t.v = 0;
2573
+ }
2574
+ }
2575
+ function Le(t) {
2576
+ return t.g || t.u || 3 <= t.v ? !1 : (t.Y++, t.u = Dt(P(t.Fa, t), Fn(t, t.v)), t.v++, !0);
2577
+ }
2578
+ r.Fa = function() {
2579
+ if (this.u = null, kn(this), this.ba && !(this.M || this.g == null || 0 >= this.R)) {
2580
+ var t = 2 * this.R;
2581
+ this.j.info("BP detection timer enabled: " + t), this.A = Dt(P(this.ab, this), t);
2582
+ }
2583
+ }, r.ab = function() {
2584
+ this.A && (this.A = null, this.j.info("BP detection timeout reached."), this.j.info("Buffering proxy detected and switch to long-polling!"), this.F = !1, this.M = !0, H(10), Jt(this), kn(this));
2585
+ };
2586
+ function Ne(t) {
2587
+ t.A != null && (y.clearTimeout(t.A), t.A = null);
2588
+ }
2589
+ function kn(t) {
2590
+ t.g = new rt(t, t.j, "rpc", t.Y), t.m === null && (t.g.H = t.o), t.g.O = 0;
2591
+ var e = tt(t.qa);
2592
+ O(e, "RID", "rpc"), O(e, "SID", t.K), O(e, "AID", t.T), O(e, "CI", t.F ? "0" : "1"), !t.F && t.ja && O(e, "TO", t.ja), O(e, "TYPE", "xmlhttp"), kt(t, e), t.m && t.o && Oe(e, t.m, t.o), t.L && (t.g.I = t.L);
2593
+ var n = t.g;
2594
+ t = t.ia, n.L = 1, n.v = Yt(tt(e)), n.m = null, n.P = !0, un(n, t);
2595
+ }
2596
+ r.Za = function() {
2597
+ this.C != null && (this.C = null, Jt(this), Le(this), H(19));
2598
+ };
2599
+ function te(t) {
2600
+ t.C != null && (y.clearTimeout(t.C), t.C = null);
2601
+ }
2602
+ function xn(t, e) {
2603
+ var n = null;
2604
+ if (t.g == e) {
2605
+ te(t), Ne(t), t.g = null;
2606
+ var s = 2;
2607
+ } else if (Ce(t.h, e)) n = e.D, dn(t.h, e), s = 1;
2608
+ else return;
2609
+ if (t.G != 0) {
2610
+ if (e.o) if (s == 1) {
2611
+ n = e.m ? e.m.length : 0, e = Date.now() - e.F;
2612
+ var g = t.B;
2613
+ s = ye(), j(s, new hn(s, n)), Zt(t);
2614
+ } else Bn(t);
2615
+ else if (g = e.s, g == 3 || g == 0 && 0 < e.X || !(s == 1 && ss(t, e) || s == 2 && Le(t))) switch (n && 0 < n.length && (e = t.h, e.i = e.i.concat(n)), g) {
2616
+ case 1:
2617
+ ct(t, 5);
2618
+ break;
2619
+ case 4:
2620
+ ct(t, 10);
2621
+ break;
2622
+ case 3:
2623
+ ct(t, 6);
2624
+ break;
2625
+ default:
2626
+ ct(t, 2);
2627
+ }
2628
+ }
2629
+ }
2630
+ function Fn(t, e) {
2631
+ let n = t.Ta + Math.floor(Math.random() * t.cb);
2632
+ return t.isActive() || (n *= 2), n * e;
2633
+ }
2634
+ function ct(t, e) {
2635
+ if (t.j.info("Error code " + e), e == 2) {
2636
+ var n = P(t.fb, t), s = t.Xa;
2637
+ const g = !s;
2638
+ s = new ut(s || "//www.google.com/images/cleardot.gif"), y.location && y.location.protocol == "http" || Kt(s, "https"), Yt(s), g ? qi(s.toString(), n) : Ji(s.toString(), n);
2639
+ } else H(2);
2640
+ t.G = 0, t.l && t.l.sa(e), jn(t), Un(t);
2641
+ }
2642
+ r.fb = function(t) {
2643
+ t ? (this.j.info("Successfully pinged google.com"), H(2)) : (this.j.info("Failed to ping google.com"), H(1));
2644
+ };
2645
+ function jn(t) {
2646
+ if (t.G = 0, t.ka = [], t.l) {
2647
+ const e = _n(t.h);
2648
+ (e.length != 0 || t.i.length != 0) && (N(t.ka, e), N(t.ka, t.i), t.h.i.length = 0, M(t.i), t.i.length = 0), t.l.ra();
2649
+ }
2650
+ }
2651
+ function Hn(t, e, n) {
2652
+ var s = n instanceof ut ? tt(n) : new ut(n);
2653
+ if (s.g != "") e && (s.g = e + "." + s.g), Wt(s, s.s);
2654
+ else {
2655
+ var g = y.location;
2656
+ s = g.protocol, e = e ? e + "." + g.hostname : g.hostname, g = +g.port;
2657
+ var _ = new ut(null);
2658
+ s && Kt(_, s), e && (_.g = e), g && Wt(_, g), n && (_.l = n), s = _;
2659
+ }
2660
+ return n = t.D, e = t.ya, n && e && O(s, n, e), O(s, "VER", t.la), kt(t, s), s;
2661
+ }
2662
+ function Vn(t, e, n) {
2663
+ if (e && !t.J) throw Error("Can't create secondary domain capable XhrIo object.");
2664
+ return e = t.Ca && !t.pa ? new L(new Xt({ eb: n })) : new L(t.pa), e.Ha(t.J), e;
2665
+ }
2666
+ r.isActive = function() {
2667
+ return !!this.l && this.l.isActive(this);
2668
+ };
2669
+ function Qn() {
2670
+ }
2671
+ r = Qn.prototype, r.ua = function() {
2672
+ }, r.ta = function() {
2673
+ }, r.sa = function() {
2674
+ }, r.ra = function() {
2675
+ }, r.isActive = function() {
2676
+ return !0;
2677
+ }, r.Na = function() {
2678
+ };
2679
+ function X(t, e) {
2680
+ k.call(this), this.g = new Nn(e), this.l = t, this.h = e && e.messageUrlParams || null, t = e && e.messageHeaders || null, e && e.clientProtocolHeaderRequired && (t ? t["X-Client-Protocol"] = "webchannel" : t = { "X-Client-Protocol": "webchannel" }), this.g.o = t, t = e && e.initMessageHeaders || null, e && e.messageContentType && (t ? t["X-WebChannel-Content-Type"] = e.messageContentType : t = { "X-WebChannel-Content-Type": e.messageContentType }), e && e.va && (t ? t["X-WebChannel-Client-Profile"] = e.va : t = { "X-WebChannel-Client-Profile": e.va }), this.g.S = t, (t = e && e.Sb) && !q(t) && (this.g.m = t), this.v = e && e.supportsCrossDomainXhr || !1, this.u = e && e.sendRawJson || !1, (e = e && e.httpSessionIdParam) && !q(e) && (this.g.D = e, t = this.h, t !== null && e in t && (t = this.h, e in t && delete t[e])), this.j = new dt(this);
2681
+ }
2682
+ w(X, k), X.prototype.m = function() {
2683
+ this.g.l = this.j, this.v && (this.g.J = !0), this.g.connect(this.l, this.h || void 0);
2684
+ }, X.prototype.close = function() {
2685
+ Pe(this.g);
2686
+ }, X.prototype.o = function(t) {
2687
+ var e = this.g;
2688
+ if (typeof t == "string") {
2689
+ var n = {};
2690
+ n.__data__ = t, t = n;
2691
+ } else this.u && (n = {}, n.__data__ = de(t), t = n);
2692
+ e.i.push(new Hi(e.Ya++, t)), e.G == 3 && Zt(e);
2693
+ }, X.prototype.N = function() {
2694
+ this.g.l = null, delete this.j, Pe(this.g), delete this.g, X.aa.N.call(this);
2695
+ };
2696
+ function $n(t) {
2697
+ Te.call(this), t.__headers__ && (this.headers = t.__headers__, this.statusCode = t.__status__, delete t.__headers__, delete t.__status__);
2698
+ var e = t.__sm__;
2699
+ if (e) {
2700
+ t: {
2701
+ for (const n in e) {
2702
+ t = n;
2703
+ break t;
2704
+ }
2705
+ t = void 0;
2706
+ }
2707
+ (this.i = t) && (t = this.i, e = e !== null && t in e ? e[t] : void 0), this.data = e;
2708
+ } else this.data = t;
2709
+ }
2710
+ w($n, Te);
2711
+ function Gn() {
2712
+ me.call(this), this.status = 1;
2713
+ }
2714
+ w(Gn, me);
2715
+ function dt(t) {
2716
+ this.g = t;
2717
+ }
2718
+ w(dt, Qn), dt.prototype.ua = function() {
2719
+ j(this.g, "a");
2720
+ }, dt.prototype.ta = function(t) {
2721
+ j(this.g, new $n(t));
2722
+ }, dt.prototype.sa = function(t) {
2723
+ j(this.g, new Gn());
2724
+ }, dt.prototype.ra = function() {
2725
+ j(this.g, "b");
2726
+ }, X.prototype.send = X.prototype.o, X.prototype.open = X.prototype.m, X.prototype.close = X.prototype.close, Se.NO_ERROR = 0, Se.TIMEOUT = 8, Se.HTTP_ERROR = 6, Fi.COMPLETE = "complete", bi.EventType = wt, wt.OPEN = "a", wt.CLOSE = "b", wt.ERROR = "c", wt.MESSAGE = "d", k.prototype.listen = k.prototype.K, L.prototype.listenOnce = L.prototype.L, L.prototype.getLastError = L.prototype.Ka, L.prototype.getLastErrorCode = L.prototype.Ba, L.prototype.getStatus = L.prototype.Z, L.prototype.getResponseJson = L.prototype.Oa, L.prototype.getResponseText = L.prototype.oa, L.prototype.send = L.prototype.ea, L.prototype.setWithCredentials = L.prototype.Ha;
2727
+ }).apply(typeof ne < "u" ? ne : typeof self < "u" ? self : typeof window < "u" ? window : {});
2728
+ const ii = "@firebase/firestore";
2729
+ /**
2730
+ * @license
2731
+ * Copyright 2017 Google LLC
2732
+ *
2733
+ * Licensed under the Apache License, Version 2.0 (the "License");
2734
+ * you may not use this file except in compliance with the License.
2735
+ * You may obtain a copy of the License at
2736
+ *
2737
+ * http://www.apache.org/licenses/LICENSE-2.0
2738
+ *
2739
+ * Unless required by applicable law or agreed to in writing, software
2740
+ * distributed under the License is distributed on an "AS IS" BASIS,
2741
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2742
+ * See the License for the specific language governing permissions and
2743
+ * limitations under the License.
2744
+ */
2745
+ class Q {
2746
+ constructor(i) {
2747
+ this.uid = i;
2748
+ }
2749
+ isAuthenticated() {
2750
+ return this.uid != null;
2751
+ }
2752
+ /**
2753
+ * Returns a key representing this user, suitable for inclusion in a
2754
+ * dictionary.
2755
+ */
2756
+ toKey() {
2757
+ return this.isAuthenticated() ? "uid:" + this.uid : "anonymous-user";
2758
+ }
2759
+ isEqual(i) {
2760
+ return i.uid === this.uid;
2761
+ }
2762
+ }
2763
+ Q.UNAUTHENTICATED = new Q(null), // TODO(mikelehen): Look into getting a proper uid-equivalent for
2764
+ // non-FirebaseAuth providers.
2765
+ Q.GOOGLE_CREDENTIALS = new Q("google-credentials-uid"), Q.FIRST_PARTY = new Q("first-party-uid"), Q.MOCK_USER = new Q("mock-user");
2766
+ /**
2767
+ * @license
2768
+ * Copyright 2017 Google LLC
2769
+ *
2770
+ * Licensed under the Apache License, Version 2.0 (the "License");
2771
+ * you may not use this file except in compliance with the License.
2772
+ * You may obtain a copy of the License at
2773
+ *
2774
+ * http://www.apache.org/licenses/LICENSE-2.0
2775
+ *
2776
+ * Unless required by applicable law or agreed to in writing, software
2777
+ * distributed under the License is distributed on an "AS IS" BASIS,
2778
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2779
+ * See the License for the specific language governing permissions and
2780
+ * limitations under the License.
2781
+ */
2782
+ let he = "10.13.1";
2783
+ /**
2784
+ * @license
2785
+ * Copyright 2017 Google LLC
2786
+ *
2787
+ * Licensed under the Apache License, Version 2.0 (the "License");
2788
+ * you may not use this file except in compliance with the License.
2789
+ * You may obtain a copy of the License at
2790
+ *
2791
+ * http://www.apache.org/licenses/LICENSE-2.0
2792
+ *
2793
+ * Unless required by applicable law or agreed to in writing, software
2794
+ * distributed under the License is distributed on an "AS IS" BASIS,
2795
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2796
+ * See the License for the specific language governing permissions and
2797
+ * limitations under the License.
2798
+ */
2799
+ const re = new fi("@firebase/firestore");
2800
+ function K(r, ...i) {
2801
+ if (re.logLevel <= D.DEBUG) {
2802
+ const o = i.map(Ti);
2803
+ re.debug(`Firestore (${he}): ${r}`, ...o);
2804
+ }
2805
+ }
2806
+ function Ge(r, ...i) {
2807
+ if (re.logLevel <= D.ERROR) {
2808
+ const o = i.map(Ti);
2809
+ re.error(`Firestore (${he}): ${r}`, ...o);
2810
+ }
2811
+ }
2812
+ function Ti(r) {
2813
+ if (typeof r == "string") return r;
2814
+ try {
2815
+ /**
2816
+ * @license
2817
+ * Copyright 2020 Google LLC
2818
+ *
2819
+ * Licensed under the Apache License, Version 2.0 (the "License");
2820
+ * you may not use this file except in compliance with the License.
2821
+ * You may obtain a copy of the License at
2822
+ *
2823
+ * http://www.apache.org/licenses/LICENSE-2.0
2824
+ *
2825
+ * Unless required by applicable law or agreed to in writing, software
2826
+ * distributed under the License is distributed on an "AS IS" BASIS,
2827
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2828
+ * See the License for the specific language governing permissions and
2829
+ * limitations under the License.
2830
+ */
2831
+ return function(o) {
2832
+ return JSON.stringify(o);
2833
+ }(r);
2834
+ } catch {
2835
+ return r;
2836
+ }
2837
+ }
2838
+ /**
2839
+ * @license
2840
+ * Copyright 2017 Google LLC
2841
+ *
2842
+ * Licensed under the Apache License, Version 2.0 (the "License");
2843
+ * you may not use this file except in compliance with the License.
2844
+ * You may obtain a copy of the License at
2845
+ *
2846
+ * http://www.apache.org/licenses/LICENSE-2.0
2847
+ *
2848
+ * Unless required by applicable law or agreed to in writing, software
2849
+ * distributed under the License is distributed on an "AS IS" BASIS,
2850
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2851
+ * See the License for the specific language governing permissions and
2852
+ * limitations under the License.
2853
+ */
2854
+ function mi(r = "Unexpected state") {
2855
+ const i = `FIRESTORE (${he}) INTERNAL ASSERTION FAILED: ` + r;
2856
+ throw Ge(i), new Error(i);
2857
+ }
2858
+ function Ve(r, i) {
2859
+ r || mi();
2860
+ }
2861
+ /**
2862
+ * @license
2863
+ * Copyright 2017 Google LLC
2864
+ *
2865
+ * Licensed under the Apache License, Version 2.0 (the "License");
2866
+ * you may not use this file except in compliance with the License.
2867
+ * You may obtain a copy of the License at
2868
+ *
2869
+ * http://www.apache.org/licenses/LICENSE-2.0
2870
+ *
2871
+ * Unless required by applicable law or agreed to in writing, software
2872
+ * distributed under the License is distributed on an "AS IS" BASIS,
2873
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2874
+ * See the License for the specific language governing permissions and
2875
+ * limitations under the License.
2876
+ */
2877
+ const $ = {
2878
+ // Causes are copied from:
2879
+ // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h
2880
+ /** Not an error; returned on success. */
2881
+ OK: "ok",
2882
+ /** The operation was cancelled (typically by the caller). */
2883
+ CANCELLED: "cancelled",
2884
+ /** Unknown error or an error from a different error domain. */
2885
+ UNKNOWN: "unknown",
2886
+ /**
2887
+ * Client specified an invalid argument. Note that this differs from
2888
+ * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are
2889
+ * problematic regardless of the state of the system (e.g., a malformed file
2890
+ * name).
2891
+ */
2892
+ INVALID_ARGUMENT: "invalid-argument",
2893
+ /**
2894
+ * Deadline expired before operation could complete. For operations that
2895
+ * change the state of the system, this error may be returned even if the
2896
+ * operation has completed successfully. For example, a successful response
2897
+ * from a server could have been delayed long enough for the deadline to
2898
+ * expire.
2899
+ */
2900
+ DEADLINE_EXCEEDED: "deadline-exceeded",
2901
+ /** Some requested entity (e.g., file or directory) was not found. */
2902
+ NOT_FOUND: "not-found",
2903
+ /**
2904
+ * Some entity that we attempted to create (e.g., file or directory) already
2905
+ * exists.
2906
+ */
2907
+ ALREADY_EXISTS: "already-exists",
2908
+ /**
2909
+ * The caller does not have permission to execute the specified operation.
2910
+ * PERMISSION_DENIED must not be used for rejections caused by exhausting
2911
+ * some resource (use RESOURCE_EXHAUSTED instead for those errors).
2912
+ * PERMISSION_DENIED must not be used if the caller cannot be identified
2913
+ * (use UNAUTHENTICATED instead for those errors).
2914
+ */
2915
+ PERMISSION_DENIED: "permission-denied",
2916
+ /**
2917
+ * The request does not have valid authentication credentials for the
2918
+ * operation.
2919
+ */
2920
+ UNAUTHENTICATED: "unauthenticated",
2921
+ /**
2922
+ * Some resource has been exhausted, perhaps a per-user quota, or perhaps the
2923
+ * entire file system is out of space.
2924
+ */
2925
+ RESOURCE_EXHAUSTED: "resource-exhausted",
2926
+ /**
2927
+ * Operation was rejected because the system is not in a state required for
2928
+ * the operation's execution. For example, directory to be deleted may be
2929
+ * non-empty, an rmdir operation is applied to a non-directory, etc.
2930
+ *
2931
+ * A litmus test that may help a service implementor in deciding
2932
+ * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
2933
+ * (a) Use UNAVAILABLE if the client can retry just the failing call.
2934
+ * (b) Use ABORTED if the client should retry at a higher-level
2935
+ * (e.g., restarting a read-modify-write sequence).
2936
+ * (c) Use FAILED_PRECONDITION if the client should not retry until
2937
+ * the system state has been explicitly fixed. E.g., if an "rmdir"
2938
+ * fails because the directory is non-empty, FAILED_PRECONDITION
2939
+ * should be returned since the client should not retry unless
2940
+ * they have first fixed up the directory by deleting files from it.
2941
+ * (d) Use FAILED_PRECONDITION if the client performs conditional
2942
+ * REST Get/Update/Delete on a resource and the resource on the
2943
+ * server does not match the condition. E.g., conflicting
2944
+ * read-modify-write on the same resource.
2945
+ */
2946
+ FAILED_PRECONDITION: "failed-precondition",
2947
+ /**
2948
+ * The operation was aborted, typically due to a concurrency issue like
2949
+ * sequencer check failures, transaction aborts, etc.
2950
+ *
2951
+ * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
2952
+ * and UNAVAILABLE.
2953
+ */
2954
+ ABORTED: "aborted",
2955
+ /**
2956
+ * Operation was attempted past the valid range. E.g., seeking or reading
2957
+ * past end of file.
2958
+ *
2959
+ * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed
2960
+ * if the system state changes. For example, a 32-bit file system will
2961
+ * generate INVALID_ARGUMENT if asked to read at an offset that is not in the
2962
+ * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from
2963
+ * an offset past the current file size.
2964
+ *
2965
+ * There is a fair bit of overlap between FAILED_PRECONDITION and
2966
+ * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)
2967
+ * when it applies so that callers who are iterating through a space can
2968
+ * easily look for an OUT_OF_RANGE error to detect when they are done.
2969
+ */
2970
+ OUT_OF_RANGE: "out-of-range",
2971
+ /** Operation is not implemented or not supported/enabled in this service. */
2972
+ UNIMPLEMENTED: "unimplemented",
2973
+ /**
2974
+ * Internal errors. Means some invariants expected by underlying System has
2975
+ * been broken. If you see one of these errors, Something is very broken.
2976
+ */
2977
+ INTERNAL: "internal",
2978
+ /**
2979
+ * The service is currently unavailable. This is a most likely a transient
2980
+ * condition and may be corrected by retrying with a backoff.
2981
+ *
2982
+ * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
2983
+ * and UNAVAILABLE.
2984
+ */
2985
+ UNAVAILABLE: "unavailable",
2986
+ /** Unrecoverable data loss or corruption. */
2987
+ DATA_LOSS: "data-loss"
2988
+ };
2989
+ class G extends yt {
2990
+ /** @hideconstructor */
2991
+ constructor(i, o) {
2992
+ super(i, o), this.code = i, this.message = o, // HACK: We write a toString property directly because Error is not a real
2993
+ // class and so inheritance does not work correctly. We could alternatively
2994
+ // do the same "back-door inheritance" trick that FirebaseError does.
2995
+ this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;
2996
+ }
2997
+ }
2998
+ /**
2999
+ * @license
3000
+ * Copyright 2017 Google LLC
3001
+ *
3002
+ * Licensed under the Apache License, Version 2.0 (the "License");
3003
+ * you may not use this file except in compliance with the License.
3004
+ * You may obtain a copy of the License at
3005
+ *
3006
+ * http://www.apache.org/licenses/LICENSE-2.0
3007
+ *
3008
+ * Unless required by applicable law or agreed to in writing, software
3009
+ * distributed under the License is distributed on an "AS IS" BASIS,
3010
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3011
+ * See the License for the specific language governing permissions and
3012
+ * limitations under the License.
3013
+ */
3014
+ class mt {
3015
+ constructor() {
3016
+ this.promise = new Promise((i, o) => {
3017
+ this.resolve = i, this.reject = o;
3018
+ });
3019
+ }
3020
+ }
3021
+ /**
3022
+ * @license
3023
+ * Copyright 2017 Google LLC
3024
+ *
3025
+ * Licensed under the Apache License, Version 2.0 (the "License");
3026
+ * you may not use this file except in compliance with the License.
3027
+ * You may obtain a copy of the License at
3028
+ *
3029
+ * http://www.apache.org/licenses/LICENSE-2.0
3030
+ *
3031
+ * Unless required by applicable law or agreed to in writing, software
3032
+ * distributed under the License is distributed on an "AS IS" BASIS,
3033
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3034
+ * See the License for the specific language governing permissions and
3035
+ * limitations under the License.
3036
+ */
3037
+ class yr {
3038
+ constructor(i, o) {
3039
+ this.user = o, this.type = "OAuth", this.headers = /* @__PURE__ */ new Map(), this.headers.set("Authorization", `Bearer ${i}`);
3040
+ }
3041
+ }
3042
+ class Sr {
3043
+ getToken() {
3044
+ return Promise.resolve(null);
3045
+ }
3046
+ invalidateToken() {
3047
+ }
3048
+ start(i, o) {
3049
+ i.enqueueRetryable(() => o(Q.UNAUTHENTICATED));
3050
+ }
3051
+ shutdown() {
3052
+ }
3053
+ }
3054
+ class vr {
3055
+ constructor(i) {
3056
+ this.t = i, /** Tracks the current User. */
3057
+ this.currentUser = Q.UNAUTHENTICATED, /**
3058
+ * Counter used to detect if the token changed while a getToken request was
3059
+ * outstanding.
3060
+ */
3061
+ this.i = 0, this.forceRefresh = !1, this.auth = null;
3062
+ }
3063
+ start(i, o) {
3064
+ let c = this.i;
3065
+ const d = (v) => this.i !== c ? (c = this.i, o(v)) : Promise.resolve();
3066
+ let T = new mt();
3067
+ this.o = () => {
3068
+ this.i++, this.currentUser = this.u(), T.resolve(), T = new mt(), i.enqueueRetryable(() => d(this.currentUser));
3069
+ };
3070
+ const m = () => {
3071
+ const v = T;
3072
+ i.enqueueRetryable(async () => {
3073
+ await v.promise, await d(this.currentUser);
3074
+ });
3075
+ }, y = (v) => {
3076
+ K("FirebaseAuthCredentialsProvider", "Auth detected"), this.auth = v, this.auth.addAuthTokenListener(this.o), m();
3077
+ };
3078
+ this.t.onInit((v) => y(v)), // Our users can initialize Auth right after Firestore, so we give it
3079
+ // a chance to register itself with the component framework before we
3080
+ // determine whether to start up in unauthenticated mode.
3081
+ setTimeout(() => {
3082
+ if (!this.auth) {
3083
+ const v = this.t.getImmediate({
3084
+ optional: !0
3085
+ });
3086
+ v ? y(v) : (
3087
+ // If auth is still not available, proceed with `null` user
3088
+ (K("FirebaseAuthCredentialsProvider", "Auth not yet detected"), T.resolve(), T = new mt())
3089
+ );
3090
+ }
3091
+ }, 0), m();
3092
+ }
3093
+ getToken() {
3094
+ const i = this.i, o = this.forceRefresh;
3095
+ return this.forceRefresh = !1, this.auth ? this.auth.getToken(o).then((c) => (
3096
+ // Cancel the request since the token changed while the request was
3097
+ // outstanding so the response is potentially for a previous user (which
3098
+ // user, we can't be sure).
3099
+ this.i !== i ? (K("FirebaseAuthCredentialsProvider", "getToken aborted due to token change."), this.getToken()) : c ? (Ve(typeof c.accessToken == "string"), new yr(c.accessToken, this.currentUser)) : null
3100
+ )) : Promise.resolve(null);
3101
+ }
3102
+ invalidateToken() {
3103
+ this.forceRefresh = !0;
3104
+ }
3105
+ shutdown() {
3106
+ this.auth && this.auth.removeAuthTokenListener(this.o);
3107
+ }
3108
+ // Auth.getUid() can return null even with a user logged in. It is because
3109
+ // getUid() is synchronous, but the auth code populating Uid is asynchronous.
3110
+ // This method should only be called in the AuthTokenListener callback
3111
+ // to guarantee to get the actual user.
3112
+ u() {
3113
+ const i = this.auth && this.auth.getUid();
3114
+ return Ve(i === null || typeof i == "string"), new Q(i);
3115
+ }
3116
+ }
3117
+ class Ar {
3118
+ constructor(i, o, c) {
3119
+ this.l = i, this.h = o, this.P = c, this.type = "FirstParty", this.user = Q.FIRST_PARTY, this.I = /* @__PURE__ */ new Map();
3120
+ }
3121
+ /**
3122
+ * Gets an authorization token, using a provided factory function, or return
3123
+ * null.
3124
+ */
3125
+ T() {
3126
+ return this.P ? this.P() : null;
3127
+ }
3128
+ get headers() {
3129
+ this.I.set("X-Goog-AuthUser", this.l);
3130
+ const i = this.T();
3131
+ return i && this.I.set("Authorization", i), this.h && this.I.set("X-Goog-Iam-Authorization-Token", this.h), this.I;
3132
+ }
3133
+ }
3134
+ class Rr {
3135
+ constructor(i, o, c) {
3136
+ this.l = i, this.h = o, this.P = c;
3137
+ }
3138
+ getToken() {
3139
+ return Promise.resolve(new Ar(this.l, this.h, this.P));
3140
+ }
3141
+ start(i, o) {
3142
+ i.enqueueRetryable(() => o(Q.FIRST_PARTY));
3143
+ }
3144
+ shutdown() {
3145
+ }
3146
+ invalidateToken() {
3147
+ }
3148
+ }
3149
+ class Ir {
3150
+ constructor(i) {
3151
+ this.value = i, this.type = "AppCheck", this.headers = /* @__PURE__ */ new Map(), i && i.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
3152
+ }
3153
+ }
3154
+ class wr {
3155
+ constructor(i) {
3156
+ this.A = i, this.forceRefresh = !1, this.appCheck = null, this.R = null;
3157
+ }
3158
+ start(i, o) {
3159
+ const c = (T) => {
3160
+ T.error != null && K("FirebaseAppCheckTokenProvider", `Error getting App Check token; using placeholder token instead. Error: ${T.error.message}`);
3161
+ const m = T.token !== this.R;
3162
+ return this.R = T.token, K("FirebaseAppCheckTokenProvider", `Received ${m ? "new" : "existing"} token.`), m ? o(T.token) : Promise.resolve();
3163
+ };
3164
+ this.o = (T) => {
3165
+ i.enqueueRetryable(() => c(T));
3166
+ };
3167
+ const d = (T) => {
3168
+ K("FirebaseAppCheckTokenProvider", "AppCheck detected"), this.appCheck = T, this.appCheck.addTokenListener(this.o);
3169
+ };
3170
+ this.A.onInit((T) => d(T)), // Our users can initialize AppCheck after Firestore, so we give it
3171
+ // a chance to register itself with the component framework.
3172
+ setTimeout(() => {
3173
+ if (!this.appCheck) {
3174
+ const T = this.A.getImmediate({
3175
+ optional: !0
3176
+ });
3177
+ T ? d(T) : (
3178
+ // If AppCheck is still not available, proceed without it.
3179
+ K("FirebaseAppCheckTokenProvider", "AppCheck not yet detected")
3180
+ );
3181
+ }
3182
+ }, 0);
3183
+ }
3184
+ getToken() {
3185
+ const i = this.forceRefresh;
3186
+ return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(i).then((o) => o ? (Ve(typeof o.token == "string"), this.R = o.token, new Ir(o.token)) : null) : Promise.resolve(null);
3187
+ }
3188
+ invalidateToken() {
3189
+ this.forceRefresh = !0;
3190
+ }
3191
+ shutdown() {
3192
+ this.appCheck && this.appCheck.removeTokenListener(this.o);
3193
+ }
3194
+ }
3195
+ /**
3196
+ * @license
3197
+ * Copyright 2020 Google LLC
3198
+ *
3199
+ * Licensed under the Apache License, Version 2.0 (the "License");
3200
+ * you may not use this file except in compliance with the License.
3201
+ * You may obtain a copy of the License at
3202
+ *
3203
+ * http://www.apache.org/licenses/LICENSE-2.0
3204
+ *
3205
+ * Unless required by applicable law or agreed to in writing, software
3206
+ * distributed under the License is distributed on an "AS IS" BASIS,
3207
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3208
+ * See the License for the specific language governing permissions and
3209
+ * limitations under the License.
3210
+ */
3211
+ function Cr(r) {
3212
+ const i = (
3213
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3214
+ typeof self < "u" && (self.crypto || self.msCrypto)
3215
+ ), o = new Uint8Array(r);
3216
+ if (i && typeof i.getRandomValues == "function") i.getRandomValues(o);
3217
+ else
3218
+ for (let c = 0; c < r; c++) o[c] = Math.floor(256 * Math.random());
3219
+ return o;
3220
+ }
3221
+ /**
3222
+ * @license
3223
+ * Copyright 2017 Google LLC
3224
+ *
3225
+ * Licensed under the Apache License, Version 2.0 (the "License");
3226
+ * you may not use this file except in compliance with the License.
3227
+ * You may obtain a copy of the License at
3228
+ *
3229
+ * http://www.apache.org/licenses/LICENSE-2.0
3230
+ *
3231
+ * Unless required by applicable law or agreed to in writing, software
3232
+ * distributed under the License is distributed on an "AS IS" BASIS,
3233
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3234
+ * See the License for the specific language governing permissions and
3235
+ * limitations under the License.
3236
+ */
3237
+ class Dr {
3238
+ static newId() {
3239
+ const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", o = Math.floor(256 / i.length) * i.length;
3240
+ let c = "";
3241
+ for (; c.length < 20; ) {
3242
+ const d = Cr(40);
3243
+ for (let T = 0; T < d.length; ++T)
3244
+ c.length < 20 && d[T] < o && (c += i.charAt(d[T] % i.length));
3245
+ }
3246
+ return c;
3247
+ }
3248
+ }
3249
+ function yi(r) {
3250
+ return r.name === "IndexedDbTransactionError";
3251
+ }
3252
+ /**
3253
+ * @license
3254
+ * Copyright 2017 Google LLC
3255
+ *
3256
+ * Licensed under the Apache License, Version 2.0 (the "License");
3257
+ * you may not use this file except in compliance with the License.
3258
+ * You may obtain a copy of the License at
3259
+ *
3260
+ * http://www.apache.org/licenses/LICENSE-2.0
3261
+ *
3262
+ * Unless required by applicable law or agreed to in writing, software
3263
+ * distributed under the License is distributed on an "AS IS" BASIS,
3264
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3265
+ * See the License for the specific language governing permissions and
3266
+ * limitations under the License.
3267
+ */
3268
+ class Or {
3269
+ /**
3270
+ * Constructs a DatabaseInfo using the provided host, databaseId and
3271
+ * persistenceKey.
3272
+ *
3273
+ * @param databaseId - The database to use.
3274
+ * @param appId - The Firebase App Id.
3275
+ * @param persistenceKey - A unique identifier for this Firestore's local
3276
+ * storage (used in conjunction with the databaseId).
3277
+ * @param host - The Firestore backend host to connect to.
3278
+ * @param ssl - Whether to use SSL when connecting.
3279
+ * @param forceLongPolling - Whether to use the forceLongPolling option
3280
+ * when using WebChannel as the network transport.
3281
+ * @param autoDetectLongPolling - Whether to use the detectBufferingProxy
3282
+ * option when using WebChannel as the network transport.
3283
+ * @param longPollingOptions Options that configure long-polling.
3284
+ * @param useFetchStreams Whether to use the Fetch API instead of
3285
+ * XMLHTTPRequest
3286
+ */
3287
+ constructor(i, o, c, d, T, m, y, v, A) {
3288
+ this.databaseId = i, this.appId = o, this.persistenceKey = c, this.host = d, this.ssl = T, this.forceLongPolling = m, this.autoDetectLongPolling = y, this.longPollingOptions = v, this.useFetchStreams = A;
3289
+ }
3290
+ }
3291
+ class oe {
3292
+ constructor(i, o) {
3293
+ this.projectId = i, this.database = o || "(default)";
3294
+ }
3295
+ static empty() {
3296
+ return new oe("", "");
3297
+ }
3298
+ get isDefaultDatabase() {
3299
+ return this.database === "(default)";
3300
+ }
3301
+ isEqual(i) {
3302
+ return i instanceof oe && i.projectId === this.projectId && i.database === this.database;
3303
+ }
3304
+ }
3305
+ /**
3306
+ * @license
3307
+ * Copyright 2017 Google LLC
3308
+ *
3309
+ * Licensed under the Apache License, Version 2.0 (the "License");
3310
+ * you may not use this file except in compliance with the License.
3311
+ * You may obtain a copy of the License at
3312
+ *
3313
+ * http://www.apache.org/licenses/LICENSE-2.0
3314
+ *
3315
+ * Unless required by applicable law or agreed to in writing, software
3316
+ * distributed under the License is distributed on an "AS IS" BASIS,
3317
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3318
+ * See the License for the specific language governing permissions and
3319
+ * limitations under the License.
3320
+ */
3321
+ var si, R;
3322
+ (R = si || (si = {}))[R.OK = 0] = "OK", R[R.CANCELLED = 1] = "CANCELLED", R[R.UNKNOWN = 2] = "UNKNOWN", R[R.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", R[R.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", R[R.NOT_FOUND = 5] = "NOT_FOUND", R[R.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", R[R.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", R[R.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", R[R.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", R[R.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", R[R.ABORTED = 10] = "ABORTED", R[R.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", R[R.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", R[R.INTERNAL = 13] = "INTERNAL", R[R.UNAVAILABLE = 14] = "UNAVAILABLE", R[R.DATA_LOSS = 15] = "DATA_LOSS";
3323
+ /**
3324
+ * @license
3325
+ * Copyright 2022 Google LLC
3326
+ *
3327
+ * Licensed under the Apache License, Version 2.0 (the "License");
3328
+ * you may not use this file except in compliance with the License.
3329
+ * You may obtain a copy of the License at
3330
+ *
3331
+ * http://www.apache.org/licenses/LICENSE-2.0
3332
+ *
3333
+ * Unless required by applicable law or agreed to in writing, software
3334
+ * distributed under the License is distributed on an "AS IS" BASIS,
3335
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3336
+ * See the License for the specific language governing permissions and
3337
+ * limitations under the License.
3338
+ */
3339
+ new _i([4294967295, 4294967295], 0);
3340
+ function xe() {
3341
+ return typeof document < "u" ? document : null;
3342
+ }
3343
+ /**
3344
+ * @license
3345
+ * Copyright 2017 Google LLC
3346
+ *
3347
+ * Licensed under the Apache License, Version 2.0 (the "License");
3348
+ * you may not use this file except in compliance with the License.
3349
+ * You may obtain a copy of the License at
3350
+ *
3351
+ * http://www.apache.org/licenses/LICENSE-2.0
3352
+ *
3353
+ * Unless required by applicable law or agreed to in writing, software
3354
+ * distributed under the License is distributed on an "AS IS" BASIS,
3355
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3356
+ * See the License for the specific language governing permissions and
3357
+ * limitations under the License.
3358
+ */
3359
+ class Pr {
3360
+ constructor(i, o, c = 1e3, d = 1.5, T = 6e4) {
3361
+ this.ui = i, this.timerId = o, this.ko = c, this.qo = d, this.Qo = T, this.Ko = 0, this.$o = null, /** The last backoff attempt, as epoch milliseconds. */
3362
+ this.Uo = Date.now(), this.reset();
3363
+ }
3364
+ /**
3365
+ * Resets the backoff delay.
3366
+ *
3367
+ * The very next backoffAndWait() will have no delay. If it is called again
3368
+ * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and
3369
+ * subsequent ones will increase according to the backoffFactor.
3370
+ */
3371
+ reset() {
3372
+ this.Ko = 0;
3373
+ }
3374
+ /**
3375
+ * Resets the backoff delay to the maximum delay (e.g. for use after a
3376
+ * RESOURCE_EXHAUSTED error).
3377
+ */
3378
+ Wo() {
3379
+ this.Ko = this.Qo;
3380
+ }
3381
+ /**
3382
+ * Returns a promise that resolves after currentDelayMs, and increases the
3383
+ * delay for any subsequent attempts. If there was a pending backoff operation
3384
+ * already, it will be canceled.
3385
+ */
3386
+ Go(i) {
3387
+ this.cancel();
3388
+ const o = Math.floor(this.Ko + this.zo()), c = Math.max(0, Date.now() - this.Uo), d = Math.max(0, o - c);
3389
+ d > 0 && K("ExponentialBackoff", `Backing off for ${d} ms (base delay: ${this.Ko} ms, delay with jitter: ${o} ms, last attempt: ${c} ms ago)`), this.$o = this.ui.enqueueAfterDelay(this.timerId, d, () => (this.Uo = Date.now(), i())), // Apply backoff factor to determine next delay and ensure it is within
3390
+ // bounds.
3391
+ this.Ko *= this.qo, this.Ko < this.ko && (this.Ko = this.ko), this.Ko > this.Qo && (this.Ko = this.Qo);
3392
+ }
3393
+ jo() {
3394
+ this.$o !== null && (this.$o.skipDelay(), this.$o = null);
3395
+ }
3396
+ cancel() {
3397
+ this.$o !== null && (this.$o.cancel(), this.$o = null);
3398
+ }
3399
+ /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */
3400
+ zo() {
3401
+ return (Math.random() - 0.5) * this.Ko;
3402
+ }
3403
+ }
3404
+ /**
3405
+ * @license
3406
+ * Copyright 2017 Google LLC
3407
+ *
3408
+ * Licensed under the Apache License, Version 2.0 (the "License");
3409
+ * you may not use this file except in compliance with the License.
3410
+ * You may obtain a copy of the License at
3411
+ *
3412
+ * http://www.apache.org/licenses/LICENSE-2.0
3413
+ *
3414
+ * Unless required by applicable law or agreed to in writing, software
3415
+ * distributed under the License is distributed on an "AS IS" BASIS,
3416
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3417
+ * See the License for the specific language governing permissions and
3418
+ * limitations under the License.
3419
+ */
3420
+ class Ke {
3421
+ constructor(i, o, c, d, T) {
3422
+ this.asyncQueue = i, this.timerId = o, this.targetTimeMs = c, this.op = d, this.removalCallback = T, this.deferred = new mt(), this.then = this.deferred.promise.then.bind(this.deferred.promise), // It's normal for the deferred promise to be canceled (due to cancellation)
3423
+ // and so we attach a dummy catch callback to avoid
3424
+ // 'UnhandledPromiseRejectionWarning' log spam.
3425
+ this.deferred.promise.catch((m) => {
3426
+ });
3427
+ }
3428
+ get promise() {
3429
+ return this.deferred.promise;
3430
+ }
3431
+ /**
3432
+ * Creates and returns a DelayedOperation that has been scheduled to be
3433
+ * executed on the provided asyncQueue after the provided delayMs.
3434
+ *
3435
+ * @param asyncQueue - The queue to schedule the operation on.
3436
+ * @param id - A Timer ID identifying the type of operation this is.
3437
+ * @param delayMs - The delay (ms) before the operation should be scheduled.
3438
+ * @param op - The operation to run.
3439
+ * @param removalCallback - A callback to be called synchronously once the
3440
+ * operation is executed or canceled, notifying the AsyncQueue to remove it
3441
+ * from its delayedOperations list.
3442
+ * PORTING NOTE: This exists to prevent making removeDelayedOperation() and
3443
+ * the DelayedOperation class public.
3444
+ */
3445
+ static createAndSchedule(i, o, c, d, T) {
3446
+ const m = Date.now() + c, y = new Ke(i, o, m, d, T);
3447
+ return y.start(c), y;
3448
+ }
3449
+ /**
3450
+ * Starts the timer. This is called immediately after construction by
3451
+ * createAndSchedule().
3452
+ */
3453
+ start(i) {
3454
+ this.timerHandle = setTimeout(() => this.handleDelayElapsed(), i);
3455
+ }
3456
+ /**
3457
+ * Queues the operation to run immediately (if it hasn't already been run or
3458
+ * canceled).
3459
+ */
3460
+ skipDelay() {
3461
+ return this.handleDelayElapsed();
3462
+ }
3463
+ /**
3464
+ * Cancels the operation if it hasn't already been executed or canceled. The
3465
+ * promise will be rejected.
3466
+ *
3467
+ * As long as the operation has not yet been run, calling cancel() provides a
3468
+ * guarantee that the operation will not be run.
3469
+ */
3470
+ cancel(i) {
3471
+ this.timerHandle !== null && (this.clearTimeout(), this.deferred.reject(new G($.CANCELLED, "Operation cancelled" + (i ? ": " + i : ""))));
3472
+ }
3473
+ handleDelayElapsed() {
3474
+ this.asyncQueue.enqueueAndForget(() => this.timerHandle !== null ? (this.clearTimeout(), this.op().then((i) => this.deferred.resolve(i))) : Promise.resolve());
3475
+ }
3476
+ clearTimeout() {
3477
+ this.timerHandle !== null && (this.removalCallback(this), clearTimeout(this.timerHandle), this.timerHandle = null);
3478
+ }
3479
+ }
3480
+ function Lr(r, i) {
3481
+ if (Ge("AsyncQueue", `${i}: ${r}`), yi(r)) return new G($.UNAVAILABLE, `${i}: ${r}`);
3482
+ throw r;
3483
+ }
3484
+ var ri, oi;
3485
+ (oi = ri || (ri = {})).ea = "default", /** Listen to changes in cache only */
3486
+ oi.Cache = "cache";
3487
+ /**
3488
+ * @license
3489
+ * Copyright 2017 Google LLC
3490
+ *
3491
+ * Licensed under the Apache License, Version 2.0 (the "License");
3492
+ * you may not use this file except in compliance with the License.
3493
+ * You may obtain a copy of the License at
3494
+ *
3495
+ * http://www.apache.org/licenses/LICENSE-2.0
3496
+ *
3497
+ * Unless required by applicable law or agreed to in writing, software
3498
+ * distributed under the License is distributed on an "AS IS" BASIS,
3499
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3500
+ * See the License for the specific language governing permissions and
3501
+ * limitations under the License.
3502
+ */
3503
+ class Nr {
3504
+ constructor(i, o, c, d) {
3505
+ this.authCredentials = i, this.appCheckCredentials = o, this.asyncQueue = c, this.databaseInfo = d, this.user = Q.UNAUTHENTICATED, this.clientId = Dr.newId(), this.authCredentialListener = () => Promise.resolve(), this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(c, async (T) => {
3506
+ K("FirestoreClient", "Received user=", T.uid), await this.authCredentialListener(T), this.user = T;
3507
+ }), this.appCheckCredentials.start(c, (T) => (K("FirestoreClient", "Received new app check token=", T), this.appCheckCredentialListener(T, this.user)));
3508
+ }
3509
+ get configuration() {
3510
+ return {
3511
+ asyncQueue: this.asyncQueue,
3512
+ databaseInfo: this.databaseInfo,
3513
+ clientId: this.clientId,
3514
+ authCredentials: this.authCredentials,
3515
+ appCheckCredentials: this.appCheckCredentials,
3516
+ initialUser: this.user,
3517
+ maxConcurrentLimboResolutions: 100
3518
+ };
3519
+ }
3520
+ setCredentialChangeListener(i) {
3521
+ this.authCredentialListener = i;
3522
+ }
3523
+ setAppCheckTokenChangeListener(i) {
3524
+ this.appCheckCredentialListener = i;
3525
+ }
3526
+ /**
3527
+ * Checks that the client has not been terminated. Ensures that other methods on //
3528
+ * this class cannot be called after the client is terminated. //
3529
+ */
3530
+ verifyNotTerminated() {
3531
+ if (this.asyncQueue.isShuttingDown) throw new G($.FAILED_PRECONDITION, "The client has already been terminated.");
3532
+ }
3533
+ terminate() {
3534
+ this.asyncQueue.enterRestrictedMode();
3535
+ const i = new mt();
3536
+ return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async () => {
3537
+ try {
3538
+ this._onlineComponents && await this._onlineComponents.terminate(), this._offlineComponents && await this._offlineComponents.terminate(), // The credentials provider must be terminated after shutting down the
3539
+ // RemoteStore as it will prevent the RemoteStore from retrieving auth
3540
+ // tokens.
3541
+ this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), i.resolve();
3542
+ } catch (o) {
3543
+ const c = Lr(o, "Failed to shutdown persistence");
3544
+ i.reject(c);
3545
+ }
3546
+ }), i.promise;
3547
+ }
3548
+ }
3549
+ /**
3550
+ * @license
3551
+ * Copyright 2023 Google LLC
3552
+ *
3553
+ * Licensed under the Apache License, Version 2.0 (the "License");
3554
+ * you may not use this file except in compliance with the License.
3555
+ * You may obtain a copy of the License at
3556
+ *
3557
+ * http://www.apache.org/licenses/LICENSE-2.0
3558
+ *
3559
+ * Unless required by applicable law or agreed to in writing, software
3560
+ * distributed under the License is distributed on an "AS IS" BASIS,
3561
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3562
+ * See the License for the specific language governing permissions and
3563
+ * limitations under the License.
3564
+ */
3565
+ function Si(r) {
3566
+ const i = {};
3567
+ return r.timeoutSeconds !== void 0 && (i.timeoutSeconds = r.timeoutSeconds), i;
3568
+ }
3569
+ /**
3570
+ * @license
3571
+ * Copyright 2020 Google LLC
3572
+ *
3573
+ * Licensed under the Apache License, Version 2.0 (the "License");
3574
+ * you may not use this file except in compliance with the License.
3575
+ * You may obtain a copy of the License at
3576
+ *
3577
+ * http://www.apache.org/licenses/LICENSE-2.0
3578
+ *
3579
+ * Unless required by applicable law or agreed to in writing, software
3580
+ * distributed under the License is distributed on an "AS IS" BASIS,
3581
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3582
+ * See the License for the specific language governing permissions and
3583
+ * limitations under the License.
3584
+ */
3585
+ const hi = /* @__PURE__ */ new Map();
3586
+ function Ur(r, i, o, c) {
3587
+ if (i === !0 && c === !0) throw new G($.INVALID_ARGUMENT, `${r} and ${o} cannot be used together.`);
3588
+ }
3589
+ /**
3590
+ * @license
3591
+ * Copyright 2020 Google LLC
3592
+ *
3593
+ * Licensed under the Apache License, Version 2.0 (the "License");
3594
+ * you may not use this file except in compliance with the License.
3595
+ * You may obtain a copy of the License at
3596
+ *
3597
+ * http://www.apache.org/licenses/LICENSE-2.0
3598
+ *
3599
+ * Unless required by applicable law or agreed to in writing, software
3600
+ * distributed under the License is distributed on an "AS IS" BASIS,
3601
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3602
+ * See the License for the specific language governing permissions and
3603
+ * limitations under the License.
3604
+ */
3605
+ class ai {
3606
+ constructor(i) {
3607
+ var o, c;
3608
+ if (i.host === void 0) {
3609
+ if (i.ssl !== void 0) throw new G($.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set");
3610
+ this.host = "firestore.googleapis.com", this.ssl = !0;
3611
+ } else this.host = i.host, this.ssl = (o = i.ssl) === null || o === void 0 || o;
3612
+ if (this.credentials = i.credentials, this.ignoreUndefinedProperties = !!i.ignoreUndefinedProperties, this.localCache = i.localCache, i.cacheSizeBytes === void 0) this.cacheSizeBytes = 41943040;
3613
+ else {
3614
+ if (i.cacheSizeBytes !== -1 && i.cacheSizeBytes < 1048576) throw new G($.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
3615
+ this.cacheSizeBytes = i.cacheSizeBytes;
3616
+ }
3617
+ Ur("experimentalForceLongPolling", i.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", i.experimentalAutoDetectLongPolling), this.experimentalForceLongPolling = !!i.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : i.experimentalAutoDetectLongPolling === void 0 ? this.experimentalAutoDetectLongPolling = !0 : (
3618
+ // For backwards compatibility, coerce the value to boolean even though
3619
+ // the TypeScript compiler has narrowed the type to boolean already.
3620
+ // noinspection PointlessBooleanExpressionJS
3621
+ this.experimentalAutoDetectLongPolling = !!i.experimentalAutoDetectLongPolling
3622
+ ), this.experimentalLongPollingOptions = Si((c = i.experimentalLongPollingOptions) !== null && c !== void 0 ? c : {}), function(T) {
3623
+ if (T.timeoutSeconds !== void 0) {
3624
+ if (isNaN(T.timeoutSeconds)) throw new G($.INVALID_ARGUMENT, `invalid long polling timeout: ${T.timeoutSeconds} (must not be NaN)`);
3625
+ if (T.timeoutSeconds < 5) throw new G($.INVALID_ARGUMENT, `invalid long polling timeout: ${T.timeoutSeconds} (minimum allowed value is 5)`);
3626
+ if (T.timeoutSeconds > 30) throw new G($.INVALID_ARGUMENT, `invalid long polling timeout: ${T.timeoutSeconds} (maximum allowed value is 30)`);
3627
+ }
3628
+ }(this.experimentalLongPollingOptions), this.useFetchStreams = !!i.useFetchStreams;
3629
+ }
3630
+ isEqual(i) {
3631
+ return this.host === i.host && this.ssl === i.ssl && this.credentials === i.credentials && this.cacheSizeBytes === i.cacheSizeBytes && this.experimentalForceLongPolling === i.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === i.experimentalAutoDetectLongPolling && function(c, d) {
3632
+ return c.timeoutSeconds === d.timeoutSeconds;
3633
+ }(this.experimentalLongPollingOptions, i.experimentalLongPollingOptions) && this.ignoreUndefinedProperties === i.ignoreUndefinedProperties && this.useFetchStreams === i.useFetchStreams;
3634
+ }
3635
+ }
3636
+ class br {
3637
+ /** @hideconstructor */
3638
+ constructor(i, o, c, d) {
3639
+ this._authCredentials = i, this._appCheckCredentials = o, this._databaseId = c, this._app = d, /**
3640
+ * Whether it's a Firestore or Firestore Lite instance.
3641
+ */
3642
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ai({}), this._settingsFrozen = !1;
3643
+ }
3644
+ /**
3645
+ * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
3646
+ * instance.
3647
+ */
3648
+ get app() {
3649
+ if (!this._app) throw new G($.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3650
+ return this._app;
3651
+ }
3652
+ get _initialized() {
3653
+ return this._settingsFrozen;
3654
+ }
3655
+ get _terminated() {
3656
+ return this._terminateTask !== void 0;
3657
+ }
3658
+ _setSettings(i) {
3659
+ if (this._settingsFrozen) throw new G($.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
3660
+ this._settings = new ai(i), i.credentials !== void 0 && (this._authCredentials = function(c) {
3661
+ if (!c) return new Sr();
3662
+ switch (c.type) {
3663
+ case "firstParty":
3664
+ return new Rr(c.sessionIndex || "0", c.iamToken || null, c.authTokenFactory || null);
3665
+ case "provider":
3666
+ return c.client;
3667
+ default:
3668
+ throw new G($.INVALID_ARGUMENT, "makeAuthCredentialsProvider failed due to invalid credential type");
3669
+ }
3670
+ }(i.credentials));
3671
+ }
3672
+ _getSettings() {
3673
+ return this._settings;
3674
+ }
3675
+ _freezeSettings() {
3676
+ return this._settingsFrozen = !0, this._settings;
3677
+ }
3678
+ _delete() {
3679
+ return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;
3680
+ }
3681
+ /** Returns a JSON-serializable representation of this `Firestore` instance. */
3682
+ toJSON() {
3683
+ return {
3684
+ app: this._app,
3685
+ databaseId: this._databaseId,
3686
+ settings: this._settings
3687
+ };
3688
+ }
3689
+ /**
3690
+ * Terminates all components used by this client. Subclasses can override
3691
+ * this method to clean up their own dependencies, but must also call this
3692
+ * method.
3693
+ *
3694
+ * Only ever called once.
3695
+ */
3696
+ _terminate() {
3697
+ return function(o) {
3698
+ const c = hi.get(o);
3699
+ c && (K("ComponentProvider", "Removing Datastore"), hi.delete(o), c.terminate());
3700
+ }(this), Promise.resolve();
3701
+ }
3702
+ }
3703
+ /**
3704
+ * @license
3705
+ * Copyright 2020 Google LLC
3706
+ *
3707
+ * Licensed under the Apache License, Version 2.0 (the "License");
3708
+ * you may not use this file except in compliance with the License.
3709
+ * You may obtain a copy of the License at
3710
+ *
3711
+ * http://www.apache.org/licenses/LICENSE-2.0
3712
+ *
3713
+ * Unless required by applicable law or agreed to in writing, software
3714
+ * distributed under the License is distributed on an "AS IS" BASIS,
3715
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3716
+ * See the License for the specific language governing permissions and
3717
+ * limitations under the License.
3718
+ */
3719
+ class Mr {
3720
+ constructor() {
3721
+ this.au = Promise.resolve(), // A list of retryable operations. Retryable operations are run in order and
3722
+ // retried with backoff.
3723
+ this.uu = [], // Is this AsyncQueue being shut down? Once it is set to true, it will not
3724
+ // be changed again.
3725
+ this.cu = !1, // Operations scheduled to be queued in the future. Operations are
3726
+ // automatically removed after they are run or canceled.
3727
+ this.lu = [], // visible for testing
3728
+ this.hu = null, // Flag set while there's an outstanding AsyncQueue operation, used for
3729
+ // assertion sanity-checks.
3730
+ this.Pu = !1, // Enabled during shutdown on Safari to prevent future access to IndexedDB.
3731
+ this.Iu = !1, // List of TimerIds to fast-forward delays for.
3732
+ this.Tu = [], // Backoff timer used to schedule retries for retryable operations
3733
+ this.t_ = new Pr(
3734
+ this,
3735
+ "async_queue_retry"
3736
+ /* TimerId.AsyncQueueRetry */
3737
+ ), // Visibility handler that triggers an immediate retry of all retryable
3738
+ // operations. Meant to speed up recovery when we regain file system access
3739
+ // after page comes into foreground.
3740
+ this.Eu = () => {
3741
+ const o = xe();
3742
+ o && K("AsyncQueue", "Visibility state changed to " + o.visibilityState), this.t_.jo();
3743
+ };
3744
+ const i = xe();
3745
+ i && typeof i.addEventListener == "function" && i.addEventListener("visibilitychange", this.Eu);
3746
+ }
3747
+ get isShuttingDown() {
3748
+ return this.cu;
3749
+ }
3750
+ /**
3751
+ * Adds a new operation to the queue without waiting for it to complete (i.e.
3752
+ * we ignore the Promise result).
3753
+ */
3754
+ enqueueAndForget(i) {
3755
+ this.enqueue(i);
3756
+ }
3757
+ enqueueAndForgetEvenWhileRestricted(i) {
3758
+ this.du(), // eslint-disable-next-line @typescript-eslint/no-floating-promises
3759
+ this.Au(i);
3760
+ }
3761
+ enterRestrictedMode(i) {
3762
+ if (!this.cu) {
3763
+ this.cu = !0, this.Iu = i || !1;
3764
+ const o = xe();
3765
+ o && typeof o.removeEventListener == "function" && o.removeEventListener("visibilitychange", this.Eu);
3766
+ }
3767
+ }
3768
+ enqueue(i) {
3769
+ if (this.du(), this.cu)
3770
+ return new Promise(() => {
3771
+ });
3772
+ const o = new mt();
3773
+ return this.Au(() => this.cu && this.Iu ? Promise.resolve() : (i().then(o.resolve, o.reject), o.promise)).then(() => o.promise);
3774
+ }
3775
+ enqueueRetryable(i) {
3776
+ this.enqueueAndForget(() => (this.uu.push(i), this.Ru()));
3777
+ }
3778
+ /**
3779
+ * Runs the next operation from the retryable queue. If the operation fails,
3780
+ * reschedules with backoff.
3781
+ */
3782
+ async Ru() {
3783
+ if (this.uu.length !== 0) {
3784
+ try {
3785
+ await this.uu[0](), this.uu.shift(), this.t_.reset();
3786
+ } catch (i) {
3787
+ if (!yi(i)) throw i;
3788
+ K("AsyncQueue", "Operation failed with retryable error: " + i);
3789
+ }
3790
+ this.uu.length > 0 && // If there are additional operations, we re-schedule `retryNextOp()`.
3791
+ // This is necessary to run retryable operations that failed during
3792
+ // their initial attempt since we don't know whether they are already
3793
+ // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`
3794
+ // needs to be re-run, we will run `op1`, `op1`, `op2` using the
3795
+ // already enqueued calls to `retryNextOp()`. `op3()` will then run in the
3796
+ // call scheduled here.
3797
+ // Since `backoffAndRun()` cancels an existing backoff and schedules a
3798
+ // new backoff on every call, there is only ever a single additional
3799
+ // operation in the queue.
3800
+ this.t_.Go(() => this.Ru());
3801
+ }
3802
+ }
3803
+ Au(i) {
3804
+ const o = this.au.then(() => (this.Pu = !0, i().catch((c) => {
3805
+ this.hu = c, this.Pu = !1;
3806
+ const d = (
3807
+ /**
3808
+ * Chrome includes Error.message in Error.stack. Other browsers do not.
3809
+ * This returns expected output of message + stack when available.
3810
+ * @param error - Error or FirestoreError
3811
+ */
3812
+ function(m) {
3813
+ let y = m.message || "";
3814
+ return m.stack && (y = m.stack.includes(m.message) ? m.stack : m.message + `
3815
+ ` + m.stack), y;
3816
+ }(c)
3817
+ );
3818
+ throw Ge("INTERNAL UNHANDLED ERROR: ", d), c;
3819
+ }).then((c) => (this.Pu = !1, c))));
3820
+ return this.au = o, o;
3821
+ }
3822
+ enqueueAfterDelay(i, o, c) {
3823
+ this.du(), // Fast-forward delays for timerIds that have been overridden.
3824
+ this.Tu.indexOf(i) > -1 && (o = 0);
3825
+ const d = Ke.createAndSchedule(this, i, o, c, (T) => this.Vu(T));
3826
+ return this.lu.push(d), d;
3827
+ }
3828
+ du() {
3829
+ this.hu && mi();
3830
+ }
3831
+ verifyOperationInProgress() {
3832
+ }
3833
+ /**
3834
+ * Waits until all currently queued tasks are finished executing. Delayed
3835
+ * operations are not run.
3836
+ */
3837
+ async mu() {
3838
+ let i;
3839
+ do
3840
+ i = this.au, await i;
3841
+ while (i !== this.au);
3842
+ }
3843
+ /**
3844
+ * For Tests: Determine if a delayed operation with a particular TimerId
3845
+ * exists.
3846
+ */
3847
+ fu(i) {
3848
+ for (const o of this.lu) if (o.timerId === i) return !0;
3849
+ return !1;
3850
+ }
3851
+ /**
3852
+ * For Tests: Runs some or all delayed operations early.
3853
+ *
3854
+ * @param lastTimerId - Delayed operations up to and including this TimerId
3855
+ * will be drained. Pass TimerId.All to run all delayed operations.
3856
+ * @returns a Promise that resolves once all operations have been run.
3857
+ */
3858
+ gu(i) {
3859
+ return this.mu().then(() => {
3860
+ this.lu.sort((o, c) => o.targetTimeMs - c.targetTimeMs);
3861
+ for (const o of this.lu) if (o.skipDelay(), i !== "all" && o.timerId === i) break;
3862
+ return this.mu();
3863
+ });
3864
+ }
3865
+ /**
3866
+ * For Tests: Skip all subsequent delays for a timer id.
3867
+ */
3868
+ pu(i) {
3869
+ this.Tu.push(i);
3870
+ }
3871
+ /** Called once a DelayedOperation is run or canceled. */
3872
+ Vu(i) {
3873
+ const o = this.lu.indexOf(i);
3874
+ this.lu.splice(o, 1);
3875
+ }
3876
+ }
3877
+ class Br extends br {
3878
+ /** @hideconstructor */
3879
+ constructor(i, o, c, d) {
3880
+ super(i, o, c, d), /**
3881
+ * Whether it's a {@link Firestore} or Firestore Lite instance.
3882
+ */
3883
+ this.type = "firestore", this._queue = function() {
3884
+ return new Mr();
3885
+ }(), this._persistenceKey = (d == null ? void 0 : d.name) || "[DEFAULT]";
3886
+ }
3887
+ _terminate() {
3888
+ return this._firestoreClient || // The client must be initialized to ensure that all subsequent API
3889
+ // usage throws an exception.
3890
+ kr(this), this._firestoreClient.terminate();
3891
+ }
3892
+ }
3893
+ function kr(r) {
3894
+ var i, o, c;
3895
+ const d = r._freezeSettings(), T = function(y, v, A, b) {
3896
+ return new Or(y, v, A, b.host, b.ssl, b.experimentalForceLongPolling, b.experimentalAutoDetectLongPolling, Si(b.experimentalLongPollingOptions), b.useFetchStreams);
3897
+ }(r._databaseId, ((i = r._app) === null || i === void 0 ? void 0 : i.options.appId) || "", r._persistenceKey, d);
3898
+ r._firestoreClient = new Nr(r._authCredentials, r._appCheckCredentials, r._queue, T), !((o = d.localCache) === null || o === void 0) && o._offlineComponentProvider && (!((c = d.localCache) === null || c === void 0) && c._onlineComponentProvider) && (r._firestoreClient._uninitializedComponentsProvider = {
3899
+ _offlineKind: d.localCache.kind,
3900
+ _offline: d.localCache._offlineComponentProvider,
3901
+ _online: d.localCache._onlineComponentProvider
3902
+ });
3903
+ }
3904
+ (function(i, o = !0) {
3905
+ (function(d) {
3906
+ he = d;
3907
+ })(ar), se(new ie("firestore", (c, { instanceIdentifier: d, options: T }) => {
3908
+ const m = c.getProvider("app").getImmediate(), y = new Br(new vr(c.getProvider("auth-internal")), new wr(c.getProvider("app-check-internal")), function(A, b) {
3909
+ if (!Object.prototype.hasOwnProperty.apply(A.options, ["projectId"])) throw new G($.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
3910
+ return new oe(A.options.projectId, b);
3911
+ }(m, d), m);
3912
+ return T = Object.assign({
3913
+ useFetchStreams: o
3914
+ }, T), y._setSettings(T), y;
3915
+ }, "PUBLIC").setMultipleInstances(!0)), Tt(ii, "4.7.1", i), // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
3916
+ Tt(ii, "4.7.1", "esm2017");
3917
+ })();
3918
+ const xr = "REGISTER_REQUEST", Fr = "LOGIN_REQUEST", jr = "AUTH_RESET", Hr = "PARTIAL_REGISTER", Vr = "SET_PIN_SCREEN", Qr = "VALIDATE_REGISTER_BY_EMAIL_REQUEST", $r = "AUTH_SCREEN_UPDATE", Gr = "REGISTER_BY_EMAIL_REQUEST", Kr = "VERIFY_REGISTER_BY_EMAIL_REQUEST", Wr = "LOGIN_BY_EMAIL_REQUEST", Yr = "VALIDATE_OTP_REQUEST", Xr = "USER_REF_REQUEST", zr = "USER_REF_COUNT_REQUEST", qr = "USER_TWITTER_INFO_REQUEST", Jr = "USER_TWITTER_UPDATE_REQUEST", Zr = "USER_MINIMAL_KYC_REQUEST", to = "RESET_KYC", eo = "USER_BANK_REQUEST", no = "ADD_BANK_REQUEST", io = "DELETE_BANK_REQUEST", so = "PLAID_TOKEN_REQUEST", ro = "PLAID_CREATE_ITEM_REQUEST", oo = "USER_WALLET_REQUEST", ho = "ADD_WALLET_REQUEST", ao = "ADD_WALLET_SUCCESS", lo = "USER_ASSOCIATE_WALLET_REQUEST", uo = "ADD_ASSOCIATE_WALLET_REQUEST", co = "ADD_ASSOCIATE_WALLET_SUCCESS", fo = "FETCH_AVAILABLE_TOKENS", po = "FETCH_LINKED_WALLET_TOKENS", go = "FETCH_EVER_WALLET_TOKENS", Eo = "FIAT_ASSETS_REQUEST", _o = "FEATURE_CRYPTO_ASSETS", To = "CRYPTO_ASSETS_REQUEST", mo = "CRYPTO_ASSETS_PAIRS_REQUEST", yo = "USER_DOCUMENTS_REQUEST", So = "PREVIEW_DOCUMENT_REQUEST", vo = "PREVIEW_IDENTITY_DOCUMENT_REQUEST", Ao = "PREVIEW_DOCUMENT_CLEAR", Ro = "DELETE_DOCUMENT_REQUEST", Io = "UPLOAD_DOCUMENT_REQUEST", wo = "NETWORK_LIST_REQUEST", Co = "SUGGEST_GAS_REQUEST", Do = "SEND_NATIVE_TOKEN_REQUEST", Oo = "SEND_TOKEN_REQUEST", Po = "HIDE_GAS_POPUP", Lo = "CLEAR_SEND_TRX_ID", No = "ORDER_LIST_REQUEST", Uo = "ORDER_ESTIMATE_REQUEST", bo = "ORDER_CREATE_REQUEST", Mo = "ORDER_RESET_ESTIMATE", Bo = "ORDER_CHECKOUT_PAYMENT_REQUEST", ko = "ORDER_TYPE_REQUEST", xo = "STAKE_LIST_REQUEST", Fo = "STAKE_SET_REQUEST", jo = "STAKE_INITIAL_STATE", Ho = "STAKE_FINISH_REQUEST", Vo = "BRIDGE_MOVE_TO_ETHEREUM_GAS_REQUEST", Qo = "BRIDGE_MOVE_TO_ETHEREUM_REQUEST", $o = "BRIDGE_MOVE_TO_EVERCHAIN_GAS_REQUEST", Go = "BRIDGE_MOVE_TO_EVERCHAIN_REQUEST", Ko = "BRIDGE_RESET";
3919
+ export {
3920
+ So as $,
3921
+ jr as A,
3922
+ ko as B,
3923
+ so as C,
3924
+ ro as D,
3925
+ no as E,
3926
+ fo as F,
3927
+ eo as G,
3928
+ io as H,
3929
+ To as I,
3930
+ mo as J,
3931
+ _o as K,
3932
+ Wr as L,
3933
+ Ko as M,
3934
+ Vo as N,
3935
+ Uo as O,
3936
+ Hr as P,
3937
+ Qo as Q,
3938
+ xr as R,
3939
+ xo as S,
3940
+ $o as T,
3941
+ Xr as U,
3942
+ Yr as V,
3943
+ Go as W,
3944
+ Ao as X,
3945
+ yo as Y,
3946
+ Io as Z,
3947
+ vo as _,
3948
+ jo as a,
3949
+ Ro as a0,
3950
+ wo as a1,
3951
+ Po as a2,
3952
+ Do as a3,
3953
+ Oo as a4,
3954
+ Lo as a5,
3955
+ Co as a6,
3956
+ Eo as a7,
3957
+ Ho as b,
3958
+ Fo as c,
3959
+ Qr as d,
3960
+ Fr as e,
3961
+ Vr as f,
3962
+ $r as g,
3963
+ Gr as h,
3964
+ Kr as i,
3965
+ zr as j,
3966
+ qr as k,
3967
+ Jr as l,
3968
+ to as m,
3969
+ Zr as n,
3970
+ oo as o,
3971
+ lo as p,
3972
+ po as q,
3973
+ go as r,
3974
+ ao as s,
3975
+ co as t,
3976
+ ho as u,
3977
+ uo as v,
3978
+ Mo as w,
3979
+ bo as x,
3980
+ Bo as y,
3981
+ No as z
3982
+ };