cloudcommerce 0.0.109 → 0.0.111

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 (236) hide show
  1. package/.ecomplus/stores/monocard/.firebaserc +5 -0
  2. package/.ecomplus/stores/monocard/.github/renovate.json +5 -0
  3. package/.ecomplus/stores/monocard/.github/workflows/build-and-deploy.yml +41 -0
  4. package/.ecomplus/stores/monocard/.github/workflows/calibreapp-image-actions.yml +23 -0
  5. package/.ecomplus/stores/monocard/.vscode/extensions.json +8 -0
  6. package/.ecomplus/stores/monocard/.vscode/settings.json +5 -0
  7. package/.ecomplus/stores/monocard/LICENSE.md +230 -0
  8. package/.ecomplus/stores/monocard/README.md +117 -0
  9. package/.ecomplus/stores/monocard/README.pt-BR.md +117 -0
  10. package/.ecomplus/stores/monocard/functions/config.json +3 -0
  11. package/.ecomplus/stores/monocard/functions/core/index.js +9 -0
  12. package/.ecomplus/stores/monocard/functions/core/package.json +20 -0
  13. package/.ecomplus/stores/monocard/functions/events/index.js +9 -0
  14. package/.ecomplus/stores/monocard/functions/events/package.json +21 -0
  15. package/.ecomplus/stores/monocard/functions/example.env +10 -0
  16. package/.ecomplus/stores/monocard/functions/modules/index.js +9 -0
  17. package/.ecomplus/stores/monocard/functions/modules/package.json +21 -0
  18. package/.ecomplus/stores/monocard/functions/passport/index.js +9 -0
  19. package/.ecomplus/stores/monocard/functions/passport/package.json +21 -0
  20. package/.ecomplus/stores/monocard/functions/ssr/astro.config.mjs +4 -0
  21. package/.ecomplus/stores/monocard/functions/ssr/content/blog.json +18 -0
  22. package/.ecomplus/stores/monocard/functions/ssr/content/brands.json +24 -0
  23. package/.ecomplus/stores/monocard/functions/ssr/content/categories.json +24 -0
  24. package/.ecomplus/stores/monocard/functions/ssr/content/code.json +5 -0
  25. package/.ecomplus/stores/monocard/functions/ssr/content/collections.json +24 -0
  26. package/.ecomplus/stores/monocard/functions/ssr/content/contacts.json +13 -0
  27. package/.ecomplus/stores/monocard/functions/ssr/content/footer.json +46 -0
  28. package/.ecomplus/stores/monocard/functions/ssr/content/header.json +35 -0
  29. package/.ecomplus/stores/monocard/functions/ssr/content/home.json +45 -0
  30. package/.ecomplus/stores/monocard/functions/ssr/content/info.json +18 -0
  31. package/.ecomplus/stores/monocard/functions/ssr/content/maintenance.json +6 -0
  32. package/.ecomplus/stores/monocard/functions/ssr/content/menu.json +6 -0
  33. package/.ecomplus/stores/monocard/functions/ssr/content/pages/contato.json +6 -0
  34. package/.ecomplus/stores/monocard/functions/ssr/content/pages/entrega.json +6 -0
  35. package/.ecomplus/stores/monocard/functions/ssr/content/pages/faq.json +6 -0
  36. package/.ecomplus/stores/monocard/functions/ssr/content/pages/pagamentos.json +6 -0
  37. package/.ecomplus/stores/monocard/functions/ssr/content/pages/privacidade.json +6 -0
  38. package/.ecomplus/stores/monocard/functions/ssr/content/pages/sobre-nos.json +6 -0
  39. package/.ecomplus/stores/monocard/functions/ssr/content/pages/termos.json +6 -0
  40. package/.ecomplus/stores/monocard/functions/ssr/content/pages/trocas.json +6 -0
  41. package/.ecomplus/stores/monocard/functions/ssr/content/posts/esta-loja-e-um-pwa.json +9 -0
  42. package/.ecomplus/stores/monocard/functions/ssr/content/products.json +32 -0
  43. package/.ecomplus/stores/monocard/functions/ssr/content/search.json +8 -0
  44. package/.ecomplus/stores/monocard/functions/ssr/content/settings.json +21 -0
  45. package/.ecomplus/stores/monocard/functions/ssr/content/social.json +5 -0
  46. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/analytics.json +11 -0
  47. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/compre-confie.json +11 -0
  48. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/ebit.json +11 -0
  49. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/fb-pixel.json +12 -0
  50. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/gmc-ratings.json +12 -0
  51. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/minicart.json +6 -0
  52. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/offers-notification.json +11 -0
  53. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/opinioes-verificadas.json +18 -0
  54. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/product-card.json +10 -0
  55. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/product.json +13 -0
  56. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/search-engine.json +8 -0
  57. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/search.json +6 -0
  58. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/tag-manager.json +12 -0
  59. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/tawkto.json +12 -0
  60. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/trustvox.json +15 -0
  61. package/.ecomplus/stores/monocard/functions/ssr/content/widgets/user.json +5 -0
  62. package/.ecomplus/stores/monocard/functions/ssr/index.js +18 -0
  63. package/.ecomplus/stores/monocard/functions/ssr/package.json +27 -0
  64. package/.ecomplus/stores/monocard/functions/ssr/public/admin/config.json +1 -0
  65. package/.ecomplus/stores/monocard/functions/ssr/public/assets/cms-preview.css +274 -0
  66. package/.ecomplus/stores/monocard/functions/ssr/public/assets/cms.css +114 -0
  67. package/.ecomplus/stores/monocard/functions/ssr/public/assets/cvv.png +0 -0
  68. package/.ecomplus/stores/monocard/functions/ssr/public/assets/icons/bootstrap-icons/font/storefront-icons.woff2 +0 -0
  69. package/.ecomplus/stores/monocard/functions/ssr/public/assets/icons/feather-icons/font/storefront-icons.woff2 +0 -0
  70. package/.ecomplus/stores/monocard/functions/ssr/public/assets/icons/font-awesome/font/storefront-icons.woff2 +0 -0
  71. package/.ecomplus/stores/monocard/functions/ssr/public/assets/icons/line-awesome/font/storefront-icons.woff2 +0 -0
  72. package/.ecomplus/stores/monocard/functions/ssr/public/assets/icons/tabler-icons/font/storefront-icons.woff2 +0 -0
  73. package/.ecomplus/stores/monocard/functions/ssr/public/assets/img-placeholder.png +0 -0
  74. package/.ecomplus/stores/monocard/functions/ssr/public/assets/payments.png +0 -0
  75. package/.ecomplus/stores/monocard/functions/ssr/public/assets/ssl-safe.png +0 -0
  76. package/.ecomplus/stores/monocard/functions/ssr/public/img/icon.png +0 -0
  77. package/.ecomplus/stores/monocard/functions/ssr/public/img/large-icon.png +0 -0
  78. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/banner1.png +0 -0
  79. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/banner2.png +0 -0
  80. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/banner2.webp +0 -0
  81. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/favicon.png +0 -0
  82. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/headless.png +0 -0
  83. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/headphone.png +0 -0
  84. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/headphone.webp +0 -0
  85. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/icon.png +0 -0
  86. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/large-icon.png +0 -0
  87. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/logo.png +0 -0
  88. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/logo.webp +0 -0
  89. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/og-image.png +0 -0
  90. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/passion.png +0 -0
  91. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/passion.webp +0 -0
  92. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/pwa-reliable.png +0 -0
  93. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/rect8589.png +0 -0
  94. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/rect859.png +0 -0
  95. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/rect89.png +0 -0
  96. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/rect89.webp +0 -0
  97. package/.ecomplus/stores/monocard/functions/ssr/public/img/uploads/ssl-safe.png +0 -0
  98. package/.ecomplus/stores/monocard/functions/ssr/public/robots.txt +8 -0
  99. package/.ecomplus/stores/monocard/functions/ssr/src/env.d.ts +3 -0
  100. package/.ecomplus/stores/monocard/functions/ssr/src/pages/[...slug].astro +38 -0
  101. package/.ecomplus/stores/monocard/functions/ssr/src/pages/fallback.astro +21 -0
  102. package/.ecomplus/stores/monocard/functions/ssr/src/pages/index.astro +33 -0
  103. package/.ecomplus/stores/monocard/functions/ssr/src/scripts/InlineScripts.astro +10 -0
  104. package/.ecomplus/stores/monocard/functions/ssr/tailwind.config.cjs +4 -0
  105. package/.ecomplus/stores/monocard/functions/ssr/tsconfig.json +3 -0
  106. package/.ecomplus/stores/monocard/functions/ssr/uno.config.ts +4 -0
  107. package/.ecomplus/stores/monocard/package.json +28 -0
  108. package/.ecomplus/stores/monocard/scripts/install.sh +8 -0
  109. package/.gitmodules +3 -0
  110. package/CHANGELOG.md +29 -0
  111. package/CONTRIBUTING.md +2 -1
  112. package/action.yml +1 -1
  113. package/package.json +1 -1
  114. package/packages/api/lib/api.d.ts +4 -4940
  115. package/packages/api/lib/types.d.ts +17 -3
  116. package/packages/api/package.json +1 -1
  117. package/packages/api/src/types.ts +45 -23
  118. package/packages/apps/correios/package.json +1 -1
  119. package/packages/apps/custom-shipping/package.json +1 -1
  120. package/packages/apps/discounts/package.json +1 -1
  121. package/packages/apps/frenet/lib-mjs/calculate-frenet.mjs +26 -23
  122. package/packages/apps/frenet/package.json +1 -1
  123. package/packages/apps/tiny-erp/lib/event-to-tiny.js +94 -94
  124. package/packages/apps/tiny-erp/lib/index.js +1 -1
  125. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +71 -74
  126. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +70 -73
  127. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +49 -53
  128. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +3 -3
  129. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +76 -75
  130. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +137 -140
  131. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +40 -39
  132. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +173 -178
  133. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +173 -171
  134. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +123 -127
  135. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +32 -32
  136. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +37 -37
  137. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +42 -43
  138. package/packages/apps/tiny-erp/lib/tiny-erp.js +8 -6
  139. package/packages/apps/tiny-erp/lib/tiny-webhook.js +76 -73
  140. package/packages/apps/tiny-erp/package.json +1 -1
  141. package/packages/cli/package.json +1 -1
  142. package/packages/config/package.json +1 -1
  143. package/packages/events/package.json +1 -1
  144. package/packages/firebase/package.json +1 -1
  145. package/packages/i18n/lib/en_us.d.ts +1 -0
  146. package/packages/i18n/lib/en_us.js +1 -0
  147. package/packages/i18n/lib/en_us.js.map +1 -1
  148. package/packages/i18n/lib/pt_br.d.ts +1 -0
  149. package/packages/i18n/lib/pt_br.js +1 -0
  150. package/packages/i18n/lib/pt_br.js.map +1 -1
  151. package/packages/i18n/package.json +1 -1
  152. package/packages/i18n/src/en_us.ts +1 -0
  153. package/packages/i18n/src/pt_br.ts +1 -0
  154. package/packages/modules/lib/firebase/ajv.js +24 -19
  155. package/packages/modules/lib/firebase/call-app-module.js +110 -116
  156. package/packages/modules/lib/firebase/checkout.js +149 -154
  157. package/packages/modules/lib/firebase/checkout.js.map +1 -1
  158. package/packages/modules/lib/firebase/functions-checkout/fix-items.js +187 -194
  159. package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js +33 -27
  160. package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js.map +1 -1
  161. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js +111 -125
  162. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
  163. package/packages/modules/lib/firebase/functions-checkout/new-order.js +178 -178
  164. package/packages/modules/lib/firebase/functions-checkout/new-order.js.map +1 -1
  165. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +53 -60
  166. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
  167. package/packages/modules/lib/firebase/functions-checkout/utils.js +197 -195
  168. package/packages/modules/lib/firebase/handle-module.js +146 -144
  169. package/packages/modules/lib/firebase/handle-module.js.map +1 -1
  170. package/packages/modules/lib/firebase/proxy-apps.js +1 -2
  171. package/packages/modules/lib/firebase/serve-modules-api.js +53 -52
  172. package/packages/modules/lib/firebase/serve-modules-api.js.map +1 -1
  173. package/packages/modules/lib/firebase.js +6 -4
  174. package/packages/modules/lib/index.js +17 -12
  175. package/packages/modules/lib/index.js.map +1 -1
  176. package/packages/modules/package.json +2 -1
  177. package/packages/modules/schemas/@checkout.cjs +13 -1
  178. package/packages/modules/schemas/list_payments.cjs +6 -0
  179. package/packages/modules/src/firebase/checkout.ts +22 -49
  180. package/packages/modules/src/firebase/functions-checkout/get-custumerId.ts +23 -17
  181. package/packages/modules/src/firebase/functions-checkout/handle-order-transaction.ts +8 -45
  182. package/packages/modules/src/firebase/functions-checkout/new-order.ts +4 -9
  183. package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +2 -11
  184. package/packages/modules/src/firebase/handle-module.ts +1 -1
  185. package/packages/modules/src/firebase/serve-modules-api.ts +1 -1
  186. package/packages/modules/src/index.ts +2 -0
  187. package/packages/passport/lib/firebase/authenticate-customer.js +81 -0
  188. package/packages/passport/lib/firebase/authenticate-customer.js.map +1 -0
  189. package/packages/passport/lib/firebase/serve-passport-api.js +20 -30
  190. package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
  191. package/packages/passport/lib/firebase.js +1 -13
  192. package/packages/passport/lib/firebase.js.map +1 -1
  193. package/packages/passport/lib/index.js +1 -1
  194. package/packages/passport/lib/index.js.map +1 -1
  195. package/packages/passport/package.json +1 -1
  196. package/packages/passport/src/firebase/authenticate-customer.ts +94 -0
  197. package/packages/passport/src/firebase/serve-passport-api.ts +21 -49
  198. package/packages/passport/src/firebase.ts +1 -21
  199. package/packages/passport/src/index.ts +4 -1
  200. package/packages/ssr/package.json +2 -2
  201. package/packages/storefront/client.d.ts +1 -1
  202. package/packages/storefront/content/header.json +6 -0
  203. package/packages/storefront/dist/client/LoginDrawer.1061c69c.js +1 -0
  204. package/packages/storefront/dist/client/assets/_...129504ca.css +4 -0
  205. package/packages/storefront/dist/client/chunks/LoginDrawer.4d10fa17.js +1 -0
  206. package/packages/storefront/dist/client/chunks/{LoginForm.c995d3d4.js → LoginForm.dd3df9d8.js} +109 -109
  207. package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.7f8f570f.js +1 -0
  208. package/packages/storefront/dist/client/{client.6736232b.js → client.246ab4a4.js} +1 -1
  209. package/packages/storefront/dist/client/sw.js +1 -1
  210. package/packages/storefront/dist/server/entry.mjs +2439 -223
  211. package/packages/storefront/package.json +2 -2
  212. package/packages/storefront/src/assets/pico.css +3 -400
  213. package/packages/storefront/src/lib/components/{AOffcanvas.vue → ADrawer.vue} +3 -3
  214. package/packages/storefront/src/lib/components/LoginDrawer.vue +80 -0
  215. package/packages/storefront/src/lib/components/LoginForm.vue +31 -14
  216. package/packages/storefront/src/lib/layouts/Base.astro +5 -7
  217. package/packages/storefront/src/lib/layouts/PagesHeader.astro +18 -7
  218. package/packages/storefront/src/lib/scripts/firebase-app.ts +1 -10
  219. package/packages/storefront/src/lib/state/customer-session.ts +137 -0
  220. package/packages/storefront/src/pages/[...slug].astro +2 -0
  221. package/packages/storefront/src/pages/fallback.astro +2 -0
  222. package/packages/storefront/src/pages/index.astro +2 -0
  223. package/packages/storefront/src/scripts/InlineScripts.astro +11 -0
  224. package/packages/types/index.ts +22 -0
  225. package/packages/types/modules/@checkout:params.d.ts +9 -1
  226. package/packages/types/modules/list_payments:params.d.ts +4 -0
  227. package/packages/types/package.json +1 -1
  228. package/pnpm-workspace.yaml +3 -1
  229. package/packages/passport/lib/firebase/handle-passport.js +0 -112
  230. package/packages/passport/lib/firebase/handle-passport.js.map +0 -1
  231. package/packages/passport/src/firebase/handle-passport.ts +0 -142
  232. package/packages/storefront/dist/client/LoginOffcanvas.28d2f50c.js +0 -1
  233. package/packages/storefront/dist/client/assets/_...41f686e3.css +0 -4
  234. package/packages/storefront/dist/client/chunks/LoginOffcanvas.a1f3fe3b.js +0 -1
  235. package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.62d623e7.js +0 -1
  236. package/packages/storefront/src/lib/components/LoginOffcanvas.vue +0 -41
@@ -1,4 +1,4 @@
1
- import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f as G,A as Tn,g as De,o as Pe}from"./runtime-dom.esm-bundler.62d623e7.js";import{i as Sn,a as kn,b as Rn,c as An,d as On,e as dt,f as Cn}from"./LoginOffcanvas.a1f3fe3b.js";import"./preload-helper.f15ab524.js";/* empty css *//**
1
+ import{z as Yn,A as Xn,B as Qn,d as Zn,w as St,r as je,c as er,e as ze,h as tr,l as nr,m as rr,u as v,f as x,q as ne,i as kt,C as Ge,D as At,E as ir,G as sr,g as Ke,F as or,o as qe}from"./runtime-dom.esm-bundler.7f8f570f.js";import{i as ar,a as cr,b as lr,c as ur,d as dr,e as hr,f as fr,g as Rt,h as pr}from"./LoginDrawer.4d10fa17.js";import"./preload-helper.f15ab524.js";/* empty css */function Je(n){let e=Yn(),t=n.subscribe(r=>{e.value=r});return Xn()&&Qn(t),e}/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  *
@@ -28,7 +28,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
28
28
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
29
  * See the License for the specific language governing permissions and
30
30
  * limitations under the License.
31
- */const Lt=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},Dn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],a=n[t++],c=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Ut={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,a=o?n[i+1]:0,c=i+2<n.length,l=c?n[i+2]:0,d=s>>2,f=(s&3)<<4|a>>4;let m=(a&15)<<2|l>>6,I=l&63;c||(I=64,o||(m=64)),r.push(t[d],t[f],t[m],t[I])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Lt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Dn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||a==null||l==null||f==null)throw Error();const m=s<<2|a>>4;if(r.push(m),l!==64){const I=a<<4&240|l>>2;if(r.push(I),f!==64){const U=l<<6&192|f;r.push(U)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},Pn=function(n){const e=Lt(n);return Ut.encodeByteArray(e,!0)},Bt=function(n){return Pn(n).replace(/\./g,"")},Nn=function(n){try{return Ut.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
31
+ */const en=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},mr=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],a=n[t++],c=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},tn={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,a=o?n[i+1]:0,c=i+2<n.length,l=c?n[i+2]:0,d=s>>2,f=(s&3)<<4|a>>4;let p=(a&15)<<2|l>>6,y=l&63;c||(y=64,o||(p=64)),r.push(t[d],t[f],t[p],t[y])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(en(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):mr(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||a==null||l==null||f==null)throw Error();const p=s<<2|a>>4;if(r.push(p),l!==64){const y=a<<4&240|l>>2;if(r.push(y),f!==64){const R=l<<6&192|f;r.push(R)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},gr=function(n){const e=en(n);return tn.encodeByteArray(e,!0)},nn=function(n){return gr(n).replace(/\./g,"")},_r=function(n){try{return tn.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
32
32
  * @license
33
33
  * Copyright 2017 Google LLC
34
34
  *
@@ -43,7 +43,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
43
43
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
44
  * See the License for the specific language governing permissions and
45
45
  * limitations under the License.
46
- */class Mn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
46
+ */class vr{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
47
47
  * @license
48
48
  * Copyright 2017 Google LLC
49
49
  *
@@ -58,7 +58,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
58
58
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
59
  * See the License for the specific language governing permissions and
60
60
  * limitations under the License.
61
- */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Ln(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Un(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Bn(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function xn(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Fn(){return typeof indexedDB=="object"}function $n(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
61
+ */function m(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Ir(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m())}function yr(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function br(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function wr(){const n=m();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Er(){return typeof indexedDB=="object"}function Tr(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
62
62
  * @license
63
63
  * Copyright 2017 Google LLC
64
64
  *
@@ -73,7 +73,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
73
73
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
74
  * See the License for the specific language governing permissions and
75
75
  * limitations under the License.
76
- */const Hn="FirebaseError";class C extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Hn,Object.setPrototypeOf(this,C.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,te.prototype.create)}}class te{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Vn(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new C(i,a,r)}}function Vn(n,e){return n.replace(Wn,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Wn=/\{\$([^}]+)}/g;function jn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function pe(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(ht(s)&&ht(o)){if(!pe(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function ht(n){return n!==null&&typeof n=="object"}/**
76
+ */const Sr="FirebaseError";class U extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Sr,Object.setPrototypeOf(this,U.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,de.prototype.create)}}class de{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?kr(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new U(i,a,r)}}function kr(n,e){return n.replace(Ar,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Ar=/\{\$([^}]+)}/g;function Rr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Re(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(Ot(s)&&Ot(o)){if(!Re(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function Ot(n){return n!==null&&typeof n=="object"}/**
77
77
  * @license
78
78
  * Copyright 2017 Google LLC
79
79
  *
@@ -88,7 +88,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
88
88
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
89
  * See the License for the specific language governing permissions and
90
90
  * limitations under the License.
91
- */function ne(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function K(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function q(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function zn(n,e){const t=new Gn(n,e);return t.subscribe.bind(t)}class Gn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");Kn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Ne),i.error===void 0&&(i.error=Ne),i.complete===void 0&&(i.complete=Ne);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Kn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Ne(){}/**
91
+ */function he(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function re(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function ie(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function Or(n,e){const t=new Cr(n,e);return t.subscribe.bind(t)}class Cr{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");Dr(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Ye),i.error===void 0&&(i.error=Ye),i.complete===void 0&&(i.complete=Ye);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Dr(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Ye(){}/**
92
92
  * @license
93
93
  * Copyright 2021 Google LLC
94
94
  *
@@ -103,7 +103,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
103
103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
104
  * See the License for the specific language governing permissions and
105
105
  * limitations under the License.
106
- */function W(n){return n&&n._delegate?n._delegate:n}class H{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
106
+ */function B(n){return n&&n._delegate?n._delegate:n}class X{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
107
107
  * @license
108
108
  * Copyright 2019 Google LLC
109
109
  *
@@ -118,7 +118,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
118
118
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
119
  * See the License for the specific language governing permissions and
120
120
  * limitations under the License.
121
- */const D="[DEFAULT]";/**
121
+ */const F="[DEFAULT]";/**
122
122
  * @license
123
123
  * Copyright 2019 Google LLC
124
124
  *
@@ -133,7 +133,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
133
133
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
134
  * See the License for the specific language governing permissions and
135
135
  * limitations under the License.
136
- */class qn{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Mn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Yn(e))try{this.getOrInitializeService({instanceIdentifier:D})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=D){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=D){return this.instances.has(e)}getOptions(e=D){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(!!r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Jn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=D){return this.component?this.component.multipleInstances?e:D:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Jn(n){return n===D?void 0:n}function Yn(n){return n.instantiationMode==="EAGER"}/**
136
+ */class Nr{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new vr;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Lr(e))try{this.getOrInitializeService({instanceIdentifier:F})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=F){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=F){return this.instances.has(e)}getOptions(e=F){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(!!r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Pr(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=F){return this.component?this.component.multipleInstances?e:F:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Pr(n){return n===F?void 0:n}function Lr(n){return n.instantiationMode==="EAGER"}/**
137
137
  * @license
138
138
  * Copyright 2019 Google LLC
139
139
  *
@@ -148,7 +148,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
148
148
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
149
  * See the License for the specific language governing permissions and
150
150
  * limitations under the License.
151
- */class Xn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new qn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
151
+ */class Mr{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Nr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
152
152
  * @license
153
153
  * Copyright 2017 Google LLC
154
154
  *
@@ -163,7 +163,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
163
163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
164
  * See the License for the specific language governing permissions and
165
165
  * limitations under the License.
166
- */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const Qn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Zn=h.INFO,er={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},tr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=er[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class xt{constructor(e){this.name=e,this._logLevel=Zn,this._logHandler=tr,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Qn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const nr=(n,e)=>e.some(t=>n instanceof t);let ft,pt;function rr(){return ft||(ft=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ir(){return pt||(pt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ft=new WeakMap,$e=new WeakMap,$t=new WeakMap,Me=new WeakMap,Ge=new WeakMap;function sr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(O(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Ft.set(t,n)}).catch(()=>{}),Ge.set(e,n),e}function or(n){if($e.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});$e.set(n,e)}let He={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return $e.get(n);if(e==="objectStoreNames")return n.objectStoreNames||$t.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return O(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function ar(n){He=n(He)}function cr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Le(this),e,...t);return $t.set(r,e.sort?e.sort():[e]),O(r)}:ir().includes(n)?function(...e){return n.apply(Le(this),e),O(Ft.get(this))}:function(...e){return O(n.apply(Le(this),e))}}function lr(n){return typeof n=="function"?cr(n):(n instanceof IDBTransaction&&or(n),nr(n,rr())?new Proxy(n,He):n)}function O(n){if(n instanceof IDBRequest)return sr(n);if(Me.has(n))return Me.get(n);const e=lr(n);return e!==n&&(Me.set(n,e),Ge.set(e,n)),e}const Le=n=>Ge.get(n);function ur(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=O(o);return r&&o.addEventListener("upgradeneeded",c=>{r(O(o.result),c.oldVersion,c.newVersion,O(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const dr=["get","getKey","getAll","getAllKeys","count"],hr=["put","add","delete","clear"],Ue=new Map;function mt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ue.get(e))return Ue.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=hr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||dr.includes(t)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[t](...a),i&&c.done]))[0]};return Ue.set(e,s),s}ar(n=>({...n,get:(e,t,r)=>mt(e,t)||n.get(e,t,r),has:(e,t)=>!!mt(e,t)||n.has(e,t)}));/**
166
+ */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const Ur={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Br=h.INFO,xr={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},$r=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=xr[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class rn{constructor(e){this.name=e,this._logLevel=Br,this._logHandler=$r,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Ur[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const Fr=(n,e)=>e.some(t=>n instanceof t);let Ct,Dt;function Hr(){return Ct||(Ct=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Vr(){return Dt||(Dt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const sn=new WeakMap,rt=new WeakMap,on=new WeakMap,Xe=new WeakMap,ut=new WeakMap;function Wr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(M(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&sn.set(t,n)}).catch(()=>{}),ut.set(e,n),e}function jr(n){if(rt.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});rt.set(n,e)}let it={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return rt.get(n);if(e==="objectStoreNames")return n.objectStoreNames||on.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return M(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function zr(n){it=n(it)}function Gr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Qe(this),e,...t);return on.set(r,e.sort?e.sort():[e]),M(r)}:Vr().includes(n)?function(...e){return n.apply(Qe(this),e),M(sn.get(this))}:function(...e){return M(n.apply(Qe(this),e))}}function Kr(n){return typeof n=="function"?Gr(n):(n instanceof IDBTransaction&&jr(n),Fr(n,Hr())?new Proxy(n,it):n)}function M(n){if(n instanceof IDBRequest)return Wr(n);if(Xe.has(n))return Xe.get(n);const e=Kr(n);return e!==n&&(Xe.set(n,e),ut.set(e,n)),e}const Qe=n=>ut.get(n);function qr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=M(o);return r&&o.addEventListener("upgradeneeded",c=>{r(M(o.result),c.oldVersion,c.newVersion,M(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const Jr=["get","getKey","getAll","getAllKeys","count"],Yr=["put","add","delete","clear"],Ze=new Map;function Nt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ze.get(e))return Ze.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=Yr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Jr.includes(t)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[t](...a),i&&c.done]))[0]};return Ze.set(e,s),s}zr(n=>({...n,get:(e,t,r)=>Nt(e,t)||n.get(e,t,r),has:(e,t)=>!!Nt(e,t)||n.has(e,t)}));/**
167
167
  * @license
168
168
  * Copyright 2019 Google LLC
169
169
  *
@@ -178,7 +178,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
178
178
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
179
  * See the License for the specific language governing permissions and
180
180
  * limitations under the License.
181
- */class fr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(pr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function pr(n){const e=n.getComponent();return e?.type==="VERSION"}const Ve="@firebase/app",gt="0.7.33";/**
181
+ */class Xr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Qr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function Qr(n){const e=n.getComponent();return e?.type==="VERSION"}const st="@firebase/app",Pt="0.7.33";/**
182
182
  * @license
183
183
  * Copyright 2019 Google LLC
184
184
  *
@@ -193,7 +193,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
193
193
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
194
  * See the License for the specific language governing permissions and
195
195
  * limitations under the License.
196
- */const N=new xt("@firebase/app"),mr="@firebase/app-compat",gr="@firebase/analytics-compat",_r="@firebase/analytics",vr="@firebase/app-check-compat",Ir="@firebase/app-check",yr="@firebase/auth",br="@firebase/auth-compat",wr="@firebase/database",Er="@firebase/database-compat",Tr="@firebase/functions",Sr="@firebase/functions-compat",kr="@firebase/installations",Rr="@firebase/installations-compat",Ar="@firebase/messaging",Or="@firebase/messaging-compat",Cr="@firebase/performance",Dr="@firebase/performance-compat",Pr="@firebase/remote-config",Nr="@firebase/remote-config-compat",Mr="@firebase/storage",Lr="@firebase/storage-compat",Ur="@firebase/firestore",Br="@firebase/firestore-compat",xr="firebase",Fr="9.10.0";/**
196
+ */const V=new rn("@firebase/app"),Zr="@firebase/app-compat",ei="@firebase/analytics-compat",ti="@firebase/analytics",ni="@firebase/app-check-compat",ri="@firebase/app-check",ii="@firebase/auth",si="@firebase/auth-compat",oi="@firebase/database",ai="@firebase/database-compat",ci="@firebase/functions",li="@firebase/functions-compat",ui="@firebase/installations",di="@firebase/installations-compat",hi="@firebase/messaging",fi="@firebase/messaging-compat",pi="@firebase/performance",mi="@firebase/performance-compat",gi="@firebase/remote-config",_i="@firebase/remote-config-compat",vi="@firebase/storage",Ii="@firebase/storage-compat",yi="@firebase/firestore",bi="@firebase/firestore-compat",wi="firebase",Ei="9.10.0";/**
197
197
  * @license
198
198
  * Copyright 2019 Google LLC
199
199
  *
@@ -208,7 +208,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
208
208
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
209
  * See the License for the specific language governing permissions and
210
210
  * limitations under the License.
211
- */const Ht="[DEFAULT]",$r={[Ve]:"fire-core",[mr]:"fire-core-compat",[_r]:"fire-analytics",[gr]:"fire-analytics-compat",[Ir]:"fire-app-check",[vr]:"fire-app-check-compat",[yr]:"fire-auth",[br]:"fire-auth-compat",[wr]:"fire-rtdb",[Er]:"fire-rtdb-compat",[Tr]:"fire-fn",[Sr]:"fire-fn-compat",[kr]:"fire-iid",[Rr]:"fire-iid-compat",[Ar]:"fire-fcm",[Or]:"fire-fcm-compat",[Cr]:"fire-perf",[Dr]:"fire-perf-compat",[Pr]:"fire-rc",[Nr]:"fire-rc-compat",[Mr]:"fire-gcs",[Lr]:"fire-gcs-compat",[Ur]:"fire-fst",[Br]:"fire-fst-compat","fire-js":"fire-js",[xr]:"fire-js-all"};/**
211
+ */const an="[DEFAULT]",Ti={[st]:"fire-core",[Zr]:"fire-core-compat",[ti]:"fire-analytics",[ei]:"fire-analytics-compat",[ri]:"fire-app-check",[ni]:"fire-app-check-compat",[ii]:"fire-auth",[si]:"fire-auth-compat",[oi]:"fire-rtdb",[ai]:"fire-rtdb-compat",[ci]:"fire-fn",[li]:"fire-fn-compat",[ui]:"fire-iid",[di]:"fire-iid-compat",[hi]:"fire-fcm",[fi]:"fire-fcm-compat",[pi]:"fire-perf",[mi]:"fire-perf-compat",[gi]:"fire-rc",[_i]:"fire-rc-compat",[vi]:"fire-gcs",[Ii]:"fire-gcs-compat",[yi]:"fire-fst",[bi]:"fire-fst-compat","fire-js":"fire-js",[wi]:"fire-js-all"};/**
212
212
  * @license
213
213
  * Copyright 2019 Google LLC
214
214
  *
@@ -223,7 +223,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
223
223
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
224
  * See the License for the specific language governing permissions and
225
225
  * limitations under the License.
226
- */const me=new Map,We=new Map;function Hr(n,e){try{n.container.addComponent(e)}catch(t){N.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Y(n){const e=n.name;if(We.has(e))return N.debug(`There were multiple attempts to register component ${e}.`),!1;We.set(e,n);for(const t of me.values())Hr(t,n);return!0}function Vt(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
226
+ */const Oe=new Map,ot=new Map;function Si(n,e){try{n.container.addComponent(e)}catch(t){V.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function oe(n){const e=n.name;if(ot.has(e))return V.debug(`There were multiple attempts to register component ${e}.`),!1;ot.set(e,n);for(const t of Oe.values())Si(t,n);return!0}function cn(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
227
227
  * @license
228
228
  * Copyright 2019 Google LLC
229
229
  *
@@ -238,7 +238,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
238
238
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
239
  * See the License for the specific language governing permissions and
240
240
  * limitations under the License.
241
- */const Vr={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["bad-app-name"]:"Illegal App name: '{$appName}",["duplicate-app"]:"Firebase App named '{$appName}' already exists with different options or config",["app-deleted"]:"Firebase App named '{$appName}' already deleted",["invalid-app-argument"]:"firebase.{$appName}() takes either no argument or a Firebase App instance.",["invalid-log-argument"]:"First argument to `onLog` must be null or a function.",["idb-open"]:"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",["idb-get"]:"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",["idb-set"]:"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",["idb-delete"]:"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},M=new te("app","Firebase",Vr);/**
241
+ */const ki={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["bad-app-name"]:"Illegal App name: '{$appName}",["duplicate-app"]:"Firebase App named '{$appName}' already exists with different options or config",["app-deleted"]:"Firebase App named '{$appName}' already deleted",["invalid-app-argument"]:"firebase.{$appName}() takes either no argument or a Firebase App instance.",["invalid-log-argument"]:"First argument to `onLog` must be null or a function.",["idb-open"]:"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",["idb-get"]:"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",["idb-set"]:"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",["idb-delete"]:"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},W=new de("app","Firebase",ki);/**
242
242
  * @license
243
243
  * Copyright 2019 Google LLC
244
244
  *
@@ -253,7 +253,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
253
253
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
254
  * See the License for the specific language governing permissions and
255
255
  * limitations under the License.
256
- */class Wr{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new H("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw M.create("app-deleted",{appName:this._name})}}/**
256
+ */class Ai{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new X("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw W.create("app-deleted",{appName:this._name})}}/**
257
257
  * @license
258
258
  * Copyright 2019 Google LLC
259
259
  *
@@ -268,7 +268,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
268
268
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
269
  * See the License for the specific language governing permissions and
270
270
  * limitations under the License.
271
- */const ye=Fr;function jr(n,e={}){typeof e!="object"&&(e={name:e});const t=Object.assign({name:Ht,automaticDataCollectionEnabled:!1},e),r=t.name;if(typeof r!="string"||!r)throw M.create("bad-app-name",{appName:String(r)});const i=me.get(r);if(i){if(pe(n,i.options)&&pe(t,i.config))return i;throw M.create("duplicate-app",{appName:r})}const s=new Xn(r);for(const a of We.values())s.addComponent(a);const o=new Wr(n,t,s);return me.set(r,o),o}function zr(n=Ht){const e=me.get(n);if(!e)throw M.create("no-app",{appName:n});return e}function x(n,e,t){var r;let i=(r=$r[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),N.warn(a.join(" "));return}Y(new H(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
271
+ */const Me=Ei;function Ri(n,e={}){typeof e!="object"&&(e={name:e});const t=Object.assign({name:an,automaticDataCollectionEnabled:!1},e),r=t.name;if(typeof r!="string"||!r)throw W.create("bad-app-name",{appName:String(r)});const i=Oe.get(r);if(i){if(Re(n,i.options)&&Re(t,i.config))return i;throw W.create("duplicate-app",{appName:r})}const s=new Mr(r);for(const a of ot.values())s.addComponent(a);const o=new Ai(n,t,s);return Oe.set(r,o),o}function Oi(n=an){const e=Oe.get(n);if(!e)throw W.create("no-app",{appName:n});return e}function q(n,e,t){var r;let i=(r=Ti[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),V.warn(a.join(" "));return}oe(new X(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
272
272
  * @license
273
273
  * Copyright 2021 Google LLC
274
274
  *
@@ -283,7 +283,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
283
283
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
284
  * See the License for the specific language governing permissions and
285
285
  * limitations under the License.
286
- */const Gr="firebase-heartbeat-database",Kr=1,X="firebase-heartbeat-store";let Be=null;function Wt(){return Be||(Be=ur(Gr,Kr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(X)}}}).catch(n=>{throw M.create("idb-open",{originalErrorMessage:n.message})})),Be}async function qr(n){var e;try{return(await Wt()).transaction(X).objectStore(X).get(jt(n))}catch(t){if(t instanceof C)N.warn(t.message);else{const r=M.create("idb-get",{originalErrorMessage:(e=t)===null||e===void 0?void 0:e.message});N.warn(r.message)}}}async function _t(n,e){var t;try{const i=(await Wt()).transaction(X,"readwrite");return await i.objectStore(X).put(e,jt(n)),i.done}catch(r){if(r instanceof C)N.warn(r.message);else{const i=M.create("idb-set",{originalErrorMessage:(t=r)===null||t===void 0?void 0:t.message});N.warn(i.message)}}}function jt(n){return`${n.name}!${n.options.appId}`}/**
286
+ */const Ci="firebase-heartbeat-database",Di=1,ae="firebase-heartbeat-store";let et=null;function ln(){return et||(et=qr(Ci,Di,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(ae)}}}).catch(n=>{throw W.create("idb-open",{originalErrorMessage:n.message})})),et}async function Ni(n){var e;try{return(await ln()).transaction(ae).objectStore(ae).get(un(n))}catch(t){if(t instanceof U)V.warn(t.message);else{const r=W.create("idb-get",{originalErrorMessage:(e=t)===null||e===void 0?void 0:e.message});V.warn(r.message)}}}async function Lt(n,e){var t;try{const i=(await ln()).transaction(ae,"readwrite");return await i.objectStore(ae).put(e,un(n)),i.done}catch(r){if(r instanceof U)V.warn(r.message);else{const i=W.create("idb-set",{originalErrorMessage:(t=r)===null||t===void 0?void 0:t.message});V.warn(i.message)}}}function un(n){return`${n.name}!${n.options.appId}`}/**
287
287
  * @license
288
288
  * Copyright 2021 Google LLC
289
289
  *
@@ -298,7 +298,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
298
298
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
299
  * See the License for the specific language governing permissions and
300
300
  * limitations under the License.
301
- */const Jr=1024,Yr=30*24*60*60*1e3;class Xr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Zr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=vt();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Yr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=vt(),{heartbeatsToSend:t,unsentEntries:r}=Qr(this._heartbeatsCache.heartbeats),i=Bt(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function vt(){return new Date().toISOString().substring(0,10)}function Qr(n,e=Jr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),It(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),It(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Zr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Fn()?$n().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await qr(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return _t(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return _t(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function It(n){return Bt(JSON.stringify({version:2,heartbeats:n})).length}/**
301
+ */const Pi=1024,Li=30*24*60*60*1e3;class Mi{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Bi(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Mt();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Li}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=Mt(),{heartbeatsToSend:t,unsentEntries:r}=Ui(this._heartbeatsCache.heartbeats),i=nn(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function Mt(){return new Date().toISOString().substring(0,10)}function Ui(n,e=Pi){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),Ut(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),Ut(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Bi{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Er()?Tr().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await Ni(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return Lt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return Lt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Ut(n){return nn(JSON.stringify({version:2,heartbeats:n})).length}/**
302
302
  * @license
303
303
  * Copyright 2019 Google LLC
304
304
  *
@@ -313,7 +313,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
313
313
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
314
  * See the License for the specific language governing permissions and
315
315
  * limitations under the License.
316
- */function ei(n){Y(new H("platform-logger",e=>new fr(e),"PRIVATE")),Y(new H("heartbeat",e=>new Xr(e),"PRIVATE")),x(Ve,gt,n),x(Ve,gt,"esm2017"),x("fire-js","")}ei("");var ti="firebase",ni="9.10.0";/**
316
+ */function xi(n){oe(new X("platform-logger",e=>new Xr(e),"PRIVATE")),oe(new X("heartbeat",e=>new Mi(e),"PRIVATE")),q(st,Pt,n),q(st,Pt,"esm2017"),q("fire-js","")}xi("");function dt(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function dn(){return{["dependent-sdk-initialized-before-auth"]:"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const $i=dn,hn=new de("auth","Firebase",dn());/**
317
317
  * @license
318
318
  * Copyright 2020 Google LLC
319
319
  *
@@ -328,7 +328,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
328
328
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
329
  * See the License for the specific language governing permissions and
330
330
  * limitations under the License.
331
- */x(ti,ni,"app");const ri=window.firebaseConfig||{apiKey:"AIzaSyCrVzemDgpyp9i6ni7Yc5ZuEVfXYwl-4J0",authDomain:"ecom2-002.firebaseapp.com",projectId:"ecom2-002",storageBucket:"ecom2-002.appspot.com",messagingSenderId:"402807248219",appId:"1:402807248219:web:cf7d57759751e74776367e",measurementId:"G-SC592CE0GB"};jr(ri);function Ke(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function zt(){return{["dependent-sdk-initialized-before-auth"]:"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const ii=zt,Gt=new te("auth","Firebase",zt());/**
331
+ */const Bt=new rn("@firebase/auth");function we(n,...e){Bt.logLevel<=h.ERROR&&Bt.error(`Auth (${Me}): ${n}`,...e)}/**
332
332
  * @license
333
333
  * Copyright 2020 Google LLC
334
334
  *
@@ -343,7 +343,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
343
343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
344
  * See the License for the specific language governing permissions and
345
345
  * limitations under the License.
346
- */const yt=new xt("@firebase/auth");function ue(n,...e){yt.logLevel<=h.ERROR&&yt.error(`Auth (${ye}): ${n}`,...e)}/**
346
+ */function b(n,...e){throw ht(n,...e)}function E(n,...e){return ht(n,...e)}function Fi(n,e,t){const r=Object.assign(Object.assign({},$i()),{[e]:t});return new de("auth","Firebase",r).create(e,{appName:n.name})}function ht(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return hn.create(n,...e)}function u(n,e,...t){if(!n)throw ht(e,...t)}function S(n){const e="INTERNAL ASSERTION FAILED: "+n;throw we(e),new Error(e)}function A(n,e){n||S(e)}/**
347
347
  * @license
348
348
  * Copyright 2020 Google LLC
349
349
  *
@@ -358,7 +358,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
358
358
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
359
  * See the License for the specific language governing permissions and
360
360
  * limitations under the License.
361
- */function g(n,...e){throw qe(n,...e)}function _(n,...e){return qe(n,...e)}function si(n,e,t){const r=Object.assign(Object.assign({},ii()),{[e]:t});return new te("auth","Firebase",r).create(e,{appName:n.name})}function qe(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return Gt.create(n,...e)}function u(n,e,...t){if(!n)throw qe(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ue(e),new Error(e)}function w(n,e){n||y(e)}/**
361
+ */const xt=new Map;function k(n){A(n instanceof Function,"Expected a class definition");let e=xt.get(n);return e?(A(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,xt.set(n,e),e)}/**
362
362
  * @license
363
363
  * Copyright 2020 Google LLC
364
364
  *
@@ -373,7 +373,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
373
373
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
374
374
  * See the License for the specific language governing permissions and
375
375
  * limitations under the License.
376
- */const bt=new Map;function b(n){w(n instanceof Function,"Expected a class definition");let e=bt.get(n);return e?(w(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,bt.set(n,e),e)}/**
376
+ */function Hi(n,e){const t=cn(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(Re(s,e??{}))return i;b(i,"already-initialized")}return t.initialize({options:e})}function Vi(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(k);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}/**
377
377
  * @license
378
378
  * Copyright 2020 Google LLC
379
379
  *
@@ -388,7 +388,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
388
388
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
389
  * See the License for the specific language governing permissions and
390
390
  * limitations under the License.
391
- */function oi(n,e){const t=Vt(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(pe(s,e??{}))return i;g(i,"already-initialized")}return t.initialize({options:e})}function ai(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(b);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}/**
391
+ */function Ce(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function Wi(){return $t()==="http:"||$t()==="https:"}function $t(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -403,7 +403,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
403
403
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
404
404
  * See the License for the specific language governing permissions and
405
405
  * limitations under the License.
406
- */function je(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ci(){return wt()==="http:"||wt()==="https:"}function wt(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
406
+ */function ji(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Wi()||yr()||"connection"in navigator)?navigator.onLine:!0}function zi(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
407
407
  * @license
408
408
  * Copyright 2020 Google LLC
409
409
  *
@@ -418,7 +418,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
418
418
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
419
  * See the License for the specific language governing permissions and
420
420
  * limitations under the License.
421
- */function li(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ci()||Un()||"connection"in navigator)?navigator.onLine:!0}function ui(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
421
+ */class fe{constructor(e,t){this.shortDelay=e,this.longDelay=t,A(t>e,"Short delay should be less than long delay!"),this.isMobile=Ir()||br()}get(){return ji()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
422
422
  * @license
423
423
  * Copyright 2020 Google LLC
424
424
  *
@@ -433,7 +433,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
433
433
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
434
  * See the License for the specific language governing permissions and
435
435
  * limitations under the License.
436
- */class re{constructor(e,t){this.shortDelay=e,this.longDelay=t,w(t>e,"Short delay should be less than long delay!"),this.isMobile=Ln()||Bn()}get(){return li()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
436
+ */function ft(n,e){A(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
437
437
  * @license
438
438
  * Copyright 2020 Google LLC
439
439
  *
@@ -448,7 +448,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
448
448
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
449
  * See the License for the specific language governing permissions and
450
450
  * limitations under the License.
451
- */function Je(n,e){w(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
451
+ */class fn{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;S("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;S("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;S("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
452
452
  * @license
453
453
  * Copyright 2020 Google LLC
454
454
  *
@@ -463,7 +463,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
463
463
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
464
464
  * See the License for the specific language governing permissions and
465
465
  * limitations under the License.
466
- */class Kt{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
466
+ */const Gi={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error"};/**
467
467
  * @license
468
468
  * Copyright 2020 Google LLC
469
469
  *
@@ -478,7 +478,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
478
478
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
479
479
  * See the License for the specific language governing permissions and
480
480
  * limitations under the License.
481
- */const di={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error"};/**
481
+ */const Ki=new fe(3e4,6e4);function pe(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function ee(n,e,t,r,i={}){return pn(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=he(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),fn.fetch()(mn(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function pn(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Gi),e);try{const i=new qi(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Ie(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Ie(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Ie(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw Ie(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw Fi(n,d,l);b(n,d)}}catch(i){if(i instanceof U)throw i;b(n,"network-request-failed")}}async function Ue(n,e,t,r,i={}){const s=await ee(n,e,t,r,i);return"mfaPendingCredential"in s&&b(n,"multi-factor-auth-required",{_serverResponse:s}),s}function mn(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?ft(n.config,i):`${n.config.apiScheme}://${i}`}class qi{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(E(this.auth,"network-request-failed")),Ki.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Ie(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=E(n,e,r);return i.customData._tokenResponse=t,i}/**
482
482
  * @license
483
483
  * Copyright 2020 Google LLC
484
484
  *
@@ -493,7 +493,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
493
493
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
494
  * See the License for the specific language governing permissions and
495
495
  * limitations under the License.
496
- */const hi=new re(3e4,6e4);function ie(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function j(n,e,t,r,i={}){return qt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=ne(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Kt.fetch()(Jt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function qt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},di),e);try{const i=new fi(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw le(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw le(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw le(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw le(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw si(n,d,l);g(n,d)}}catch(i){if(i instanceof C)throw i;g(n,"network-request-failed")}}async function be(n,e,t,r,i={}){const s=await j(n,e,t,r,i);return"mfaPendingCredential"in s&&g(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Jt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?Je(n.config,i):`${n.config.apiScheme}://${i}`}class fi{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),hi.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function le(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=_(n,e,r);return i.customData._tokenResponse=t,i}/**
496
+ */async function Ji(n,e){return ee(n,"POST","/v1/accounts:delete",e)}async function Yi(n,e){return ee(n,"POST","/v1/accounts:lookup",e)}/**
497
497
  * @license
498
498
  * Copyright 2020 Google LLC
499
499
  *
@@ -508,7 +508,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
508
508
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
509
  * See the License for the specific language governing permissions and
510
510
  * limitations under the License.
511
- */async function pi(n,e){return j(n,"POST","/v1/accounts:delete",e)}async function mi(n,e){return j(n,"POST","/v1/accounts:lookup",e)}/**
511
+ */function se(n){if(!!n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Xi(n,e=!1){const t=B(n),r=await t.getIdToken(e),i=pt(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:se(tt(i.auth_time)),issuedAtTime:se(tt(i.iat)),expirationTime:se(tt(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function tt(n){return Number(n)*1e3}function pt(n){var e;const[t,r,i]=n.split(".");if(t===void 0||r===void 0||i===void 0)return we("JWT malformed, contained fewer than 3 sections"),null;try{const s=_r(r);return s?JSON.parse(s):(we("Failed to decode base64 JWT payload"),null)}catch(s){return we("Caught error parsing JWT payload as JSON",(e=s)===null||e===void 0?void 0:e.toString()),null}}function Qi(n){const e=pt(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
512
512
  * @license
513
513
  * Copyright 2020 Google LLC
514
514
  *
@@ -523,7 +523,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
523
523
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
524
  * See the License for the specific language governing permissions and
525
525
  * limitations under the License.
526
- */function J(n){if(!!n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function gi(n,e=!1){const t=W(n),r=await t.getIdToken(e),i=Ye(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:J(xe(i.auth_time)),issuedAtTime:J(xe(i.iat)),expirationTime:J(xe(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function xe(n){return Number(n)*1e3}function Ye(n){var e;const[t,r,i]=n.split(".");if(t===void 0||r===void 0||i===void 0)return ue("JWT malformed, contained fewer than 3 sections"),null;try{const s=Nn(r);return s?JSON.parse(s):(ue("Failed to decode base64 JWT payload"),null)}catch(s){return ue("Caught error parsing JWT payload as JSON",(e=s)===null||e===void 0?void 0:e.toString()),null}}function _i(n){const e=Ye(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
526
+ */async function ce(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof U&&Zi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function Zi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
527
527
  * @license
528
528
  * Copyright 2020 Google LLC
529
529
  *
@@ -538,7 +538,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
538
538
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
539
  * See the License for the specific language governing permissions and
540
540
  * limitations under the License.
541
- */async function Q(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof C&&vi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function vi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
541
+ */class es{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){!this.isRunning||(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){var e;try{await this.user.getIdToken(!0)}catch(t){((e=t)===null||e===void 0?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
542
542
  * @license
543
543
  * Copyright 2020 Google LLC
544
544
  *
@@ -553,22 +553,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
553
553
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
554
  * See the License for the specific language governing permissions and
555
555
  * limitations under the License.
556
- */class Ii{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){!this.isRunning||(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){var e;try{await this.user.getIdToken(!0)}catch(t){((e=t)===null||e===void 0?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
557
- * @license
558
- * Copyright 2020 Google LLC
559
- *
560
- * Licensed under the Apache License, Version 2.0 (the "License");
561
- * you may not use this file except in compliance with the License.
562
- * You may obtain a copy of the License at
563
- *
564
- * http://www.apache.org/licenses/LICENSE-2.0
565
- *
566
- * Unless required by applicable law or agreed to in writing, software
567
- * distributed under the License is distributed on an "AS IS" BASIS,
568
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
- * See the License for the specific language governing permissions and
570
- * limitations under the License.
571
- */class Yt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=J(this.lastLoginAt),this.creationTime=J(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
556
+ */class gn{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=se(this.lastLoginAt),this.creationTime=se(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
572
557
  * @license
573
558
  * Copyright 2019 Google LLC
574
559
  *
@@ -583,7 +568,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
583
568
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
569
  * See the License for the specific language governing permissions and
585
570
  * limitations under the License.
586
- */async function ge(n){var e;const t=n.auth,r=await n.getIdToken(),i=await Q(n,mi(t,{idToken:r}));u(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?wi(s.providerUserInfo):[],a=bi(n.providerData,o),c=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!a?.length,d=c?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new Yt(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function yi(n){const e=W(n);await ge(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function bi(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function wi(n){return n.map(e=>{var{providerId:t}=e,r=Ke(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
571
+ */async function De(n){var e;const t=n.auth,r=await n.getIdToken(),i=await ce(n,Yi(t,{idToken:r}));u(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?rs(s.providerUserInfo):[],a=ns(n.providerData,o),c=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!a?.length,d=c?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new gn(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function ts(n){const e=B(n);await De(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function ns(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function rs(n){return n.map(e=>{var{providerId:t}=e,r=dt(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
587
572
  * @license
588
573
  * Copyright 2020 Google LLC
589
574
  *
@@ -598,7 +583,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
598
583
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
584
  * See the License for the specific language governing permissions and
600
585
  * limitations under the License.
601
- */async function Ei(n,e){const t=await qt(n,{},async()=>{const r=ne({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Jt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Kt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
586
+ */async function is(n,e){const t=await pn(n,{},async()=>{const r=he({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=mn(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",fn.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
602
587
  * @license
603
588
  * Copyright 2020 Google LLC
604
589
  *
@@ -613,7 +598,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
613
598
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
599
  * See the License for the specific language governing permissions and
615
600
  * limitations under the License.
616
- */class Z{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):_i(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return u(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await Ei(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Z;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Z,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
601
+ */class le{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Qi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return u(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await is(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new le;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new le,this.toJSON())}_performRefresh(){return S("not implemented")}}/**
617
602
  * @license
618
603
  * Copyright 2020 Google LLC
619
604
  *
@@ -628,7 +613,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
628
613
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
614
  * See the License for the specific language governing permissions and
630
615
  * limitations under the License.
631
- */function T(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class P{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=Ke(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Ii(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Yt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Q(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return gi(this,e)}reload(){return yi(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new P(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await ge(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Q(this,pi(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,a,c,l,d;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,m=(i=t.email)!==null&&i!==void 0?i:void 0,I=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,rt=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Se=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,it=(l=t.createdAt)!==null&&l!==void 0?l:void 0,st=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:ke,emailVerified:ot,isAnonymous:at,providerData:Re,stsTokenManager:ct}=t;u(ke&&ct,e,"internal-error");const yn=Z.fromJSON(this.name,ct);u(typeof ke=="string",e,"internal-error"),T(f,e.name),T(m,e.name),u(typeof ot=="boolean",e,"internal-error"),u(typeof at=="boolean",e,"internal-error"),T(I,e.name),T(U,e.name),T(rt,e.name),T(Se,e.name),T(it,e.name),T(st,e.name);const Ae=new P({uid:ke,auth:e,email:m,emailVerified:ot,displayName:f,isAnonymous:at,photoURL:U,phoneNumber:I,tenantId:rt,stsTokenManager:yn,createdAt:it,lastLoginAt:st});return Re&&Array.isArray(Re)&&(Ae.providerData=Re.map(bn=>Object.assign({},bn))),Se&&(Ae._redirectEventId=Se),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new Z;i.updateFromServerResponse(t);const s=new P({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await ge(s),s}}/**
616
+ */function C(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class H{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=dt(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new es(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new gn(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await ce(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Xi(this,e)}reload(){return ts(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new H(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await De(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await ce(this,Ji(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,a,c,l,d;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,p=(i=t.email)!==null&&i!==void 0?i:void 0,y=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,R=(o=t.photoURL)!==null&&o!==void 0?o:void 0,g=(a=t.tenantId)!==null&&a!==void 0?a:void 0,_=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,O=(l=t.createdAt)!==null&&l!==void 0?l:void 0,ve=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:te,emailVerified:wt,isAnonymous:Et,providerData:Ve,stsTokenManager:Tt}=t;u(te&&Tt,e,"internal-error");const qn=le.fromJSON(this.name,Tt);u(typeof te=="string",e,"internal-error"),C(f,e.name),C(p,e.name),u(typeof wt=="boolean",e,"internal-error"),u(typeof Et=="boolean",e,"internal-error"),C(y,e.name),C(R,e.name),C(g,e.name),C(_,e.name),C(O,e.name),C(ve,e.name);const We=new H({uid:te,auth:e,email:p,emailVerified:wt,displayName:f,isAnonymous:Et,photoURL:R,phoneNumber:y,tenantId:g,stsTokenManager:qn,createdAt:O,lastLoginAt:ve});return Ve&&Array.isArray(Ve)&&(We.providerData=Ve.map(Jn=>Object.assign({},Jn))),_&&(We._redirectEventId=_),We}static async _fromIdTokenResponse(e,t,r=!1){const i=new le;i.updateFromServerResponse(t);const s=new H({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await De(s),s}}/**
632
617
  * @license
633
618
  * Copyright 2019 Google LLC
634
619
  *
@@ -643,7 +628,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
643
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
629
  * See the License for the specific language governing permissions and
645
630
  * limitations under the License.
646
- */class Xt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Xt.type="NONE";const Et=Xt;/**
631
+ */class _n{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}_n.type="NONE";const Ft=_n;/**
647
632
  * @license
648
633
  * Copyright 2019 Google LLC
649
634
  *
@@ -658,7 +643,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
658
643
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
644
  * See the License for the specific language governing permissions and
660
645
  * limitations under the License.
661
- */function de(n,e,t){return`firebase:${n}:${e}:${t}`}class F{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=de(this.userKey,i.apiKey,s),this.fullPersistenceKey=de("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?P._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new F(b(Et),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||b(Et);const o=de(r,e.config.apiKey,e.name);let a=null;for(const l of t)try{const d=await l._get(o);if(d){const f=P._fromJSON(e,d);l!==s&&(a=f),s=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new F(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new F(s,e,r))}}/**
646
+ */function Ee(n,e,t){return`firebase:${n}:${e}:${t}`}class J{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Ee(this.userKey,i.apiKey,s),this.fullPersistenceKey=Ee("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?H._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new J(k(Ft),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||k(Ft);const o=Ee(r,e.config.apiKey,e.name);let a=null;for(const l of t)try{const d=await l._get(o);if(d){const f=H._fromJSON(e,d);l!==s&&(a=f),s=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new J(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new J(s,e,r))}}/**
662
647
  * @license
663
648
  * Copyright 2020 Google LLC
664
649
  *
@@ -673,7 +658,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
673
658
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
674
659
  * See the License for the specific language governing permissions and
675
660
  * limitations under the License.
676
- */function Tt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(en(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Qt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(nn(e))return"Blackberry";if(rn(e))return"Webos";if(Xe(e))return"Safari";if((e.includes("chrome/")||Zt(e))&&!e.includes("edge/"))return"Chrome";if(tn(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Qt(n=p()){return/firefox\//i.test(n)}function Xe(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Zt(n=p()){return/crios\//i.test(n)}function en(n=p()){return/iemobile/i.test(n)}function tn(n=p()){return/android/i.test(n)}function nn(n=p()){return/blackberry/i.test(n)}function rn(n=p()){return/webos/i.test(n)}function we(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Ti(n=p()){var e;return we(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Si(){return xn()&&document.documentMode===10}function sn(n=p()){return we(n)||tn(n)||rn(n)||nn(n)||/windows phone/i.test(n)||en(n)}function ki(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
661
+ */function Ht(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(yn(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(vn(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(wn(e))return"Blackberry";if(En(e))return"Webos";if(mt(e))return"Safari";if((e.includes("chrome/")||In(e))&&!e.includes("edge/"))return"Chrome";if(bn(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function vn(n=m()){return/firefox\//i.test(n)}function mt(n=m()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function In(n=m()){return/crios\//i.test(n)}function yn(n=m()){return/iemobile/i.test(n)}function bn(n=m()){return/android/i.test(n)}function wn(n=m()){return/blackberry/i.test(n)}function En(n=m()){return/webos/i.test(n)}function Be(n=m()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function ss(n=m()){var e;return Be(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function os(){return wr()&&document.documentMode===10}function Tn(n=m()){return Be(n)||bn(n)||En(n)||wn(n)||/windows phone/i.test(n)||yn(n)}function as(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
677
662
  * @license
678
663
  * Copyright 2020 Google LLC
679
664
  *
@@ -688,7 +673,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
688
673
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
689
674
  * See the License for the specific language governing permissions and
690
675
  * limitations under the License.
691
- */function on(n,e=[]){let t;switch(n){case"Browser":t=Tt(p());break;case"Worker":t=`${Tt(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${ye}/${r}`}/**
676
+ */function Sn(n,e=[]){let t;switch(n){case"Browser":t=Ht(m());break;case"Worker":t=`${Ht(m())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Me}/${r}`}/**
692
677
  * @license
693
678
  * Copyright 2022 Google LLC
694
679
  *
@@ -703,7 +688,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
703
688
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
704
689
  * See the License for the specific language governing permissions and
705
690
  * limitations under the License.
706
- */class Ri{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){var t;if(this.auth.currentUser===e)return;const r=[];try{for(const i of this.queue)await i(e),i.onAbort&&r.push(i.onAbort)}catch(i){r.reverse();for(const s of r)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:(t=i)===null||t===void 0?void 0:t.message})}}}/**
691
+ */class cs{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){var t;if(this.auth.currentUser===e)return;const r=[];try{for(const i of this.queue)await i(e),i.onAbort&&r.push(i.onAbort)}catch(i){r.reverse();for(const s of r)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:(t=i)===null||t===void 0?void 0:t.message})}}}/**
707
692
  * @license
708
693
  * Copyright 2020 Google LLC
709
694
  *
@@ -718,7 +703,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
718
703
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
719
704
  * See the License for the specific language governing permissions and
720
705
  * limitations under the License.
721
- */class Ai{constructor(e,t,r){this.app=e,this.heartbeatServiceProvider=t,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new St(this),this.idTokenSubscription=new St(this),this.beforeStateQueue=new Ri(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Gt,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=b(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await F.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i?._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&c?.user&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){var t;try{await ge(e)}catch(r){if(((t=r)===null||t===void 0?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ui()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?W(e):null;return t&&u(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(b(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new te("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&b(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[b(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return u(o,this,"internal-error"),o.then(()=>s(this.currentUser)),typeof t=="function"?e.addObserver(t,r,i):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=on(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={["X-Client-Version"]:this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());return r&&(t["X-Firebase-Client"]=r),t}}function Qe(n){return W(n)}class St{constructor(e){this.auth=e,this.observer=null,this.addObserver=zn(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
706
+ */class ls{constructor(e,t,r){this.app=e,this.heartbeatServiceProvider=t,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Vt(this),this.idTokenSubscription=new Vt(this),this.beforeStateQueue=new cs(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=hn,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=k(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await J.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i?._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&c?.user&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){var t;try{await De(e)}catch(r){if(((t=r)===null||t===void 0?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=zi()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?B(e):null;return t&&u(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(k(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new de("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&k(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await J.create(this,[k(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return u(o,this,"internal-error"),o.then(()=>s(this.currentUser)),typeof t=="function"?e.addObserver(t,r,i):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Sn(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={["X-Client-Version"]:this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());return r&&(t["X-Firebase-Client"]=r),t}}function gt(n){return B(n)}class Vt{constructor(e){this.auth=e,this.observer=null,this.addObserver=Or(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
722
707
  * @license
723
708
  * Copyright 2020 Google LLC
724
709
  *
@@ -733,7 +718,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
733
718
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
719
  * See the License for the specific language governing permissions and
735
720
  * limitations under the License.
736
- */class Ze{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return y("not implemented")}_getIdTokenResponse(e){return y("not implemented")}_linkToIdToken(e,t){return y("not implemented")}_getReauthenticationResolver(e){return y("not implemented")}}async function Oi(n,e){return j(n,"POST","/v1/accounts:update",e)}/**
721
+ */class _t{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return S("not implemented")}_getIdTokenResponse(e){return S("not implemented")}_linkToIdToken(e,t){return S("not implemented")}_getReauthenticationResolver(e){return S("not implemented")}}async function us(n,e){return ee(n,"POST","/v1/accounts:update",e)}/**
737
722
  * @license
738
723
  * Copyright 2020 Google LLC
739
724
  *
@@ -748,7 +733,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
748
733
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
734
  * See the License for the specific language governing permissions and
750
735
  * limitations under the License.
751
- */async function Ci(n,e){return be(n,"POST","/v1/accounts:signInWithPassword",ie(n,e))}async function Di(n,e){return j(n,"POST","/v1/accounts:sendOobCode",ie(n,e))}async function Pi(n,e){return Di(n,e)}/**
736
+ */async function ds(n,e){return Ue(n,"POST","/v1/accounts:signInWithPassword",pe(n,e))}async function hs(n,e){return ee(n,"POST","/v1/accounts:sendOobCode",pe(n,e))}async function fs(n,e){return hs(n,e)}/**
752
737
  * @license
753
738
  * Copyright 2020 Google LLC
754
739
  *
@@ -763,7 +748,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
763
748
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
749
  * See the License for the specific language governing permissions and
765
750
  * limitations under the License.
766
- */async function Ni(n,e){return be(n,"POST","/v1/accounts:signInWithEmailLink",ie(n,e))}async function Mi(n,e){return be(n,"POST","/v1/accounts:signInWithEmailLink",ie(n,e))}/**
751
+ */async function ps(n,e){return Ue(n,"POST","/v1/accounts:signInWithEmailLink",pe(n,e))}async function ms(n,e){return Ue(n,"POST","/v1/accounts:signInWithEmailLink",pe(n,e))}/**
767
752
  * @license
768
753
  * Copyright 2020 Google LLC
769
754
  *
@@ -778,7 +763,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
778
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779
764
  * See the License for the specific language governing permissions and
780
765
  * limitations under the License.
781
- */class ee extends Ze{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ee(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ee(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Ci(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Ni(e,{email:this._email,oobCode:this._password});default:g(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Oi(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Mi(e,{idToken:t,email:this._email,oobCode:this._password});default:g(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
766
+ */class ue extends _t{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ue(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ue(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return ds(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return ps(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return us(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return ms(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
782
767
  * @license
783
768
  * Copyright 2020 Google LLC
784
769
  *
@@ -793,7 +778,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
793
778
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
794
779
  * See the License for the specific language governing permissions and
795
780
  * limitations under the License.
796
- */async function $(n,e){return be(n,"POST","/v1/accounts:signInWithIdp",ie(n,e))}/**
781
+ */async function Y(n,e){return Ue(n,"POST","/v1/accounts:signInWithIdp",pe(n,e))}/**
797
782
  * @license
798
783
  * Copyright 2020 Google LLC
799
784
  *
@@ -808,7 +793,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
808
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
794
  * See the License for the specific language governing permissions and
810
795
  * limitations under the License.
811
- */const Li="http://localhost";class L extends Ze{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new L(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):g("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=Ke(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new L(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return $(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,$(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,$(e,t)}buildRequest(){const e={requestUri:Li,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ne(t)}return e}}/**
796
+ */const gs="http://localhost";class j extends _t{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new j(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):b("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=dt(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new j(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return Y(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,Y(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Y(e,t)}buildRequest(){const e={requestUri:gs,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=he(t)}return e}}/**
812
797
  * @license
813
798
  * Copyright 2020 Google LLC
814
799
  *
@@ -823,7 +808,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
823
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
824
809
  * See the License for the specific language governing permissions and
825
810
  * limitations under the License.
826
- */function Ui(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Bi(n){const e=K(q(n)).link,t=e?K(q(e)).deep_link_id:null,r=K(q(n)).deep_link_id;return(r?K(q(r)).link:null)||r||t||e||n}class et{constructor(e){var t,r,i,s,o,a;const c=K(q(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,d=(r=c.oobCode)!==null&&r!==void 0?r:null,f=Ui((i=c.mode)!==null&&i!==void 0?i:null);u(l&&d&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=Bi(e);try{return new et(t)}catch{return null}}}/**
811
+ */function _s(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function vs(n){const e=re(ie(n)).link,t=e?re(ie(e)).deep_link_id:null,r=re(ie(n)).deep_link_id;return(r?re(ie(r)).link:null)||r||t||e||n}class xe{constructor(e){var t,r,i,s,o,a;const c=re(ie(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,d=(r=c.oobCode)!==null&&r!==void 0?r:null,f=_s((i=c.mode)!==null&&i!==void 0?i:null);u(l&&d&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=vs(e);try{return new xe(t)}catch{return null}}}/**
827
812
  * @license
828
813
  * Copyright 2020 Google LLC
829
814
  *
@@ -838,7 +823,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
838
823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
824
  * See the License for the specific language governing permissions and
840
825
  * limitations under the License.
841
- */class z{constructor(){this.providerId=z.PROVIDER_ID}static credential(e,t){return ee._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=et.parseLink(t);return u(r,"argument-error"),ee._fromEmailAndCode(e,r.code,r.tenantId)}}z.PROVIDER_ID="password";z.EMAIL_PASSWORD_SIGN_IN_METHOD="password";z.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
826
+ */class z{constructor(){this.providerId=z.PROVIDER_ID}static credential(e,t){return ue._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=xe.parseLink(t);return u(r,"argument-error"),ue._fromEmailAndCode(e,r.code,r.tenantId)}}z.PROVIDER_ID="password";z.EMAIL_PASSWORD_SIGN_IN_METHOD="password";z.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
842
827
  * @license
843
828
  * Copyright 2020 Google LLC
844
829
  *
@@ -853,7 +838,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
853
838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854
839
  * See the License for the specific language governing permissions and
855
840
  * limitations under the License.
856
- */class an{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
841
+ */class kn{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
857
842
  * @license
858
843
  * Copyright 2019 Google LLC
859
844
  *
@@ -868,7 +853,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
868
853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
869
854
  * See the License for the specific language governing permissions and
870
855
  * limitations under the License.
871
- */class se extends an{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
856
+ */class me extends kn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
872
857
  * @license
873
858
  * Copyright 2020 Google LLC
874
859
  *
@@ -883,7 +868,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
883
868
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
869
  * See the License for the specific language governing permissions and
885
870
  * limitations under the License.
886
- */class S extends se{constructor(){super("facebook.com")}static credential(e){return L._fromParams({providerId:S.PROVIDER_ID,signInMethod:S.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return S.credentialFromTaggedObject(e)}static credentialFromError(e){return S.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return S.credential(e.oauthAccessToken)}catch{return null}}}S.FACEBOOK_SIGN_IN_METHOD="facebook.com";S.PROVIDER_ID="facebook.com";/**
871
+ */class D extends me{constructor(){super("facebook.com")}static credential(e){return j._fromParams({providerId:D.PROVIDER_ID,signInMethod:D.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return D.credentialFromTaggedObject(e)}static credentialFromError(e){return D.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return D.credential(e.oauthAccessToken)}catch{return null}}}D.FACEBOOK_SIGN_IN_METHOD="facebook.com";D.PROVIDER_ID="facebook.com";/**
887
872
  * @license
888
873
  * Copyright 2020 Google LLC
889
874
  *
@@ -898,7 +883,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
898
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
884
  * See the License for the specific language governing permissions and
900
885
  * limitations under the License.
901
- */class k extends se{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return L._fromParams({providerId:k.PROVIDER_ID,signInMethod:k.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return k.credentialFromTaggedObject(e)}static credentialFromError(e){return k.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return k.credential(t,r)}catch{return null}}}k.GOOGLE_SIGN_IN_METHOD="google.com";k.PROVIDER_ID="google.com";/**
886
+ */class N extends me{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return j._fromParams({providerId:N.PROVIDER_ID,signInMethod:N.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return N.credentialFromTaggedObject(e)}static credentialFromError(e){return N.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return N.credential(t,r)}catch{return null}}}N.GOOGLE_SIGN_IN_METHOD="google.com";N.PROVIDER_ID="google.com";/**
902
887
  * @license
903
888
  * Copyright 2020 Google LLC
904
889
  *
@@ -913,7 +898,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
913
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
899
  * See the License for the specific language governing permissions and
915
900
  * limitations under the License.
916
- */class R extends se{constructor(){super("github.com")}static credential(e){return L._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return R.credential(e.oauthAccessToken)}catch{return null}}}R.GITHUB_SIGN_IN_METHOD="github.com";R.PROVIDER_ID="github.com";/**
901
+ */class P extends me{constructor(){super("github.com")}static credential(e){return j._fromParams({providerId:P.PROVIDER_ID,signInMethod:P.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return P.credentialFromTaggedObject(e)}static credentialFromError(e){return P.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return P.credential(e.oauthAccessToken)}catch{return null}}}P.GITHUB_SIGN_IN_METHOD="github.com";P.PROVIDER_ID="github.com";/**
917
902
  * @license
918
903
  * Copyright 2020 Google LLC
919
904
  *
@@ -928,7 +913,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
928
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
929
914
  * See the License for the specific language governing permissions and
930
915
  * limitations under the License.
931
- */class A extends se{constructor(){super("twitter.com")}static credential(e,t){return L._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return A.credential(t,r)}catch{return null}}}A.TWITTER_SIGN_IN_METHOD="twitter.com";A.PROVIDER_ID="twitter.com";/**
916
+ */class L extends me{constructor(){super("twitter.com")}static credential(e,t){return j._fromParams({providerId:L.PROVIDER_ID,signInMethod:L.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return L.credentialFromTaggedObject(e)}static credentialFromError(e){return L.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return L.credential(t,r)}catch{return null}}}L.TWITTER_SIGN_IN_METHOD="twitter.com";L.PROVIDER_ID="twitter.com";/**
932
917
  * @license
933
918
  * Copyright 2020 Google LLC
934
919
  *
@@ -943,7 +928,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
943
928
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
944
929
  * See the License for the specific language governing permissions and
945
930
  * limitations under the License.
946
- */class V{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await P._fromIdTokenResponse(e,r,i),o=kt(r);return new V({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=kt(r);return new V({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function kt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
931
+ */class Q{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await H._fromIdTokenResponse(e,r,i),o=Wt(r);return new Q({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=Wt(r);return new Q({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function Wt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
947
932
  * @license
948
933
  * Copyright 2020 Google LLC
949
934
  *
@@ -958,7 +943,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
958
943
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
959
944
  * See the License for the specific language governing permissions and
960
945
  * limitations under the License.
961
- */class _e extends C{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,_e.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new _e(e,t,r,i)}}function cn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?_e._fromErrorAndOperation(n,s,e,r):s})}async function xi(n,e,t=!1){const r=await Q(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return V._forOperation(n,"link",r)}/**
946
+ */class Ne extends U{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Ne.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new Ne(e,t,r,i)}}function An(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Ne._fromErrorAndOperation(n,s,e,r):s})}async function Is(n,e,t=!1){const r=await ce(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return Q._forOperation(n,"link",r)}/**
962
947
  * @license
963
948
  * Copyright 2019 Google LLC
964
949
  *
@@ -973,7 +958,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
973
958
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
974
959
  * See the License for the specific language governing permissions and
975
960
  * limitations under the License.
976
- */async function Fi(n,e,t=!1){var r;const{auth:i}=n,s="reauthenticate";try{const o=await Q(n,cn(i,s,e,n),t);u(o.idToken,i,"internal-error");const a=Ye(o.idToken);u(a,i,"internal-error");const{sub:c}=a;return u(n.uid===c,i,"user-mismatch"),V._forOperation(n,s,o)}catch(o){throw((r=o)===null||r===void 0?void 0:r.code)==="auth/user-not-found"&&g(i,"user-mismatch"),o}}/**
961
+ */async function ys(n,e,t=!1){var r;const{auth:i}=n,s="reauthenticate";try{const o=await ce(n,An(i,s,e,n),t);u(o.idToken,i,"internal-error");const a=pt(o.idToken);u(a,i,"internal-error");const{sub:c}=a;return u(n.uid===c,i,"user-mismatch"),Q._forOperation(n,s,o)}catch(o){throw((r=o)===null||r===void 0?void 0:r.code)==="auth/user-not-found"&&b(i,"user-mismatch"),o}}/**
977
962
  * @license
978
963
  * Copyright 2020 Google LLC
979
964
  *
@@ -988,7 +973,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
988
973
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
974
  * See the License for the specific language governing permissions and
990
975
  * limitations under the License.
991
- */async function ln(n,e,t=!1){const r="signIn",i=await cn(n,r,e),s=await V._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function $i(n,e){return ln(Qe(n),e)}/**
976
+ */async function Rn(n,e,t=!1){const r="signIn",i=await An(n,r,e),s=await Q._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function On(n,e){return Rn(gt(n),e)}/**
992
977
  * @license
993
978
  * Copyright 2020 Google LLC
994
979
  *
@@ -1003,7 +988,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1003
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
989
  * See the License for the specific language governing permissions and
1005
990
  * limitations under the License.
1006
- */function Hi(n,e,t){var r;u(((r=t.url)===null||r===void 0?void 0:r.length)>0,n,"invalid-continue-uri"),u(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(u(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(u(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}function Vi(n,e,t){return $i(W(n),z.credential(e,t))}/**
991
+ */function bs(n,e,t){var r;u(((r=t.url)===null||r===void 0?void 0:r.length)>0,n,"invalid-continue-uri"),u(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(u(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(u(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}function ws(n,e,t){return On(B(n),z.credential(e,t))}/**
1007
992
  * @license
1008
993
  * Copyright 2020 Google LLC
1009
994
  *
@@ -1018,7 +1003,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1018
1003
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1004
  * See the License for the specific language governing permissions and
1020
1005
  * limitations under the License.
1021
- */async function Wi(n,e,t){const r=W(n),i={requestType:"EMAIL_SIGNIN",email:e};u(t.handleCodeInApp,r,"argument-error"),t&&Hi(r,i,t),await Pi(r,i)}const ve="__sak";/**
1006
+ */async function Es(n,e,t){const r=B(n),i={requestType:"EMAIL_SIGNIN",email:e};u(t.handleCodeInApp,r,"argument-error"),t&&bs(r,i,t),await fs(r,i)}function Ts(n,e){const t=xe.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function Ss(n,e,t){const r=B(n),i=z.credentialWithLink(e,t||Ce());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),On(r,i)}function ks(n,e,t,r){return B(n).onAuthStateChanged(e,t,r)}const Pe="__sak";/**
1022
1007
  * @license
1023
1008
  * Copyright 2019 Google LLC
1024
1009
  *
@@ -1033,7 +1018,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1033
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1019
  * See the License for the specific language governing permissions and
1035
1020
  * limitations under the License.
1036
- */class un{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(ve,"1"),this.storage.removeItem(ve),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1021
+ */class Cn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Pe,"1"),this.storage.removeItem(Pe),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1037
1022
  * @license
1038
1023
  * Copyright 2020 Google LLC
1039
1024
  *
@@ -1048,7 +1033,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1048
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1034
  * See the License for the specific language governing permissions and
1050
1035
  * limitations under the License.
1051
- */function ji(){const n=p();return Xe(n)||we(n)}const zi=1e3,Gi=10;class dn extends un{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=ji()&&ki(),this.fallbackToPolling=sn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);Si()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Gi):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},zi)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}dn.type="LOCAL";const Ki=dn;/**
1036
+ */function As(){const n=m();return mt(n)||Be(n)}const Rs=1e3,Os=10;class Dn extends Cn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=As()&&as(),this.fallbackToPolling=Tn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);os()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Os):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Rs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Dn.type="LOCAL";const Cs=Dn;/**
1052
1037
  * @license
1053
1038
  * Copyright 2020 Google LLC
1054
1039
  *
@@ -1063,7 +1048,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1063
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1049
  * See the License for the specific language governing permissions and
1065
1050
  * limitations under the License.
1066
- */class hn extends un{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}hn.type="SESSION";const fn=hn;/**
1051
+ */class Nn extends Cn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Nn.type="SESSION";const Pn=Nn;/**
1067
1052
  * @license
1068
1053
  * Copyright 2019 Google LLC
1069
1054
  *
@@ -1078,7 +1063,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1078
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1064
  * See the License for the specific language governing permissions and
1080
1065
  * limitations under the License.
1081
- */function qi(n){return Promise.all(n.map(async e=>{try{const t=await e;return{fulfilled:!0,value:t}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1066
+ */function Ds(n){return Promise.all(n.map(async e=>{try{const t=await e;return{fulfilled:!0,value:t}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1082
1067
  * @license
1083
1068
  * Copyright 2019 Google LLC
1084
1069
  *
@@ -1093,7 +1078,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1093
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1079
  * See the License for the specific language governing permissions and
1095
1080
  * limitations under the License.
1096
- */class Ee{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new Ee(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await qi(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Ee.receivers=[];/**
1081
+ */class $e{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new $e(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await Ds(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}$e.receivers=[];/**
1097
1082
  * @license
1098
1083
  * Copyright 2020 Google LLC
1099
1084
  *
@@ -1108,7 +1093,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1108
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
1094
  * See the License for the specific language governing permissions and
1110
1095
  * limitations under the License.
1111
- */function tt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1096
+ */function vt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1112
1097
  * @license
1113
1098
  * Copyright 2019 Google LLC
1114
1099
  *
@@ -1123,7 +1108,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1123
1108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1124
1109
  * See the License for the specific language governing permissions and
1125
1110
  * limitations under the License.
1126
- */class Ji{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=tt("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const m=f;if(m.data.eventId===l)switch(m.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(m.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1111
+ */class Ns{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=vt("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const p=f;if(p.data.eventId===l)switch(p.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1127
1112
  * @license
1128
1113
  * Copyright 2020 Google LLC
1129
1114
  *
@@ -1138,7 +1123,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1138
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1139
1124
  * See the License for the specific language governing permissions and
1140
1125
  * limitations under the License.
1141
- */function v(){return window}function Yi(n){v().location.href=n}/**
1126
+ */function T(){return window}function Ps(n){T().location.href=n}/**
1142
1127
  * @license
1143
1128
  * Copyright 2020 Google LLC.
1144
1129
  *
@@ -1153,7 +1138,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1153
1138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1154
1139
  * See the License for the specific language governing permissions and
1155
1140
  * limitations under the License.
1156
- */function pn(){return typeof v().WorkerGlobalScope<"u"&&typeof v().importScripts=="function"}async function Xi(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Qi(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Zi(){return pn()?self:null}/**
1141
+ */function Ln(){return typeof T().WorkerGlobalScope<"u"&&typeof T().importScripts=="function"}async function Ls(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Ms(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Us(){return Ln()?self:null}/**
1157
1142
  * @license
1158
1143
  * Copyright 2019 Google LLC
1159
1144
  *
@@ -1168,7 +1153,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1168
1153
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
1154
  * See the License for the specific language governing permissions and
1170
1155
  * limitations under the License.
1171
- */const mn="firebaseLocalStorageDb",es=1,Ie="firebaseLocalStorage",gn="fbase_key";class oe{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Te(n,e){return n.transaction([Ie],e?"readwrite":"readonly").objectStore(Ie)}function ts(){const n=indexedDB.deleteDatabase(mn);return new oe(n).toPromise()}function ze(){const n=indexedDB.open(mn,es);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Ie,{keyPath:gn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Ie)?e(r):(r.close(),await ts(),e(await ze()))})})}async function Rt(n,e,t){const r=Te(n,!0).put({[gn]:e,value:t});return new oe(r).toPromise()}async function ns(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function At(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const rs=800,is=3;class _n{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await ze(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>is)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return pn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ee._getInstance(Zi()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Xi(),!this.activeServiceWorker)return;this.sender=new Ji(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);!r||((e=r[0])===null||e===void 0?void 0:e.fulfilled)&&((t=r[0])===null||t===void 0?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Qi()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await ze();return await Rt(e,ve,"1"),await At(e,ve),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Rt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>ns(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>At(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Te(i,!1).getAll();return new oe(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),rs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}_n.type="LOCAL";const ss=_n;/**
1156
+ */const Mn="firebaseLocalStorageDb",Bs=1,Le="firebaseLocalStorage",Un="fbase_key";class ge{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Fe(n,e){return n.transaction([Le],e?"readwrite":"readonly").objectStore(Le)}function xs(){const n=indexedDB.deleteDatabase(Mn);return new ge(n).toPromise()}function at(){const n=indexedDB.open(Mn,Bs);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Le,{keyPath:Un})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Le)?e(r):(r.close(),await xs(),e(await at()))})})}async function jt(n,e,t){const r=Fe(n,!0).put({[Un]:e,value:t});return new ge(r).toPromise()}async function $s(n,e){const t=Fe(n,!1).get(e),r=await new ge(t).toPromise();return r===void 0?null:r.value}function zt(n,e){const t=Fe(n,!0).delete(e);return new ge(t).toPromise()}const Fs=800,Hs=3;class Bn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await at(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Hs)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Ln()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=$e._getInstance(Us()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Ls(),!this.activeServiceWorker)return;this.sender=new Ns(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);!r||((e=r[0])===null||e===void 0?void 0:e.fulfilled)&&((t=r[0])===null||t===void 0?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Ms()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await at();return await jt(e,Pe,"1"),await zt(e,Pe),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>jt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>$s(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>zt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Fe(i,!1).getAll();return new ge(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Fs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Bn.type="LOCAL";const Vs=Bn;/**
1172
1157
  * @license
1173
1158
  * Copyright 2020 Google LLC
1174
1159
  *
@@ -1183,7 +1168,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1183
1168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1184
1169
  * See the License for the specific language governing permissions and
1185
1170
  * limitations under the License.
1186
- */function os(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function as(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=_("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",os().appendChild(r)})}function cs(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new re(3e4,6e4);/**
1171
+ */function Ws(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function js(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=E("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Ws().appendChild(r)})}function zs(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new fe(3e4,6e4);/**
1187
1172
  * @license
1188
1173
  * Copyright 2021 Google LLC
1189
1174
  *
@@ -1198,7 +1183,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1198
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1184
  * See the License for the specific language governing permissions and
1200
1185
  * limitations under the License.
1201
- */function ls(n,e){return e?b(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1186
+ */function Gs(n,e){return e?k(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1202
1187
  * @license
1203
1188
  * Copyright 2019 Google LLC
1204
1189
  *
@@ -1213,7 +1198,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1213
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
1199
  * See the License for the specific language governing permissions and
1215
1200
  * limitations under the License.
1216
- */class nt extends Ze{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return $(e,this._buildIdpRequest())}_linkToIdToken(e,t){return $(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return $(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function us(n){return ln(n.auth,new nt(n),n.bypassAuthState)}function ds(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Fi(t,new nt(n),n.bypassAuthState)}async function hs(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),xi(t,new nt(n),n.bypassAuthState)}/**
1201
+ */class It extends _t{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Y(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Y(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Y(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Ks(n){return Rn(n.auth,new It(n),n.bypassAuthState)}function qs(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),ys(t,new It(n),n.bypassAuthState)}async function Js(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Is(t,new It(n),n.bypassAuthState)}/**
1217
1202
  * @license
1218
1203
  * Copyright 2020 Google LLC
1219
1204
  *
@@ -1228,7 +1213,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1228
1213
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1229
1214
  * See the License for the specific language governing permissions and
1230
1215
  * limitations under the License.
1231
- */class vn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return us;case"linkViaPopup":case"linkViaRedirect":return hs;case"reauthViaPopup":case"reauthViaRedirect":return ds;default:g(this.auth,"internal-error")}}resolve(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1216
+ */class xn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Ks;case"linkViaPopup":case"linkViaRedirect":return Js;case"reauthViaPopup":case"reauthViaRedirect":return qs;default:b(this.auth,"internal-error")}}resolve(e){A(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){A(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1232
1217
  * @license
1233
1218
  * Copyright 2020 Google LLC
1234
1219
  *
@@ -1243,7 +1228,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1243
1228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1229
  * See the License for the specific language governing permissions and
1245
1230
  * limitations under the License.
1246
- */const fs=new re(2e3,1e4);class B extends vn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,B.currentPopupAction&&B.currentPopupAction.cancel(),B.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){w(this.filter.length===1,"Popup operations only handle one event");const e=tt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(_(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,B.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,fs.get())};e()}}B.currentPopupAction=null;/**
1231
+ */const Ys=new fe(2e3,1e4);class K extends xn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,K.currentPopupAction&&K.currentPopupAction.cancel(),K.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){A(this.filter.length===1,"Popup operations only handle one event");const e=vt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(E(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(E(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,K.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(E(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,Ys.get())};e()}}K.currentPopupAction=null;/**
1247
1232
  * @license
1248
1233
  * Copyright 2020 Google LLC
1249
1234
  *
@@ -1258,7 +1243,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1258
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
1244
  * See the License for the specific language governing permissions and
1260
1245
  * limitations under the License.
1261
- */const ps="pendingRedirect",he=new Map;class ms extends vn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=he.get(this.auth._key());if(!e){try{const r=await gs(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}he.set(this.auth._key(),e)}return this.bypassAuthState||he.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function gs(n,e){const t=Is(e),r=vs(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function _s(n,e){he.set(n._key(),e)}function vs(n){return b(n._redirectPersistence)}function Is(n){return de(ps,n.config.apiKey,n.name)}async function ys(n,e,t=!1){const r=Qe(n),i=ls(r,e),o=await new ms(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1246
+ */const Xs="pendingRedirect",Te=new Map;class Qs extends xn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=Te.get(this.auth._key());if(!e){try{const r=await Zs(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}Te.set(this.auth._key(),e)}return this.bypassAuthState||Te.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Zs(n,e){const t=no(e),r=to(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function eo(n,e){Te.set(n._key(),e)}function to(n){return k(n._redirectPersistence)}function no(n){return Ee(Xs,n.config.apiKey,n.name)}async function ro(n,e,t=!1){const r=gt(n),i=Gs(r,e),o=await new Qs(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1262
1247
  * @license
1263
1248
  * Copyright 2020 Google LLC
1264
1249
  *
@@ -1273,7 +1258,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1273
1258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1259
  * See the License for the specific language governing permissions and
1275
1260
  * limitations under the License.
1276
- */const bs=10*60*1e3;class ws{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Es(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!In(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(_(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=bs&&this.cachedEventUids.clear(),this.cachedEventUids.has(Ot(e))}saveEventToCache(e){this.cachedEventUids.add(Ot(e)),this.lastProcessedEventTime=Date.now()}}function Ot(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function In({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Es(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return In(n);default:return!1}}/**
1261
+ */const io=10*60*1e3;class so{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!oo(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!$n(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(E(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=io&&this.cachedEventUids.clear(),this.cachedEventUids.has(Gt(e))}saveEventToCache(e){this.cachedEventUids.add(Gt(e)),this.lastProcessedEventTime=Date.now()}}function Gt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function $n({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function oo(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return $n(n);default:return!1}}/**
1277
1262
  * @license
1278
1263
  * Copyright 2020 Google LLC
1279
1264
  *
@@ -1288,7 +1273,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1288
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
1274
  * See the License for the specific language governing permissions and
1290
1275
  * limitations under the License.
1291
- */async function Ts(n,e={}){return j(n,"GET","/v1/projects",e)}/**
1276
+ */async function ao(n,e={}){return ee(n,"GET","/v1/projects",e)}/**
1292
1277
  * @license
1293
1278
  * Copyright 2020 Google LLC
1294
1279
  *
@@ -1303,7 +1288,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1303
1288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1289
  * See the License for the specific language governing permissions and
1305
1290
  * limitations under the License.
1306
- */const Ss=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ks=/^https?/;async function Rs(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Ts(n);for(const t of e)try{if(As(t))return}catch{}g(n,"unauthorized-domain")}function As(n){const e=je(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!ks.test(t))return!1;if(Ss.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1291
+ */const co=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,lo=/^https?/;async function uo(n){if(n.config.emulator)return;const{authorizedDomains:e}=await ao(n);for(const t of e)try{if(ho(t))return}catch{}b(n,"unauthorized-domain")}function ho(n){const e=Ce(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!lo.test(t))return!1;if(co.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1307
1292
  * @license
1308
1293
  * Copyright 2020 Google LLC.
1309
1294
  *
@@ -1318,7 +1303,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1318
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1319
1304
  * See the License for the specific language governing permissions and
1320
1305
  * limitations under the License.
1321
- */const Os=new re(3e4,6e4);function Ct(){const n=v().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function Cs(n){return new Promise((e,t)=>{var r,i,s;function o(){Ct(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ct(),t(_(n,"network-request-failed"))},timeout:Os.get()})}if(!((i=(r=v().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=v().gapi)===null||s===void 0)&&s.load)o();else{const a=cs("iframefcb");return v()[a]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},as(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw fe=null,e})}let fe=null;function Ds(n){return fe=fe||Cs(n),fe}/**
1306
+ */const fo=new fe(3e4,6e4);function Kt(){const n=T().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function po(n){return new Promise((e,t)=>{var r,i,s;function o(){Kt(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Kt(),t(E(n,"network-request-failed"))},timeout:fo.get()})}if(!((i=(r=T().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=T().gapi)===null||s===void 0)&&s.load)o();else{const a=zs("iframefcb");return T()[a]=()=>{gapi.load?o():t(E(n,"network-request-failed"))},js(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw Se=null,e})}let Se=null;function mo(n){return Se=Se||po(n),Se}/**
1322
1307
  * @license
1323
1308
  * Copyright 2020 Google LLC.
1324
1309
  *
@@ -1333,7 +1318,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1333
1318
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
1319
  * See the License for the specific language governing permissions and
1335
1320
  * limitations under the License.
1336
- */const Ps=new re(5e3,15e3),Ns="__/auth/iframe",Ms="emulator/auth/iframe",Ls={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Us=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Bs(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Je(e,Ms):`https://${n.config.authDomain}/${Ns}`,r={apiKey:e.apiKey,appName:n.name,v:ye},i=Us.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ne(r).slice(1)}`}async function xs(n){const e=await Ds(n),t=v().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:Bs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Ls,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),a=v().setTimeout(()=>{s(o)},Ps.get());function c(){v().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1321
+ */const go=new fe(5e3,15e3),_o="__/auth/iframe",vo="emulator/auth/iframe",Io={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},yo=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function bo(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?ft(e,vo):`https://${n.config.authDomain}/${_o}`,r={apiKey:e.apiKey,appName:n.name,v:Me},i=yo.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${he(r).slice(1)}`}async function wo(n){const e=await mo(n),t=T().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:bo(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Io,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=E(n,"network-request-failed"),a=T().setTimeout(()=>{s(o)},go.get());function c(){T().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1337
1322
  * @license
1338
1323
  * Copyright 2020 Google LLC.
1339
1324
  *
@@ -1348,7 +1333,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1348
1333
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349
1334
  * See the License for the specific language governing permissions and
1350
1335
  * limitations under the License.
1351
- */const Fs={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},$s=500,Hs=600,Vs="_blank",Ws="http://localhost";class Dt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function js(n,e,t,r=$s,i=Hs){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c=Object.assign(Object.assign({},Fs),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(a=Zt(l)?Vs:t),Qt(l)&&(e=e||Ws,c.scrollbars="yes");const d=Object.entries(c).reduce((m,[I,U])=>`${m}${I}=${U},`,"");if(Ti(l)&&a!=="_self")return zs(e||"",a),new Dt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new Dt(f)}function zs(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1336
+ */const Eo={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},To=500,So=600,ko="_blank",Ao="http://localhost";class qt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Ro(n,e,t,r=To,i=So){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c=Object.assign(Object.assign({},Eo),{width:r.toString(),height:i.toString(),top:s,left:o}),l=m().toLowerCase();t&&(a=In(l)?ko:t),vn(l)&&(e=e||Ao,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[y,R])=>`${p}${y}=${R},`,"");if(ss(l)&&a!=="_self")return Oo(e||"",a),new qt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new qt(f)}function Oo(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1352
1337
  * @license
1353
1338
  * Copyright 2021 Google LLC
1354
1339
  *
@@ -1363,7 +1348,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1363
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
1349
  * See the License for the specific language governing permissions and
1365
1350
  * limitations under the License.
1366
- */const Gs="__/auth/handler",Ks="emulator/auth/handler";function Pt(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:ye,eventId:i};if(e instanceof an){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",jn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,l]of Object.entries(s||{}))o[c]=l}if(e instanceof se){const c=e.getScopes().filter(l=>l!=="");c.length>0&&(o.scopes=c.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];return`${qs(n)}?${ne(a).slice(1)}`}function qs({config:n}){return n.emulator?Je(n,Ks):`https://${n.authDomain}/${Gs}`}/**
1351
+ */const Co="__/auth/handler",Do="emulator/auth/handler";function Jt(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:Me,eventId:i};if(e instanceof kn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Rr(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,l]of Object.entries(s||{}))o[c]=l}if(e instanceof me){const c=e.getScopes().filter(l=>l!=="");c.length>0&&(o.scopes=c.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];return`${No(n)}?${he(a).slice(1)}`}function No({config:n}){return n.emulator?ft(n,Do):`https://${n.authDomain}/${Co}`}/**
1367
1352
  * @license
1368
1353
  * Copyright 2020 Google LLC
1369
1354
  *
@@ -1378,7 +1363,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1378
1363
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1379
1364
  * See the License for the specific language governing permissions and
1380
1365
  * limitations under the License.
1381
- */const Fe="webStorageSupport";class Js{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=fn,this._completeRedirectFn=ys,this._overrideRedirectResult=_s}async _openPopup(e,t,r,i){var s;w((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Pt(e,t,r,je(),i);return js(e,o,tt())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Yi(Pt(e,t,r,je(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(w(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await xs(e),r=new ws(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Fe,{type:Fe},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Fe];o!==void 0&&t(!!o),g(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Rs(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return sn()||Xe()||we()}}const Ys=Js;var Nt="@firebase/auth",Mt="0.20.7";/**
1366
+ */const nt="webStorageSupport";class Po{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Pn,this._completeRedirectFn=ro,this._overrideRedirectResult=eo}async _openPopup(e,t,r,i){var s;A((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Jt(e,t,r,Ce(),i);return Ro(e,o,vt())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Ps(Jt(e,t,r,Ce(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(A(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await wo(e),r=new so(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(nt,{type:nt},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[nt];o!==void 0&&t(!!o),b(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=uo(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Tn()||mt()||Be()}}const Lo=Po;var Yt="@firebase/auth",Xt="0.20.7";/**
1382
1367
  * @license
1383
1368
  * Copyright 2020 Google LLC
1384
1369
  *
@@ -1393,7 +1378,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1393
1378
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1379
  * See the License for the specific language governing permissions and
1395
1380
  * limitations under the License.
1396
- */class Xs{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{var i;e(((i=r)===null||i===void 0?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);!t||(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1381
+ */class Mo{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{var i;e(((i=r)===null||i===void 0?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);!t||(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1397
1382
  * @license
1398
1383
  * Copyright 2020 Google LLC
1399
1384
  *
@@ -1408,7 +1393,7 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1408
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1409
1394
  * See the License for the specific language governing permissions and
1410
1395
  * limitations under the License.
1411
- */function Qs(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function Zs(n){Y(new H("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:s,authDomain:o}=r.options;return((a,c)=>{u(s&&!s.includes(":"),"invalid-api-key",{appName:a.name}),u(!o?.includes(":"),"argument-error",{appName:a.name});const l={apiKey:s,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:on(n)},d=new Ai(a,c,l);return ai(d,t),d})(r,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Y(new H("auth-internal",e=>{const t=Qe(e.getProvider("auth").getImmediate());return(r=>new Xs(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),x(Nt,Mt,Qs(n)),x(Nt,Mt,"esm2017")}/**
1396
+ */function Uo(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function Bo(n){oe(new X("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:s,authDomain:o}=r.options;return((a,c)=>{u(s&&!s.includes(":"),"invalid-api-key",{appName:a.name}),u(!o?.includes(":"),"argument-error",{appName:a.name});const l={apiKey:s,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Sn(n)},d=new ls(a,c,l);return Vi(d,t),d})(r,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),oe(new X("auth-internal",e=>{const t=gt(e.getProvider("auth").getImmediate());return(r=>new Mo(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),q(Yt,Xt,Uo(n)),q(Yt,Xt,"esm2017")}/**
1412
1397
  * @license
1413
1398
  * Copyright 2021 Google LLC
1414
1399
  *
@@ -1423,4 +1408,19 @@ import{d as wn,r as ae,w as En,e as Oe,x as ce,u as E,i as lt,y as Ce,z as ut,f
1423
1408
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1409
  * See the License for the specific language governing permissions and
1425
1410
  * limitations under the License.
1426
- */function eo(n=zr()){const e=Vt(n,"auth");return e.isInitialized()?e.getImmediate():oi(n,{popupRedirectResolver:Ys,persistence:[ss,Ki,fn]})}Zs("Browser");const to=["onSubmit"],no={key:0,for:"login-form-email"},ro=["placeholder"],io={class:"text-right lowercase"},so={type:"submit"},uo=wn({__name:"LoginForm",setup(n){const e=eo(),t=ae(!0),r=ae(!1);En(r,a=>{a&&(t.value=!0)});const i=ae(""),s=ae(""),o=async()=>{window.localStorage.setItem("emailForSignIn",i.value);try{if(t.value){const a=new URL(window.location.toString());a.searchParams.append("email",i.value),await Wi(e,i.value,{url:a.toString(),handleCodeInApp:!0})}else{const{user:a}=await Vi(e,i.value,s.value);console.log(a)}}catch(a){console.warn(a.code),console.error(a)}};return(a,c)=>(Pe(),Oe("form",{class:"login-form text-base",onSubmit:De(o,["prevent"])},[t.value?(Pe(),Oe("label",no,ce(E(Sn)),1)):lt("",!0),Ce(G("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":c[0]||(c[0]=l=>i.value=l),required:""},null,512),[[ut,i.value]]),t.value?lt("",!0):Ce((Pe(),Oe("input",{key:1,type:"password",class:"lowercase",placeholder:E(kn),"onUpdate:modelValue":c[1]||(c[1]=l=>s.value=l),required:""},null,8,ro)),[[ut,s.value]]),Ce(G("small",io,[G("a",{href:"#",class:"text-muted",onClick:c[2]||(c[2]=De(l=>t.value=!t.value,["prevent"]))},ce(t.value?E(Rn):E(An)),1)],512),[[Tn,!r.value]]),G("button",so,ce(r.value?E(On):E(dt)),1),G("a",{href:"#",class:"block text-center",onClick:c[3]||(c[3]=De(l=>r.value=!r.value,["prevent"]))},ce(r.value?E(dt):E(Cn)),1)],40,to))}});export{uo as default};
1411
+ */function Fn(n=Oi()){const e=cn(n,"auth");return e.isInitialized()?e.getImmediate():Hi(n,{popupRedirectResolver:Lo,persistence:[Vs,Cs,Pn]})}Bo("Browser");globalThis.__apiCache||(globalThis.__apiCache={});const G={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0};class Qt extends Error{constructor(e,t,r,i=!1){t?(super(t.statusText),this.data=t.data,this.statusCode=t.status):super(r||"Request error"),this.config=e,this.response=t,this.isTimeout=i}}const xo={middleware(n){const e={...n.headers};if(!n.isNoAuth)if(n.accessToken)e.Authorization=`Bearer ${n.accessToken}`;else{const s=n.authenticationId||G.ECOM_AUTHENTICATION_ID,o=n.apiKey||G.ECOM_API_KEY;if(s&&o){const a=`${s}:${o}`,c=typeof Buffer=="function"?Buffer.from(a).toString("base64"):btoa(a);e.Authorization=`Basic ${c}`}}let t=n.baseUrl||G.API_BASE_URL||"https://ecomplus.io/v2";const{endpoint:r,params:i}=n;if(r!=="login"&&r!=="authenticate"&&r!=="ask-auth-callback"&&r!=="check-username"){const s=n.storeId||G.ECOM_STORE_ID;if(!s)throw new Error("`storeId` must be set in config or `ECOM_STORE_ID` env var");t+=`/:${s}`;const o=n.lang||G.ECOM_LANG;o&&(t+=`,lang:${o}`)}if(t+=`/${r}`,i){if(typeof i=="string")t+=`?${i}`;else if(typeof i=="object"){const s=new URLSearchParams;Object.keys(i).forEach(o=>{const a=i[o];Array.isArray(a)?a.forEach(c=>{s.append(o,c)}):s.append(o,a)}),t+=`?${s.toString()}`}}return{url:t,headers:e}}},I=async(n,e=0)=>{const{url:t,headers:r}=xo.middleware(n),{method:i="get",timeout:s=2e4,maxRetries:o=3,cacheMaxAge:a=6e5}=n,c=i==="get"&&(n.canCache||n.canCache===void 0&&G.SSR);let l;if(c){l=`${t}${JSON.stringify(r)}`;const _=globalThis.__apiCache[l];if(_&&Date.now()-_.timestamp<=a)return{..._.res,config:n}}const d=n.body||n.data;let f;d&&(f=JSON.stringify(d),r["Content-Type"]="application/json",r["Content-Length"]=f.length.toString());const p=new AbortController;let y=!1;const R=setTimeout(()=>{p.abort(),y=!0},s);let g;try{g=await(n.fetch||fetch)(t,{method:i,headers:r,body:f,signal:p.signal})}catch(_){throw new Qt(n,g,_.message,y)}if(clearTimeout(R),g){if(g.ok){const O={...g,data:await g.json()};return c&&l&&(globalThis.__apiCache[l]={timestamp:Date.now(),res:O}),{...O,config:n}}const{status:_}=g;if(o<e&&(_===429||_>=500)){const O=g.headers.get("retry-after");return new Promise((ve,te)=>{setTimeout(()=>{I(n,e+1).then(ve).catch(te)},O&&parseInt(O,10)||5e3)})}}try{g.data=await g?.json()}catch{}throw new Qt(n,g)},$o=(n,e)=>I({...e,endpoint:n}),Fo=(n,e,t)=>I({...t,method:"post",endpoint:n,body:e}),Ho=(n,e,t)=>I({...t,method:"put",endpoint:n,body:e}),Vo=(n,e,t)=>I({...t,method:"patch",endpoint:n,body:e}),Hn=(n,e)=>I({...e,method:"delete",endpoint:n});I.get=$o;I.post=Fo;I.put=Ho;I.patch=Vo;I.del=Hn;I.delete=Hn;let ke,Ae;typeof window=="object"&&window?Ae=ke=window:typeof process=="object"&&process.env?(Ae=global,ke=process.env):Ae=ke=typeof self=="object"&&self||{};const Wo="en_us",jo="USD",zo="$",Go="US",Ko=1011,qo="5b1abe30a4d4531b8fe40725",Jo=n=>{if(typeof document=="object"&&document){const e=document.getElementsByTagName("meta");for(let t=0;t<e.length;t++)if(e[t].getAttribute("name")===n.replace(/_/g,"-")){const r=e[t].getAttribute("content");return n==="ecom_store_id"?parseInt(r,10):r}}return ke[n.toUpperCase()]},ct={};["lang","currency","currency_symbol","country_code","store_id","store_object_id"].forEach(n=>{ct[n]=Jo("ecom_"+n)});const Yo={get(n){const e=ct[n];if(e!=null&&e!=="")return e;switch(n){case"lang":return Wo;case"currency":return jo;case"currency_symbol":return zo;case"country_code":return Go;case"store_id":return Ko;case"store_object_id":return qo}return null},set(n,e){ct[n]=e}},Xo=n=>{if(n){if(n.display_name)return n.display_name;if(n.name&&n.name.given_name)return n.name.given_name}return""},Qo=Xo;Ae.$ecomConfig;const Zo=2,ea=5,ye=6,be=10;let Vn=(n,e,t,r)=>(n.events=n.events||{},n.events[t+be]||(n.events[t+be]=r(i=>{n.events[t].reduceRight((s,o)=>(o(s),s),{shared:{},...i})})),n.events[t]=n.events[t]||[],n.events[t].push(e),()=>{let i=n.events[t],s=i.indexOf(e);i.splice(s,1),i.length||(delete n.events[t],n.events[t+be](),delete n.events[t+be])}),ta=(n,e)=>Vn(n,e,Zo,t=>{let r=n.set,i=n.setKey;return n.setKey&&(n.setKey=(s,o)=>{let a;if(t({abort:()=>{a=!0},changed:s,newValue:{...n.value,[s]:o}}),!a)return i(s,o)}),n.set=s=>{let o;if(t({abort:()=>{o=!0},newValue:s}),!o)return r(s)},()=>{n.set=r,n.setKey=i}}),na=1e3,ra=(n,e)=>Vn(n,r=>{let i=e(r);i&&n.events[ye].push(i)},ea,r=>{let i=n.listen;n.listen=o=>(!n.lc&&!n.active&&(r(),n.active=!0),i(o));let s=n.off;return n.events[ye]=[],n.off=()=>{setTimeout(()=>{if(n.active&&!n.lc){n.active=!1;for(let o of n.events[ye])o();n.events[ye]=[],s()}},na)},()=>{n.listen=i,n.off=s}}),$=[],lt=0,Wn=n=>{let e,t=[],r={lc:0,value:n,set(i){r.value=i,r.notify()},get(){return r.lc||r.listen(()=>{})(),r.value},notify(i){e=t;let s=!$.length;for(let o=0;o<e.length;o++)$.push(e[o],r.value,i);if(s){lt++;for(let o=0;o<$.length;o+=3)$[o]($[o+1],$[o+2]);$.length=0}},listen(i){return t===e&&(t=t.slice()),r.lc=t.push(i),()=>{t===e&&(t=t.slice());let s=t.indexOf(i);~s&&(t.splice(s,1),r.lc--)}},subscribe(i){let s=r.listen(i);return i(r.value),s},off(){}};return r},ia=(n={})=>{let e=Wn(n);return e.setKey=function(t,r){typeof r>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==r&&(e.value={...e.value,[t]:r},e.notify(t))},e},_e=(n,e)=>{Array.isArray(n)||(n=[n]);let t,r=[],i=()=>{let o=n.map(a=>a.get());(t!==lt||o.some((a,c)=>a!==r[c]))&&(t=lt,r=o,s.set(e(...o)))},s=Wn();return ra(s,()=>{let o=n.map(a=>a.listen(i,e));return i(),()=>{for(let a of o)a()}}),s};var sa="firebase",oa="9.10.0";/**
1412
+ * @license
1413
+ * Copyright 2020 Google LLC
1414
+ *
1415
+ * Licensed under the Apache License, Version 2.0 (the "License");
1416
+ * you may not use this file except in compliance with the License.
1417
+ * You may obtain a copy of the License at
1418
+ *
1419
+ * http://www.apache.org/licenses/LICENSE-2.0
1420
+ *
1421
+ * Unless required by applicable law or agreed to in writing, software
1422
+ * distributed under the License is distributed on an "AS IS" BASIS,
1423
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
+ * See the License for the specific language governing permissions and
1425
+ * limitations under the License.
1426
+ */q(sa,oa,"app");Ri(window.firebaseConfig);const jn={customer:{display_name:"",main_email:""},auth:null},w=ia(jn),He="SESSION",Zt=localStorage.getItem(He);if(Zt)try{w.set(JSON.parse(Zt))}catch{localStorage.removeItem(He)}ta(w,()=>{localStorage.setItem(He,JSON.stringify(w.get()))});const yt=_e(w,({auth:n})=>n&&new Date(n.expires).getTime()-Date.now()>1e3*10),bt=_e(w,n=>n.customer),zn=_e(bt,n=>Qo(n)),Gn=_e(bt,n=>n.main_email),aa=n=>w.setKey("customer",{...bt.get(),main_email:n}),Z=Fn();if(Ts(Z,window.location.href)){const e=new URLSearchParams(window.location.search).get("email");e&&Ss(Z,e,window.location.href).catch(console.error)}const ca=_e(yt,n=>n||!!Z.currentUser),la=()=>{w.set(jn),localStorage.removeItem(He),Z.signOut()},Kn=async()=>{const n=await Z.currentUser.getIdToken(),{domain:e}=window.storefront.settings;try{const t=await fetch(`https://${e}/api/passport/token`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}});w.setKey("auth",await t.json())}catch(t){console.error(t)}},ua=async()=>(yt.get()||await Kn(),w.get().auth.access_token),da=async()=>{const n=await ua(),{auth:e}=w.get(),{data:t}=await I.get(`customers/${e.customer_id}`,{accessToken:n});return w.setKey("customer",t),t};ks(Z,async n=>{if(n){if(n.emailVerified){const e=n.email!==Gn.get();(e||!yt.get())&&(await Kn(),(e||!zn.get())&&await da())}}else la()});const ha={class:"text-xl font-medium mb-5"},fa=["onSubmit"],pa={key:0,for:"login-form-email"},ma=["placeholder"],ga={class:"text-right lowercase"},_a={type:"submit"},wa=Zn({__name:"LoginForm",emits:["login","logout"],setup(n,{emit:e}){St(Je(ca),c=>{e(c?"login":"logout")},{immediate:!0});const t=je(!0),r=je(!1);St(r,c=>{c&&(t.value=!0)});const i=er({get(){return Je(Gn).value},set:aa}),s=je(""),o=async()=>{const c=Fn();window.localStorage.setItem("emailForSignIn",i.value);try{if(t.value){const l=new URL(window.location.toString());l.searchParams.append("email",i.value),await Es(c,i.value,{url:l.toString(),handleCodeInApp:!0})}else await ws(c,i.value,s.value)}catch(l){console.warn(l.code),console.error(l)}},a=Je(zn);return(c,l)=>(qe(),ze(or,null,[tr(c.$slots,"greetings",nr(rr({customerName:v(a)})),()=>[x("div",ha,ne(`${v(ar)} ${v(a)||v(cr)}`),1)]),x("form",{class:"login-form text-base",onSubmit:Ke(o,["prevent"])},[t.value?(qe(),ze("label",pa,ne(v(lr)),1)):kt("",!0),Ge(x("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":l[0]||(l[0]=d=>ir(i)?i.value=d:null),required:""},null,512),[[At,v(i)]]),t.value?kt("",!0):Ge((qe(),ze("input",{key:1,type:"password",class:"lowercase",placeholder:v(ur),"onUpdate:modelValue":l[1]||(l[1]=d=>s.value=d),required:""},null,8,ma)),[[At,s.value]]),Ge(x("small",ga,[x("a",{href:"#",class:"text-muted",onClick:l[2]||(l[2]=Ke(d=>t.value=!t.value,["prevent"]))},ne(t.value?v(dr):v(hr)),1)],512),[[sr,!r.value]]),x("button",_a,ne(r.value?v(fr):v(Rt)),1),x("a",{href:"#",class:"block text-center",onClick:l[3]||(l[3]=Ke(d=>r.value=!r.value,["prevent"]))},ne(r.value?v(Rt):v(pr)),1)],40,fa)],64))}});export{wa as default};