cloudcommerce 0.0.124 → 0.0.126

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 (258) hide show
  1. package/.eslintrc.cjs +26 -7
  2. package/.gitmodules +3 -0
  3. package/CHANGELOG.md +15 -0
  4. package/action.yml +5 -1
  5. package/ecomplus-stores/monocard/functions/core/package.json +1 -1
  6. package/ecomplus-stores/monocard/functions/events/package.json +2 -2
  7. package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
  8. package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
  9. package/ecomplus-stores/monocard/functions/ssr/package.json +7 -4
  10. package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +1 -1
  11. package/ecomplus-stores/monocard/package.json +1 -1
  12. package/ecomplus-stores/tia-sonia/.github/renovate.json +5 -0
  13. package/ecomplus-stores/tia-sonia/.github/workflows/build-and-deploy.yml +41 -0
  14. package/ecomplus-stores/tia-sonia/.github/workflows/calibreapp-image-actions.yml +23 -0
  15. package/ecomplus-stores/tia-sonia/.vscode/extensions.json +8 -0
  16. package/ecomplus-stores/tia-sonia/.vscode/settings.json +5 -0
  17. package/ecomplus-stores/tia-sonia/LICENSE.md +230 -0
  18. package/ecomplus-stores/tia-sonia/README.md +117 -0
  19. package/ecomplus-stores/tia-sonia/README.pt-BR.md +117 -0
  20. package/ecomplus-stores/tia-sonia/functions/config.json +3 -0
  21. package/ecomplus-stores/tia-sonia/functions/core/index.js +9 -0
  22. package/ecomplus-stores/tia-sonia/functions/core/package.json +20 -0
  23. package/ecomplus-stores/tia-sonia/functions/events/index.js +9 -0
  24. package/ecomplus-stores/tia-sonia/functions/events/package.json +21 -0
  25. package/ecomplus-stores/tia-sonia/functions/example.env +10 -0
  26. package/ecomplus-stores/tia-sonia/functions/modules/index.js +9 -0
  27. package/ecomplus-stores/tia-sonia/functions/modules/package.json +21 -0
  28. package/ecomplus-stores/tia-sonia/functions/passport/index.js +9 -0
  29. package/ecomplus-stores/tia-sonia/functions/passport/package.json +21 -0
  30. package/ecomplus-stores/tia-sonia/functions/ssr/.eslintrc.cjs +6 -0
  31. package/ecomplus-stores/tia-sonia/functions/ssr/astro.config.mjs +4 -0
  32. package/ecomplus-stores/tia-sonia/functions/ssr/content/blog.json +18 -0
  33. package/ecomplus-stores/tia-sonia/functions/ssr/content/brands.json +24 -0
  34. package/ecomplus-stores/tia-sonia/functions/ssr/content/categories.json +24 -0
  35. package/ecomplus-stores/tia-sonia/functions/ssr/content/code.json +5 -0
  36. package/ecomplus-stores/tia-sonia/functions/ssr/content/collections.json +24 -0
  37. package/ecomplus-stores/tia-sonia/functions/ssr/content/contacts.json +13 -0
  38. package/ecomplus-stores/tia-sonia/functions/ssr/content/footer.json +46 -0
  39. package/ecomplus-stores/tia-sonia/functions/ssr/content/header.json +35 -0
  40. package/ecomplus-stores/tia-sonia/functions/ssr/content/home.json +45 -0
  41. package/ecomplus-stores/tia-sonia/functions/ssr/content/info.json +18 -0
  42. package/ecomplus-stores/tia-sonia/functions/ssr/content/maintenance.json +6 -0
  43. package/ecomplus-stores/tia-sonia/functions/ssr/content/menu.json +6 -0
  44. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/contato.json +6 -0
  45. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/entrega.json +6 -0
  46. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/faq.json +6 -0
  47. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/pagamentos.json +6 -0
  48. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/privacidade.json +6 -0
  49. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/sobre-nos.json +6 -0
  50. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/termos.json +6 -0
  51. package/ecomplus-stores/tia-sonia/functions/ssr/content/pages/trocas.json +6 -0
  52. package/ecomplus-stores/tia-sonia/functions/ssr/content/posts/esta-loja-e-um-pwa.json +9 -0
  53. package/ecomplus-stores/tia-sonia/functions/ssr/content/products.json +32 -0
  54. package/ecomplus-stores/tia-sonia/functions/ssr/content/search.json +8 -0
  55. package/ecomplus-stores/tia-sonia/functions/ssr/content/settings.json +14 -0
  56. package/ecomplus-stores/tia-sonia/functions/ssr/content/social.json +5 -0
  57. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/analytics.json +11 -0
  58. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/compre-confie.json +11 -0
  59. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/ebit.json +11 -0
  60. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/fb-pixel.json +12 -0
  61. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/gmc-ratings.json +12 -0
  62. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/minicart.json +6 -0
  63. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/offers-notification.json +11 -0
  64. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/opinioes-verificadas.json +18 -0
  65. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/product-card.json +10 -0
  66. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/product.json +13 -0
  67. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/search-engine.json +8 -0
  68. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/search.json +6 -0
  69. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/tag-manager.json +12 -0
  70. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/tawkto.json +12 -0
  71. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/trustvox.json +15 -0
  72. package/ecomplus-stores/tia-sonia/functions/ssr/content/widgets/user.json +5 -0
  73. package/ecomplus-stores/tia-sonia/functions/ssr/index.js +18 -0
  74. package/ecomplus-stores/tia-sonia/functions/ssr/package.json +30 -0
  75. package/ecomplus-stores/tia-sonia/functions/ssr/public/admin/config.json +1 -0
  76. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/cms-preview.css +274 -0
  77. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/cms.css +114 -0
  78. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/cvv.png +0 -0
  79. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/icons/bootstrap-icons/font/storefront-icons.woff2 +0 -0
  80. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/icons/feather-icons/font/storefront-icons.woff2 +0 -0
  81. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/icons/font-awesome/font/storefront-icons.woff2 +0 -0
  82. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/icons/line-awesome/font/storefront-icons.woff2 +0 -0
  83. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/icons/tabler-icons/font/storefront-icons.woff2 +0 -0
  84. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/img-placeholder.png +0 -0
  85. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/payments.png +0 -0
  86. package/ecomplus-stores/tia-sonia/functions/ssr/public/assets/ssl-safe.png +0 -0
  87. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/icon.png +0 -0
  88. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/large-icon.png +0 -0
  89. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/banner1.png +0 -0
  90. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/banner2.png +0 -0
  91. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/banner2.webp +0 -0
  92. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/favicon.png +0 -0
  93. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/headless.png +0 -0
  94. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/headphone.png +0 -0
  95. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/headphone.webp +0 -0
  96. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/icon.png +0 -0
  97. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/large-icon.png +0 -0
  98. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/logo.png +0 -0
  99. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/logo.webp +0 -0
  100. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/og-image.png +0 -0
  101. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/passion.png +0 -0
  102. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/passion.webp +0 -0
  103. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/pwa-reliable.png +0 -0
  104. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/rect8589.png +0 -0
  105. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/rect859.png +0 -0
  106. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/rect89.png +0 -0
  107. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/rect89.webp +0 -0
  108. package/ecomplus-stores/tia-sonia/functions/ssr/public/img/uploads/ssl-safe.png +0 -0
  109. package/ecomplus-stores/tia-sonia/functions/ssr/public/robots.txt +8 -0
  110. package/ecomplus-stores/tia-sonia/functions/ssr/src/assets/.gitkeep +0 -0
  111. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/TheHeader.vue +42 -0
  112. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/TopBar.vue +133 -0
  113. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/header/HeaderButtonLink.vue +5 -0
  114. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/header/HeaderButtons.vue +46 -0
  115. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/header/HeaderNav.vue +9 -0
  116. package/ecomplus-stores/tia-sonia/functions/ssr/src/components/header/HeaderNavLink.vue +5 -0
  117. package/ecomplus-stores/tia-sonia/functions/ssr/src/env.d.ts +3 -0
  118. package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/Base.astro +34 -0
  119. package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/Checkout.astro +0 -0
  120. package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/Pages.astro +19 -0
  121. package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/PagesHeader.astro +117 -0
  122. package/ecomplus-stores/tia-sonia/functions/ssr/src/main/Fallback.astro +15 -0
  123. package/ecomplus-stores/tia-sonia/functions/ssr/src/main/Home.astro +19 -0
  124. package/ecomplus-stores/tia-sonia/functions/ssr/src/main/Wildcard.astro +21 -0
  125. package/ecomplus-stores/tia-sonia/functions/ssr/src/pages/[...slug].astro +36 -0
  126. package/ecomplus-stores/tia-sonia/functions/ssr/src/pages/app/account.astro +0 -0
  127. package/ecomplus-stores/tia-sonia/functions/ssr/src/pages/app/index.astro +0 -0
  128. package/ecomplus-stores/tia-sonia/functions/ssr/src/pages/fallback.astro +19 -0
  129. package/ecomplus-stores/tia-sonia/functions/ssr/src/pages/index.astro +31 -0
  130. package/ecomplus-stores/tia-sonia/functions/ssr/src/scripts/InlineScripts.astro +11 -0
  131. package/ecomplus-stores/tia-sonia/functions/ssr/tailwind.config.cjs +4 -0
  132. package/ecomplus-stores/tia-sonia/functions/ssr/tsconfig.json +16 -0
  133. package/ecomplus-stores/tia-sonia/functions/ssr/uno.config.ts +4 -0
  134. package/ecomplus-stores/tia-sonia/package.json +28 -0
  135. package/ecomplus-stores/tia-sonia/scripts/install.sh +9 -0
  136. package/package.json +14 -14
  137. package/packages/api/package.json +1 -1
  138. package/packages/apps/correios/package.json +1 -1
  139. package/packages/apps/custom-shipping/package.json +1 -1
  140. package/packages/apps/discounts/package.json +1 -1
  141. package/packages/apps/frenet/package.json +1 -1
  142. package/packages/apps/mercadopago/lib/mercadopago.js +0 -2
  143. package/packages/apps/mercadopago/lib/mercadopago.js.map +1 -1
  144. package/packages/apps/mercadopago/lib/mp-webhook.js +0 -2
  145. package/packages/apps/mercadopago/lib/mp-webhook.js.map +1 -1
  146. package/packages/apps/mercadopago/package.json +4 -4
  147. package/packages/apps/mercadopago/src/mercadopago.ts +0 -3
  148. package/packages/apps/mercadopago/src/mp-webhook.ts +0 -2
  149. package/packages/apps/tiny-erp/lib/event-to-tiny.js +1 -1
  150. package/packages/apps/tiny-erp/lib/event-to-tiny.js.map +1 -1
  151. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +1 -1
  152. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +1 -1
  153. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +1 -1
  154. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +1 -1
  155. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +1 -2
  156. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -1
  157. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +1 -1
  158. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -1
  159. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +1 -1
  160. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -1
  161. package/packages/apps/tiny-erp/lib/tiny-erp.js +0 -1
  162. package/packages/apps/tiny-erp/lib/tiny-erp.js.map +1 -1
  163. package/packages/apps/tiny-erp/lib/tiny-webhook.js +1 -1
  164. package/packages/apps/tiny-erp/lib/tiny-webhook.js.map +1 -1
  165. package/packages/apps/tiny-erp/package.json +4 -4
  166. package/packages/apps/tiny-erp/src/event-to-tiny.ts +1 -1
  167. package/packages/apps/tiny-erp/src/integration/after-tiny-queue.ts +1 -1
  168. package/packages/apps/tiny-erp/src/integration/export-order-to-tiny.ts +1 -1
  169. package/packages/apps/tiny-erp/src/integration/import-order-from-tiny.ts +1 -2
  170. package/packages/apps/tiny-erp/src/integration/import-product-from-tiny.ts +1 -1
  171. package/packages/apps/tiny-erp/src/integration/parsers/product-from-tiny.ts +1 -1
  172. package/packages/apps/tiny-erp/src/tiny-erp.ts +0 -1
  173. package/packages/apps/tiny-erp/src/tiny-webhook.ts +1 -1
  174. package/packages/cli/package.json +1 -1
  175. package/packages/config/package.json +1 -1
  176. package/packages/events/package.json +4 -4
  177. package/packages/firebase/lib/config.js +3 -3
  178. package/packages/firebase/lib/handlers/check-store-events.js +1 -2
  179. package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
  180. package/packages/firebase/lib/helpers/update-app-data.js +1 -1
  181. package/packages/firebase/lib/helpers/update-app-data.js.map +1 -1
  182. package/packages/firebase/lib/init.js +0 -2
  183. package/packages/firebase/lib/init.js.map +1 -1
  184. package/packages/firebase/package.json +4 -4
  185. package/packages/firebase/src/config.ts +3 -3
  186. package/packages/firebase/src/handlers/check-store-events.ts +1 -2
  187. package/packages/firebase/src/helpers/update-app-data.ts +1 -1
  188. package/packages/firebase/src/init.ts +0 -2
  189. package/packages/i18n/package.json +1 -1
  190. package/packages/modules/lib/firebase/call-app-module.js +1 -1
  191. package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
  192. package/packages/modules/lib/firebase/checkout.js +9 -7
  193. package/packages/modules/lib/firebase/checkout.js.map +1 -1
  194. package/packages/modules/lib/firebase/functions-checkout/fix-items.js +80 -18
  195. package/packages/modules/lib/firebase/functions-checkout/fix-items.js.map +1 -1
  196. package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js +1 -1
  197. package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js.map +1 -1
  198. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js +16 -16
  199. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
  200. package/packages/modules/lib/firebase/functions-checkout/new-order.js +8 -8
  201. package/packages/modules/lib/firebase/functions-checkout/new-order.js.map +1 -1
  202. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +23 -6
  203. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
  204. package/packages/modules/lib/firebase/functions-checkout/utils.js +1 -2
  205. package/packages/modules/lib/firebase/functions-checkout/utils.js.map +1 -1
  206. package/packages/modules/lib/firebase/handle-module.js +1 -1
  207. package/packages/modules/lib/firebase/handle-module.js.map +1 -1
  208. package/packages/modules/lib/firebase.js +0 -1
  209. package/packages/modules/lib/firebase.js.map +1 -1
  210. package/packages/modules/package.json +4 -4
  211. package/packages/modules/src/firebase/call-app-module.ts +1 -1
  212. package/packages/modules/src/firebase/checkout.ts +13 -10
  213. package/packages/modules/src/firebase/functions-checkout/fix-items.ts +88 -20
  214. package/packages/modules/src/firebase/functions-checkout/get-custumerId.ts +1 -1
  215. package/packages/modules/src/firebase/functions-checkout/handle-order-transaction.ts +24 -23
  216. package/packages/modules/src/firebase/functions-checkout/new-order.ts +15 -14
  217. package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +30 -8
  218. package/packages/modules/src/firebase/functions-checkout/utils.ts +3 -5
  219. package/packages/modules/src/firebase/handle-module.ts +1 -1
  220. package/packages/modules/src/firebase.ts +0 -1
  221. package/packages/modules/src/types/index.d.ts +7 -6
  222. package/packages/passport/lib/firebase/serve-passport-api.js +1 -1
  223. package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
  224. package/packages/passport/lib/firebase.js +0 -1
  225. package/packages/passport/lib/firebase.js.map +1 -1
  226. package/packages/passport/package.json +4 -4
  227. package/packages/passport/src/firebase/serve-passport-api.ts +1 -1
  228. package/packages/passport/src/firebase.ts +0 -1
  229. package/packages/ssr/package.json +7 -7
  230. package/packages/storefront/.eslintrc.cjs +0 -1
  231. package/packages/storefront/astro.config.mjs +3 -2
  232. package/packages/storefront/dist/client/HeaderButtons.b5b4a939.js +1 -0
  233. package/packages/storefront/dist/client/assets/_...slug_.8d138f36.css +4 -0
  234. package/packages/storefront/dist/client/chunks/{HeaderButtons.d1f8a21f.js → HeaderButtons.308edb4d.js} +1 -1
  235. package/packages/storefront/dist/client/chunks/{LoginForm.e02dee3d.js → LoginForm.0c5ba697.js} +95 -95
  236. package/packages/storefront/dist/client/chunks/preload-helper.1de719f8.js +1 -0
  237. package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.f00ab3bd.js +1 -0
  238. package/packages/storefront/dist/client/client.69fdbd1b.js +1 -0
  239. package/packages/storefront/dist/client/{hoisted.3f1cf839.js → hoisted.4f689abe.js} +1 -1
  240. package/packages/storefront/dist/client/page.33c44e88.js +1 -0
  241. package/packages/storefront/dist/client/sw.js +1 -1
  242. package/packages/storefront/dist/server/entry.mjs +2826 -3530
  243. package/packages/storefront/package.json +13 -16
  244. package/packages/storefront/src/lib/assets/pico.css +19 -24
  245. package/packages/storefront/src/lib/components/LoginForm.vue +4 -13
  246. package/packages/storefront/src/lib/ssr/image.ts +0 -1
  247. package/packages/storefront/src/lib/state/customer-session.ts +29 -37
  248. package/packages/storefront/src/lib/state/shopping-cart/add-cart-item.ts +89 -0
  249. package/packages/storefront/src/lib/state/shopping-cart.ts +52 -0
  250. package/packages/storefront/src/lib/state/use-storage.ts +19 -0
  251. package/packages/storefront/tailwind.config.cjs +6 -1
  252. package/packages/types/package.json +1 -1
  253. package/packages/storefront/dist/client/HeaderButtons.75084c8f.js +0 -1
  254. package/packages/storefront/dist/client/assets/_...slug_.5d8e6131.css +0 -4
  255. package/packages/storefront/dist/client/chunks/preload-helper.f15ab524.js +0 -1
  256. package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.9119f0ff.js +0 -1
  257. package/packages/storefront/dist/client/client.671d7334.js +0 -1
  258. package/packages/storefront/dist/client/page.b906f867.js +0 -1
@@ -1,4 +1,4 @@
1
- import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h as Rt,f as F,p as ne,u as v,l as Ot,m as Ct,i as Dt,B as qe,C as Nt,D as dr,E as hr,g as Je,G as fr,F as pr}from"./runtime-dom.esm-bundler.9119f0ff.js";import{i as mr,a as gr,b as _r,c as vr,d as Ir,e as yr,f as br,g as Pt,h as wr}from"./HeaderButtons.d1f8a21f.js";import"./preload-helper.f15ab524.js";/* empty css */function Ye(n){let e=or(),t=n.subscribe(r=>{e.value=r});return ar()&&cr(t),e}/**
1
+ import{y as Qn,w as et,c as de,d as Zn,r as je,o as Ve,a as We,h as Tt,f as $,p as ne,u as v,l as St,m as kt,i as At,z as ze,A as Rt,B as er,C as tr,g as Ge,D as nr,F as rr}from"./runtime-dom.esm-bundler.f00ab3bd.js";import{i as ir,a as sr,b as or,c as ar,d as cr,e as lr,f as ur,g as Ot,h as dr}from"./HeaderButtons.308edb4d.js";import"./preload-helper.1de719f8.js";/* empty css *//**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  *
@@ -28,7 +28,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 cn=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},Er=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("")},ln={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(cn(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Er(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 O=l<<6&192|f;r.push(O)}}}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)}}},Tr=function(n){const e=cn(n);return ln.encodeByteArray(e,!0)},un=function(n){return Tr(n).replace(/\./g,"")},dn=function(n){try{return ln.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
31
+ */const nn=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},hr=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("")},rn={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(nn(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):hr(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 O=l<<6&192|f;r.push(O)}}}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)}}},fr=function(n){const e=nn(n);return rn.encodeByteArray(e,!0)},sn=function(n){return fr(n).replace(/\./g,"")},on=function(n){try{return rn.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{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */function m(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Sr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m())}function kr(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Ar(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Rr(){const n=m();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Or(){return typeof indexedDB=="object"}function Cr(){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)}})}function Dr(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
46
+ */function m(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function pr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m())}function mr(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function gr(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function _r(){const n=m();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function vr(){return typeof indexedDB=="object"}function Ir(){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)}})}function yr(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
47
47
  * @license
48
48
  * Copyright 2022 Google LLC
49
49
  *
@@ -58,7 +58,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
58
58
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
59
  * See the License for the specific language governing permissions and
60
60
  * limitations under the License.
61
- */const Nr=()=>Dr().__FIREBASE_DEFAULTS__,Pr=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Lr=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&dn(n[1]);return e&&JSON.parse(e)},ht=()=>{try{return Nr()||Pr()||Lr()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Mr=n=>{var e,t;return(t=(e=ht())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Ur=()=>{var n;return(n=ht())===null||n===void 0?void 0:n.config},hn=n=>{var e;return(e=ht())===null||e===void 0?void 0:e[`_${n}`]};/**
61
+ */const br=()=>yr().__FIREBASE_DEFAULTS__,wr=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Er=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&on(n[1]);return e&&JSON.parse(e)},ut=()=>{try{return br()||wr()||Er()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Tr=n=>{var e,t;return(t=(e=ut())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Sr=()=>{var n;return(n=ut())===null||n===void 0?void 0:n.config},an=n=>{var e;return(e=ut())===null||e===void 0?void 0:e[`_${n}`]};/**
62
62
  * @license
63
63
  * Copyright 2017 Google LLC
64
64
  *
@@ -73,7 +73,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */class xr{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))}}}/**
76
+ */class kr{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))}}}/**
77
77
  * @license
78
78
  * Copyright 2017 Google LLC
79
79
  *
@@ -88,7 +88,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */const Br="FirebaseError";class B extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Br,Object.setPrototypeOf(this,B.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?Fr(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new B(i,a,r)}}function Fr(n,e){return n.replace($r,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const $r=/\{\$([^}]+)}/g;function Hr(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(Lt(s)&&Lt(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 Lt(n){return n!==null&&typeof n=="object"}/**
91
+ */const Ar="FirebaseError";class F extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Ar,Object.setPrototypeOf(this,F.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,he.prototype.create)}}class he{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?Rr(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new F(i,a,r)}}function Rr(n,e){return n.replace(Or,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Or=/\{\$([^}]+)}/g;function Cr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function ke(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(Ct(s)&&Ct(o)){if(!ke(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function Ct(n){return n!==null&&typeof n=="object"}/**
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  *
@@ -103,7 +103,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 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 Vr(n,e){const t=new Wr(n,e);return t.subscribe.bind(t)}class Wr{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.");jr(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Xe),i.error===void 0&&(i.error=Xe),i.complete===void 0&&(i.complete=Xe);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 jr(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 Xe(){}/**
106
+ */function fe(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 Dr(n,e){const t=new Pr(n,e);return t.subscribe.bind(t)}class Pr{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.");Nr(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Ke),i.error===void 0&&(i.error=Ke),i.complete===void 0&&(i.complete=Ke);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 Nr(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 Ke(){}/**
107
107
  * @license
108
108
  * Copyright 2021 Google LLC
109
109
  *
@@ -118,7 +118,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */function S(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}}/**
121
+ */function T(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}}/**
122
122
  * @license
123
123
  * Copyright 2019 Google LLC
124
124
  *
@@ -148,7 +148,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 zr{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 xr;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(Kr(e))try{this.getOrInitializeService({instanceIdentifier:H})}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=H){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=H){return this.instances.has(e)}getOptions(e=H){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:Gr(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=H){return this.component?this.component.multipleInstances?e:H:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Gr(n){return n===H?void 0:n}function Kr(n){return n.instantiationMode==="EAGER"}/**
151
+ */class Lr{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 kr;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(Ur(e))try{this.getOrInitializeService({instanceIdentifier:H})}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=H){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=H){return this.instances.has(e)}getOptions(e=H){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:Mr(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=H){return this.component?this.component.multipleInstances?e:H:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Mr(n){return n===H?void 0:n}function Ur(n){return n.instantiationMode==="EAGER"}/**
152
152
  * @license
153
153
  * Copyright 2019 Google LLC
154
154
  *
@@ -163,7 +163,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */class qr{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 zr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
166
+ */class xr{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 Lr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
167
167
  * @license
168
168
  * Copyright 2017 Google LLC
169
169
  *
@@ -178,7 +178,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */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 Jr={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Yr=h.INFO,Xr={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},Qr=(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 fn{constructor(e){this.name=e,this._logLevel=Yr,this._logHandler=Qr,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"?Jr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,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 Zr=(n,e)=>e.some(t=>n instanceof t);let Mt,Ut;function ei(){return Mt||(Mt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ti(){return Ut||(Ut=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const pn=new WeakMap,it=new WeakMap,mn=new WeakMap,Qe=new WeakMap,ft=new WeakMap;function ni(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(U(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&pn.set(t,n)}).catch(()=>{}),ft.set(e,n),e}function ri(n){if(it.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)});it.set(n,e)}let st={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return it.get(n);if(e==="objectStoreNames")return n.objectStoreNames||mn.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return U(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 ii(n){st=n(st)}function si(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Ze(this),e,...t);return mn.set(r,e.sort?e.sort():[e]),U(r)}:ti().includes(n)?function(...e){return n.apply(Ze(this),e),U(pn.get(this))}:function(...e){return U(n.apply(Ze(this),e))}}function oi(n){return typeof n=="function"?si(n):(n instanceof IDBTransaction&&ri(n),Zr(n,ei())?new Proxy(n,st):n)}function U(n){if(n instanceof IDBRequest)return ni(n);if(Qe.has(n))return Qe.get(n);const e=oi(n);return e!==n&&(Qe.set(n,e),ft.set(e,n)),e}const Ze=n=>ft.get(n);function ai(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=U(o);return r&&o.addEventListener("upgradeneeded",c=>{r(U(o.result),c.oldVersion,c.newVersion,U(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const ci=["get","getKey","getAll","getAllKeys","count"],li=["put","add","delete","clear"],et=new Map;function xt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(et.get(e))return et.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=li.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||ci.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 et.set(e,s),s}ii(n=>({...n,get:(e,t,r)=>xt(e,t)||n.get(e,t,r),has:(e,t)=>!!xt(e,t)||n.has(e,t)}));/**
181
+ */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 Br={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Fr=h.INFO,$r={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},Hr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=$r[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 cn{constructor(e){this.name=e,this._logLevel=Fr,this._logHandler=Hr,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"?Br[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 jr=(n,e)=>e.some(t=>n instanceof t);let Dt,Pt;function Vr(){return Dt||(Dt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Wr(){return Pt||(Pt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const ln=new WeakMap,tt=new WeakMap,un=new WeakMap,qe=new WeakMap,dt=new WeakMap;function zr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(x(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&ln.set(t,n)}).catch(()=>{}),dt.set(e,n),e}function Gr(n){if(tt.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)});tt.set(n,e)}let nt={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return tt.get(n);if(e==="objectStoreNames")return n.objectStoreNames||un.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return x(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 Kr(n){nt=n(nt)}function qr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Je(this),e,...t);return un.set(r,e.sort?e.sort():[e]),x(r)}:Wr().includes(n)?function(...e){return n.apply(Je(this),e),x(ln.get(this))}:function(...e){return x(n.apply(Je(this),e))}}function Jr(n){return typeof n=="function"?qr(n):(n instanceof IDBTransaction&&Gr(n),jr(n,Vr())?new Proxy(n,nt):n)}function x(n){if(n instanceof IDBRequest)return zr(n);if(qe.has(n))return qe.get(n);const e=Jr(n);return e!==n&&(qe.set(n,e),dt.set(e,n)),e}const Je=n=>dt.get(n);function Yr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=x(o);return r&&o.addEventListener("upgradeneeded",c=>{r(x(o.result),c.oldVersion,c.newVersion,x(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const Xr=["get","getKey","getAll","getAllKeys","count"],Qr=["put","add","delete","clear"],Ye=new Map;function Nt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ye.get(e))return Ye.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=Qr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Xr.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 Ye.set(e,s),s}Kr(n=>({...n,get:(e,t,r)=>Nt(e,t)||n.get(e,t,r),has:(e,t)=>!!Nt(e,t)||n.has(e,t)}));/**
182
182
  * @license
183
183
  * Copyright 2019 Google LLC
184
184
  *
@@ -193,7 +193,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */class ui{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(di(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function di(n){const e=n.getComponent();return e?.type==="VERSION"}const ot="@firebase/app",Bt="0.8.2";/**
196
+ */class Zr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ei(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ei(n){const e=n.getComponent();return e?.type==="VERSION"}const rt="@firebase/app",Lt="0.8.3";/**
197
197
  * @license
198
198
  * Copyright 2019 Google LLC
199
199
  *
@@ -208,7 +208,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 W=new fn("@firebase/app"),hi="@firebase/app-compat",fi="@firebase/analytics-compat",pi="@firebase/analytics",mi="@firebase/app-check-compat",gi="@firebase/app-check",_i="@firebase/auth",vi="@firebase/auth-compat",Ii="@firebase/database",yi="@firebase/database-compat",bi="@firebase/functions",wi="@firebase/functions-compat",Ei="@firebase/installations",Ti="@firebase/installations-compat",Si="@firebase/messaging",ki="@firebase/messaging-compat",Ai="@firebase/performance",Ri="@firebase/performance-compat",Oi="@firebase/remote-config",Ci="@firebase/remote-config-compat",Di="@firebase/storage",Ni="@firebase/storage-compat",Pi="@firebase/firestore",Li="@firebase/firestore-compat",Mi="firebase",Ui="9.12.1";/**
211
+ */const V=new cn("@firebase/app"),ti="@firebase/app-compat",ni="@firebase/analytics-compat",ri="@firebase/analytics",ii="@firebase/app-check-compat",si="@firebase/app-check",oi="@firebase/auth",ai="@firebase/auth-compat",ci="@firebase/database",li="@firebase/database-compat",ui="@firebase/functions",di="@firebase/functions-compat",hi="@firebase/installations",fi="@firebase/installations-compat",pi="@firebase/messaging",mi="@firebase/messaging-compat",gi="@firebase/performance",_i="@firebase/performance-compat",vi="@firebase/remote-config",Ii="@firebase/remote-config-compat",yi="@firebase/storage",bi="@firebase/storage-compat",wi="@firebase/firestore",Ei="@firebase/firestore-compat",Ti="firebase",Si="9.13.0";/**
212
212
  * @license
213
213
  * Copyright 2019 Google LLC
214
214
  *
@@ -223,7 +223,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 at="[DEFAULT]",xi={[ot]:"fire-core",[hi]:"fire-core-compat",[pi]:"fire-analytics",[fi]:"fire-analytics-compat",[gi]:"fire-app-check",[mi]:"fire-app-check-compat",[_i]:"fire-auth",[vi]:"fire-auth-compat",[Ii]:"fire-rtdb",[yi]:"fire-rtdb-compat",[bi]:"fire-fn",[wi]:"fire-fn-compat",[Ei]:"fire-iid",[Ti]:"fire-iid-compat",[Si]:"fire-fcm",[ki]:"fire-fcm-compat",[Ai]:"fire-perf",[Ri]:"fire-perf-compat",[Oi]:"fire-rc",[Ci]:"fire-rc-compat",[Di]:"fire-gcs",[Ni]:"fire-gcs-compat",[Pi]:"fire-fst",[Li]:"fire-fst-compat","fire-js":"fire-js",[Mi]:"fire-js-all"};/**
226
+ */const it="[DEFAULT]",ki={[rt]:"fire-core",[ti]:"fire-core-compat",[ri]:"fire-analytics",[ni]:"fire-analytics-compat",[si]:"fire-app-check",[ii]:"fire-app-check-compat",[oi]:"fire-auth",[ai]:"fire-auth-compat",[ci]:"fire-rtdb",[li]:"fire-rtdb-compat",[ui]:"fire-fn",[di]:"fire-fn-compat",[hi]:"fire-iid",[fi]:"fire-iid-compat",[pi]:"fire-fcm",[mi]:"fire-fcm-compat",[gi]:"fire-perf",[_i]:"fire-perf-compat",[vi]:"fire-rc",[Ii]:"fire-rc-compat",[yi]:"fire-gcs",[bi]:"fire-gcs-compat",[wi]:"fire-fst",[Ei]:"fire-fst-compat","fire-js":"fire-js",[Ti]:"fire-js-all"};/**
227
227
  * @license
228
228
  * Copyright 2019 Google LLC
229
229
  *
@@ -238,7 +238,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Oe=new Map,ct=new Map;function Bi(n,e){try{n.container.addComponent(e)}catch(t){W.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function oe(n){const e=n.name;if(ct.has(e))return W.debug(`There were multiple attempts to register component ${e}.`),!1;ct.set(e,n);for(const t of Oe.values())Bi(t,n);return!0}function gn(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
241
+ */const Ae=new Map,st=new Map;function Ai(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(st.has(e))return V.debug(`There were multiple attempts to register component ${e}.`),!1;st.set(e,n);for(const t of Ae.values())Ai(t,n);return!0}function dn(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
242
242
  * @license
243
243
  * Copyright 2019 Google LLC
244
244
  *
@@ -253,7 +253,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
253
253
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
254
  * See the License for the specific language governing permissions and
255
255
  * limitations under the License.
256
- */const Fi={["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",["no-options"]:"Need to provide options, when not being deployed to hosting via source.",["invalid-app-argument"]:"firebase.{$appName}() takes either no argument or a Firebase App instance.",["invalid-log-argument"]:"First argument to `onLog` must be null or a function.",["idb-open"]:"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",["idb-get"]:"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",["idb-set"]:"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",["idb-delete"]:"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},x=new de("app","Firebase",Fi);/**
256
+ */const Ri={["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",["no-options"]:"Need to provide options, when not being deployed to hosting via source.",["invalid-app-argument"]:"firebase.{$appName}() takes either no argument or a Firebase App instance.",["invalid-log-argument"]:"First argument to `onLog` must be null or a function.",["idb-open"]:"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",["idb-get"]:"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",["idb-set"]:"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",["idb-delete"]:"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},B=new he("app","Firebase",Ri);/**
257
257
  * @license
258
258
  * Copyright 2019 Google LLC
259
259
  *
@@ -268,7 +268,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */class $i{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 x.create("app-deleted",{appName:this._name})}}/**
271
+ */class Oi{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 B.create("app-deleted",{appName:this._name})}}/**
272
272
  * @license
273
273
  * Copyright 2019 Google LLC
274
274
  *
@@ -283,7 +283,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Me=Ui;function _n(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:at,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw x.create("bad-app-name",{appName:String(i)});if(t||(t=Ur()),!t)throw x.create("no-options");const s=Oe.get(i);if(s){if(Re(t,s.options)&&Re(r,s.config))return s;throw x.create("duplicate-app",{appName:i})}const o=new qr(i);for(const c of ct.values())o.addComponent(c);const a=new $i(t,r,o);return Oe.set(i,a),a}function Hi(n=at){const e=Oe.get(n);if(!e&&n===at)return _n();if(!e)throw x.create("no-app",{appName:n});return e}function q(n,e,t){var r;let i=(r=xi[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 "/")`),W.warn(a.join(" "));return}oe(new X(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
286
+ */const Ne=Si;function hn(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:it,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw B.create("bad-app-name",{appName:String(i)});if(t||(t=Sr()),!t)throw B.create("no-options");const s=Ae.get(i);if(s){if(ke(t,s.options)&&ke(r,s.config))return s;throw B.create("duplicate-app",{appName:i})}const o=new xr(i);for(const c of st.values())o.addComponent(c);const a=new Oi(t,r,o);return Ae.set(i,a),a}function Ci(n=it){const e=Ae.get(n);if(!e&&n===it)return hn();if(!e)throw B.create("no-app",{appName:n});return e}function q(n,e,t){var r;let i=(r=ki[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"))}/**
287
287
  * @license
288
288
  * Copyright 2021 Google LLC
289
289
  *
@@ -298,7 +298,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Vi="firebase-heartbeat-database",Wi=1,ae="firebase-heartbeat-store";let tt=null;function vn(){return tt||(tt=ai(Vi,Wi,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(ae)}}}).catch(n=>{throw x.create("idb-open",{originalErrorMessage:n.message})})),tt}async function ji(n){var e;try{return(await vn()).transaction(ae).objectStore(ae).get(In(n))}catch(t){if(t instanceof B)W.warn(t.message);else{const r=x.create("idb-get",{originalErrorMessage:(e=t)===null||e===void 0?void 0:e.message});W.warn(r.message)}}}async function Ft(n,e){var t;try{const i=(await vn()).transaction(ae,"readwrite");return await i.objectStore(ae).put(e,In(n)),i.done}catch(r){if(r instanceof B)W.warn(r.message);else{const i=x.create("idb-set",{originalErrorMessage:(t=r)===null||t===void 0?void 0:t.message});W.warn(i.message)}}}function In(n){return`${n.name}!${n.options.appId}`}/**
301
+ */const Di="firebase-heartbeat-database",Pi=1,ae="firebase-heartbeat-store";let Xe=null;function fn(){return Xe||(Xe=Yr(Di,Pi,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(ae)}}}).catch(n=>{throw B.create("idb-open",{originalErrorMessage:n.message})})),Xe}async function Ni(n){var e;try{return(await fn()).transaction(ae).objectStore(ae).get(pn(n))}catch(t){if(t instanceof F)V.warn(t.message);else{const r=B.create("idb-get",{originalErrorMessage:(e=t)===null||e===void 0?void 0:e.message});V.warn(r.message)}}}async function Mt(n,e){var t;try{const i=(await fn()).transaction(ae,"readwrite");return await i.objectStore(ae).put(e,pn(n)),i.done}catch(r){if(r instanceof F)V.warn(r.message);else{const i=B.create("idb-set",{originalErrorMessage:(t=r)===null||t===void 0?void 0:t.message});V.warn(i.message)}}}function pn(n){return`${n.name}!${n.options.appId}`}/**
302
302
  * @license
303
303
  * Copyright 2021 Google LLC
304
304
  *
@@ -313,7 +313,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */const zi=1024,Gi=30*24*60*60*1e3;class Ki{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Ji(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=$t();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<=Gi}),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=$t(),{heartbeatsToSend:t,unsentEntries:r}=qi(this._heartbeatsCache.heartbeats),i=un(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 $t(){return new Date().toISOString().substring(0,10)}function qi(n,e=zi){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),Ht(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),Ht(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Ji{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Or()?Cr().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await ji(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return Ft(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 Ft(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Ht(n){return un(JSON.stringify({version:2,heartbeats:n})).length}/**
316
+ */const Li=1024,Mi=30*24*60*60*1e3;class Ui{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=Ut();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<=Mi}),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=Ut(),{heartbeatsToSend:t,unsentEntries:r}=xi(this._heartbeatsCache.heartbeats),i=sn(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 Ut(){return new Date().toISOString().substring(0,10)}function xi(n,e=Li){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),xt(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),xt(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 vr()?Ir().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 Mt(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 Mt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function xt(n){return sn(JSON.stringify({version:2,heartbeats:n})).length}/**
317
317
  * @license
318
318
  * Copyright 2019 Google LLC
319
319
  *
@@ -328,7 +328,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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
- */function Yi(n){oe(new X("platform-logger",e=>new ui(e),"PRIVATE")),oe(new X("heartbeat",e=>new Ki(e),"PRIVATE")),q(ot,Bt,n),q(ot,Bt,"esm2017"),q("fire-js","")}Yi("");function pt(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 yn(){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 Xi=yn,bn=new de("auth","Firebase",yn());/**
331
+ */function Fi(n){oe(new X("platform-logger",e=>new Zr(e),"PRIVATE")),oe(new X("heartbeat",e=>new Ui(e),"PRIVATE")),q(rt,Lt,n),q(rt,Lt,"esm2017"),q("fire-js","")}Fi("");function ht(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 mn(){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=mn,gn=new he("auth","Firebase",mn());/**
332
332
  * @license
333
333
  * Copyright 2020 Google LLC
334
334
  *
@@ -343,7 +343,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Vt=new fn("@firebase/auth");function we(n,...e){Vt.logLevel<=h.ERROR&&Vt.error(`Auth (${Me}): ${n}`,...e)}/**
346
+ */const Bt=new cn("@firebase/auth");function ye(n,...e){Bt.logLevel<=h.ERROR&&Bt.error(`Auth (${Ne}): ${n}`,...e)}/**
347
347
  * @license
348
348
  * Copyright 2020 Google LLC
349
349
  *
@@ -358,7 +358,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 b(n,...e){throw mt(n,...e)}function E(n,...e){return mt(n,...e)}function Qi(n,e,t){const r=Object.assign(Object.assign({},Xi()),{[e]:t});return new de("auth","Firebase",r).create(e,{appName:n.name})}function mt(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 bn.create(n,...e)}function u(n,e,...t){if(!n)throw mt(e,...t)}function k(n){const e="INTERNAL ASSERTION FAILED: "+n;throw we(e),new Error(e)}function R(n,e){n||k(e)}/**
361
+ */function b(n,...e){throw ft(n,...e)}function w(n,...e){return ft(n,...e)}function Hi(n,e,t){const r=Object.assign(Object.assign({},$i()),{[e]:t});return new he("auth","Firebase",r).create(e,{appName:n.name})}function ft(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 gn.create(n,...e)}function u(n,e,...t){if(!n)throw ft(e,...t)}function S(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ye(e),new Error(e)}function A(n,e){n||S(e)}/**
362
362
  * @license
363
363
  * Copyright 2020 Google LLC
364
364
  *
@@ -373,7 +373,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Wt=new Map;function A(n){R(n instanceof Function,"Expected a class definition");let e=Wt.get(n);return e?(R(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Wt.set(n,e),e)}/**
376
+ */const Ft=new Map;function k(n){A(n instanceof Function,"Expected a class definition");let e=Ft.get(n);return e?(A(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Ft.set(n,e),e)}/**
377
377
  * @license
378
378
  * Copyright 2020 Google LLC
379
379
  *
@@ -388,7 +388,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Zi(n,e){const t=gn(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 es(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(A);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}/**
391
+ */function ji(n,e){const t=dn(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(ke(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)}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -403,7 +403,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 Ce(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ts(){return jt()==="http:"||jt()==="https:"}function jt(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
406
+ */function Re(){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}/**
407
407
  * @license
408
408
  * Copyright 2020 Google LLC
409
409
  *
@@ -418,7 +418,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 ns(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ts()||kr()||"connection"in navigator)?navigator.onLine:!0}function rs(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
421
+ */function zi(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Wi()||mr()||"connection"in navigator)?navigator.onLine:!0}function Gi(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
422
422
  * @license
423
423
  * Copyright 2020 Google LLC
424
424
  *
@@ -433,7 +433,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 fe{constructor(e,t){this.shortDelay=e,this.longDelay=t,R(t>e,"Short delay should be less than long delay!"),this.isMobile=Sr()||Ar()}get(){return ns()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
436
+ */class pe{constructor(e,t){this.shortDelay=e,this.longDelay=t,A(t>e,"Short delay should be less than long delay!"),this.isMobile=pr()||gr()}get(){return zi()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
437
437
  * @license
438
438
  * Copyright 2020 Google LLC
439
439
  *
@@ -448,7 +448,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 gt(n,e){R(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
451
+ */function pt(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}/**
452
452
  * @license
453
453
  * Copyright 2020 Google LLC
454
454
  *
@@ -463,7 +463,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 wn{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;k("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;k("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;k("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
466
+ */class _n{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")}}/**
467
467
  * @license
468
468
  * Copyright 2020 Google LLC
469
469
  *
@@ -478,7 +478,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 is={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={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"};/**
482
482
  * @license
483
483
  * Copyright 2020 Google LLC
484
484
  *
@@ -493,7 +493,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 ss=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 En(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),wn.fetch()(Tn(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function En(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},is),e);try{const i=new os(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 Qi(n,d,l);b(n,d)}}catch(i){if(i instanceof B)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 Tn(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?gt(n.config,i):`${n.config.apiScheme}://${i}`}class os{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(E(this.auth,"network-request-failed")),ss.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}/**
496
+ */const qi=new pe(3e4,6e4);function me(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 vn(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=fe(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),_n.fetch()(In(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function vn(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Ki),e);try{const i=new Ji(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 Hi(n,d,l);b(n,d)}}catch(i){if(i instanceof F)throw i;b(n,"network-request-failed")}}async function Le(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 In(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?pt(n.config,i):`${n.config.apiScheme}://${i}`}class Ji{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(w(this.auth,"network-request-failed")),qi.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=w(n,e,r);return i.customData._tokenResponse=t,i}/**
497
497
  * @license
498
498
  * Copyright 2020 Google LLC
499
499
  *
@@ -508,7 +508,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 as(n,e){return ee(n,"POST","/v1/accounts:delete",e)}async function cs(n,e){return ee(n,"POST","/v1/accounts:lookup",e)}/**
511
+ */async function Yi(n,e){return ee(n,"POST","/v1/accounts:delete",e)}async function Xi(n,e){return ee(n,"POST","/v1/accounts:lookup",e)}/**
512
512
  * @license
513
513
  * Copyright 2020 Google LLC
514
514
  *
@@ -523,7 +523,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 se(n){if(!!n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function ls(n,e=!1){const t=S(n),r=await t.getIdToken(e),i=_t(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(nt(i.auth_time)),issuedAtTime:se(nt(i.iat)),expirationTime:se(nt(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function nt(n){return Number(n)*1e3}function _t(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=dn(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 us(n){const e=_t(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
+ */function se(n){if(!!n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Qi(n,e=!1){const t=T(n),r=await t.getIdToken(e),i=mt(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(Qe(i.auth_time)),issuedAtTime:se(Qe(i.iat)),expirationTime:se(Qe(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Qe(n){return Number(n)*1e3}function mt(n){var e;const[t,r,i]=n.split(".");if(t===void 0||r===void 0||i===void 0)return ye("JWT malformed, contained fewer than 3 sections"),null;try{const s=on(r);return s?JSON.parse(s):(ye("Failed to decode base64 JWT payload"),null)}catch(s){return ye("Caught error parsing JWT payload as JSON",(e=s)===null||e===void 0?void 0:e.toString()),null}}function Zi(n){const e=mt(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)}/**
527
527
  * @license
528
528
  * Copyright 2020 Google LLC
529
529
  *
@@ -538,7 +538,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 ce(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof B&&ds(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function ds({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
541
+ */async function ce(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof F&&es(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function es({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
542
542
  * @license
543
543
  * Copyright 2020 Google LLC
544
544
  *
@@ -553,7 +553,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
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 hs{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()}}/**
556
+ */class ts{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
557
  * @license
558
558
  * Copyright 2020 Google LLC
559
559
  *
@@ -568,7 +568,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
568
568
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
569
  * See the License for the specific language governing permissions and
570
570
  * limitations under the License.
571
- */class Sn{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}}}/**
571
+ */class yn{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
572
  * @license
573
573
  * Copyright 2019 Google LLC
574
574
  *
@@ -583,7 +583,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
583
583
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
584
  * See the License for the specific language governing permissions and
585
585
  * limitations under the License.
586
- */async function De(n){var e;const t=n.auth,r=await n.getIdToken(),i=await ce(n,cs(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?ms(s.providerUserInfo):[],a=ps(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 Sn(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function fs(n){const e=S(n);await De(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function ps(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ms(n){return n.map(e=>{var{providerId:t}=e,r=pt(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
586
+ */async function Oe(n){var e;const t=n.auth,r=await n.getIdToken(),i=await ce(n,Xi(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?is(s.providerUserInfo):[],a=rs(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 yn(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function ns(n){const e=T(n);await Oe(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function rs(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function is(n){return n.map(e=>{var{providerId:t}=e,r=ht(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
587
  * @license
588
588
  * Copyright 2020 Google LLC
589
589
  *
@@ -598,7 +598,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
598
598
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
599
  * See the License for the specific language governing permissions and
600
600
  * limitations under the License.
601
- */async function gs(n,e){const t=await En(n,{},async()=>{const r=he({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Tn(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",wn.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
601
+ */async function ss(n,e){const t=await vn(n,{},async()=>{const r=fe({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=In(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",_n.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
602
602
  * @license
603
603
  * Copyright 2020 Google LLC
604
604
  *
@@ -613,7 +613,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
613
613
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
614
  * See the License for the specific language governing permissions and
615
615
  * limitations under the License.
616
- */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):us(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 gs(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 k("not implemented")}}/**
616
+ */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):Zi(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 ss(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
617
  * @license
618
618
  * Copyright 2020 Google LLC
619
619
  *
@@ -628,7 +628,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
628
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
629
  * See the License for the specific language governing permissions and
630
630
  * limitations under the License.
631
- */function D(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class V{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=pt(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new hs(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 Sn(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 ls(this,e)}reload(){return fs(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 V(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,as(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,O=(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,C=(l=t.createdAt)!==null&&l!==void 0?l:void 0,ve=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:te,emailVerified:Tt,isAnonymous:St,providerData:We,stsTokenManager:kt}=t;u(te&&kt,e,"internal-error");const ir=le.fromJSON(this.name,kt);u(typeof te=="string",e,"internal-error"),D(f,e.name),D(p,e.name),u(typeof Tt=="boolean",e,"internal-error"),u(typeof St=="boolean",e,"internal-error"),D(y,e.name),D(O,e.name),D(g,e.name),D(_,e.name),D(C,e.name),D(ve,e.name);const je=new V({uid:te,auth:e,email:p,emailVerified:Tt,displayName:f,isAnonymous:St,photoURL:O,phoneNumber:y,tenantId:g,stsTokenManager:ir,createdAt:C,lastLoginAt:ve});return We&&Array.isArray(We)&&(je.providerData=We.map(sr=>Object.assign({},sr))),_&&(je._redirectEventId=_),je}static async _fromIdTokenResponse(e,t,r=!1){const i=new le;i.updateFromServerResponse(t);const s=new V({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await De(s),s}}/**
631
+ */function D(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class j{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=ht(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ts(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 yn(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 Qi(this,e)}reload(){return ns(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 j(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 Oe(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await ce(this,Yi(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,O=(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,C=(l=t.createdAt)!==null&&l!==void 0?l:void 0,ve=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:te,emailVerified:bt,isAnonymous:wt,providerData:$e,stsTokenManager:Et}=t;u(te&&Et,e,"internal-error");const Yn=le.fromJSON(this.name,Et);u(typeof te=="string",e,"internal-error"),D(f,e.name),D(p,e.name),u(typeof bt=="boolean",e,"internal-error"),u(typeof wt=="boolean",e,"internal-error"),D(y,e.name),D(O,e.name),D(g,e.name),D(_,e.name),D(C,e.name),D(ve,e.name);const He=new j({uid:te,auth:e,email:p,emailVerified:bt,displayName:f,isAnonymous:wt,photoURL:O,phoneNumber:y,tenantId:g,stsTokenManager:Yn,createdAt:C,lastLoginAt:ve});return $e&&Array.isArray($e)&&(He.providerData=$e.map(Xn=>Object.assign({},Xn))),_&&(He._redirectEventId=_),He}static async _fromIdTokenResponse(e,t,r=!1){const i=new le;i.updateFromServerResponse(t);const s=new j({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Oe(s),s}}/**
632
632
  * @license
633
633
  * Copyright 2019 Google LLC
634
634
  *
@@ -643,7 +643,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
643
643
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
644
  * See the License for the specific language governing permissions and
645
645
  * limitations under the License.
646
- */class kn{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){}}kn.type="NONE";const zt=kn;/**
646
+ */class bn{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){}}bn.type="NONE";const Ht=bn;/**
647
647
  * @license
648
648
  * Copyright 2019 Google LLC
649
649
  *
@@ -658,7 +658,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
658
658
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
659
  * See the License for the specific language governing permissions and
660
660
  * limitations under the License.
661
- */function 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?V._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(A(zt),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||A(zt);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=V._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))}}/**
661
+ */function be(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=be(this.userKey,i.apiKey,s),this.fullPersistenceKey=be("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?j._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new J(k(Ht),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(Ht);const o=be(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=j._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
662
  * @license
663
663
  * Copyright 2020 Google LLC
664
664
  *
@@ -673,7 +673,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
673
673
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
674
674
  * See the License for the specific language governing permissions and
675
675
  * limitations under the License.
676
- */function Gt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(On(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(An(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Dn(e))return"Blackberry";if(Nn(e))return"Webos";if(vt(e))return"Safari";if((e.includes("chrome/")||Rn(e))&&!e.includes("edge/"))return"Chrome";if(Cn(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 An(n=m()){return/firefox\//i.test(n)}function vt(n=m()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Rn(n=m()){return/crios\//i.test(n)}function On(n=m()){return/iemobile/i.test(n)}function Cn(n=m()){return/android/i.test(n)}function Dn(n=m()){return/blackberry/i.test(n)}function Nn(n=m()){return/webos/i.test(n)}function xe(n=m()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function _s(n=m()){var e;return xe(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function vs(){return Rr()&&document.documentMode===10}function Pn(n=m()){return xe(n)||Cn(n)||Nn(n)||Dn(n)||/windows phone/i.test(n)||On(n)}function Is(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
676
+ */function jt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Tn(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(wn(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(kn(e))return"Blackberry";if(An(e))return"Webos";if(gt(e))return"Safari";if((e.includes("chrome/")||En(e))&&!e.includes("edge/"))return"Chrome";if(Sn(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 wn(n=m()){return/firefox\//i.test(n)}function gt(n=m()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function En(n=m()){return/crios\//i.test(n)}function Tn(n=m()){return/iemobile/i.test(n)}function Sn(n=m()){return/android/i.test(n)}function kn(n=m()){return/blackberry/i.test(n)}function An(n=m()){return/webos/i.test(n)}function Me(n=m()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function os(n=m()){var e;return Me(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function as(){return _r()&&document.documentMode===10}function Rn(n=m()){return Me(n)||Sn(n)||An(n)||kn(n)||/windows phone/i.test(n)||Tn(n)}function cs(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
677
677
  * @license
678
678
  * Copyright 2020 Google LLC
679
679
  *
@@ -688,7 +688,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
688
688
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
689
689
  * See the License for the specific language governing permissions and
690
690
  * limitations under the License.
691
- */function Ln(n,e=[]){let t;switch(n){case"Browser":t=Gt(m());break;case"Worker":t=`${Gt(m())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Me}/${r}`}/**
691
+ */function On(n,e=[]){let t;switch(n){case"Browser":t=jt(m());break;case"Worker":t=`${jt(m())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ne}/${r}`}/**
692
692
  * @license
693
693
  * Copyright 2022 Google LLC
694
694
  *
@@ -703,7 +703,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
703
703
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
704
704
  * See the License for the specific language governing permissions and
705
705
  * limitations under the License.
706
- */class ys{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})}}}/**
706
+ */class ls{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
707
  * @license
708
708
  * Copyright 2020 Google LLC
709
709
  *
@@ -718,7 +718,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
718
718
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
719
719
  * See the License for the specific language governing permissions and
720
720
  * limitations under the License.
721
- */class bs{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 Kt(this),this.idTokenSubscription=new Kt(this),this.beforeStateQueue=new ys(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=bn,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=A(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=rs()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?S(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(A(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&&A(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await J.create(this,[A(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=Ln(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 Be(n){return S(n)}class Kt{constructor(e){this.auth=e,this.observer=null,this.addObserver=Vr(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function ws(n,e,t){const r=Be(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=Mn(e),{host:o,port:a}=Es(e),c=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Ts()}function Mn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Es(n){const e=Mn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:qt(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:qt(o)}}}function qt(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Ts(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
721
+ */class us{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 ls(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=gn,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 Oe(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=Gi()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?T(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 he("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=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 Ue(n){return T(n)}class Vt{constructor(e){this.auth=e,this.observer=null,this.addObserver=Dr(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function ds(n,e,t){const r=Ue(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=Cn(e),{host:o,port:a}=hs(e),c=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||fs()}function Cn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function hs(n){const e=Cn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:Wt(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:Wt(o)}}}function Wt(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function fs(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
722
722
  * @license
723
723
  * Copyright 2020 Google LLC
724
724
  *
@@ -733,7 +733,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
733
733
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
734
  * See the License for the specific language governing permissions and
735
735
  * limitations under the License.
736
- */class It{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return k("not implemented")}_getIdTokenResponse(e){return k("not implemented")}_linkToIdToken(e,t){return k("not implemented")}_getReauthenticationResolver(e){return k("not implemented")}}async function Ss(n,e){return ee(n,"POST","/v1/accounts:update",e)}/**
736
+ */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 ps(n,e){return ee(n,"POST","/v1/accounts:update",e)}/**
737
737
  * @license
738
738
  * Copyright 2020 Google LLC
739
739
  *
@@ -748,7 +748,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
748
748
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
749
  * See the License for the specific language governing permissions and
750
750
  * limitations under the License.
751
- */async function ks(n,e){return Ue(n,"POST","/v1/accounts:signInWithPassword",pe(n,e))}async function As(n,e){return ee(n,"POST","/v1/accounts:sendOobCode",pe(n,e))}async function Rs(n,e){return As(n,e)}/**
751
+ */async function ms(n,e){return Le(n,"POST","/v1/accounts:signInWithPassword",me(n,e))}async function gs(n,e){return ee(n,"POST","/v1/accounts:sendOobCode",me(n,e))}async function _s(n,e){return gs(n,e)}/**
752
752
  * @license
753
753
  * Copyright 2020 Google LLC
754
754
  *
@@ -763,7 +763,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
763
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
764
  * See the License for the specific language governing permissions and
765
765
  * limitations under the License.
766
- */async function Os(n,e){return Ue(n,"POST","/v1/accounts:signInWithEmailLink",pe(n,e))}async function Cs(n,e){return Ue(n,"POST","/v1/accounts:signInWithEmailLink",pe(n,e))}/**
766
+ */async function vs(n,e){return Le(n,"POST","/v1/accounts:signInWithEmailLink",me(n,e))}async function Is(n,e){return Le(n,"POST","/v1/accounts:signInWithEmailLink",me(n,e))}/**
767
767
  * @license
768
768
  * Copyright 2020 Google LLC
769
769
  *
@@ -778,7 +778,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
778
778
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779
779
  * See the License for the specific language governing permissions and
780
780
  * limitations under the License.
781
- */class ue extends It{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 ks(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Os(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ss(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Cs(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
781
+ */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 ms(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return vs(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ps(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Is(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
782
782
  * @license
783
783
  * Copyright 2020 Google LLC
784
784
  *
@@ -793,7 +793,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
793
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
794
794
  * See the License for the specific language governing permissions and
795
795
  * limitations under the License.
796
- */async function Y(n,e){return Ue(n,"POST","/v1/accounts:signInWithIdp",pe(n,e))}/**
796
+ */async function Y(n,e){return Le(n,"POST","/v1/accounts:signInWithIdp",me(n,e))}/**
797
797
  * @license
798
798
  * Copyright 2020 Google LLC
799
799
  *
@@ -808,7 +808,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
808
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
809
  * See the License for the specific language governing permissions and
810
810
  * limitations under the License.
811
- */const Ds="http://localhost";class j extends It{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=pt(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:Ds,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}}/**
811
+ */const ys="http://localhost";class W extends _t{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new W(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=ht(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new W(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:ys,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=fe(t)}return e}}/**
812
812
  * @license
813
813
  * Copyright 2020 Google LLC
814
814
  *
@@ -823,7 +823,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
823
823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
824
824
  * See the License for the specific language governing permissions and
825
825
  * limitations under the License.
826
- */function Ns(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 Ps(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 Fe{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=Ns((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=Ps(e);try{return new Fe(t)}catch{return null}}}/**
826
+ */function bs(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 ws(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=bs((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=ws(e);try{return new xe(t)}catch{return null}}}/**
827
827
  * @license
828
828
  * Copyright 2020 Google LLC
829
829
  *
@@ -838,7 +838,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
838
838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
839
  * See the License for the specific language governing permissions and
840
840
  * limitations under the License.
841
- */class z{constructor(){this.providerId=z.PROVIDER_ID}static credential(e,t){return ue._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=Fe.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";/**
841
+ */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
842
  * @license
843
843
  * Copyright 2020 Google LLC
844
844
  *
@@ -853,7 +853,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
853
853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854
854
  * See the License for the specific language governing permissions and
855
855
  * limitations under the License.
856
- */class Un{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}}/**
856
+ */class Dn{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
857
  * @license
858
858
  * Copyright 2019 Google LLC
859
859
  *
@@ -868,7 +868,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
868
868
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
869
869
  * See the License for the specific language governing permissions and
870
870
  * limitations under the License.
871
- */class me extends Un{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
871
+ */class ge extends Dn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
872
872
  * @license
873
873
  * Copyright 2020 Google LLC
874
874
  *
@@ -883,7 +883,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
883
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
884
  * See the License for the specific language governing permissions and
885
885
  * limitations under the License.
886
- */class N extends me{constructor(){super("facebook.com")}static credential(e){return j._fromParams({providerId:N.PROVIDER_ID,signInMethod:N.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return N.credentialFromTaggedObject(e)}static credentialFromError(e){return N.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return N.credential(e.oauthAccessToken)}catch{return null}}}N.FACEBOOK_SIGN_IN_METHOD="facebook.com";N.PROVIDER_ID="facebook.com";/**
886
+ */class N extends ge{constructor(){super("facebook.com")}static credential(e){return W._fromParams({providerId:N.PROVIDER_ID,signInMethod:N.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return N.credentialFromTaggedObject(e)}static credentialFromError(e){return N.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return N.credential(e.oauthAccessToken)}catch{return null}}}N.FACEBOOK_SIGN_IN_METHOD="facebook.com";N.PROVIDER_ID="facebook.com";/**
887
887
  * @license
888
888
  * Copyright 2020 Google LLC
889
889
  *
@@ -898,7 +898,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
898
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
899
  * See the License for the specific language governing permissions and
900
900
  * limitations under the License.
901
- */class P extends me{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return j._fromParams({providerId:P.PROVIDER_ID,signInMethod:P.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return P.credentialFromTaggedObject(e)}static credentialFromError(e){return P.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return P.credential(t,r)}catch{return null}}}P.GOOGLE_SIGN_IN_METHOD="google.com";P.PROVIDER_ID="google.com";/**
901
+ */class L extends ge{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return W._fromParams({providerId:L.PROVIDER_ID,signInMethod:L.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken: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{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return L.credential(t,r)}catch{return null}}}L.GOOGLE_SIGN_IN_METHOD="google.com";L.PROVIDER_ID="google.com";/**
902
902
  * @license
903
903
  * Copyright 2020 Google LLC
904
904
  *
@@ -913,7 +913,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
913
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
914
  * See the License for the specific language governing permissions and
915
915
  * limitations under the License.
916
- */class L extends me{constructor(){super("github.com")}static credential(e){return j._fromParams({providerId:L.PROVIDER_ID,signInMethod:L.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return L.credentialFromTaggedObject(e)}static credentialFromError(e){return L.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return L.credential(e.oauthAccessToken)}catch{return null}}}L.GITHUB_SIGN_IN_METHOD="github.com";L.PROVIDER_ID="github.com";/**
916
+ */class M extends ge{constructor(){super("github.com")}static credential(e){return W._fromParams({providerId:M.PROVIDER_ID,signInMethod:M.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return M.credentialFromTaggedObject(e)}static credentialFromError(e){return M.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return M.credential(e.oauthAccessToken)}catch{return null}}}M.GITHUB_SIGN_IN_METHOD="github.com";M.PROVIDER_ID="github.com";/**
917
917
  * @license
918
918
  * Copyright 2020 Google LLC
919
919
  *
@@ -928,7 +928,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
928
928
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
929
929
  * See the License for the specific language governing permissions and
930
930
  * limitations under the License.
931
- */class M extends me{constructor(){super("twitter.com")}static credential(e,t){return j._fromParams({providerId:M.PROVIDER_ID,signInMethod:M.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return M.credentialFromTaggedObject(e)}static credentialFromError(e){return M.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return M.credential(t,r)}catch{return null}}}M.TWITTER_SIGN_IN_METHOD="twitter.com";M.PROVIDER_ID="twitter.com";/**
931
+ */class U extends ge{constructor(){super("twitter.com")}static credential(e,t){return W._fromParams({providerId:U.PROVIDER_ID,signInMethod:U.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return U.credentialFromTaggedObject(e)}static credentialFromError(e){return U.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return U.credential(t,r)}catch{return null}}}U.TWITTER_SIGN_IN_METHOD="twitter.com";U.PROVIDER_ID="twitter.com";/**
932
932
  * @license
933
933
  * Copyright 2020 Google LLC
934
934
  *
@@ -943,7 +943,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
943
943
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
944
944
  * See the License for the specific language governing permissions and
945
945
  * limitations under the License.
946
- */class 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 V._fromIdTokenResponse(e,r,i),o=Jt(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=Jt(r);return new Q({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function Jt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
946
+ */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 j._fromIdTokenResponse(e,r,i),o=zt(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=zt(r);return new Q({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function zt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
947
947
  * @license
948
948
  * Copyright 2020 Google LLC
949
949
  *
@@ -958,7 +958,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
958
958
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
959
959
  * See the License for the specific language governing permissions and
960
960
  * limitations under the License.
961
- */class Ne extends B{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 xn(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 Ls(n,e,t=!1){const r=await ce(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return Q._forOperation(n,"link",r)}/**
961
+ */class Ce extends F{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Ce.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 Ce(e,t,r,i)}}function Pn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Ce._fromErrorAndOperation(n,s,e,r):s})}async function Es(n,e,t=!1){const r=await ce(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return Q._forOperation(n,"link",r)}/**
962
962
  * @license
963
963
  * Copyright 2019 Google LLC
964
964
  *
@@ -973,7 +973,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
973
973
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
974
974
  * See the License for the specific language governing permissions and
975
975
  * limitations under the License.
976
- */async function Ms(n,e,t=!1){var r;const{auth:i}=n,s="reauthenticate";try{const o=await ce(n,xn(i,s,e,n),t);u(o.idToken,i,"internal-error");const a=_t(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}}/**
976
+ */async function Ts(n,e,t=!1){var r;const{auth:i}=n,s="reauthenticate";try{const o=await ce(n,Pn(i,s,e,n),t);u(o.idToken,i,"internal-error");const a=mt(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
977
  * @license
978
978
  * Copyright 2020 Google LLC
979
979
  *
@@ -988,7 +988,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
988
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
989
  * See the License for the specific language governing permissions and
990
990
  * limitations under the License.
991
- */async function Bn(n,e,t=!1){const r="signIn",i=await xn(n,r,e),s=await Q._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Fn(n,e){return Bn(Be(n),e)}/**
991
+ */async function Nn(n,e,t=!1){const r="signIn",i=await Pn(n,r,e),s=await Q._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Ln(n,e){return Nn(Ue(n),e)}/**
992
992
  * @license
993
993
  * Copyright 2020 Google LLC
994
994
  *
@@ -1003,7 +1003,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1003
1003
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
1004
  * See the License for the specific language governing permissions and
1005
1005
  * limitations under the License.
1006
- */function Us(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 xs(n,e,t){return Fn(S(n),z.credential(e,t))}/**
1006
+ */function Ss(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 ks(n,e,t){return Ln(T(n),z.credential(e,t))}/**
1007
1007
  * @license
1008
1008
  * Copyright 2020 Google LLC
1009
1009
  *
@@ -1018,7 +1018,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1018
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1019
  * See the License for the specific language governing permissions and
1020
1020
  * limitations under the License.
1021
- */async function Bs(n,e,t){const r=S(n),i={requestType:"EMAIL_SIGNIN",email:e};u(t.handleCodeInApp,r,"argument-error"),t&&Us(r,i,t),await Rs(r,i)}function Fs(n,e){const t=Fe.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function $s(n,e,t){const r=S(n),i=z.credentialWithLink(e,t||Ce());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Fn(r,i)}function Hs(n,e,t,r){return S(n).onIdTokenChanged(e,t,r)}function Vs(n,e,t){return S(n).beforeAuthStateChanged(e,t)}function Ws(n,e,t,r){return S(n).onAuthStateChanged(e,t,r)}const Pe="__sak";/**
1021
+ */async function As(n,e,t){const r=T(n),i={requestType:"EMAIL_SIGNIN",email:e};u(t.handleCodeInApp,r,"argument-error"),t&&Ss(r,i,t),await _s(r,i)}function Rs(n,e){const t=xe.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function Os(n,e,t){const r=T(n),i=z.credentialWithLink(e,t||Re());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Ln(r,i)}function Cs(n,e,t,r){return T(n).onIdTokenChanged(e,t,r)}function Ds(n,e,t){return T(n).beforeAuthStateChanged(e,t)}function Ps(n,e,t,r){return T(n).onAuthStateChanged(e,t,r)}const De="__sak";/**
1022
1022
  * @license
1023
1023
  * Copyright 2019 Google LLC
1024
1024
  *
@@ -1033,7 +1033,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1033
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1034
  * See the License for the specific language governing permissions and
1035
1035
  * limitations under the License.
1036
- */class $n{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()}}/**
1036
+ */class Mn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(De,"1"),this.storage.removeItem(De),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
1037
  * @license
1038
1038
  * Copyright 2020 Google LLC
1039
1039
  *
@@ -1048,7 +1048,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1048
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1049
  * See the License for the specific language governing permissions and
1050
1050
  * limitations under the License.
1051
- */function js(){const n=m();return vt(n)||xe(n)}const zs=1e3,Gs=10;class Hn extends $n{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=js()&&Is(),this.fallbackToPolling=Pn(),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);vs()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Gs):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)})},zs)}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]}}Hn.type="LOCAL";const Ks=Hn;/**
1051
+ */function Ns(){const n=m();return gt(n)||Me(n)}const Ls=1e3,Ms=10;class Un extends Mn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Ns()&&cs(),this.fallbackToPolling=Rn(),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);as()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Ms):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)})},Ls)}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]}}Un.type="LOCAL";const Us=Un;/**
1052
1052
  * @license
1053
1053
  * Copyright 2020 Google LLC
1054
1054
  *
@@ -1063,7 +1063,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1063
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1064
  * See the License for the specific language governing permissions and
1065
1065
  * limitations under the License.
1066
- */class Vn extends $n{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Vn.type="SESSION";const Wn=Vn;/**
1066
+ */class xn extends Mn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}xn.type="SESSION";const Bn=xn;/**
1067
1067
  * @license
1068
1068
  * Copyright 2019 Google LLC
1069
1069
  *
@@ -1078,7 +1078,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1078
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1079
  * See the License for the specific language governing permissions and
1080
1080
  * limitations under the License.
1081
- */function qs(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}}}))}/**
1081
+ */function xs(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1082
1082
  * @license
1083
1083
  * Copyright 2019 Google LLC
1084
1084
  *
@@ -1093,7 +1093,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1093
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1094
  * See the License for the specific language governing permissions and
1095
1095
  * limitations under the License.
1096
- */class $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 qs(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=[];/**
1096
+ */class Be{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 Be(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 xs(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)}}Be.receivers=[];/**
1097
1097
  * @license
1098
1098
  * Copyright 2020 Google LLC
1099
1099
  *
@@ -1108,7 +1108,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1108
1108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
1109
  * See the License for the specific language governing permissions and
1110
1110
  * limitations under the License.
1111
- */function yt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1111
+ */function vt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1112
1112
  * @license
1113
1113
  * Copyright 2019 Google LLC
1114
1114
  *
@@ -1123,7 +1123,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1123
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1124
1124
  * See the License for the specific language governing permissions and
1125
1125
  * limitations under the License.
1126
- */class Js{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=yt("",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)})}}/**
1126
+ */class Bs{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
1127
  * @license
1128
1128
  * Copyright 2020 Google LLC
1129
1129
  *
@@ -1138,7 +1138,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1138
1138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1139
1139
  * See the License for the specific language governing permissions and
1140
1140
  * limitations under the License.
1141
- */function T(){return window}function Ys(n){T().location.href=n}/**
1141
+ */function E(){return window}function Fs(n){E().location.href=n}/**
1142
1142
  * @license
1143
1143
  * Copyright 2020 Google LLC.
1144
1144
  *
@@ -1153,7 +1153,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1153
1153
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1154
1154
  * See the License for the specific language governing permissions and
1155
1155
  * limitations under the License.
1156
- */function jn(){return typeof T().WorkerGlobalScope<"u"&&typeof T().importScripts=="function"}async function Xs(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Qs(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Zs(){return jn()?self:null}/**
1156
+ */function Fn(){return typeof E().WorkerGlobalScope<"u"&&typeof E().importScripts=="function"}async function $s(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Hs(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function js(){return Fn()?self:null}/**
1157
1157
  * @license
1158
1158
  * Copyright 2019 Google LLC
1159
1159
  *
@@ -1168,7 +1168,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1168
1168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
1169
  * See the License for the specific language governing permissions and
1170
1170
  * limitations under the License.
1171
- */const zn="firebaseLocalStorageDb",eo=1,Le="firebaseLocalStorage",Gn="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 He(n,e){return n.transaction([Le],e?"readwrite":"readonly").objectStore(Le)}function to(){const n=indexedDB.deleteDatabase(zn);return new ge(n).toPromise()}function lt(){const n=indexedDB.open(zn,eo);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Le,{keyPath:Gn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Le)?e(r):(r.close(),await to(),e(await lt()))})})}async function Yt(n,e,t){const r=He(n,!0).put({[Gn]:e,value:t});return new ge(r).toPromise()}async function no(n,e){const t=He(n,!1).get(e),r=await new ge(t).toPromise();return r===void 0?null:r.value}function Xt(n,e){const t=He(n,!0).delete(e);return new ge(t).toPromise()}const ro=800,io=3;class Kn{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 lt(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>io)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return jn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=$e._getInstance(Zs()),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 Xs(),!this.activeServiceWorker)return;this.sender=new Js(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||Qs()!==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 lt();return await Yt(e,Pe,"1"),await Xt(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=>Yt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>no(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Xt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=He(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(),ro)}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()}}Kn.type="LOCAL";const so=Kn;/**
1171
+ */const $n="firebaseLocalStorageDb",Vs=1,Pe="firebaseLocalStorage",Hn="fbase_key";class _e{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([Pe],e?"readwrite":"readonly").objectStore(Pe)}function Ws(){const n=indexedDB.deleteDatabase($n);return new _e(n).toPromise()}function ot(){const n=indexedDB.open($n,Vs);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Pe,{keyPath:Hn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Pe)?e(r):(r.close(),await Ws(),e(await ot()))})})}async function Gt(n,e,t){const r=Fe(n,!0).put({[Hn]:e,value:t});return new _e(r).toPromise()}async function zs(n,e){const t=Fe(n,!1).get(e),r=await new _e(t).toPromise();return r===void 0?null:r.value}function Kt(n,e){const t=Fe(n,!0).delete(e);return new _e(t).toPromise()}const Gs=800,Ks=3;class jn{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 ot(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Ks)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Fn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Be._getInstance(js()),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 $s(),!this.activeServiceWorker)return;this.sender=new Bs(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||Hs()!==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 ot();return await Gt(e,De,"1"),await Kt(e,De),!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=>Gt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>zs(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Kt(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 _e(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(),Gs)}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()}}jn.type="LOCAL";const qs=jn;/**
1172
1172
  * @license
1173
1173
  * Copyright 2020 Google LLC
1174
1174
  *
@@ -1183,7 +1183,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1183
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1184
1184
  * See the License for the specific language governing permissions and
1185
1185
  * limitations under the License.
1186
- */function oo(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function ao(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",oo().appendChild(r)})}function co(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new fe(3e4,6e4);/**
1186
+ */function Js(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function Ys(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=w("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Js().appendChild(r)})}function Xs(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new pe(3e4,6e4);/**
1187
1187
  * @license
1188
1188
  * Copyright 2021 Google LLC
1189
1189
  *
@@ -1198,7 +1198,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1198
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1199
  * See the License for the specific language governing permissions and
1200
1200
  * limitations under the License.
1201
- */function lo(n,e){return e?A(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1201
+ */function Qs(n,e){return e?k(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1202
1202
  * @license
1203
1203
  * Copyright 2019 Google LLC
1204
1204
  *
@@ -1213,7 +1213,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1213
1213
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
1214
  * See the License for the specific language governing permissions and
1215
1215
  * limitations under the License.
1216
- */class bt extends It{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 uo(n){return Bn(n.auth,new bt(n),n.bypassAuthState)}function ho(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Ms(t,new bt(n),n.bypassAuthState)}async function fo(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Ls(t,new bt(n),n.bypassAuthState)}/**
1216
+ */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 Zs(n){return Nn(n.auth,new It(n),n.bypassAuthState)}function eo(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Ts(t,new It(n),n.bypassAuthState)}async function to(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Es(t,new It(n),n.bypassAuthState)}/**
1217
1217
  * @license
1218
1218
  * Copyright 2020 Google LLC
1219
1219
  *
@@ -1228,7 +1228,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1228
1228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1229
1229
  * See the License for the specific language governing permissions and
1230
1230
  * limitations under the License.
1231
- */class qn{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 uo;case"linkViaPopup":case"linkViaRedirect":return fo;case"reauthViaPopup":case"reauthViaRedirect":return ho;default:b(this.auth,"internal-error")}}resolve(e){R(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){R(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()}}/**
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 Zs;case"linkViaPopup":case"linkViaRedirect":return to;case"reauthViaPopup":case"reauthViaRedirect":return eo;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
1232
  * @license
1233
1233
  * Copyright 2020 Google LLC
1234
1234
  *
@@ -1243,7 +1243,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1243
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1244
  * See the License for the specific language governing permissions and
1245
1245
  * limitations under the License.
1246
- */const po=new fe(2e3,1e4);class K extends qn{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(){R(this.filter.length===1,"Popup operations only handle one event");const e=yt();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,po.get())};e()}}K.currentPopupAction=null;/**
1246
+ */const no=new pe(2e3,1e4);class K extends Vn{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(w(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(w(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(w(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,no.get())};e()}}K.currentPopupAction=null;/**
1247
1247
  * @license
1248
1248
  * Copyright 2020 Google LLC
1249
1249
  *
@@ -1258,7 +1258,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1258
1258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
1259
  * See the License for the specific language governing permissions and
1260
1260
  * limitations under the License.
1261
- */const mo="pendingRedirect",Te=new Map;class go extends qn{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 _o(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 _o(n,e){const t=yo(e),r=Io(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function vo(n,e){Te.set(n._key(),e)}function Io(n){return A(n._redirectPersistence)}function yo(n){return Ee(mo,n.config.apiKey,n.name)}async function bo(n,e,t=!1){const r=Be(n),i=lo(r,e),o=await new go(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1261
+ */const ro="pendingRedirect",we=new Map;class io extends Vn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=we.get(this.auth._key());if(!e){try{const r=await so(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}we.set(this.auth._key(),e)}return this.bypassAuthState||we.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 so(n,e){const t=co(e),r=ao(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function oo(n,e){we.set(n._key(),e)}function ao(n){return k(n._redirectPersistence)}function co(n){return be(ro,n.config.apiKey,n.name)}async function lo(n,e,t=!1){const r=Ue(n),i=Qs(r,e),o=await new io(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1262
1262
  * @license
1263
1263
  * Copyright 2020 Google LLC
1264
1264
  *
@@ -1273,7 +1273,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1273
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1274
  * See the License for the specific language governing permissions and
1275
1275
  * limitations under the License.
1276
- */const wo=10*60*1e3;class Eo{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||!To(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!Jn(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>=wo&&this.cachedEventUids.clear(),this.cachedEventUids.has(Qt(e))}saveEventToCache(e){this.cachedEventUids.add(Qt(e)),this.lastProcessedEventTime=Date.now()}}function Qt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Jn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function To(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Jn(n);default:return!1}}/**
1276
+ */const uo=10*60*1e3;class ho{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||!fo(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!Wn(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(w(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>=uo&&this.cachedEventUids.clear(),this.cachedEventUids.has(qt(e))}saveEventToCache(e){this.cachedEventUids.add(qt(e)),this.lastProcessedEventTime=Date.now()}}function qt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Wn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function fo(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Wn(n);default:return!1}}/**
1277
1277
  * @license
1278
1278
  * Copyright 2020 Google LLC
1279
1279
  *
@@ -1288,7 +1288,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1288
1288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
1289
  * See the License for the specific language governing permissions and
1290
1290
  * limitations under the License.
1291
- */async function So(n,e={}){return ee(n,"GET","/v1/projects",e)}/**
1291
+ */async function po(n,e={}){return ee(n,"GET","/v1/projects",e)}/**
1292
1292
  * @license
1293
1293
  * Copyright 2020 Google LLC
1294
1294
  *
@@ -1303,7 +1303,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1303
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1304
  * See the License for the specific language governing permissions and
1305
1305
  * limitations under the License.
1306
- */const ko=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ao=/^https?/;async function Ro(n){if(n.config.emulator)return;const{authorizedDomains:e}=await So(n);for(const t of e)try{if(Oo(t))return}catch{}b(n,"unauthorized-domain")}function Oo(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(!Ao.test(t))return!1;if(ko.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1306
+ */const mo=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,go=/^https?/;async function _o(n){if(n.config.emulator)return;const{authorizedDomains:e}=await po(n);for(const t of e)try{if(vo(t))return}catch{}b(n,"unauthorized-domain")}function vo(n){const e=Re(),{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(!go.test(t))return!1;if(mo.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1307
1307
  * @license
1308
1308
  * Copyright 2020 Google LLC.
1309
1309
  *
@@ -1318,7 +1318,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1318
1318
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1319
1319
  * See the License for the specific language governing permissions and
1320
1320
  * limitations under the License.
1321
- */const Co=new fe(3e4,6e4);function Zt(){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 Do(n){return new Promise((e,t)=>{var r,i,s;function o(){Zt(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Zt(),t(E(n,"network-request-failed"))},timeout:Co.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=co("iframefcb");return T()[a]=()=>{gapi.load?o():t(E(n,"network-request-failed"))},ao(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw Se=null,e})}let Se=null;function No(n){return Se=Se||Do(n),Se}/**
1321
+ */const Io=new pe(3e4,6e4);function Jt(){const n=E().___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 yo(n){return new Promise((e,t)=>{var r,i,s;function o(){Jt(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Jt(),t(w(n,"network-request-failed"))},timeout:Io.get()})}if(!((i=(r=E().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=E().gapi)===null||s===void 0)&&s.load)o();else{const a=Xs("iframefcb");return E()[a]=()=>{gapi.load?o():t(w(n,"network-request-failed"))},Ys(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw Ee=null,e})}let Ee=null;function bo(n){return Ee=Ee||yo(n),Ee}/**
1322
1322
  * @license
1323
1323
  * Copyright 2020 Google LLC.
1324
1324
  *
@@ -1333,7 +1333,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1333
1333
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
1334
  * See the License for the specific language governing permissions and
1335
1335
  * limitations under the License.
1336
- */const Po=new fe(5e3,15e3),Lo="__/auth/iframe",Mo="emulator/auth/iframe",Uo={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},xo=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?gt(e,Mo):`https://${n.config.authDomain}/${Lo}`,r={apiKey:e.apiKey,appName:n.name,v:Me},i=xo.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 Fo(n){const e=await No(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:Uo,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)},Po.get());function c(){T().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1336
+ */const wo=new pe(5e3,15e3),Eo="__/auth/iframe",To="emulator/auth/iframe",So={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ko=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Ao(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?pt(e,To):`https://${n.config.authDomain}/${Eo}`,r={apiKey:e.apiKey,appName:n.name,v:Ne},i=ko.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${fe(r).slice(1)}`}async function Ro(n){const e=await bo(n),t=E().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:Ao(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:So,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=w(n,"network-request-failed"),a=E().setTimeout(()=>{s(o)},wo.get());function c(){E().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1337
1337
  * @license
1338
1338
  * Copyright 2020 Google LLC.
1339
1339
  *
@@ -1348,7 +1348,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1348
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349
1349
  * See the License for the specific language governing permissions and
1350
1350
  * limitations under the License.
1351
- */const $o={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ho=500,Vo=600,Wo="_blank",jo="http://localhost";class en{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function zo(n,e,t,r=Ho,i=Vo){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({},$o),{width:r.toString(),height:i.toString(),top:s,left:o}),l=m().toLowerCase();t&&(a=Rn(l)?Wo:t),An(l)&&(e=e||jo,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[y,O])=>`${p}${y}=${O},`,"");if(_s(l)&&a!=="_self")return Go(e||"",a),new en(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new en(f)}function Go(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)}/**
1351
+ */const Oo={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Co=500,Do=600,Po="_blank",No="http://localhost";class Yt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Lo(n,e,t,r=Co,i=Do){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({},Oo),{width:r.toString(),height:i.toString(),top:s,left:o}),l=m().toLowerCase();t&&(a=En(l)?Po:t),wn(l)&&(e=e||No,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[y,O])=>`${p}${y}=${O},`,"");if(os(l)&&a!=="_self")return Mo(e||"",a),new Yt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new Yt(f)}function Mo(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
1352
  * @license
1353
1353
  * Copyright 2021 Google LLC
1354
1354
  *
@@ -1363,7 +1363,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1363
1363
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
1364
  * See the License for the specific language governing permissions and
1365
1365
  * limitations under the License.
1366
- */const Ko="__/auth/handler",qo="emulator/auth/handler";function tn(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 Un){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Hr(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`${Jo(n)}?${he(a).slice(1)}`}function Jo({config:n}){return n.emulator?gt(n,qo):`https://${n.authDomain}/${Ko}`}/**
1366
+ */const Uo="__/auth/handler",xo="emulator/auth/handler";function Xt(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:Ne,eventId:i};if(e instanceof Dn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Cr(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,l]of Object.entries(s||{}))o[c]=l}if(e instanceof ge){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`${Bo(n)}?${fe(a).slice(1)}`}function Bo({config:n}){return n.emulator?pt(n,xo):`https://${n.authDomain}/${Uo}`}/**
1367
1367
  * @license
1368
1368
  * Copyright 2020 Google LLC
1369
1369
  *
@@ -1378,7 +1378,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1378
1378
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1379
1379
  * See the License for the specific language governing permissions and
1380
1380
  * limitations under the License.
1381
- */const rt="webStorageSupport";class Yo{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Wn,this._completeRedirectFn=bo,this._overrideRedirectResult=vo}async _openPopup(e,t,r,i){var s;R((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=tn(e,t,r,Ce(),i);return zo(e,o,yt())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Ys(tn(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):(R(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 Fo(e),r=new Eo(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(rt,{type:rt},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[rt];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]=Ro(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Pn()||vt()||xe()}}const Xo=Yo;var nn="@firebase/auth",rn="0.20.10";/**
1381
+ */const Ze="webStorageSupport";class Fo{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Bn,this._completeRedirectFn=lo,this._overrideRedirectResult=oo}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=Xt(e,t,r,Re(),i);return Lo(e,o,vt())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Fs(Xt(e,t,r,Re(),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 Ro(e),r=new ho(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(Ze,{type:Ze},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Ze];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]=_o(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Rn()||gt()||Me()}}const $o=Fo;var Qt="@firebase/auth",Zt="0.20.11";/**
1382
1382
  * @license
1383
1383
  * Copyright 2020 Google LLC
1384
1384
  *
@@ -1393,7 +1393,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1393
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1394
  * See the License for the specific language governing permissions and
1395
1395
  * limitations under the License.
1396
- */class Qo{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()}}/**
1396
+ */class Ho{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
1397
  * @license
1398
1398
  * Copyright 2020 Google LLC
1399
1399
  *
@@ -1408,7 +1408,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1408
1408
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1409
1409
  * See the License for the specific language governing permissions and
1410
1410
  * limitations under the License.
1411
- */function Zo(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function ea(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:Ln(n)},d=new bs(a,c,l);return es(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=Be(e.getProvider("auth").getImmediate());return(r=>new Qo(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),q(nn,rn,Zo(n)),q(nn,rn,"esm2017")}/**
1411
+ */function jo(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function Vo(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:On(n)},d=new us(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=Ue(e.getProvider("auth").getImmediate());return(r=>new Ho(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),q(Qt,Zt,jo(n)),q(Qt,Zt,"esm2017")}/**
1412
1412
  * @license
1413
1413
  * Copyright 2021 Google LLC
1414
1414
  *
@@ -1423,7 +1423,7 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1423
1423
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1424
  * See the License for the specific language governing permissions and
1425
1425
  * limitations under the License.
1426
- */const ta=5*60,na=hn("authIdTokenMaxAge")||ta;let sn=null;const ra=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>na)return;const i=t?.token;sn!==i&&(sn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Yn(n=Hi()){const e=gn(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Zi(n,{popupRedirectResolver:Xo,persistence:[so,Ks,Wn]}),r=hn("authTokenSyncURL");if(r){const s=ra(r);Vs(t,s,()=>s(t.currentUser)),Hs(t,o=>s(o))}const i=Mr("auth");return i&&ws(t,`http://${i}`),t}ea("Browser");globalThis.__apiCache||(globalThis.__apiCache={});const G={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0};class on 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 ia={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}=ia.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 O=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 on(n,g,_.message,y)}if(clearTimeout(O),g){if(g.ok){const C={...g,data:await g.json()};return c&&l&&(globalThis.__apiCache[l]={timestamp:Date.now(),res:C}),{...C,config:n}}const{status:_}=g;if(o<e&&(_===429||_>=500)){const C=g.headers.get("retry-after");return new Promise((ve,te)=>{setTimeout(()=>{I(n,e+1).then(ve).catch(te)},C&&parseInt(C,10)||5e3)})}}try{g.data=await g?.json()}catch{}throw new on(n,g)},sa=(n,e)=>I({...e,endpoint:n}),oa=(n,e,t)=>I({...t,method:"post",endpoint:n,body:e}),aa=(n,e,t)=>I({...t,method:"put",endpoint:n,body:e}),ca=(n,e,t)=>I({...t,method:"patch",endpoint:n,body:e}),Xn=(n,e)=>I({...e,method:"delete",endpoint:n});I.get=sa;I.post=oa;I.put=aa;I.patch=ca;I.del=Xn;I.delete=Xn;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 la="en_us",ua="USD",da="$",ha="US",fa=1011,pa="5b1abe30a4d4531b8fe40725",ma=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()]},ut={};["lang","currency","currency_symbol","country_code","store_id","store_object_id"].forEach(n=>{ut[n]=ma("ecom_"+n)});const ga={get(n){const e=ut[n];if(e!=null&&e!=="")return e;switch(n){case"lang":return la;case"currency":return ua;case"currency_symbol":return da;case"country_code":return ha;case"store_id":return fa;case"store_object_id":return pa}return null},set(n,e){ut[n]=e}},_a=n=>{if(n){if(n.display_name)return n.display_name;if(n.name&&n.name.given_name)return n.name.given_name}return""},va=_a;Ae.$ecomConfig;const Ia=2,ya=5,ye=6,be=10;let Qn=(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])}),ba=(n,e)=>Qn(n,e,Ia,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}}),wa=1e3,Ea=(n,e)=>Qn(n,r=>{let i=e(r);i&&n.events[ye].push(i)},ya,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()}},wa)},()=>{n.listen=i,n.off=s}}),$=[],dt=0,Zn=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){dt++;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},Ta=(n={})=>{let e=Zn(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!==dt||o.some((a,c)=>a!==r[c]))&&(t=dt,r=o,s.set(e(...o)))},s=Zn();return Ea(s,()=>{let o=n.map(a=>a.listen(i,e));return i(),()=>{for(let a of o)a()}}),s};var Sa="firebase",ka="9.12.1";/**
1426
+ */const Wo=5*60,zo=an("authIdTokenMaxAge")||Wo;let en=null;const Go=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>zo)return;const i=t?.token;en!==i&&(en=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function zn(n=Ci()){const e=dn(n,"auth");if(e.isInitialized())return e.getImmediate();const t=ji(n,{popupRedirectResolver:$o,persistence:[qs,Us,Bn]}),r=an("authTokenSyncURL");if(r){const s=Go(r);Ds(t,s,()=>s(t.currentUser)),Cs(t,o=>s(o))}const i=Tr("auth");return i&&ds(t,`http://${i}`),t}Vo("Browser");globalThis.__apiCache||(globalThis.__apiCache={});const G={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0};class tn 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 Ko={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}=Ko.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 O=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 tn(n,g,_.message,y)}if(clearTimeout(O),g){if(g.ok){const C={...g,data:await g.json()};return c&&l&&(globalThis.__apiCache[l]={timestamp:Date.now(),res:C}),{...C,config:n}}const{status:_}=g;if(o<e&&(_===429||_>=500)){const C=g.headers.get("retry-after");return new Promise((ve,te)=>{setTimeout(()=>{I(n,e+1).then(ve).catch(te)},C&&parseInt(C,10)||5e3)})}}try{g.data=await g?.json()}catch{}throw new tn(n,g)},qo=(n,e)=>I({...e,endpoint:n}),Jo=(n,e,t)=>I({...t,method:"post",endpoint:n,body:e}),Yo=(n,e,t)=>I({...t,method:"put",endpoint:n,body:e}),Xo=(n,e,t)=>I({...t,method:"patch",endpoint:n,body:e}),Gn=(n,e)=>I({...e,method:"delete",endpoint:n});I.get=qo;I.post=Jo;I.put=Yo;I.patch=Xo;I.del=Gn;I.delete=Gn;let Te,Se;typeof window=="object"&&window?Se=Te=window:typeof process=="object"&&process.env?(Se=global,Te=process.env):Se=Te=typeof self=="object"&&self||{};const Qo="en_us",Zo="USD",ea="$",ta="US",na=1011,ra="5b1abe30a4d4531b8fe40725",ia=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 Te[n.toUpperCase()]},at={};["lang","currency","currency_symbol","country_code","store_id","store_object_id"].forEach(n=>{at[n]=ia("ecom_"+n)});const sa={get(n){const e=at[n];if(e!=null&&e!=="")return e;switch(n){case"lang":return Qo;case"currency":return Zo;case"currency_symbol":return ea;case"country_code":return ta;case"store_id":return na;case"store_object_id":return ra}return null},set(n,e){at[n]=e}},oa=n=>{if(n){if(n.display_name)return n.display_name;if(n.name&&n.name.given_name)return n.name.given_name}return""},aa=oa;Se.$ecomConfig;const ca=(n,e,t=localStorage)=>{let r;const i=t.getItem(n);if(i)try{r=JSON.parse(i)}catch{r=null,t.removeItem(n)}const s=Qn(r||e);return et(s,()=>{t.setItem(n,JSON.stringify(s))}),s};var la="firebase",ua="9.13.0";/**
1427
1427
  * @license
1428
1428
  * Copyright 2020 Google LLC
1429
1429
  *
@@ -1438,4 +1438,4 @@ import{y as or,z as ar,A as cr,d as lr,w as At,r as ze,c as ur,o as Ge,a as Ke,h
1438
1438
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1439
1439
  * See the License for the specific language governing permissions and
1440
1440
  * limitations under the License.
1441
- */q(Sa,ka,"app");_n(window.firebaseConfig);const er={customer:{display_name:"",main_email:""},auth:null},w=Ta(er),Ve="SESSION",an=localStorage.getItem(Ve);if(an)try{w.set(JSON.parse(an))}catch{localStorage.removeItem(Ve)}ba(w,()=>{localStorage.setItem(Ve,JSON.stringify(w.get()))});const wt=_e(w,({auth:n})=>n&&new Date(n.expires).getTime()-Date.now()>1e3*10),Et=_e(w,n=>n.customer),tr=_e(Et,n=>va(n)),nr=_e(Et,n=>n.main_email),Aa=n=>w.setKey("customer",{...Et.get(),main_email:n}),Z=Yn();if(Fs(Z,window.location.href)){const e=new URLSearchParams(window.location.search).get("email");e&&$s(Z,e,window.location.href).catch(console.error)}const Ra=_e(wt,n=>n||!!Z.currentUser),Oa=()=>{w.set(er),localStorage.removeItem(Ve),Z.signOut()},rr=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)}},Ca=async()=>(wt.get()||await rr(),w.get().auth.access_token),Da=async()=>{const n=await Ca(),{auth:e}=w.get(),{data:t}=await I.get(`customers/${e.customer_id}`,{accessToken:n});return w.setKey("customer",t),t};Ws(Z,async n=>{if(n){if(n.emailVerified){const e=n.email!==nr.get();(e||!wt.get())&&(await rr(),(e||!tr.get())&&await Da())}}else Oa()});const Na={class:"text-xl font-medium mb-5"},Pa=["onSubmit"],La={key:0,for:"login-form-email"},Ma=["placeholder"],Ua={class:"text-right lowercase"},xa={type:"submit"},Va=lr({__name:"LoginForm",emits:["login","logout"],setup(n,{emit:e}){At(Ye(Ra),c=>{e(c?"login":"logout")},{immediate:!0});const t=ze(!0),r=ze(!1);At(r,c=>{c&&(t.value=!0)});const i=ur({get(){return Ye(nr).value},set:Aa}),s=ze(""),o=async()=>{const c=Yn();window.localStorage.setItem("emailForSignIn",i.value);try{if(t.value){const l=new URL(window.location.toString());l.searchParams.append("email",i.value),await Bs(c,i.value,{url:l.toString(),handleCodeInApp:!0})}else await xs(c,i.value,s.value)}catch(l){console.warn(l.code),console.error(l)}},a=Ye(tr);return(c,l)=>(Ge(),Ke(pr,null,[Rt(c.$slots,"greetings",Ot(Ct({customerName:v(a)})),()=>[F("div",Na,ne(`${v(mr)} ${v(a)||v(gr)}`),1)]),F("form",{class:"login-form text-base",onSubmit:Je(o,["prevent"])},[t.value?(Ge(),Ke("label",La,ne(v(_r)),1)):Dt("",!0),qe(F("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":l[0]||(l[0]=d=>dr(i)?i.value=d:null),required:""},null,512),[[Nt,v(i)]]),t.value?Dt("",!0):qe((Ge(),Ke("input",{key:1,type:"password",class:"lowercase",placeholder:v(vr),"onUpdate:modelValue":l[1]||(l[1]=d=>s.value=d),required:""},null,8,Ma)),[[Nt,s.value]]),qe(F("small",Ua,[F("a",{href:"#",class:"text-muted",onClick:l[2]||(l[2]=Je(d=>t.value=!t.value,["prevent"]))},ne(t.value?v(Ir):v(yr)),1)],512),[[hr,!r.value]]),F("button",xa,[Rt(c.$slots,"button-content",Ot(Ct({isSignUp:r.value})),()=>[fr(ne(r.value?v(br):v(Pt)),1)])]),F("a",{href:"#",class:"block text-center",onClick:l[3]||(l[3]=Je(d=>r.value=!r.value,["prevent"]))},ne(r.value?v(Pt):v(wr)),1)],40,Pa)],64))}});export{Va as default};
1441
+ */q(la,ua,"app");hn(window.firebaseConfig);const Kn="SESSION",ct={customer:{display_name:"",main_email:""},auth:null},R=ca(Kn,ct),yt=de(()=>{const{auth:n}=R;return n&&new Date(n.expires).getTime()-Date.now()>1e3*10}),qn=de(()=>R.customer),lt=de(()=>aa(qn.value)),P=de({get(){return qn.value.main_email},set(n){R.customer.main_email=n}}),Z=zn();if(Rs(Z,window.location.href)){const e=new URLSearchParams(window.location.search).get("email");e&&Os(Z,e,window.location.href).catch(console.error)}const da=de(()=>yt.value||!!Z.currentUser),ha=()=>{R.auth=ct.auth,R.customer=ct.customer,localStorage.removeItem(Kn),Z.signOut()},Jn=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}`}});R.auth=await t.json()}catch(t){console.error(t)}},fa=async()=>(yt.value||await Jn(),R.auth.access_token),pa=async()=>{const n=await fa(),{data:e}=await I.get(`customers/${R.auth.customer_id}`,{accessToken:n});return R.customer=e,e};Ps(Z,async n=>{if(n){if(n.emailVerified){const e=n.email!==P.value;(e||!yt.value)&&(await Jn(),(e||!lt.value)&&await pa())}}else ha()});const ma={class:"text-xl font-medium mb-5"},ga=["onSubmit"],_a={key:0,for:"login-form-email"},va=["placeholder"],Ia={class:"text-right lowercase"},ya={type:"submit"},Sa=Zn({__name:"LoginForm",emits:["login","logout"],setup(n,{emit:e}){et(da,o=>{e(o?"login":"logout")},{immediate:!0});const t=je(!0),r=je(!1);et(r,o=>{o&&(t.value=!0)});const i=je(""),s=async()=>{const o=zn();window.localStorage.setItem("emailForSignIn",P.value);try{if(t.value){const a=new URL(window.location.toString());a.searchParams.append("email",P.value),await As(o,P.value,{url:a.toString(),handleCodeInApp:!0})}else await ks(o,P.value,i.value)}catch(a){console.warn(a.code),console.error(a)}};return(o,a)=>(Ve(),We(rr,null,[Tt(o.$slots,"greetings",St(kt({customerName:v(lt)})),()=>[$("div",ma,ne(`${v(ir)} ${v(lt)||v(sr)}`),1)]),$("form",{class:"login-form text-base",onSubmit:Ge(s,["prevent"])},[t.value?(Ve(),We("label",_a,ne(v(or)),1)):At("",!0),ze($("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":a[0]||(a[0]=c=>er(P)?P.value=c:null),required:""},null,512),[[Rt,v(P)]]),t.value?At("",!0):ze((Ve(),We("input",{key:1,type:"password",class:"lowercase",placeholder:v(ar),"onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),required:""},null,8,va)),[[Rt,i.value]]),ze($("small",Ia,[$("a",{href:"#",class:"text-muted",onClick:a[2]||(a[2]=Ge(c=>t.value=!t.value,["prevent"]))},ne(t.value?v(cr):v(lr)),1)],512),[[tr,!r.value]]),$("button",ya,[Tt(o.$slots,"button-content",St(kt({isSignUp:r.value})),()=>[nr(ne(r.value?v(ur):v(Ot)),1)])]),$("a",{href:"#",class:"block text-center",onClick:a[3]||(a[3]=Ge(c=>r.value=!r.value,["prevent"]))},ne(r.value?v(Ot):v(dr)),1)],40,ga)],64))}});export{Sa as default};