diff --git a/.env.example b/.env.example index 8c4e02317..aa06f85ec 100644 --- a/.env.example +++ b/.env.example @@ -99,6 +99,29 @@ LNBITS_THEME_OPTIONS="classic, bitcoin, flamingo, freedom, mint, autumn, monochr HOST=127.0.0.1 PORT=5000 +###################################### +####### Auth Configurations ########## +###################################### +# Secret Key: will default to the hash of the super user. It is strongly recommended that you set your own value. +AUTH_SECRET_KEY="" +AUTH_TOKEN_EXPIRE_MINUTES=525600 +# Possible authorization methods: user-id-only, username-password, google-auth, github-auth +AUTH_ALLOWED_METHODS="user-id-only, username-password" +# Set this flag if HTTP is used for OAuth +# OAUTHLIB_INSECURE_TRANSPORT="1" + +# Google OAuth Config +# Make sure thant the authorized redirect URIs contain https://{domain}/api/v1/auth/google/token +GOOGLE_CLIENT_ID="" +GOOGLE_CLIENT_SECRET="" + +# GitHub OAuth Config +# Make sure thant the authorization callback URL is set to https://{domain}/api/v1/auth/github/token +GITHUB_CLIENT_ID="" +GITHUB_CLIENT_SECRET="" + +###################################### + # uvicorn variable, uncomment to allow https behind a proxy # FORWARDED_ALLOW_IPS="*" diff --git a/flake.lock b/flake.lock index 117b101bd..951846da5 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701539137, - "narHash": "sha256-nVO/5QYpf1GwjvtpXhyxx5M3U/WN0MwBro4Lsk+9mL0=", + "lastModified": 1702233072, + "narHash": "sha256-H5G2wgbim2Ku6G6w+NSaQaauv6B6DlPhY9fMvArKqRo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "933d7dc155096e7575d207be6fb7792bc9f34f6d", + "rev": "781e2a9797ecf0f146e81425c822dca69fe4a348", "type": "github" }, "original": { @@ -66,11 +66,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1701861752, - "narHash": "sha256-QfrE05P66856b1SMan69NPhjc9e82VtLxBKg3yiQGW8=", + "lastModified": 1702334837, + "narHash": "sha256-QZG6+zFshyY+L8m2tlOTm75U5m9y7z01g0josVK+8Os=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "9fc487b32a68473da4bf9573f85b388043c5ecda", + "rev": "1f4bcbf1be73abc232a972a77102a3e820485a99", "type": "github" }, "original": { diff --git a/lnbits/app.py b/lnbits/app.py index 9cb41cd07..84d9084c0 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -15,10 +15,12 @@ from typing import Callable, List from fastapi import FastAPI, HTTPException, Request from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import RedirectResponse from fastapi.staticfiles import StaticFiles from loguru import logger from slowapi import Limiter from slowapi.util import get_remote_address +from starlette.middleware.sessions import SessionMiddleware from starlette.responses import JSONResponse from lnbits.core.crud import get_installed_extensions @@ -96,6 +98,9 @@ def create_app() -> FastAPI: CustomGZipMiddleware, minimum_size=1000, exclude_paths=["/api/v1/payments/sse"] ) + # required for SSO login + app.add_middleware(SessionMiddleware, secret_key=settings.auth_secret_key) + # order of these two middlewares is important app.add_middleware(InstalledExtensionMiddleware) app.add_middleware(ExtensionsRedirectMiddleware) @@ -515,6 +520,13 @@ def register_exception_handlers(app: FastAPI): and "accept" in request.headers and "text/html" in request.headers["accept"] ): + if exc.headers and "token-expired" in exc.headers: + response = RedirectResponse("/") + response.delete_cookie("cookie_access_token") + response.delete_cookie("is_lnbits_user_authorized") + response.set_cookie("is_access_token_expired", "true") + return response + return template_renderer().TemplateResponse( "error.html", { diff --git a/lnbits/core/__init__.py b/lnbits/core/__init__.py index 7724a97d8..40ae228a1 100644 --- a/lnbits/core/__init__.py +++ b/lnbits/core/__init__.py @@ -3,6 +3,7 @@ from fastapi import APIRouter from .db import core_app_extra, db from .views.admin_api import admin_router from .views.api import api_router +from .views.auth_api import auth_router # this compat is needed for usermanager extension from .views.generic import generic_router, update_user_extension @@ -26,3 +27,4 @@ def init_core_routers(app): app.include_router(admin_router) app.include_router(tinyurl_router) app.include_router(webpush_router) + app.include_router(auth_router) diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index 22cec6834..1e51bfd1f 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -5,6 +5,7 @@ from urllib.parse import urlparse from uuid import UUID, uuid4 import shortuuid +from passlib.context import CryptContext from lnbits.core.db import db from lnbits.core.models import WalletType @@ -20,11 +21,14 @@ from lnbits.settings import ( from .models import ( BalanceCheck, + CreateUser, Payment, PaymentFilters, PaymentHistoryPoint, TinyURL, + UpdateUserPassword, User, + UserConfig, Wallet, WebPushSubscription, ) @@ -33,8 +37,43 @@ from .models import ( # -------- +async def create_user( + data: CreateUser, user_config: Optional[UserConfig] = None +) -> User: + if not settings.new_accounts_allowed: + raise ValueError("Account creation is disabled.") + if await get_account_by_username(data.username): + raise ValueError("Username already exists.") + + if data.email and await get_account_by_email(data.email): + raise ValueError("Email already exists.") + + pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") + + user_id = uuid4().hex + await db.execute( + """ + INSERT INTO accounts (id, email, username, pass, extra) + VALUES (?, ?, ?, ?, ?) + """, + ( + user_id, + data.email, + data.username, + pwd_context.hash(data.password), + json.dumps(dict(user_config)) if user_config else "{}", + ), + ) + new_account = await get_account(user_id=user_id) + assert new_account, "Newly created account couldn't be retrieved" + return new_account + + async def create_account( - conn: Optional[Connection] = None, user_id: Optional[str] = None + conn: Optional[Connection] = None, + user_id: Optional[str] = None, + email: Optional[str] = None, + user_config: Optional[UserConfig] = None, ) -> User: if user_id: user_uuid4 = UUID(hex=user_id, version=4) @@ -42,7 +81,11 @@ async def create_account( else: user_id = uuid4().hex - await (conn or db).execute("INSERT INTO accounts (id) VALUES (?)", (user_id,)) + extra = json.dumps(dict(user_config)) if user_config else "{}" + await (conn or db).execute( + "INSERT INTO accounts (id, email, extra) VALUES (?, ?, ?)", + (user_id, email, extra), + ) new_account = await get_account(user_id=user_id, conn=conn) assert new_account, "Newly created account couldn't be retrieved" @@ -50,19 +93,132 @@ async def create_account( return new_account +async def update_account( + user_id: str, + username: Optional[str] = None, + email: Optional[str] = None, + user_config: Optional[UserConfig] = None, +) -> Optional[User]: + user = await get_account(user_id) + assert user, "User not found" + + if email: + assert not user.email or email == user.email, "Cannot change email." + account = await get_account_by_email(email) + assert not account or account.id == user_id, "Email already in use." + + if username: + assert not user.username or username == user.username, "Cannot change username." + account = await get_account_by_username(username) + assert not account or account.id == user_id, "Username already in exists." + + username = user.username or username + email = user.email or email + extra = user_config or user.config + + await db.execute( + """ + UPDATE accounts SET (username, email, extra) = (?, ?, ?) + WHERE id = ? + """, + (username, email, json.dumps(dict(extra)) if extra else "{}", user_id), + ) + + user = await get_user(user_id) + assert user, "Updated account couldn't be retrieved" + return user + + async def get_account( user_id: str, conn: Optional[Connection] = None ) -> Optional[User]: row = await (conn or db).fetchone( - "SELECT id, email, pass as password FROM accounts WHERE id = ?", (user_id,) + "SELECT id, email, username FROM accounts WHERE id = ?", + (user_id,), ) return User(**row) if row else None +async def get_user_password(user_id: str) -> Optional[str]: + row = await db.fetchone( + "SELECT pass FROM accounts WHERE id = ?", + (user_id,), + ) + if not row: + return None + + return row[0] + + +async def verify_user_password(user_id: str, password: str) -> bool: + existing_password = await get_user_password(user_id) + if not existing_password: + return False + + pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") + return pwd_context.verify(password, existing_password) + + +# todo: , conn: Optional[Connection] = None ?? +async def update_user_password(data: UpdateUserPassword) -> Optional[User]: + assert data.password == data.password_repeat, "Passwords do not match." + + # old accounts do not have a pasword + if await get_user_password(data.user_id): + assert data.password_old, "Missing old password" + old_pwd_ok = await verify_user_password(data.user_id, data.password_old) + assert old_pwd_ok, "Invalid credentials." + + pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") + + await db.execute( + "UPDATE accounts SET pass = ? WHERE id = ?", + ( + pwd_context.hash(data.password), + data.user_id, + ), + ) + + user = await get_user(data.user_id) + assert user, "Updated account couldn't be retrieved" + return user + + +async def get_account_by_username( + username: str, conn: Optional[Connection] = None +) -> Optional[User]: + row = await (conn or db).fetchone( + "SELECT id, username, email FROM accounts WHERE username = ?", + (username,), + ) + + return User(**row) if row else None + + +async def get_account_by_email( + email: str, conn: Optional[Connection] = None +) -> Optional[User]: + row = await (conn or db).fetchone( + "SELECT id, username, email FROM accounts WHERE email = ?", + (email,), + ) + + return User(**row) if row else None + + +async def get_account_by_username_or_email( + username_or_email: str, conn: Optional[Connection] = None +) -> Optional[User]: + user = await get_account_by_username(username_or_email, conn) + if not user: + user = await get_account_by_email(username_or_email, conn) + return user + + async def get_user(user_id: str, conn: Optional[Connection] = None) -> Optional[User]: user = await (conn or db).fetchone( - "SELECT id, email FROM accounts WHERE id = ?", (user_id,) + "SELECT id, email, username, pass, extra FROM accounts WHERE id = ?", (user_id,) ) if user: @@ -86,6 +242,7 @@ async def get_user(user_id: str, conn: Optional[Connection] = None) -> Optional[ return User( id=user["id"], email=user["email"], + username=user["username"], extensions=[ e[0] for e in extensions if User.is_extension_for_user(e[0], user["id"]) ], @@ -93,6 +250,8 @@ async def get_user(user_id: str, conn: Optional[Connection] = None) -> Optional[ admin=user["id"] == settings.super_user or user["id"] in settings.lnbits_admin_users, super_user=user["id"] == settings.super_user, + has_password=True if user["pass"] else False, + config=UserConfig(**json.loads(user["extra"])) if user["extra"] else None, ) diff --git a/lnbits/core/helpers.py b/lnbits/core/helpers.py index 68ad4f34a..741587d12 100644 --- a/lnbits/core/helpers.py +++ b/lnbits/core/helpers.py @@ -1,6 +1,6 @@ import importlib import re -from typing import Any +from typing import Any, Optional from uuid import UUID import httpx @@ -48,7 +48,9 @@ async def run_migration( await update_migration_version(conn, db_name, version) -async def stop_extension_background_work(ext_id: str, user: str): +async def stop_extension_background_work( + ext_id: str, user: str, access_token: Optional[str] = None +): """ Stop background work for extension (like asyncio.Tasks, WebSockets, etc). Extensions SHOULD expose a DELETE enpoint at the root level of their API. @@ -58,14 +60,13 @@ async def stop_extension_background_work(ext_id: str, user: str): async with httpx.AsyncClient() as client: try: url = f"http://{settings.host}:{settings.port}/{ext_id}/api/v1?usr={user}" - await client.delete(url) + headers = ( + {"Authorization": "Bearer " + access_token} if access_token else None + ) + resp = await client.delete(url=url, headers=headers) + resp.raise_for_status() except Exception as ex: logger.warning(ex) - try: - # try https - url = f"https://{settings.host}:{settings.port}/{ext_id}/api/v1?usr={user}" - except Exception as ex: - logger.warning(ex) def to_valid_user_id(user_id: str) -> UUID: diff --git a/lnbits/core/migrations.py b/lnbits/core/migrations.py index 9cc889133..4fad37087 100644 --- a/lnbits/core/migrations.py +++ b/lnbits/core/migrations.py @@ -393,3 +393,14 @@ async def m015_create_push_notification_subscriptions_table(db): ); """ ) + + +async def m016_add_username_column_to_accounts(db): + """ + Adds username column to accounts. + """ + try: + await db.execute("ALTER TABLE accounts ADD COLUMN username TEXT") + await db.execute("ALTER TABLE accounts ADD COLUMN extra TEXT") + except OperationalError: + pass diff --git a/lnbits/core/models.py b/lnbits/core/models.py index cb568214e..297dadfc2 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -79,14 +79,25 @@ class WalletTypeInfo: wallet: Wallet +class UserConfig(BaseModel): + email_verified: Optional[bool] = False + first_name: Optional[str] = None + last_name: Optional[str] = None + display_name: Optional[str] = None + picture: Optional[str] = None + provider: Optional[str] = "lnbits" # auth provider + + class User(BaseModel): id: str email: Optional[str] = None + username: Optional[str] = None extensions: List[str] = [] wallets: List[Wallet] = [] - password: Optional[str] = None admin: bool = False super_user: bool = False + has_password: bool = False + config: Optional[UserConfig] = None @property def wallet_ids(self) -> List[str]: @@ -107,6 +118,36 @@ class User(BaseModel): return False +class CreateUser(BaseModel): + email: Optional[str] = Query(default=None) + username: str = Query(default=..., min_length=2, max_length=20) + password: str = Query(default=..., min_length=8, max_length=50) + password_repeat: str = Query(default=..., min_length=8, max_length=50) + + +class UpdateUser(BaseModel): + user_id: str + email: Optional[str] = Query(default=None) + username: Optional[str] = Query(default=..., min_length=2, max_length=20) + config: Optional[UserConfig] = None + + +class UpdateUserPassword(BaseModel): + user_id: str + password: str = Query(default=..., min_length=8, max_length=50) + password_repeat: str = Query(default=..., min_length=8, max_length=50) + password_old: Optional[str] = Query(default=None, min_length=8, max_length=50) + + +class LoginUsr(BaseModel): + usr: str + + +class LoginUsernamePassword(BaseModel): + username: str + password: str + + class Payment(FromRowModel): checking_id: str pending: bool diff --git a/lnbits/core/tasks.py b/lnbits/core/tasks.py index 85aa60087..166580f9a 100644 --- a/lnbits/core/tasks.py +++ b/lnbits/core/tasks.py @@ -188,6 +188,8 @@ async def send_payment_push_notification(payment: Payment): body += f"\r\n{payment.memo}" for subscription in subscriptions: + # todo: review permissions when user-id-only not allowed + # todo: replace all this logic with websockets? url = ( f"https://{subscription.host}/wallet?usr={wallet.user}&wal={wallet.id}" ) diff --git a/lnbits/core/templates/core/account.html b/lnbits/core/templates/core/account.html new file mode 100644 index 000000000..3a1e62860 --- /dev/null +++ b/lnbits/core/templates/core/account.html @@ -0,0 +1,235 @@ +{% extends "base.html" %} + +{% from "macros.jinja" import window_vars with context %} + +{% block scripts %} {{ window_vars(user) }} + +{% endblock %} {% block page %} +
+
+ + +
+
+

Password Settings

+
+
+ +
+
+
+ + + + + + + + + Update Password + + +
+ + +
+
+

Account Settings

+
+
+ +
+
+
+ + + + + + + + + +
+
+
Check email using:
+ {% if "google-auth" in LNBITS_AUTH_METHODS %} +
+ + + + +
Google
+
+
+ {%endif%} {% if "github-auth" in LNBITS_AUTH_METHODS %} +
+ + + + +
GitHub
+
+
+ {%endif%} +
+
+ + + + + + + + + + + + + + + + Update Account + + +
+
+
+ + +

Account

+
+
+
+
+{% endblock %} diff --git a/lnbits/core/templates/core/extensions.html b/lnbits/core/templates/core/extensions.html index 54618ec08..256b05c70 100644 --- a/lnbits/core/templates/core/extensions.html +++ b/lnbits/core/templates/core/extensions.html @@ -185,7 +185,7 @@ flat color="primary" type="a" - :href="[extension.id, '/?usr=', g.user.id].join('')" + :href="extension.id" >{%raw%}{{ $t('open') }}{%endraw%} {%raw%}{{ $t('disable') }}{%endraw%} @@ -209,7 +209,7 @@ type="a" :href="['{{ url_for('install.extensions') - }}', '?usr=', g.user.id, '&enable=', extension.id].join('')" + }}', '?enable=', extension.id].join('')" > {%raw%}{{ $t('enable') }}{%endraw%} @@ -511,7 +511,7 @@ LNbits.api .request( 'POST', - `/api/v1/extension?usr=${this.g.user.id}`, + `/api/v1/extension`, this.g.user.wallets[0].adminkey, { ext_id: extension.id, @@ -542,7 +542,7 @@ LNbits.api .request( 'DELETE', - `/api/v1/extension/${extension.id}?usr=${this.g.user.id}`, + `/api/v1/extension/${extension.id}`, this.g.user.wallets[0].adminkey ) .then(response => { @@ -576,7 +576,7 @@ LNbits.api .request( 'DELETE', - `/api/v1/extension/${extension.id}/db?usr=${this.g.user.id}`, + `/api/v1/extension/${extension.id}/db`, this.g.user.wallets[0].adminkey ) .then(response => { @@ -598,9 +598,8 @@ LNbits.api .request( 'GET', - "{{ url_for('install.extensions') }}?usr=" + - this.g.user.id + - '&' + + "{{ url_for('install.extensions') }}" + + '?' + action + '=' + extension.id @@ -629,7 +628,7 @@ try { const {data} = await LNbits.api.request( 'GET', - `/api/v1/extension/${extension.id}/releases?usr=${this.g.user.id}`, + `/api/v1/extension/${extension.id}/releases`, this.g.user.wallets[0].adminkey ) @@ -694,7 +693,7 @@ try { const {data} = await LNbits.api.request( 'GET', - `/api/v1/extension/release/${org}/${repo}/${release.version}?usr=${this.g.user.id}`, + `/api/v1/extension/release/${org}/${repo}/${release.version}`, this.g.user.wallets[0].adminkey ) release.loaded = true diff --git a/lnbits/core/templates/core/index.html b/lnbits/core/templates/core/index.html index 242164bed..85d1c40bb 100644 --- a/lnbits/core/templates/core/index.html +++ b/lnbits/core/templates/core/index.html @@ -2,77 +2,309 @@ {% endblock %} {% block page %}
-
- {% if lnurl or LNBITS_NEW_ACCOUNTS_ALLOWED %} - - - {% if lnurl %} - - {% elif LNBITS_NEW_ACCOUNTS_ALLOWED %} - - - - - {% endif %} - - - {% endif %} +
+
+
+

{{SITE_TITLE}}

+
{{SITE_TAGLINE}}
+
+ {% if lnurl and LNBITS_NEW_ACCOUNTS_ALLOWED and ("user-id-only" in + LNBITS_AUTH_METHODS)%} +
+
+ + + + + +
+
+ {%else%} {% endif %} - - -

{{SITE_TITLE}}

-
{{SITE_TAGLINE}}
-
-

-
- - +
+
+ +
+
-
-
-
-
- - + + + {% if "user-id-only" in LNBITS_AUTH_METHODS %} + +
+ +
+ + + + {% if LNBITS_NEW_ACCOUNTS_ALLOWED %} + + + + + + + {%endif%} +
+
+ + +

+ + +
+ +
+
+
+ {%endif%} {% if "username-password" in LNBITS_AUTH_METHODS %} + +
+ + + +
+ + + +
+ +
+
+
+ +

+ + + + +
+ +
+
+
+ {%endif%} {% if LNBITS_NEW_ACCOUNTS_ALLOWED %} + +
+ + +
+ +
+
+
+
+ {% if "username-password" in LNBITS_AUTH_METHODS %} + +
+ +
+
+ {%endif%} + + {% endif %} + + +
+ {% if "google-auth" in LNBITS_AUTH_METHODS %} +
+ + + + +
+ +
+
+
+ {%endif%} {% if "github-auth" in LNBITS_AUTH_METHODS %} +
+ + + + +
+
+
+ {%endif%} +
+
+ +
+
+ + +
+
+
+
+
+
+
+ + +
- +
- +
- +
- +
- +
- + - + #{{ props.row.tag }} @@ -355,7 +352,8 @@

diff --git a/lnbits/core/templates/node/index.html b/lnbits/core/templates/node/index.html index 3d1f4d7e1..5ae501cfa 100644 --- a/lnbits/core/templates/node/index.html +++ b/lnbits/core/templates/node/index.html @@ -249,7 +249,6 @@ }, api: function (method, url, options) { const params = new URLSearchParams(options?.query) - params.set('usr', this.g.user.id) return LNbits.api .request(method, `/node/api/v1${url}?${params}`, {}, options?.data) .catch(error => { diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 8382b7c3a..c82f46ed2 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -48,6 +48,7 @@ from lnbits.core.models import ( from lnbits.db import Filters, Page from lnbits.decorators import ( WalletTypeInfo, + check_access_token, check_admin, get_key_type, parse_filters, @@ -780,7 +781,9 @@ async def websocket_update_get(item_id: str, data: str): @api_router.post("/api/v1/extension") async def api_install_extension( - data: CreateExtension, user: User = Depends(check_admin) + data: CreateExtension, + user: User = Depends(check_admin), + access_token: Optional[str] = Depends(check_access_token), ): release = await InstallableExtension.get_extension_release( data.ext_id, data.source_repo, data.archive @@ -812,7 +815,7 @@ async def api_install_extension( await add_installed_extension(ext_info) # call stop while the old routes are still active - await stop_extension_background_work(data.ext_id, user.id) + await stop_extension_background_work(data.ext_id, user.id, access_token) if data.ext_id not in settings.lnbits_deactivated_extensions: settings.lnbits_deactivated_extensions += [data.ext_id] @@ -838,7 +841,11 @@ async def api_install_extension( @api_router.delete("/api/v1/extension/{ext_id}") -async def api_uninstall_extension(ext_id: str, user: User = Depends(check_admin)): +async def api_uninstall_extension( + ext_id: str, + user: User = Depends(check_admin), + access_token: Optional[str] = Depends(check_access_token), +): installable_extensions = await InstallableExtension.get_installable_extensions() extensions = [e for e in installable_extensions if e.id == ext_id] @@ -864,7 +871,7 @@ async def api_uninstall_extension(ext_id: str, user: User = Depends(check_admin) try: # call stop while the old routes are still active - await stop_extension_background_work(ext_id, user.id) + await stop_extension_background_work(ext_id, user.id, access_token) if ext_id not in settings.lnbits_deactivated_extensions: settings.lnbits_deactivated_extensions += [ext_id] diff --git a/lnbits/core/views/auth_api.py b/lnbits/core/views/auth_api.py new file mode 100644 index 000000000..6b102321d --- /dev/null +++ b/lnbits/core/views/auth_api.py @@ -0,0 +1,348 @@ +from typing import Optional + +from fastapi import APIRouter, Depends, HTTPException, Request, status +from fastapi.responses import JSONResponse, RedirectResponse +from fastapi_sso.sso.base import OpenID +from fastapi_sso.sso.github import GithubSSO +from fastapi_sso.sso.google import GoogleSSO +from loguru import logger +from starlette.status import ( + HTTP_400_BAD_REQUEST, + HTTP_401_UNAUTHORIZED, + HTTP_403_FORBIDDEN, + HTTP_500_INTERNAL_SERVER_ERROR, +) + +from lnbits.decorators import check_user_exists +from lnbits.helpers import ( + create_access_token, + is_valid_email_address, + is_valid_username, +) +from lnbits.settings import AuthMethods, settings + +# todo: move this class to a `crypto.py` file +from lnbits.wallets.macaroon.macaroon import AESCipher + +from ..crud import ( + create_account, + create_user, + get_account, + get_account_by_email, + get_account_by_username_or_email, + get_user, + update_account, + update_user_password, + verify_user_password, +) +from ..models import ( + CreateUser, + LoginUsernamePassword, + LoginUsr, + UpdateUser, + UpdateUserPassword, + User, + UserConfig, +) + +auth_router = APIRouter() + + +def _init_google_sso() -> Optional[GoogleSSO]: + if not settings.is_auth_method_allowed(AuthMethods.google_auth): + return None + if not settings.is_google_auth_configured: + logger.warning("Google Auth allowed but not configured.") + return None + return GoogleSSO( + settings.google_client_id, + settings.google_client_secret, + None, + allow_insecure_http=True, + ) + + +def _init_github_sso() -> Optional[GithubSSO]: + if not settings.is_auth_method_allowed(AuthMethods.github_auth): + return None + if not settings.is_github_auth_configured: + logger.warning("Github Auth allowed but not configured.") + return None + return GithubSSO( + settings.github_client_id, + settings.github_client_secret, + None, + allow_insecure_http=True, + ) + + +google_sso = _init_google_sso() +github_sso = _init_github_sso() + + +@auth_router.get("/api/v1/auth", description="Get the authenticated user") +async def get_auth_user(user: User = Depends(check_user_exists)) -> User: + return user + + +@auth_router.post("/api/v1/auth", description="Login via the username and password") +async def login(data: LoginUsernamePassword) -> JSONResponse: + if not settings.is_auth_method_allowed(AuthMethods.username_and_password): + raise HTTPException( + HTTP_401_UNAUTHORIZED, "Login by 'Username and Password' not allowed." + ) + + try: + user = await get_account_by_username_or_email(data.username) + + if not user: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Invalid credentials.") + if not await verify_user_password(user.id, data.password): + raise HTTPException(HTTP_401_UNAUTHORIZED, "Invalid credentials.") + + return _auth_success_response(user.username, user.id) + except HTTPException as e: + raise e + except Exception as e: + logger.debug(e) + raise HTTPException(HTTP_500_INTERNAL_SERVER_ERROR, "Cannot login.") + + +@auth_router.post("/api/v1/auth/usr", description="Login via the User ID") +async def login_usr(data: LoginUsr) -> JSONResponse: + if not settings.is_auth_method_allowed(AuthMethods.user_id_only): + raise HTTPException(HTTP_401_UNAUTHORIZED, "Login by 'User ID' not allowed.") + + try: + user = await get_user(data.usr) + if not user: + raise HTTPException(HTTP_401_UNAUTHORIZED, "User ID does not exist.") + + return _auth_success_response(user.username or "", user.id) + except HTTPException as e: + raise e + except Exception as e: + logger.debug(e) + raise HTTPException(HTTP_500_INTERNAL_SERVER_ERROR, "Cannot login.") + + +@auth_router.get("/api/v1/auth/google", description="Google SSO") +async def login_with_google(request: Request, user_id: Optional[str] = None): + if not google_sso: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Login by 'Google' not allowed.") + + google_sso.redirect_uri = str(request.base_url) + "api/v1/auth/google/token" + with google_sso: + state = _encrypt_message(user_id) + return await google_sso.get_login_redirect(state=state) + + +@auth_router.get("/api/v1/auth/github", description="Github SSO") +async def login_with_github(request: Request, user_id: Optional[str] = None): + if not github_sso: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Login by 'GitHub' not allowed.") + + github_sso.redirect_uri = str(request.base_url) + "api/v1/auth/github/token" + with github_sso: + state = _encrypt_message(user_id) + return await github_sso.get_login_redirect(state=state) + + +@auth_router.get( + "/api/v1/auth/google/token", description="Handle Google OAuth callback" +) +async def handle_google_token(request: Request) -> RedirectResponse: + if not google_sso: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Login by 'Google' not allowed.") + + try: + with google_sso: + userinfo = await google_sso.verify_and_process(request) + assert userinfo is not None + user_id = _decrypt_message(google_sso.state) + request.session.pop("user", None) + return await _handle_sso_login(userinfo, user_id) + except HTTPException as e: + raise e + except ValueError as e: + raise HTTPException(HTTP_403_FORBIDDEN, str(e)) + except Exception as e: + logger.debug(e) + raise HTTPException( + HTTP_500_INTERNAL_SERVER_ERROR, "Cannot authenticate user with Google Auth." + ) + + +@auth_router.get( + "/api/v1/auth/github/token", description="Handle Github OAuth callback" +) +async def handle_github_token(request: Request) -> RedirectResponse: + if not github_sso: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Login by 'GitHub' not allowed.") + + try: + with github_sso: + userinfo = await github_sso.verify_and_process(request) + assert userinfo is not None + user_id = _decrypt_message(github_sso.state) + request.session.pop("user", None) + return await _handle_sso_login(userinfo, user_id) + + except HTTPException as e: + raise e + except ValueError as e: + raise HTTPException(HTTP_403_FORBIDDEN, str(e)) + except Exception as e: + logger.debug(e) + raise HTTPException( + HTTP_500_INTERNAL_SERVER_ERROR, "Cannot authenticate user with GitHub Auth." + ) + + +@auth_router.post("/api/v1/auth/logout") +async def logout() -> JSONResponse: + response = JSONResponse({"status": "success"}, status_code=status.HTTP_200_OK) + response.delete_cookie("cookie_access_token") + response.delete_cookie("is_lnbits_user_authorized") + response.delete_cookie("is_access_token_expired") + return response + + +@auth_router.post("/api/v1/auth/register") +async def register(data: CreateUser) -> JSONResponse: + if not settings.is_auth_method_allowed(AuthMethods.username_and_password): + raise HTTPException( + HTTP_401_UNAUTHORIZED, "Register by 'Username and Password' not allowed." + ) + + if data.password != data.password_repeat: + raise HTTPException(HTTP_400_BAD_REQUEST, "Passwords do not match.") + + if not data.username: + raise HTTPException(HTTP_400_BAD_REQUEST, "Missing username.") + if not is_valid_username(data.username): + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid username.") + + if data.email and not is_valid_email_address(data.email): + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid email.") + + try: + user = await create_user(data) + return _auth_success_response(user.username) + + except ValueError as e: + raise HTTPException(HTTP_403_FORBIDDEN, str(e)) + except Exception as e: + logger.debug(e) + raise HTTPException(HTTP_500_INTERNAL_SERVER_ERROR, "Cannot create user.") + + +@auth_router.put("/api/v1/auth/password") +async def update_password( + data: UpdateUserPassword, user: User = Depends(check_user_exists) +) -> Optional[User]: + if not settings.is_auth_method_allowed(AuthMethods.username_and_password): + raise HTTPException( + HTTP_401_UNAUTHORIZED, "Auth by 'Username and Password' not allowed." + ) + if data.user_id != user.id: + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid user ID.") + + try: + return await update_user_password(data) + except AssertionError as e: + raise HTTPException(HTTP_403_FORBIDDEN, str(e)) + except Exception as e: + logger.debug(e) + raise HTTPException( + HTTP_500_INTERNAL_SERVER_ERROR, "Cannot update user password." + ) + + +@auth_router.put("/api/v1/auth/update") +async def update( + data: UpdateUser, user: User = Depends(check_user_exists) +) -> Optional[User]: + if data.user_id != user.id: + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid user ID.") + if data.username and not is_valid_username(data.username): + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid username.") + if data.email != user.email: + raise HTTPException(HTTP_400_BAD_REQUEST, "Email mismatch.") + + try: + return await update_account(user.id, data.username, None, data.config) + except AssertionError as e: + raise HTTPException(HTTP_403_FORBIDDEN, str(e)) + except Exception as e: + logger.debug(e) + raise HTTPException(HTTP_500_INTERNAL_SERVER_ERROR, "Cannot update user.") + + +async def _handle_sso_login(userinfo: OpenID, verified_user_id: Optional[str] = None): + email = userinfo.email + if not email or not is_valid_email_address(email): + raise HTTPException(HTTP_400_BAD_REQUEST, "Invalid email.") + + redirect_path = "/wallet" + user_config = UserConfig(**dict(userinfo)) + user_config.email_verified = True + + account = await get_account_by_email(email) + + if verified_user_id: + if account: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Email already used.") + account = await get_account(verified_user_id) + if not account: + raise HTTPException(HTTP_401_UNAUTHORIZED, "Cannot verify user email.") + redirect_path = "/account" + + if account: + user = await update_account(account.id, email=email, user_config=user_config) + else: + if not settings.new_accounts_allowed: + raise HTTPException(HTTP_400_BAD_REQUEST, "Account creation is disabled.") + user = await create_account(email=email, user_config=user_config) + + if not user: + raise HTTPException(HTTP_401_UNAUTHORIZED, "User not found.") + + return _auth_redirect_response(redirect_path, email) + + +def _auth_success_response( + username: Optional[str] = None, + user_id: Optional[str] = None, + email: Optional[str] = None, +) -> JSONResponse: + access_token = create_access_token( + data={"sub": username or "", "usr": user_id, "email": email} + ) + response = JSONResponse({"access_token": access_token, "token_type": "bearer"}) + response.set_cookie("cookie_access_token", access_token, httponly=True) + response.set_cookie("is_lnbits_user_authorized", "true") + response.delete_cookie("is_access_token_expired") + + return response + + +def _auth_redirect_response(path: str, email: str) -> RedirectResponse: + access_token = create_access_token(data={"sub": "" or "", "email": email}) + response = RedirectResponse(path) + response.set_cookie("cookie_access_token", access_token, httponly=True) + response.set_cookie("is_lnbits_user_authorized", "true") + response.delete_cookie("is_access_token_expired") + return response + + +def _encrypt_message(m: Optional[str] = None) -> Optional[str]: + if not m: + return None + return AESCipher(key=settings.auth_secret_key).encrypt(m.encode()) + + +def _decrypt_message(m: Optional[str] = None) -> Optional[str]: + if not m: + return None + return AESCipher(key=settings.auth_secret_key).decrypt(m) diff --git a/lnbits/core/views/generic.py b/lnbits/core/views/generic.py index d51e11674..802b5d0c3 100644 --- a/lnbits/core/views/generic.py +++ b/lnbits/core/views/generic.py @@ -165,54 +165,30 @@ async def extensions_install( ) async def wallet( request: Request, - usr: UUID4 = Query(...), + user: User = Depends(check_user_exists), wal: Optional[UUID4] = Query(None), ): - user_id = usr.hex - user = await get_user(user_id) - - if not user: - return template_renderer().TemplateResponse( - "error.html", {"request": request, "err": "User does not exist."} - ) - - if not wal: - if len(user.wallets) == 0: - wallet = await create_wallet(user_id=user.id) - return RedirectResponse(url=f"/wallet?usr={user_id}&wal={wallet.id}") - return RedirectResponse(url=f"/wallet?usr={user_id}&wal={user.wallets[0].id}") - else: + if wal: wallet_id = wal.hex + elif len(user.wallets) == 0: + wallet = await create_wallet(user_id=user.id) + user = await get_user(user_id=user.id) or user + wallet_id = wallet.id + else: + wallet_id = user.wallets[0].id - userwallet = user.get_wallet(wallet_id) - if not userwallet or userwallet.deleted: + user_wallet = user.get_wallet(wallet_id) + if not user_wallet or user_wallet.deleted: return template_renderer().TemplateResponse( "error.html", {"request": request, "err": "Wallet not found"} ) - if ( - len(settings.lnbits_allowed_users) > 0 - and user_id not in settings.lnbits_allowed_users - and user_id not in settings.lnbits_admin_users - and user_id != settings.super_user - ): - return template_renderer().TemplateResponse( - "error.html", {"request": request, "err": "User not authorized."} - ) - - if user_id == settings.super_user or user_id in settings.lnbits_admin_users: - user.admin = True - if user_id == settings.super_user: - user.super_user = True - - logger.debug(f"Access user {user.id} wallet {userwallet.name}") - return template_renderer().TemplateResponse( "core/wallet.html", { "request": request, "user": user.dict(), - "wallet": userwallet.dict(), + "wallet": user_wallet.dict(), "service_fee": settings.lnbits_service_fee, "service_fee_max": settings.lnbits_service_fee_max, "web_manifest": f"/manifest/{user.id}.webmanifest", @@ -220,6 +196,24 @@ async def wallet( ) +@generic_router.get( + "/account", + response_class=HTMLResponse, + description="show account page", +) +async def account( + request: Request, + user: User = Depends(check_user_exists), +): + return template_renderer().TemplateResponse( + "core/account.html", + { + "request": request, + "user": user.dict(), + }, + ) + + @generic_router.get("/withdraw", response_class=JSONResponse) async def lnurl_full_withdraw(request: Request): usr_param = request.query_params.get("usr") diff --git a/lnbits/decorators.py b/lnbits/decorators.py index d58ae8324..51c573a53 100644 --- a/lnbits/decorators.py +++ b/lnbits/decorators.py @@ -1,18 +1,27 @@ from http import HTTPStatus -from typing import Literal, Optional, Type +from typing import Annotated, Literal, Optional, Type, Union -from fastapi import Query, Request, Security +from fastapi import Cookie, Depends, Query, Request, Security from fastapi.exceptions import HTTPException from fastapi.openapi.models import APIKey, APIKeyIn -from fastapi.security import APIKeyHeader, APIKeyQuery +from fastapi.security import APIKeyHeader, APIKeyQuery, OAuth2PasswordBearer from fastapi.security.base import SecurityBase +from jose import ExpiredSignatureError, JWTError, jwt +from loguru import logger from pydantic.types import UUID4 -from lnbits.core.crud import get_user, get_wallet_for_key +from lnbits.core.crud import ( + get_account, + get_account_by_email, + get_account_by_username, + get_user, + get_wallet_for_key, +) from lnbits.core.models import User, WalletType, WalletTypeInfo from lnbits.db import Filter, Filters, TFilterModel -from lnbits.requestvars import g -from lnbits.settings import settings +from lnbits.settings import AuthMethods, settings + +oauth2_scheme = OAuth2PasswordBearer(tokenUrl="api/v1/auth", auto_error=False) # TODO: fix type ignores @@ -220,44 +229,50 @@ async def require_invoice_key( return wallet -async def check_user_exists(usr: UUID4) -> User: - g().user = await get_user(usr.hex) - - if not g().user: - raise HTTPException( - status_code=HTTPStatus.NOT_FOUND, detail="User does not exist." - ) - - if ( - len(settings.lnbits_allowed_users) > 0 - and g().user.id not in settings.lnbits_allowed_users - and g().user.id not in settings.lnbits_admin_users - and g().user.id != settings.super_user - ): - raise HTTPException( - status_code=HTTPStatus.UNAUTHORIZED, detail="User not authorized." - ) - - return g().user +async def check_access_token( + header_access_token: Annotated[Union[str, None], Depends(oauth2_scheme)], + cookie_access_token: Annotated[Union[str, None], Cookie()] = None, +) -> Optional[str]: + return header_access_token or cookie_access_token -async def check_admin(usr: UUID4) -> User: - user = await check_user_exists(usr) +async def check_user_exists( + r: Request, + access_token: Annotated[Optional[str], Depends(check_access_token)], + usr: Optional[UUID4] = None, +) -> User: + if access_token: + account = await _get_account_from_token(access_token) + elif usr and settings.is_auth_method_allowed(AuthMethods.user_id_only): + account = await get_account(usr.hex) + else: + raise HTTPException(HTTPStatus.UNAUTHORIZED, "Missing user ID or access token.") + + if not account or not settings.is_user_allowed(account.id): + raise HTTPException(HTTPStatus.UNAUTHORIZED, "User not allowed.") + + user = await get_user(account.id) + assert user, "User not found for account." + + if not user.admin and r["path"].split("/")[1] in settings.lnbits_admin_extensions: + raise HTTPException(HTTPStatus.FORBIDDEN, "User not authorized for extension.") + + return user + + +async def check_admin(user: Annotated[User, Depends(check_user_exists)]) -> User: if user.id != settings.super_user and user.id not in settings.lnbits_admin_users: raise HTTPException( - status_code=HTTPStatus.UNAUTHORIZED, - detail="User not authorized. No admin privileges.", + HTTPStatus.UNAUTHORIZED, "User not authorized. No admin privileges." ) return user -async def check_super_user(usr: UUID4) -> User: - user = await check_admin(usr) +async def check_super_user(user: Annotated[User, Depends(check_user_exists)]) -> User: if user.id != settings.super_user: raise HTTPException( - status_code=HTTPStatus.UNAUTHORIZED, - detail="User not authorized. No super user privileges.", + HTTPStatus.UNAUTHORIZED, "User not authorized. No super user privileges." ) return user @@ -295,3 +310,23 @@ def parse_filters(model: Type[TFilterModel]): ) return dependency + + +async def _get_account_from_token(access_token): + try: + payload = jwt.decode(access_token, settings.auth_secret_key, "HS256") + if "sub" in payload and payload.get("sub"): + return await get_account_by_username(str(payload.get("sub"))) + if "usr" in payload and payload.get("usr"): + return await get_account(str(payload.get("usr"))) + if "email" in payload and payload.get("email"): + return await get_account_by_email(str(payload.get("email"))) + + raise HTTPException(HTTPStatus.UNAUTHORIZED, "Data missing for access token.") + except ExpiredSignatureError: + raise HTTPException( + HTTPStatus.UNAUTHORIZED, "Session expired.", {"token-expired": "true"} + ) + except JWTError as e: + logger.debug(e) + raise HTTPException(HTTPStatus.UNAUTHORIZED, "Invalid access token.") diff --git a/lnbits/helpers.py b/lnbits/helpers.py index 0555b4018..d783df578 100644 --- a/lnbits/helpers.py +++ b/lnbits/helpers.py @@ -1,9 +1,12 @@ import json +import re +from datetime import datetime, timedelta from pathlib import Path from typing import Any, List, Optional, Type import jinja2 import shortuuid +from jose import jwt from pydantic import BaseModel from pydantic.schema import field_schema @@ -58,6 +61,7 @@ def template_renderer(additional_folders: Optional[List] = None) -> Jinja2Templa t.env.globals["LNBITS_QR_LOGO"] = settings.lnbits_qr_logo t.env.globals["LNBITS_VERSION"] = settings.version t.env.globals["LNBITS_NEW_ACCOUNTS_ALLOWED"] = settings.new_accounts_allowed + t.env.globals["LNBITS_AUTH_METHODS"] = settings.auth_allowed_methods t.env.globals["LNBITS_ADMIN_UI"] = settings.lnbits_admin_ui t.env.globals["LNBITS_SERVICE_FEE"] = settings.lnbits_service_fee t.env.globals["LNBITS_SERVICE_FEE_MAX"] = settings.lnbits_service_fee_max @@ -166,3 +170,20 @@ def update_query(table_name: str, model: BaseModel, where: str = "WHERE id = ?") """ query = ", ".join([f"{field} = ?" for field in model.dict().keys()]) return f"UPDATE {table_name} SET {query} {where}" + + +def is_valid_email_address(email: str) -> bool: + email_regex = r"[A-Za-z0-9\._%+-]+@[A-Za-z0-9\.-]+\.[A-Za-z]{2,63}" + return re.fullmatch(email_regex, email) is not None + + +def is_valid_username(username: str) -> bool: + username_regex = r"(?=[a-zA-Z0-9._]{2,20}$)(?!.*[_.]{2})[^_.].*[^_.]" + return re.fullmatch(username_regex, username) is not None + + +def create_access_token(data: dict): + expire = datetime.utcnow() + timedelta(minutes=settings.auth_token_expire_minutes) + to_encode = data.copy() + to_encode.update({"exp": expire}) + return jwt.encode(to_encode, settings.auth_secret_key, "HS256") diff --git a/lnbits/middleware.py b/lnbits/middleware.py index 0f7d84d28..ad5e17045 100644 --- a/lnbits/middleware.py +++ b/lnbits/middleware.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, List, Tuple, Union -from urllib.parse import parse_qs from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse, JSONResponse @@ -41,13 +40,6 @@ class InstalledExtensionMiddleware: await response(scope, receive, send) return - if not self._user_allowed_to_extension(top_path, scope): - response = self._response_by_accepted_type( - headers, "User not authorized.", HTTPStatus.FORBIDDEN - ) - await response(scope, receive, send) - return - # static resources do not require redirect if rest[0:1] == ["static"]: await self.app(scope, receive, send) @@ -68,23 +60,6 @@ class InstalledExtensionMiddleware: await self.app(scope, receive, send) - def _user_allowed_to_extension(self, ext_name: str, scope) -> bool: - if ext_name not in settings.lnbits_admin_extensions: - return True - if "query_string" not in scope: - return True - - # parse the URL query string into a `dict` - q = parse_qs(scope["query_string"].decode("UTF-8")) - user = q.get("usr", [""])[0] - if not user: - return True - - if user == settings.super_user or user in settings.lnbits_admin_users: - return True - - return False - def _response_by_accepted_type( self, headers: List[Any], msg: str, status_code: HTTPStatus ) -> Union[HTMLResponse, JSONResponse]: diff --git a/lnbits/settings.py b/lnbits/settings.py index 42f462ba4..c38ff4f36 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -4,6 +4,8 @@ import importlib import importlib.metadata import inspect import json +from enum import Enum +from hashlib import sha256 from os import path from sqlite3 import Row from time import time @@ -308,6 +310,45 @@ class EnvSettings(LNbitsSettings): return self.lnbits_extensions_path == "lnbits" +class AuthMethods(Enum): + user_id_only = "user-id-only" + username_and_password = "username-password" + google_auth = "google-auth" + github_auth = "github-auth" + + +class AuthSettings(LNbitsSettings): + auth_secret_key: str = Field(default="") + auth_token_expire_minutes: int = Field(default=30) + auth_allowed_methods: List[str] = Field( + default=[ + AuthMethods.user_id_only.value, + AuthMethods.username_and_password.value, + ] + ) + + def is_auth_method_allowed(self, method: AuthMethods): + return method.value in self.auth_allowed_methods + + +class GoogleAuthSettings(LNbitsSettings): + google_client_id: str = Field(default="") + google_client_secret: str = Field(default="") + + @property + def is_google_auth_configured(self): + return self.google_client_id != "" and self.google_client_secret != "" + + +class GitHubAuthSettings(LNbitsSettings): + github_client_id: str = Field(default="") + github_client_secret: str = Field(default="") + + @property + def is_github_auth_configured(self): + return self.github_client_id != "" and self.github_client_secret != "" + + class SaaSSettings(LNbitsSettings): lnbits_saas_callback: Optional[str] = Field(default=None) lnbits_saas_secret: Optional[str] = Field(default=None) @@ -356,6 +397,9 @@ class ReadOnlySettings( SaaSSettings, PersistenceSettings, SuperUserSettings, + AuthSettings, + GoogleAuthSettings, + GitHubAuthSettings, ): lnbits_admin_ui: bool = Field(default=False) @@ -384,6 +428,14 @@ class Settings(EditableSettings, ReadOnlySettings, TransientSettings, BaseSettin case_sensitive = False json_loads = list_parse_fallback + def is_user_allowed(self, user_id: str): + return ( + len(self.lnbits_allowed_users) == 0 + or user_id in self.lnbits_allowed_users + or user_id in self.lnbits_admin_users + or user_id == self.super_user + ) + class SuperSettings(EditableSettings): super_user: str @@ -432,6 +484,9 @@ settings = Settings() settings.lnbits_path = str(path.dirname(path.realpath(__file__))) settings.version = importlib.metadata.version("lnbits") +settings.auth_secret_key = ( + settings.auth_secret_key or sha256(settings.super_user.encode("utf-8")).hexdigest() +) if not settings.user_agent: settings.user_agent = f"LNbits/{settings.version}" diff --git a/lnbits/static/bundle.min.js b/lnbits/static/bundle.min.js index 863c29446..300499355 100644 --- a/lnbits/static/bundle.min.js +++ b/lnbits/static/bundle.min.js @@ -3,21 +3,21 @@ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -function decode(e){let t=e.toLowerCase(),n=t.lastIndexOf("1"),i=t.substring(0,n),r=t.substring(n+1,t.length-6),o=t.substring(t.length-6,t.length);if(!verify_checksum(i,bech32ToFiveBitArray(r+o)))throw"Malformed request: checksum is incorrect";return{human_readable_part:decodeHumanReadablePart(i),data:decodeData(r,i),checksum:o}}function decodeHumanReadablePart(e){let t;if(["lnbc","lntb","lnbcrt","lnsb","lntbs"].forEach((n=>{e.substring(0,n.length)===n&&(t=n)})),null==t)throw"Malformed request: unknown prefix";let n=decodeAmount(e.substring(t.length,e.length));return{prefix:t,amount:n}}function decodeData(e,t){let n=e.substring(0,7),i=bech32ToInt(n),r=e.substring(e.length-104,e.length),o=e.substring(7,e.length-104),a=decodeTags(o),s=bech32ToFiveBitArray(n+o);return s=fiveBitArrayTo8BitArray(s,!0),s=textToHexString(t).concat(byteArrayToHexString(s)),{time_stamp:i,tags:a,signature:decodeSignature(r),signing_data:s}}function decodeSignature(e){let t=fiveBitArrayTo8BitArray(bech32ToFiveBitArray(e)),n=t[t.length-1];return{r:byteArrayToHexString(t.slice(0,32)),s:byteArrayToHexString(t.slice(32,t.length-1)),recovery_flag:n}}function decodeAmount(e){let t=e.charAt(e.length-1),n=e.substring(0,e.length-1);if("0"===n.substring(0,1))throw"Malformed request: amount cannot contain leading zeros";if(n=Number(n),n<0||!Number.isInteger(n))throw"Malformed request: amount must be a positive decimal integer";switch(t){case"":return"Any amount";case"p":return n/10;case"n":return 100*n;case"u":return 1e5*n;case"m":return 1e8*n;default:throw"Malformed request: undefined amount multiplier"}}function decodeTags(e){let t=extractTags(e),n=[];return t.forEach((e=>n.push(decodeTag(e.type,e.length,e.data)))),n}function extractTags(e){let t=[];for(;e.length>0;){let n=e.charAt(0),i=bech32ToInt(e.substring(1,3)),r=e.substring(3,i+3);t.push({type:n,length:i,data:r}),e=e.substring(3+i,e.length)}return t}function decodeTag(e,t,n){switch(e){case"p":if(52!==t)break;return{type:e,length:t,description:"payment_hash",value:byteArrayToHexString(fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n)))};case"d":return{type:e,length:t,description:"description",value:bech32ToUTF8String(n)};case"n":if(53!==t)break;return{type:e,length:t,description:"payee_public_key",value:byteArrayToHexString(fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n)))};case"h":if(52!==t)break;return{type:e,length:t,description:"description_hash",value:n};case"x":return{type:e,length:t,description:"expiry",value:bech32ToInt(n)};case"c":return{type:e,length:t,description:"min_final_cltv_expiry",value:bech32ToInt(n)};case"f":let i=bech32ToFiveBitArray(n.charAt(0))[0];if(i<0||i>18)break;return{type:e,length:t,description:"fallback_address",value:{version:i,fallback_address:n=n.substring(1,n.length)}};case"r":let r=(n=fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n))).slice(0,33),o=n.slice(33,41),a=n.slice(41,45),s=n.slice(45,49),l=n.slice(49,51);return{type:e,length:t,description:"routing_information",value:{public_key:byteArrayToHexString(r),short_channel_id:byteArrayToHexString(o),fee_base_msat:byteArrayToInt(a),fee_proportional_millionths:byteArrayToInt(s),cltv_expiry_delta:byteArrayToInt(l)}}}}function polymod(e){let t=[996825010,642813549,513874426,1027748829,705979059],n=1;return e.forEach((e=>{let i=n>>25;n=(33554431&n)<<5^e;for(let e=0;e<5;e++)n^=1==(i>>e&1)?t[e]:0})),n}function expand(e){let t=[];for(let n=0;n>5);t.push(0);for(let n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,O=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,q={},E={};function D(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(E[e]=r),t&&(E[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function N(e,t){return e.isValid()?(t=z(t,e.localeData()),q[t]=q[t]||function(e){var t,n,i,r=e.match(L);for(t=0,n=r.length;t=0&&O.test(e);)e=e.replace(O,i),O.lastIndex=0,n-=1;return e}var j={};function R(e,t){var n=e.toLowerCase();j[n]=j[n+"s"]=j[t]=e}function I(e){return"string"==typeof e?j[e]||j[e.toLowerCase()]:void 0}function $(e){var t,n,i={};for(n in e)o(e,n)&&(t=I(n))&&(i[t]=e[n]);return i}var B={};function F(e,t){B[e]=t}function V(e){return e%4==0&&e%100!=0||e%400==0}function H(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=H(t)),n}function U(e,t){return function(i){return null!=i?(Q(this,e,i),n.updateOffset(this,t),this):Y(this,e)}}function Y(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&V(e.year())&&1===e.month()&&29===e.date()?(n=W(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var G,K=/\d/,Z=/\d\d/,J=/\d{3}/,X=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,ie=/\d\d\d\d\d\d?/,re=/\d{1,3}/,oe=/\d{1,4}/,ae=/[+-]?\d{1,6}/,se=/\d+/,le=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,ue=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function he(e,t,n){G[e]=M(t)?t:function(e,i){return e&&n?n:t}}function fe(e,t){return o(G,e)?G[e](t._strict,t._locale):new RegExp(pe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,i,r){return t||n||i||r}))))}function pe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}G={};var me={};function ve(e,t){var n,i,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n68?1900:2e3)};var $e=U("FullYear",!0);function Be(e,t,n,i,r,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,i,r,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,i,r,o,a),s}function Fe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ve(e,t,n){var i=7+t-n;return-((7+Fe(e,0,i).getUTCDay()-t)%7)+i-1}function He(e,t,n,i,r){var o,a,s=1+7*(t-1)+(7+n-i)%7+Ve(e,i,r);return s<=0?a=Ie(o=e-1)+s:s>Ie(e)?(o=e+1,a=s-Ie(e)):(o=e,a=s),{year:o,dayOfYear:a}}function We(e,t,n){var i,r,o=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?i=a+Ue(r=e.year()-1,t,n):a>Ue(e.year(),t,n)?(i=a-Ue(e.year(),t,n),r=e.year()+1):(r=e.year(),i=a),{week:i,year:r}}function Ue(e,t,n){var i=Ve(e,t,n),r=Ve(e+1,t,n);return(Ie(e)-i+r)/7}D("w",["ww",2],"wo","week"),D("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),F("week",5),F("isoWeek",5),he("w",te),he("ww",te,Z),he("W",te),he("WW",te,Z),ge(["w","ww","W","WW"],(function(e,t,n,i){t[i.substr(0,1)]=W(e)}));function Ye(e,t){return e.slice(t,7).concat(e.slice(0,t))}D("d",0,"do","day"),D("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),D("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),D("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),D("e",0,0,"weekday"),D("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),he("d",te),he("e",te),he("E",te),he("dd",(function(e,t){return t.weekdaysMinRegex(e)})),he("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),he("dddd",(function(e,t){return t.weekdaysRegex(e)})),ge(["dd","ddd","dddd"],(function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:f(n).invalidWeekday=e})),ge(["d","e","E"],(function(e,t,n,i){t[i]=W(e)}));var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ge="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ze=de,Je=de,Xe=de;function et(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null}function tt(){function e(e,t){return t.length-e.length}var t,n,i,r,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),i=pe(this.weekdaysMin(n,"")),r=pe(this.weekdaysShort(n,"")),o=pe(this.weekdays(n,"")),a.push(i),s.push(r),l.push(o),c.push(i),c.push(r),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function nt(){return this.hours()%12||12}function it(e,t){D(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function rt(e,t){return t._meridiemParse}D("H",["HH",2],0,"hour"),D("h",["hh",2],0,nt),D("k",["kk",2],0,(function(){return this.hours()||24})),D("hmm",0,0,(function(){return""+nt.apply(this)+P(this.minutes(),2)})),D("hmmss",0,0,(function(){return""+nt.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),D("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),D("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),it("a",!0),it("A",!1),R("hour","h"),F("hour",13),he("a",rt),he("A",rt),he("H",te),he("h",te),he("k",te),he("HH",te,Z),he("hh",te,Z),he("kk",te,Z),he("hmm",ne),he("hmmss",ie),he("Hmm",ne),he("Hmmss",ie),ve(["H","HH"],ke),ve(["k","kk"],(function(e,t,n){var i=W(e);t[ke]=24===i?0:i})),ve(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ve(["h","hh"],(function(e,t,n){t[ke]=W(e),f(n).bigHour=!0})),ve("hmm",(function(e,t,n){var i=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i)),f(n).bigHour=!0})),ve("hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i,2)),t[Ce]=W(e.substr(r)),f(n).bigHour=!0})),ve("Hmm",(function(e,t,n){var i=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i))})),ve("Hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i,2)),t[Ce]=W(e.substr(r))}));var ot=U("Hours",!0);var at,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Le,monthsShort:Oe,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Ge,meridiemParse:/[ap]\.?m?\.?/i},lt={},ct={};function ut(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n0;){if(i=ht(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&ut(r,n)>=t-1)break;t--}o++}return at}(e)}function vt(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[we]<0||n[we]>11?we:n[xe]<1||n[xe]>Pe(n[ye],n[we])?xe:n[ke]<0||n[ke]>24||24===n[ke]&&(0!==n[Se]||0!==n[Ce]||0!==n[Me])?ke:n[Se]<0||n[Se]>59?Se:n[Ce]<0||n[Ce]>59?Ce:n[Me]<0||n[Me]>999?Me:-1,f(e)._overflowDayOfYear&&(txe)&&(t=xe),f(e)._overflowWeeks&&-1===t&&(t=Te),f(e)._overflowWeekday&&-1===t&&(t=Ae),f(e).overflow=t),e}var gt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bt=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],wt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],xt=/^\/?Date\((-?\d+)/i,kt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ct(e){var t,n,i,r,o,a,s=e._i,l=gt.exec(s)||_t.exec(s),c=yt.length,u=wt.length;if(l){for(f(e).iso=!0,t=0,n=c;t7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=We(Et(),o,a),n=At(t.gg,e._a[ye],c.year),i=At(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o);i<1||i>Ue(n,o,a)?f(e)._overflowWeeks=!0:null!=l?f(e)._overflowWeekday=!0:(s=He(n,i,r,o,a),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=At(e._a[ye],r[ye]),(e._dayOfYear>Ie(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),i=Fe(a,0,e._dayOfYear),e._a[we]=i.getUTCMonth(),e._a[xe]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ke]&&0===e._a[Se]&&0===e._a[Ce]&&0===e._a[Me]&&(e._nextDay=!0,e._a[ke]=0),e._d=(e._useUTC?Fe:Be).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ke]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(f(e).weekdayMismatch=!0)}}function Lt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],f(e).empty=!0;var t,i,r,o,a,s,l,c=""+e._i,u=c.length,d=0;for(l=(r=z(e._f,e._locale).match(L)||[]).length,t=0;t0&&f(e).unusedInput.push(a),c=c.slice(c.indexOf(i)+i.length),d+=i.length),E[o]?(i?f(e).empty=!1:f(e).unusedTokens.push(o),_e(o,i,e)):e._strict&&!i&&f(e).unusedTokens.push(o);f(e).charsLeftOver=u-d,c.length>0&&f(e).unusedInput.push(c),e._a[ke]<=12&&!0===f(e).bigHour&&e._a[ke]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[ke]=function(e,t,n){var i;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[ke],e._meridiem),null!==(s=f(e).era)&&(e._a[ye]=e._locale.erasConvertYear(s,e._a[ye])),Pt(e),vt(e)}else Tt(e);else Ct(e)}function Ot(e){var t=e._i,o=e._f;return e._locale=e._locale||mt(e._l),null===t||void 0===o&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new b(vt(t)):(c(t)?e._d=t:i(o)?function(e){var t,n,i,r,o,a,s=!1,l=e._f.length;if(0===l)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;rthis?this:e:m()}));function zt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Et();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-hn:new Date(e,t,n).valueOf()}function mn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hn:Date.UTC(e,t,n)}function vn(e,t){return t.erasAbbrRegex(e)}function gn(){var e,t,n=[],i=[],r=[],o=[],a=this.eras();for(e=0,t=a.length;e(o=Ue(e,i,r))&&(t=o),yn.call(this,e,t,n,i,r))}function yn(e,t,n,i,r){var o=He(e,t,n,i,r),a=Fe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}D("N",0,0,"eraAbbr"),D("NN",0,0,"eraAbbr"),D("NNN",0,0,"eraAbbr"),D("NNNN",0,0,"eraName"),D("NNNNN",0,0,"eraNarrow"),D("y",["y",1],"yo","eraYear"),D("y",["yy",2],0,"eraYear"),D("y",["yyy",3],0,"eraYear"),D("y",["yyyy",4],0,"eraYear"),he("N",vn),he("NN",vn),he("NNN",vn),he("NNNN",(function(e,t){return t.erasNameRegex(e)})),he("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ve(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?f(n).era=r:f(n).invalidEra=e})),he("y",se),he("yy",se),he("yyy",se),he("yyyy",se),he("yo",(function(e,t){return t._eraYearOrdinalRegex||se})),ve(["y","yy","yyy","yyyy"],ye),ve(["yo"],(function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ye]=n._locale.eraYearOrdinalParse(e,r):t[ye]=parseInt(e,10)})),D(0,["gg",2],0,(function(){return this.weekYear()%100})),D(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),_n("gggg","weekYear"),_n("ggggg","weekYear"),_n("GGGG","isoWeekYear"),_n("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),he("G",le),he("g",le),he("GG",te,Z),he("gg",te,Z),he("GGGG",oe,X),he("gggg",oe,X),he("GGGGG",ae,ee),he("ggggg",ae,ee),ge(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,i){t[i.substr(0,2)]=W(e)})),ge(["gg","GG"],(function(e,t,i,r){t[r]=n.parseTwoDigitYear(e)})),D("Q",0,"Qo","quarter"),R("quarter","Q"),F("quarter",7),he("Q",K),ve("Q",(function(e,t){t[we]=3*(W(e)-1)})),D("D",["DD",2],"Do","date"),R("date","D"),F("date",9),he("D",te),he("DD",te,Z),he("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ve(["D","DD"],xe),ve("Do",(function(e,t){t[xe]=W(e.match(te)[0])}));var wn=U("Date",!0);D("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),F("dayOfYear",4),he("DDD",re),he("DDDD",J),ve(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=W(e)})),D("m",["mm",2],0,"minute"),R("minute","m"),F("minute",14),he("m",te),he("mm",te,Z),ve(["m","mm"],Se);var xn=U("Minutes",!1);D("s",["ss",2],0,"second"),R("second","s"),F("second",15),he("s",te),he("ss",te,Z),ve(["s","ss"],Ce);var kn,Sn,Cn=U("Seconds",!1);for(D("S",0,0,(function(){return~~(this.millisecond()/100)})),D(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),D(0,["SSS",3],0,"millisecond"),D(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),D(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),D(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),D(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),D(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),D(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),R("millisecond","ms"),F("millisecond",16),he("S",re,K),he("SS",re,Z),he("SSS",re,J),kn="SSSS";kn.length<=9;kn+="S")he(kn,se);function Mn(e,t){t[Me]=W(1e3*("0."+e))}for(kn="S";kn.length<=9;kn+="S")ve(kn,Mn);Sn=U("Milliseconds",!1),D("z",0,0,"zoneAbbr"),D("zz",0,0,"zoneName");var Tn=b.prototype;function An(e){return e}Tn.add=en,Tn.calendar=function(e,t){1===arguments.length&&(arguments[0]?rn(arguments[0])?(e=arguments[0],t=void 0):function(e){var t,n=r(e)&&!a(e),i=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;tn.valueOf():n.valueOf()9999?N(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):M(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(n,"Z")):N(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Tn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",n=r+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Tn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Tn.toJSON=function(){return this.isValid()?this.toISOString():null},Tn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Tn.unix=function(){return Math.floor(this.valueOf()/1e3)},Tn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Tn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Tn.eraName=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Tn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Tn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Tn.isUtc=Ut,Tn.isUTC=Ut,Tn.zoneAbbr=function(){return this._isUTC?"UTC":""},Tn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Tn.dates=x("dates accessor is deprecated. Use date instead.",wn),Tn.months=x("months accessor is deprecated. Use month instead",je),Tn.years=x("years accessor is deprecated. Use year instead",$e),Tn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),Tn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return _(t,this),(t=Ot(t))._a?(e=t._isUTC?h(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(i=0;i0):this._isDSTShifted=!1,this._isDSTShifted}));var Pn=A.prototype;function Ln(e,t,n,i){var r=mt(),o=h().set(i,t);return r[n](o,e)}function On(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ln(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Ln(e,i,n,"month");return r}function qn(e,t,n,i){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var r,o=mt(),a=e?o._week.dow:0,s=[];if(null!=n)return Ln(t,(n+a)%7,i,"day");for(r=0;r<7;r++)s[r]=Ln(t,(r+a)%7,i,"day");return s}Pn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return M(i)?i.call(t,n):i},Pn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},Pn.invalidDate=function(){return this._invalidDate},Pn.ordinal=function(e){return this._ordinal.replace("%d",e)},Pn.preparse=An,Pn.postformat=An,Pn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return M(r)?r(e,t,n,i):r.replace(/%d/i,e)},Pn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return M(n)?n(t):n.replace(/%s/i,t)},Pn.set=function(e){var t,n;for(n in e)o(e,n)&&(M(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Pn.eras=function(e,t){var i,r,o,a=this._eras||mt("en")._eras;for(i=0,r=a.length;i=0)return l[i]},Pn.erasConvertYear=function(e,t){var i=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*i},Pn.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||gn.call(this),e?this._erasAbbrRegex:this._erasRegex},Pn.erasNameRegex=function(e){return o(this,"_erasNameRegex")||gn.call(this),e?this._erasNameRegex:this._erasRegex},Pn.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||gn.call(this),e?this._erasNarrowRegex:this._erasRegex},Pn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||qe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},Pn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[qe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Pn.monthsParse=function(e,t,n){var i,r,o;if(this._monthsParseExact)return Ne.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},Pn.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Re.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=De),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Pn.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Re.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Ee),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Pn.week=function(e){return We(e,this._week.dow,this._week.doy).week},Pn.firstDayOfYear=function(){return this._week.doy},Pn.firstDayOfWeek=function(){return this._week.dow},Pn.weekdays=function(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ye(n,this._week.dow):e?n[e.day()]:n},Pn.weekdaysMin=function(e){return!0===e?Ye(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Pn.weekdaysShort=function(e){return!0===e?Ye(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Pn.weekdaysParse=function(e,t,n){var i,r,o;if(this._weekdaysParseExact)return et.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},Pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Pn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===W(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",ft),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",mt);var En=Math.abs;function Dn(e,t,n,i){var r=Gt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function Nn(e){return e<0?Math.floor(e):Math.ceil(e)}function zn(e){return 4800*e/146097}function jn(e){return 146097*e/4800}function Rn(e){return function(){return this.as(e)}}var In=Rn("ms"),$n=Rn("s"),Bn=Rn("m"),Fn=Rn("h"),Vn=Rn("d"),Hn=Rn("w"),Wn=Rn("M"),Un=Rn("Q"),Yn=Rn("y");function Qn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Gn=Qn("milliseconds"),Kn=Qn("seconds"),Zn=Qn("minutes"),Jn=Qn("hours"),Xn=Qn("days"),ei=Qn("months"),ti=Qn("years");var ni=Math.round,ii={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ri(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}var oi=Math.abs;function ai(e){return(e>0)-(e<0)||+e}function si(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,o,a,s,l=oi(this._milliseconds)/1e3,c=oi(this._days),u=oi(this._months),d=this.asSeconds();return d?(e=H(l/60),t=H(e/60),l%=60,e%=60,n=H(u/12),u%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",o=ai(this._months)!==ai(d)?"-":"",a=ai(this._days)!==ai(d)?"-":"",s=ai(this._milliseconds)!==ai(d)?"-":"",r+"P"+(n?o+n+"Y":"")+(u?o+u+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+i+"S":"")):"P0D"}var li=Rt.prototype;return li.isValid=function(){return this._isValid},li.abs=function(){var e=this._data;return this._milliseconds=En(this._milliseconds),this._days=En(this._days),this._months=En(this._months),e.milliseconds=En(e.milliseconds),e.seconds=En(e.seconds),e.minutes=En(e.minutes),e.hours=En(e.hours),e.months=En(e.months),e.years=En(e.years),this},li.add=function(e,t){return Dn(this,e,t,1)},li.subtract=function(e,t){return Dn(this,e,t,-1)},li.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=I(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,n=this._months+zn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(jn(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},li.asMilliseconds=In,li.asSeconds=$n,li.asMinutes=Bn,li.asHours=Fn,li.asDays=Vn,li.asWeeks=Hn,li.asMonths=Wn,li.asQuarters=Un,li.asYears=Yn,li.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*W(this._months/12):NaN},li._bubble=function(){var e,t,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Nn(jn(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=H(o/1e3),l.seconds=e%60,t=H(e/60),l.minutes=t%60,n=H(t/60),l.hours=n%24,a+=H(n/24),s+=r=H(zn(a)),a-=Nn(jn(r)),i=H(s/12),s%=12,l.days=a,l.months=s,l.years=i,this},li.clone=function(){return Gt(this)},li.get=function(e){return e=I(e),this.isValid()?this[e+"s"]():NaN},li.milliseconds=Gn,li.seconds=Kn,li.minutes=Zn,li.hours=Jn,li.days=Xn,li.weeks=function(){return H(this.days()/7)},li.months=ei,li.years=ti,li.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,o=ii;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(o=Object.assign({},ii,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),i=function(e,t,n,i){var r=Gt(e).abs(),o=ni(r.as("s")),a=ni(r.as("m")),s=ni(r.as("h")),l=ni(r.as("d")),c=ni(r.as("M")),u=ni(r.as("w")),d=ni(r.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=i,ri.apply(null,h)}(this,!r,o,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)},li.toISOString=si,li.toString=si,li.toJSON=si,li.locale=an,li.localeData=ln,li.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",si),li.lang=sn,D("X",0,0,"unix"),D("x",0,0,"valueOf"),he("x",le),he("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ve("x",(function(e,t,n){n._d=new Date(W(e))})), +function decode(e){let t=e.toLowerCase(),n=t.lastIndexOf("1"),i=t.substring(0,n),r=t.substring(n+1,t.length-6),o=t.substring(t.length-6,t.length);if(!verify_checksum(i,bech32ToFiveBitArray(r+o)))throw"Malformed request: checksum is incorrect";return{human_readable_part:decodeHumanReadablePart(i),data:decodeData(r,i),checksum:o}}function decodeHumanReadablePart(e){let t;if(["lnbc","lntb","lnbcrt","lnsb","lntbs"].forEach((n=>{e.substring(0,n.length)===n&&(t=n)})),null==t)throw"Malformed request: unknown prefix";let n=decodeAmount(e.substring(t.length,e.length));return{prefix:t,amount:n}}function decodeData(e,t){let n=e.substring(0,7),i=bech32ToInt(n),r=e.substring(e.length-104,e.length),o=e.substring(7,e.length-104),a=decodeTags(o),s=bech32ToFiveBitArray(n+o);return s=fiveBitArrayTo8BitArray(s,!0),s=textToHexString(t).concat(byteArrayToHexString(s)),{time_stamp:i,tags:a,signature:decodeSignature(r),signing_data:s}}function decodeSignature(e){let t=fiveBitArrayTo8BitArray(bech32ToFiveBitArray(e)),n=t[t.length-1];return{r:byteArrayToHexString(t.slice(0,32)),s:byteArrayToHexString(t.slice(32,t.length-1)),recovery_flag:n}}function decodeAmount(e){let t=e.charAt(e.length-1),n=e.substring(0,e.length-1);if("0"===n.substring(0,1))throw"Malformed request: amount cannot contain leading zeros";if(n=Number(n),n<0||!Number.isInteger(n))throw"Malformed request: amount must be a positive decimal integer";switch(t){case"":return"Any amount";case"p":return n/10;case"n":return 100*n;case"u":return 1e5*n;case"m":return 1e8*n;default:throw"Malformed request: undefined amount multiplier"}}function decodeTags(e){let t=extractTags(e),n=[];return t.forEach((e=>n.push(decodeTag(e.type,e.length,e.data)))),n}function extractTags(e){let t=[];for(;e.length>0;){let n=e.charAt(0),i=bech32ToInt(e.substring(1,3)),r=e.substring(3,i+3);t.push({type:n,length:i,data:r}),e=e.substring(3+i,e.length)}return t}function decodeTag(e,t,n){switch(e){case"p":if(52!==t)break;return{type:e,length:t,description:"payment_hash",value:byteArrayToHexString(fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n)))};case"d":return{type:e,length:t,description:"description",value:bech32ToUTF8String(n)};case"n":if(53!==t)break;return{type:e,length:t,description:"payee_public_key",value:byteArrayToHexString(fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n)))};case"h":if(52!==t)break;return{type:e,length:t,description:"description_hash",value:n};case"x":return{type:e,length:t,description:"expiry",value:bech32ToInt(n)};case"c":return{type:e,length:t,description:"min_final_cltv_expiry",value:bech32ToInt(n)};case"f":let i=bech32ToFiveBitArray(n.charAt(0))[0];if(i<0||i>18)break;return{type:e,length:t,description:"fallback_address",value:{version:i,fallback_address:n=n.substring(1,n.length)}};case"r":let r=(n=fiveBitArrayTo8BitArray(bech32ToFiveBitArray(n))).slice(0,33),o=n.slice(33,41),a=n.slice(41,45),s=n.slice(45,49),l=n.slice(49,51);return{type:e,length:t,description:"routing_information",value:{public_key:byteArrayToHexString(r),short_channel_id:byteArrayToHexString(o),fee_base_msat:byteArrayToInt(a),fee_proportional_millionths:byteArrayToInt(s),cltv_expiry_delta:byteArrayToInt(l)}}}}function polymod(e){let t=[996825010,642813549,513874426,1027748829,705979059],n=1;return e.forEach((e=>{let i=n>>25;n=(33554431&n)<<5^e;for(let e=0;e<5;e++)n^=1==(i>>e&1)?t[e]:0})),n}function expand(e){let t=[];for(let n=0;n>5);t.push(0);for(let n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,O=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,q={},E={};function D(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(E[e]=r),t&&(E[t[0]]=function(){return P(r.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function N(e,t){return e.isValid()?(t=z(t,e.localeData()),q[t]=q[t]||function(e){var t,n,i,r=e.match(L);for(t=0,n=r.length;t=0&&O.test(e);)e=e.replace(O,i),O.lastIndex=0,n-=1;return e}var R={};function j(e,t){var n=e.toLowerCase();R[n]=R[n+"s"]=R[t]=e}function I(e){return"string"==typeof e?R[e]||R[e.toLowerCase()]:void 0}function $(e){var t,n,i={};for(n in e)o(e,n)&&(t=I(n))&&(i[t]=e[n]);return i}var B={};function F(e,t){B[e]=t}function V(e){return e%4==0&&e%100!=0||e%400==0}function H(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=H(t)),n}function U(e,t){return function(i){return null!=i?(Q(this,e,i),n.updateOffset(this,t),this):Y(this,e)}}function Y(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&V(e.year())&&1===e.month()&&29===e.date()?(n=W(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var G,K=/\d/,Z=/\d\d/,J=/\d{3}/,X=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,ie=/\d\d\d\d\d\d?/,re=/\d{1,3}/,oe=/\d{1,4}/,ae=/[+-]?\d{1,6}/,se=/\d+/,le=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,ue=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function he(e,t,n){G[e]=M(t)?t:function(e,i){return e&&n?n:t}}function fe(e,t){return o(G,e)?G[e](t._strict,t._locale):new RegExp(pe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,i,r){return t||n||i||r}))))}function pe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}G={};var me={};function ve(e,t){var n,i,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n68?1900:2e3)};var $e=U("FullYear",!0);function Be(e,t,n,i,r,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,i,r,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,i,r,o,a),s}function Fe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ve(e,t,n){var i=7+t-n;return-((7+Fe(e,0,i).getUTCDay()-t)%7)+i-1}function He(e,t,n,i,r){var o,a,s=1+7*(t-1)+(7+n-i)%7+Ve(e,i,r);return s<=0?a=Ie(o=e-1)+s:s>Ie(e)?(o=e+1,a=s-Ie(e)):(o=e,a=s),{year:o,dayOfYear:a}}function We(e,t,n){var i,r,o=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?i=a+Ue(r=e.year()-1,t,n):a>Ue(e.year(),t,n)?(i=a-Ue(e.year(),t,n),r=e.year()+1):(r=e.year(),i=a),{week:i,year:r}}function Ue(e,t,n){var i=Ve(e,t,n),r=Ve(e+1,t,n);return(Ie(e)-i+r)/7}D("w",["ww",2],"wo","week"),D("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),F("week",5),F("isoWeek",5),he("w",te),he("ww",te,Z),he("W",te),he("WW",te,Z),ge(["w","ww","W","WW"],(function(e,t,n,i){t[i.substr(0,1)]=W(e)}));function Ye(e,t){return e.slice(t,7).concat(e.slice(0,t))}D("d",0,"do","day"),D("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),D("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),D("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),D("e",0,0,"weekday"),D("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),he("d",te),he("e",te),he("E",te),he("dd",(function(e,t){return t.weekdaysMinRegex(e)})),he("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),he("dddd",(function(e,t){return t.weekdaysRegex(e)})),ge(["dd","ddd","dddd"],(function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:f(n).invalidWeekday=e})),ge(["d","e","E"],(function(e,t,n,i){t[i]=W(e)}));var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ge="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ze=de,Je=de,Xe=de;function et(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null}function tt(){function e(e,t){return t.length-e.length}var t,n,i,r,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),i=pe(this.weekdaysMin(n,"")),r=pe(this.weekdaysShort(n,"")),o=pe(this.weekdays(n,"")),a.push(i),s.push(r),l.push(o),c.push(i),c.push(r),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function nt(){return this.hours()%12||12}function it(e,t){D(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function rt(e,t){return t._meridiemParse}D("H",["HH",2],0,"hour"),D("h",["hh",2],0,nt),D("k",["kk",2],0,(function(){return this.hours()||24})),D("hmm",0,0,(function(){return""+nt.apply(this)+P(this.minutes(),2)})),D("hmmss",0,0,(function(){return""+nt.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),D("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),D("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),it("a",!0),it("A",!1),j("hour","h"),F("hour",13),he("a",rt),he("A",rt),he("H",te),he("h",te),he("k",te),he("HH",te,Z),he("hh",te,Z),he("kk",te,Z),he("hmm",ne),he("hmmss",ie),he("Hmm",ne),he("Hmmss",ie),ve(["H","HH"],ke),ve(["k","kk"],(function(e,t,n){var i=W(e);t[ke]=24===i?0:i})),ve(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ve(["h","hh"],(function(e,t,n){t[ke]=W(e),f(n).bigHour=!0})),ve("hmm",(function(e,t,n){var i=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i)),f(n).bigHour=!0})),ve("hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i,2)),t[Ce]=W(e.substr(r)),f(n).bigHour=!0})),ve("Hmm",(function(e,t,n){var i=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i))})),ve("Hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[ke]=W(e.substr(0,i)),t[Se]=W(e.substr(i,2)),t[Ce]=W(e.substr(r))}));var ot=U("Hours",!0);var at,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Le,monthsShort:Oe,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Ge,meridiemParse:/[ap]\.?m?\.?/i},lt={},ct={};function ut(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n0;){if(i=ht(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&ut(r,n)>=t-1)break;t--}o++}return at}(e)}function vt(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[we]<0||n[we]>11?we:n[xe]<1||n[xe]>Pe(n[ye],n[we])?xe:n[ke]<0||n[ke]>24||24===n[ke]&&(0!==n[Se]||0!==n[Ce]||0!==n[Me])?ke:n[Se]<0||n[Se]>59?Se:n[Ce]<0||n[Ce]>59?Ce:n[Me]<0||n[Me]>999?Me:-1,f(e)._overflowDayOfYear&&(txe)&&(t=xe),f(e)._overflowWeeks&&-1===t&&(t=Te),f(e)._overflowWeekday&&-1===t&&(t=Ae),f(e).overflow=t),e}var gt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bt=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],wt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],xt=/^\/?Date\((-?\d+)/i,kt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ct(e){var t,n,i,r,o,a,s=e._i,l=gt.exec(s)||_t.exec(s),c=yt.length,u=wt.length;if(l){for(f(e).iso=!0,t=0,n=c;t7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=We(Et(),o,a),n=At(t.gg,e._a[ye],c.year),i=At(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o);i<1||i>Ue(n,o,a)?f(e)._overflowWeeks=!0:null!=l?f(e)._overflowWeekday=!0:(s=He(n,i,r,o,a),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=At(e._a[ye],r[ye]),(e._dayOfYear>Ie(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),i=Fe(a,0,e._dayOfYear),e._a[we]=i.getUTCMonth(),e._a[xe]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ke]&&0===e._a[Se]&&0===e._a[Ce]&&0===e._a[Me]&&(e._nextDay=!0,e._a[ke]=0),e._d=(e._useUTC?Fe:Be).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ke]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(f(e).weekdayMismatch=!0)}}function Lt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],f(e).empty=!0;var t,i,r,o,a,s,l,c=""+e._i,u=c.length,d=0;for(l=(r=z(e._f,e._locale).match(L)||[]).length,t=0;t0&&f(e).unusedInput.push(a),c=c.slice(c.indexOf(i)+i.length),d+=i.length),E[o]?(i?f(e).empty=!1:f(e).unusedTokens.push(o),_e(o,i,e)):e._strict&&!i&&f(e).unusedTokens.push(o);f(e).charsLeftOver=u-d,c.length>0&&f(e).unusedInput.push(c),e._a[ke]<=12&&!0===f(e).bigHour&&e._a[ke]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[ke]=function(e,t,n){var i;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[ke],e._meridiem),null!==(s=f(e).era)&&(e._a[ye]=e._locale.erasConvertYear(s,e._a[ye])),Pt(e),vt(e)}else Tt(e);else Ct(e)}function Ot(e){var t=e._i,o=e._f;return e._locale=e._locale||mt(e._l),null===t||void 0===o&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new b(vt(t)):(c(t)?e._d=t:i(o)?function(e){var t,n,i,r,o,a,s=!1,l=e._f.length;if(0===l)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;rthis?this:e:m()}));function zt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Et();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-hn:new Date(e,t,n).valueOf()}function mn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hn:Date.UTC(e,t,n)}function vn(e,t){return t.erasAbbrRegex(e)}function gn(){var e,t,n=[],i=[],r=[],o=[],a=this.eras();for(e=0,t=a.length;e(o=Ue(e,i,r))&&(t=o),yn.call(this,e,t,n,i,r))}function yn(e,t,n,i,r){var o=He(e,t,n,i,r),a=Fe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}D("N",0,0,"eraAbbr"),D("NN",0,0,"eraAbbr"),D("NNN",0,0,"eraAbbr"),D("NNNN",0,0,"eraName"),D("NNNNN",0,0,"eraNarrow"),D("y",["y",1],"yo","eraYear"),D("y",["yy",2],0,"eraYear"),D("y",["yyy",3],0,"eraYear"),D("y",["yyyy",4],0,"eraYear"),he("N",vn),he("NN",vn),he("NNN",vn),he("NNNN",(function(e,t){return t.erasNameRegex(e)})),he("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ve(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?f(n).era=r:f(n).invalidEra=e})),he("y",se),he("yy",se),he("yyy",se),he("yyyy",se),he("yo",(function(e,t){return t._eraYearOrdinalRegex||se})),ve(["y","yy","yyy","yyyy"],ye),ve(["yo"],(function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ye]=n._locale.eraYearOrdinalParse(e,r):t[ye]=parseInt(e,10)})),D(0,["gg",2],0,(function(){return this.weekYear()%100})),D(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),_n("gggg","weekYear"),_n("ggggg","weekYear"),_n("GGGG","isoWeekYear"),_n("GGGGG","isoWeekYear"),j("weekYear","gg"),j("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),he("G",le),he("g",le),he("GG",te,Z),he("gg",te,Z),he("GGGG",oe,X),he("gggg",oe,X),he("GGGGG",ae,ee),he("ggggg",ae,ee),ge(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,i){t[i.substr(0,2)]=W(e)})),ge(["gg","GG"],(function(e,t,i,r){t[r]=n.parseTwoDigitYear(e)})),D("Q",0,"Qo","quarter"),j("quarter","Q"),F("quarter",7),he("Q",K),ve("Q",(function(e,t){t[we]=3*(W(e)-1)})),D("D",["DD",2],"Do","date"),j("date","D"),F("date",9),he("D",te),he("DD",te,Z),he("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ve(["D","DD"],xe),ve("Do",(function(e,t){t[xe]=W(e.match(te)[0])}));var wn=U("Date",!0);D("DDD",["DDDD",3],"DDDo","dayOfYear"),j("dayOfYear","DDD"),F("dayOfYear",4),he("DDD",re),he("DDDD",J),ve(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=W(e)})),D("m",["mm",2],0,"minute"),j("minute","m"),F("minute",14),he("m",te),he("mm",te,Z),ve(["m","mm"],Se);var xn=U("Minutes",!1);D("s",["ss",2],0,"second"),j("second","s"),F("second",15),he("s",te),he("ss",te,Z),ve(["s","ss"],Ce);var kn,Sn,Cn=U("Seconds",!1);for(D("S",0,0,(function(){return~~(this.millisecond()/100)})),D(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),D(0,["SSS",3],0,"millisecond"),D(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),D(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),D(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),D(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),D(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),D(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),j("millisecond","ms"),F("millisecond",16),he("S",re,K),he("SS",re,Z),he("SSS",re,J),kn="SSSS";kn.length<=9;kn+="S")he(kn,se);function Mn(e,t){t[Me]=W(1e3*("0."+e))}for(kn="S";kn.length<=9;kn+="S")ve(kn,Mn);Sn=U("Milliseconds",!1),D("z",0,0,"zoneAbbr"),D("zz",0,0,"zoneName");var Tn=b.prototype;function An(e){return e}Tn.add=en,Tn.calendar=function(e,t){1===arguments.length&&(arguments[0]?rn(arguments[0])?(e=arguments[0],t=void 0):function(e){var t,n=r(e)&&!a(e),i=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;tn.valueOf():n.valueOf()9999?N(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):M(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(n,"Z")):N(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Tn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",n=r+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Tn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Tn.toJSON=function(){return this.isValid()?this.toISOString():null},Tn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Tn.unix=function(){return Math.floor(this.valueOf()/1e3)},Tn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Tn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Tn.eraName=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Tn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Tn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Tn.isUtc=Ut,Tn.isUTC=Ut,Tn.zoneAbbr=function(){return this._isUTC?"UTC":""},Tn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Tn.dates=x("dates accessor is deprecated. Use date instead.",wn),Tn.months=x("months accessor is deprecated. Use month instead",Re),Tn.years=x("years accessor is deprecated. Use year instead",$e),Tn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),Tn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return _(t,this),(t=Ot(t))._a?(e=t._isUTC?h(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(i=0;i0):this._isDSTShifted=!1,this._isDSTShifted}));var Pn=A.prototype;function Ln(e,t,n,i){var r=mt(),o=h().set(i,t);return r[n](o,e)}function On(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ln(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Ln(e,i,n,"month");return r}function qn(e,t,n,i){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var r,o=mt(),a=e?o._week.dow:0,s=[];if(null!=n)return Ln(t,(n+a)%7,i,"day");for(r=0;r<7;r++)s[r]=Ln(t,(r+a)%7,i,"day");return s}Pn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return M(i)?i.call(t,n):i},Pn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},Pn.invalidDate=function(){return this._invalidDate},Pn.ordinal=function(e){return this._ordinal.replace("%d",e)},Pn.preparse=An,Pn.postformat=An,Pn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return M(r)?r(e,t,n,i):r.replace(/%d/i,e)},Pn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return M(n)?n(t):n.replace(/%s/i,t)},Pn.set=function(e){var t,n;for(n in e)o(e,n)&&(M(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Pn.eras=function(e,t){var i,r,o,a=this._eras||mt("en")._eras;for(i=0,r=a.length;i=0)return l[i]},Pn.erasConvertYear=function(e,t){var i=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*i},Pn.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||gn.call(this),e?this._erasAbbrRegex:this._erasRegex},Pn.erasNameRegex=function(e){return o(this,"_erasNameRegex")||gn.call(this),e?this._erasNameRegex:this._erasRegex},Pn.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||gn.call(this),e?this._erasNarrowRegex:this._erasRegex},Pn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||qe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},Pn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[qe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Pn.monthsParse=function(e,t,n){var i,r,o;if(this._monthsParseExact)return Ne.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},Pn.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=De),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Pn.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Ee),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Pn.week=function(e){return We(e,this._week.dow,this._week.doy).week},Pn.firstDayOfYear=function(){return this._week.doy},Pn.firstDayOfWeek=function(){return this._week.dow},Pn.weekdays=function(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ye(n,this._week.dow):e?n[e.day()]:n},Pn.weekdaysMin=function(e){return!0===e?Ye(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Pn.weekdaysShort=function(e){return!0===e?Ye(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Pn.weekdaysParse=function(e,t,n){var i,r,o;if(this._weekdaysParseExact)return et.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},Pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||tt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Pn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===W(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",ft),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",mt);var En=Math.abs;function Dn(e,t,n,i){var r=Gt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function Nn(e){return e<0?Math.floor(e):Math.ceil(e)}function zn(e){return 4800*e/146097}function Rn(e){return 146097*e/4800}function jn(e){return function(){return this.as(e)}}var In=jn("ms"),$n=jn("s"),Bn=jn("m"),Fn=jn("h"),Vn=jn("d"),Hn=jn("w"),Wn=jn("M"),Un=jn("Q"),Yn=jn("y");function Qn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Gn=Qn("milliseconds"),Kn=Qn("seconds"),Zn=Qn("minutes"),Jn=Qn("hours"),Xn=Qn("days"),ei=Qn("months"),ti=Qn("years");var ni=Math.round,ii={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ri(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}var oi=Math.abs;function ai(e){return(e>0)-(e<0)||+e}function si(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,o,a,s,l=oi(this._milliseconds)/1e3,c=oi(this._days),u=oi(this._months),d=this.asSeconds();return d?(e=H(l/60),t=H(e/60),l%=60,e%=60,n=H(u/12),u%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",o=ai(this._months)!==ai(d)?"-":"",a=ai(this._days)!==ai(d)?"-":"",s=ai(this._milliseconds)!==ai(d)?"-":"",r+"P"+(n?o+n+"Y":"")+(u?o+u+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+i+"S":"")):"P0D"}var li=jt.prototype;return li.isValid=function(){return this._isValid},li.abs=function(){var e=this._data;return this._milliseconds=En(this._milliseconds),this._days=En(this._days),this._months=En(this._months),e.milliseconds=En(e.milliseconds),e.seconds=En(e.seconds),e.minutes=En(e.minutes),e.hours=En(e.hours),e.months=En(e.months),e.years=En(e.years),this},li.add=function(e,t){return Dn(this,e,t,1)},li.subtract=function(e,t){return Dn(this,e,t,-1)},li.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=I(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,n=this._months+zn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Rn(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},li.asMilliseconds=In,li.asSeconds=$n,li.asMinutes=Bn,li.asHours=Fn,li.asDays=Vn,li.asWeeks=Hn,li.asMonths=Wn,li.asQuarters=Un,li.asYears=Yn,li.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*W(this._months/12):NaN},li._bubble=function(){var e,t,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Nn(Rn(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=H(o/1e3),l.seconds=e%60,t=H(e/60),l.minutes=t%60,n=H(t/60),l.hours=n%24,a+=H(n/24),s+=r=H(zn(a)),a-=Nn(Rn(r)),i=H(s/12),s%=12,l.days=a,l.months=s,l.years=i,this},li.clone=function(){return Gt(this)},li.get=function(e){return e=I(e),this.isValid()?this[e+"s"]():NaN},li.milliseconds=Gn,li.seconds=Kn,li.minutes=Zn,li.hours=Jn,li.days=Xn,li.weeks=function(){return H(this.days()/7)},li.months=ei,li.years=ti,li.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,o=ii;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(o=Object.assign({},ii,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),i=function(e,t,n,i){var r=Gt(e).abs(),o=ni(r.as("s")),a=ni(r.as("m")),s=ni(r.as("h")),l=ni(r.as("d")),c=ni(r.as("M")),u=ni(r.as("w")),d=ni(r.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=i,ri.apply(null,h)}(this,!r,o,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)},li.toISOString=si,li.toString=si,li.toJSON=si,li.locale=an,li.localeData=ln,li.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",si),li.lang=sn,D("X",0,0,"unix"),D("x",0,0,"valueOf"),he("x",le),he("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ve("x",(function(e,t,n){n._d=new Date(W(e))})), //! moment.js -n.version="2.29.4",e=Et,n.fn=Tn,n.min=function(){return zt("isBefore",[].slice.call(arguments,0))},n.max=function(){return zt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(e){return Et(1e3*e)},n.months=function(e,t){return On(e,t,"months")},n.isDate=c,n.locale=ft,n.invalid=m,n.duration=Gt,n.isMoment=y,n.weekdays=function(e,t,n){return qn(e,t,n,"weekdays")},n.parseZone=function(){return Et.apply(null,arguments).parseZone()},n.localeData=mt,n.isDuration=It,n.monthsShort=function(e,t){return On(e,t,"monthsShort")},n.weekdaysMin=function(e,t,n){return qn(e,t,n,"weekdaysMin")},n.defineLocale=pt,n.updateLocale=function(e,t){if(null!=t){var n,i,r=st;null!=lt[e]&&null!=lt[e].parentLocale?lt[e].set(T(lt[e]._config,t)):(null!=(i=ht(e))&&(r=i._config),t=T(r,t),null==i&&(t.abbr=e),(n=new A(t)).parentLocale=lt[e],lt[e]=n),ft(e)}else null!=lt[e]&&(null!=lt[e].parentLocale?(lt[e]=lt[e].parentLocale,e===ft()&&ft(e)):null!=lt[e]&&delete lt[e]);return lt[e]},n.locales=function(){return k(lt)},n.weekdaysShort=function(e,t,n){return qn(e,t,n,"weekdaysShort")},n.normalizeUnits=I,n.relativeTimeRounding=function(e){return void 0===e?ni:"function"==typeof e&&(ni=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==ii[e]&&(void 0===t?ii[e]:(ii[e]=t,"s"===e&&(ii.ss=t-1),!0))},n.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=Tn,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e._,i=e._=t();i.noConflict=function(){return e._=n,i}}())}(this,(function(){var e="1.13.6",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},n=Array.prototype,i=Object.prototype,r="undefined"!=typeof Symbol?Symbol.prototype:null,o=n.push,a=n.slice,s=i.toString,l=i.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,d=Array.isArray,h=Object.keys,f=Object.create,p=c&&ArrayBuffer.isView,m=isNaN,v=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],b=Math.pow(2,53)-1;function y(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),i=Array(n),r=0;r=0&&n<=b}}function Y(e){return function(t){return null==t?void 0:t[e]}}var Q=Y("byteLength"),G=U(Q),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var Z=c?function(e){return p?p(e)&&!I(e):G(e)&&K.test(s.call(e))}:W(!1),J=Y("length");function X(e,t){t=function(e){for(var t={},n=e.length,i=0;i":">",'"':""","'":"'","`":"`"},Ve=Be(Fe),He=Be(ye(Fe)),We=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Ue=/(.)^/,Ye={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qe=/\\|'|\r|\n|\u2028|\u2029/g;function Ge(e){return"\\"+Ye[e]}var Ke=/^\s*(\w|\$)+\s*$/;var Ze=0;function Je(e,t,n,i,r){if(!(i instanceof t))return e.apply(n,r);var o=Me(e.prototype),a=e.apply(o,r);return w(a)?a:o}var Xe=y((function(e,t){var n=Xe.placeholder,i=function(){for(var r=0,o=t.length,a=Array(o),s=0;s1)nt(s,t-1,n,i),r=i.length;else for(var l=0,c=s.length;l0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var lt=Xe(st,2);function ct(e,t,n){t=je(t,n);for(var i,r=ee(e),o=0,a=r.length;o0?0:r-1;o>=0&&o0?s=o>=0?o:Math.max(o+l,s):l=o>=0?Math.min(o+1,l):o+l+1;else if(n&&o&&l)return i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=t(a.call(i,s,l),H))>=0?o+s:-1;for(o=e>0?s:l-1;o>=0&&o=3;return function(t,n,i,r){var o=!tt(t)&&ee(t),a=(o||t).length,s=e>0?0:a-1;for(r||(i=t[o?o[s]:s],s+=e);s>=0&&s=0}var Tt=y((function(e,t,n){var i,r;return D(t)?r=t:(t=Ae(t),i=t.slice(0,-1),t=t[t.length-1]),bt(e,(function(e){var o=r;if(!o){if(i&&i.length&&(e=Pe(e,i)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)}))}));function At(e,t){return bt(e,Ee(t))}function Pt(e,t,n){var i,r,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=tt(e)?e:be(e)).length;so&&(o=i);else t=je(t,n),_t(e,(function(e,n,i){((r=t(e,n,i))>a||r===-1/0&&o===-1/0)&&(o=e,a=r)}));return o}var Lt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ot(e){return e?$(e)?a.call(e):C(e)?e.match(Lt):tt(e)?bt(e,Oe):be(e):[]}function qt(e,t,n){if(null==t||n)return tt(e)||(e=be(e)),e[Ie(e.length-1)];var i=Ot(e),r=J(i);t=Math.max(Math.min(t,r),0);for(var o=r-1,a=0;a1&&(i=De(i,t[1])),t=se(e)):(i=Rt,t=nt(t,!1,!1),e=Object(e));for(var r=0,o=t.length;r1&&(n=t[1])):(t=bt(nt(t,!1,!1),String),i=function(e,n){return!Mt(t,n)}),It(e,i,n)}));function Bt(e,t,n){return a.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function Ft(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Bt(e,e.length-t)}function Vt(e,t,n){return a.call(e,null==t||n?1:t)}var Ht=y((function(e,t){return t=nt(t,!0,!0),kt(e,(function(e){return!Mt(t,e)}))})),Wt=y((function(e,t){return Ht(e,t)}));function Ut(e,t,n,i){k(t)||(i=n,n=t,t=!1),null!=n&&(n=je(n,i));for(var r=[],o=[],a=0,s=J(e);at?(i&&(clearTimeout(i),i=null),s=c,a=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(i),s=0,i=r=o=null},c},debounce:function(e,t,n){var i,r,o,a,s,l=function(){var c=$e()-r;t>c?i=setTimeout(l,t-c):(i=null,n||(a=e.apply(s,o)),i||(o=s=null))},c=y((function(c){return s=this,o=c,r=$e(),i||(i=setTimeout(l,t),n&&(a=e.apply(s,o))),a}));return c.cancel=function(){clearTimeout(i),i=o=s=null},c},wrap:function(e,t){return Xe(t,e)},negate:at,compose:function(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:st,once:lt,findKey:ct,findIndex:dt,findLastIndex:ht,sortedIndex:ft,indexOf:mt,lastIndexOf:vt,find:gt,detect:gt,findWhere:function(e,t){return gt(e,qe(t))},each:_t,forEach:_t,map:bt,collect:bt,reduce:wt,foldl:wt,inject:wt,reduceRight:xt,foldr:xt,filter:kt,select:kt,reject:function(e,t,n){return kt(e,at(je(t)),n)},every:St,all:St,some:Ct,any:Ct,contains:Mt,includes:Mt,include:Mt,invoke:Tt,pluck:At,where:function(e,t){return kt(e,qe(t))},max:Pt,min:function(e,t,n){var i,r,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=tt(e)?e:be(e)).length;si||void 0===n)return 1;if(ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,a=void 0!==o&&o;if(null!=t)if("object"!==e(t)&&(t=[t]),f(t))for(i=0,r=t.length;i0;)if(t===(n=i[r]).toLowerCase())return n;return null}var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=function(e){return!p(e)&&e!==A};var L,O=(L="undefined"!=typeof Uint8Array&&c(Uint8Array),function(e){return L&&e instanceof L}),q=d("HTMLFormElement"),E=function(e){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),D=d("RegExp"),N=function(e,t){var n=Object.getOwnPropertyDescriptors(e),i={};M(n,(function(n,r){var o;!1!==(o=t(n,r,e))&&(i[r]=o||n)})),Object.defineProperties(e,i)},z="abcdefghijklmnopqrstuvwxyz",j="0123456789",R={DIGIT:j,ALPHA:z,ALPHA_DIGIT:z+z.toUpperCase()+j};var I=d("AsyncFunction"),$={isArray:f,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=u(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:v,isNumber:_,isBoolean:function(e){return!0===e||!1===e},isObject:b,isPlainObject:y,isUndefined:p,isDate:w,isFile:x,isBlob:k,isRegExp:D,isFunction:g,isStream:function(e){return b(e)&&g(e.pipe)},isURLSearchParams:C,isTypedArray:O,isFileList:S,forEach:M,merge:function e(){for(var t=(P(this)&&this||{}).caseless,n={},i=function(i,r){var o=t&&T(n,r)||r;y(n[o])&&y(i)?n[o]=e(n[o],i):y(i)?n[o]=e({},i):f(i)?n[o]=i.slice():n[o]=i},r=0,o=arguments.length;r3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,i){var r,o,a,s={};if(t=t||{},null==e)return t;do{for(o=(r=Object.getOwnPropertyNames(e)).length;o-- >0;)a=r[o],i&&!i(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:d,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var i=e.indexOf(t,n);return-1!==i&&i===n},toArray:function(e){if(!e)return null;if(f(e))return e;var t=e.length;if(!_(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,i=(e&&e[Symbol.iterator]).call(e);(n=i.next())&&!n.done;){var r=n.value;t.call(e,r[0],r[1])}},matchAll:function(e,t){for(var n,i=[];null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:q,hasOwnProperty:E,hasOwnProp:E,reduceDescriptors:N,freezeMethods:function(e){N(e,(function(t,n){if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var i=e[n];g(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},i=function(e){e.forEach((function(e){n[e]=!0}))};return f(e)?i(e):i(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:T,global:A,isContextDefined:P,ALPHABET:R,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R.ALPHA_DIGIT,n="",i=t.length;e--;)n+=t[Math.random()*i|0];return n},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(n,i){if(b(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;var r=f(n)?[]:{};return M(n,(function(t,n){var o=e(t,i+1);!p(o)&&(r[n]=o)})),t[i]=void 0,r}}return n}(e,0)},isAsyncFn:I,isThenable:function(e){return e&&(b(e)||g(e))&&g(e.then)&&g(e.catch)}};function B(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}$.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var F=B.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){V[e]={value:e}})),Object.defineProperties(B,V),Object.defineProperty(F,"isAxiosError",{value:!0}),B.from=function(e,t,n,i,r,o){var a=Object.create(F);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),B.call(a,e.message,t,n,i,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};function H(e){return $.isPlainObject(e)||$.isArray(e)}function W(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function U(e,t,n){return e?e.concat(t).map((function(e,t){return e=W(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Y=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Q(t,n,i){if(!$.isObject(t))throw new TypeError("target must be an object");n=n||new FormData;var r=(i=$.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,o=i.visitor||u,a=i.dots,s=i.indexes,l=(i.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(n);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!l&&$.isBlob(e))throw new B("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(t,i,o){var l=t;if(t&&!o&&"object"===e(t))if($.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else if($.isArray(t)&&function(e){return $.isArray(e)&&!e.some(H)}(t)||($.isFileList(t)||$.endsWith(i,"[]"))&&(l=$.toArray(t)))return i=W(i),l.forEach((function(e,t){!$.isUndefined(e)&&null!==e&&n.append(!0===s?U([i],t,a):null===s?i:i+"[]",c(e))})),!1;return!!H(t)||(n.append(U(o,i,a),c(t)),!1)}var d=[],h=Object.assign(Y,{defaultVisitor:u,convertValue:c,isVisitable:H});if(!$.isObject(t))throw new TypeError("data must be an object");return function e(t,i){if(!$.isUndefined(t)){if(-1!==d.indexOf(t))throw Error("Circular reference detected in "+i.join("."));d.push(t),$.forEach(t,(function(t,r){!0===(!($.isUndefined(t)||null===t)&&o.call(n,t,$.isString(r)?r.trim():r,i,h))&&e(t,i?i.concat(r):[r])})),d.pop()}}(t),n}function G(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function K(e,t){this._pairs=[],e&&Q(e,this,t)}var Z=K.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,n){if(!t)return e;var i,r=n&&n.encode||J,o=n&&n.serialize;if(i=o?o(t,n):$.isURLSearchParams(t)?t.toString():new K(t,n).toString(r)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){var t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ee,te=function(){function e(){t(this,e),this.handlers=[]}return i(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:K,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:("undefined"==typeof navigator||"ReactNative"!==(ee=navigator.product)&&"NativeScript"!==ee&&"NS"!==ee)&&"undefined"!=typeof window&&"undefined"!=typeof document,isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function re(e){function t(e,n,i,r){var o=e[r++],a=Number.isFinite(+o),s=r>=e.length;return o=!o&&$.isArray(i)?i.length:o,s?($.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):(i[o]&&$.isObject(i[o])||(i[o]=[]),t(e,n,i[o],r)&&$.isArray(i[o])&&(i[o]=function(e){var t,n,i={},r=Object.keys(e),o=r.length;for(t=0;t-1,o=$.isObject(e);if(o&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r&&r?JSON.stringify(re(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new ie.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return ie.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=$.isFileList(e))||i.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return Q(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||oe.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&$.isString(e)&&(n&&!this.responseType||i)){var r=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw B.from(e,B.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(function(e){oe.headers[e]={}}));var ae=oe,se=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),le=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function de(e,t,n,i,r){return $.isFunction(i)?i.call(this,t,n):(r&&(t=n),$.isString(t)?$.isString(i)?-1!==t.indexOf(i):$.isRegExp(i)?i.test(t):void 0:void 0)}var he=function(e,n){function o(e){t(this,o),e&&this.set(e)}return i(o,[{key:"set",value:function(e,t,n){var i=this;function r(e,t,n){var r=ce(t);if(!r)throw new Error("header name must be a non-empty string");var o=$.findKey(i,r);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=ue(e))}var o,a,s,l,c,u=function(e,t){return $.forEach(e,(function(e,n){return r(e,n,t)}))};return $.isPlainObject(e)||e instanceof this.constructor?u(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?u((c={},(o=e)&&o.split("\n").forEach((function(e){l=e.indexOf(":"),a=e.substring(0,l).trim().toLowerCase(),s=e.substring(l+1).trim(),!a||c[a]&&se[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&r(t,e,n),this}},{key:"get",value:function(e,t){if(e=ce(e)){var n=$.findKey(this,e);if(n){var i=this[n];if(!t)return i;if(!0===t)return function(e){for(var t,n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=i.exec(e);)n[t[1]]=t[2];return n}(i);if($.isFunction(t))return t.call(this,i,n);if($.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=ce(e)){var n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!de(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,i=!1;function r(e){if(e=ce(e)){var r=$.findKey(n,e);!r||t&&!de(0,n[r],r,t)||(delete n[r],i=!0)}}return $.isArray(e)?e.forEach(r):r(e),i}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,i=!1;n--;){var r=t[n];e&&!de(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}},{key:"normalize",value:function(e){var t=this,n={};return $.forEach(this,(function(i,r){var o=$.findKey(n,r);if(o)return t[o]=ue(i),void delete t[r];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(r):String(r).trim();a!==r&&delete t[r],t[a]=ue(i),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i1?n-1:0),r=1;r1?"since :\n"+l.map(xe).join("\n"):" "+xe(l[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n},adapters:we};function Ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ve(null,e)}function Me(e){return Ce(e),e.headers=fe.from(e.headers),e.data=pe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se.getAdapter(e.adapter||ae.adapter)(e).then((function(t){return Ce(e),t.data=pe.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return me(t)||(Ce(e),t&&t.response&&(t.response.data=pe.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}var Te=function(e){return e instanceof fe?e.toJSON():e};function Ae(e,t){t=t||{};var n={};function i(e,t,n){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:n},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function r(e,t,n){return $.isUndefined(t)?$.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function o(e,t){if(!$.isUndefined(t))return i(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function s(n,r,o){return o in t?i(n,r):o in e?i(void 0,n):void 0}var l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return r(Te(e),Te(t),!0)}};return $.forEach(Object.keys(Object.assign({},e,t)),(function(i){var o=l[i]||r,a=o(e[i],t[i],i);$.isUndefined(a)&&o!==s||(n[i]=a)})),n}var Pe="1.6.0",Le={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){Le[t]=function(i){return e(i)===t||"a"+(n<1?"n ":" ")+t}}));var Oe={};Le.transitional=function(e,t,n){function i(e,t){return"[Axios v1.6.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new B(i(r," has been removed"+(t?" in "+t:"")),B.ERR_DEPRECATED);return t&&!Oe[r]&&(Oe[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}};var qe={assertOptions:function(t,n,i){if("object"!==e(t))throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),o=r.length;o-- >0;){var a=r[o],s=n[a];if(s){var l=t[a],c=void 0===l||s(l,a,t);if(!0!==c)throw new B("option "+a+" must be "+c,B.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new B("Unknown option "+a,B.ERR_BAD_OPTION)}},validators:Le},Ee=qe.validators,De=function(){function e(n){t(this,e),this.defaults=n,this.interceptors={request:new te,response:new te}}return i(e,[{key:"request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Ae(this.defaults,t),i=n.transitional,r=n.paramsSerializer,o=n.headers;void 0!==i&&qe.assertOptions(i,{silentJSONParsing:Ee.transitional(Ee.boolean),forcedJSONParsing:Ee.transitional(Ee.boolean),clarifyTimeoutError:Ee.transitional(Ee.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:qe.assertOptions(r,{encode:Ee.function,serialize:Ee.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete o[e]})),t.headers=fe.concat(a,o);var s=[],l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,h=0;if(!l){var f=[Me.bind(this),void 0];for(f.unshift.apply(f,s),f.push.apply(f,u),d=f.length,c=Promise.resolve(t);h0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},n((function(e,t,n){r.reason||(r.reason=new ve(e,t,n),i(r.reason))}))}return i(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];je[i]=n}));var Re=je;var Ie=function e(t){var n=new Ne(t),i=a(Ne.prototype.request,n);return $.extend(i,Ne.prototype,n,{allOwnKeys:!0}),$.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Ae(t,n))},i}(ae);return Ie.Axios=Ne,Ie.CanceledError=ve,Ie.CancelToken=ze,Ie.isCancel=me,Ie.VERSION=Pe,Ie.toFormData=Q,Ie.AxiosError=B,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=Ae,Ie.AxiosHeaders=fe,Ie.formToJSON=function(e){return re($.isHTMLForm(e)?new FormData(e):e)},Ie.getAdapter=Se.getAdapter,Ie.HttpStatusCode=Re,Ie.default=Ie,Ie})), +n.version="2.29.4",e=Et,n.fn=Tn,n.min=function(){return zt("isBefore",[].slice.call(arguments,0))},n.max=function(){return zt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(e){return Et(1e3*e)},n.months=function(e,t){return On(e,t,"months")},n.isDate=c,n.locale=ft,n.invalid=m,n.duration=Gt,n.isMoment=y,n.weekdays=function(e,t,n){return qn(e,t,n,"weekdays")},n.parseZone=function(){return Et.apply(null,arguments).parseZone()},n.localeData=mt,n.isDuration=It,n.monthsShort=function(e,t){return On(e,t,"monthsShort")},n.weekdaysMin=function(e,t,n){return qn(e,t,n,"weekdaysMin")},n.defineLocale=pt,n.updateLocale=function(e,t){if(null!=t){var n,i,r=st;null!=lt[e]&&null!=lt[e].parentLocale?lt[e].set(T(lt[e]._config,t)):(null!=(i=ht(e))&&(r=i._config),t=T(r,t),null==i&&(t.abbr=e),(n=new A(t)).parentLocale=lt[e],lt[e]=n),ft(e)}else null!=lt[e]&&(null!=lt[e].parentLocale?(lt[e]=lt[e].parentLocale,e===ft()&&ft(e)):null!=lt[e]&&delete lt[e]);return lt[e]},n.locales=function(){return k(lt)},n.weekdaysShort=function(e,t,n){return qn(e,t,n,"weekdaysShort")},n.normalizeUnits=I,n.relativeTimeRounding=function(e){return void 0===e?ni:"function"==typeof e&&(ni=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==ii[e]&&(void 0===t?ii[e]:(ii[e]=t,"s"===e&&(ii.ss=t-1),!0))},n.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=Tn,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e._,i=e._=t();i.noConflict=function(){return e._=n,i}}())}(this,(function(){var e="1.13.6",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},n=Array.prototype,i=Object.prototype,r="undefined"!=typeof Symbol?Symbol.prototype:null,o=n.push,a=n.slice,s=i.toString,l=i.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,d=Array.isArray,h=Object.keys,f=Object.create,p=c&&ArrayBuffer.isView,m=isNaN,v=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],b=Math.pow(2,53)-1;function y(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),i=Array(n),r=0;r=0&&n<=b}}function Y(e){return function(t){return null==t?void 0:t[e]}}var Q=Y("byteLength"),G=U(Q),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var Z=c?function(e){return p?p(e)&&!I(e):G(e)&&K.test(s.call(e))}:W(!1),J=Y("length");function X(e,t){t=function(e){for(var t={},n=e.length,i=0;i":">",'"':""","'":"'","`":"`"},Ve=Be(Fe),He=Be(ye(Fe)),We=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Ue=/(.)^/,Ye={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qe=/\\|'|\r|\n|\u2028|\u2029/g;function Ge(e){return"\\"+Ye[e]}var Ke=/^\s*(\w|\$)+\s*$/;var Ze=0;function Je(e,t,n,i,r){if(!(i instanceof t))return e.apply(n,r);var o=Me(e.prototype),a=e.apply(o,r);return w(a)?a:o}var Xe=y((function(e,t){var n=Xe.placeholder,i=function(){for(var r=0,o=t.length,a=Array(o),s=0;s1)nt(s,t-1,n,i),r=i.length;else for(var l=0,c=s.length;l0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var lt=Xe(st,2);function ct(e,t,n){t=Re(t,n);for(var i,r=ee(e),o=0,a=r.length;o0?0:r-1;o>=0&&o0?s=o>=0?o:Math.max(o+l,s):l=o>=0?Math.min(o+1,l):o+l+1;else if(n&&o&&l)return i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=t(a.call(i,s,l),H))>=0?o+s:-1;for(o=e>0?s:l-1;o>=0&&o=3;return function(t,n,i,r){var o=!tt(t)&&ee(t),a=(o||t).length,s=e>0?0:a-1;for(r||(i=t[o?o[s]:s],s+=e);s>=0&&s=0}var Tt=y((function(e,t,n){var i,r;return D(t)?r=t:(t=Ae(t),i=t.slice(0,-1),t=t[t.length-1]),bt(e,(function(e){var o=r;if(!o){if(i&&i.length&&(e=Pe(e,i)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)}))}));function At(e,t){return bt(e,Ee(t))}function Pt(e,t,n){var i,r,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=tt(e)?e:be(e)).length;so&&(o=i);else t=Re(t,n),_t(e,(function(e,n,i){((r=t(e,n,i))>a||r===-1/0&&o===-1/0)&&(o=e,a=r)}));return o}var Lt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ot(e){return e?$(e)?a.call(e):C(e)?e.match(Lt):tt(e)?bt(e,Oe):be(e):[]}function qt(e,t,n){if(null==t||n)return tt(e)||(e=be(e)),e[Ie(e.length-1)];var i=Ot(e),r=J(i);t=Math.max(Math.min(t,r),0);for(var o=r-1,a=0;a1&&(i=De(i,t[1])),t=se(e)):(i=jt,t=nt(t,!1,!1),e=Object(e));for(var r=0,o=t.length;r1&&(n=t[1])):(t=bt(nt(t,!1,!1),String),i=function(e,n){return!Mt(t,n)}),It(e,i,n)}));function Bt(e,t,n){return a.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function Ft(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Bt(e,e.length-t)}function Vt(e,t,n){return a.call(e,null==t||n?1:t)}var Ht=y((function(e,t){return t=nt(t,!0,!0),kt(e,(function(e){return!Mt(t,e)}))})),Wt=y((function(e,t){return Ht(e,t)}));function Ut(e,t,n,i){k(t)||(i=n,n=t,t=!1),null!=n&&(n=Re(n,i));for(var r=[],o=[],a=0,s=J(e);at?(i&&(clearTimeout(i),i=null),s=c,a=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(i),s=0,i=r=o=null},c},debounce:function(e,t,n){var i,r,o,a,s,l=function(){var c=$e()-r;t>c?i=setTimeout(l,t-c):(i=null,n||(a=e.apply(s,o)),i||(o=s=null))},c=y((function(c){return s=this,o=c,r=$e(),i||(i=setTimeout(l,t),n&&(a=e.apply(s,o))),a}));return c.cancel=function(){clearTimeout(i),i=o=s=null},c},wrap:function(e,t){return Xe(t,e)},negate:at,compose:function(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:st,once:lt,findKey:ct,findIndex:dt,findLastIndex:ht,sortedIndex:ft,indexOf:mt,lastIndexOf:vt,find:gt,detect:gt,findWhere:function(e,t){return gt(e,qe(t))},each:_t,forEach:_t,map:bt,collect:bt,reduce:wt,foldl:wt,inject:wt,reduceRight:xt,foldr:xt,filter:kt,select:kt,reject:function(e,t,n){return kt(e,at(Re(t)),n)},every:St,all:St,some:Ct,any:Ct,contains:Mt,includes:Mt,include:Mt,invoke:Tt,pluck:At,where:function(e,t){return kt(e,qe(t))},max:Pt,min:function(e,t,n){var i,r,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=tt(e)?e:be(e)).length;si||void 0===n)return 1;if(ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,a=void 0!==o&&o;if(null!=t)if("object"!==e(t)&&(t=[t]),f(t))for(i=0,r=t.length;i0;)if(t===(n=i[r]).toLowerCase())return n;return null}var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=function(e){return!p(e)&&e!==A};var L,O=(L="undefined"!=typeof Uint8Array&&c(Uint8Array),function(e){return L&&e instanceof L}),q=d("HTMLFormElement"),E=function(e){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),D=d("RegExp"),N=function(e,t){var n=Object.getOwnPropertyDescriptors(e),i={};M(n,(function(n,r){var o;!1!==(o=t(n,r,e))&&(i[r]=o||n)})),Object.defineProperties(e,i)},z="abcdefghijklmnopqrstuvwxyz",R="0123456789",j={DIGIT:R,ALPHA:z,ALPHA_DIGIT:z+z.toUpperCase()+R};var I=d("AsyncFunction"),$={isArray:f,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=u(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:v,isNumber:_,isBoolean:function(e){return!0===e||!1===e},isObject:b,isPlainObject:y,isUndefined:p,isDate:w,isFile:x,isBlob:k,isRegExp:D,isFunction:g,isStream:function(e){return b(e)&&g(e.pipe)},isURLSearchParams:C,isTypedArray:O,isFileList:S,forEach:M,merge:function e(){for(var t=(P(this)&&this||{}).caseless,n={},i=function(i,r){var o=t&&T(n,r)||r;y(n[o])&&y(i)?n[o]=e(n[o],i):y(i)?n[o]=e({},i):f(i)?n[o]=i.slice():n[o]=i},r=0,o=arguments.length;r3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,i){var r,o,a,s={};if(t=t||{},null==e)return t;do{for(o=(r=Object.getOwnPropertyNames(e)).length;o-- >0;)a=r[o],i&&!i(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:d,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var i=e.indexOf(t,n);return-1!==i&&i===n},toArray:function(e){if(!e)return null;if(f(e))return e;var t=e.length;if(!_(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,i=(e&&e[Symbol.iterator]).call(e);(n=i.next())&&!n.done;){var r=n.value;t.call(e,r[0],r[1])}},matchAll:function(e,t){for(var n,i=[];null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:q,hasOwnProperty:E,hasOwnProp:E,reduceDescriptors:N,freezeMethods:function(e){N(e,(function(t,n){if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var i=e[n];g(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},i=function(e){e.forEach((function(e){n[e]=!0}))};return f(e)?i(e):i(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:T,global:A,isContextDefined:P,ALPHABET:j,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j.ALPHA_DIGIT,n="",i=t.length;e--;)n+=t[Math.random()*i|0];return n},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(n,i){if(b(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;var r=f(n)?[]:{};return M(n,(function(t,n){var o=e(t,i+1);!p(o)&&(r[n]=o)})),t[i]=void 0,r}}return n}(e,0)},isAsyncFn:I,isThenable:function(e){return e&&(b(e)||g(e))&&g(e.then)&&g(e.catch)}};function B(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}$.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var F=B.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){V[e]={value:e}})),Object.defineProperties(B,V),Object.defineProperty(F,"isAxiosError",{value:!0}),B.from=function(e,t,n,i,r,o){var a=Object.create(F);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),B.call(a,e.message,t,n,i,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};function H(e){return $.isPlainObject(e)||$.isArray(e)}function W(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function U(e,t,n){return e?e.concat(t).map((function(e,t){return e=W(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Y=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Q(t,n,i){if(!$.isObject(t))throw new TypeError("target must be an object");n=n||new FormData;var r=(i=$.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,o=i.visitor||u,a=i.dots,s=i.indexes,l=(i.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(n);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!l&&$.isBlob(e))throw new B("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(t,i,o){var l=t;if(t&&!o&&"object"===e(t))if($.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else if($.isArray(t)&&function(e){return $.isArray(e)&&!e.some(H)}(t)||($.isFileList(t)||$.endsWith(i,"[]"))&&(l=$.toArray(t)))return i=W(i),l.forEach((function(e,t){!$.isUndefined(e)&&null!==e&&n.append(!0===s?U([i],t,a):null===s?i:i+"[]",c(e))})),!1;return!!H(t)||(n.append(U(o,i,a),c(t)),!1)}var d=[],h=Object.assign(Y,{defaultVisitor:u,convertValue:c,isVisitable:H});if(!$.isObject(t))throw new TypeError("data must be an object");return function e(t,i){if(!$.isUndefined(t)){if(-1!==d.indexOf(t))throw Error("Circular reference detected in "+i.join("."));d.push(t),$.forEach(t,(function(t,r){!0===(!($.isUndefined(t)||null===t)&&o.call(n,t,$.isString(r)?r.trim():r,i,h))&&e(t,i?i.concat(r):[r])})),d.pop()}}(t),n}function G(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function K(e,t){this._pairs=[],e&&Q(e,this,t)}var Z=K.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,n){if(!t)return e;var i,r=n&&n.encode||J,o=n&&n.serialize;if(i=o?o(t,n):$.isURLSearchParams(t)?t.toString():new K(t,n).toString(r)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){var t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ee,te=function(){function e(){t(this,e),this.handlers=[]}return i(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:K,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:("undefined"==typeof navigator||"ReactNative"!==(ee=navigator.product)&&"NativeScript"!==ee&&"NS"!==ee)&&"undefined"!=typeof window&&"undefined"!=typeof document,isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function re(e){function t(e,n,i,r){var o=e[r++],a=Number.isFinite(+o),s=r>=e.length;return o=!o&&$.isArray(i)?i.length:o,s?($.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):(i[o]&&$.isObject(i[o])||(i[o]=[]),t(e,n,i[o],r)&&$.isArray(i[o])&&(i[o]=function(e){var t,n,i={},r=Object.keys(e),o=r.length;for(t=0;t-1,o=$.isObject(e);if(o&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r&&r?JSON.stringify(re(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new ie.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return ie.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=$.isFileList(e))||i.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return Q(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||oe.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&$.isString(e)&&(n&&!this.responseType||i)){var r=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw B.from(e,B.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(function(e){oe.headers[e]={}}));var ae=oe,se=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),le=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function de(e,t,n,i,r){return $.isFunction(i)?i.call(this,t,n):(r&&(t=n),$.isString(t)?$.isString(i)?-1!==t.indexOf(i):$.isRegExp(i)?i.test(t):void 0:void 0)}var he=function(e,n){function o(e){t(this,o),e&&this.set(e)}return i(o,[{key:"set",value:function(e,t,n){var i=this;function r(e,t,n){var r=ce(t);if(!r)throw new Error("header name must be a non-empty string");var o=$.findKey(i,r);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=ue(e))}var o,a,s,l,c,u=function(e,t){return $.forEach(e,(function(e,n){return r(e,n,t)}))};return $.isPlainObject(e)||e instanceof this.constructor?u(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?u((c={},(o=e)&&o.split("\n").forEach((function(e){l=e.indexOf(":"),a=e.substring(0,l).trim().toLowerCase(),s=e.substring(l+1).trim(),!a||c[a]&&se[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&r(t,e,n),this}},{key:"get",value:function(e,t){if(e=ce(e)){var n=$.findKey(this,e);if(n){var i=this[n];if(!t)return i;if(!0===t)return function(e){for(var t,n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=i.exec(e);)n[t[1]]=t[2];return n}(i);if($.isFunction(t))return t.call(this,i,n);if($.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=ce(e)){var n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!de(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,i=!1;function r(e){if(e=ce(e)){var r=$.findKey(n,e);!r||t&&!de(0,n[r],r,t)||(delete n[r],i=!0)}}return $.isArray(e)?e.forEach(r):r(e),i}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,i=!1;n--;){var r=t[n];e&&!de(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}},{key:"normalize",value:function(e){var t=this,n={};return $.forEach(this,(function(i,r){var o=$.findKey(n,r);if(o)return t[o]=ue(i),void delete t[r];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(r):String(r).trim();a!==r&&delete t[r],t[a]=ue(i),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i1?n-1:0),r=1;r1?"since :\n"+l.map(xe).join("\n"):" "+xe(l[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n},adapters:we};function Ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ve(null,e)}function Me(e){return Ce(e),e.headers=fe.from(e.headers),e.data=pe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se.getAdapter(e.adapter||ae.adapter)(e).then((function(t){return Ce(e),t.data=pe.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return me(t)||(Ce(e),t&&t.response&&(t.response.data=pe.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}var Te=function(e){return e instanceof fe?e.toJSON():e};function Ae(e,t){t=t||{};var n={};function i(e,t,n){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:n},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function r(e,t,n){return $.isUndefined(t)?$.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function o(e,t){if(!$.isUndefined(t))return i(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function s(n,r,o){return o in t?i(n,r):o in e?i(void 0,n):void 0}var l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return r(Te(e),Te(t),!0)}};return $.forEach(Object.keys(Object.assign({},e,t)),(function(i){var o=l[i]||r,a=o(e[i],t[i],i);$.isUndefined(a)&&o!==s||(n[i]=a)})),n}var Pe="1.6.0",Le={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){Le[t]=function(i){return e(i)===t||"a"+(n<1?"n ":" ")+t}}));var Oe={};Le.transitional=function(e,t,n){function i(e,t){return"[Axios v1.6.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new B(i(r," has been removed"+(t?" in "+t:"")),B.ERR_DEPRECATED);return t&&!Oe[r]&&(Oe[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}};var qe={assertOptions:function(t,n,i){if("object"!==e(t))throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),o=r.length;o-- >0;){var a=r[o],s=n[a];if(s){var l=t[a],c=void 0===l||s(l,a,t);if(!0!==c)throw new B("option "+a+" must be "+c,B.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new B("Unknown option "+a,B.ERR_BAD_OPTION)}},validators:Le},Ee=qe.validators,De=function(){function e(n){t(this,e),this.defaults=n,this.interceptors={request:new te,response:new te}}return i(e,[{key:"request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Ae(this.defaults,t),i=n.transitional,r=n.paramsSerializer,o=n.headers;void 0!==i&&qe.assertOptions(i,{silentJSONParsing:Ee.transitional(Ee.boolean),forcedJSONParsing:Ee.transitional(Ee.boolean),clarifyTimeoutError:Ee.transitional(Ee.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:qe.assertOptions(r,{encode:Ee.function,serialize:Ee.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete o[e]})),t.headers=fe.concat(a,o);var s=[],l=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,h=0;if(!l){var f=[Me.bind(this),void 0];for(f.unshift.apply(f,s),f.push.apply(f,u),d=f.length,c=Promise.resolve(t);h0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},n((function(e,t,n){r.reason||(r.reason=new ve(e,t,n),i(r.reason))}))}return i(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Re={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Re).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];Re[i]=n}));var je=Re;var Ie=function e(t){var n=new Ne(t),i=a(Ne.prototype.request,n);return $.extend(i,Ne.prototype,n,{allOwnKeys:!0}),$.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Ae(t,n))},i}(ae);return Ie.Axios=Ne,Ie.CanceledError=ve,Ie.CancelToken=ze,Ie.isCancel=me,Ie.VERSION=Pe,Ie.toFormData=Q,Ie.AxiosError=B,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=Ae,Ie.AxiosHeaders=fe,Ie.formToJSON=function(e){return re($.isHTMLForm(e)?new FormData(e):e)},Ie.getAdapter=Se.getAdapter,Ie.HttpStatusCode=je,Ie.default=Ie,Ie})), /*! * Vue.js v2.6.12 * (c) 2014-2020 Evan You * Released under the MIT License. */ -function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,(function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function i(e){return!0===e}function r(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return a.call(e).slice(8,-1)}function l(e){return"[object Object]"===a.call(e)}function c(e){return"[object RegExp]"===a.call(e)}function u(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function h(e){return null==e?"":Array.isArray(e)||l(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),i=e.split(","),r=0;r-1)return e.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function b(e,t){return _.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var w=/-(\w)/g,x=y((function(e){return e.replace(w,(function(e,t){return t?t.toUpperCase():""}))})),k=y((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),S=/\B([A-Z])/g,C=y((function(e){return e.replace(S,"-$1").toLowerCase()}));var M=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var i=arguments.length;return i?i>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function T(e,t){t=t||0;for(var n=e.length-t,i=new Array(n);n--;)i[n]=e[n+t];return i}function A(e,t){for(var n in t)e[n]=t[n];return e}function P(e){for(var t={},n=0;n0,J=G&&G.indexOf("edge/")>0,X=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===Q),ee=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),te={}.watch,ne=!1;if(U)try{var ie={};Object.defineProperty(ie,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,ie)}catch(e){}var re=function(){return void 0===H&&(H=!U&&!Y&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),H},oe=U&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ae(e){return"function"==typeof e&&/native code/.test(e.toString())}var se,le="undefined"!=typeof Symbol&&ae(Symbol)&&"undefined"!=typeof Reflect&&ae(Reflect.ownKeys);se="undefined"!=typeof Set&&ae(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ce=L,ue=L,de=L,he=L,fe="undefined"!=typeof console,pe=/(?:^|[-_])(\w)/g;ce=function(e,t){var n=t?de(t):"";I.warnHandler?I.warnHandler.call(null,e,t,n):fe&&!I.silent&&console.error("[Vue warn]: "+e+n)},ue=function(e,t){fe&&!I.silent&&console.warn("[Vue tip]: "+e+(t?de(t):""))},he=function(e,t){if(e.$root===e)return"";var n="function"==typeof e&&null!=e.cid?e.options:e._isVue?e.$options||e.constructor.options:e,i=n.name||n._componentTag,r=n.__file;if(!i&&r){var o=r.match(/([^/\\]+)\.vue$/);i=o&&o[1]}return(i?"<"+function(e){return e.replace(pe,(function(e){return e.toUpperCase()})).replace(/[-_]/g,"")}(i)+">":"")+(r&&!1!==t?" at "+r:"")};de=function(e){if(e._isVue&&e.$parent){for(var t=[],n=0;e;){if(t.length>0){var i=t[t.length-1];if(i.constructor===e.constructor){n++,e=e.$parent;continue}n>0&&(t[t.length-1]=[i,n],n=0)}t.push(e),e=e.$parent}return"\n\nfound in\n\n"+t.map((function(e,t){return""+(0===t?"---\x3e ":function(e,t){for(var n="";t;)t%2==1&&(n+=e),t>1&&(e+=e),t>>=1;return n}(" ",5+2*t))+(Array.isArray(e)?he(e[0])+"... ("+e[1]+" recursive calls)":he(e))})).join("\n")}return"\n\n(found in "+he(e)+")"};var me=0,ve=function(){this.id=me++,this.subs=[]};ve.prototype.addSub=function(e){this.subs.push(e)},ve.prototype.removeSub=function(e){g(this.subs,e)},ve.prototype.depend=function(){ve.target&&ve.target.addDep(this)},ve.prototype.notify=function(){var e=this.subs.slice();I.async||e.sort((function(e,t){return e.id-t.id}));for(var t=0,n=e.length;t-1)if(a&&!b(r,"default"))l=!1;else if(""===l||l===C(e)){var u=Ze(String,r.type);(u<0||c0&&(Dt((s=Nt(s,(o||"")+"_"+a))[0])&&Dt(c)&&(u[l]=ke(c.text+s[0].text),s.shift()),u.push.apply(u,s)):r(s)?Dt(c)?u[l]=ke(c.text+s):""!==s&&u.push(ke(s)):Dt(s)&&Dt(c)?u[l]=ke(c.text+s.text):(i(e._isVList)&&n(s.tag)&&t(s.key)&&n(o)&&(s.key="__vlist"+o+"_"+a+"__"),u.push(s)));return u}function zt(e,t){if(e){for(var n=Object.create(null),i=le?Reflect.ownKeys(e):Object.keys(e),r=0;r0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&i&&i!==e&&s===i.$key&&!o&&!i.$hasNormal)return i;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=$t(n,l,t[l]))}else r={};for(var c in n)c in r||(r[c]=Bt(n,c));return t&&Object.isExtensible(t)&&(t._normalized=r),F(r,"$stable",a),F(r,"$key",s),F(r,"$hasNormal",o),r}function $t(e,t,n){var i=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:Et(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:i,enumerable:!0,configurable:!0}),i}function Bt(e,t){return function(){return e[t]}}function Ft(e,t){var i,r,a,s,l;if(Array.isArray(e)||"string"==typeof e)for(i=new Array(e.length),r=0,a=e.length;r.",e),l=new ye(I.parsePlatformTagName(t),i,a,void 0,void 0,e)):l=i&&i.pre||!n(u=We(e.$options,"components",t))?new ye(t,i,a,void 0,void 0,e):cn(u,i,e,a,t)}else l=cn(t,i,e,a);return Array.isArray(l)?l:n(l)?(n(c)&&pn(l,c),n(i)&&function(e){o(e.style)&&Mt(e.style);o(e.class)&&Mt(e.class)}(i),l):xe()}(e,t,a,s,l)}function pn(e,r,o){if(e.ns=r,"foreignObject"===e.tag&&(r=void 0,o=!0),n(e.children))for(var a=0,s=e.children.length;adocument.createEvent("Event").timeStamp&&($n=function(){return Bn.now()})}function Fn(){var e,t;for(In=$n(),jn=!0,qn.sort((function(e,t){return e.id-t.id})),Rn=0;RnOn)){ce("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}var n=En.slice(),i=qn.slice();Rn=qn.length=En.length=0,Dn={},Nn={},zn=jn=!1,function(e){for(var t=0;tRn&&qn[n].id>e.id;)n--;qn.splice(n+1,0,e)}else qn.push(e);if(!zn){if(zn=!0,!I.async)return void Fn();mt(Fn)}}}(this)},Hn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){et(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Hn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Hn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Hn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Wn={enumerable:!0,configurable:!0,get:L,set:L};function Un(e,t,n){Wn.get=function(){return this[t][n]},Wn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Wn)}function Yn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},i=e._props={},r=e.$options._propKeys=[],o=!e.$parent;o||Pe(!1);var a=function(a){r.push(a);var s=Ue(a,t,n,e),l=C(a);(v(l)||I.isReservedAttr(l))&&ce('"'+l+'" is a reserved attribute and cannot be used as component prop.',e),qe(i,a,s,(function(){o||Cn||ce("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+a+'"',e)})),a in e||Un(e,"_props",a)};for(var s in t)a(s);Pe(!0)}(e,t.props),t.methods&&function(e,t){var n=e.$options.props;for(var i in t)"function"!=typeof t[i]&&ce('Method "'+i+'" has type "'+typeof t[i]+'" in the component definition. Did you reference the function correctly?',e),n&&b(n,i)&&ce('Method "'+i+'" has already been defined as a prop.',e),i in e&&B(i)&&ce('Method "'+i+'" conflicts with an existing Vue instance method. Avoid defining component methods that start with _ or $.'),e[i]="function"!=typeof t[i]?L:M(t[i],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;t=e._data="function"==typeof t?function(e,t){_e();try{return e.call(t,t)}catch(e){return et(e,t,"data()"),{}}finally{be()}}(t,e):t||{},l(t)||(t={},ce("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));var n=Object.keys(t),i=e.$options.props,r=e.$options.methods,o=n.length;for(;o--;){var a=n[o];r&&b(r,a)&&ce('Method "'+a+'" has already been defined as a data property.',e),i&&b(i,a)?ce('The data property "'+a+'" is already declared as a prop. Use prop default value instead.',e):B(a)||Un(e,"_data",a)}Oe(t,!0)}(e):Oe(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),i=re();for(var r in t){var o=t[r],a="function"==typeof o?o:o.get;null==a&&ce('Getter is missing for computed property "'+r+'".',e),i||(n[r]=new Hn(e,a||L,L,Qn)),r in e?r in e.$data?ce('The computed property "'+r+'" is already defined in data.',e):e.$options.props&&r in e.$options.props&&ce('The computed property "'+r+'" is already defined as a prop.',e):Gn(e,r,o)}}(e,t.computed),t.watch&&t.watch!==te&&function(e,t){for(var n in t){var i=t[n];if(Array.isArray(i))for(var r=0;r-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!c(e)&&e.test(t)}function oi(e,t){var n=e.cache,i=e.keys,r=e._vnode;for(var o in n){var a=n[o];if(a){var s=ii(a.componentOptions);s&&!t(s)&&ai(n,o,i,r)}}}function ai(e,t,n,i){var r=e[t];!r||i&&r.tag===i.tag||r.componentInstance.$destroy(),e[t]=null,g(n,t)}!function(t){t.prototype._init=function(t){var n,i,r=this;r._uid=Xn++,I.performance&&ot&&(n="vue-perf-start:"+r._uid,i="vue-perf-end:"+r._uid,ot(n)),r._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),i=t._parentVnode;n.parent=t.parent,n._parentVnode=i;var r=i.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(r,t):r.$options=He(ei(r.constructor),t||{},r),vt(r),r._self=r,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(r),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&kn(e,t)}(r),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,i=t.$vnode=n._parentVnode,r=i&&i.context;t.$slots=jt(n._renderChildren,r),t.$scopedSlots=e,t._c=function(e,n,i,r){return fn(t,e,n,i,r,!1)},t.$createElement=function(e,n,i,r){return fn(t,e,n,i,r,!0)};var o=i&&i.data;qe(t,"$attrs",o&&o.attrs||e,(function(){!Cn&&ce("$attrs is readonly.",t)}),!0),qe(t,"$listeners",n._parentListeners||e,(function(){!Cn&&ce("$listeners is readonly.",t)}),!0)}(r),Ln(r,"beforeCreate"),function(e){var t=zt(e.$options.inject,e);t&&(Pe(!1),Object.keys(t).forEach((function(n){qe(e,n,t[n],(function(){ce('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "'+n+'"',e)}))})),Pe(!0))}(r),Yn(r),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(r),Ln(r,"created"),I.performance&&ot&&(r._name=he(r,!1),ot(i),at("vue "+r._name+" init",n,i)),r.$options.el&&r.$mount(r.$options.el)}}(ti),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};t.set=function(){ce("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){ce("$props is readonly.",this)},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ee,e.prototype.$delete=De,e.prototype.$watch=function(e,t,n){var i=this;if(l(t))return Jn(i,e,t,n);(n=n||{}).user=!0;var r=new Hn(i,e,t,n);if(n.immediate)try{t.call(i,r.value)}catch(e){et(e,i,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(ti),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var i=this;if(Array.isArray(e))for(var r=0,o=e.length;r1?T(i):i;for(var r=T(arguments,1),o='event handler for "'+e+'"',a=0,s=i.length;aparseInt(this.max)&&ai(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return I},set:function(){ce("Do not replace the Vue.config object, set individual fields instead.")}};Object.defineProperty(e,"config",t),e.util={warn:ce,extend:A,mergeOptions:He,defineReactive:qe},e.set=Ee,e.delete=De,e.nextTick=mt,e.observable=function(e){return Oe(e),e},e.options=Object.create(null),j.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,A(e.options.components,li),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=T(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=He(this.options,e),this}}(e),ni(e),function(e){j.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&Fe(e),"component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(ti),Object.defineProperty(ti.prototype,"$isServer",{get:re}),Object.defineProperty(ti.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(ti,"FunctionalRenderContext",{value:rn}),ti.version="2.6.12";var ci=p("style,class"),ui=p("input,textarea,option,select,progress"),di=function(e,t,n){return"value"===n&&ui(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},hi=p("contenteditable,draggable,spellcheck"),fi=p("events,caret,typing,plaintext-only"),pi=function(e,t){return bi(t)||"false"===t?"false":"contenteditable"===e&&fi(t)?t:"true"},mi=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),vi="http://www.w3.org/1999/xlink",gi=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},_i=function(e){return gi(e)?e.slice(6,e.length):""},bi=function(e){return null==e||!1===e};function yi(e){for(var t=e.data,i=e,r=e;n(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=wi(r.data,t));for(;n(i=i.parent);)i&&i.data&&(t=wi(t,i.data));return function(e,t){if(n(e)||n(t))return xi(e,ki(t));return""}(t.staticClass,t.class)}function wi(e,t){return{staticClass:xi(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function xi(e,t){return e?t?e+" "+t:e:t||""}function ki(e){return Array.isArray(e)?function(e){for(var t,i="",r=0,o=e.length;r-1?Qi(e,t,n):mi(t)?bi(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):hi(t)?e.setAttribute(t,pi(t,n)):gi(t)?bi(n)?e.removeAttributeNS(vi,_i(t)):e.setAttributeNS(vi,t,n):Qi(e,t,n)}function Qi(e,t,n){if(bi(n))e.removeAttribute(t);else{if(K&&!Z&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var i=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",i)};e.addEventListener("input",i),e.__ieph=!0}e.setAttribute(t,n)}}var Gi={create:Ui,update:Ui};function Ki(e,i){var r=i.elm,o=i.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=yi(i),l=r._transitionClasses;n(l)&&(s=xi(s,ki(l))),s!==r._prevClass&&(r.setAttribute("class",s),r._prevClass=s)}}var Zi,Ji,Xi,er,tr,nr,ir,rr={create:Ki,update:Ki},or=/[\w).+\-_$\]]/;function ar(e){var t,n,i,r,o,a=!1,s=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(i=0;i=0&&" "===(m=e.charAt(p));p--);m&&or.test(m)||(c=!0)}}else void 0===r?(f=i+1,r=e.slice(0,i).trim()):v();function v(){(o||(o=[])).push(e.slice(f,i).trim()),f=i+1}if(void 0===r?r=e.slice(0,i).trim():0!==f&&v(),o)for(i=0;i-1?{exp:e.slice(0,er),key:'"'+e.slice(er+1)+'"'}:{exp:e,key:null};Ji=e,er=tr=nr=0;for(;!Sr();)Cr(Xi=kr())?Tr(Xi):91===Xi&&Mr(Xi);return{exp:e.slice(0,tr),key:e.slice(tr+1,nr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function kr(){return Ji.charCodeAt(++er)}function Sr(){return er>=Zi}function Cr(e){return 34===e||39===e}function Mr(e){var t=1;for(tr=er;!Sr();)if(Cr(e=kr()))Tr(e);else if(91===e&&t++,93===e&&t--,0===t){nr=er;break}}function Tr(e){for(var t=e;!Sr()&&(e=kr())!==t;);}var Ar,Pr="__r",Lr="__c";function Or(e,t,n){var i=Ar;return function r(){null!==t.apply(null,arguments)&&Dr(e,r,n,i)}}var qr=st&&!(ee&&Number(ee[1])<=53);function Er(e,t,n,i){if(qr){var r=In,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=r||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Ar.addEventListener(e,t,ne?{capture:n,passive:i}:n)}function Dr(e,t,n,i){(i||Ar).removeEventListener(e,t._wrapper||t,n)}function Nr(e,i){if(!t(e.data.on)||!t(i.data.on)){var r=i.data.on||{},o=e.data.on||{};Ar=i.elm,function(e){if(n(e[Pr])){var t=K?"change":"input";e[t]=[].concat(e[Pr],e[t]||[]),delete e[Pr]}n(e[Lr])&&(e.change=[].concat(e[Lr],e.change||[]),delete e[Lr])}(r),Lt(r,o,Er,Dr,Or,i.context),Ar=void 0}}var zr,jr={create:Nr,update:Nr};function Rr(e,i){if(!t(e.data.domProps)||!t(i.data.domProps)){var r,o,a=i.elm,s=e.data.domProps||{},l=i.data.domProps||{};for(r in n(l.__ob__)&&(l=i.data.domProps=A({},l)),s)r in l||(a[r]="");for(r in l){if(o=l[r],"textContent"===r||"innerHTML"===r){if(i.children&&(i.children.length=0),o===s[r])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===r&&"PROGRESS"!==a.tagName){a._value=o;var c=t(o)?"":String(o);Ir(a,c)&&(a.value=c)}else if("innerHTML"===r&&Mi(a.tagName)&&t(a.innerHTML)){(zr=zr||document.createElement("div")).innerHTML=""+o+"";for(var u=zr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}else if(o!==s[r])try{a[r]=o}catch(e){}}}}function Ir(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var i=e.value,r=e._vModifiers;if(n(r)){if(r.number)return f(i)!==f(t);if(r.trim)return i.trim()!==t.trim()}return i!==t}(e,t))}var $r={create:Rr,update:Rr},Br=y((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var i=e.split(n);i.length>1&&(t[i[0].trim()]=i[1].trim())}})),t}));function Fr(e){var t=Vr(e.style);return e.staticStyle?A(e.staticStyle,t):t}function Vr(e){return Array.isArray(e)?P(e):"string"==typeof e?Br(e):e}var Hr,Wr=/^--/,Ur=/\s*!important$/,Yr=function(e,t,n){if(Wr.test(t))e.style.setProperty(t,n);else if(Ur.test(n))e.style.setProperty(C(t),n.replace(Ur,""),"important");else{var i=Gr(t);if(Array.isArray(n))for(var r=0,o=n.length;r-1?t.split(Jr).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function eo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Jr).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",i=" "+t+" ";n.indexOf(i)>=0;)n=n.replace(i," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function to(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,no(e.name||"v")),A(t,e),t}return"string"==typeof e?no(e):void 0}}var no=y((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),io=U&&!Z,ro="transition",oo="animation",ao="transition",so="transitionend",lo="animation",co="animationend";io&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ao="WebkitTransition",so="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(lo="WebkitAnimation",co="webkitAnimationEnd"));var uo=U?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function ho(e){uo((function(){uo(e)}))}function fo(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Xr(e,t))}function po(e,t){e._transitionClasses&&g(e._transitionClasses,t),eo(e,t)}function mo(e,t,n){var i=go(e,t),r=i.type,o=i.timeout,a=i.propCount;if(!r)return n();var s=r===ro?so:co,l=0,c=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++l>=a&&c()};setTimeout((function(){l0&&(n=ro,u=a,d=o.length):t===oo?c>0&&(n=oo,u=c,d=l.length):d=(n=(u=Math.max(a,c))>0?a>c?ro:oo:null)?n===ro?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:n===ro&&vo.test(i[ao+"Property"])}}function _o(e,t){for(;e.length explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&ce(" explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function ko(e){return"number"==typeof e&&!isNaN(e)}function So(e){if(t(e))return!1;var i=e.fns;return n(i)?So(Array.isArray(i)?i[0]:i):(e._length||e.length)>1}function Co(e,t){!0!==t.data.show&&yo(t)}var Mo=function(e){var o,a,s={},l=e.modules,u=e.nodeOps;for(o=0;o - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),w(e),_(e,p,t),n(d)&&y(e,t),g(r,e.elm,o),d&&d.pre&&f--):i(e.isComment)?(e.elm=u.createComment(e.text),g(r,e.elm,o)):(e.elm=u.createTextNode(e.text),g(r,e.elm,o))}}function v(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,b(e)?(y(e,t),w(e)):(Di(e),t.push(e))}function g(e,t,i){n(e)&&(n(i)?u.parentNode(i)===e&&u.insertBefore(e,t,i):u.appendChild(e,t))}function _(e,t,n){if(Array.isArray(t)){M(t);for(var i=0;if?x(e,t(r[g+1])?null:r[g+1].elm,r,h,g,o):h>g&&S(i,d,f)}(d,p,v,o,c):n(v)?(M(v),n(e.text)&&u.setTextContent(d,""),x(d,null,v,0,v.length-1,o)):n(p)?S(p,0,p.length-1):n(e.text)&&u.setTextContent(d,""):e.text!==r.text&&u.setTextContent(d,r.text),n(f)&&n(h=f.hook)&&n(h=h.postpatch)&&h(e,r)}}}function P(e,t,r){if(i(r)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o, or missing . Bailing hydration and performing full client-side render.")}l=e,e=new ye(u.tagName(l).toLowerCase(),{},[],void 0,l)}var f=e.elm,p=u.parentNode(f);if(m(r,d,f._leaveCb?null:p,u.nextSibling(f)),n(r.parent))for(var v=r.parent,g=b(r);v;){for(var _=0;_-1,a.selected!==o&&(a.selected=o);else if(E(Oo(a),i))return void(e.selectedIndex!==s&&(e.selectedIndex=s));r||(e.selectedIndex=-1)}else ce('