From 3f7891f4e8931f00f0af5aa93be47c0e2a51edea Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 24 Jan 2020 06:02:18 +0100
Subject: [PATCH 01/75] Fix #3045
---
.../Actions/SetDestinationAccount.php | 74 ++++++++++++-------
config/firefly.php | 2 +-
2 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php
index 9446752b7f..9611bfca52 100644
--- a/app/TransactionRules/Actions/SetDestinationAccount.php
+++ b/app/TransactionRules/Actions/SetDestinationAccount.php
@@ -25,8 +25,8 @@ namespace FireflyIII\TransactionRules\Actions;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\RuleAction;
+use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
-use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Log;
@@ -71,54 +71,78 @@ class SetDestinationAccount implements ActionInterface
$this->repository->setUser($journal->user);
// journal type:
$type = $journal->transactionType->type;
+ // source and destination:
+ /** @var Transaction $source */
+ $source = $journal->transactions()->where('amount', '<', 0)->first();
+ /** @var Transaction $destination */
+ $destination = $journal->transactions()->where('amount', '>', 0)->first();
- // if this is a deposit or a transfer, the destination account must be an asset account or a default account, and it MUST exist:
- if ((TransactionType::DEPOSIT === $type || TransactionType::TRANSFER === $type) && !$this->findAssetAccount()) {
+ // sanity check:
+ if (null === $source || null === $destination) {
+ Log::error(sprintf('Cannot run rule on journal #%d because no source or dest.', $journal->id));
+
+ return false;
+ }
+
+ // it depends on the type what kind of destination account is expected.
+ $expectedDestinationTypes = config(sprintf('firefly.source_dests.%s.%s', $type, $source->account->accountType->type));
+
+ if (null === $expectedDestinationTypes) {
Log::error(
sprintf(
- 'Cannot change destination account of journal #%d because no asset account with name "%s" exists.',
- $journal->id,
- $this->action->action_value
+ 'Configuration line "%s" is unexpectedly empty. Stopped.', sprintf('firefly.source_dests.%s.%s', $type, $source->account->accountType->type)
)
);
return false;
}
- // if this is a withdrawal, the new destination account must be a expense account and may be created:
- if (TransactionType::WITHDRAWAL === $type) {
+ // try to find an account with the destination name and these types:
+ $newDestination = $this->findAccount($expectedDestinationTypes);
+ if (true === $newDestination) {
+ // update account.
+ $destination->account_id = $this->newDestinationAccount->id;
+ $destination->save();
+ $journal->touch();
+ Log::debug(sprintf('Updated transaction #%d and gave it new account ID.', $destination->id));
+
+ return true;
+ }
+
+ Log::info(sprintf('Expected destination account "%s" not found.', $this->action->action_value));
+ if (AccountType::EXPENSE === $expectedDestinationTypes[0]) {
+ Log::debug('Expected type is expense, lets create it.');
$this->findExpenseAccount();
+ // update account.
+ $destination->account_id = $this->newDestinationAccount->id;
+ $destination->save();
+ $journal->touch();
+ Log::debug(sprintf('Updated transaction #%d and gave it new account ID.', $destination->id));
}
- Log::debug(sprintf('New destination account is #%d ("%s").', $this->newDestinationAccount->id, $this->newDestinationAccount->name));
-
- // update destination transaction with new destination account:
- // get destination transaction:
- $transaction = $journal->transactions()->where('amount', '>', 0)->first();
- if (null === $transaction) {
- return true; // @codeCoverageIgnore
- }
- $transaction->account_id = $this->newDestinationAccount->id;
- $transaction->save();
- $journal->touch();
- Log::debug(sprintf('Updated transaction #%d and gave it new account ID.', $transaction->id));
-
return true;
}
/**
+ * @param array $types
+ *
* @return bool
*/
- private function findAssetAccount(): bool
+ private function findAccount(array $types): bool
{
- $account = $this->repository->findByName($this->action->action_value, [AccountType::DEFAULT, AccountType::ASSET]);
+ $account = $this->repository->findByName($this->action->action_value, $types);
if (null === $account) {
- Log::debug(sprintf('There is NO asset account called "%s".', $this->action->action_value));
+ Log::debug(sprintf('There is NO account called "%s" of type', $this->action->action_value), $types);
return false;
}
- Log::debug(sprintf('There exists an asset account called "%s". ID is #%d', $this->action->action_value, $account->id));
+ Log::debug(
+ sprintf(
+ 'There exists an account called "%s". ID is #%d. Type is "%s"',
+ $this->action->action_value, $account->id, $account->accountType->type
+ )
+ );
$this->newDestinationAccount = $account;
return true;
diff --git a/config/firefly.php b/config/firefly.php
index 1cddd22f0e..3a3da8e009 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -701,7 +701,7 @@ return [
],
],
- // allowed source / destination accounts.
+ // allowed source -> destination accounts.
'source_dests' => [
TransactionTypeModel::WITHDRAWAL => [
AccountType::ASSET => [AccountType::EXPENSE, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, AccountType::CASH],
From 3adc43938efade92249e9b3cd87a1534a12a940f Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 24 Jan 2020 20:40:23 +0100
Subject: [PATCH 02/75] Make 'stack' log to 'stdout' AND 'daily' to satisfy
both Docker and self-hosted users.
---
.env.example | 4 +++-
config/logging.php | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.env.example b/.env.example
index 8585f0fc22..336af709e8 100644
--- a/.env.example
+++ b/.env.example
@@ -32,7 +32,9 @@ TRUSTED_PROXIES=
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
-LOG_CHANNEL=stdout
+# A rotating log option is 'daily', creates 5 files that (surprise) rotate.
+# Default setting 'stack' will log to 'daily' and to 'stdout' at the same time.
+LOG_CHANNEL=stack
# Log level. You can set this from least severe to most severe:
# debug, info, notice, warning, error, critical, alert, emergency
diff --git a/config/logging.php b/config/logging.php
index e2bb74cdb1..0e089acbe3 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -56,7 +56,7 @@ return [
'channels' => [
'stack' => [
'driver' => 'stack',
- 'channels' => ['daily', 'slack'],
+ 'channels' => ['daily', 'stdout'],
],
'single' => [
From f4fd9e5a15526662832382a19e0935674798c15e Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 25 Jan 2020 06:08:56 +0100
Subject: [PATCH 03/75] Update email address
---
app/Events/AdminRequestedTestMessage.php | 2 +-
app/Events/Event.php | 2 +-
app/Events/RegisteredUser.php | 2 +-
app/Events/RequestedNewPassword.php | 2 +-
app/Events/RequestedReportOnJournals.php | 2 +-
app/Events/RequestedVersionCheckStatus.php | 2 +-
app/Events/StoredTransactionGroup.php | 2 +-
app/Events/UpdatedTransactionGroup.php | 2 +-
app/Events/UserChangedEmail.php | 2 +-
resources/assets/js/app.js | 2 +-
resources/assets/js/bootstrap.js | 2 +-
resources/assets/js/components/ExampleComponent.vue | 2 +-
resources/assets/js/components/SomeTestComponent.vue | 2 +-
resources/assets/js/components/bills/Index.vue | 2 +-
.../assets/js/components/passport/AuthorizedClients.vue | 2 +-
resources/assets/js/components/passport/Clients.vue | 2 +-
.../assets/js/components/passport/PersonalAccessTokens.vue | 2 +-
resources/assets/js/components/profile/ProfileOptions.vue | 2 +-
.../assets/js/components/transactions/AccountSelect.vue | 2 +-
resources/assets/js/components/transactions/Amount.vue | 2 +-
resources/assets/js/components/transactions/Budget.vue | 2 +-
resources/assets/js/components/transactions/Category.vue | 2 +-
.../assets/js/components/transactions/CreateTransaction.vue | 2 +-
.../assets/js/components/transactions/CustomAttachments.vue | 2 +-
resources/assets/js/components/transactions/CustomDate.vue | 2 +-
.../assets/js/components/transactions/CustomString.vue | 2 +-
.../assets/js/components/transactions/CustomTextarea.vue | 2 +-
.../js/components/transactions/CustomTransactionFields.vue | 2 +-
.../assets/js/components/transactions/EditTransaction.vue | 2 +-
.../js/components/transactions/ForeignAmountSelect.vue | 2 +-
.../assets/js/components/transactions/GroupDescription.vue | 2 +-
resources/assets/js/components/transactions/PiggyBank.vue | 2 +-
.../assets/js/components/transactions/StandardDate.vue | 2 +-
resources/assets/js/components/transactions/Tags.vue | 2 +-
.../js/components/transactions/TransactionDescription.vue | 2 +-
.../assets/js/components/transactions/TransactionType.vue | 2 +-
resources/assets/js/create_transaction.js | 2 +-
resources/assets/js/edit_transaction.js | 2 +-
resources/assets/js/profile.js | 2 +-
resources/assets/sass/_variables.scss | 2 +-
resources/assets/sass/app.scss | 2 +-
resources/lang/en_US/api.php | 2 +-
resources/lang/en_US/auth.php | 2 +-
resources/lang/en_US/bank.php | 2 +-
resources/lang/en_US/breadcrumbs.php | 2 +-
resources/lang/en_US/components.php | 2 +-
resources/lang/en_US/config.php | 2 +-
resources/lang/en_US/csv.php | 2 +-
resources/lang/en_US/demo.php | 2 +-
resources/lang/en_US/firefly.php | 6 +++++-
resources/lang/en_US/form.php | 2 +-
resources/lang/en_US/import.php | 2 +-
resources/lang/en_US/intro.php | 2 +-
resources/lang/en_US/list.php | 2 +-
resources/lang/en_US/pagination.php | 2 +-
resources/lang/en_US/passwords.php | 2 +-
resources/lang/en_US/validation.php | 2 +-
resources/views/v1/emails/error-html.twig | 2 +-
resources/views/v1/emails/error-text.twig | 2 +-
resources/views/v1/error.twig | 2 +-
60 files changed, 64 insertions(+), 60 deletions(-)
diff --git a/app/Events/AdminRequestedTestMessage.php b/app/Events/AdminRequestedTestMessage.php
index ece312467f..78f90858c8 100644
--- a/app/Events/AdminRequestedTestMessage.php
+++ b/app/Events/AdminRequestedTestMessage.php
@@ -2,7 +2,7 @@
/**
* AdminRequestedTestMessage.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/Event.php b/app/Events/Event.php
index 5499c81cf2..2ab5509c44 100644
--- a/app/Events/Event.php
+++ b/app/Events/Event.php
@@ -2,7 +2,7 @@
/**
* Event.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/RegisteredUser.php b/app/Events/RegisteredUser.php
index b98338ec68..a49d099f88 100644
--- a/app/Events/RegisteredUser.php
+++ b/app/Events/RegisteredUser.php
@@ -2,7 +2,7 @@
/**
* RegisteredUser.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.php
index 8424b0d3e6..1706faa15c 100644
--- a/app/Events/RequestedNewPassword.php
+++ b/app/Events/RequestedNewPassword.php
@@ -2,7 +2,7 @@
/**
* RequestedNewPassword.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php
index a9f64c9d40..b02b29d3ff 100644
--- a/app/Events/RequestedReportOnJournals.php
+++ b/app/Events/RequestedReportOnJournals.php
@@ -2,7 +2,7 @@
/**
* RequestedReportOnJournals.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/RequestedVersionCheckStatus.php b/app/Events/RequestedVersionCheckStatus.php
index 9fb026cd59..692f825d24 100644
--- a/app/Events/RequestedVersionCheckStatus.php
+++ b/app/Events/RequestedVersionCheckStatus.php
@@ -2,7 +2,7 @@
/**
* RequestedVersionCheckStatus.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/StoredTransactionGroup.php b/app/Events/StoredTransactionGroup.php
index 7b70043491..701733b184 100644
--- a/app/Events/StoredTransactionGroup.php
+++ b/app/Events/StoredTransactionGroup.php
@@ -2,7 +2,7 @@
/**
* StoredTransactionGroup.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/UpdatedTransactionGroup.php b/app/Events/UpdatedTransactionGroup.php
index 2cbb9b8285..1ab814ec14 100644
--- a/app/Events/UpdatedTransactionGroup.php
+++ b/app/Events/UpdatedTransactionGroup.php
@@ -2,7 +2,7 @@
/**
* UpdatedTransactionGroup.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php
index 7470b1030b..8f4f70090d 100644
--- a/app/Events/UserChangedEmail.php
+++ b/app/Events/UserChangedEmail.php
@@ -2,7 +2,7 @@
/**
* UserChangedEmail.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js
index 0e00fad03d..8ee4fe8266 100644
--- a/resources/assets/js/app.js
+++ b/resources/assets/js/app.js
@@ -1,6 +1,6 @@
/*
* app.js
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js
index 0e6f5613fa..b446b668f5 100644
--- a/resources/assets/js/bootstrap.js
+++ b/resources/assets/js/bootstrap.js
@@ -1,6 +1,6 @@
/*
* bootstrap.js
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/resources/assets/js/components/ExampleComponent.vue b/resources/assets/js/components/ExampleComponent.vue
index 381bcd86a5..52dab78f56 100644
--- a/resources/assets/js/components/ExampleComponent.vue
+++ b/resources/assets/js/components/ExampleComponent.vue
@@ -1,6 +1,6 @@
+
+
+ {% endfor %}
+
+
@@ -51,9 +62,9 @@
From c7f25c5486be0221f1fbe6a5fd966e2cf03a0e25 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 31 Jan 2020 07:24:41 +0100
Subject: [PATCH 20/75] Middleware to generate unique ID for Firefly III
installation.
---
.env.example | 5 ++
app/Http/Controllers/HomeController.php | 3 ++
app/Http/Kernel.php | 2 +
app/Http/Middleware/InstallationId.php | 61 +++++++++++++++++++++++++
composer.json | 1 +
composer.lock | 2 +-
6 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 app/Http/Middleware/InstallationId.php
diff --git a/.env.example b/.env.example
index fb1d526bc5..d429db05fd 100644
--- a/.env.example
+++ b/.env.example
@@ -206,6 +206,11 @@ DISABLE_CSP_HEADER=false
TRACKER_SITE_ID=
TRACKER_URL=
+#
+# Firefly III could (in the future) collect telemetry on how you use Firefly III.
+# In order to allow this, change the following variable to true:
+SEND_TELEMETRY=false
+
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data.
# However if you know what you're doing you can significantly speed up container start times.
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 5a860b42ab..0128903939 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -43,6 +43,7 @@ class HomeController extends Controller
{
/**
* HomeController constructor.
+ *
* @codeCoverageIgnore
*/
public function __construct()
@@ -57,6 +58,7 @@ class HomeController extends Controller
* Change index date range.
*
* @param Request $request
+ *
* @return JsonResponse
* @throws Exception
*/
@@ -98,6 +100,7 @@ class HomeController extends Controller
* Show index.
*
* @param AccountRepositoryInterface $repository
+ *
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
* @throws Exception
*/
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index dc50579d2c..df0db26d4a 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -25,6 +25,7 @@ namespace FireflyIII\Http;
use FireflyIII\Http\Middleware\Authenticate;
use FireflyIII\Http\Middleware\Binder;
use FireflyIII\Http\Middleware\EncryptCookies;
+use FireflyIII\Http\Middleware\InstallationId;
use FireflyIII\Http\Middleware\Installer;
use FireflyIII\Http\Middleware\InterestingMessage;
use FireflyIII\Http\Middleware\IsAdmin;
@@ -70,6 +71,7 @@ class Kernel extends HttpKernel
TrimStrings::class,
ConvertEmptyStringsToNull::class,
TrustProxies::class,
+ InstallationId::class
];
/**
diff --git a/app/Http/Middleware/InstallationId.php b/app/Http/Middleware/InstallationId.php
new file mode 100644
index 0000000000..5e7848de6b
--- /dev/null
+++ b/app/Http/Middleware/InstallationId.php
@@ -0,0 +1,61 @@
+.
+ */
+
+declare(strict_types=1);
+
+
+namespace FireflyIII\Http\Middleware;
+
+use Closure;
+use FireflyIII\Exceptions\FireflyException;
+use Log;
+use Ramsey\Uuid\Uuid;
+
+/**
+ *
+ * Class InstallationId
+ */
+class InstallationId
+{
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param Closure $next
+ *
+ * @return mixed
+ *
+ * @throws FireflyException
+ *
+ */
+ public function handle($request, Closure $next)
+ {
+ $config = app('fireflyconfig')->get('installation_id', null);
+ if (null === $config) {
+ $uuid5 = Uuid::uuid5(Uuid::NAMESPACE_URL, 'firefly-iii.org');
+ $uniqueId = (string)$uuid5;
+ Log::info(sprintf('Created Firefly III installation ID %s', $uniqueId));
+ app('fireflyconfig')->set('installation_id', $uniqueId);
+ }
+
+ return $next($request);
+ }
+}
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 7ff32b4c76..64ab365414 100644
--- a/composer.json
+++ b/composer.json
@@ -88,6 +88,7 @@
"pragmarx/google2fa": "^7.0",
"pragmarx/recovery": "^0.1.0",
"predis/predis": "^1.1",
+ "ramsey/uuid": "^3.9",
"rcrowe/twigbridge": "^0.11.2"
},
"require-dev": {
diff --git a/composer.lock b/composer.lock
index 9bdf5fc822..2b545ef8d1 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9c7b883d0a087261d6c484e9f274ecf5",
+ "content-hash": "8fea3d9d5b2e1f842ccd34736b68d74b",
"packages": [
{
"name": "adldap2/adldap2",
From 3771cc3b75062e7ae8ec71900610714d04c00e64 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 31 Jan 2020 07:32:04 +0100
Subject: [PATCH 21/75] Update email address
---
app/Http/Controllers/Account/CreateController.php | 2 +-
app/Http/Controllers/Account/DeleteController.php | 2 +-
app/Http/Controllers/Account/EditController.php | 2 +-
app/Http/Controllers/Account/IndexController.php | 2 +-
app/Http/Controllers/Account/ReconcileController.php | 2 +-
app/Http/Controllers/Account/ShowController.php | 2 +-
app/Http/Controllers/Admin/ConfigurationController.php | 2 +-
app/Http/Controllers/Admin/HomeController.php | 2 +-
app/Http/Controllers/Admin/LinkController.php | 2 +-
app/Http/Controllers/Admin/UpdateController.php | 2 +-
app/Http/Controllers/Admin/UserController.php | 2 +-
app/Http/Controllers/AttachmentController.php | 2 +-
app/Http/Controllers/Auth/ConfirmPasswordController.php | 2 +-
app/Http/Controllers/Auth/ForgotPasswordController.php | 2 +-
app/Http/Controllers/Auth/LoginController.php | 2 +-
app/Http/Controllers/Auth/RegisterController.php | 2 +-
app/Http/Controllers/Auth/ResetPasswordController.php | 2 +-
app/Http/Controllers/Auth/TwoFactorController.php | 2 +-
app/Http/Controllers/BillController.php | 2 +-
app/Http/Controllers/Budget/AvailableBudgetController.php | 2 +-
app/Http/Controllers/Budget/BudgetLimitController.php | 2 +-
app/Http/Controllers/Budget/CreateController.php | 2 +-
app/Http/Controllers/Budget/DeleteController.php | 2 +-
app/Http/Controllers/Budget/EditController.php | 2 +-
app/Http/Controllers/Budget/IndexController.php | 2 +-
app/Http/Controllers/Budget/ShowController.php | 2 +-
app/Http/Controllers/Category/CreateController.php | 2 +-
app/Http/Controllers/Category/DeleteController.php | 2 +-
app/Http/Controllers/Category/EditController.php | 2 +-
app/Http/Controllers/Category/IndexController.php | 2 +-
app/Http/Controllers/Category/NoCategoryController.php | 2 +-
app/Http/Controllers/Category/ShowController.php | 2 +-
app/Http/Controllers/Chart/AccountController.php | 2 +-
app/Http/Controllers/Chart/BillController.php | 2 +-
app/Http/Controllers/Chart/BudgetController.php | 2 +-
app/Http/Controllers/Chart/BudgetReportController.php | 2 +-
app/Http/Controllers/Chart/CategoryController.php | 2 +-
app/Http/Controllers/Chart/CategoryReportController.php | 2 +-
app/Http/Controllers/Chart/DoubleReportController.php | 2 +-
app/Http/Controllers/Chart/ExpenseReportController.php | 2 +-
app/Http/Controllers/Chart/PiggyBankController.php | 2 +-
app/Http/Controllers/Chart/ReportController.php | 2 +-
app/Http/Controllers/Chart/TagReportController.php | 2 +-
app/Http/Controllers/Controller.php | 2 +-
app/Http/Controllers/CurrencyController.php | 2 +-
app/Http/Controllers/DebugController.php | 2 +-
app/Http/Controllers/Export/IndexController.php | 2 +-
app/Http/Controllers/HelpController.php | 2 +-
app/Http/Controllers/HomeController.php | 2 +-
app/Http/Controllers/Import/CallbackController.php | 2 +-
app/Http/Controllers/Import/IndexController.php | 2 +-
app/Http/Controllers/Import/JobConfigurationController.php | 2 +-
app/Http/Controllers/Import/JobStatusController.php | 2 +-
app/Http/Controllers/Import/PrerequisitesController.php | 2 +-
app/Http/Controllers/JavascriptController.php | 2 +-
app/Http/Controllers/Json/AutoCompleteController.php | 2 +-
app/Http/Controllers/Json/BoxController.php | 2 +-
app/Http/Controllers/Json/ExchangeController.php | 2 +-
app/Http/Controllers/Json/FrontpageController.php | 2 +-
app/Http/Controllers/Json/IntroController.php | 2 +-
app/Http/Controllers/Json/ReconcileController.php | 2 +-
app/Http/Controllers/Json/RecurrenceController.php | 2 +-
app/Http/Controllers/Json/RuleController.php | 2 +-
app/Http/Controllers/NewUserController.php | 2 +-
app/Http/Controllers/PiggyBankController.php | 2 +-
app/Http/Controllers/Popup/ReportController.php | 2 +-
app/Http/Controllers/PreferencesController.php | 2 +-
app/Http/Controllers/Profile/DataController.php | 2 +-
app/Http/Controllers/ProfileController.php | 2 +-
app/Http/Controllers/Recurring/CreateController.php | 2 +-
app/Http/Controllers/Recurring/DeleteController.php | 2 +-
app/Http/Controllers/Recurring/EditController.php | 2 +-
app/Http/Controllers/Recurring/IndexController.php | 2 +-
app/Http/Controllers/Recurring/ShowController.php | 2 +-
app/Http/Controllers/Report/AccountController.php | 2 +-
app/Http/Controllers/Report/BalanceController.php | 2 +-
app/Http/Controllers/Report/BillController.php | 2 +-
app/Http/Controllers/Report/BudgetController.php | 2 +-
app/Http/Controllers/Report/CategoryController.php | 2 +-
app/Http/Controllers/Report/DoubleController.php | 2 +-
app/Http/Controllers/Report/OperationsController.php | 2 +-
app/Http/Controllers/Report/TagController.php | 2 +-
app/Http/Controllers/ReportController.php | 2 +-
app/Http/Controllers/Rule/CreateController.php | 2 +-
app/Http/Controllers/Rule/DeleteController.php | 2 +-
app/Http/Controllers/Rule/EditController.php | 2 +-
app/Http/Controllers/Rule/IndexController.php | 2 +-
app/Http/Controllers/Rule/SelectController.php | 2 +-
app/Http/Controllers/RuleGroup/CreateController.php | 2 +-
app/Http/Controllers/RuleGroup/DeleteController.php | 2 +-
app/Http/Controllers/RuleGroup/EditController.php | 2 +-
app/Http/Controllers/RuleGroup/ExecutionController.php | 2 +-
app/Http/Controllers/SearchController.php | 2 +-
app/Http/Controllers/System/CronController.php | 2 +-
app/Http/Controllers/System/InstallController.php | 2 +-
app/Http/Controllers/TagController.php | 2 +-
app/Http/Controllers/Transaction/BulkController.php | 2 +-
app/Http/Controllers/Transaction/ConvertController.php | 2 +-
app/Http/Controllers/Transaction/CreateController.php | 2 +-
app/Http/Controllers/Transaction/DeleteController.php | 2 +-
app/Http/Controllers/Transaction/EditController.php | 2 +-
app/Http/Controllers/Transaction/IndexController.php | 2 +-
app/Http/Controllers/Transaction/LinkController.php | 2 +-
app/Http/Controllers/Transaction/MassController.php | 2 +-
app/Http/Controllers/Transaction/ShowController.php | 2 +-
app/Http/Kernel.php | 2 +-
app/Http/Middleware/Authenticate.php | 2 +-
app/Http/Middleware/Binder.php | 2 +-
app/Http/Middleware/EncryptCookies.php | 2 +-
app/Http/Middleware/Installer.php | 2 +-
app/Http/Middleware/InterestingMessage.php | 2 +-
app/Http/Middleware/IsAdmin.php | 2 +-
app/Http/Middleware/IsDemoUser.php | 2 +-
app/Http/Middleware/IsSandStormUser.php | 2 +-
app/Http/Middleware/Range.php | 2 +-
app/Http/Middleware/RedirectIfAuthenticated.php | 2 +-
app/Http/Middleware/Sandstorm.php | 2 +-
app/Http/Middleware/SecureHeaders.php | 2 +-
app/Http/Middleware/StartFireflySession.php | 2 +-
app/Http/Middleware/TrimStrings.php | 2 +-
app/Http/Middleware/TrustProxies.php | 2 +-
app/Http/Middleware/VerifyCsrfToken.php | 2 +-
app/Http/Requests/AccountFormRequest.php | 2 +-
app/Http/Requests/AttachmentFormRequest.php | 2 +-
app/Http/Requests/BillFormRequest.php | 2 +-
app/Http/Requests/BudgetFormRequest.php | 2 +-
app/Http/Requests/BudgetIncomeRequest.php | 2 +-
app/Http/Requests/BulkEditJournalRequest.php | 2 +-
app/Http/Requests/CategoryFormRequest.php | 2 +-
app/Http/Requests/ConfigurationRequest.php | 2 +-
app/Http/Requests/CurrencyFormRequest.php | 2 +-
app/Http/Requests/DeleteAccountFormRequest.php | 2 +-
app/Http/Requests/EmailFormRequest.php | 2 +-
app/Http/Requests/JournalLinkRequest.php | 2 +-
app/Http/Requests/LinkTypeFormRequest.php | 2 +-
app/Http/Requests/MassDeleteJournalRequest.php | 2 +-
app/Http/Requests/MassEditJournalRequest.php | 2 +-
app/Http/Requests/NewUserFormRequest.php | 2 +-
app/Http/Requests/PiggyBankFormRequest.php | 2 +-
app/Http/Requests/ProfileFormRequest.php | 2 +-
app/Http/Requests/ReconciliationStoreRequest.php | 2 +-
app/Http/Requests/RecurrenceFormRequest.php | 2 +-
app/Http/Requests/ReportFormRequest.php | 2 +-
app/Http/Requests/Request.php | 2 +-
app/Http/Requests/RuleFormRequest.php | 2 +-
app/Http/Requests/RuleGroupFormRequest.php | 2 +-
app/Http/Requests/SelectTransactionsRequest.php | 2 +-
app/Http/Requests/TagFormRequest.php | 2 +-
app/Http/Requests/TestRuleFormRequest.php | 2 +-
app/Http/Requests/TokenFormRequest.php | 2 +-
app/Http/Requests/UserFormRequest.php | 2 +-
app/Http/Requests/UserRegistrationRequest.php | 2 +-
152 files changed, 152 insertions(+), 152 deletions(-)
diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php
index 191fc1891d..ed01a7b06d 100644
--- a/app/Http/Controllers/Account/CreateController.php
+++ b/app/Http/Controllers/Account/CreateController.php
@@ -1,7 +1,7 @@
Date: Fri, 31 Jan 2020 07:39:24 +0100
Subject: [PATCH 22/75] Allows the user to set the default language for new and
unauthenticated visitors.
---
.env.example | 6 ++++
config/app.php | 4 +--
config/firefly.php | 84 +++++++++++++++++++++++-----------------------
3 files changed, 50 insertions(+), 44 deletions(-)
diff --git a/.env.example b/.env.example
index d429db05fd..f01981f30a 100644
--- a/.env.example
+++ b/.env.example
@@ -15,6 +15,12 @@ SITE_OWNER=mail@example.com
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
APP_KEY=SomeRandomStringOf32CharsExactly
+#
+# Firefly III will launch using this language (for new users and unauthenticated visitors)
+# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/master/resources/lang
+#
+# If text is still in English, remember that not everything may have been translated.
+DEFAULT_LANGUAGE=en_US
# Change this value to your preferred time zone.
# Example: Europe/Amsterdam
diff --git a/config/app.php b/config/app.php
index 7839ceb304..01b40384a7 100644
--- a/config/app.php
+++ b/config/app.php
@@ -31,7 +31,7 @@ return [
'debug' => env('APP_DEBUG', false),
'url' => envNonEmpty('APP_URL', 'http://localhost'),
'timezone' => envNonEmpty('TZ', 'UTC'),
- 'locale' => 'en_US',
+ 'locale' => envNonEmpty('DEFAULT_LANGUAGE', 'en_US'),
'fallback_locale' => 'en_US',
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
@@ -147,7 +147,7 @@ return [
'PiggyBankForm' => \FireflyIII\Support\Facades\PiggyBankForm::class,
'RuleForm' => \FireflyIII\Support\Facades\RuleForm::class,
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
- 'Twig' => TwigBridge\Facade\Twig::class,
+ 'Twig' => TwigBridge\Facade\Twig::class,
],
diff --git a/config/firefly.php b/config/firefly.php
index 8189a48175..2465dad837 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -135,31 +135,31 @@ return [
'feature_flags' => [
'export' => true,
],
- 'encryption' => null === env('USE_ENCRYPTION') || true === env('USE_ENCRYPTION'),
- 'version' => '5.0.3',
- 'api_version' => '1.0.0',
- 'db_version' => 12,
- 'maxUploadSize' => 15242880,
- 'send_error_message' => env('SEND_ERROR_MESSAGE', true),
- 'site_owner' => env('SITE_OWNER', ''),
- 'send_registration_mail' => env('SEND_REGISTRATION_MAIL', true),
- 'demo_username' => env('DEMO_USERNAME', ''),
- 'demo_password' => env('DEMO_PASSWORD', ''),
- 'is_sandstorm' => env('IS_SANDSTORM', 'unknown'),
- 'bunq_use_sandbox' => env('BUNQ_USE_SANDBOX', false),
- 'fixer_api_key' => env('FIXER_API_KEY', ''),
- 'mapbox_api_key' => env('MAPBOX_API_KEY', ''),
- 'trusted_proxies' => env('TRUSTED_PROXIES', ''),
- 'search_result_limit' => env('SEARCH_RESULT_LIMIT', 50),
- 'send_report_journals' => envNonEmpty('SEND_REPORT_JOURNALS', true),
- 'tracker_site_id' => env('TRACKER_SITE_ID', ''),
- 'tracker_url' => env('TRACKER_URL', ''),
- 'disable_frame_header' => env('DISABLE_FRAME_HEADER', false),
- 'disable_csp_header' => env('DISABLE_CSP_HEADER', false),
- 'login_provider' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'),
- 'cer_provider' => envNonEmpty('CER_PROVIDER', 'fixer'),
- 'update_endpoint' => 'https://version.firefly-iii.org/index.json',
- 'default_location' => [
+ 'encryption' => null === env('USE_ENCRYPTION') || true === env('USE_ENCRYPTION'),
+ 'version' => '5.0.3',
+ 'api_version' => '1.0.0',
+ 'db_version' => 12,
+ 'maxUploadSize' => 15242880,
+ 'send_error_message' => env('SEND_ERROR_MESSAGE', true),
+ 'site_owner' => env('SITE_OWNER', ''),
+ 'send_registration_mail' => env('SEND_REGISTRATION_MAIL', true),
+ 'demo_username' => env('DEMO_USERNAME', ''),
+ 'demo_password' => env('DEMO_PASSWORD', ''),
+ 'is_sandstorm' => env('IS_SANDSTORM', 'unknown'),
+ 'bunq_use_sandbox' => env('BUNQ_USE_SANDBOX', false),
+ 'fixer_api_key' => env('FIXER_API_KEY', ''),
+ 'mapbox_api_key' => env('MAPBOX_API_KEY', ''),
+ 'trusted_proxies' => env('TRUSTED_PROXIES', ''),
+ 'search_result_limit' => env('SEARCH_RESULT_LIMIT', 50),
+ 'send_report_journals' => envNonEmpty('SEND_REPORT_JOURNALS', true),
+ 'tracker_site_id' => env('TRACKER_SITE_ID', ''),
+ 'tracker_url' => env('TRACKER_URL', ''),
+ 'disable_frame_header' => env('DISABLE_FRAME_HEADER', false),
+ 'disable_csp_header' => env('DISABLE_CSP_HEADER', false),
+ 'login_provider' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'),
+ 'cer_provider' => envNonEmpty('CER_PROVIDER', 'fixer'),
+ 'update_endpoint' => 'https://version.firefly-iii.org/index.json',
+ 'default_location' => [
'longitude' => env('MAP_DEFAULT_LONG', '5.916667'),
'latitude' => env('MAP_DEFAULT_LAT', '51.983333'),
'zoom_level' => env('MAP_DEFAULT_ZOOM', '6'),
@@ -313,22 +313,22 @@ return [
*/
'languages' => [
// currently enabled languages
- 'en_US' => ['name_locale' => 'English', 'name_english' => 'English'],
- 'cs_CZ' => ['name_locale' => 'Czech', 'name_english' => 'Czech'],
- 'es_ES' => ['name_locale' => 'Español', 'name_english' => 'Spanish'],
- 'de_DE' => ['name_locale' => 'Deutsch', 'name_english' => 'German'],
- 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French'],
- 'it_IT' => ['name_locale' => 'Italiano', 'name_english' => 'Italian'],
- 'nb_NO' => ['name_locale' => 'Norsk', 'name_english' => 'Norwegian'],
- 'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch'],
- 'pl_PL' => ['name_locale' => 'Polski', 'name_english' => 'Polish '],
- 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)'],
- 'ro_RO' => ['name_locale' => 'Română', 'name_english' => 'Romanian'],
- 'ru_RU' => ['name_locale' => 'Русский', 'name_english' => 'Russian'],
- 'zh_TW' => ['name_locale' => 'Chinese Traditional', 'name_english' => 'Chinese Traditional'],
- 'zh_CN' => ['name_locale' => 'Chinese Simplified', 'name_english' => 'Chinese Simplified'],
- 'hu_HU' => ['name_locale' => 'Hungarian', 'name_english' => 'Hungarian'],
- 'sv_SE' => ['name_locale' => 'Svenska', 'name_english' => 'Swedish'],
+ 'en_US' => ['name_locale' => 'English', 'name_english' => 'English'],
+ 'cs_CZ' => ['name_locale' => 'Czech', 'name_english' => 'Czech'],
+ 'es_ES' => ['name_locale' => 'Español', 'name_english' => 'Spanish'],
+ 'de_DE' => ['name_locale' => 'Deutsch', 'name_english' => 'German'],
+ 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French'],
+ 'it_IT' => ['name_locale' => 'Italiano', 'name_english' => 'Italian'],
+ 'nb_NO' => ['name_locale' => 'Norsk', 'name_english' => 'Norwegian'],
+ 'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch'],
+ 'pl_PL' => ['name_locale' => 'Polski', 'name_english' => 'Polish '],
+ 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)'],
+ 'ro_RO' => ['name_locale' => 'Română', 'name_english' => 'Romanian'],
+ 'ru_RU' => ['name_locale' => 'Русский', 'name_english' => 'Russian'],
+ 'zh_TW' => ['name_locale' => 'Chinese Traditional', 'name_english' => 'Chinese Traditional'],
+ 'zh_CN' => ['name_locale' => 'Chinese Simplified', 'name_english' => 'Chinese Simplified'],
+ 'hu_HU' => ['name_locale' => 'Hungarian', 'name_english' => 'Hungarian'],
+ 'sv_SE' => ['name_locale' => 'Svenska', 'name_english' => 'Swedish'],
// currently disabled languages:
// 'bg_BG' => ['name_locale' => 'Български', 'name_english' => 'Bulgarian'],
@@ -546,7 +546,7 @@ return [
'range' => 200,
],
'default_currency' => 'EUR',
- 'default_language' => 'en_US',
+ 'default_language' => envNonEmpty('DEFAULT_LANGUAGE', 'en_US'),
'search_modifiers' => ['amount_is', 'amount', 'amount_max', 'amount_min', 'amount_less', 'amount_more', 'source', 'destination', 'category',
'budget', 'bill', 'type', 'date', 'date_before', 'date_after', 'on', 'before', 'after', 'from', 'to', 'tag', 'created_on',
'updated_on'],
From 28b7bd4d71ab8608ccd1dae846eafaa8452faa14 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 1 Feb 2020 06:19:12 +0100
Subject: [PATCH 23/75] Improve box for #3071
---
app/Http/Controllers/Json/BoxController.php | 73 +++++++++++++--------
public/v1/js/ff/index.js | 19 ++++--
2 files changed, 62 insertions(+), 30 deletions(-)
diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php
index 07850d61f4..85da86b9d0 100644
--- a/app/Http/Controllers/Json/BoxController.php
+++ b/app/Http/Controllers/Json/BoxController.php
@@ -28,6 +28,7 @@ use FireflyIII\Helpers\Report\NetWorthInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
+use FireflyIII\Models\AvailableBudget;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -49,7 +50,10 @@ class BoxController extends Controller
use RequestInformation;
/**
- * How much money user has available.
+ * This box has three types of info to display:
+ * 0) If the user has available amount this period and has overspent: overspent box.
+ * 1) If the user has available amount this period and has NOT overspent: left to spend box.
+ * 2) if the user has no available amount set this period: spent per day
*
* @return JsonResponse
*/
@@ -59,7 +63,6 @@ class BoxController extends Controller
$repository = app(BudgetRepositoryInterface::class);
/** @var OperationsRepositoryInterface $opsRepository */
$opsRepository = app(OperationsRepositoryInterface::class);
-
/** @var AvailableBudgetRepositoryInterface $abRepository */
$abRepository = app(AvailableBudgetRepositoryInterface::class);
@@ -67,8 +70,11 @@ class BoxController extends Controller
/** @var Carbon $start */
$start = session('start', Carbon::now()->startOfMonth());
/** @var Carbon $end */
- $end = session('end', Carbon::now()->endOfMonth());
- $today = new Carbon;
+ $end = session('end', Carbon::now()->endOfMonth());
+ $today = new Carbon;
+ $display = 2; // see method docs.
+ $boxTitle = (string)trans('firefly.spent');
+
$cache = new CacheProperties;
$cache->addProperty($start);
$cache->addProperty($end);
@@ -77,32 +83,47 @@ class BoxController extends Controller
if ($cache->has()) {
return response()->json($cache->get()); // @codeCoverageIgnore
}
- // get available amount
- $currency = app('amount')->getDefaultCurrency();
- $available = $abRepository->getAvailableBudget($currency, $start, $end);
+ $leftPerDayAmount = '0';
+ $leftToSpendAmount = '0';
- // get spent amount:
- $budgets = $repository->getActiveBudgets();
- $budgetInformation = $opsRepository->collectBudgetInformation($budgets, $start, $end);
- $spent = (string)array_sum(array_column($budgetInformation, 'spent'));
- $left = bcadd($available, $spent);
- $days = $today->diffInDays($end) + 1;
- $perDay = '0';
- $text = (string)trans('firefly.left_to_spend');
- $overspent = false;
- if (bccomp($left, '0') === -1) {
- $text = (string)trans('firefly.overspent');
- $overspent = true;
- }
- if (0 !== $days && bccomp($left, '0') > -1) {
- $perDay = bcdiv($left, (string)$days);
+ $currency = app('amount')->getDefaultCurrency();
+ $availableBudgets = $abRepository->getAvailableBudgetsByDate($start, $end);
+ $availableBudgets = $availableBudgets->filter(
+ static function (AvailableBudget $availableBudget) use ($currency) {
+ if ($availableBudget->transaction_currency_id === $currency->id) {
+ return $availableBudget;
+ }
+
+ return null;
+ }
+ );
+ // spent in this period, in budgets, for default currency.
+ // also calculate spent per day.
+ $spent = $opsRepository->sumExpenses($start, $end, null, null, $currency);
+ $spentAmount = $spent[(int)$currency->id]['sum'] ?? '0';
+ $spentPerDay = '-1';
+ if (1 === $availableBudgets->count()) {
+ $display = 0; // assume user overspent
+ $boxTitle = (string)trans('firefly.overspent');
+ /** @var AvailableBudget $availableBudget */
+ $availableBudget = $availableBudgets->first();
+ // calculate with available budget.
+ $leftToSpendAmount = bcadd($availableBudget->amount, $spentAmount);
+ if (1 === bccomp($leftToSpendAmount, '0')) {
+ $boxTitle = (string)trans('firefly.left_to_spend');
+ $days = $today->diffInDays($end) + 1;
+ $display = 1; // not overspent
+ $leftPerDayAmount = bcdiv($leftToSpendAmount, (string)$days);
+ }
}
$return = [
- 'perDay' => app('amount')->formatAnything($currency, $perDay, false),
- 'left' => app('amount')->formatAnything($currency, $left, false),
- 'text' => $text,
- 'overspent' => $overspent,
+ 'display' => $display,
+ 'spent_total' => app('amount')->formatAnything($currency, $spentAmount, false),
+ 'spent_per_day' => app('amount')->formatAnything($currency, $spentPerDay, false),
+ 'left_to_spend' => app('amount')->formatAnything($currency, $leftToSpendAmount, false),
+ 'left_per_day' => app('amount')->formatAnything($currency, $leftPerDayAmount, false),
+ 'title' => $boxTitle,
];
$cache->store($return);
diff --git a/public/v1/js/ff/index.js b/public/v1/js/ff/index.js
index 0fd754a13c..2b28efbbb1 100644
--- a/public/v1/js/ff/index.js
+++ b/public/v1/js/ff/index.js
@@ -73,12 +73,23 @@ function getNetWorthBox() {
function getAvailableBox() {
// box-left-to-spend
// box-left-per-day
+ // * 0) If the user has available amount this period and has overspent: overspent box.
+ // * 1) If the user has available amount this period and has NOT overspent: left to spend box.
+ // * 2) if the user has no available amount set this period: spent per day
$.getJSON('json/box/available').done(function (data) {
- $('#box-left-to-spend').html(data.left);
- $('#box-left-per-day').html(data.perDay);
- $('#box-left-to-spend-text').text(data.text);
- if(data.overspent === true) {
+ $('#box-left-to-spend-text').text(data.title);
+ if (0 === data.display) {
$('#box-left-to-spend-box').removeClass('bg-green-gradient').addClass('bg-red-gradient');
+ $('#box-left-to-spend').html(data.left_to_spend);
+ $('#box-left-per-day').html(data.left_per_day);
+ }
+ if(1=== data.display) {
+ $('#box-left-to-spend').html(data.left_to_spend);
+ $('#box-left-per-day').html(data.left_per_day);
+ }
+ if(2=== data.display) {
+ $('#box-left-to-spend').html(data.spent_total);
+ $('#box-left-per-day').html(data.spent_per_day);
}
});
}
From 7cdfbc48a9b204ae6461065a45747ef87b38db59 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 1 Feb 2020 06:32:28 +0100
Subject: [PATCH 24/75] Fix #3070
---
app/Http/Controllers/JavascriptController.php | 3 +-
app/Support/Amount.php | 57 ++++++++++++++-----
2 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index 80235b65ae..f2b901bbd6 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -119,9 +119,8 @@ class JavascriptController extends Controller
$currency = app('amount')->getDefaultCurrency();
}
- $localeconv = localeconv();
+ $localeconv = app('amount')->getLocaleInfo();
$accounting = app('amount')->getJsConfig($localeconv);
- $localeconv = localeconv();
$localeconv['frac_digits'] = $currency->decimal_places;
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
/** @noinspection NullPointerExceptionInspection */
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 696373795d..cb192acc22 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -33,6 +33,7 @@ use Preferences as Prefs;
/**
* Class Amount.
+ *
* @codeCoverageIgnore
*/
class Amount
@@ -125,15 +126,11 @@ class Amount
*/
public function formatAnything(TransactionCurrency $format, string $amount, bool $coloured = null): string
{
- $coloured = $coloured ?? true;
- $locale = explode(',', (string)trans('config.locale'));
- $locale = array_map('trim', $locale);
- setlocale(LC_MONETARY, $locale);
+ $coloured = $coloured ?? true;
$float = round($amount, 12);
- $info = localeconv();
+ $info = $this->getLocaleInfo();
$formatted = number_format($float, (int)$format->decimal_places, $info['mon_decimal_point'], $info['mon_thousands_sep']);
- // some complicated switches to format the amount correctly:
$precedes = $amount < 0 ? $info['n_cs_precedes'] : $info['p_cs_precedes'];
$separated = $amount < 0 ? $info['n_sep_by_space'] : $info['p_sep_by_space'];
$space = true === $separated ? ' ' : '';
@@ -168,15 +165,18 @@ class Amount
*/
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, bool $coloured = null): string
{
- $coloured = $coloured ?? true;
- $locale = explode(',', (string)trans('config.locale'));
- $locale = array_map('trim', $locale);
- setlocale(LC_MONETARY, $locale);
+ $coloured = $coloured ?? true;
$float = round($amount, 12);
- $info = localeconv();
+ $info = $this->getLocaleInfo();
$formatted = number_format($float, $decimalPlaces, $info['mon_decimal_point'], $info['mon_thousands_sep']);
// some complicated switches to format the amount correctly:
+ $info['n_cs_precedes'] = (is_bool($info['n_cs_precedes']) && true === $info['n_cs_precedes'])
+ || (is_int($info['n_cs_precedes']) && 1 === $info['n_cs_precedes']);
+
+ $info['p_cs_precedes'] = (is_bool($info['p_cs_precedes']) && true === $info['p_cs_precedes'])
+ || (is_int($info['p_cs_precedes']) && 1 === $info['p_cs_precedes']);
+
$precedes = $amount < 0 ? $info['n_cs_precedes'] : $info['p_cs_precedes'];
$separated = $amount < 0 ? $info['n_sep_by_space'] : $info['p_sep_by_space'];
$space = true === $separated ? ' ' : '';
@@ -204,6 +204,7 @@ class Amount
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
}
+
return TransactionCurrency::orderBy('code', 'ASC')->get();
}
@@ -215,6 +216,7 @@ class Amount
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
}
+
return TransactionCurrency::where('enabled', true)->orderBy('code', 'ASC')->get();
}
@@ -326,8 +328,8 @@ class Amount
*/
public function getJsConfig(array $config): array
{
- $negative = self::getAmountJsConfig(1 === $config['n_sep_by_space'], $config['n_sign_posn'], $config['negative_sign'], 1 === $config['n_cs_precedes']);
- $positive = self::getAmountJsConfig(1 === $config['p_sep_by_space'], $config['p_sign_posn'], $config['positive_sign'], 1 === $config['p_cs_precedes']);
+ $negative = self::getAmountJsConfig($config['n_sep_by_space'], $config['n_sign_posn'], $config['negative_sign'], $config['n_cs_precedes']);
+ $positive = self::getAmountJsConfig($config['p_sep_by_space'], $config['p_sign_posn'], $config['positive_sign'], $config['p_cs_precedes']);
return [
'pos' => $positive,
@@ -336,6 +338,35 @@ class Amount
];
}
+ /**
+ * @return array
+ */
+ public function getLocaleInfo(): array
+ {
+ $locale = explode(',', (string)trans('config.locale'));
+ $locale = array_map('trim', $locale);
+ setlocale(LC_MONETARY, $locale);
+ $info = localeconv();
+ // correct variables
+ $info['n_cs_precedes'] = (is_bool($info['n_cs_precedes']) && true === $info['n_cs_precedes'])
+ || (is_int($info['n_cs_precedes']) && 1 === $info['n_cs_precedes']);
+
+ $info['p_cs_precedes'] = (is_bool($info['p_cs_precedes']) && true === $info['p_cs_precedes'])
+ || (is_int($info['p_cs_precedes']) && 1 === $info['p_cs_precedes']);
+
+ $info['n_sep_by_space'] = (is_bool($info['n_sep_by_space']) && true === $info['n_sep_by_space'])
+ || (is_int($info['n_sep_by_space']) && 1 === $info['n_sep_by_space']);
+
+ $info['p_sep_by_space'] = (is_bool($info['p_sep_by_space']) && true === $info['p_sep_by_space'])
+ || (is_int($info['p_sep_by_space']) && 1 === $info['p_sep_by_space']);
+
+ // n_sep_by_space
+ // p_sep_by_space
+
+ return $info;
+
+ }
+
/**
* @param string $value
*
From 3f6719dc70a7a85ba59072a087ec8cd81f081ec4 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 1 Feb 2020 15:44:03 +0100
Subject: [PATCH 25/75] Add Lando to readme.
---
readme.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/readme.md b/readme.md
index 2002b6b20a..42b36f226d 100644
--- a/readme.md
+++ b/readme.md
@@ -122,6 +122,7 @@ There are many ways to run Firefly III
4. You can [install it using Softaculous](https://softaculous.com/). These guys even have made [another demo site](https://www.softaculous.com/softaculous/apps/others/Firefly_III)!
5. You can [install it using AMPPS](https://www.ampps.com/).
6. You can [install it on Cloudron](https://cloudron.io/store/org.fireflyiii.cloudronapp.html).
+7. You can [install it on Lando](https://gist.github.com/ArtisKrumins/ccb24f31d6d4872b57e7c9343a9d1bf0).
## Contributing
From cf4adae604b617270970cee62ac88b8eb7843fc9 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 1 Feb 2020 15:54:26 +0100
Subject: [PATCH 26/75] Refactor category chart code.
---
.../Controllers/Chart/CategoryController.php | 90 ++++----
.../Controllers/Chart/CategoryController.php | 213 ++++++++----------
.../Controllers/Report/BudgetController.php | 16 +-
.../Controllers/Report/CategoryController.php | 140 ++----------
.../Category/NoCategoryRepository.php | 30 ++-
5 files changed, 202 insertions(+), 287 deletions(-)
diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php
index 01763fff93..ce26a0b469 100644
--- a/app/Api/V1/Controllers/Chart/CategoryController.php
+++ b/app/Api/V1/Controllers/Chart/CategoryController.php
@@ -90,12 +90,12 @@ class CategoryController extends Controller
$tempData = [];
$spentWith = $this->opsRepository->listExpenses($start, $end);
$earnedWith = $this->opsRepository->listIncome($start, $end);
- $spentWithout = $this->noCatRepository->listExpenses($start, $end);
- $earnedWithout = $this->noCatRepository->listIncome($start, $end);
+ $spentWithout = $this->noCatRepository->listExpenses($start, $end); // refactored
+ $earnedWithout = $this->noCatRepository->listIncome($start, $end); // refactored
$categories = [];
- foreach ([$spentWith, $earnedWith] as $set) {
+ foreach ([$spentWith, $earnedWith, $spentWithout, $earnedWithout] as $set) {
foreach ($set as $currency) {
foreach ($currency['categories'] as $category) {
$categories[] = $category['name'];
@@ -141,48 +141,48 @@ class CategoryController extends Controller
}
}
- foreach ([$spentWithout, $earnedWithout] as $set) {
- foreach ($set as $currency) {
- $inKey = sprintf('%d-i', $currency['currency_id']);
- $outKey = sprintf('%d-e', $currency['currency_id']);
- $categories[] = (string)trans('firefly.no_category');
- // make data arrays if not yet present.
- $tempData[$inKey] = $tempData[$inKey] ?? [
- 'currency_id' => $currency['currency_id'],
- 'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
- 'currency_code' => $currency['currency_code'],
- 'currency_symbol' => $currency['currency_symbol'],
- 'currency_decimal_places' => $currency['currency_decimal_places'],
- 'type' => 'bar', // line, area or bar
- 'yAxisID' => 0, // 0, 1, 2
- 'entries' => [
- // per category:
- // "category" => 5,
- ],
- ];
- $tempData[$outKey] = $tempData[$outKey] ?? [
- 'currency_id' => $currency['currency_id'],
- 'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
- 'currency_code' => $currency['currency_code'],
- 'currency_symbol' => $currency['currency_symbol'],
- 'currency_decimal_places' => $currency['currency_decimal_places'],
- 'type' => 'bar', // line, area or bar
- 'yAxisID' => 0, // 0, 1, 2
- 'entries' => [
- // per category:
- // "category" => 5,
- ],
- ];
- foreach ($currency['transaction_journals'] as $journal) {
- // is it expense or income?
- $letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';
- $currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);
- $name = (string)trans('firefly.no_category');
- $tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
- $tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
- }
- }
- }
+// foreach ([] as $set) {
+// foreach ($set as $currency) {
+// $inKey = sprintf('%d-i', $currency['currency_id']);
+// $outKey = sprintf('%d-e', $currency['currency_id']);
+// $categories[] = (string)trans('firefly.no_category');
+// // make data arrays if not yet present.
+// $tempData[$inKey] = $tempData[$inKey] ?? [
+// 'currency_id' => $currency['currency_id'],
+// 'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
+// 'currency_code' => $currency['currency_code'],
+// 'currency_symbol' => $currency['currency_symbol'],
+// 'currency_decimal_places' => $currency['currency_decimal_places'],
+// 'type' => 'bar', // line, area or bar
+// 'yAxisID' => 0, // 0, 1, 2
+// 'entries' => [
+// // per category:
+// // "category" => 5,
+// ],
+// ];
+// $tempData[$outKey] = $tempData[$outKey] ?? [
+// 'currency_id' => $currency['currency_id'],
+// 'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
+// 'currency_code' => $currency['currency_code'],
+// 'currency_symbol' => $currency['currency_symbol'],
+// 'currency_decimal_places' => $currency['currency_decimal_places'],
+// 'type' => 'bar', // line, area or bar
+// 'yAxisID' => 0, // 0, 1, 2
+// 'entries' => [
+// // per category:
+// // "category" => 5,
+// ],
+// ];
+// foreach ($currency['transaction_journals'] as $journal) {
+// // is it expense or income?
+// $letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';
+// $currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);
+// $name = (string)trans('firefly.no_category');
+// $tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
+// $tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
+// }
+// }
+// }
// re-sort every spent array and add 0 for missing entries.
foreach ($tempData as $index => $set) {
diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php
index d5e73c1ea1..21ae827a07 100644
--- a/app/Http/Controllers/Chart/CategoryController.php
+++ b/app/Http/Controllers/Chart/CategoryController.php
@@ -134,7 +134,9 @@ class CategoryController extends Controller
$currencies = [];
$tempData = [];
$categories = $repository->getCategories();
- $accounts = $accountRepository->getAccountsByType([AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::ASSET, AccountType::DEFAULT]);
+ $accounts = $accountRepository->getAccountsByType(
+ [AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::ASSET, AccountType::DEFAULT]
+ );
/** @var Category $category */
foreach ($categories as $category) {
@@ -229,68 +231,8 @@ class CategoryController extends Controller
if ($cache->has()) {
return response()->json($cache->get());// @codeCoverageIgnore
}
+ $data = $this->reportPeriodChart($accounts, $start, $end, $category);
- /** @var OperationsRepositoryInterface $opsRepository */
- $opsRepository = app(OperationsRepositoryInterface::class);
-
-
- // this gives us all currencies
- $collection = new Collection([$category]);
- $expenses = $opsRepository->listExpenses($start, $end, null, $collection);
- $income = $opsRepository->listIncome($start, $end, null, $collection);
- $currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
- $periods = app('navigation')->listOfPeriods($start, $end);
- $format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
- $chartData = [];
- // make empty data array:
- // double foreach (bad) to make empty array:
- foreach ($currencies as $currencyId) {
- $currencyInfo = $expenses[$currencyId] ?? $income[$currencyId];
- $outKey = sprintf('%d-out', $currencyId);
- $inKey = sprintf('%d-in', $currencyId);
- $chartData[$outKey]
- = [
- 'label' => sprintf('%s (%s)', (string)trans('firefly.spent'), $currencyInfo['currency_name']),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
- ];
-
- $chartData[$inKey]
- = [
- 'label' => sprintf('%s (%s)', (string)trans('firefly.earned'), $currencyInfo['currency_name']),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
- ];
-
-
- // loop empty periods:
- foreach (array_keys($periods) as $period) {
- $label = $periods[$period];
- $chartData[$outKey]['entries'][$label] = '0';
- $chartData[$inKey]['entries'][$label] = '0';
- }
- // loop income and expenses for this category.:
- $outSet = $expenses[$currencyId]['categories'][$category->id] ?? ['transaction_journals' => []];
- foreach ($outSet['transaction_journals'] as $journal) {
- $amount = app('steam')->positive($journal['amount']);
- $date = $journal['date']->formatLocalized($format);
- $chartData[$outKey]['entries'][$date] = $chartData[$outKey]['entries'][$date] ?? '0';
-
- $chartData[$outKey]['entries'][$date] = bcadd($amount, $chartData[$outKey]['entries'][$date]);
- }
-
- $inSet = $income[$currencyId]['categories'][$category->id] ?? ['transaction_journals' => []];
- foreach ($inSet['transaction_journals'] as $journal) {
- $amount = app('steam')->positive($journal['amount']);
- $date = $journal['date']->formatLocalized($format);
- $chartData[$inKey]['entries'][$date] = $chartData[$inKey]['entries'][$date] ?? '0';
- $chartData[$inKey]['entries'][$date] = bcadd($amount, $chartData[$inKey]['entries'][$date]);
- }
- }
-
- $data = $this->generator->multiSet($chartData);
$cache->store($data);
return response()->json($data);
@@ -317,64 +259,8 @@ class CategoryController extends Controller
if ($cache->has()) {
return response()->json($cache->get()); // @codeCoverageIgnore
}
+ $data = $this->reportPeriodChart($accounts, $start, $end, null);
- /** @var NoCategoryRepositoryInterface $noCatRepository */
- $noCatRepository = app(NoCategoryRepositoryInterface::class);
-
- // this gives us all currencies
- $expenses = $noCatRepository->listExpenses($start, $end, $accounts);
- $income = $noCatRepository->listIncome($start, $end, $accounts);
- $currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
- $periods = app('navigation')->listOfPeriods($start, $end);
- $format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
- $chartData = [];
- // make empty data array:
- // double foreach (bad) to make empty array:
- foreach ($currencies as $currencyId) {
- $currencyInfo = $expenses[$currencyId] ?? $income[$currencyId];
- $outKey = sprintf('%d-out', $currencyId);
- $inKey = sprintf('%d-in', $currencyId);
-
- $chartData[$outKey]
- = [
- 'label' => sprintf('%s (%s)', (string)trans('firefly.spent'), $currencyInfo['currency_name']),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
- ];
-
- $chartData[$inKey]
- = [
- 'label' => sprintf('%s (%s)', (string)trans('firefly.earned'), $currencyInfo['currency_name']),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
- ];
-
- // loop empty periods:
- foreach (array_keys($periods) as $period) {
- $label = $periods[$period];
- $chartData[$outKey]['entries'][$label] = '0';
- $chartData[$inKey]['entries'][$label] = '0';
- }
- // loop income and expenses:
- $outSet = $expenses[$currencyId] ?? ['transaction_journals' => []];
- foreach ($outSet['transaction_journals'] as $journal) {
- $amount = app('steam')->positive($journal['amount']);
- $date = $journal['date']->formatLocalized($format);
- $chartData[$outKey]['entries'][$date] = $chartData[$outKey]['entries'][$date] ?? '0';
- $chartData[$outKey]['entries'][$date] = bcadd($amount, $chartData[$outKey]['entries'][$date]);
- }
-
- $inSet = $income[$currencyId] ?? ['transaction_journals' => []];
- foreach ($inSet['transaction_journals'] as $journal) {
- $amount = app('steam')->positive($journal['amount']);
- $date = $journal['date']->formatLocalized($format);
- $chartData[$inKey]['entries'][$date] = $chartData[$inKey]['entries'][$date] ?? '0';
- $chartData[$inKey]['entries'][$date] = bcadd($amount, $chartData[$inKey]['entries'][$date]);
- }
- }
- $data = $this->generator->multiSet($chartData);
$cache->store($data);
return response()->json($data);
@@ -436,4 +322,93 @@ class CategoryController extends Controller
return $carbon;
}
+
+ /**
+ * Generate report chart for either with or without category.
+ *
+ * @param Collection $accounts
+ * @param Carbon $start
+ * @param Carbon $end
+ * @param Category $category
+ *
+ * @return array
+ */
+ private function reportPeriodChart(Collection $accounts, Carbon $start, Carbon $end, ?Category $category): array
+ {
+ $income = [];
+ $expenses = [];
+ $categoryId = 0;
+ if (null === $category) {
+ /** @var NoCategoryRepositoryInterface $noCatRepository */
+ $noCatRepository = app(NoCategoryRepositoryInterface::class);
+
+ // this gives us all currencies
+ $expenses = $noCatRepository->listExpenses($start, $end, $accounts);
+ $income = $noCatRepository->listIncome($start, $end, $accounts);
+ }
+
+ if (null !== $category) {
+ /** @var OperationsRepositoryInterface $opsRepository */
+ $opsRepository = app(OperationsRepositoryInterface::class);
+ $categoryId = (int)$category->id;
+ // this gives us all currencies
+ $collection = new Collection([$category]);
+ $expenses = $opsRepository->listExpenses($start, $end, null, $collection);
+ $income = $opsRepository->listIncome($start, $end, null, $collection);
+
+ }
+ $currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
+ $periods = app('navigation')->listOfPeriods($start, $end);
+ $format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
+ $chartData = [];
+ // make empty data array:
+ // double foreach (bad) to make empty array:
+ foreach ($currencies as $currencyId) {
+ $currencyInfo = $expenses[$currencyId] ?? $income[$currencyId];
+ $outKey = sprintf('%d-out', $currencyId);
+ $inKey = sprintf('%d-in', $currencyId);
+ $chartData[$outKey]
+ = [
+ 'label' => sprintf('%s (%s)', (string)trans('firefly.spent'), $currencyInfo['currency_name']),
+ 'entries' => [],
+ 'type' => 'bar',
+ 'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
+ ];
+
+ $chartData[$inKey]
+ = [
+ 'label' => sprintf('%s (%s)', (string)trans('firefly.earned'), $currencyInfo['currency_name']),
+ 'entries' => [],
+ 'type' => 'bar',
+ 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
+ ];
+
+
+ // loop empty periods:
+ foreach (array_keys($periods) as $period) {
+ $label = $periods[$period];
+ $chartData[$outKey]['entries'][$label] = '0';
+ $chartData[$inKey]['entries'][$label] = '0';
+ }
+ // loop income and expenses for this category.:
+ $outSet = $expenses[$currencyId]['categories'][$categoryId] ?? ['transaction_journals' => []];
+ foreach ($outSet['transaction_journals'] as $journal) {
+ $amount = app('steam')->positive($journal['amount']);
+ $date = $journal['date']->formatLocalized($format);
+ $chartData[$outKey]['entries'][$date] = $chartData[$outKey]['entries'][$date] ?? '0';
+
+ $chartData[$outKey]['entries'][$date] = bcadd($amount, $chartData[$outKey]['entries'][$date]);
+ }
+
+ $inSet = $income[$currencyId]['categories'][$categoryId] ?? ['transaction_journals' => []];
+ foreach ($inSet['transaction_journals'] as $journal) {
+ $amount = app('steam')->positive($journal['amount']);
+ $date = $journal['date']->formatLocalized($format);
+ $chartData[$inKey]['entries'][$date] = $chartData[$inKey]['entries'][$date] ?? '0';
+ $chartData[$inKey]['entries'][$date] = bcadd($amount, $chartData[$inKey]['entries'][$date]);
+ }
+ }
+
+ return $this->generator->multiSet($chartData);
+ }
}
diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php
index 94a8bcdcc7..7ed503d63a 100644
--- a/app/Http/Controllers/Report/BudgetController.php
+++ b/app/Http/Controllers/Report/BudgetController.php
@@ -300,7 +300,6 @@ class BudgetController extends Controller
$report[$budgetId]['currencies'][$currencyId]['sum_pct'] = $pct;
}
}
-
return view('reports.budget.partials.budgets', compact('sums', 'report'));
}
@@ -381,6 +380,7 @@ class BudgetController extends Controller
}
}
+
// add no budget info.
$report['budgets'][0] = $report['budgets'][0] ?? [
'budget_id' => null,
@@ -408,8 +408,19 @@ class BudgetController extends Controller
];
$report['sums'][$noBudgetEntry['currency_id']]['spent']
= bcadd($report['sums'][$noBudgetEntry['currency_id']]['spent'] ?? '0', $noBudgetEntry['sum']);
- }
+ // append currency info because it may be missing:
+ $report['sums'][$noBudgetEntry['currency_id']]['currency_id'] = (int)($noBudgetEntry['currency_id'] ?? $defaultCurrency->id);
+ $report['sums'][$noBudgetEntry['currency_id']]['currency_code'] = $noBudgetEntry['currency_code'] ?? $defaultCurrency->code;
+ $report['sums'][$noBudgetEntry['currency_id']]['currency_name'] = $noBudgetEntry['currency_name'] ?? $defaultCurrency->name;
+ $report['sums'][$noBudgetEntry['currency_id']]['currency_symbol'] = $noBudgetEntry['currency_symbol'] ?? $defaultCurrency->symbol;
+ $report['sums'][$noBudgetEntry['currency_id']]['currency_decimal_places'] = $noBudgetEntry['currency_decimal_places'] ?? $defaultCurrency->decimal_places;
+ // append other sums because they might be missing:
+ $report['sums'][$noBudgetEntry['currency_id']]['overspent'] = $report['sums'][$noBudgetEntry['currency_id']]['overspent'] ?? '0';
+ $report['sums'][$noBudgetEntry['currency_id']]['left'] = $report['sums'][$noBudgetEntry['currency_id']]['left'] ?? '0';
+ $report['sums'][$noBudgetEntry['currency_id']]['budgeted'] = $report['sums'][$noBudgetEntry['currency_id']]['budgeted'] ?? '0';
+
+ }
// make percentages based on total amount.
foreach ($report['budgets'] as $budgetId => $data) {
foreach ($data['budget_limits'] as $limitId => $entry) {
@@ -434,6 +445,7 @@ class BudgetController extends Controller
$report['budgets'][$budgetId]['budget_limits'][$limitId]['budgeted_pct'] = $budgetedPct;
}
}
+ //var_dump($report);exit;
return view('reports.partials.budgets', compact('report'))->render();
}
diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php
index 554a996465..96b7feb93a 100644
--- a/app/Http/Controllers/Report/CategoryController.php
+++ b/app/Http/Controllers/Report/CategoryController.php
@@ -517,8 +517,8 @@ class CategoryController extends Controller
$data = [];
$with = $opsRepository->listExpenses($start, $end, $accounts);
$without = $noCatRepos->listExpenses($start, $end, $accounts);
-
- foreach ($with as $currencyId => $currencyRow) {
+ foreach([$with, $without] as $set) {
+ foreach ($set as $currencyId => $currencyRow) {
foreach ($currencyRow['categories'] as $categoryId => $categoryRow) {
$key = sprintf('%d-%d', $currencyId, $categoryId);
$data[$key] = $data[$key] ?? [
@@ -541,26 +541,8 @@ class CategoryController extends Controller
}
}
}
- foreach ($without as $currencyId => $currencyRow) {
- $key = sprintf('0-%d', $currencyId);
- $data[$key] = $data[$key] ?? [
- 'id' => 0,
- 'title' => sprintf('%s (%s)', trans('firefly.noCategory'), $currencyRow['currency_name']),
- 'currency_id' => $currencyRow['currency_id'],
- 'currency_symbol' => $currencyRow['currency_symbol'],
- 'currency_name' => $currencyRow['currency_name'],
- 'currency_code' => $currencyRow['currency_code'],
- 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
- 'sum' => '0',
- 'entries' => [],
- ];
- foreach ($currencyRow['transaction_journals'] as $journalId => $journal) {
- $date = $journal['date']->format($format);
- $data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
- $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
- $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']);
- }
}
+
$cache->store($data);
$report = $data;
@@ -621,50 +603,31 @@ class CategoryController extends Controller
$data = [];
$with = $opsRepository->listIncome($start, $end, $accounts);
$without = $noCatRepos->listIncome($start, $end, $accounts);
+ foreach([$with, $without] as $set) {
+ foreach ($set as $currencyId => $currencyRow) {
+ foreach ($currencyRow['categories'] as $categoryId => $categoryRow) {
+ $key = sprintf('%d-%d', $currencyId, $categoryId);
+ $data[$key] = $data[$key] ?? [
+ 'id' => $categoryRow['id'],
+ 'title' => sprintf('%s (%s)', $categoryRow['name'], $currencyRow['currency_name']),
+ 'currency_id' => $currencyRow['currency_id'],
+ 'currency_symbol' => $currencyRow['currency_symbol'],
+ 'currency_name' => $currencyRow['currency_name'],
+ 'currency_code' => $currencyRow['currency_code'],
+ 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
+ 'sum' => '0',
+ 'entries' => [],
- foreach ($with as $currencyId => $currencyRow) {
- foreach ($currencyRow['categories'] as $categoryId => $categoryRow) {
- $key = sprintf('%d-%d', $currencyId, $categoryId);
- $data[$key] = $data[$key] ?? [
- 'id' => $categoryRow['id'],
- 'title' => sprintf('%s (%s)', $categoryRow['name'], $currencyRow['currency_name']),
- 'currency_id' => $currencyRow['currency_id'],
- 'currency_symbol' => $currencyRow['currency_symbol'],
- 'currency_name' => $currencyRow['currency_name'],
- 'currency_code' => $currencyRow['currency_code'],
- 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
- 'sum' => '0',
- 'entries' => [],
-
- ];
- foreach ($categoryRow['transaction_journals'] as $journalId => $journal) {
- $date = $journal['date']->format($format);
- $data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
- $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
- $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']);
+ ];
+ foreach ($categoryRow['transaction_journals'] as $journalId => $journal) {
+ $date = $journal['date']->format($format);
+ $data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
+ $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
+ $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']);
+ }
}
}
}
- foreach ($without as $currencyId => $currencyRow) {
- $key = sprintf('0-%d', $currencyId);
- $data[$key] = $data[$key] ?? [
- 'id' => 0,
- 'title' => sprintf('%s (%s)', trans('firefly.noCategory'), $currencyRow['currency_name']),
- 'currency_id' => $currencyRow['currency_id'],
- 'currency_symbol' => $currencyRow['currency_symbol'],
- 'currency_name' => $currencyRow['currency_name'],
- 'currency_code' => $currencyRow['currency_code'],
- 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
- 'sum' => '0',
- 'entries' => [],
- ];
- foreach ($currencyRow['transaction_journals'] as $journalId => $journal) {
- $date = $journal['date']->format($format);
- $data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
- $data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
- $data[$key]['sum'] = bcadd($data[$key]['sum'], $journal['amount']);
- }
- }
$cache->store($data);
$report = $data;
@@ -725,8 +688,7 @@ class CategoryController extends Controller
];
// needs four for-each loops.
- // TODO improve this.
- foreach ([$earnedWith, $spentWith] as $data) {
+ foreach ([$earnedWith, $spentWith, $earnedWithout, $spentWithout] as $data) {
foreach ($data as $currencyId => $currencyRow) {
$report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
'spent' => '0',
@@ -781,58 +743,6 @@ class CategoryController extends Controller
}
}
}
- foreach ([$earnedWithout, $spentWithout] as $data) {
- foreach ($data as $currencyId => $currencyRow) {
- $report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
- 'spent' => '0',
- 'earned' => '0',
- 'sum' => '0',
- 'currency_id' => $currencyRow['currency_id'],
- 'currency_symbol' => $currencyRow['currency_symbol'],
- 'currency_name' => $currencyRow['currency_name'],
- 'currency_code' => $currencyRow['currency_code'],
- 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
- ];
- $key = sprintf('%s-0', $currencyId);
- $report['categories'][$key] = $report['categories'][$key] ?? [
- 'id' => 0,
- 'title' => sprintf('%s (%s)', trans('firefly.noCategory'), $currencyRow['currency_name']),
- 'currency_id' => $currencyRow['currency_id'],
- 'currency_symbol' => $currencyRow['currency_symbol'],
- 'currency_name' => $currencyRow['currency_name'],
- 'currency_code' => $currencyRow['currency_code'],
- 'currency_decimal_places' => $currencyRow['currency_decimal_places'],
- 'spent' => '0',
- 'earned' => '0',
- 'sum' => '0',
- ];
- // loop journals:
- foreach ($currencyRow['transaction_journals'] as $journal) {
- // sum of all
- $report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $journal['amount']);
-
- // sum of spent:
- $report['sums'][$currencyId]['spent'] = -1 === bccomp($journal['amount'], '0') ? bcadd(
- $report['sums'][$currencyId]['spent'], $journal['amount']
- ) : $report['sums'][$currencyId]['spent'];
- // sum of earned
- $report['sums'][$currencyId]['earned'] = 1 === bccomp($journal['amount'], '0') ? bcadd(
- $report['sums'][$currencyId]['earned'], $journal['amount']
- ) : $report['sums'][$currencyId]['earned'];
-
- // sum of category
- $report['categories'][$key]['sum'] = bcadd($report['categories'][$key]['sum'], $journal['amount']);
- // total spent in no category
- $report['categories'][$key]['spent'] = -1 === bccomp($journal['amount'], '0') ? bcadd(
- $report['categories'][$key]['spent'], $journal['amount']
- ) : $report['categories'][$key]['spent'];
- // total earned in no category
- $report['categories'][$key]['earned'] = 1 === bccomp($journal['amount'], '0') ? bcadd(
- $report['categories'][$key]['earned'], $journal['amount']
- ) : $report['categories'][$key]['earned'];
- }
- }
- }
// @codeCoverageIgnoreStart
try {
diff --git a/app/Repositories/Category/NoCategoryRepository.php b/app/Repositories/Category/NoCategoryRepository.php
index 4f0c1c9fb2..8fd1845fa6 100644
--- a/app/Repositories/Category/NoCategoryRepository.php
+++ b/app/Repositories/Category/NoCategoryRepository.php
@@ -76,17 +76,25 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface
foreach ($journals as $journal) {
$currencyId = (int)$journal['currency_id'];
$array[$currencyId] = $array[$currencyId] ?? [
- 'transaction_journals' => [],
+ 'categories' => [],
'currency_id' => $currencyId,
'currency_name' => $journal['currency_name'],
'currency_symbol' => $journal['currency_symbol'],
'currency_code' => $journal['currency_code'],
'currency_decimal_places' => $journal['currency_decimal_places'],
];
+ // info about the non-existent category:
+ $array[$currencyId]['categories'][0] = $array[$currencyId]['categories'][0] ?? [
+ 'id' => 0,
+ 'name' => (string)trans('firefly.noCategory'),
+ 'transaction_journals' => [],
+ ];
+
// add journal to array:
// only a subset of the fields.
- $journalId = (int)$journal['transaction_journal_id'];
- $array[$currencyId]['transaction_journals'][$journalId] = [
+ $journalId = (int)$journal['transaction_journal_id'];
+ $array[$currencyId]['categories'][0]['transaction_journals'][$journalId]
+ = [
'amount' => app('steam')->negative($journal['amount']),
'date' => $journal['date'],
];
@@ -121,17 +129,27 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface
foreach ($journals as $journal) {
$currencyId = (int)$journal['currency_id'];
$array[$currencyId] = $array[$currencyId] ?? [
- 'transaction_journals' => [],
+ 'categories' => [],
'currency_id' => $currencyId,
'currency_name' => $journal['currency_name'],
'currency_symbol' => $journal['currency_symbol'],
'currency_code' => $journal['currency_code'],
'currency_decimal_places' => $journal['currency_decimal_places'],
];
+
+ // info about the non-existent category:
+ $array[$currencyId]['categories'][0] = $array[$currencyId]['categories'][0] ?? [
+ 'id' => 0,
+ 'name' => (string)trans('firefly.noCategory'),
+ 'transaction_journals' => [],
+ ];
+
+
// add journal to array:
// only a subset of the fields.
- $journalId = (int)$journal['transaction_journal_id'];
- $array[$currencyId]['transaction_journals'][$journalId] = [
+ $journalId = (int)$journal['transaction_journal_id'];
+ $array[$currencyId]['categories'][0]['transaction_journals'][$journalId]
+ = [
'amount' => app('steam')->positive($journal['amount']),
'date' => $journal['date'],
];
From fb574cb17319660a032f0c956b69c6c951b7a9e4 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 1 Feb 2020 15:54:36 +0100
Subject: [PATCH 27/75] Expand changelog.
---
changelog.md | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/changelog.md b/changelog.md
index 2bfa862f6e..2844b31494 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,21 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
+## [5.1.0 (API 1.0.0)] - 2020-02-xx
+
+### Added
+- #2575 Create a transaction from a rule.
+- Firefly III will generate a unique installation ID for itself.
+
+### Changed
+- #3050 Date blocks were rendered badly
+- #3066 New tag overview. Not yet sure what works best.
+
+### Fixed
+- #3045 Linking bills to liability accounts through rules was broken.
+- #3042 Rule engine behavior was inconsistent when importing data.
+- #3064 Weird bug in reports.
+
## [5.0.3 (API 1.0.0)] - 2020-01-30
This release fixes several bugs found in 5.0.0 and earlier releases.
From 7f3522339c1af5e3cc9687744ab362466a64b2cd Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sun, 2 Feb 2020 10:39:37 +0100
Subject: [PATCH 28/75] Simplify update check.
---
.../Events/VersionCheckEventHandler.php | 20 +--
app/Helpers/Update/UpdateTrait.php | 84 +--------
.../Controllers/Admin/UpdateController.php | 46 +----
.../FireflyIIIOrg/Update/UpdateRequest.php | 164 ++++++++++++++++--
.../Update/UpdateRequestInterface.php | 3 +-
config/firefly.php | 1 +
public/v1/js/ff/admin/update/index.js | 14 --
resources/lang/en_US/firefly.php | 6 +-
resources/views/v1/admin/update/index.twig | 2 +-
9 files changed, 173 insertions(+), 167 deletions(-)
diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php
index d8f97883ea..a1c57662a8 100644
--- a/app/Handlers/Events/VersionCheckEventHandler.php
+++ b/app/Handlers/Events/VersionCheckEventHandler.php
@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events;
+use Carbon\Carbon;
use FireflyIII\Events\RequestedVersionCheckStatus;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Update\UpdateTrait;
@@ -55,7 +56,6 @@ class VersionCheckEventHandler
$value = (int)$permission->data;
if (1 !== $value) {
Log::info('Update check is not enabled.');
-
return;
}
@@ -65,7 +65,6 @@ class VersionCheckEventHandler
$user = $event->user;
if (!$repository->hasRole($user, 'owner')) {
Log::debug('User is not admin, done.');
-
return;
}
@@ -76,26 +75,13 @@ class VersionCheckEventHandler
Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < 604800) {
Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)));
-
return;
}
// last check time was more than a week ago.
Log::debug('Have not checked for a new version in a week!');
- try {
- $latestRelease = $this->getLatestRelease();
- } catch (FireflyException $e) {
- Log::error($e);
- session()->flash('error', (string)trans('firefly.update_check_error'));
+ $release = $this->getLatestRelease();
- // softfail.
- return;
- }
- $versionCheck = $this->versionCheck($latestRelease);
- $resultString = $this->parseResult($versionCheck, $latestRelease);
- if (0 !== $versionCheck && '' !== $resultString) {
- // flash info
- session()->flash('info', $resultString);
- }
+ session()->flash($release['level'], $release['message']);
app('fireflyconfig')->set('last_update_check', time());
}
}
diff --git a/app/Helpers/Update/UpdateTrait.php b/app/Helpers/Update/UpdateTrait.php
index de1f82f4b6..dc3610ee07 100644
--- a/app/Helpers/Update/UpdateTrait.php
+++ b/app/Helpers/Update/UpdateTrait.php
@@ -23,8 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Update;
-use Carbon\Carbon;
-use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
use Log;
@@ -35,10 +33,11 @@ use Log;
trait UpdateTrait
{
/**
- * Get object for the latest release from GitHub.
+ * Returns an array with info on the next release, if any.
+ * 'message' => 'A new version is available.
+ * 'level' => 'info' / 'success' / 'error'
*
* @return array
- * @throws FireflyException
*/
public function getLatestRelease(): array
{
@@ -47,81 +46,6 @@ trait UpdateTrait
$checker = app(UpdateRequestInterface::class);
$channel = app('fireflyconfig')->get('update_channel', 'stable')->data;
- return $checker->getVersion($channel);
- }
-
- /**
- * Parses the version check result in a human readable sentence.
- *
- * @param int $versionCheck
- * @param array $information
- *
- * @return string
- */
- public function parseResult(int $versionCheck, array $information): string
- {
- Log::debug(sprintf('Now in parseResult(%d)', $versionCheck));
- $current = (string)config('firefly.version');
- $return = '';
- $triggered = false;
- if (-1 === $versionCheck) {
- $triggered = true;
- $monthAndDayFormat = (string)trans('config.month_and_day');
- $carbon = Carbon::createFromFormat('Y-m-d', $information['date']);
- $return = (string)trans(
- 'firefly.update_new_version_alert',
- [
- 'your_version' => $current,
- 'new_version' => $information['version'],
- 'date' => $carbon->formatLocalized($monthAndDayFormat),
- ]
- );
- // append warning if beta or alpha.
- $isBeta = $information['is_beta'] ?? false;
- if (true === $isBeta) {
- $return = sprintf('%s %s', $return, trans('firefly.update_version_beta'));
- }
-
- $isAlpha = $information['is_alpha'] ?? false;
- if (true === $isAlpha) {
- $return = sprintf('%s %s', $return, trans('firefly.update_version_alpha'));
- }
- }
-
- if (0 === $versionCheck) {
- $triggered = true;
- Log::debug('User is running current version.');
- // you are running the current version!
- $return = (string)trans('firefly.update_current_version_alert', ['version' => $current]);
- }
- if (1 === $versionCheck) {
- $triggered = true;
- Log::debug('User is running NEWER version.');
- // you are running a newer version!
- $return = (string)trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $information['version']]);
- }
- if (false === $triggered) {
- Log::debug('No option was triggered.');
- $return = (string)trans('firefly.update_check_error');
- }
-
- return $return;
- }
-
- /**
- * Compare version and store result.
- *
- * @param array $information
- *
- * @return int
- */
- public function versionCheck(array $information): int
- {
- Log::debug('Now in versionCheck()');
- $current = (string)config('firefly.version');
- $check = version_compare($current, $information['version']);
- Log::debug(sprintf('Comparing %s with %s, result is %s', $current, $information['version'], $check), $information);
-
- return $check;
+ return $checker->getUpdateInformation($channel);
}
}
diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php
index 7a8bfbb242..620ccb7565 100644
--- a/app/Http/Controllers/Admin/UpdateController.php
+++ b/app/Http/Controllers/Admin/UpdateController.php
@@ -23,14 +23,12 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
-use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Update\UpdateTrait;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Middleware\IsSandStormUser;
-use Illuminate\Http\JsonResponse;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
-use Log;
/**
* Class HomeController.
@@ -110,46 +108,12 @@ class UpdateController extends Controller
/**
* Does a manual update check.
*/
- public function updateCheck(): JsonResponse
+ public function updateCheck(): RedirectResponse
{
- $success = true;
- $latestRelease = '1.0';
- $resultString = '';
- $versionCheck = -2;
- $channel = app('fireflyconfig')->get('update_channel', 'stable')->data;
+ $release = $this->getLatestRelease();
- try {
- $latestRelease = $this->getLatestRelease();
- } catch (FireflyException $e) {
- Log::error($e->getMessage());
- $success = false;
- }
+ session()->flash($release['level'], $release['message']);
- // if error, tell the user.
- if (false === $success) {
- $resultString = (string)trans('firefly.update_check_error');
- session()->flash('error', $resultString);
- }
-
- // if not, compare and tell the user.
- if (true === $success) {
- $versionCheck = $this->versionCheck($latestRelease);
- $resultString = $this->parseResult($versionCheck, $latestRelease);
- }
-
- Log::debug(sprintf('Result string is: "%s"', $resultString));
-
- if (0 !== $versionCheck && '' !== $resultString) {
- // flash info
- session()->flash('info', $resultString);
- }
- app('fireflyconfig')->set('last_update_check', time());
-
- return response()->json(
- [
- 'result' => $resultString,
- 'channel' => $channel,
- ]
- );
+ return redirect(route('admin.update-check'));
}
}
diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php
index fc318675bc..dd728f6ec4 100644
--- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php
+++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php
@@ -21,8 +21,8 @@
namespace FireflyIII\Services\FireflyIIIOrg\Update;
+use Carbon\Carbon;
use Exception;
-use FireflyIII\Exceptions\FireflyException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use JsonException;
@@ -38,14 +38,135 @@ class UpdateRequest implements UpdateRequestInterface
* @param string $channel
*
* @return array
- * @throws FireflyException
*/
- public function getVersion(string $channel): array
+ public function getUpdateInformation(string $channel): array
{
+ Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel));
+ $information = [
+ 'level' => 'error',
+ 'message' => (string)trans('firefly.unknown_error'),
+ ];
+
+ // try get array from update server:
+ $updateInfo = $this->contactServer($channel);
+ if ('error' === $updateInfo['level']) {
+ Log::error('Update information contains an error.');
+ Log::error($updateInfo['message']);
+ $information['message'] = $updateInfo['message'];
+
+ return $information;
+ }
+
+ // if no error, parse the result and return
+ return $this->parseResult($updateInfo);
+ }
+
+ /**
+ * @param array $information
+ *
+ * @return array
+ */
+ private function parseResult(array $information): array
+ {
+ Log::debug('Now in parseResult()', $information);
+ $return = [
+ 'level' => 'error',
+ 'message' => (string)trans('firefly.unknown_error'),
+ ];
+ $current = config('firefly.version');
+ $latest = $information['version'];
+ $compare = version_compare($latest, $current);
+
+ Log::debug(sprintf('Current version is "%s", latest is "%s", result is: %d', $current, $latest, $compare));
+
+ // -1: you're running a newer version:
+ if (-1 === $compare) {
+ $return['level'] = 'info';
+ $return['message'] = (string)trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $latest]);
+ Log::debug('User is running a newer version', $return);
+
+ return $return;
+ }
+ // running the current version:
+ if (0 === $compare) {
+ $return['level'] = 'info';
+ $return['message'] = (string)trans('firefly.update_current_version_alert', ['version' => $current]);
+ Log::debug('User is the current version.', $return);
+
+ return $return;
+ }
+ // a newer version is available!
+ /** @var Carbon $released */
+ $released = $information['date'];
+ $today = Carbon::today()->startOfDay();
+ $diff = $today->diffInDays($released);
+ $expectedDiff = config('firefly.update_minimum_age') ?? 6;
+ // it's still very fresh, and user wants a stable release:
+ if ($diff <= $expectedDiff) {
+ $return['level'] = 'info';
+ $return['message'] = (string)trans(
+ 'firefly.just_new_release',
+ ['version' => $latest,
+ 'date' => $released->formatLocalized((string)trans('config.month_and_day')),
+ 'days' => $expectedDiff,
+ ]
+ );
+ Log::debug('Release is very fresh.', $return);
+
+ return $return;
+ }
+
+ // its been around for a while:
+ $return['level'] = 'success';
+ $return['message'] = (string)trans(
+ 'firefly.update_new_version_alert',
+ [
+ 'your_version' => $current,
+ 'new_version' => $latest,
+ 'date' => $released->formatLocalized(
+ (string)trans('config.month_and_day')
+ )]
+ );
+ Log::debug('New release is old enough.');
+
+ // add warning in case of alpha or beta:
+ // append warning if beta or alpha.
+ $isBeta = $information['is_beta'] ?? false;
+ if (true === $isBeta) {
+ $return['message'] = sprintf('%s %s', $return['message'], trans('firefly.update_version_beta'));
+ Log::debug('New release is also a beta!');
+ }
+
+ $isAlpha = $information['is_alpha'] ?? false;
+ if (true === $isAlpha) {
+ $return['message'] = sprintf('%s %s', $return['message'], trans('firefly.update_version_alpha'));
+ Log::debug('New release is also a alpha!');
+ }
+ Log::debug('New release is here!', $return);
+
+ return $return;
+ }
+
+ /**
+ * @param string $channel
+ *
+ * @return array
+ */
+ private function contactServer(string $channel): array
+ {
+ Log::debug(sprintf('Now in contactServer(%s)', $channel));
+ // always fall back to current version:
+ $return = [
+ 'version' => config('firefly.version'),
+ 'date' => Carbon::today()->startOfDay(),
+ 'level' => 'error',
+ 'message' => (string)trans('firefly.unknown_error'),
+ ];
+
$uri = config('firefly.update_endpoint');
Log::debug(sprintf('Going to call %s', $uri));
try {
- $client = new Client();
+ $client = new Client;
$options = [
'headers' => [
'User-Agent' => sprintf('FireflyIII/%s/%s', config('firefly.version'), $channel),
@@ -53,23 +174,46 @@ class UpdateRequest implements UpdateRequestInterface
];
$res = $client->request('GET', $uri, $options);
} catch (GuzzleException|Exception $e) {
- throw new FireflyException(sprintf('Response error from update check: %s', $e->getMessage()));
+ Log::error('Ran into Guzzle error.');
+ Log::error($e->getMessage());
+ Log::error($e->getTraceAsString());
+ $return['message'] = sprintf('Guzzle: %s', $e->getMessage());
+
+ return $return;
}
if (200 !== $res->getStatusCode()) {
- throw new FireflyException(sprintf('Returned error code %d from update check.', $res->getStatusCode()));
+ Log::error(sprintf('Response status from server is %d.', $res->getStatusCode()));
+ Log::error((string)$res->getBody());
+ $return['message'] = sprintf('Error: %d', $res->getStatusCode());
+
+ return $return;
}
$body = (string)$res->getBody();
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
- } catch (JsonException $e) {
- throw new FireflyException('Invalid JSON in server response.');
+
+ } catch (JsonException|Exception $e) {
+ Log::error('Body is not valid JSON');
+ Log::error($body);
+ $return['message'] = 'Invalid JSON :(';
+
+ return $return;
}
if (!isset($json['firefly_iii'][$channel])) {
- throw new FireflyException(sprintf('Unknown update channel "%s"', $channel));
+ Log::error(sprintf('No valid update channel "%s"', $channel));
+ Log::error($body);
+ $return['message'] = sprintf('Unknown update channel "%s" :(', $channel);
}
- return $json['firefly_iii'][$channel];
+ // parse response a bit. No message yet.
+ $response = $json['firefly_iii'][$channel];
+ $return['version'] = $response['version'];
+ $return['level'] = 'success';
+ $return['date'] = Carbon::createFromFormat('Y-m-d', $response['date'])->startOfDay();
+ Log::info('Response from update server', $response);
+
+ return $return;
}
}
\ No newline at end of file
diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequestInterface.php b/app/Services/FireflyIIIOrg/Update/UpdateRequestInterface.php
index 5f18bc0836..6028c02ffd 100644
--- a/app/Services/FireflyIIIOrg/Update/UpdateRequestInterface.php
+++ b/app/Services/FireflyIIIOrg/Update/UpdateRequestInterface.php
@@ -32,8 +32,7 @@ interface UpdateRequestInterface
* @param string $channel
*
* @return array
- * @throws FireflyException
*/
- public function getVersion(string $channel): array;
+ public function getUpdateInformation(string $channel): array;
}
\ No newline at end of file
diff --git a/config/firefly.php b/config/firefly.php
index ba72560a36..c339a342c8 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -160,6 +160,7 @@ return [
'login_provider' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'),
'cer_provider' => envNonEmpty('CER_PROVIDER', 'fixer'),
'update_endpoint' => 'https://version.firefly-iii.org/index.json',
+ 'update_minimum_age' => 6,
'default_location' => [
'longitude' => env('MAP_DEFAULT_LONG', '5.916667'),
'latitude' => env('MAP_DEFAULT_LAT', '51.983333'),
diff --git a/public/v1/js/ff/admin/update/index.js b/public/v1/js/ff/admin/update/index.js
index 55dc16b66d..b369180a1f 100644
--- a/public/v1/js/ff/admin/update/index.js
+++ b/public/v1/js/ff/admin/update/index.js
@@ -25,18 +25,4 @@ $(function () {
// Enable update button.
- $('#update').click(checkUpdate);
});
-
-function checkUpdate() {
-
- // do post update check:
- $.post(updateCheckUri).done(function (data) {
- alert(data.result);
- }).fail(function () {
- alert('Error while checking.');
- });
-
-
- return false;
-}
\ No newline at end of file
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 919904f8b9..1eb9238937 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -218,7 +218,7 @@ return [
// check for updates:
'update_check_title' => 'Check for updates',
'admin_update_check_title' => 'Automatically check for update',
- 'admin_update_check_explain' => 'Firefly III can check for updates automatically. When you enable this setting, it will contact Github to see if a new version of Firefly III is available. When it is, you will get a notification. You can test this notification using the button on the right. Please indicate below if you want Firefly III to check for updates.',
+ 'admin_update_check_explain' => 'Firefly III can check for updates automatically. When you enable this setting, it will contact the Firefly III update server to see if a new version of Firefly III is available. When it is, you will get a notification. You can test this notification using the button on the right. Please indicate below if you want Firefly III to check for updates.',
'check_for_updates_permission' => 'Firefly III can check for updates, but it needs your permission to do so. Please go to the administration to indicate if you would like this feature to be enabled.',
'updates_ask_me_later' => 'Ask me later',
'updates_do_not_check' => 'Do not check for updates',
@@ -231,7 +231,9 @@ return [
'update_version_alpha' => 'This version is a ALPHA version. You may run into issues.',
'update_current_version_alert' => 'You are running :version, which is the latest available release.',
'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.',
- 'update_check_error' => 'An error occurred while checking for updates. Please view the log files.',
+ 'update_check_error' => 'An error occurred while checking for updates: :error',
+ 'unknown_error' => 'Unknown error. Sorry about that.',
+ 'just_new_release' => 'A new version is available! Version :version was released :date. This release is very fresh. Wait a few days for the new release to stabilize.',
'admin_update_channel_title' => 'Update channel',
'admin_update_channel_explain' => 'Firefly III has three update "channels" which determine how ahead of the curve you are in terms of features, enhancements and bugs. Use the "beta" channel if you\'re adventurous and the "alpha" when you like to live life dangerously.',
'update_channel_stable' => 'Stable. Everything should work as expected.',
diff --git a/resources/views/v1/admin/update/index.twig b/resources/views/v1/admin/update/index.twig
index 52986b238b..c2a0d63963 100644
--- a/resources/views/v1/admin/update/index.twig
+++ b/resources/views/v1/admin/update/index.twig
@@ -50,7 +50,7 @@
{{ 'admin_update_check_now_explain'|_ }}
- {{ 'check_for_updates_button'|_ }}
+ {{ 'check_for_updates_button'|_ }}
From 635ef0de77f6496d0d5c3b75c1162ddb8b99baa2 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Mon, 3 Feb 2020 20:00:02 +0100
Subject: [PATCH 29/75] Fix #3075
---
app/Jobs/MailError.php | 2 +-
resources/views/v1/emails/registered-html.twig | 2 +-
resources/views/v1/emails/registered-text.twig | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php
index e6a3505a1f..da5c821412 100644
--- a/app/Jobs/MailError.php
+++ b/app/Jobs/MailError.php
@@ -83,7 +83,7 @@ class MailError extends Job implements ShouldQueue
$args,
function (Message $message) use ($email) {
if ('mail@example.com' !== $email) {
- $message->to($email, $email)->subject('Caught an error in Firely III');
+ $message->to($email, $email)->subject('Caught an error in Firefly III');
}
}
);
diff --git a/resources/views/v1/emails/registered-html.twig b/resources/views/v1/emails/registered-html.twig
index 5274b801b7..8f72845c84 100644
--- a/resources/views/v1/emails/registered-html.twig
+++ b/resources/views/v1/emails/registered-html.twig
@@ -1,6 +1,6 @@
{% include 'emails.header-html' %}
- Welkome to Firefly III . Your registration has made it, and this email is here to confirm it. Yay!
+ Welcome to Firefly III . Your registration has made it, and this email is here to confirm it. Yay!
diff --git a/resources/views/v1/emails/registered-text.twig b/resources/views/v1/emails/registered-text.twig
index c750538f65..bbfbca6953 100644
--- a/resources/views/v1/emails/registered-text.twig
+++ b/resources/views/v1/emails/registered-text.twig
@@ -1,5 +1,5 @@
{% include 'emails.header-text' %}
-Welkome to Firefly III. Your registration has made it, and this email is here to confirm it. Yay!
+Welcome to Firefly III. Your registration has made it, and this email is here to confirm it. Yay!
* If you have forgotten your password already, please reset it using the password reset tool.
* There is a help-icon in the top right corner of each page. If you need help, click it!
From 11997f0f97e6154e619231523c3072c03b45ef89 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Tue, 4 Feb 2020 17:39:38 +0100
Subject: [PATCH 30/75] Fix #3082
---
resources/views/v1/list/groups.twig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twig
index 3fee8c6585..12352d2747 100644
--- a/resources/views/v1/list/groups.twig
+++ b/resources/views/v1/list/groups.twig
@@ -180,7 +180,7 @@ TODO: hide and show columns
From 067246be792e74332998b1e5e9a42c35a9ff493d Mon Sep 17 00:00:00 2001
From: James Cole
Date: Tue, 4 Feb 2020 19:20:34 +0100
Subject: [PATCH 31/75] Check if object is countable, fix #3080
---
app/Validation/TransactionValidation.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php
index ce6f7a86cf..b6e608a426 100644
--- a/app/Validation/TransactionValidation.php
+++ b/app/Validation/TransactionValidation.php
@@ -243,6 +243,11 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+ if (!is_countable($transactions)) {
+ $validator->errors()->add('transactions.0.description', (string)trans('validation.at_least_one_transaction'));
+
+ return;
+ }
// need at least one transaction
if (0 === count($transactions)) {
$validator->errors()->add('transactions.0.description', (string)trans('validation.at_least_one_transaction'));
From fc81833b508e0f136c0c70c93afe45e0588b920f Mon Sep 17 00:00:00 2001
From: James Cole
Date: Wed, 5 Feb 2020 05:53:12 +0100
Subject: [PATCH 32/75] Update email address
---
app/Import/Converter/Amount.php | 2 +-
app/Import/Converter/AmountCredit.php | 2 +-
app/Import/Converter/AmountDebit.php | 2 +-
app/Import/Converter/AmountNegated.php | 2 +-
app/Import/Converter/BankDebitCredit.php | 2 +-
app/Import/Converter/ConverterInterface.php | 2 +-
app/Import/JobConfiguration/BunqJobConfiguration.php | 2 +-
app/Import/JobConfiguration/FakeJobConfiguration.php | 2 +-
app/Import/JobConfiguration/FileJobConfiguration.php | 2 +-
app/Import/JobConfiguration/JobConfigurationInterface.php | 2 +-
app/Import/JobConfiguration/SpectreJobConfiguration.php | 2 +-
app/Import/JobConfiguration/YnabJobConfiguration.php | 2 +-
app/Import/Mapper/AssetAccountIbans.php | 2 +-
app/Import/Mapper/AssetAccounts.php | 2 +-
app/Import/Mapper/Bills.php | 2 +-
app/Import/Mapper/Budgets.php | 2 +-
app/Import/Mapper/Categories.php | 2 +-
app/Import/Mapper/MapperInterface.php | 2 +-
app/Import/Mapper/OpposingAccountIbans.php | 2 +-
app/Import/Mapper/OpposingAccounts.php | 2 +-
app/Import/Mapper/Tags.php | 2 +-
app/Import/Mapper/TransactionCurrencies.php | 2 +-
app/Import/MapperPreProcess/PreProcessorInterface.php | 2 +-
app/Import/MapperPreProcess/TagsComma.php | 2 +-
app/Import/MapperPreProcess/TagsSpace.php | 2 +-
app/Import/Prerequisites/BunqPrerequisites.php | 2 +-
app/Import/Prerequisites/FakePrerequisites.php | 2 +-
app/Import/Prerequisites/FilePrerequisites.php | 2 +-
app/Import/Prerequisites/PrerequisitesInterface.php | 2 +-
app/Import/Prerequisites/SpectrePrerequisites.php | 2 +-
app/Import/Prerequisites/YnabPrerequisites.php | 2 +-
app/Import/Routine/BunqRoutine.php | 2 +-
app/Import/Routine/FakeRoutine.php | 2 +-
app/Import/Routine/FileRoutine.php | 2 +-
app/Import/Routine/RoutineInterface.php | 2 +-
app/Import/Routine/SpectreRoutine.php | 2 +-
app/Import/Routine/YnabRoutine.php | 2 +-
app/Import/Specifics/PresidentsChoice.php | 2 +-
app/Import/Specifics/RabobankDescription.php | 2 +-
app/Import/Specifics/SpecificInterface.php | 2 +-
app/Import/Storage/ImportArrayStorage.php | 2 +-
41 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php
index 1e6b1dc264..00c7fdbfe4 100644
--- a/app/Import/Converter/Amount.php
+++ b/app/Import/Converter/Amount.php
@@ -1,7 +1,7 @@
Date: Wed, 5 Feb 2020 20:37:23 +0100
Subject: [PATCH 33/75] More validation for #3080
---
app/Validation/TransactionValidation.php | 114 ++++++++++++++++++++++-
1 file changed, 109 insertions(+), 5 deletions(-)
diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php
index b6e608a426..18e5956ab4 100644
--- a/app/Validation/TransactionValidation.php
+++ b/app/Validation/TransactionValidation.php
@@ -47,6 +47,14 @@ trait TransactionValidation
$transactionType = $data['type'] ?? 'invalid';
$transactions = $data['transactions'] ?? [];
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
/** @var AccountValidator $accountValidator */
$accountValidator = app(AccountValidator::class);
@@ -91,6 +99,14 @@ trait TransactionValidation
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
/** @var AccountValidator $accountValidator */
$accountValidator = app(AccountValidator::class);
@@ -142,8 +158,15 @@ trait TransactionValidation
*/
public function validateDescriptions(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
+ $data = $validator->getData();
+ $transactions = $data['transactions'] ?? [];
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
$validDescriptions = 0;
foreach ($transactions as $index => $transaction) {
if ('' !== (string)($transaction['description'] ?? null)) {
@@ -168,6 +191,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
foreach ($transactions as $index => $transaction) {
// if foreign amount is present, then the currency must be as well.
if (isset($transaction['foreign_amount']) && !(isset($transaction['foreign_currency_id']) || isset($transaction['foreign_currency_code']))
@@ -195,7 +227,16 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
- $groupTitle = $data['group_title'] ?? '';
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
+ $groupTitle = $data['group_title'] ?? '';
if ('' === $groupTitle && count($transactions) > 1) {
$validator->errors()->add('group_title', (string)trans('validation.group_title_mandatory'));
}
@@ -210,6 +251,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
// need at least one transaction
if (0 === count($transactions)) {
$validator->errors()->add('transactions', (string)trans('validation.at_least_one_transaction'));
@@ -225,6 +275,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? null;
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
if (null === $transactions) {
return;
}
@@ -263,7 +322,16 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
- $types = [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
+ $types = [];
foreach ($transactions as $index => $transaction) {
$types[] = $transaction['type'] ?? 'invalid';
}
@@ -289,7 +357,16 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
- $types = [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
+ $types = [];
foreach ($transactions as $index => $transaction) {
$originalType = $this->getOriginalType((int)($transaction['transaction_journal_id'] ?? 0));
// if type is not set, fall back to the type of the journal, if one is given.
@@ -373,6 +450,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
// needs to be split
if (count($transactions) < 2) {
return;
@@ -414,6 +500,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
// needs to be split
if (count($transactions) < 2) {
return;
@@ -497,6 +592,15 @@ trait TransactionValidation
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
+
+ if (!is_countable($data['transactions'])) {
+ $validator->errors()->add(
+ 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
+ );
+
+ return;
+ }
+
if (count($transactions) < 2) {
return;
}
From 3cb01a9b506543120b0c0c504d4964e308200d99 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Thu, 6 Feb 2020 15:05:29 +0100
Subject: [PATCH 34/75] Update groups.twig
---
resources/views/v1/list/groups.twig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twig
index 12352d2747..7a7fb151db 100644
--- a/resources/views/v1/list/groups.twig
+++ b/resources/views/v1/list/groups.twig
@@ -180,7 +180,7 @@ TODO: hide and show columns
From 554a702c0a6000d1abc04d2b059863a884aa0305 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Thu, 6 Feb 2020 21:54:47 +0100
Subject: [PATCH 35/75] A special commit for @SuperSandro2000 :wink:
---
app/Validation/TransactionValidation.php | 139 ++++++-----------------
1 file changed, 37 insertions(+), 102 deletions(-)
diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php
index 18e5956ab4..f5f4728fb6 100644
--- a/app/Validation/TransactionValidation.php
+++ b/app/Validation/TransactionValidation.php
@@ -34,6 +34,7 @@ use Log;
*/
trait TransactionValidation
{
+
/**
* Validates the given account information. Switches on given transaction type.
*
@@ -41,19 +42,10 @@ trait TransactionValidation
*/
public function validateAccountInformation(Validator $validator): void
{
- //Log::debug('Now in validateAccountInformation()');
- $data = $validator->getData();
+ $transactions = $this->getTransactionsArray($validator);
+ $data = $validator->getData();
$transactionType = $data['type'] ?? 'invalid';
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
/** @var AccountValidator $accountValidator */
$accountValidator = app(AccountValidator::class);
@@ -96,16 +88,7 @@ trait TransactionValidation
*/
public function validateAccountInformationUpdate(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
/** @var AccountValidator $accountValidator */
$accountValidator = app(AccountValidator::class);
@@ -158,15 +141,7 @@ trait TransactionValidation
*/
public function validateDescriptions(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
$validDescriptions = 0;
foreach ($transactions as $index => $transaction) {
if ('' !== (string)($transaction['description'] ?? null)) {
@@ -189,16 +164,7 @@ trait TransactionValidation
*/
public function validateForeignCurrencyInformation(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
foreach ($transactions as $index => $transaction) {
// if foreign amount is present, then the currency must be as well.
@@ -226,15 +192,7 @@ trait TransactionValidation
public function validateGroupDescription(Validator $validator): void
{
$data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
$groupTitle = $data['group_title'] ?? '';
if ('' === $groupTitle && count($transactions) > 1) {
@@ -249,16 +207,7 @@ trait TransactionValidation
*/
public function validateOneRecurrenceTransaction(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
// need at least one transaction
if (0 === count($transactions)) {
@@ -273,20 +222,7 @@ trait TransactionValidation
*/
public function validateOneRecurrenceTransactionUpdate(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? null;
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
-
- if (null === $transactions) {
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
// need at least one transaction
if (0 === count($transactions)) {
$validator->errors()->add('transactions', (string)trans('validation.at_least_one_transaction'));
@@ -300,13 +236,7 @@ trait TransactionValidation
*/
public function validateOneTransaction(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
- if (!is_countable($transactions)) {
- $validator->errors()->add('transactions.0.description', (string)trans('validation.at_least_one_transaction'));
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
// need at least one transaction
if (0 === count($transactions)) {
$validator->errors()->add('transactions.0.description', (string)trans('validation.at_least_one_transaction'));
@@ -320,16 +250,7 @@ trait TransactionValidation
*/
public function validateTransactionTypes(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
+ $transactions = $this->getTransactionsArray($validator);
$types = [];
foreach ($transactions as $index => $transaction) {
@@ -355,18 +276,8 @@ trait TransactionValidation
*/
public function validateTransactionTypesForUpdate(Validator $validator): void
{
- $data = $validator->getData();
- $transactions = $data['transactions'] ?? [];
-
- if (!is_countable($data['transactions'])) {
- $validator->errors()->add(
- 'transactions.0.description', (string)trans('validation.filled', ['attribute' => (string)trans('validation.attributes.description')])
- );
-
- return;
- }
-
- $types = [];
+ $transactions = $this->getTransactionsArray($validator);
+ $types = [];
foreach ($transactions as $index => $transaction) {
$originalType = $this->getOriginalType((int)($transaction['transaction_journal_id'] ?? 0));
// if type is not set, fall back to the type of the journal, if one is given.
@@ -443,6 +354,30 @@ trait TransactionValidation
return 'invalid';
}
+ /**
+ * @param Validator $validator
+ *
+ * @return array
+ */
+ private function getTransactionsArray(Validator $validator): array
+ {
+ $data = $validator->getData();
+ $transactions = $data['transactions'] ?? [];
+ if (!is_countable($transactions)) {
+ Log::error(sprintf('Transactions array is not countable, because its a %s', gettype($transactions)));
+
+ return [];
+ }
+ // a superfluous check but you never know.
+ if (!is_array($transactions)) {
+ Log::error(sprintf('Transactions array is not an array, because its a %s', gettype($transactions)));
+
+ return [];
+ }
+
+ return $transactions;
+ }
+
/**
* @param Validator $validator
*/
From c2e7e00cdd8e34fcac5c9c2945664fd46cc3db3a Mon Sep 17 00:00:00 2001
From: James Cole
Date: Thu, 6 Feb 2020 22:01:59 +0100
Subject: [PATCH 36/75] Demo user can trigger error.
---
app/Http/Controllers/DebugController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php
index 22208e761f..cd25ce80d8 100644
--- a/app/Http/Controllers/DebugController.php
+++ b/app/Http/Controllers/DebugController.php
@@ -51,7 +51,7 @@ class DebugController extends Controller
public function __construct()
{
parent::__construct();
- $this->middleware(IsDemoUser::class);
+ $this->middleware(IsDemoUser::class)->except(['displayError']);
}
/**
From ab73322c58a4f54891e5f583760de86005b65f35 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 11:16:38 +0100
Subject: [PATCH 37/75] Update email addresses.
---
app/Jobs/CreateRecurringTransactions.php | 2 +-
app/Jobs/Job.php | 2 +-
app/Jobs/MailError.php | 2 +-
app/Mail/AccessTokenCreatedMail.php | 2 +-
app/Mail/AdminTestMail.php | 2 +-
app/Mail/ConfirmEmailChangeMail.php | 2 +-
app/Mail/OAuthTokenCreatedMail.php | 2 +-
app/Mail/RegisteredUser.php | 2 +-
app/Mail/ReportNewJournalsMail.php | 2 +-
app/Mail/RequestedNewPassword.php | 2 +-
app/Mail/UndoEmailChangeMail.php | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.php
index ee56d4958c..6c6d32d54c 100644
--- a/app/Jobs/CreateRecurringTransactions.php
+++ b/app/Jobs/CreateRecurringTransactions.php
@@ -2,7 +2,7 @@
/**
* CreateRecurringTransactions.php
- * Copyright (c) 2019 thegrumpydictator@gmail.com
+ * Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php
index 0482bb0bd7..7562dbfa3c 100644
--- a/app/Jobs/Job.php
+++ b/app/Jobs/Job.php
@@ -1,7 +1,7 @@
Date: Fri, 7 Feb 2020 11:16:52 +0100
Subject: [PATCH 38/75] Fix #3083
---
resources/views/v1/reports/partials/budget-period.twig | 2 +-
resources/views/v1/reports/partials/category-period.twig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/resources/views/v1/reports/partials/budget-period.twig b/resources/views/v1/reports/partials/budget-period.twig
index 27cf2cbb13..5bd717d8f1 100644
--- a/resources/views/v1/reports/partials/budget-period.twig
+++ b/resources/views/v1/reports/partials/budget-period.twig
@@ -12,7 +12,7 @@
{% for key, info in report %}
-
+
{% if info.id != 0 %}
{% else %}
diff --git a/resources/views/v1/reports/partials/category-period.twig b/resources/views/v1/reports/partials/category-period.twig
index 17dbfbb940..fc8d400919 100644
--- a/resources/views/v1/reports/partials/category-period.twig
+++ b/resources/views/v1/reports/partials/category-period.twig
@@ -11,7 +11,7 @@
{% for info in report %}
-
+
{% if info.id != 0 %}
{% else %}
From ae57be74e0d66d1f75dfe4d66314831da0d5870a Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 18:26:47 +0100
Subject: [PATCH 39/75] Add port to DSN
---
app/Console/Commands/CreateDatabase.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/Console/Commands/CreateDatabase.php b/app/Console/Commands/CreateDatabase.php
index 9b8e9a0366..a996127949 100644
--- a/app/Console/Commands/CreateDatabase.php
+++ b/app/Console/Commands/CreateDatabase.php
@@ -55,10 +55,11 @@ class CreateDatabase extends Command
{
if ('mysql' !== env('DB_CONNECTION')) {
$this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION')));
+
return 0;
}
// try to set up a raw connection:
- $dsn = sprintf('mysql:host=%s;charset=utf8mb4', env('DB_HOST'));
+ $dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST'), env('DB_PORT'));
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
From 685107e95099deea8eeeae078c4a4ad20a4a4bf1 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 18:27:49 +0100
Subject: [PATCH 40/75] Add DNS to debug.
---
app/Console/Commands/CreateDatabase.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/Console/Commands/CreateDatabase.php b/app/Console/Commands/CreateDatabase.php
index a996127949..d636e39e1f 100644
--- a/app/Console/Commands/CreateDatabase.php
+++ b/app/Console/Commands/CreateDatabase.php
@@ -60,6 +60,7 @@ class CreateDatabase extends Command
}
// try to set up a raw connection:
$dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST'), env('DB_PORT'));
+ $this->line(sprintf('DSN is: "%s"', $dsn));
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
From 0c13ac2e93ba9a9c5d5151b1cdc27ed2e68ed0c2 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 20:50:46 +0100
Subject: [PATCH 41/75] Fix some old debug code.
---
app/Console/Commands/CreateDatabase.php | 3 +--
app/Console/Commands/SetLatestVersion.php | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/app/Console/Commands/CreateDatabase.php b/app/Console/Commands/CreateDatabase.php
index d636e39e1f..46cd5109ba 100644
--- a/app/Console/Commands/CreateDatabase.php
+++ b/app/Console/Commands/CreateDatabase.php
@@ -59,8 +59,7 @@ class CreateDatabase extends Command
return 0;
}
// try to set up a raw connection:
- $dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST'), env('DB_PORT'));
- $this->line(sprintf('DSN is: "%s"', $dsn));
+ $dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST', 'localhost'), env('DB_PORT', '3306'));
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
diff --git a/app/Console/Commands/SetLatestVersion.php b/app/Console/Commands/SetLatestVersion.php
index 035f1584a7..eec6710f6e 100644
--- a/app/Console/Commands/SetLatestVersion.php
+++ b/app/Console/Commands/SetLatestVersion.php
@@ -32,7 +32,7 @@ class SetLatestVersion extends Command
*
* @var string
*/
- protected $description = 'Command description';
+ protected $description = 'Set latest version in DB.';
/**
* The name and signature of the console command.
*
From ac931698d377a2f218179187f1b4acb64b7b9e32 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 20:51:25 +0100
Subject: [PATCH 42/75] Code for #3052
---
.../Transaction/CreateController.php | 18 +++
.../Internal/Update/GroupCloneService.php | 146 ++++++++++++++++++
public/v1/js/ff/transactions/show.js | 6 +
resources/lang/en_US/firefly.php | 3 +-
resources/views/v1/transactions/show.twig | 6 +-
routes/web.php | 14 +-
6 files changed, 178 insertions(+), 15 deletions(-)
create mode 100644 app/Services/Internal/Update/GroupCloneService.php
diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php
index 6153c72b88..490a1ba802 100644
--- a/app/Http/Controllers/Transaction/CreateController.php
+++ b/app/Http/Controllers/Transaction/CreateController.php
@@ -25,7 +25,9 @@ namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Http\Controllers\Controller;
+use FireflyIII\Models\TransactionGroup;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
+use FireflyIII\Services\Internal\Update\GroupCloneService;
/**
* Class CreateController
@@ -34,6 +36,7 @@ class CreateController extends Controller
{
/**
* CreateController constructor.
+ *
* @codeCoverageIgnore
*/
public function __construct()
@@ -55,6 +58,21 @@ class CreateController extends Controller
);
}
+ /**
+ * @param TransactionGroup $group
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ */
+ public function cloneGroup(TransactionGroup $group)
+ {
+
+ /** @var GroupCloneService $service */
+ $service = app(GroupCloneService::class);
+ $newGroup = $service->cloneGroup($group);
+
+ return redirect(route('transactions.show', [$newGroup->id]));
+ }
+
/**
* Create a new transaction group.
*
diff --git a/app/Services/Internal/Update/GroupCloneService.php b/app/Services/Internal/Update/GroupCloneService.php
new file mode 100644
index 0000000000..79a07f8c41
--- /dev/null
+++ b/app/Services/Internal/Update/GroupCloneService.php
@@ -0,0 +1,146 @@
+.
+ */
+
+declare(strict_types=1);
+
+namespace FireflyIII\Services\Internal\Update;
+
+use Carbon\Carbon;
+use FireflyIII\Models\Budget;
+use FireflyIII\Models\Category;
+use FireflyIII\Models\Note;
+use FireflyIII\Models\Tag;
+use FireflyIII\Models\Transaction;
+use FireflyIII\Models\TransactionGroup;
+use FireflyIII\Models\TransactionJournal;
+use FireflyIII\Models\TransactionJournalMeta;
+
+/**
+ * Class GroupCloneService
+ * TODO test.
+ */
+class GroupCloneService
+{
+ /**
+ * @param TransactionGroup $group
+ *
+ * @return TransactionGroup
+ */
+ public function cloneGroup(TransactionGroup $group): TransactionGroup
+ {
+ $newGroup = $group->replicate();
+ $newGroup->save();
+ foreach ($group->transactionJournals as $journal) {
+ $this->cloneJournal($journal, $newGroup, (int)$group->id);
+ }
+
+
+ return $newGroup;
+ }
+
+ /**
+ * @param TransactionJournal $journal
+ * @param TransactionGroup $newGroup
+ * @param int $originalGroup
+ */
+ private function cloneJournal(TransactionJournal $journal, TransactionGroup $newGroup, int $originalGroup): void
+ {
+ $newJournal = $journal->replicate();
+ $newJournal->transaction_group_id = $newGroup->id;
+ $newJournal->date = Carbon::now();
+ $newJournal->save();
+
+ foreach ($journal->transactions as $transaction) {
+ $this->cloneTransaction($transaction, $newJournal);
+ }
+
+ // clone notes
+ /** @var Note $note */
+ foreach ($journal->notes as $note) {
+ $this->cloneNote($note, $newJournal, $originalGroup);
+ }
+ // clone location (not yet available)
+
+ // clone meta
+ /** @var TransactionJournalMeta $meta */
+ foreach ($journal->transactionJournalMeta as $meta) {
+ $this->cloneMeta($meta, $newJournal);
+ }
+ // clone category
+ /** @var Category $category */
+ foreach ($journal->categories as $category) {
+ $newJournal->categories()->save($category);
+ }
+
+ // clone budget
+ /** @var Budget $budget */
+ foreach ($journal->budgets as $budget) {
+ $newJournal->budgets()->save($budget);
+ }
+ // clone links (ongoing).
+
+ // clone tags
+ /** @var Tag $tag */
+ foreach ($journal->tags as $tag) {
+ $newJournal->tags()->save($tag);
+ }
+ // add note saying "cloned".
+
+ // add relation.
+ }
+
+ /**
+ * @param TransactionJournalMeta $meta
+ * @param TransactionJournal $newJournal
+ */
+ private function cloneMeta(TransactionJournalMeta $meta, TransactionJournal $newJournal): void
+ {
+ $newMeta = $meta->replicate();
+ $newMeta->transaction_journal_id = $newJournal->id;
+ if ('recurrence_id' !== $newMeta->name) {
+ $newMeta->save();
+ }
+ }
+
+ private function cloneNote(Note $note, TransactionJournal $newJournal, int $oldGroupId): void
+ {
+ $newNote = $note->replicate();
+ $newNote->text .= sprintf(
+ "\n\n%s", trans('firefly.clones_journal_x', ['description' => $newJournal->description, 'id' => $oldGroupId])
+ );
+ $newNote->noteable_id = $newJournal->id;
+ $newNote->save();
+
+ }
+
+ /**
+ * @param Transaction $transaction
+ * @param TransactionJournal $newJournal
+ */
+ private function cloneTransaction(Transaction $transaction, TransactionJournal $newJournal): void
+ {
+ $newTransaction = $transaction->replicate();
+ $newTransaction->transaction_journal_id = $newJournal->id;
+ $newTransaction->save();
+ }
+
+
+}
diff --git a/public/v1/js/ff/transactions/show.js b/public/v1/js/ff/transactions/show.js
index 6efb5ab0c0..b377f56ce5 100644
--- a/public/v1/js/ff/transactions/show.js
+++ b/public/v1/js/ff/transactions/show.js
@@ -27,8 +27,14 @@ $(function () {
makeAutoComplete();
})
$('[data-toggle="tooltip"]').tooltip();
+
+ $('#clone_button').click(cloneNewFunction);
});
+function cloneNewFunction() {
+ return confirm(newCloneInstructions);
+}
+
function getLinkModal(e) {
var button = $(e.currentTarget);
var journalId = parseInt(button.data('journal'));
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 1eb9238937..e77a1ec894 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -58,7 +58,8 @@ return [
'no_rules_for_bill' => 'This bill has no rules associated to it.',
'go_to_asset_accounts' => 'View your asset accounts',
'go_to_budgets' => 'Go to your budgets',
- 'clone_instructions' => 'To clone a transaction, search for the "store as new" checkbox in the edit screen',
+ 'new_clone_instructions' => 'This button will automatically clone the transaction and set the date to today. Are you sure?',
+ 'clones_journal_x' => 'This transaction is a clone of ":description" (#:id)',
'go_to_categories' => 'Go to your categories',
'go_to_bills' => 'Go to your bills',
'go_to_expense_accounts' => 'See your expense accounts',
diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig
index b9ebd56c09..d2302d89bd 100644
--- a/resources/views/v1/transactions/show.twig
+++ b/resources/views/v1/transactions/show.twig
@@ -61,9 +61,8 @@
{% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %}
-
- Clone
- {# {{ 'clone'|_ }} #}
+
+ {{ 'clone'|_ }}
{% endif %}
{#
{{ 'delete'|_ }}
@@ -415,6 +414,7 @@
var modalDialogURI = '{{ route('transactions.link.modal', ['%JOURNAL%']) }}';
var acURI = '{{ route('json.autocomplete.all-journals-with-id') }}';
var groupURI = '{{ route('transactions.show',['%GROUP%']) }}';
+ var newCloneInstructions = '{{ 'new_clone_instructions'|_|escape('js') }}';
diff --git a/routes/web.php b/routes/web.php
index babf1c9752..d105dc77ab 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -963,6 +963,9 @@ Route::group(
Route::get('create/{objectType}', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']);
Route::post('store', ['uses' => 'Transaction\CreateController@store', 'as' => 'store']);
+ // clone group
+ Route::get('clone/{transactionGroup}', ['uses' => 'Transaction\CreateController@cloneGroup', 'as' => 'clone']);
+
// edit group
Route::get('edit/{transactionGroup}', ['uses' => 'Transaction\EditController@edit', 'as' => 'edit']);
Route::post('update', ['uses' => 'Transaction\EditController@update', 'as' => 'update']);
@@ -971,17 +974,6 @@ Route::group(
Route::get('delete/{transactionGroup}', ['uses' => 'Transaction\DeleteController@delete', 'as' => 'delete']);
Route::post('destroy/{transactionGroup}', ['uses' => 'Transaction\DeleteController@destroy', 'as' => 'destroy']);
- // clone group:
- //Route::get('clone/{transactionGroup}', ['uses' => 'Transaction\CloneController@clone', 'as' => 'clone']);
-
- //Route::get('debug/{tj}', ['uses' => 'Transaction\SingleController@debugShow', 'as' => 'debug']);
- //Route::get('debug/{tj}', ['uses' => 'Transaction\SingleController@debugShow', 'as' => 'debug']);
-
- //Route::post('reorder', ['uses' => 'TransactionController@reorder', 'as' => 'reorder']);
- //Route::post('reconcile', ['uses' => 'TransactionController@reconcile', 'as' => 'reconcile']);
- // TODO end of improvement.
-
-
Route::get('show/{transactionGroup}', ['uses' => 'Transaction\ShowController@show', 'as' => 'show']);
}
);
From d5cfc12bf36c21fbd4c2c2108fc689c7fea7082c Mon Sep 17 00:00:00 2001
From: James Cole
Date: Fri, 7 Feb 2020 20:52:13 +0100
Subject: [PATCH 43/75] Clone button.
---
resources/views/v1/list/groups.twig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twig
index 7a7fb151db..21bc369a1c 100644
--- a/resources/views/v1/list/groups.twig
+++ b/resources/views/v1/list/groups.twig
@@ -66,7 +66,7 @@ TODO: hide and show columns
@@ -180,6 +180,7 @@ TODO: hide and show columns
From cebc0d756814e80bf4be479ce3a3685e7494846f Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 8 Feb 2020 06:42:07 +0100
Subject: [PATCH 44/75] Add a debug view for transactions.
---
.../Transaction/ShowController.php | 11 +++
app/Models/TransactionJournal.php | 9 ++
.../TransactionGroupRepository.php | 97 +++++++++++++++++++
.../TransactionGroupRepositoryInterface.php | 10 +-
routes/web.php | 19 +---
5 files changed, 127 insertions(+), 19 deletions(-)
diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.php
index d27e466fc3..7cdedae923 100644
--- a/app/Http/Controllers/Transaction/ShowController.php
+++ b/app/Http/Controllers/Transaction/ShowController.php
@@ -61,6 +61,16 @@ class ShowController extends Controller
);
}
+ /**
+ * @param TransactionGroup $transactionGroup
+ *
+ * @return \Illuminate\Http\JsonResponse
+ */
+ public function debugShow(TransactionGroup $transactionGroup)
+ {
+ return response()->json($this->repository->expandGroup($transactionGroup));
+ }
+
/**
* @param TransactionGroup $transactionGroup
*
@@ -105,6 +115,7 @@ class ShowController extends Controller
/**
* @param array $group
+ *
* @return array
*/
private function getAmounts(array $group): array
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index 1bfaba5065..1908e48d6d 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -346,6 +346,15 @@ class TransactionJournal extends Model
return $this->hasMany(TransactionJournalLink::class, 'source_id');
}
+ /**
+ * @codeCoverageIgnore
+ * @return HasMany
+ */
+ public function destJournalLinks(): HasMany
+ {
+ return $this->hasMany(TransactionJournalLink::class, 'destination_id');
+ }
+
/**
* @codeCoverageIgnore
* @return BelongsToMany
diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
index 5f7de565c7..96e3473ef2 100644
--- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php
+++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
@@ -74,6 +74,21 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
$service->destroy($group);
}
+ /**
+ * @inheritDoc
+ */
+ public function expandGroup(TransactionGroup $group): array
+ {
+ $result = $group->toArray();
+ $result['transaction_journals'] = [];
+ /** @var TransactionJournal $journal */
+ foreach ($group->transactionJournals as $journal) {
+ $result['transaction_journals'][] = $this->expandJournal($journal);
+ }
+
+ return $result;
+ }
+
/**
* Find a transaction group by its ID.
*
@@ -342,6 +357,88 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
return $service->update($transactionGroup, $data);
}
+ /**
+ * @param TransactionJournal $journal
+ *
+ * @return array
+ */
+ private function expandJournal(TransactionJournal $journal): array
+ {
+ $array = $journal->toArray();
+ $array['transactions'] = [];
+ $array['meta'] = [];
+ $array['tags'] = [];
+ $array['categories'] = [];
+ $array['budgets'] = [];
+ $array['notes'] = [];
+ $array['locations'] = [];
+ $array['attachments'] = [];
+ $array['links'] = [];
+ $array['piggy_bank_events'] = [];
+
+ /** @var Transaction $transaction */
+ foreach ($journal->transactions as $transaction) {
+ $array['transactions'][] = $this->expandTransaction($transaction);
+ }
+ foreach ($journal->transactionJournalMeta as $meta) {
+ $array['meta'][] = $meta->toArray();
+ }
+
+ foreach ($journal->tags as $tag) {
+ $array['tags'][] = $tag->toArray();
+ }
+ foreach ($journal->categories as $category) {
+ $array['categories'][] = $category->toArray();
+ }
+
+ foreach ($journal->budgets as $budget) {
+ $array['budgets'][] = $budget->toArray();
+ }
+ foreach ($journal->notes as $note) {
+ $array['notes'][] = $note->toArray();
+ }
+
+ foreach ($journal->attachments as $attachment) {
+ $array['attachments'][] = $attachment->toArray();
+ }
+ // TODO apparantly this doesnt work.
+ foreach ($journal->sourceJournalLinks as $link) {
+ $array['links'][] = $link->toArray();
+ }
+ foreach ($journal->destJournalLinks as $link) {
+ $array['links'][] = $link->toArray();
+ }
+
+ foreach ($journal->piggyBankEvents as $event) {
+ $array['piggy_bank_events'][] = $event->toArray();
+ }
+
+ return $array;
+ }
+
+ /**
+ * @param Transaction $transaction
+ *
+ * @return array
+ */
+ private function expandTransaction(Transaction $transaction): array
+ {
+ $array = $transaction->toArray();
+ $array['account'] = $transaction->account->toArray();
+ $array['budgets'] = [];
+ $array['categories'] = [];
+
+ foreach ($transaction->categories as $category) {
+ $array['categories'][] = $category->toArray();
+ }
+
+ foreach ($transaction->budgets as $budget) {
+ $array['budgets'][] = $budget->toArray();
+ }
+
+ return $array;
+ }
+
/**
* @param TransactionJournal $journal
*
diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php b/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
index 58c0496c2a..a4b39a8d06 100644
--- a/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
+++ b/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
@@ -33,12 +33,20 @@ use FireflyIII\User;
*/
interface TransactionGroupRepositoryInterface
{
-
/**
* @param TransactionGroup $group
*/
public function destroy(TransactionGroup $group): void;
+ /**
+ * Return a group and expand all meta data etc.
+ *
+ * @param TransactionGroup $group
+ *
+ * @return array
+ */
+ public function expandGroup(TransactionGroup $group): array;
+
/**
* Find a transaction group by its ID.
*
diff --git a/routes/web.php b/routes/web.php
index d105dc77ab..db9a64ee44 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -975,27 +975,10 @@ Route::group(
Route::post('destroy/{transactionGroup}', ['uses' => 'Transaction\DeleteController@destroy', 'as' => 'destroy']);
Route::get('show/{transactionGroup}', ['uses' => 'Transaction\ShowController@show', 'as' => 'show']);
+ Route::get('debug/{transactionGroup}', ['uses' => 'Transaction\ShowController@debugShow', 'as' => 'debug']);
}
);
-/**
- * Transaction Single Controller
- */
-Route::group(
- ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Transaction', 'prefix' => 'transactions', 'as' => 'transactions.'],
- function () {
- // TODO improve these routes
-
- //Route::get('edit/{tj}', ['uses' => 'SingleController@edit', 'as' => 'edit']);
- //
- //Route::post('store', ['uses' => 'SingleController@store', 'as' => 'store'])->where(['what' => 'withdrawal|deposit|transfer']);
- //Route::post('update/{tj}', ['uses' => 'SingleController@update', 'as' => 'update']);
- //
- //Route::get('clone/{tj}', ['uses' => 'SingleController@cloneTransaction', 'as' => 'clone']);
- //Route::get('{tj}/{type}', ['uses' => 'ConvertController@index', 'as' => 'convert']);
- // TODO end of improvement.
- }
-);
/**
* Transaction Mass Controller
From e81ce3317c17af424a13abc5cdecb62e19181fba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?=
Date: Sat, 8 Feb 2020 11:51:04 +0100
Subject: [PATCH 45/75] API: Unified attachment_* and model_* for Attachments
---
app/Api/V1/Requests/AttachmentStoreRequest.php | 16 ++++++++--------
app/Api/V1/Requests/AttachmentUpdateRequest.php | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/app/Api/V1/Requests/AttachmentStoreRequest.php b/app/Api/V1/Requests/AttachmentStoreRequest.php
index e7b0326bb9..6fc7a89354 100644
--- a/app/Api/V1/Requests/AttachmentStoreRequest.php
+++ b/app/Api/V1/Requests/AttachmentStoreRequest.php
@@ -57,8 +57,8 @@ class AttachmentStoreRequest extends Request
'filename' => $this->string('filename'),
'title' => $this->string('title'),
'notes' => $this->nlString('notes'),
- 'model' => $this->string('model'),
- 'model_id' => $this->integer('model_id'),
+ 'model' => $this->string('attachable_type'),
+ 'model_id' => $this->integer('attachable_id'),
];
}
@@ -77,14 +77,14 @@ class AttachmentStoreRequest extends Request
str_replace('FireflyIII\\Models\\', '', TransactionJournal::class),
]
);
- $model = $this->string('model');
+ $model = $this->string('attachable_type');
return [
- 'filename' => 'required|between:1,255',
- 'title' => 'between:1,255',
- 'notes' => 'between:1,65000',
- 'model' => sprintf('required|in:%s', $models),
- 'model_id' => ['required', 'numeric', new IsValidAttachmentModel($model)],
+ 'filename' => 'required|between:1,255',
+ 'title' => 'between:1,255',
+ 'notes' => 'between:1,65000',
+ 'attachable_type' => sprintf('required|in:%s', $models),
+ 'attachable_id' => ['required', 'numeric', new IsValidAttachmentModel($model)],
];
}
}
diff --git a/app/Api/V1/Requests/AttachmentUpdateRequest.php b/app/Api/V1/Requests/AttachmentUpdateRequest.php
index f5675b7f53..60a69c612b 100644
--- a/app/Api/V1/Requests/AttachmentUpdateRequest.php
+++ b/app/Api/V1/Requests/AttachmentUpdateRequest.php
@@ -52,8 +52,8 @@ class AttachmentUpdateRequest extends Request
'filename' => $this->string('filename'),
'title' => $this->string('title'),
'notes' => $this->nlString('notes'),
- 'model' => $this->string('model'),
- 'model_id' => $this->integer('model_id'),
+ 'model' => $this->string('attachable_type'),
+ 'model_id' => $this->integer('attachable_id'),
];
}
From 5aae8b77436cd3be3381dae7dc33110ab17d96ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?=
Date: Fri, 7 Feb 2020 12:03:13 +0100
Subject: [PATCH 46/75] API: Add link_type_id when reading TransactionLink
---
app/Transformers/TransactionLinkTransformer.php | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/app/Transformers/TransactionLinkTransformer.php b/app/Transformers/TransactionLinkTransformer.php
index 204e5d7cd2..319859f32a 100644
--- a/app/Transformers/TransactionLinkTransformer.php
+++ b/app/Transformers/TransactionLinkTransformer.php
@@ -60,13 +60,14 @@ class TransactionLinkTransformer extends AbstractTransformer
{
$notes = $this->repository->getLinkNoteText($link);
$data = [
- 'id' => (int)$link->id,
- 'created_at' => $link->created_at->toAtomString(),
- 'updated_at' => $link->updated_at->toAtomString(),
- 'inward_id' => $link->source_id,
- 'outward_id' => $link->destination_id,
- 'notes' => '' === $notes ? null : $notes,
- 'links' => [
+ 'id' => (int)$link->id,
+ 'created_at' => $link->created_at->toAtomString(),
+ 'updated_at' => $link->updated_at->toAtomString(),
+ 'inward_id' => $link->source_id,
+ 'outward_id' => $link->destination_id,
+ 'link_type_id' => $link->link_type_id,
+ 'notes' => '' === $notes ? null : $notes,
+ 'links' => [
[
'rel' => 'self',
'uri' => '/transaction_links/' . $link->id,
From 4cd642b8dafeadda51a70b1b391e2116ec7aba3f Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sat, 8 Feb 2020 12:59:43 +0100
Subject: [PATCH 47/75] Fix #3099
---
app/Http/Controllers/PiggyBankController.php | 2 +-
app/Transformers/AccountTransformer.php | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php
index aad7744e31..cc02d9b6b8 100644
--- a/app/Http/Controllers/PiggyBankController.php
+++ b/app/Http/Controllers/PiggyBankController.php
@@ -240,7 +240,7 @@ class PiggyBankController extends Controller
foreach ($collection as $piggy) {
$array = $transformer->transform($piggy);
$account = $accountTransformer->transform($piggy->account);
- $accountId = $account['id'];
+ $accountId = (int)$account['id'];
if (!isset($accounts[$accountId])) {
// create new:
$accounts[$accountId] = $account;
diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php
index ec8ee2cf12..f8efed6538 100644
--- a/app/Transformers/AccountTransformer.php
+++ b/app/Transformers/AccountTransformer.php
@@ -180,10 +180,11 @@ class AccountTransformer extends AbstractTransformer
private function getCurrency(Account $account): array
{
$currency = $this->repository->getAccountCurrency($account);
- $currencyId = null;
- $currencyCode = null;
- $decimalPlaces = 2;
- $currencySymbol = null;
+ $default = app('amount')->getDefaultCurrencyByUser($account->user);
+ $currencyId = $default->id;
+ $currencyCode = $default->code;
+ $decimalPlaces = $default->decimal_places;
+ $currencySymbol = $default->symbol;
if (null !== $currency) {
$currencyId = $currency->id;
$currencyCode = $currency->code;
From edaa2c168a35ac7685e742a418c778f01254bd2f Mon Sep 17 00:00:00 2001
From: Agraphie
Date: Sat, 8 Feb 2020 13:55:31 +0100
Subject: [PATCH 48/75] Move redis comment to different line
The comment in the variable caused redis to use `"0" #always use quotes` as redis db index instead of just "0"
---
.env.example | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.env.example b/.env.example
index fb1d526bc5..8378fe99a6 100644
--- a/.env.example
+++ b/.env.example
@@ -73,7 +73,8 @@ SESSION_DRIVER=file
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
-REDIS_DB="0" # always use quotes
+# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
+REDIS_DB="0"
REDIS_CACHE_DB="1"
# Cookie settings. Should not be necessary to change these.
From 930695b188d1d3176781907934d19ace03b54f76 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sun, 9 Feb 2020 09:21:20 +0100
Subject: [PATCH 49/75] Add line
---
.env.example | 1 +
1 file changed, 1 insertion(+)
diff --git a/.env.example b/.env.example
index f01981f30a..0ebd688164 100644
--- a/.env.example
+++ b/.env.example
@@ -54,6 +54,7 @@ APP_LOG_LEVEL=notice
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
+# Use "mysql" for MySQL and MariaDB. Use "sqlite" for SQLite.
DB_CONNECTION=pgsql
DB_HOST=firefly_iii_db
DB_PORT=5432
From c8d205350024c7511a2f8a7f44b236b7a055f17c Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sun, 9 Feb 2020 09:22:38 +0100
Subject: [PATCH 50/75] Append changelog.
---
changelog.md | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/changelog.md b/changelog.md
index c93e67c98d..665d7bc095 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,14 +5,26 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [5.1.0 (API 1.0.0)] - 2020-02-xx
### Added
-- #2575 Create a transaction from a rule.
+- #2575 You can now create a transaction from a rule.
+- #3052 The old way of cloning transactions is back.
- Firefly III will generate a unique installation ID for itself.
### Changed
-- #3050 Date blocks were rendered badly
-- #3066 New tag overview. Not yet sure what works best.
+- #3066 #3067 New tag overview. Not yet sure what works best.
+- #3071 Top box with expense information (left to spend) is now more clear.
+- #2999 NOT YET DONE
+- #3075 Embarrassing typo in welcome email.
+- You can set the default language for Firefly III which will also apply to the login page.
+- Add Lando to readme.
+- Add support for Finnish! 🇫🇮
+- In the configuration `pgsql` is now the default database connection. This may break your non-`pgsql` installation if you haven't set it specifically to your database type.
+- A new debug view for transactions. Change the word "show" in `/transactions/show/123` to "debug" to get a nice JSON thing.
+- Foreign currencies should show up less often in edit/create transaction screens.
### Fixed
+- #3050 Date blocks were rendered badly.
+- #3070 The currency symbol would not precede the amount in some locales.
+- #3083 Fix category sort in report.
- #3045 Linking bills to liability accounts through rules was broken.
- #3042 Rule engine behavior was inconsistent when importing data.
- #3064 Weird bug in reports.
From ccb1f5657316909a20e200cda5061f176358b70b Mon Sep 17 00:00:00 2001
From: James Cole
Date: Sun, 9 Feb 2020 09:32:33 +0100
Subject: [PATCH 51/75] Various JS changes.
---
public/v1/js/app.js | 2 +-
public/v1/js/create_transaction.js | 2 +-
public/v1/js/edit_transaction.js | 2 +-
public/v1/js/profile.js | 2 +-
.../js/components/transactions/CreateTransaction.vue | 2 +-
.../js/components/transactions/ForeignAmountSelect.vue | 10 ++++++----
6 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/public/v1/js/app.js b/public/v1/js/app.js
index 74f62d08c6..bac3d05ae3 100644
--- a/public/v1/js/app.js
+++ b/public/v1/js/app.js
@@ -1 +1 @@
-!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=91)}([function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(41)},function(t,e,n){"use strict";var r=n(12),i=n(52),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===o.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=0&&d.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),v(t,e),e}function y(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function A(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=l++;n=u||(u=g(e)),r=w.bind(null,n,a,!1),i=w.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),v(t,e),e}(e),r=x.bind(null,n,e),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),r=C.bind(null,n),i=function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var r=[],i=0;i=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(o)})),t.exports=c}).call(this,n(11))},function(t,e,n){t.exports=n(51)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;nn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i div[data-v-61d92e31] {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%;\n}\n.ti-selected-item[data-v-61d92e31] {\n background-color: #5C6BC0;\n color: #fff;\n}\n',"",{version:3,sources:["C:/Users/johan/dev/vue-tags-input/vue-tags-input/C:/Users/johan/dev/vue-tags-input/vue-tags-input/vue-tags-input.scss"],names:[],mappings:"AAAA;EACE,uBAAuB;EACvB,mCAA8C;EAC9C,+JAAuM;EACvM,oBAAoB;EACpB,mBAAmB;CAAE;AAEvB;EACE,kCAAkC;EAClC,YAAY;EACZ,mBAAmB;EACnB,oBAAoB;EACpB,qBAAqB;EACrB,qBAAqB;EACrB,eAAe;EACf,oCAAoC;EACpC,mCAAmC;CAAE;AAEvC;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,YAAY;EACZ,aAAa;EACb,sBAAsB;CAAE;AAE1B;EACE,uBAAuB;CAAE;AAE3B;EACE,cAAc;CAAE;AAElB;EACE,8BAA8B;CAAE;AAElC;EACE,iBAAiB;EACjB,mBAAmB;EACnB,uBAAuB;CAAE;AAE3B;EACE,aAAa;CAAE;AACf;IACE,gBAAgB;CAAE;AAEtB;EACE,uBAAuB;EACvB,cAAc;EACd,aAAa;EACb,gBAAgB;CAAE;AAEpB;EACE,cAAc;EACd,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;CAAE;AAErB;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,cAAc;EACd,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,cAAc;CAAE;AAClB;IACE,cAAc;IACd,oBAAoB;CAAE;AACxB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,iBAAiB;CAAE;AACrB;IACE,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;CAAE;AACpB;MACE,gBAAgB;CAAE;AACtB;IACE,kBAAkB;CAAE;AACtB;IACE,0BAA0B;CAAE;AAEhC;EACE,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,YAAY;CAAE;AAElB;EACE,qBAAqB;CAAE;AAEzB;EACE,uBAAuB;EACvB,iBAAiB;EACjB,mBAAmB;EACnB,YAAY;EACZ,uBAAuB;EACvB,YAAY;CAAE;AAEhB;EACE,gBAAgB;EAChB,iBAAiB;EACjB,YAAY;CAAE;AAEhB;EACE,0BAA0B;EAC1B,YAAY;CAAE",file:"vue-tags-input.scss?vue&type=style&index=0&id=61d92e31&lang=scss&scoped=true&",sourcesContent:['@font-face {\n font-family: \'icomoon\';\n src: url("./assets/fonts/icomoon.eot?7grlse");\n src: url("./assets/fonts/icomoon.eot?7grlse#iefix") format("embedded-opentype"), url("./assets/fonts/icomoon.ttf?7grlse") format("truetype"), url("./assets/fonts/icomoon.woff?7grlse") format("woff");\n font-weight: normal;\n font-style: normal; }\n\n[class^="ti-icon-"], [class*=" ti-icon-"] {\n font-family: \'icomoon\' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale; }\n\n.ti-icon-check:before {\n content: "\\e902"; }\n\n.ti-icon-close:before {\n content: "\\e901"; }\n\n.ti-icon-undo:before {\n content: "\\e900"; }\n\nul {\n margin: 0px;\n padding: 0px;\n list-style-type: none; }\n\n*, *:before, *:after {\n box-sizing: border-box; }\n\ninput:focus {\n outline: none; }\n\ninput[disabled] {\n background-color: transparent; }\n\n.vue-tags-input {\n max-width: 450px;\n position: relative;\n background-color: #fff; }\n\ndiv.vue-tags-input.disabled {\n opacity: 0.5; }\n div.vue-tags-input.disabled * {\n cursor: default; }\n\n.ti-input {\n border: 1px solid #ccc;\n display: flex;\n padding: 4px;\n flex-wrap: wrap; }\n\n.ti-tags {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n line-height: 1em; }\n\n.ti-tag {\n background-color: #5C6BC0;\n color: #fff;\n border-radius: 2px;\n display: flex;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-tag:focus {\n outline: none; }\n .ti-tag .ti-content {\n display: flex;\n align-items: center; }\n .ti-tag .ti-tag-center {\n position: relative; }\n .ti-tag span {\n line-height: .85em; }\n .ti-tag span.ti-hidden {\n padding-left: 14px;\n visibility: hidden;\n height: 0px;\n white-space: pre; }\n .ti-tag .ti-actions {\n margin-left: 2px;\n display: flex;\n align-items: center;\n font-size: 1.15em; }\n .ti-tag .ti-actions i {\n cursor: pointer; }\n .ti-tag:last-child {\n margin-right: 4px; }\n .ti-tag.ti-invalid, .ti-tag.ti-tag.ti-deletion-mark {\n background-color: #e54d42; }\n\n.ti-new-tag-input-wrapper {\n display: flex;\n flex: 1 0 auto;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-new-tag-input-wrapper input {\n flex: 1 0 auto;\n min-width: 100px;\n border: none;\n padding: 0px;\n margin: 0px; }\n\n.ti-new-tag-input {\n line-height: initial; }\n\n.ti-autocomplete {\n border: 1px solid #ccc;\n border-top: none;\n position: absolute;\n width: 100%;\n background-color: #fff;\n z-index: 20; }\n\n.ti-item > div {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%; }\n\n.ti-selected-item {\n background-color: #5C6BC0;\n color: #fff; }\n'],sourceRoot:""}])},function(t,e,n){"use strict";t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){t.exports="data:font/ttf;base64,AAEAAAALAIAAAwAwT1MvMg8SBawAAAC8AAAAYGNtYXAXVtKJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZqWfozAAAAF4AAAA/GhlYWQPxZgIAAACdAAAADZoaGVhB4ADyAAAAqwAAAAkaG10eBIAAb4AAALQAAAAHGxvY2EAkgDiAAAC7AAAABBtYXhwAAkAHwAAAvwAAAAgbmFtZZlKCfsAAAMcAAABhnBvc3QAAwAAAAAEpAAAACAAAwOAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6QL//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAFYBAQO+AoEAHAAAATIXHgEXFhcHJicuAScmIyIGBxchERc2Nz4BNzYCFkpDQ28pKRdkECAfVTM0OT9wLZz+gJgdIiJLKSgCVRcYUjg5QiAzKys+ERIrJZoBgJoZFRQcCAgAAQDWAIEDKgLVAAsAAAEHFwcnByc3JzcXNwMq7u487u487u487u4Cme7uPO7uPO7uPO7uAAEAkgCBA4ACvQAFAAAlARcBJzcBgAHEPP4A7jz5AcQ8/gDuPAAAAAABAAAAAAAAH8nTUV8PPPUACwQAAAAAANZ1KhsAAAAA1nUqGwAAAAADvgLVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAO+AAEAAAAAAAAAAAAAAAAAAAAHBAAAAAAAAAAAAAAAAgAAAAQAAFYEAADWBAAAkgAAAAAACgAUAB4AUABqAH4AAQAAAAcAHQABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},function(t,e){t.exports="data:font/woff;base64,d09GRgABAAAAAAUQAAsAAAAABMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFrGNtYXAAAAFoAAAAVAAAAFQXVtKJZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAPwAAAD8pZ+jMGhlYWQAAALAAAAANgAAADYPxZgIaGhlYQAAAvgAAAAkAAAAJAeAA8hobXR4AAADHAAAABwAAAAcEgABvmxvY2EAAAM4AAAAEAAAABAAkgDibWF4cAAAA0gAAAAgAAAAIAAJAB9uYW1lAAADaAAAAYYAAAGGmUoJ+3Bvc3QAAATwAAAAIAAAACAAAwAAAAMDgAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QIDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkC//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQBWAQEDvgKBABwAAAEyFx4BFxYXByYnLgEnJiMiBgcXIREXNjc+ATc2AhZKQ0NvKSkXZBAgH1UzNDk/cC2c/oCYHSIiSykoAlUXGFI4OUIgMysrPhESKyWaAYCaGRUUHAgIAAEA1gCBAyoC1QALAAABBxcHJwcnNyc3FzcDKu7uPO7uPO7uPO7uApnu7jzu7jzu7jzu7gABAJIAgQOAAr0ABQAAJQEXASc3AYABxDz+AO48+QHEPP4A7jwAAAAAAQAAAAAAAB/J01FfDzz1AAsEAAAAAADWdSobAAAAANZ1KhsAAAAAA74C1QAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADvgABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABWBAAA1gQAAJIAAAAAAAoAFAAeAFAAagB+AAEAAAAHAB0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAHAAAAAQAAAAAAAgAHAGAAAQAAAAAAAwAHADYAAQAAAAAABAAHAHUAAQAAAAAABQALABUAAQAAAAAABgAHAEsAAQAAAAAACgAaAIoAAwABBAkAAQAOAAcAAwABBAkAAgAOAGcAAwABBAkAAwAOAD0AAwABBAkABAAOAHwAAwABBAkABQAWACAAAwABBAkABgAOAFIAAwABBAkACgA0AKRpY29tb29uAGkAYwBvAG0AbwBvAG5WZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADBpY29tb29uAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG5SZWd1bGFyAFIAZQBnAHUAbABhAHJpY29tb29uAGkAYwBvAG0AbwBvAG5Gb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-tags-input",class:[{"ti-disabled":t.disabled},{"ti-focus":t.focused}]},[n("div",{staticClass:"ti-input"},[t.tagsCopy?n("ul",{staticClass:"ti-tags"},[t._l(t.tagsCopy,(function(e,r){return n("li",{key:r,staticClass:"ti-tag",class:[{"ti-editing":t.tagsEditStatus[r]},e.tiClasses,e.classes,{"ti-deletion-mark":t.isMarked(r)}],style:e.style,attrs:{tabindex:"0"},on:{click:function(n){return t.$emit("tag-clicked",{tag:e,index:r})}}},[n("div",{staticClass:"ti-content"},[t.$scopedSlots["tag-left"]?n("div",{staticClass:"ti-tag-left"},[t._t("tag-left",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e(),t._v(" "),n("div",{ref:"tagCenter",refInFor:!0,staticClass:"ti-tag-center"},[t.$scopedSlots["tag-center"]?t._e():n("span",{class:{"ti-hidden":t.tagsEditStatus[r]},on:{click:function(e){return t.performEditTag(r)}}},[t._v(t._s(e.text))]),t._v(" "),t.$scopedSlots["tag-center"]?t._e():n("tag-input",{attrs:{scope:{edit:t.tagsEditStatus[r],maxlength:t.maxlength,tag:e,index:r,validateTag:t.createChangedTag,performCancelEdit:t.cancelEdit,performSaveEdit:t.performSaveTag}}}),t._v(" "),t._t("tag-center",null,{tag:e,index:r,maxlength:t.maxlength,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,validateTag:t.createChangedTag,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2),t._v(" "),t.$scopedSlots["tag-right"]?n("div",{staticClass:"ti-tag-right"},[t._t("tag-right",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e()]),t._v(" "),n("div",{staticClass:"ti-actions"},[t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:t.tagsEditStatus[r],expression:"tagsEditStatus[index]"}],staticClass:"ti-icon-undo",on:{click:function(e){return t.cancelEdit(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:!t.tagsEditStatus[r],expression:"!tagsEditStatus[index]"}],staticClass:"ti-icon-close",on:{click:function(e){return t.performDeleteTag(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._t("tag-actions",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)}):t._e()],2)])})),t._v(" "),n("li",{staticClass:"ti-new-tag-input-wrapper"},[n("input",t._b({ref:"newTagInput",staticClass:"ti-new-tag-input",class:[t.createClasses(t.newTag,t.tags,t.validation,t.isDuplicate)],attrs:{placeholder:t.placeholder,maxlength:t.maxlength,disabled:t.disabled,type:"text",size:"1"},domProps:{value:t.newTag},on:{keydown:[function(e){return t.performAddTags(t.filteredAutocompleteItems[t.selectedItem]||t.newTag,e)},function(e){return e.type.indexOf("key")||8===e.keyCode?t.invokeDelete(e):null},function(e){return e.type.indexOf("key")||9===e.keyCode?t.performBlur(e):null},function(e){return e.type.indexOf("key")||38===e.keyCode?t.selectItem(e,"before"):null},function(e){return e.type.indexOf("key")||40===e.keyCode?t.selectItem(e,"after"):null}],paste:t.addTagsFromPaste,input:t.updateNewTag,blur:function(e){return t.$emit("blur",e)},focus:function(e){t.focused=!0,t.$emit("focus",e)},click:function(e){!t.addOnlyFromAutocomplete&&(t.selectedItem=null)}}},"input",t.$attrs,!1))])],2):t._e()]),t._v(" "),t._t("between-elements"),t._v(" "),t.autocompleteOpen?n("div",{staticClass:"ti-autocomplete",on:{mouseout:function(e){t.selectedItem=null}}},[t._t("autocomplete-header"),t._v(" "),n("ul",t._l(t.filteredAutocompleteItems,(function(e,r){return n("li",{key:r,staticClass:"ti-item",class:[e.tiClasses,e.classes,{"ti-selected-item":t.isSelected(r)}],style:e.style,on:{mouseover:function(e){!t.disabled&&(t.selectedItem=r)}}},[t.$scopedSlots["autocomplete-item"]?t._t("autocomplete-item",null,{item:e,index:r,performAdd:function(e){return t.performAddTags(e,void 0,"autocomplete")},selected:t.isSelected(r)}):n("div",{on:{click:function(n){return t.performAddTags(e,void 0,"autocomplete")}}},[t._v("\n "+t._s(e.text)+"\n ")])],2)})),0),t._v(" "),t._t("autocomplete-footer")],2):t._e()],2)};r._withStripped=!0;var i=n(5),o=n.n(i),a=function(t){return JSON.parse(JSON.stringify(t))},s=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0;void 0===t.text&&(t={text:t});var i=function(t,e){return e.filter((function(e){var n=t.text;return"string"==typeof e.rule?!new RegExp(e.rule).test(n):e.rule instanceof RegExp?!e.rule.test(n):"[object Function]"==={}.toString.call(e.rule)?e.rule(t):void 0})).map((function(t){return t.classes}))}(t,n),o=function(t,e){for(var n=0;n1?n-1:0),i=1;i1?e-1:0),r=1;r=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems:function(){var t=this,e=this.autocompleteItems.map((function(e){return c(e,t.tags,t.validation,t.isDuplicate)}));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:s,getSelectedIndex:function(t){var e=this.filteredAutocompleteItems,n=this.selectedItem,r=e.length-1;if(0!==e.length)return null===n?0:"before"===t&&0===n?r:"after"===t&&n===r?0:"after"===t?n+1:n-1},selectDefaultItem:function(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem:function(t,e){t.preventDefault(),this.selectedItem=this.getSelectedIndex(e)},isSelected:function(t){return this.selectedItem===t},isMarked:function(t){return this.deletionMark===t},invokeDelete:function(){var t=this;if(this.deleteOnBackspace&&!(this.newTag.length>0)){var e=this.tagsCopy.length-1;null===this.deletionMark?(this.deletionMarkTime=setTimeout((function(){return t.deletionMark=null}),1e3),this.deletionMark=e):this.performDeleteTag(e)}},addTagsFromPaste:function(){var t=this;this.addFromPaste&&setTimeout((function(){return t.performAddTags(t.newTag)}),10)},performEditTag:function(t){var e=this;this.allowEditTags&&(this._events["before-editing-tag"]||this.editTag(t),this.$emit("before-editing-tag",{index:t,tag:this.tagsCopy[t],editTag:function(){return e.editTag(t)}}))},editTag:function(t){this.allowEditTags&&(this.toggleEditMode(t),this.focus(t))},toggleEditMode:function(t){this.allowEditTags&&!this.disabled&&this.$set(this.tagsEditStatus,t,!this.tagsEditStatus[t])},createChangedTag:function(t,e){var n=this.tagsCopy[t];n.text=e?e.target.value:this.tagsCopy[t].text,this.$set(this.tagsCopy,t,c(n,this.tagsCopy,this.validation,this.isDuplicate))},focus:function(t){var e=this;this.$nextTick((function(){var n=e.$refs.tagCenter[t].querySelector("input.ti-tag-input");n&&n.focus()}))},quote:function(t){return t.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit:function(t){this.tags[t]&&(this.tagsCopy[t]=a(c(this.tags[t],this.tags,this.validation,this.isDuplicate)),this.$set(this.tagsEditStatus,t,!1))},hasForbiddingAddRule:function(t){var e=this;return t.some((function(t){var n=e.validation.find((function(e){return t===e.classes}));return!!n&&n.disableAdd}))},createTagTexts:function(t){var e=this,n=new RegExp(this.separators.map((function(t){return e.quote(t)})).join("|"));return t.split(n).map((function(t){return{text:t}}))},performDeleteTag:function(t){var e=this;this._events["before-deleting-tag"]||this.deleteTag(t),this.$emit("before-deleting-tag",{index:t,tag:this.tagsCopy[t],deleteTag:function(){return e.deleteTag(t)}})},deleteTag:function(t){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(t,1),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey:function(t,e){var n=-1!==this[e].indexOf(t.keyCode)||-1!==this[e].indexOf(t.key);return n&&t.preventDefault(),!n},performAddTags:function(t,e,n){var r=this;if(!(this.disabled||e&&this.noTriggerKey(e,"addOnKey"))){var i=[];"object"===y(t)&&(i=[t]),"string"==typeof t&&(i=this.createTagTexts(t)),(i=i.filter((function(t){return t.text.trim().length>0}))).forEach((function(t){t=c(t,r.tags,r.validation,r.isDuplicate),r._events["before-adding-tag"]||r.addTag(t,n),r.$emit("before-adding-tag",{tag:t,addTag:function(){return r.addTag(t,n)}})}))}},duplicateFilter:function(t){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,t):!this.tagsCopy.find((function(e){return e.text===t.text}))},addTag:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"new-tag-input",r=this.filteredAutocompleteItems.map((function(t){return t.text}));this.addOnlyFromAutocomplete&&-1===r.indexOf(t.text)||this.$nextTick((function(){return e.maxTags&&e.maxTags<=e.tagsCopy.length?e.$emit("max-tags-reached",t):e.avoidAddingDuplicates&&!e.duplicateFilter(t)?e.$emit("adding-duplicate",t):void(e.hasForbiddingAddRule(t.tiClasses)||(e.$emit("input",""),e.tagsCopy.push(t),e._events["update:tags"]&&e.$emit("update:tags",e.tagsCopy),"autocomplete"===n&&e.$refs.newTagInput.focus(),e.$emit("tags-changed",e.tagsCopy)))}))},performSaveTag:function(t,e){var n=this,r=this.tagsCopy[t];this.disabled||e&&this.noTriggerKey(e,"addOnKey")||0!==r.text.trim().length&&(this._events["before-saving-tag"]||this.saveTag(t,r),this.$emit("before-saving-tag",{index:t,tag:r,saveTag:function(){return n.saveTag(t,r)}}))},saveTag:function(t,e){if(this.avoidAddingDuplicates){var n=a(this.tagsCopy),r=n.splice(t,1)[0];if(this.isDuplicate?this.isDuplicate(n,r):-1!==n.map((function(t){return t.text})).indexOf(r.text))return this.$emit("saving-duplicate",e)}this.hasForbiddingAddRule(e.tiClasses)||(this.$set(this.tagsCopy,t,e),this.toggleEditMode(t),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual:function(){var t=this;return!this.tagsCopy.some((function(e,n){return!o()(e,t.tags[n])}))},updateNewTag:function(t){var e=t.target.value;this.newTag=e,this.$emit("input",e)},initTags:function(){this.tagsCopy=u(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=a(this.tags).map((function(){return!1})),this._events["update:tags"]&&!this.tagsEqual()&&this.$emit("update:tags",this.tagsCopy)},blurredOnClick:function(t){this.$el.contains(t.target)||this.$el.contains(document.activeElement)||this.performBlur(t)},performBlur:function(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{value:function(t){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=t},tags:{handler:function(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created:function(){this.newTag=this.value,this.initTags()},mounted:function(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},destroyed:function(){document.removeEventListener("click",this.blurredOnClick)}},_=(n(9),f(A,r,[],!1,null,"61d92e31",null));_.options.__file="vue-tags-input/vue-tags-input.vue";var b=_.exports;n.d(e,"VueTagsInput",(function(){return b})),n.d(e,"createClasses",(function(){return s})),n.d(e,"createTag",(function(){return c})),n.d(e,"createTags",(function(){return u})),n.d(e,"TagInput",(function(){return h})),b.install=function(t){return t.component(b.name,b)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(b),e.default=b}])},function(t,e,n){"use strict";n.r(e),n.d(e,"Carousel",(function(){return l})),n.d(e,"Slide",(function(){return h})),n.d(e,"Collapse",(function(){return J})),n.d(e,"Dropdown",(function(){return X})),n.d(e,"Modal",(function(){return ht})),n.d(e,"Tab",(function(){return vt})),n.d(e,"Tabs",(function(){return mt})),n.d(e,"DatePicker",(function(){return _t})),n.d(e,"Affix",(function(){return Tt})),n.d(e,"Alert",(function(){return kt})),n.d(e,"Pagination",(function(){return Et})),n.d(e,"Tooltip",(function(){return St})),n.d(e,"Popover",(function(){return Bt})),n.d(e,"TimePicker",(function(){return Dt})),n.d(e,"Typeahead",(function(){return Ot})),n.d(e,"ProgressBar",(function(){return Nt})),n.d(e,"ProgressBarStack",(function(){return It})),n.d(e,"Breadcrumbs",(function(){return Pt})),n.d(e,"BreadcrumbItem",(function(){return jt})),n.d(e,"Btn",(function(){return dt})),n.d(e,"BtnGroup",(function(){return lt})),n.d(e,"BtnToolbar",(function(){return Lt})),n.d(e,"MultiSelect",(function(){return Rt})),n.d(e,"Navbar",(function(){return Mt})),n.d(e,"NavbarNav",(function(){return Ft})),n.d(e,"NavbarForm",(function(){return Ut})),n.d(e,"NavbarText",(function(){return Ht})),n.d(e,"tooltip",(function(){return Vt})),n.d(e,"popover",(function(){return Jt})),n.d(e,"scrollspy",(function(){return oe})),n.d(e,"MessageBox",(function(){return he})),n.d(e,"Notification",(function(){return $e})),n.d(e,"install",(function(){return Be}));var r=n(1),i=n.n(r);function o(t){return null!=t}function a(t){return"function"==typeof t}function s(t){return"number"==typeof t}function c(t){return"string"==typeof t}function u(){return"undefined"!=typeof window&&o(window.Promise)}var l={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"carousel slide",attrs:{"data-ride":"carousel"},on:{mouseenter:t.stopInterval,mouseleave:t.startInterval}},[t.indicators?t._t("indicators",[n("ol",{staticClass:"carousel-indicators"},t._l(t.slides,(function(e,r){return n("li",{class:{active:r===t.activeIndex},on:{click:function(e){return t.select(r)}}})})),0)],{select:t.select,activeIndex:t.activeIndex}):t._e(),t._v(" "),n("div",{staticClass:"carousel-inner",attrs:{role:"listbox"}},[t._t("default")],2),t._v(" "),t.controls?n("a",{staticClass:"left carousel-control",attrs:{href:"#",role:"button"},on:{click:function(e){return e.preventDefault(),t.prev()}}},[n("span",{class:t.iconControlLeft,attrs:{"aria-hidden":"true"}}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v("Previous")])]):t._e(),t._v(" "),t.controls?n("a",{staticClass:"right carousel-control",attrs:{href:"#",role:"button"},on:{click:function(e){return e.preventDefault(),t.next()}}},[n("span",{class:t.iconControlRight,attrs:{"aria-hidden":"true"}}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v("Next")])]):t._e()],2)},staticRenderFns:[],props:{value:Number,indicators:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},interval:{type:Number,default:5e3},iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{slides:[],activeIndex:0,timeoutId:0,intervalId:0}},watch:{interval:function(){this.startInterval()},value:function(t,e){this.run(t,e),this.activeIndex=t}},mounted:function(){o(this.value)&&(this.activeIndex=this.value),this.slides.length>0&&this.$select(this.activeIndex),this.startInterval()},beforeDestroy:function(){this.stopInterval()},methods:{run:function(t,e){var n=this,r=e||0,i=void 0;i=t>r?["next","left"]:["prev","right"],this.slides[t].slideClass[i[0]]=!0,this.$nextTick((function(){n.slides[t].$el.offsetHeight,n.slides.forEach((function(e,n){n===r?(e.slideClass.active=!0,e.slideClass[i[1]]=!0):n===t&&(e.slideClass[i[1]]=!0)})),n.timeoutId=setTimeout((function(){n.$select(t),n.$emit("change",t),n.timeoutId=0}),600)}))},startInterval:function(){var t=this;this.stopInterval(),this.interval>0&&(this.intervalId=setInterval((function(){t.next()}),this.interval))},stopInterval:function(){clearInterval(this.intervalId),this.intervalId=0},resetAllSlideClass:function(){this.slides.forEach((function(t){t.slideClass.active=!1,t.slideClass.left=!1,t.slideClass.right=!1,t.slideClass.next=!1,t.slideClass.prev=!1}))},$select:function(t){this.resetAllSlideClass(),this.slides[t].slideClass.active=!0},select:function(t){0===this.timeoutId&&t!==this.activeIndex&&(o(this.value)?this.$emit("input",t):(this.run(t,this.activeIndex),this.activeIndex=t))},prev:function(){this.select(0===this.activeIndex?this.slides.length-1:this.activeIndex-1)},next:function(){this.select(this.activeIndex===this.slides.length-1?0:this.activeIndex+1)}}};function d(t,e){if(Array.isArray(t)){var n=t.indexOf(e);n>=0&&t.splice(n,1)}}function f(t){return Array.prototype.slice.call(t||[])}function p(t,e,n){return n.indexOf(t)===e}var h={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"item",class:this.slideClass},[this._t("default")],2)},staticRenderFns:[],data:function(){return{slideClass:{active:!1,prev:!1,next:!1,left:!1,right:!1}}},created:function(){try{this.$parent.slides.push(this)}catch(t){throw new Error("Slide parent must be Carousel.")}},beforeDestroy:function(){d(this.$parent&&this.$parent.slides,this)}},v="mouseenter",m="mouseleave",g="focus",y="blur",A="click",_="input",b="keydown",w="keyup",C="resize",x="scroll",T="touchend",k="click",E="hover",$="focus",S="hover-focus",B="outside-click",D="top",O="right",I="bottom",N="left";function j(t){return window.getComputedStyle(t)}function P(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}var L=null,R=null;function M(t,e,n){t.addEventListener(e,n)}function F(t,e,n){t.removeEventListener(e,n)}function U(t){return t&&t.nodeType===Node.ELEMENT_NODE}function H(t){U(t)&&U(t.parentNode)&&t.parentNode.removeChild(t)}function z(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=e.length;--n>=0&&e.item(n)!==this;);return n>-1})}function q(t,e){if(U(t))if(t.className){var n=t.className.split(" ");n.indexOf(e)<0&&(n.push(e),t.className=n.join(" "))}else t.className=e}function W(t,e){if(U(t)&&t.className){for(var n=t.className.split(" "),r=[],i=0,o=n.length;i=i.height,u=r.left+r.width/2>=i.width/2,s=r.right-r.width/2+i.width/2<=o.width;break;case I:c=r.bottom+i.height<=o.height,u=r.left+r.width/2>=i.width/2,s=r.right-r.width/2+i.width/2<=o.width;break;case O:s=r.right+i.width<=o.width,a=r.top+r.height/2>=i.height/2,c=r.bottom-r.height/2+i.height/2<=o.height;break;case N:u=r.left>=i.width,a=r.top+r.height/2>=i.height/2,c=r.bottom-r.height/2+i.height/2<=o.height}return a&&s&&c&&u}function V(t){var e=t.scrollHeight>t.clientHeight,n=j(t);return e||"scroll"===n.overflow||"scroll"===n.overflowY}function Y(t){var e=document.body;if(t)W(e,"modal-open"),e.style.paddingRight=null;else{var n=-1!==window.navigator.appVersion.indexOf("MSIE 10")||!!window.MSInputMethodContext&&!!document.documentMode;(V(document.documentElement)||V(document.body))&&!n&&(e.style.paddingRight=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=P();if(null!==L&&!t&&e.height===R.height&&e.width===R.width)return L;if("loading"===document.readyState)return null;var n=document.createElement("div"),r=document.createElement("div");return n.style.width=r.style.width=n.style.height=r.style.height="100px",n.style.overflow="scroll",r.style.overflow="hidden",document.body.appendChild(n),document.body.appendChild(r),L=Math.abs(n.scrollHeight-r.scrollHeight),document.body.removeChild(n),document.body.removeChild(r),R=e,L}()+"px"),q(e,"modal-open")}}function G(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;z();for(var r=[],i=t.parentElement;i;){if(i.matches(e))r.push(i);else if(n&&(n===i||i.matches(n)))break;i=i.parentElement}return r}function K(t){U(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}var J={render:function(t){return t(this.tag,{},this.$slots.default)},props:{tag:{type:String,default:"div"},value:{type:Boolean,default:!1},transitionDuration:{type:Number,default:350}},data:function(){return{timeoutId:0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){var t=this.$el;q(t,"collapse"),this.value&&q(t,"in")},methods:{toggle:function(t){var e=this;clearTimeout(this.timeoutId);var n=this.$el;if(t){this.$emit("show"),W(n,"collapse"),n.style.height="auto";var r=window.getComputedStyle(n).height;n.style.height=null,q(n,"collapsing"),n.offsetHeight,n.style.height=r,this.timeoutId=setTimeout((function(){W(n,"collapsing"),q(n,"collapse"),q(n,"in"),n.style.height=null,e.timeoutId=0,e.$emit("shown")}),this.transitionDuration)}else this.$emit("hide"),n.style.height=window.getComputedStyle(n).height,W(n,"in"),W(n,"collapse"),n.offsetHeight,n.style.height=null,q(n,"collapsing"),this.timeoutId=setTimeout((function(){q(n,"collapse"),W(n,"collapsing"),n.style.height=null,e.timeoutId=0,e.$emit("hidden")}),this.transitionDuration)}}},X={render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(M(this.triggerEl,A,this.toggle),M(this.triggerEl,b,this.onKeyPress)),M(this.$refs.dropdown,b,this.onKeyPress),M(window,A,this.windowClicked),M(window,T,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(F(this.triggerEl,A,this.toggle),F(this.triggerEl,b,this.onKeyPress)),F(this.$refs.dropdown,b,this.onKeyPress),F(window,A,this.windowClicked),F(window,T,this.windowClicked)},methods:{onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,n=t.keyCode||t.which;if(27===n)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===n){var r=e.querySelector("li > a:focus");r&&r.click()}else if(38===n||40===n){t.preventDefault(),t.stopPropagation();var i=e.querySelector("li > a:focus"),o=e.querySelectorAll("li:not(.disabled) > a");if(i){for(var a=0;a0?K(o[a-1]):40===n&&a=0;a=o||s&&c}if(a){n=!0;break}}var u=this.$refs.dropdown.contains(e),l=this.$el.contains(e)&&!u,d=u&&"touchend"===t.type;l||n||d||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.documentElement,i=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),o=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=e.getBoundingClientRect(),s=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",n.menuRight?t.style.left=i+a.left+a.width-s.width+"px":t.style.left=i+a.left+"px",n.dropup?t.style.top=o+a.top-s.height-4+"px":t.style.top=o+a.top+a.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}},Z={uiv:{datePicker:{clear:"Clear",today:"Today",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",week1:"Mon",week2:"Tue",week3:"Wed",week4:"Thu",week5:"Fri",week6:"Sat",week7:"Sun"},timePicker:{am:"AM",pm:"PM"},modal:{cancel:"Cancel",ok:"OK"},multiSelect:{placeholder:"Select...",filterPlaceholder:"Search..."}}},tt=function(){var t=Object.getPrototypeOf(this).$t;if(a(t))try{return t.apply(this,arguments)}catch(t){return this.$t.apply(this,arguments)}},et=function(t,e){e=e||{};var n=tt.apply(this,arguments);if(o(n)&&!e.$$locale)return n;for(var r=t.split("."),i=e.$$locale||Z,a=0,s=r.length;a=0:i.value===i.inputValue,c=(n={btn:!0,active:i.inputType?s:i.active,disabled:i.disabled,"btn-block":i.block},it(n,"btn-"+i.type,Boolean(i.type)),it(n,"btn-"+i.size,Boolean(i.size)),n),u={click:function(t){i.disabled&&t instanceof Event&&(t.preventDefault(),t.stopPropagation())}},l=void 0,d=void 0,f=void 0;return i.href?(l="a",f=r,d=st(o,{on:u,class:c,attrs:{role:"button",href:i.href,target:i.target}})):i.to?(l="router-link",f=r,d=st(o,{nativeOn:u,class:c,props:{event:i.disabled?"":"click",to:i.to,replace:i.replace,append:i.append,exact:i.exact},attrs:{role:"button"}})):i.inputType?(l="label",d=st(o,{on:u,class:c}),f=[t("input",{attrs:{autocomplete:"off",type:i.inputType,checked:s?"checked":null,disabled:i.disabled},domProps:{checked:s},on:{change:function(){if("checkbox"===i.inputType){var t=i.value.slice();s?t.splice(t.indexOf(i.inputValue),1):t.push(i.inputValue),a.input(t)}else a.input(i.inputValue)}}}),r]):i.justified?(l=lt,d={},f=[t("button",st(o,{on:u,class:c,attrs:{type:i.nativeType,disabled:i.disabled}}),r)]):(l="button",f=r,d=st(o,{on:u,class:c,attrs:{type:i.nativeType,disabled:i.disabled}})),t(l,d,f)},props:{justified:{type:Boolean,default:!1},type:{type:String,default:"default"},nativeType:{type:String,default:"button"},size:String,block:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:null,inputValue:null,inputType:{type:String,validator:function(t){return"checkbox"===t||"radio"===t}}}},ft=function(){return document.querySelectorAll(".modal-backdrop")},pt=function(){return ft().length},ht={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"modal",class:{fade:t.transitionDuration>0},attrs:{tabindex:"-1",role:"dialog"},on:{click:function(e){return e.target!==e.currentTarget?null:t.backdropClicked(e)}}},[n("div",{ref:"dialog",staticClass:"modal-dialog",class:t.modalSizeClass,attrs:{role:"document"}},[n("div",{staticClass:"modal-content"},[t.header?n("div",{staticClass:"modal-header"},[t._t("header",[t.dismissBtn?n("button",{staticClass:"close",staticStyle:{position:"relative","z-index":"1060"},attrs:{type:"button","aria-label":"Close"},on:{click:function(e){return t.toggle(!1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]):t._e(),t._v(" "),n("h4",{staticClass:"modal-title"},[t._t("title",[t._v(t._s(t.title))])],2)])],2):t._e(),t._v(" "),n("div",{staticClass:"modal-body"},[t._t("default")],2),t._v(" "),t.footer?n("div",{staticClass:"modal-footer"},[t._t("footer",[n("btn",{attrs:{type:t.cancelType},on:{click:function(e){return t.toggle(!1,"cancel")}}},[n("span",[t._v(t._s(t.cancelText||t.t("uiv.modal.cancel")))])]),t._v(" "),n("btn",{attrs:{type:t.okType,"data-action":"auto-focus"},on:{click:function(e){return t.toggle(!1,"ok")}}},[n("span",[t._v(t._s(t.okText||t.t("uiv.modal.ok")))])])])],2):t._e()])]),t._v(" "),n("div",{ref:"backdrop",staticClass:"modal-backdrop",class:{fade:t.transitionDuration>0}})])},staticRenderFns:[],mixins:[at],components:{Btn:dt},props:{value:{type:Boolean,default:!1},title:String,size:String,backdrop:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},header:{type:Boolean,default:!0},cancelText:String,cancelType:{type:String,default:"default"},okText:String,okType:{type:String,default:"primary"},dismissBtn:{type:Boolean,default:!0},transitionDuration:{type:Number,default:150},autoFocus:{type:Boolean,default:!1},keyboard:{type:Boolean,default:!0},beforeClose:Function,zOffset:{type:Number,default:20},appendToBody:{type:Boolean,default:!1},displayStyle:{type:String,default:"block"}},data:function(){return{msg:"",timeoutId:0}},computed:{modalSizeClass:function(){return it({},"modal-"+this.size,Boolean(this.size))}},watch:{value:function(t){this.$toggle(t)}},mounted:function(){H(this.$refs.backdrop),M(window,w,this.onKeyPress),this.value&&this.$toggle(!0)},beforeDestroy:function(){clearTimeout(this.timeoutId),H(this.$refs.backdrop),H(this.$el),0===pt()&&Y(!0),F(window,w,this.onKeyPress)},methods:{onKeyPress:function(t){if(this.keyboard&&this.value&&27===t.keyCode){var e=this.$refs.backdrop,n=e.style.zIndex;n=n&&"auto"!==n?parseInt(n):0;for(var r=ft(),i=r.length,o=0;on)return}this.toggle(!1)}},toggle:function(t,e){(t||!a(this.beforeClose)||this.beforeClose(e))&&(this.msg=e,this.$emit("input",t))},$toggle:function(t){var e=this,n=this.$el,r=this.$refs.backdrop;if(clearTimeout(this.timeoutId),t){var i=pt();if(document.body.appendChild(r),this.appendToBody&&document.body.appendChild(n),n.style.display=this.displayStyle,n.scrollTop=0,r.offsetHeight,Y(!1),q(r,"in"),q(n,"in"),i>0){var o=parseInt(j(n).zIndex)||1050,a=parseInt(j(r).zIndex)||1040,s=i*this.zOffset;n.style.zIndex=""+(o+s),r.style.zIndex=""+(a+s)}this.timeoutId=setTimeout((function(){if(e.autoFocus){var t=e.$el.querySelector('[data-action="auto-focus"]');t&&t.focus()}e.$emit("show"),e.timeoutId=0}),this.transitionDuration)}else W(r,"in"),W(n,"in"),this.timeoutId=setTimeout((function(){n.style.display="none",H(r),e.appendToBody&&H(n),0===pt()&&Y(!0),e.$emit("hide",e.msg||"dismiss"),e.msg="",e.timeoutId=0,n.style.zIndex="",r.style.zIndex=""}),this.transitionDuration)},backdropClicked:function(t){this.backdrop&&this.toggle(!1)}}},vt={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"tab-pane",class:{fade:this.transition>0},attrs:{role:"tabpanel"}},[this._t("default")],2)},staticRenderFns:[],props:{title:{type:String,default:"Tab Title"},htmlTitle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},"tab-classes":{type:Object,default:function(){return{}}},group:String,pullRight:{type:Boolean,default:!1}},data:function(){return{active:!0,transition:150}},watch:{active:function(t){var e=this;t?setTimeout((function(){q(e.$el,"active"),e.$el.offsetHeight,q(e.$el,"in");try{e.$parent.$emit("after-change",e.$parent.activeIndex)}catch(t){throw new Error(" parent must be .")}}),this.transition):(W(this.$el,"in"),setTimeout((function(){W(e.$el,"active")}),this.transition))}},created:function(){try{this.$parent.tabs.push(this)}catch(t){throw new Error(" parent must be .")}},beforeDestroy:function(){d(this.$parent&&this.$parent.tabs,this)},methods:{show:function(){var t=this;this.$nextTick((function(){q(t.$el,"active"),q(t.$el,"in")}))}}},mt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",[n("ul",{class:t.navClasses,attrs:{role:"tablist"}},[t._l(t.groupedTabs,(function(e,r){return[e.tabs?n("dropdown",{class:t.getTabClasses(e),attrs:{role:"presentation",tag:"li"}},[n("a",{staticClass:"dropdown-toggle",attrs:{role:"tab",href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v(t._s(e.group)+" "),n("span",{staticClass:"caret"})]),t._v(" "),n("template",{slot:"dropdown"},t._l(e.tabs,(function(e){return n("li",{class:t.getTabClasses(e,!0)},[n("a",{attrs:{href:"#"},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}},[t._v(t._s(e.title))])])})),0)],2):n("li",{class:t.getTabClasses(e),attrs:{role:"presentation"}},[e.htmlTitle?n("a",{attrs:{role:"tab",href:"#"},domProps:{innerHTML:t._s(e.title)},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}}):n("a",{attrs:{role:"tab",href:"#"},domProps:{textContent:t._s(e.title)},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}})])]})),t._v(" "),!t.justified&&t.$slots["nav-right"]?n("li",{staticClass:"pull-right"},[t._t("nav-right")],2):t._e()],2),t._v(" "),n("div",{staticClass:"tab-content"},[t._t("default")],2)])},staticRenderFns:[],components:{Dropdown:X},props:{value:{type:Number,validator:function(t){return t>=0}},transitionDuration:{type:Number,default:150},justified:Boolean,pills:Boolean,stacked:Boolean,customNavClass:null},data:function(){return{tabs:[],activeIndex:0}},watch:{value:{immediate:!0,handler:function(t){s(t)&&(this.activeIndex=t,this.selectCurrent())}},tabs:function(t){var e=this;t.forEach((function(t,n){t.transition=e.transitionDuration,n===e.activeIndex&&t.show()})),this.selectCurrent()}},computed:{navClasses:function(){var t={nav:!0,"nav-justified":this.justified,"nav-tabs":!this.pills,"nav-pills":this.pills,"nav-stacked":this.stacked&&this.pills},e=this.customNavClass;return o(e)?c(e)?ot({},t,it({},e,!0)):ot({},t,e):t},groupedTabs:function(){var t=[],e={};return this.tabs.forEach((function(n){n.group?(e.hasOwnProperty(n.group)?t[e[n.group]].tabs.push(n):(t.push({tabs:[n],group:n.group}),e[n.group]=t.length-1),n.active&&(t[e[n.group]].active=!0),n.pullRight&&(t[e[n.group]].pullRight=!0)):t.push(n)})),t}},methods:{getTabClasses:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={active:t.active,disabled:t.disabled,"pull-right":t.pullRight&&!e};return ot(n,t.tabClasses)},selectCurrent:function(){var t=this,e=!1;this.tabs.forEach((function(n,r){r===t.activeIndex?(e=!n.active,n.active=!0):n.active=!1})),e&&this.$emit("change",this.activeIndex)},selectValidate:function(t){var e=this;a(this.$listeners["before-change"])?this.$emit("before-change",this.activeIndex,t,(function(n){o(n)||e.$select(t)})):this.$select(t)},select:function(t){this.tabs[t].disabled||t===this.activeIndex||this.selectValidate(t)},$select:function(t){s(this.value)?this.$emit("input",t):(this.activeIndex=t,this.selectCurrent())}}};function gt(t,e){for(var n=e-(t+="").length;n>0;n--)t="0"+t;return t}var yt=["January","February","March","April","May","June","July","August","September","October","November","December"];function At(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}var _t={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:t.pickerStyle,attrs:{"data-role":"date-picker"},on:{click:t.onPickerClick}},[n("date-view",{directives:[{name:"show",rawName:"v-show",value:"d"===t.view,expression:"view==='d'"}],attrs:{month:t.currentMonth,year:t.currentYear,date:t.valueDateObj,today:t.now,limit:t.limit,"week-starts-with":t.weekStartsWith,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,"date-class":t.dateClass,"year-month-formatter":t.yearMonthFormatter,"week-numbers":t.weekNumbers,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"date-change":t.onDateChange,"view-change":t.onViewChange}}),t._v(" "),n("month-view",{directives:[{name:"show",rawName:"v-show",value:"m"===t.view,expression:"view==='m'"}],attrs:{month:t.currentMonth,year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),n("year-view",{directives:[{name:"show",rawName:"v-show",value:"y"===t.view,expression:"view==='y'"}],attrs:{year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight},on:{"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),t.todayBtn||t.clearBtn?n("div",[n("br"),t._v(" "),n("div",{staticClass:"text-center"},[t.todayBtn?n("btn",{attrs:{"data-action":"select",type:"info",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.today"))},on:{click:t.selectToday}}):t._e(),t._v(" "),t.clearBtn?n("btn",{attrs:{"data-action":"select",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.clear"))},on:{click:t.clearSelect}}):t._e()],1)]):t._e()],1)},staticRenderFns:[],mixins:[at],components:{DateView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevMonth}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:t.weekNumbers?6:5}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.changeView}},[n("b",[t._v(t._s(t.yearMonthStr))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextMonth}},[n("i",{class:t.iconControlRight})])],1)]),t._v(" "),n("tr",{attrs:{align:"center"}},[t.weekNumbers?n("td"):t._e(),t._v(" "),t._l(t.weekDays,(function(e){return n("td",{attrs:{width:"14.2857142857%"}},[n("small",[t._v(t._s(t.tWeekName(0===e?7:e)))])])}))],2)]),t._v(" "),n("tbody",t._l(t.monthDayRows,(function(e){return n("tr",[t.weekNumbers?n("td",{staticClass:"text-center",staticStyle:{"border-right":"1px solid #eee"}},[n("small",{staticClass:"text-muted"},[t._v(t._s(t.getWeekNumber(e[t.weekStartsWith])))])]):t._e(),t._v(" "),t._l(e,(function(e){return n("td",[n("btn",{class:e.classes,staticStyle:{border:"none"},attrs:{block:"",size:"sm","data-action":"select",type:t.getBtnType(e),disabled:e.disabled},on:{click:function(n){return t.select(e)}}},[n("span",{class:{"text-muted":t.month!==e.month},attrs:{"data-action":"select"}},[t._v(t._s(e.date))])])],1)}))],2)})),0)])},staticRenderFns:[],mixins:[at],props:{month:Number,year:Number,date:Date,today:Date,limit:Object,weekStartsWith:Number,iconControlLeft:String,iconControlRight:String,dateClass:Function,yearMonthFormatter:Function,weekNumbers:Boolean},components:{Btn:dt},computed:{weekDays:function(){for(var t=[],e=this.weekStartsWith;t.length<7;)t.push(e++),e>6&&(e=0);return t},yearMonthStr:function(){return this.yearMonthFormatter?this.yearMonthFormatter(this.year,this.month):o(this.month)?this.year+" "+this.t("uiv.datePicker.month"+(this.month+1)):this.year},monthDayRows:function(){var t,e,n=[],r=new Date(this.year,this.month,1),i=new Date(this.year,this.month,0).getDate(),o=r.getDay(),s=(t=this.month,e=this.year,new Date(e,t+1,0).getDate()),c=0;c=this.weekStartsWith>o?7-this.weekStartsWith:0-this.weekStartsWith;for(var u=0;u<6;u++){n.push([]);for(var l=0-c;l<7-c;l++){var d=7*u+l,f={year:this.year,disabled:!1};d0?f.month=this.month-1:(f.month=11,f.year--)):d=this.limit.from),this.limit&&this.limit.to&&(v=p0?t--:(t=11,e--,this.$emit("year-change",e)),this.$emit("month-change",t)},goNextMonth:function(){var t=this.month,e=this.year;this.month<11?t++:(t=0,e++,this.$emit("year-change",e)),this.$emit("month-change",t)},changeView:function(){this.$emit("view-change","m")}}},MonthView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:"4"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:function(e){return t.changeView()}}},[n("b",[t._v(t._s(t.year))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[n("i",{class:t.iconControlRight})])],1)])]),t._v(" "),n("tbody",t._l(t.rows,(function(e,r){return n("tr",t._l(e,(function(e,i){return n("td",{attrs:{colspan:"2",width:"33.333333%"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(3*r+i)},on:{click:function(e){return t.changeView(3*r+i)}}},[n("span",[t._v(t._s(t.tCell(e)))])])],1)})),0)})),0)])},staticRenderFns:[],components:{Btn:dt},mixins:[at],props:{month:Number,year:Number,iconControlLeft:String,iconControlRight:String},data:function(){return{rows:[]}},mounted:function(){for(var t=0;t<4;t++){this.rows.push([]);for(var e=0;e<3;e++)this.rows[t].push(3*t+e+1)}},methods:{tCell:function(t){return this.t("uiv.datePicker.month"+t)},getBtnClass:function(t){return t===this.month?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-1)},goNextYear:function(){this.$emit("year-change",this.year+1)},changeView:function(t){o(t)?(this.$emit("month-change",t),this.$emit("view-change","d")):this.$emit("view-change","y")}}},YearView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:"3"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"}},[n("b",[t._v(t._s(t.yearStr))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[n("i",{class:t.iconControlRight})])],1)])]),t._v(" "),n("tbody",t._l(t.rows,(function(e){return n("tr",t._l(e,(function(e){return n("td",{attrs:{width:"20%"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(e)},on:{click:function(n){return t.changeView(e)}}},[n("span",[t._v(t._s(e))])])],1)})),0)})),0)])},staticRenderFns:[],components:{Btn:dt},props:{year:Number,iconControlLeft:String,iconControlRight:String},computed:{rows:function(){for(var t=[],e=this.year-this.year%20,n=0;n<4;n++){t.push([]);for(var r=0;r<5;r++)t[n].push(e+5*n+r)}return t},yearStr:function(){var t=this.year-this.year%20;return t+" ~ "+(t+19)}},methods:{getBtnClass:function(t){return t===this.year?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-20)},goNextYear:function(){this.$emit("year-change",this.year+20)},changeView:function(t){this.$emit("year-change",t),this.$emit("view-change","m")}}},Btn:dt},props:{value:null,width:{type:Number,default:270},todayBtn:{type:Boolean,default:!0},clearBtn:{type:Boolean,default:!0},closeOnSelected:{type:Boolean,default:!0},limitFrom:null,limitTo:null,format:{type:String,default:"yyyy-MM-dd"},initialView:{type:String,default:"d"},dateParser:{type:Function,default:Date.parse},dateClass:Function,yearMonthFormatter:Function,weekStartsWith:{type:Number,default:0,validator:function(t){return t>=0&&t<=6}},weekNumbers:Boolean,iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{show:!1,now:new Date,currentMonth:0,currentYear:0,view:"d"}},computed:{valueDateObj:function(){var t=this.dateParser(this.value);if(isNaN(t))return null;var e=new Date(t);return 0!==e.getHours()&&(e=new Date(t+60*e.getTimezoneOffset()*1e3)),e},pickerStyle:function(){return{width:this.width+"px"}},limit:function(){var t={};if(this.limitFrom){var e=this.dateParser(this.limitFrom);isNaN(e)||((e=At(new Date(e))).setHours(0,0,0,0),t.from=e)}if(this.limitTo){var n=this.dateParser(this.limitTo);isNaN(n)||((n=At(new Date(n))).setHours(0,0,0,0),t.to=n)}return t}},mounted:function(){this.value?this.setMonthAndYearByValue(this.value):(this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView)},watch:{value:function(t,e){this.setMonthAndYearByValue(t,e)}},methods:{setMonthAndYearByValue:function(t,e){var n=this.dateParser(t);if(!isNaN(n)){var r=new Date(n);0!==r.getHours()&&(r=new Date(n+60*r.getTimezoneOffset()*1e3)),this.limit&&(this.limit.from&&r=this.limit.to)?this.$emit("input",e||""):(this.currentMonth=r.getMonth(),this.currentYear=r.getFullYear())}},onMonthChange:function(t){this.currentMonth=t},onYearChange:function(t){this.currentYear=t,this.currentMonth=void 0},onDateChange:function(t){if(t&&s(t.date)&&s(t.month)&&s(t.year)){var e=new Date(t.year,t.month,t.date);this.$emit("input",this.format?function(t,e){try{var n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=yt[r-1];return e.replace(/yyyy/g,n).replace(/MMMM/g,o).replace(/MMM/g,o.substring(0,3)).replace(/MM/g,gt(r,2)).replace(/dd/g,gt(i,2)).replace(/yy/g,n).replace(/M(?!a)/g,r).replace(/d/g,i)}catch(t){return""}}(e,this.format):e),this.currentMonth=t.month,this.currentYear=t.year}else this.$emit("input","")},onViewChange:function(t){this.view=t},selectToday:function(){this.view="d",this.onDateChange({date:this.now.getDate(),month:this.now.getMonth(),year:this.now.getFullYear()})},clearSelect:function(){this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView,this.onDateChange()},onPickerClick:function(t){"select"===t.target.getAttribute("data-action")&&this.closeOnSelected||t.stopPropagation()}}},bt="_uiv_scroll_handler",wt=[C,x],Ct=function(t,e){var n=e.value;a(n)&&(xt(t),t[bt]=n,wt.forEach((function(e){M(window,e,t[bt])})))},xt=function(t){wt.forEach((function(e){F(window,e,t[bt])})),delete t[bt]},Tt={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"hidden-print"},[e("div",{directives:[{name:"scroll",rawName:"v-scroll",value:this.onScroll,expression:"onScroll"}],class:this.classes,style:this.styles},[this._t("default")],2)])},staticRenderFns:[],directives:{scroll:{bind:Ct,unbind:xt,update:function(t,e){e.value!==e.oldValue&&Ct(t,e)}}},props:{offset:{type:Number,default:0}},data:function(){return{affixed:!1}},computed:{classes:function(){return{affix:this.affixed}},styles:function(){return{top:this.affixed?this.offset+"px":null}}},methods:{onScroll:function(){var t=this;if(this.$el.offsetWidth||this.$el.offsetHeight||this.$el.getClientRects().length){for(var e={},n={},r=this.$el.getBoundingClientRect(),i=document.body,o=["Top","Left"],a=0;an.top-this.offset;this.affixed!==u&&(this.affixed=u,this.affixed&&(this.$emit("affix"),this.$nextTick((function(){t.$emit("affixed")}))))}}}},kt={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.alertClass,attrs:{role:"alert"}},[this.dismissible?e("button",{staticClass:"close",attrs:{type:"button","aria-label":"Close"},on:{click:this.closeAlert}},[e("span",{attrs:{"aria-hidden":"true"}},[this._v("×")])]):this._e(),this._v(" "),this._t("default")],2)},staticRenderFns:[],props:{dismissible:{type:Boolean,default:!1},duration:{type:Number,default:0},type:{type:String,default:"info"}},data:function(){return{timeout:0}},computed:{alertClass:function(){var t;return it(t={alert:!0},"alert-"+this.type,Boolean(this.type)),it(t,"alert-dismissible",this.dismissible),t}},methods:{closeAlert:function(){clearTimeout(this.timeout),this.$emit("dismissed")}},mounted:function(){this.duration>0&&(this.timeout=setTimeout(this.closeAlert,this.duration))},destroyed:function(){clearTimeout(this.timeout)}},Et={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{class:t.navClasses,attrs:{"aria-label":"Page navigation"}},[n("ul",{staticClass:"pagination",class:t.classes},[t.boundaryLinks?n("li",{class:{disabled:t.value<=1||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"First"},on:{click:function(e){return e.preventDefault(),t.onPageChange(1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("«")])])]):t._e(),t._v(" "),t.directionLinks?n("li",{class:{disabled:t.value<=1||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Previous"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.value-1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("‹")])])]):t._e(),t._v(" "),t.sliceStart>0?n("li",{class:{disabled:t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Previous group"},on:{click:function(e){return e.preventDefault(),t.toPage(1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("…")])])]):t._e(),t._v(" "),t._l(t.sliceArray,(function(e){return n("li",{key:e,class:{active:t.value===e+1,disabled:t.disabled}},[n("a",{attrs:{href:"#",role:"button"},on:{click:function(n){return n.preventDefault(),t.onPageChange(e+1)}}},[t._v(t._s(e+1))])])})),t._v(" "),t.sliceStart=t.totalPage||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Next"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.value+1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("›")])])]):t._e(),t._v(" "),t.boundaryLinks?n("li",{class:{disabled:t.value>=t.totalPage||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Last"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.totalPage)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()],2)])},staticRenderFns:[],props:{value:{type:Number,required:!0,validator:function(t){return t>=1}},boundaryLinks:{type:Boolean,default:!1},directionLinks:{type:Boolean,default:!0},size:String,align:String,totalPage:{type:Number,required:!0,validator:function(t){return t>=0}},maxSize:{type:Number,default:5,validator:function(t){return t>=0}},disabled:Boolean},data:function(){return{sliceStart:0}},computed:{navClasses:function(){return it({},"text-"+this.align,Boolean(this.align))},classes:function(){return it({},"pagination-"+this.size,Boolean(this.size))},sliceArray:function(){return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=[],i=e;in+e){var r=this.totalPage-e;this.sliceStart=t>r?r:t-1}else te?t-e:0)},onPageChange:function(t){!this.disabled&&t>0&&t<=this.totalPage&&t!==this.value&&(this.$emit("input",t),this.$emit("change",t))},toPage:function(t){if(!this.disabled){var e=this.maxSize,n=this.sliceStart,r=this.totalPage-e,i=t?n-e:n+e;this.sliceStart=i<0?0:i>r?r:i}}},created:function(){this.$watch((function(t){return[t.value,t.maxSize,t.totalPage].join()}),this.calculateSliceStart,{immediate:!0})}},$t={props:{value:{type:Boolean,default:!1},tag:{type:String,default:"span"},placement:{type:String,default:D},autoPlacement:{type:Boolean,default:!0},appendTo:{type:String,default:"body"},transitionDuration:{type:Number,default:150},hideDelay:{type:Number,default:0},showDelay:{type:Number,default:0},enable:{type:Boolean,default:!0},enterable:{type:Boolean,default:!0},target:null,viewport:null},data:function(){return{triggerEl:null,hideTimeoutId:0,showTimeoutId:0,transitionTimeoutId:0}},watch:{value:function(t){t?this.show():this.hide()},trigger:function(){this.clearListeners(),this.initListeners()},target:function(t){this.clearListeners(),this.initTriggerElByTarget(t),this.initListeners()},allContent:function(t){var e=this;this.isNotEmpty()?this.$nextTick((function(){e.isShown()&&e.resetPosition()})):this.hide()},enable:function(t){t||this.hide()}},mounted:function(){var t=this;z(),H(this.$refs.popup),this.$nextTick((function(){t.initTriggerElByTarget(t.target),t.initListeners(),t.value&&t.show()}))},beforeDestroy:function(){this.clearListeners(),H(this.$refs.popup)},methods:{initTriggerElByTarget:function(t){if(t)c(t)?this.triggerEl=document.querySelector(t):U(t)?this.triggerEl=t:U(t.$el)&&(this.triggerEl=t.$el);else{var e=this.$el.querySelector('[data-role="trigger"]');if(e)this.triggerEl=e;else{var n=this.$el.firstChild;this.triggerEl=n===this.$refs.popup?null:n}}},initListeners:function(){this.triggerEl&&(this.trigger===E?(M(this.triggerEl,v,this.show),M(this.triggerEl,m,this.hide)):this.trigger===$?(M(this.triggerEl,g,this.show),M(this.triggerEl,y,this.hide)):this.trigger===S?(M(this.triggerEl,v,this.handleAuto),M(this.triggerEl,m,this.handleAuto),M(this.triggerEl,g,this.handleAuto),M(this.triggerEl,y,this.handleAuto)):this.trigger!==k&&this.trigger!==B||M(this.triggerEl,A,this.toggle)),M(window,A,this.windowClicked)},clearListeners:function(){this.triggerEl&&(F(this.triggerEl,g,this.show),F(this.triggerEl,y,this.hide),F(this.triggerEl,v,this.show),F(this.triggerEl,m,this.hide),F(this.triggerEl,A,this.toggle),F(this.triggerEl,v,this.handleAuto),F(this.triggerEl,m,this.handleAuto),F(this.triggerEl,g,this.handleAuto),F(this.triggerEl,y,this.handleAuto)),F(window,A,this.windowClicked)},resetPosition:function(){var t=this.$refs.popup;!function(t,e,n,r,i,s){var u=t&&t.className&&t.className.indexOf("popover")>=0,l=void 0,d=void 0;if(o(i)&&"body"!==i){var f=document.querySelector(i);d=f.scrollLeft,l=f.scrollTop}else{var p=document.documentElement;d=(window.pageXOffset||p.scrollLeft)-(p.clientLeft||0),l=(window.pageYOffset||p.scrollTop)-(p.clientTop||0)}if(r){var h=[O,I,N,D],v=function(e){h.forEach((function(e){W(t,e)})),q(t,e)};if(!Q(e,t,n)){for(var m=0,g=h.length;mE&&(_=E-A.height),b$&&(b=$-A.width),n===I?_-=C:n===N?b+=C:n===O?b-=C:_+=C}t.style.top=_+"px",t.style.left=b+"px"}(t,this.triggerEl,this.placement,this.autoPlacement,this.appendTo,this.viewport),t.offsetHeight},hideOnLeave:function(){(this.trigger===E||this.trigger===S&&!this.triggerEl.matches(":focus"))&&this.$hide()},toggle:function(){this.isShown()?this.hide():this.show()},show:function(){var t=this;if(this.enable&&this.triggerEl&&this.isNotEmpty()&&!this.isShown()){var e=this.$refs.popup,n=this.hideTimeoutId>0;n&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.transitionTimeoutId>0&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),this.showTimeoutId=setTimeout((function(){n||(e.className=t.name+" "+t.placement+" fade",document.querySelector(t.appendTo).appendChild(e),t.resetPosition());q(e,"in"),t.$emit("input",!0),t.$emit("show")}),this.showDelay)}},hide:function(){var t=this;this.showTimeoutId>0&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.isShown()&&(!this.enterable||this.trigger!==E&&this.trigger!==S?this.$hide():setTimeout((function(){t.$refs.popup.matches(":hover")||t.$hide()}),100))},$hide:function(){var t=this;this.isShown()&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0,W(t.$refs.popup,"in"),t.transitionTimeoutId=setTimeout((function(){t.transitionTimeoutId=0,H(t.$refs.popup),t.$emit("input",!1),t.$emit("hide")}),t.transitionDuration)}),this.hideDelay))},isShown:function(){return function(t,e){if(!U(t))return!1;for(var n=t.className.split(" "),r=0,i=n.length;r=1&&e<=12&&(this.meridian?this.hours=12===e?0:e:this.hours=12===e?12:e+12):e>=0&&e<=23&&(this.hours=e),this.setTime()}},minutesText:function(t){if(0!==this.minutes||""!==t){var e=parseInt(t);e>=0&&e<=59&&(this.minutes=e),this.setTime()}}},methods:{updateByValue:function(t){if(isNaN(t.getTime()))return this.hours=0,this.minutes=0,this.hoursText="",this.minutesText="",void(this.meridian=!0);this.hours=t.getHours(),this.minutes=t.getMinutes(),this.showMeridian?this.hours>=12?(12===this.hours?this.hoursText=this.hours+"":this.hoursText=gt(this.hours-12,2),this.meridian=!1):(0===this.hours?this.hoursText=12..toString():this.hoursText=gt(this.hours,2),this.meridian=!0):this.hoursText=gt(this.hours,2),this.minutesText=gt(this.minutes,2),this.$refs.hoursInput.value=this.hoursText,this.$refs.minutesInput.value=this.minutesText},addHour:function(t){t=t||this.hourStep,this.hours=this.hours>=23?0:this.hours+t},reduceHour:function(t){t=t||this.hourStep,this.hours=this.hours<=0?23:this.hours-t},addMinute:function(){this.minutes>=59?(this.minutes=0,this.addHour(1)):this.minutes+=this.minStep},reduceMinute:function(){this.minutes<=0?(this.minutes=60-this.minStep,this.reduceHour(1)):this.minutes-=this.minStep},changeTime:function(t,e){this.readonly||(t&&e?this.addHour():t&&!e?this.reduceHour():!t&&e?this.addMinute():this.reduceMinute(),this.setTime())},toggleMeridian:function(){this.meridian=!this.meridian,this.meridian?this.hours-=12:this.hours+=12,this.setTime()},onWheel:function(t,e){this.readonly||(t.preventDefault(),this.changeTime(e,t.deltaY<0))},setTime:function(){var t=this.value;if(isNaN(t.getTime())&&((t=new Date).setHours(0),t.setMinutes(0)),t.setHours(this.hours),t.setMinutes(this.minutes),this.max){var e=new Date(t);e.setHours(this.max.getHours()),e.setMinutes(this.max.getMinutes()),t=t>e?e:t}if(this.min){var n=new Date(t);n.setHours(this.min.getHours()),n.setMinutes(this.min.getMinutes()),t=t1&&void 0!==arguments[1]&&arguments[1];if(e)this.items=t.slice(0,this.limit);else{this.items=[],this.activeIndex=this.preselect?0:-1;for(var n=0,r=t.length;n=0)&&this.items.push(i),this.items.length>=this.limit)break}}},fetchItems:function(t,e){var n=this;if(clearTimeout(this.timeoutID),""!==t||this.openOnEmpty){if(this.data)this.prepareItems(this.data),this.open=this.hasEmptySlot()||Boolean(this.items.length);else if(this.asyncSrc)this.timeoutID=setTimeout((function(){var e,r,i,s;n.$emit("loading"),(e=n.asyncSrc+encodeURIComponent(t),r=new window.XMLHttpRequest,i={},s={then:function(t,e){return s.done(t).fail(e)},catch:function(t){return s.fail(t)},always:function(t){return s.done(t).fail(t)}},["done","fail"].forEach((function(t){i[t]=[],s[t]=function(e){return e instanceof Function&&i[t].push(e),s}})),s.done(JSON.parse),r.onreadystatechange=function(){if(4===r.readyState){var t={status:r.status};if(200===r.status){var e=r.responseText;for(var n in i.done)if(i.done.hasOwnProperty(n)&&a(i.done[n])){var s=i.done[n](e);o(s)&&(e=s)}}else i.fail.forEach((function(e){return e(t)}))}},r.open("GET",e),r.setRequestHeader("Accept","application/json"),r.send(),s).then((function(t){n.inputEl.matches(":focus")&&(n.prepareItems(n.asyncKey?t[n.asyncKey]:t,!0),n.open=n.hasEmptySlot()||Boolean(n.items.length)),n.$emit("loaded")})).catch((function(t){console.error(t),n.$emit("loaded-error")}))}),e);else if(this.asyncFunction){var r=function(t){n.inputEl.matches(":focus")&&(n.prepareItems(t,!0),n.open=n.hasEmptySlot()||Boolean(n.items.length)),n.$emit("loaded")};this.timeoutID=setTimeout((function(){n.$emit("loading"),n.asyncFunction(t,r)}),e)}}else this.open=!1},inputChanged:function(){var t=this.inputEl.value;this.fetchItems(t,this.debounce),this.$emit("input",this.forceSelect?void 0:t)},inputFocused:function(){if(this.openOnFocus){var t=this.inputEl.value;this.fetchItems(t,0)}},inputBlured:function(){var t=this;this.dropdownMenuEl.matches(":hover")||(this.open=!1),this.inputEl&&this.forceClear&&this.$nextTick((function(){void 0===t.value&&(t.inputEl.value="")}))},inputKeyPressed:function(t){if(t.stopPropagation(),this.open)switch(t.keyCode){case 13:this.activeIndex>=0?this.selectItem(this.items[this.activeIndex]):this.open=!1;break;case 27:this.open=!1;break;case 38:this.activeIndex=this.activeIndex>0?this.activeIndex-1:0;break;case 40:var e=this.items.length-1;this.activeIndex=this.activeIndex$&")}}},It={functional:!0,render:function(t,e){var n=e.props;return t("div",st(e.data,{class:it({"progress-bar":!0,"progress-bar-striped":n.striped,active:n.striped&&n.active},"progress-bar-"+n.type,Boolean(n.type)),style:{minWidth:n.minWidth?"2em":null,width:n.value+"%"},attrs:{role:"progressbar","aria-valuemin":0,"aria-valuenow":n.value,"aria-valuemax":100}}),n.label?n.labelText?n.labelText:n.value+"%":null)},props:{value:{type:Number,required:!0,validator:function(t){return t>=0&&t<=100}},labelText:String,type:String,label:{type:Boolean,default:!1},minWidth:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},active:{type:Boolean,default:!1}}},Nt={functional:!0,render:function(t,e){var n=e.props,r=e.data,i=e.children;return t("div",st(r,{class:"progress"}),i&&i.length?i:[t(It,{props:n})])}},jt={functional:!0,mixins:[ut],render:function(t,e){var n=e.props,r=e.data,i=e.children,o=void 0;return o=n.active?i:n.to?[t("router-link",{props:{to:n.to,replace:n.replace,append:n.append,exact:n.exact}},i)]:[t("a",{attrs:{href:n.href,target:n.target}},i)],t("li",st(r,{class:{active:n.active}}),o)},props:{active:{type:Boolean,default:!1}}},Pt={functional:!0,render:function(t,e){var n=e.props,r=e.data,i=e.children,o=[];return i&&i.length?o=i:n.items&&(o=n.items.map((function(e,r){return t(jt,{key:e.hasOwnProperty("key")?e.key:r,props:{active:e.hasOwnProperty("active")?e.active:r===n.items.length-1,href:e.href,target:e.target,to:e.to,replace:e.replace,append:e.append,exact:e.exact}},e.text)}))),t("ol",st(r,{class:"breadcrumb"}),o)},props:{items:Array}},Lt={functional:!0,render:function(t,e){var n=e.children;return t("div",st(e.data,{class:{"btn-toolbar":!0},attrs:{role:"toolbar"}}),n)}},Rt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("dropdown",{ref:"dropdown",style:t.containerStyles,attrs:{"not-close-elements":t.els,"append-to-body":t.appendToBody,disabled:t.disabled},nativeOn:{keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;t.showDropdown=!1}},model:{value:t.showDropdown,callback:function(e){t.showDropdown=e},expression:"showDropdown"}},[n("div",{staticClass:"form-control dropdown-toggle clearfix",class:t.selectClasses,attrs:{disabled:t.disabled,tabindex:"0","data-role":"trigger"},on:{focus:function(e){return t.$emit("focus",e)},blur:function(e){return t.$emit("blur",e)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}]}},[n("div",{class:t.selectTextClasses,staticStyle:{display:"inline-block","vertical-align":"middle"}},[t._v(t._s(t.selectedText))]),t._v(" "),n("div",{staticClass:"pull-right",staticStyle:{display:"inline-block","vertical-align":"middle"}},[n("span",[t._v(" ")]),t._v(" "),n("span",{staticClass:"caret"})])]),t._v(" "),n("template",{slot:"dropdown"},[t.filterable?n("li",{staticStyle:{padding:"4px 8px"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.filterInput,expression:"filterInput"}],ref:"filterInput",staticClass:"form-control input-sm",attrs:{"aria-label":"Filter...",type:"text",placeholder:t.filterPlaceholder||t.t("uiv.multiSelect.filterPlaceholder")},domProps:{value:t.filterInput},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}],input:function(e){e.target.composing||(t.filterInput=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.groupedOptions,(function(e){return[e.$group?n("li",{staticClass:"dropdown-header",domProps:{textContent:t._s(e.$group)}}):t._e(),t._v(" "),t._l(e.options,(function(e){return[n("li",{class:t.itemClasses(e),staticStyle:{outline:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}],click:function(n){return n.stopPropagation(),t.toggle(e)},mouseenter:function(e){t.currentActive=-1}}},[t.isItemSelected(e)?n("a",{staticStyle:{outline:"0"},attrs:{role:"button"}},[n("b",[t._v(t._s(e[t.labelKey]))]),t._v(" "),t.selectedIcon?n("span",{class:t.selectedIconClasses}):t._e()]):n("a",{staticStyle:{outline:"0"},attrs:{role:"button"}},[n("span",[t._v(t._s(e[t.labelKey]))])])])]}))]}))],2)],2)},staticRenderFns:[],mixins:[at],components:{Dropdown:X},props:{value:{type:Array,required:!0},options:{type:Array,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},limit:{type:Number,default:0},size:String,placeholder:String,split:{type:String,default:", "},disabled:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},block:{type:Boolean,default:!1},collapseSelected:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterAutoFocus:{type:Boolean,default:!0},filterFunction:Function,filterPlaceholder:String,selectedIcon:{type:String,default:"glyphicon glyphicon-ok"},itemSelectedClass:String},data:function(){return{showDropdown:!1,els:[],filterInput:"",currentActive:-1}},computed:{containerStyles:function(){return{width:this.block?"100%":""}},filteredOptions:function(){var t=this;if(this.filterable&&this.filterInput){if(this.filterFunction)return this.filterFunction(this.filterInput);var e=this.filterInput.toLowerCase();return this.options.filter((function(n){return n[t.valueKey].toString().toLowerCase().indexOf(e)>=0||n[t.labelKey].toString().toLowerCase().indexOf(e)>=0}))}return this.options},groupedOptions:function(){var t=this;return this.filteredOptions.map((function(t){return t.group})).filter(p).map((function(e){return{options:t.filteredOptions.filter((function(t){return t.group===e})),$group:e}}))},flatternGroupedOptions:function(){if(this.groupedOptions&&this.groupedOptions.length){var t=[];return this.groupedOptions.forEach((function(e){t=t.concat(e.options)})),t}return[]},selectClasses:function(){return it({},"input-"+this.size,this.size)},selectedIconClasses:function(){var t;return it(t={},this.selectedIcon,!0),it(t,"pull-right",!0),t},selectTextClasses:function(){return{"text-muted":0===this.value.length}},labelValue:function(){var t=this,e=this.options.map((function(e){return e[t.valueKey]}));return this.value.map((function(n){var r=e.indexOf(n);return r>=0?t.options[r][t.labelKey]:n}))},selectedText:function(){if(this.value.length){var t=this.labelValue;if(this.collapseSelected){var e=t[0];return e+=t.length>1?this.split+"+"+(t.length-1):""}return t.join(this.split)}return this.placeholder||this.t("uiv.multiSelect.placeholder")}},watch:{showDropdown:function(t){var e=this;this.filterInput="",this.currentActive=-1,this.$emit("visible-change",t),t&&this.filterable&&this.filterAutoFocus&&this.$nextTick((function(){e.$refs.filterInput.focus()}))}},mounted:function(){this.els=[this.$el]},methods:{goPrevOption:function(){this.showDropdown&&(this.currentActive>0?this.currentActive--:this.currentActive=this.flatternGroupedOptions.length-1)},goNextOption:function(){this.showDropdown&&(this.currentActive=0&&t=0},toggle:function(t){if(!t.disabled){var e=t[this.valueKey],n=this.value.indexOf(e);if(1===this.limit){var r=n>=0?[]:[e];this.$emit("input",r),this.$emit("change",r)}else n>=0?(this.value.splice(n,1),this.$emit("change",this.value)):0===this.limit||this.value.length1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.el=t,this.opts=ot({},Xt.DEFAULTS,n),this.opts.target=e,this.scrollElement="body"===e?window:document.querySelector("[id="+e+"]"),this.selector="li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.scrollElement&&(this.refresh(),this.process())}Xt.DEFAULTS={offset:10,callback:function(t){return 0}},Xt.prototype.getScrollHeight=function(){return this.scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},Xt.prototype.refresh=function(){var t=this;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var e=f(this.el.querySelectorAll(this.selector)),n=this.scrollElement===window;e.map((function(e){var r=e.getAttribute("href");if(/^#./.test(r)){var i=document.documentElement,o=(n?document:t.scrollElement).querySelector("[id='"+r.slice(1)+"']"),a=(window.pageYOffset||i.scrollTop)-(i.clientTop||0);return[n?o.getBoundingClientRect().top+a:o.offsetTop+t.scrollElement.scrollTop,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t.offsets.push(e[0]),t.targets.push(e[1])}))},Xt.prototype.process=function(){var t=this.scrollElement===window,e=(t?window.pageYOffset:this.scrollElement.scrollTop)+this.opts.offset,n=this.getScrollHeight(),r=t?P().height:this.scrollElement.getBoundingClientRect().height,i=this.opts.offset+n-r,o=this.offsets,a=this.targets,s=this.activeTarget,c=void 0;if(this.scrollHeight!==n&&this.refresh(),e>=i)return s!==(c=a[a.length-1])&&this.activate(c);if(s&&e=o[c]&&(void 0===o[c+1]||e-1:t.input},on:{change:[function(e){var n=t.input,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.input=n.concat([null])):o>-1&&(t.input=n.slice(0,o).concat(n.slice(o+1)))}else t.input=i},function(e){t.dirty=!0}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)}}}):"radio"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.input,expression:"input"}],ref:"input",staticClass:"form-control",attrs:{required:"","data-action":"auto-focus",type:"radio"},domProps:{checked:t._q(t.input,null)},on:{change:[function(e){t.input=null},function(e){t.dirty=!0}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.input,expression:"input"}],ref:"input",staticClass:"form-control",attrs:{required:"","data-action":"auto-focus",type:t.inputType},domProps:{value:t.input},on:{change:function(e){t.dirty=!0},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)},input:function(e){e.target.composing||(t.input=e.target.value)}}}),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.inputNotValid,expression:"inputNotValid"}],staticClass:"help-block"},[t._v(t._s(t.inputError))])])]):t._e(),t._v(" "),t.type===t.TYPES.ALERT?n("template",{slot:"footer"},[n("btn",{attrs:{type:t.okType,"data-action":"ok"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.okBtnText)},on:{click:function(e){return t.toggle(!1,"ok")}}})],1):n("template",{slot:"footer"},[n("btn",{attrs:{type:t.cancelType,"data-action":"cancel"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.cancelBtnText)},on:{click:function(e){return t.toggle(!1,"cancel")}}}),t._v(" "),t.type===t.TYPES.CONFIRM?n("btn",{attrs:{type:t.okType,"data-action":"ok"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.okBtnText)},on:{click:function(e){return t.toggle(!1,"ok")}}}):n("btn",{attrs:{type:t.okType},domProps:{textContent:t._s(t.okBtnText)},on:{click:t.validate}})],1)],2)},staticRenderFns:[],mixins:[at],components:{Modal:ht,Btn:dt},props:{backdrop:null,title:String,content:String,html:{type:Boolean,default:!1},okText:String,okType:{type:String,default:"primary"},cancelText:String,cancelType:{type:String,default:"default"},type:{type:Number,default:se.ALERT},size:{type:String,default:"sm"},cb:{type:Function,required:!0},validator:{type:Function,default:function(){return null}},customClass:null,defaultValue:String,inputType:{type:String,default:"text"},autoFocus:{type:String,default:"ok"}},data:function(){return{TYPES:se,show:!1,input:"",dirty:!1}},mounted:function(){this.defaultValue&&(this.input=this.defaultValue)},computed:{closeOnBackdropClick:function(){return o(this.backdrop)?Boolean(this.backdrop):this.type!==se.ALERT},inputError:function(){return this.validator(this.input)},inputNotValid:function(){return this.dirty&&this.inputError},okBtnText:function(){return this.okText||this.t("uiv.modal.ok")},cancelBtnText:function(){return this.cancelText||this.t("uiv.modal.cancel")}},methods:{toggle:function(t,e){this.$refs.modal.toggle(t,e)},validate:function(){this.dirty=!0,o(this.inputError)||this.toggle(!1,{value:this.input})}}},ue=[],le=function(t){H(t.$el),t.$destroy(),d(ue,t)},de=function(t,e){return t===se.CONFIRM?"ok"===e:o(e)&&c(e.value)},fe=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=this.$i18n,c=new i.a({extends:ce,i18n:s,propsData:ot({type:t},e,{cb:function(e){le(c),a(n)?t===se.CONFIRM?de(t,e)?n(null,e):n(e):t===se.PROMPT&&de(t,e)?n(null,e.value):n(e):r&&o&&(t===se.CONFIRM?de(t,e)?r(e):o(e):t===se.PROMPT?de(t,e)?r(e.value):o(e):r(e))}})});c.$mount(),document.body.appendChild(c.$el),c.show=!0,ue.push(c)},pe=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];if(u())return new Promise((function(i,o){fe.apply(e,[t,n,r,i,o])}));fe.apply(this,[t,n,r])},he={alert:function(t,e){return pe.apply(this,[se.ALERT,t,e])},confirm:function(t,e){return pe.apply(this,[se.CONFIRM,t,e])},prompt:function(t,e){return pe.apply(this,[se.PROMPT,t,e])}},ve="success",me="info",ge="danger",ye="warning",Ae="top-left",_e="top-right",be="bottom-left",we="bottom-right",Ce="glyphicon",xe={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("alert",{staticClass:"fade",class:t.customClass,style:t.styles,attrs:{type:t.type,duration:t.duration,dismissible:t.dismissible},on:{dismissed:t.onDismissed}},[n("div",{staticClass:"media",staticStyle:{margin:"0"}},[t.icons?n("div",{staticClass:"media-left"},[n("span",{class:t.icons,staticStyle:{"font-size":"1.5em"}})]):t._e(),t._v(" "),n("div",{staticClass:"media-body"},[t.title?n("div",{staticClass:"media-heading"},[n("b",[t._v(t._s(t.title))])]):t._e(),t._v(" "),t.html?n("div",{domProps:{innerHTML:t._s(t.content)}}):n("div",[t._v(t._s(t.content))])])])])},staticRenderFns:[],components:{Alert:kt},props:{title:String,content:String,html:{type:Boolean,default:!1},duration:{type:Number,default:5e3},dismissible:{type:Boolean,default:!0},type:String,placement:String,icon:String,customClass:null,cb:{type:Function,required:!0},queue:{type:Array,required:!0},offsetY:{type:Number,default:15},offsetX:{type:Number,default:15},offset:{type:Number,default:15}},data:function(){return{height:0,top:0,horizontal:this.placement===Ae||this.placement===be?"left":"right",vertical:this.placement===Ae||this.placement===_e?"top":"bottom"}},created:function(){this.top=this.getTotalHeightOfQueue(this.queue)},mounted:function(){var t=this,e=this.$el;e.style[this.vertical]=this.top+"px",this.$nextTick((function(){e.style[t.horizontal]="-300px",t.height=e.offsetHeight,e.style[t.horizontal]=t.offsetX+"px",q(e,"in")}))},computed:{styles:function(){var t,e=this.queue,n=e.indexOf(this);return it(t={position:"fixed"},this.vertical,this.getTotalHeightOfQueue(e,n)+"px"),it(t,"width","300px"),it(t,"transition","all 0.3s ease-in-out"),t},icons:function(){if(c(this.icon))return this.icon;switch(this.type){case me:case ye:return Ce+" "+Ce+"-info-sign";case ve:return Ce+" "+Ce+"-ok-sign";case ge:return Ce+" "+Ce+"-remove-sign";default:return null}}},methods:{getTotalHeightOfQueue:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,n=this.offsetY,r=0;r2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=t.placement,c=Te[s];if(o(c)){var u=new i.a({extends:xe,propsData:ot({queue:c,placement:s},t,{cb:function(t){ke(c,u),a(e)?e(t):n&&r&&n(t)}})});u.$mount(),document.body.appendChild(u.$el),c.push(u)}},$e={notify:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(c(t)&&(t={content:t}),o(t.placement)||(t.placement=_e),u())return new Promise((function(n,r){Ee(t,e,n,r)}));Ee(t,e)}},Se=Object.freeze({MessageBox:he,Notification:$e}),Be=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};nt(e.locale),rt(e.i18n),Object.keys(zt).forEach((function(n){var r=e.prefix?e.prefix+n:n;t.component(r,zt[n])})),Object.keys(ae).forEach((function(n){var r=e.prefix?e.prefix+"-"+n:n;t.directive(r,ae[n])})),Object.keys(Se).forEach((function(n){var r=Se[n];Object.keys(r).forEach((function(n){var i=e.prefix?e.prefix+"_"+n:n;t.prototype["$"+i]=r[n]}))}))}},function(t,e,n){"use strict";var r={name:"CustomAttachments",props:{title:String,name:String,error:Array},methods:{hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{staticClass:"form-control",attrs:{multiple:"multiple",autocomplete:"off",placeholder:t.title,title:t.title,name:t.name,type:"file"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"21f615fb",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CreateTransaction",components:{},mounted:function(){this.addTransactionToArray()},ready:function(){},methods:{convertData:function(){var t,e,n,r={transactions:[]};for(var i in this.transactions.length>1&&(r.group_title=this.group_title),t=this.transactionType?this.transactionType.toLowerCase():"invalid",e=this.transactions[0].source_account.type,n=this.transactions[0].destination_account.type,"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)&&(t="withdrawal"),"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(n)&&(t="deposit"),this.transactions)this.transactions.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&r.transactions.push(this.convertDataRow(this.transactions[i],i,t));return r},convertDataRow:function(t,e,n){var r,i,o,a,s,c,u=[],l=null,d=null;for(var f in i=t.source_account.id,o=t.source_account.name,a=t.destination_account.id,s=t.destination_account.name,c=t.date,e>0&&(c=this.transactions[0].date),"withdrawal"===n&&""===s&&(a=window.cashAccountId),"deposit"===n&&""===o&&(i=window.cashAccountId),e>0&&("withdrawal"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(i=this.transactions[0].source_account.id,o=this.transactions[0].source_account.name),e>0&&("deposit"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(a=this.transactions[0].destination_account.id,s=this.transactions[0].destination_account.name),u=[],l=null,d=null,t.tags)t.tags.hasOwnProperty(f)&&/^0$|^[1-9]\d*$/.test(f)&&f<=4294967294&&u.push(t.tags[f].text);return""!==t.foreign_amount.amount&&0!==parseFloat(t.foreign_amount.amount)&&(l=t.foreign_amount.amount,d=t.foreign_amount.currency_id),d===t.currency_id&&(l=null,d=null),0===a&&(a=null),0===i&&(i=null),r={type:n,date:c,amount:t.amount,currency_id:t.currency_id,description:t.description,source_id:i,source_name:o,destination_id:a,destination_name:s,category_name:t.category,interest_date:t.custom_fields.interest_date,book_date:t.custom_fields.book_date,process_date:t.custom_fields.process_date,due_date:t.custom_fields.due_date,payment_date:t.custom_fields.payment_date,invoice_date:t.custom_fields.invoice_date,internal_reference:t.custom_fields.internal_reference,notes:t.custom_fields.notes},u.length>0&&(r.tags=u),null!==l&&(r.foreign_amount=l,r.foreign_currency_id=d),parseInt(t.budget)>0&&(r.budget_id=parseInt(t.budget)),parseInt(t.piggy_bank)>0&&(r.piggy_bank_id=parseInt(t.piggy_bank)),r},submit:function(t){var e=this,n="./api/v1/transactions?_token="+document.head.querySelector('meta[name="csrf-token"]').content,r=this.convertData(),i=$(t.currentTarget);i.prop("disabled",!0),axios.post(n,r).then((function(t){0===e.collectAttachmentData(t)&&e.redirectUser(t.data.data.id,i,t.data.data)})).catch((function(t){console.error("Error in transaction submission."),console.error(t),e.parseErrors(t.response.data),i.prop("disabled",!1)})),t&&t.preventDefault()},escapeHTML:function(t){var e=document.createElement("div");return e.innerText=t,e.innerHTML},redirectUser:function(t,e,n){var r=this,i=null===n.attributes.group_title?n.attributes.transactions[0].description:n.attributes.group_title;this.createAnother?(this.success_message='Transaction #'+t+' ("'+this.escapeHTML(i)+'") has been stored.',this.error_message="",this.resetFormAfter&&(this.resetTransactions(),setTimeout((function(){return r.addTransactionToArray()}),50)),this.setDefaultErrors(),e&&e.prop("disabled",!1)):window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=created"},collectAttachmentData:function(t){var e=this,n=t.data.data.id,r=[],i=[],o=$('input[name="attachments[]"]');for(var a in o)if(o.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294)for(var s in o[a].files)o[a].files.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&r.push({journal:t.data.data.attributes.transactions[a].transaction_journal_id,file:o[a].files[s]});var c=r.length,u=function(o){var a,s,u;r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&(a=r[o],s=e,(u=new FileReader).onloadend=function(e){e.target.readyState===FileReader.DONE&&(i.push({name:r[o].file.name,journal:r[o].journal,content:new Blob([e.target.result])}),i.length===c&&s.uploadFiles(i,n,t.data.data))},u.readAsArrayBuffer(a.file))};for(var l in r)u(l);return c},uploadFiles:function(t,e,n){var r=this,i=t.length,o=0,a=function(a){if(t.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var s={filename:t[a].name,model:"TransactionJournal",model_id:t[a].journal};axios.post("./api/v1/attachments",s).then((function(s){var c="./api/v1/attachments/"+s.data.data.id+"/upload";axios.post(c,t[a].content).then((function(t){return++o===i&&r.redirectUser(e,null,n),!0})).catch((function(t){return console.error("Could not upload"),console.error(t),++o===i&&r.redirectUser(e,null,n),!1}))}))}};for(var s in t)a(s)},setDefaultErrors:function(){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(this.transactions[t].errors={source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}})},parseErrors:function(t){var e,n;for(var r in this.setDefaultErrors(),this.error_message="",t.message.length>0?this.error_message=this.$t("firefly.errors_submission"):this.error_message="",t.errors)if(t.errors.hasOwnProperty(r)){if("group_title"===r&&(this.group_title_errors=t.errors[r]),"group_title"!==r)switch(e=parseInt(r.split(".")[1]),n=r.split(".")[2]){case"amount":case"date":case"budget_id":case"description":case"tags":this.transactions[e].errors[n]=t.errors[r];break;case"source_name":case"source_id":this.transactions[e].errors.source_account=this.transactions[e].errors.source_account.concat(t.errors[r]);break;case"destination_name":case"destination_id":this.transactions[e].errors.destination_account=this.transactions[e].errors.destination_account.concat(t.errors[r]);break;case"foreign_amount":case"foreign_currency_id":this.transactions[e].errors.foreign_amount=this.transactions[e].errors.foreign_amount.concat(t.errors[r])}void 0!==this.transactions[e]&&(this.transactions[e].errors.source_account=Array.from(new Set(this.transactions[e].errors.source_account)),this.transactions[e].errors.destination_account=Array.from(new Set(this.transactions[e].errors.destination_account)))}},resetTransactions:function(){this.transactions=[]},addTransactionToArray:function(t){if(this.transactions.push({description:"",date:"",amount:"",category:"",piggy_bank:0,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:0,tags:[],custom_fields:{interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",internal_reference:"",notes:"",attachments:[]},foreign_amount:{amount:"",currency_id:0},source_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:["Asset account","Revenue account","Loan","Debt","Mortgage"],default_allowed_types:["Asset account","Revenue account","Loan","Debt","Mortgage"]},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:["Asset account","Expense account","Loan","Debt","Mortgage"],default_allowed_types:["Asset account","Expense account","Loan","Debt","Mortgage"]}}),1===this.transactions.length){var e=new Date;this.transactions[0].date=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)}t&&t.preventDefault()},setTransactionType:function(t){this.transactionType=t},deleteTransaction:function(t,e){for(var n in e.preventDefault(),this.transactions)this.transactions.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n);for(var r in this.transactions.splice(t,1),this.transactions)this.transactions.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)},limitSourceType:function(t){var e;for(e=0;e1?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("group-description",{attrs:{error:t.group_title_errors},model:{value:t.group_title,callback:function(e){t.group_title=e},expression:"group_title"}})],1)])])]):t._e(),t._v(" "),n("div",t._l(t.transactions,(function(e,r){return n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title splitTitle"},[t.transactions.length>1?n("span",[t._v(t._s(t.$t("firefly.split"))+" "+t._s(r+1)+" / "+t._s(t.transactions.length))]):t._e(),t._v(" "),1===t.transactions.length?n("span",[t._v(t._s(t.$t("firefly.transaction_journal_information")))]):t._e()]),t._v(" "),t.transactions.length>1?n("div",{staticClass:"box-tools pull-right",attrs:{x:""}},[n("button",{staticClass:"btn btn-xs btn-danger",attrs:{type:"button"},on:{click:function(e){return t.deleteTransaction(r,e)}}},[n("i",{staticClass:"fa fa-trash"})])]):t._e()]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-4"},[n("transaction-description",{attrs:{index:r,error:e.errors.description},model:{value:e.description,callback:function(n){t.$set(e,"description",n)},expression:"transaction.description"}}),t._v(" "),n("account-select",{attrs:{inputName:"source[]",title:t.$t("firefly.source_account"),accountName:e.source_account.name,accountTypeFilters:e.source_account.allowed_types,defaultAccountTypeFilters:e.source_account.default_allowed_types,transactionType:t.transactionType,index:r,error:e.errors.source_account},on:{"clear:value":function(e){return t.clearSource(r)},"select:account":function(e){return t.selectedSourceAccount(r,e)}}}),t._v(" "),n("account-select",{attrs:{inputName:"destination[]",title:t.$t("firefly.destination_account"),accountName:e.destination_account.name,accountTypeFilters:e.destination_account.allowed_types,defaultAccountTypeFilters:e.destination_account.default_allowed_types,transactionType:t.transactionType,index:r,error:e.errors.destination_account},on:{"clear:value":function(e){return t.clearDestination(r)},"select:account":function(e){return t.selectedDestinationAccount(r,e)}}}),t._v(" "),n("standard-date",{attrs:{index:r,error:e.errors.date},model:{value:e.date,callback:function(n){t.$set(e,"date",n)},expression:"transaction.date"}}),t._v(" "),0===r?n("div",[n("transaction-type",{attrs:{source:e.source_account.type,destination:e.destination_account.type},on:{"set:transactionType":function(e){return t.setTransactionType(e)},"act:limitSourceType":function(e){return t.limitSourceType(e)},"act:limitDestinationType":function(e){return t.limitDestinationType(e)}}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("amount",{attrs:{source:e.source_account,destination:e.destination_account,error:e.errors.amount,transactionType:t.transactionType},model:{value:e.amount,callback:function(n){t.$set(e,"amount",n)},expression:"transaction.amount"}}),t._v(" "),n("foreign-amount",{attrs:{source:e.source_account,destination:e.destination_account,transactionType:t.transactionType,error:e.errors.foreign_amount,title:t.$t("form.foreign_amount")},model:{value:e.foreign_amount,callback:function(n){t.$set(e,"foreign_amount",n)},expression:"transaction.foreign_amount"}})],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("budget",{attrs:{transactionType:t.transactionType,error:e.errors.budget_id,no_budget:t.$t("firefly.none_in_select_list")},model:{value:e.budget,callback:function(n){t.$set(e,"budget",n)},expression:"transaction.budget"}}),t._v(" "),n("category",{attrs:{transactionType:t.transactionType,error:e.errors.category},model:{value:e.category,callback:function(n){t.$set(e,"category",n)},expression:"transaction.category"}}),t._v(" "),n("piggy-bank",{attrs:{transactionType:t.transactionType,error:e.errors.piggy_bank,no_piggy_bank:t.$t("firefly.no_piggy_bank")},model:{value:e.piggy_bank,callback:function(n){t.$set(e,"piggy_bank",n)},expression:"transaction.piggy_bank"}}),t._v(" "),n("tags",{attrs:{error:e.errors.tags},model:{value:e.tags,callback:function(n){t.$set(e,"tags",n)},expression:"transaction.tags"}}),t._v(" "),n("custom-transaction-fields",{attrs:{error:e.errors.custom_errors},model:{value:e.custom_fields,callback:function(n){t.$set(e,"custom_fields",n)},expression:"transaction.custom_fields"}})],1)])]),t._v(" "),t.transactions.length-1===r?n("div",{staticClass:"box-footer"},[n("button",{staticClass:"split_add_btn btn btn-primary",attrs:{type:"button"},on:{click:t.addTransactionToArray}},[t._v(t._s(t.$t("firefly.add_another_split")))])]):t._e()])])])})),0),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-3 col-md-4 col-sm-6 col-xs-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.submission"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createAnother,expression:"createAnother"}],attrs:{name:"create_another",type:"checkbox"},domProps:{checked:Array.isArray(t.createAnother)?t._i(t.createAnother,null)>-1:t.createAnother},on:{change:function(e){var n=t.createAnother,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.createAnother=n.concat([null])):o>-1&&(t.createAnother=n.slice(0,o).concat(n.slice(o+1)))}else t.createAnother=i}}}),t._v("\n "+t._s(t.$t("firefly.create_another"))+"\n ")]),t._v(" "),n("label",{class:{"text-muted":!1===this.createAnother}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.resetFormAfter,expression:"resetFormAfter"}],attrs:{disabled:!1===this.createAnother,name:"reset_form",type:"checkbox"},domProps:{checked:Array.isArray(t.resetFormAfter)?t._i(t.resetFormAfter,null)>-1:t.resetFormAfter},on:{change:function(e){var n=t.resetFormAfter,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.resetFormAfter=n.concat([null])):o>-1&&(t.resetFormAfter=n.slice(0,o).concat(n.slice(o+1)))}else t.resetFormAfter=i}}}),t._v("\n "+t._s(t.$t("firefly.reset_after"))+"\n\n ")])])]),t._v(" "),n("div",{staticClass:"box-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-success",attrs:{id:"submitButton"},on:{click:t.submit}},[t._v(t._s(t.$t("firefly.submit")))])])])])])])])}),[],!1,null,"78dcea3e",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"EditTransaction",props:{groupId:Number},mounted:function(){this.getGroup()},ready:function(){},methods:{positiveAmount:function(t){return t<0?-1*t:t},roundNumber:function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},selectedSourceAccount:function(t,e){if("string"==typeof e)return this.transactions[t].source_account.id=null,void(this.transactions[t].source_account.name=e);this.transactions[t].source_account={id:e.id,name:e.name,type:e.type,currency_id:e.currency_id,currency_name:e.currency_name,currency_code:e.currency_code,currency_decimal_places:e.currency_decimal_places,allowed_types:this.transactions[t].source_account.allowed_types}},selectedDestinationAccount:function(t,e){if("string"==typeof e)return this.transactions[t].destination_account.id=null,void(this.transactions[t].destination_account.name=e);this.transactions[t].destination_account={id:e.id,name:e.name,type:e.type,currency_id:e.currency_id,currency_name:e.currency_name,currency_code:e.currency_code,currency_decimal_places:e.currency_decimal_places,allowed_types:this.transactions[t].destination_account.allowed_types}},clearSource:function(t){this.transactions[t].source_account={id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:this.transactions[t].source_account.allowed_types},this.transactions[t].destination_account&&this.selectedDestinationAccount(t,this.transactions[t].destination_account)},setTransactionType:function(t){null!==t&&(this.transactionType=t)},deleteTransaction:function(t,e){for(var n in e.preventDefault(),this.transactions)this.transactions.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n);for(var r in this.transactions.splice(t,1),this.transactions)this.transactions.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)},clearDestination:function(t){this.transactions[t].destination_account={id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:this.transactions[t].destination_account.allowed_types},this.transactions[t].source_account&&this.selectedSourceAccount(t,this.transactions[t].source_account)},getGroup:function(){var t=this,e=window.location.href.split("/"),n="./api/v1/transactions/"+e[e.length-1]+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content;axios.get(n).then((function(e){t.processIncomingGroup(e.data.data)})).catch((function(t){}))},processIncomingGroup:function(t){this.group_title=t.attributes.group_title;var e=t.attributes.transactions.reverse();for(var n in e)if(e.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var r=e[n];this.processIncomingGroupRow(r)}},processIncomingGroupRow:function(t){this.setTransactionType(t.type);var e=[];for(var n in t.tags)t.tags.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&e.push({text:t.tags[n],tiClasses:[]});this.transactions.push({transaction_journal_id:t.transaction_journal_id,description:t.description,date:t.date.substr(0,10),amount:this.roundNumber(this.positiveAmount(t.amount),t.currency_decimal_places),category:t.category_name,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:t.budget_id,tags:e,custom_fields:{interest_date:t.interest_date,book_date:t.book_date,process_date:t.process_date,due_date:t.due_date,payment_date:t.payment_date,invoice_date:t.invoice_date,internal_reference:t.internal_reference,notes:t.notes},foreign_amount:{amount:this.roundNumber(this.positiveAmount(t.foreign_amount),t.foreign_currency_decimal_places),currency_id:t.foreign_currency_id},source_account:{id:t.source_id,name:t.source_name,type:t.source_type,currency_id:t.currency_id,currency_name:t.currency_name,currency_code:t.currency_code,currency_decimal_places:t.currency_decimal_places,allowed_types:[t.source_type]},destination_account:{id:t.destination_id,name:t.destination_name,type:t.destination_type,currency_id:t.currency_id,currency_name:t.currency_name,currency_code:t.currency_code,currency_decimal_places:t.currency_decimal_places,allowed_types:[t.destination_type]}})},convertData:function(){var t,e,n,r={transactions:[]};for(var i in this.transactions.length>1&&(r.group_title=this.group_title),t=this.transactionType?this.transactionType.toLowerCase():"invalid",e=this.transactions[0].source_account.type,n=this.transactions[0].destination_account.type,"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)&&(t="withdrawal"),"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(n)&&(t="deposit"),this.transactions)this.transactions.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&r.transactions.push(this.convertDataRow(this.transactions[i],i,t));return r},convertDataRow:function(t,e,n){var r,i,o,a,s,c,u=[],l=null,d=null;for(var f in i=t.source_account.id,o=t.source_account.name,a=t.destination_account.id,s=t.destination_account.name,c=t.date,e>0&&(c=this.transactions[0].date),"withdrawal"===n&&""===s&&(a=window.cashAccountId),"deposit"===n&&""===o&&(i=window.cashAccountId),e>0&&("withdrawal"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(i=this.transactions[0].source_account.id,o=this.transactions[0].source_account.name),e>0&&("deposit"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(a=this.transactions[0].destination_account.id,s=this.transactions[0].destination_account.name),u=[],l=null,d=null,t.tags)t.tags.hasOwnProperty(f)&&/^0$|^[1-9]\d*$/.test(f)&&f<=4294967294&&u.push(t.tags[f].text);return""!==t.foreign_amount.amount&&0!==parseFloat(t.foreign_amount.amount)&&(l=t.foreign_amount.amount,d=t.foreign_amount.currency_id),d===t.currency_id&&(l=null,d=null),0===a&&(a=null),0===i&&(i=null),r={transaction_journal_id:t.transaction_journal_id,type:n,date:c,amount:t.amount,currency_id:t.currency_id,description:t.description,source_id:i,source_name:o,destination_id:a,destination_name:s,category_name:t.category,interest_date:t.custom_fields.interest_date,book_date:t.custom_fields.book_date,process_date:t.custom_fields.process_date,due_date:t.custom_fields.due_date,payment_date:t.custom_fields.payment_date,invoice_date:t.custom_fields.invoice_date,internal_reference:t.custom_fields.internal_reference,notes:t.custom_fields.notes,tags:u},null!==l&&(r.foreign_amount=l,r.foreign_currency_id=d),r.budget_id=parseInt(t.budget),parseInt(t.piggy_bank)>0&&(r.piggy_bank_id=parseInt(t.piggy_bank)),r},submit:function(t){var e=this,n=window.location.href.split("/"),r="./api/v1/transactions/"+n[n.length-1]+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content,i="PUT";this.storeAsNew&&(r="./api/v1/transactions?_token="+document.head.querySelector('meta[name="csrf-token"]').content,i="POST");var o=this.convertData(),a=$(t.currentTarget);a.prop("disabled",!0),axios({method:i,url:r,data:o}).then((function(t){0===e.collectAttachmentData(t)&&e.redirectUser(t.data.data.id)})).catch((function(t){e.parseErrors(t.response.data)})),t&&t.preventDefault(),a.prop("disabled",!1)},redirectUser:function(t){this.returnAfter?(this.setDefaultErrors(),this.storeAsNew?(this.success_message='Transaction #'+t+" has been created.",this.error_message=""):(this.success_message='The transaction has been updated.',this.error_message="")):this.storeAsNew?window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=created":window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=updated"},collectAttachmentData:function(t){var e=this,n=t.data.data.id,r=[],i=[],o=$('input[name="attachments[]"]');for(var a in o)if(o.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294)for(var s in o[a].files)if(o[a].files.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var c=t.data.data.attributes.transactions.reverse();r.push({journal:c[a].transaction_journal_id,file:o[a].files[s]})}var u=r.length,l=function(t){var o,a,s;r.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(o=r[t],a=e,(s=new FileReader).onloadend=function(e){e.target.readyState===FileReader.DONE&&(i.push({name:r[t].file.name,journal:r[t].journal,content:new Blob([e.target.result])}),i.length===u&&a.uploadFiles(i,n))},s.readAsArrayBuffer(o.file))};for(var d in r)l(d);return u},uploadFiles:function(t,e){var n=this,r=t.length,i=0,o=function(o){if(t.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294){var a={filename:t[o].name,model:"TransactionJournal",model_id:t[o].journal};axios.post("./api/v1/attachments",a).then((function(a){var s="./api/v1/attachments/"+a.data.data.id+"/upload";axios.post(s,t[o].content).then((function(t){return++i===r&&n.redirectUser(e,null),!0})).catch((function(t){return console.error("Could not upload file."),console.error(t),i++,n.error_message="Could not upload attachment: "+t,i===r&&n.redirectUser(e,null),!1}))}))}};for(var a in t)o(a)},addTransaction:function(t){this.transactions.push({transaction_journal_id:0,description:"",date:"",amount:"",category:"",piggy_bank:0,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:0,tags:[],custom_fields:{interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",internal_reference:"",notes:"",attachments:[]},foreign_amount:{amount:"",currency_id:0},source_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:[]},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:[]}}),t&&t.preventDefault()},parseErrors:function(t){var e,n;for(var r in this.setDefaultErrors(),this.error_message="",t.message.length>0?this.error_message=this.$t("firefly.errors_submission"):this.error_message="",t.errors)if(t.errors.hasOwnProperty(r)&&("group_title"===r&&(this.group_title_errors=t.errors[r]),"group_title"!==r)){switch(e=parseInt(r.split(".")[1]),n=r.split(".")[2]){case"amount":case"date":case"budget_id":case"description":case"tags":this.transactions[e].errors[n]=t.errors[r];break;case"source_name":case"source_id":this.transactions[e].errors.source_account=this.transactions[e].errors.source_account.concat(t.errors[r]);break;case"destination_name":case"destination_id":this.transactions[e].errors.destination_account=this.transactions[e].errors.destination_account.concat(t.errors[r]);break;case"foreign_amount":case"foreign_currency_id":this.transactions[e].errors.foreign_amount=this.transactions[e].errors.foreign_amount.concat(t.errors[r])}this.transactions[e].errors.source_account=Array.from(new Set(this.transactions[e].errors.source_account)),this.transactions[e].errors.destination_account=Array.from(new Set(this.transactions[e].errors.destination_account))}},setDefaultErrors:function(){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(this.transactions[t].errors={source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}})}},data:function(){return{group:this.groupId,error_message:"",success_message:"",transactions:[],group_title:"",returnAfter:!1,storeAsNew:!1,transactionType:null,group_title_errors:[],resetButtonDisabled:!0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{staticClass:"form-horizontal",attrs:{method:"POST",action:"#","accept-charset":"UTF-8",id:"store",enctype:"multipart/form-data"}},[n("input",{attrs:{name:"_token",type:"hidden",value:"xxx"}}),t._v(" "),""!==t.error_message?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"alert alert-danger alert-dismissible",attrs:{role:"alert"}},[n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":t.$t("firefly.close")}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),n("strong",[t._v(t._s(t.$t("firefly.flash_error")))]),t._v(" "+t._s(t.error_message)+"\n ")])])]):t._e(),t._v(" "),""!==t.success_message?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"alert alert-success alert-dismissible",attrs:{role:"alert"}},[n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":t.$t("firefly.close")}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),n("strong",[t._v(t._s(t.$t("firefly.flash_success")))]),t._v(" "),n("span",{domProps:{innerHTML:t._s(t.success_message)}})])])]):t._e(),t._v(" "),t.transactions.length>1?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("group-description",{attrs:{error:t.group_title_errors},model:{value:t.group_title,callback:function(e){t.group_title=e},expression:"group_title"}})],1)])])]):t._e(),t._v(" "),n("div",t._l(t.transactions,(function(e,r){return n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title splitTitle"},[t.transactions.length>1?n("span",[t._v(t._s(t.$t("firefly.split"))+" "+t._s(r+1)+" / "+t._s(t.transactions.length))]):t._e(),t._v(" "),1===t.transactions.length?n("span",[t._v(t._s(t.$t("firefly.transaction_journal_information")))]):t._e()]),t._v(" "),t.transactions.length>1?n("div",{staticClass:"box-tools pull-right",attrs:{x:""}},[n("button",{staticClass:"btn btn-xs btn-danger",attrs:{type:"button"},on:{click:function(e){return t.deleteTransaction(r,e)}}},[n("i",{staticClass:"fa fa-trash"})])]):t._e()]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-4"},["reconciliation"!==t.transactionType.toLowerCase()?n("transaction-description",{attrs:{index:r,error:e.errors.description},model:{value:e.description,callback:function(n){t.$set(e,"description",n)},expression:"transaction.description"}}):t._e(),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("account-select",{attrs:{inputName:"source[]",title:t.$t("firefly.source_account"),accountName:e.source_account.name,accountTypeFilters:e.source_account.allowed_types,transactionType:t.transactionType,index:r,error:e.errors.source_account},on:{"clear:value":function(e){return t.clearSource(r)},"select:account":function(e){return t.selectedSourceAccount(r,e)}}}):t._e(),t._v(" "),"reconciliation"===t.transactionType.toLowerCase()?n("div",{staticClass:"form-group"},[n("div",{staticClass:"col-sm-12"},[n("p",{staticClass:"form-control-static",attrs:{id:"ffInput_source"}},[n("em",[t._v("\n "+t._s(t.$t("firefly.source_account_reconciliation"))+"\n ")])])])]):t._e(),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("account-select",{attrs:{inputName:"destination[]",title:t.$t("firefly.destination_account"),accountName:e.destination_account.name,accountTypeFilters:e.destination_account.allowed_types,transactionType:t.transactionType,index:r,error:e.errors.destination_account},on:{"clear:value":function(e){return t.clearDestination(r)},"select:account":function(e){return t.selectedDestinationAccount(r,e)}}}):t._e(),t._v(" "),"reconciliation"===t.transactionType.toLowerCase()?n("div",{staticClass:"form-group"},[n("div",{staticClass:"col-sm-12"},[n("p",{staticClass:"form-control-static",attrs:{id:"ffInput_dest"}},[n("em",[t._v("\n "+t._s(t.$t("firefly.destination_account_reconciliation"))+"\n ")])])])]):t._e(),t._v(" "),n("standard-date",{attrs:{index:r,error:e.errors.date},model:{value:e.date,callback:function(n){t.$set(e,"date",n)},expression:"transaction.date"}}),t._v(" "),0===r?n("div",[n("transaction-type",{attrs:{source:e.source_account.type,destination:e.destination_account.type},on:{"set:transactionType":function(e){return t.setTransactionType(e)},"act:limitSourceType":function(e){return t.limitSourceType(e)},"act:limitDestinationType":function(e){return t.limitDestinationType(e)}}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("amount",{attrs:{source:e.source_account,destination:e.destination_account,error:e.errors.amount,transactionType:t.transactionType},model:{value:e.amount,callback:function(n){t.$set(e,"amount",n)},expression:"transaction.amount"}}),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("foreign-amount",{attrs:{source:e.source_account,destination:e.destination_account,transactionType:t.transactionType,error:e.errors.foreign_amount,no_currency:t.$t("firefly.none_in_select_list"),title:t.$t("form.foreign_amount")},model:{value:e.foreign_amount,callback:function(n){t.$set(e,"foreign_amount",n)},expression:"transaction.foreign_amount"}}):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("budget",{attrs:{transactionType:t.transactionType,error:e.errors.budget_id,no_budget:t.$t("firefly.none_in_select_list")},model:{value:e.budget,callback:function(n){t.$set(e,"budget",n)},expression:"transaction.budget"}}),t._v(" "),n("category",{attrs:{transactionType:t.transactionType,error:e.errors.category},model:{value:e.category,callback:function(n){t.$set(e,"category",n)},expression:"transaction.category"}}),t._v(" "),n("tags",{attrs:{transactionType:t.transactionType,tags:e.tags,error:e.errors.tags},model:{value:e.tags,callback:function(n){t.$set(e,"tags",n)},expression:"transaction.tags"}}),t._v(" "),n("custom-transaction-fields",{attrs:{error:e.errors.custom_errors},model:{value:e.custom_fields,callback:function(n){t.$set(e,"custom_fields",n)},expression:"transaction.custom_fields"}})],1)])]),t._v(" "),t.transactions.length-1===r&&"reconciliation"!==t.transactionType.toLowerCase()?n("div",{staticClass:"box-footer"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addTransaction}},[t._v(t._s(t.$t("firefly.add_another_split")))])]):t._e()])])])})),0),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-3 col-md-4 col-sm-6 col-xs-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.submission"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.returnAfter,expression:"returnAfter"}],attrs:{name:"return_after",type:"checkbox"},domProps:{checked:Array.isArray(t.returnAfter)?t._i(t.returnAfter,null)>-1:t.returnAfter},on:{change:function(e){var n=t.returnAfter,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.returnAfter=n.concat([null])):o>-1&&(t.returnAfter=n.slice(0,o).concat(n.slice(o+1)))}else t.returnAfter=i}}}),t._v("\n "+t._s(t.$t("firefly.after_update_create_another"))+"\n ")])]),t._v(" "),null!==t.transactionType&&"reconciliation"!==t.transactionType.toLowerCase()?n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.storeAsNew,expression:"storeAsNew"}],attrs:{name:"store_as_new",type:"checkbox"},domProps:{checked:Array.isArray(t.storeAsNew)?t._i(t.storeAsNew,null)>-1:t.storeAsNew},on:{change:function(e){var n=t.storeAsNew,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.storeAsNew=n.concat([null])):o>-1&&(t.storeAsNew=n.slice(0,o).concat(n.slice(o+1)))}else t.storeAsNew=i}}}),t._v("\n "+t._s(t.$t("firefly.store_as_new"))+"\n ")])]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-success",on:{click:t.submit}},[t._v(t._s(t.$t("firefly.update_transaction")))])])])])])])])}),[],!1,null,"078a97ec",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomDate",props:{value:String,title:String,name:String,error:Array},methods:{handleInput:function(t){this.$emit("input",this.$refs.date.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"date",staticClass:"form-control",attrs:{type:"date",name:t.name,title:t.title,autocomplete:"off",placeholder:t.title},domProps:{value:t.value?t.value.substr(0,10):""},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"476dc857",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomString",props:{title:String,name:String,value:String,error:Array},methods:{handleInput:function(t){this.$emit("input",this.$refs.str.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"str",staticClass:"form-control",attrs:{type:"text",name:t.name,title:t.title,autocomplete:"off",placeholder:t.title},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"05f5f098",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomTextarea",props:{title:String,name:String,value:String,error:Array},data:function(){return{textValue:this.value}},methods:{handleInput:function(t){this.$emit("input",this.$refs.str.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.textValue,expression:"textValue"}],ref:"str",staticClass:"form-control",attrs:{name:t.name,title:t.title,autocomplete:"off",rows:"8",placeholder:t.title},domProps:{value:t.textValue},on:{input:[function(e){e.target.composing||(t.textValue=e.target.value)},t.handleInput]}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"646ac644",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"StandardDate",methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.date.value)}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.date"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"date",staticClass:"form-control",attrs:{type:"date",name:"date[]",title:t.$t("firefly.date"),autocomplete:"off",disabled:t.index>0,placeholder:t.$t("firefly.date")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"12108d0d",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"GroupDescription",methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.descr.value)}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"descr",staticClass:"form-control",attrs:{type:"text",name:"group_title",title:t.$t("firefly.split_transaction_title"),autocomplete:"off",placeholder:t.$t("firefly.split_transaction_title")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),0===t.error.length?n("p",{staticClass:"help-block"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title_help"))+"\n ")]):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"d8e3a02c",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"TransactionDescription",mounted:function(){this.target=this.$refs.descr,this.descriptionAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/transaction-journals/all?search="},data:function(){return{descriptionAutoCompleteURI:null,name:null,description:null,target:null}},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.descr.value)},handleEnter:function(t){13===t.keyCode&&t.preventDefault()},selectedItem:function(t){void 0!==this.name&&"string"!=typeof this.name&&(this.$refs.descr.value=this.name.description,this.$emit("input",this.$refs.descr.value))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.description"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"descr",staticClass:"form-control",attrs:{type:"text",name:"description[]",title:t.$t("firefly.description"),autocomplete:"off",placeholder:t.$t("firefly.description")},domProps:{value:t.value},on:{keypress:t.handleEnter,submit:function(t){t.preventDefault()},input:t.handleInput}}),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.descriptionAutoCompleteURI,target:t.target,"item-key":"description"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"56ea3d62",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomTransactionFields",props:["value","error"],mounted:function(){this.getPreference()},data:function(){return{customInterestDate:null,fields:[{interest_date:!1,book_date:!1,process_date:!1,due_date:!1,payment_date:!1,invoice_date:!1,internal_reference:!1,notes:!1,attachments:!1}]}},computed:{dateComponent:function(){return"custom-date"},stringComponent:function(){return"custom-string"},attachmentComponent:function(){return"custom-attachments"},textareaComponent:function(){return"custom-textarea"}},methods:{handleInput:function(t){this.$emit("input",this.value)},getPreference:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"api/v1/preferences/transaction_journal_optional_fields";axios.get(e).then((function(e){t.fields=e.data.data.attributes.data})).catch((function(){return console.warn("Oh. Something went wrong loading custom transaction fields.")}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[this.fields.interest_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.interest_date,name:"interest_date[]",title:t.$t("form.interest_date")},model:{value:t.value.interest_date,callback:function(e){t.$set(t.value,"interest_date",e)},expression:"value.interest_date"}}):t._e(),t._v(" "),this.fields.book_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.book_date,name:"book_date[]",title:t.$t("form.book_date")},model:{value:t.value.book_date,callback:function(e){t.$set(t.value,"book_date",e)},expression:"value.book_date"}}):t._e(),t._v(" "),this.fields.process_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.process_date,name:"process_date[]",title:t.$t("form.process_date")},model:{value:t.value.process_date,callback:function(e){t.$set(t.value,"process_date",e)},expression:"value.process_date"}}):t._e(),t._v(" "),this.fields.due_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.due_date,name:"due_date[]",title:t.$t("form.due_date")},model:{value:t.value.due_date,callback:function(e){t.$set(t.value,"due_date",e)},expression:"value.due_date"}}):t._e(),t._v(" "),this.fields.payment_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.payment_date,name:"payment_date[]",title:t.$t("form.payment_date")},model:{value:t.value.payment_date,callback:function(e){t.$set(t.value,"payment_date",e)},expression:"value.payment_date"}}):t._e(),t._v(" "),this.fields.invoice_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.invoice_date,name:"invoice_date[]",title:t.$t("form.invoice_date")},model:{value:t.value.invoice_date,callback:function(e){t.$set(t.value,"invoice_date",e)},expression:"value.invoice_date"}}):t._e(),t._v(" "),this.fields.internal_reference?n(t.stringComponent,{tag:"component",attrs:{error:t.error.internal_reference,name:"internal_reference[]",title:t.$t("form.internal_reference")},model:{value:t.value.internal_reference,callback:function(e){t.$set(t.value,"internal_reference",e)},expression:"value.internal_reference"}}):t._e(),t._v(" "),this.fields.attachments?n(t.attachmentComponent,{tag:"component",attrs:{error:t.error.attachments,name:"attachments[]",title:t.$t("firefly.attachments")},model:{value:t.value.attachments,callback:function(e){t.$set(t.value,"attachments",e)},expression:"value.attachments"}}):t._e(),t._v(" "),this.fields.notes?n(t.textareaComponent,{tag:"component",attrs:{error:t.error.notes,name:"notes[]",title:t.$t("firefly.notes")},model:{value:t.value.notes,callback:function(e){t.$set(t.value,"notes",e)},expression:"value.notes"}}):t._e()],1)}),[],!1,null,"1366cbef",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"PiggyBank",props:["value","transactionType","error","no_piggy_bank"],mounted:function(){this.loadPiggies()},data:function(){return{piggies:[]}},methods:{handleInput:function(t){this.$emit("input",this.$refs.piggy.value)},hasError:function(){return this.error.length>0},loadPiggies:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/piggy-banks";axios.get(e,{}).then((function(e){for(var n in t.piggies=[{name_with_amount:t.no_piggy_bank,id:0}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&t.piggies.push(e.data[n])}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return void 0!==this.transactionType&&"Transfer"===this.transactionType?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12"},[this.piggies.length>0?n("select",{ref:"piggy",staticClass:"form-control",attrs:{name:"piggy_bank[]"},on:{input:t.handleInput}},t._l(this.piggies,(function(e){return n("option",{attrs:{label:e.name_with_amount},domProps:{value:e.id}},[t._v(t._s(e.name_with_amount))])})),0):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"72eff39a",null);e.a=o.exports},function(t,e,n){"use strict";var r=n(10),i=n.n(r),o=n(17),a={name:"Tags",components:{VueTagsInput:n.n(o).a},props:["value","error"],data:function(){return{tag:"",autocompleteItems:[],debounce:null,tags:this.value}},watch:{tag:"initItems"},methods:{update:function(t){this.autocompleteItems=[],this.tags=t,this.$emit("input",this.tags)},hasError:function(){return this.error.length>0},initItems:function(){var t=this;if(!(this.tag.length<2)){var e=document.getElementsByTagName("base")[0].href+"json/tags?search=".concat(this.tag);clearTimeout(this.debounce),this.debounce=setTimeout((function(){i.a.get(e).then((function(e){t.autocompleteItems=e.data.map((function(t){return{text:t.tag}}))})).catch((function(){return console.warn("Oh. Something went wrong loading tags.")}))}),600)}}}},s=n(0),c=Object(s.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.tags"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("vue-tags-input",{attrs:{tags:t.tags,classes:"form-input","autocomplete-items":t.autocompleteItems,"add-only-from-autocomplete":!1,placeholder:t.$t("firefly.tags")},on:{"tags-changed":t.update},model:{value:t.tag,callback:function(e){t.tag=e},expression:"tag"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"8f8e1762",null);e.a=c.exports},function(t,e,n){"use strict";var r={name:"Category",props:{value:String,inputName:String,error:Array,accountName:{type:String,default:""}},data:function(){return{categoryAutoCompleteURI:null,name:null,target:null}},ready:function(){this.name=this.accountName},mounted:function(){this.target=this.$refs.input,this.categoryAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/categories?search="},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){"string"!=typeof this.$refs.input.value?this.$emit("input",this.$refs.input.value.name):this.$emit("input",this.$refs.input.value)},clearCategory:function(){this.name="",this.$refs.input.value="",this.$emit("input",this.$refs.input.value),this.$emit("clear:category")},selectedItem:function(t){void 0!==this.name&&(this.$emit("select:category",this.name),"string"!=typeof this.name?this.$emit("input",this.name.name):this.$emit("input",this.name))},handleEnter:function(t){13===t.keyCode&&t.preventDefault()}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.category"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"input-group"},[n("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",placeholder:t.$t("firefly.category"),autocomplete:"off","data-role":"input",name:"category[]",title:t.$t("firefly.category")},domProps:{value:t.value},on:{input:t.handleInput,keypress:t.handleEnter,submit:function(t){t.preventDefault()}}}),t._v(" "),n("span",{staticClass:"input-group-btn"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button"},on:{click:t.clearCategory}},[n("i",{staticClass:"fa fa-trash-o"})])])]),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.categoryAutoCompleteURI,target:t.target,"item-key":"name"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"63905dd9",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"Amount",props:["source","destination","transactionType","value","error"],data:function(){return{sourceAccount:this.source,destinationAccount:this.destination,type:this.transactionType}},methods:{handleInput:function(t){this.$emit("input",this.$refs.amount.value)},hasError:function(){return this.error.length>0},changeData:function(){var t=this.transactionType;t||this.source.name||this.destination.name?(null===t&&(t=""),""!==t||""===this.source.currency_name?""!==t||""===this.destination.currency_name?"withdrawal"!==t.toLowerCase()&&"reconciliation"!==t.toLowerCase()&&"transfer"!==t.toLowerCase()?"Deposit"===t&&$(this.$refs.cur).text(this.destination.currency_name):$(this.$refs.cur).text(this.source.currency_name):$(this.$refs.cur).text(this.destination.currency_name):$(this.$refs.cur).text(this.source.currency_name)):$(this.$refs.cur).text("")}},watch:{source:function(){this.changeData()},destination:function(){this.changeData()},transactionType:function(){this.changeData()}},mounted:function(){this.changeData()}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-8 col-sm-offset-4 text-sm"},[t._v("\n "+t._s(t.$t("firefly.amount"))+"\n ")]),t._v(" "),n("label",{ref:"cur",staticClass:"col-sm-4 control-label"}),t._v(" "),n("div",{staticClass:"col-sm-8"},[n("input",{ref:"amount",staticClass:"form-control",attrs:{type:"number",step:"any",name:"amount[]",title:"$t('firefly.amount')",autocomplete:"off",placeholder:t.$t("firefly.amount")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"920c84c2",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"ForeignAmountSelect",props:["source","destination","transactionType","value","error","no_currency","title"],mounted:function(){this.liability=!1,this.loadCurrencies()},data:function(){return{currencies:[],enabledCurrencies:[],exclude:null,liability:!1}},watch:{source:function(){this.changeData()},destination:function(){this.changeData()},transactionType:function(){this.changeData()}},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){var e={amount:this.$refs.amount.value,currency_id:this.$refs.currency_select.value};this.$emit("input",e)},changeData:function(){this.enabledCurrencies=[];var t=this.destination.type?this.destination.type.toLowerCase():"invalid",e=this.source.type?this.source.type.toLowerCase():"invalid",n=this.transactionType?this.transactionType.toLowerCase():"invalid",r=["loan","debt","mortgage"],i=-1!==r.indexOf(e),o=-1!==r.indexOf(t);if("transfer"===n||o||i)for(var a in this.liability=!0,this.currencies)this.currencies.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&this.currencies[a].id===this.destination.currency_id&&this.enabledCurrencies.push(this.currencies[a]);else if("withdrawal"===n&&this.source&&!1===i)for(var s in this.currencies)this.currencies.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&this.source.currency_id!==this.currencies[s].id&&this.enabledCurrencies.push(this.currencies[s]);else if("deposit"===n&&this.destination)for(var c in this.currencies)this.currencies.hasOwnProperty(c)&&/^0$|^[1-9]\d*$/.test(c)&&c<=4294967294&&this.destination.currency_id!==this.currencies[c].id&&this.enabledCurrencies.push(this.currencies[c]);else for(var u in this.currencies)this.currencies.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&this.enabledCurrencies.push(this.currencies[u])},loadCurrencies:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/currencies";axios.get(e,{}).then((function(e){for(var n in t.currencies=[{name:t.no_currency,id:0,enabled:!0}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&e.data[n].enabled&&(t.currencies.push(e.data[n]),t.enabledCurrencies.push(e.data[n]))}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return null==this.transactionType||null!=this.transactionType&&this.enabledCurrencies.length>2&&("deposit"===this.transactionType.toLowerCase()||"withdrawal"===this.transactionType.toLowerCase())||this.liability||null!=this.transactionType&&"transfer"===this.transactionType.toLowerCase()?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-8 col-sm-offset-4 text-sm"},[t._v("\n "+t._s(t.$t("form.foreign_amount"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-4"},[n("select",{ref:"currency_select",staticClass:"form-control",attrs:{name:"foreign_currency[]"},on:{input:t.handleInput}},t._l(this.enabledCurrencies,(function(e){return e.enabled?n("option",{attrs:{label:e.name},domProps:{value:e.id,selected:t.value.currency_id===e.id}},[t._v("\n "+t._s(e.name)+"\n ")]):t._e()})),0)]),t._v(" "),n("div",{staticClass:"col-sm-8"},[this.enabledCurrencies.length>0?n("input",{ref:"amount",staticClass:"form-control",attrs:{type:"number",step:"any",name:"foreign_amount[]",title:this.title,autocomplete:"off",placeholder:this.title},domProps:{value:t.value.amount},on:{input:t.handleInput}}):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"0dc3f488",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:{source:String,destination:String,type:String},methods:{changeValue:function(){if(this.source&&this.destination){var t="";window.accountToTypes[this.source]?window.accountToTypes[this.source][this.destination]?t=window.accountToTypes[this.source][this.destination]:console.warn("User selected an impossible destination."):console.warn("User selected an impossible source."),""!==t&&(this.transactionType=t,this.sentence="You're creating a "+this.transactionType,this.$emit("act:limitSourceType",this.source),this.$emit("act:limitDestinationType",this.destination))}else this.sentence="",this.transactionType="";this.$emit("set:transactionType",this.transactionType)}},data:function(){return{transactionType:this.type,sentence:""}},watch:{source:function(){this.changeValue()},destination:function(){this.changeValue()}},name:"TransactionType"},i=n(0),o=Object(i.a)(r,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"form-group"},[e("div",{staticClass:"col-sm-12"},[""!==this.sentence?e("label",{staticClass:"control-label text-info"},[this._v("\n "+this._s(this.sentence)+"\n ")]):this._e()])])}),[],!1,null,"30b6f8d0",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:{inputName:String,title:String,index:Number,transactionType:String,error:Array,accountName:{type:String,default:""},accountTypeFilters:{type:Array,default:function(){return[]}},defaultAccountTypeFilters:{type:Array,default:function(){return[]}}},data:function(){return{accountAutoCompleteURI:null,name:null,trType:this.transactionType,target:null,inputDisabled:!1,allowedTypes:this.accountTypeFilters,defaultAllowedTypes:this.defaultAccountTypeFilters}},ready:function(){this.name=this.accountName},mounted:function(){this.target=this.$refs.input;var t=this.allowedTypes.join(",");this.name=this.accountName,this.accountAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/accounts?types="+t+"&search=",this.triggerTransactionType()},watch:{transactionType:function(){this.triggerTransactionType()},accountTypeFilters:function(){var t=this.accountTypeFilters.join(",");0===this.accountTypeFilters.length&&(t=this.defaultAccountTypeFilters.join(",")),this.accountAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/accounts?types="+t+"&search="},name:function(){}},methods:{hasError:function(){return this.error.length>0},triggerTransactionType:function(){if(this.name,null!==this.transactionType&&""!==this.transactionType&&(this.inputDisabled=!1,""!==this.transactionType.toString()&&this.index>0)){if("transfer"===this.transactionType.toString().toLowerCase())return void(this.inputDisabled=!0);if("withdrawal"===this.transactionType.toString().toLowerCase()&&"source"===this.inputName.substr(0,6).toLowerCase())return void(this.inputDisabled=!0);"deposit"===this.transactionType.toString().toLowerCase()&&"destination"===this.inputName.substr(0,11).toLowerCase()&&(this.inputDisabled=!0)}},selectedItem:function(t){void 0!==this.name&&("string"==typeof this.name&&this.$emit("clear:value"),this.$emit("select:account",this.name))},clearSource:function(t){this.name="",this.$emit("clear:value")},handleEnter:function(t){13===t.keyCode&&t.preventDefault()}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"input-group"},[n("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",placeholder:t.title,"data-index":t.index,autocomplete:"off","data-role":"input",disabled:t.inputDisabled,name:t.inputName,title:t.title},on:{keypress:t.handleEnter,submit:function(t){t.preventDefault()}}}),t._v(" "),n("span",{staticClass:"input-group-btn"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button"},on:{click:t.clearSource}},[n("i",{staticClass:"fa fa-trash-o"})])])]),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.accountAutoCompleteURI,target:t.target,"item-key":"name_with_balance"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"ff6f5e0e",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"Budget",props:["transactionType","value","error","no_budget"],mounted:function(){this.loadBudgets()},data:function(){return{budgets:[]}},methods:{handleInput:function(t){this.$emit("input",this.$refs.budget.value)},hasError:function(){return this.error.length>0},loadBudgets:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/budgets";axios.get(e,{}).then((function(e){for(var n in t.budgets=[{name:t.no_budget,id:0},{name:t.no_budget,id:null}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&t.budgets.push(e.data[n])}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return void 0===this.transactionType||"withdrawal"===this.transactionType||"Withdrawal"===this.transactionType||""===this.transactionType||null===this.transactionType?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.budget"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[this.budgets.length>0?n("select",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"value"}],ref:"budget",staticClass:"form-control",attrs:{name:"budget[]"},on:{input:t.handleInput,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.value=e.target.multiple?n:n[0]}}},t._l(this.budgets,(function(e){return n("option",{attrs:{label:e.name},domProps:{value:e.id}},[t._v(t._s(e.name))])})),0):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"3fcc2506",null);e.a=o.exports},,function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={data:function(){return{clients:[],createForm:{errors:[],name:"",redirect:""},editForm:{errors:[],name:"",redirect:""}}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getClients(),$("#modal-create-client").on("shown.bs.modal",(function(){$("#create-client-name").focus()})),$("#modal-edit-client").on("shown.bs.modal",(function(){$("#edit-client-name").focus()}))},getClients:function(){var t=this;axios.get("./oauth/clients").then((function(e){t.clients=e.data}))},showCreateClientForm:function(){$("#modal-create-client").modal("show")},store:function(){this.persistClient("post","./oauth/clients?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.createForm,"#modal-create-client")},edit:function(t){this.editForm.id=t.id,this.editForm.name=t.name,this.editForm.redirect=t.redirect,$("#modal-edit-client").modal("show")},update:function(){this.persistClient("put","./oauth/clients/"+this.editForm.id+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.editForm,"#modal-edit-client")},persistClient:function(t,e,n,i){var o=this;n.errors=[],axios[t](e,n).then((function(t){o.getClients(),n.name="",n.redirect="",n.errors=[],$(i).modal("hide")})).catch((function(t){"object"===r(t.response.data)?n.errors=_.flatten(_.toArray(t.response.data)):n.errors=["Something went wrong. Please try again."]}))},destroy:function(t){var e=this;axios.delete("./oauth/clients/"+t.id).then((function(t){e.getClients()}))}}},o=(n(44),n(0)),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[0===t.clients.length?n("p",{staticClass:"m-b-none"},[t._v("\n You have not created any OAuth clients.\n ")]):t._e(),t._v(" "),t.clients.length>0?n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.clients,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.id)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("code",[t._v(t._s(e.secret))])]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-default btn-xs",on:{click:function(n){return t.edit(e)}}},[t._v("\n Edit\n ")])]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-danger btn-xs",on:{click:function(n){return t.destroy(e)}}},[t._v("\n Delete\n ")])])])})),0)]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("a",{staticClass:"action-link btn btn-success",on:{click:t.showCreateClientForm}},[t._v("\n Create New Client\n ")])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-create-client",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(2),t._v(" "),n("div",{staticClass:"modal-body"},[t.createForm.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(3),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.createForm.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createForm.name,expression:"createForm.name"}],staticClass:"form-control",attrs:{id:"create-client-name",type:"text"},domProps:{value:t.createForm.name},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.store(e)},input:function(e){e.target.composing||t.$set(t.createForm,"name",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Something your users will recognize and trust.\n ")])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Redirect URL")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createForm.redirect,expression:"createForm.redirect"}],staticClass:"form-control",attrs:{type:"text",name:"redirect"},domProps:{value:t.createForm.redirect},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.store(e)},input:function(e){e.target.composing||t.$set(t.createForm,"redirect",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Your application's authorization callback URL.\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.store}},[t._v("\n Create\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-edit-client",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(4),t._v(" "),n("div",{staticClass:"modal-body"},[t.editForm.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(5),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.editForm.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.editForm.name,expression:"editForm.name"}],staticClass:"form-control",attrs:{id:"edit-client-name",type:"text"},domProps:{value:t.editForm.name},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.update(e)},input:function(e){e.target.composing||t.$set(t.editForm,"name",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Something your users will recognize and trust.\n ")])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Redirect URL")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.editForm.redirect,expression:"editForm.redirect"}],staticClass:"form-control",attrs:{type:"text",name:"redirect"},domProps:{value:t.editForm.redirect},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.update(e)},input:function(e){e.target.composing||t.$set(t.editForm,"redirect",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Your application's authorization callback URL.\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.update}},[t._v("\n Save Changes\n ")])])])])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n OAuth Clients\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Client ID")]),this._v(" "),e("th",[this._v("Name")]),this._v(" "),e("th",[this._v("Secret")]),this._v(" "),e("th"),this._v(" "),e("th")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Create Client\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Edit Client\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])}],!1,null,"0c0acb0f",null);e.a=a.exports},function(t,e,n){"use strict";var r={data:function(){return{tokens:[]}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getTokens()},getTokens:function(){var t=this;axios.get("./oauth/tokens").then((function(e){t.tokens=e.data}))},revoke:function(t){var e=this;axios.delete("./oauth/tokens/"+t.id).then((function(t){e.getTokens()}))}}},i=(n(47),n(0)),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.tokens.length>0?n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.tokens,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.client.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[e.scopes.length>0?n("span",[t._v("\n "+t._s(e.scopes.join(", "))+"\n ")]):t._e()]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-danger btn-xs",on:{click:function(n){return t.revoke(e)}}},[t._v("\n Revoke\n ")])])])})),0)])])])]):t._e()])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n Authorized Applications\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Name")]),this._v(" "),e("th",[this._v("Scopes")]),this._v(" "),e("th")])])}],!1,null,"77c1edf8",null);e.a=o.exports},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={data:function(){return{accessToken:null,tokens:[],scopes:[],form:{name:"",scopes:[],errors:[]}}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getTokens(),this.getScopes(),$("#modal-create-token").on("shown.bs.modal",(function(){$("#create-token-name").focus()}))},getTokens:function(){var t=this;axios.get("./oauth/personal-access-tokens").then((function(e){t.tokens=e.data}))},getScopes:function(){var t=this;axios.get("./oauth/scopes").then((function(e){t.scopes=e.data}))},showCreateTokenForm:function(){$("#modal-create-token").modal("show")},store:function(){var t=this;this.accessToken=null,this.form.errors=[],axios.post("./oauth/personal-access-tokens?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.form).then((function(e){t.form.name="",t.form.scopes=[],t.form.errors=[],t.tokens.push(e.data.token),t.showAccessToken(e.data.accessToken)})).catch((function(e){"object"===r(e.response.data)?t.form.errors=_.flatten(_.toArray(e.response.data)):t.form.errors=["Something went wrong. Please try again."]}))},toggleScope:function(t){this.scopeIsAssigned(t)?this.form.scopes=_.reject(this.form.scopes,(function(e){return e==t})):this.form.scopes.push(t)},scopeIsAssigned:function(t){return _.indexOf(this.form.scopes,t)>=0},showAccessToken:function(t){$("#modal-create-token").modal("hide"),this.accessToken=t,$("#modal-access-token").modal("show")},revoke:function(t){var e=this;axios.delete("./oauth/personal-access-tokens/"+t.id).then((function(t){e.getTokens()}))}}},o=(n(49),n(0)),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[0===t.tokens.length?n("p",{staticClass:"m-b-none"},[t._v("\n You have not created any personal access tokens.\n ")]):t._e(),t._v(" "),t.tokens.length>0?n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.tokens,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link text-danger",on:{click:function(n){return t.revoke(e)}}},[t._v("\n Delete\n ")])])])})),0)]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("a",{staticClass:"action-link btn btn-success",on:{click:t.showCreateTokenForm}},[t._v("\n Create New Token\n ")])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-create-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(2),t._v(" "),n("div",{staticClass:"modal-body"},[t.form.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(3),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.form.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.store(e)}}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-4 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-6"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"form-control",attrs:{id:"create-token-name",type:"text",name:"name"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}})])]),t._v(" "),t.scopes.length>0?n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-4 control-label"},[t._v("Scopes")]),t._v(" "),n("div",{staticClass:"col-md-6"},t._l(t.scopes,(function(e){return n("div",[n("div",{staticClass:"checkbox"},[n("label",[n("input",{attrs:{type:"checkbox"},domProps:{checked:t.scopeIsAssigned(e.id)},on:{click:function(n){return t.toggleScope(e.id)}}}),t._v("\n\n "+t._s(e.id)+"\n ")])])])})),0)]):t._e()])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.store}},[t._v("\n Create\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-access-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(4),t._v(" "),n("div",{staticClass:"modal-body"},[n("p",[t._v("\n Here is your new personal access token. This is the only time it will be shown so don't lose it!\n You may now use this token to make API requests.\n ")]),t._v(" "),n("pre",[n("textarea",{staticClass:"form-control",staticStyle:{width:"100%"},attrs:{id:"tokenHidden",rows:"20"}},[t._v(t._s(t.accessToken))])])]),t._v(" "),t._m(5)])])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n Personal Access Tokens\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Name")]),this._v(" "),e("th")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Create Token\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Personal Access Token\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-footer"},[e("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[this._v("Close")])])}],!1,null,"18342cc8",null);e.a=a.exports},function(t,e,n){"use strict";(function(e,n){var r=Object.freeze({});function i(t){return null==t}function o(t){return null!=t}function a(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function l(t){return"[object Object]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var y=Object.prototype.hasOwnProperty;function A(t,e){return y.call(t,e)}function _(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var b=/-(\w)/g,w=_((function(t){return t.replace(b,(function(t,e){return e?e.toUpperCase():""}))})),C=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),x=/\B([A-Z])/g,T=_((function(t){return t.replace(x,"-$1").toLowerCase()})),k=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function E(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function $(t,e){for(var n in e)t[n]=e[n];return t}function S(t){for(var e={},n=0;n0,K=V&&V.indexOf("edge/")>0,J=(V&&V.indexOf("android"),V&&/iphone|ipad|ipod|ios/.test(V)||"ios"===Q),X=(V&&/chrome\/\d+/.test(V),V&&/phantomjs/.test(V),V&&V.match(/firefox\/(\d+)/)),Z={}.watch,tt=!1;if(q)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(r){}var nt=function(){return void 0===U&&(U=!q&&!W&&void 0!==e&&e.process&&"server"===e.process.env.VUE_ENV),U},rt=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var ot,at="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);ot="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var st=B,ct=0,ut=function(){this.id=ct++,this.subs=[]};ut.prototype.addSub=function(t){this.subs.push(t)},ut.prototype.removeSub=function(t){g(this.subs,t)},ut.prototype.depend=function(){ut.target&&ut.target.addDep(this)},ut.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e-1)if(o&&!A(i,"default"))a=!1;else if(""===a||a===T(t)){var c=Mt(String,i.type);(c<0||s0&&(ce((c=t(c,(n||"")+"_"+r))[0])&&ce(l)&&(d[u]=mt(l.text+c[0].text),c.shift()),d.push.apply(d,c)):s(c)?ce(l)?d[u]=mt(l.text+c):""!==c&&d.push(mt(c)):ce(c)&&ce(l)?d[u]=mt(l.text+c.text):(a(e._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist"+n+"_"+r+"__"),d.push(c)));return d}(t):void 0}function ce(t){return o(t)&&o(t.text)&&!1===t.isComment}function ue(t,e){if(t){for(var n=Object.create(null),r=at?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=pe(e,c,t[c]))}else i={};for(var u in e)u in i||(i[u]=he(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),F(i,"$stable",a),F(i,"$key",s),F(i,"$hasNormal",o),i}function pe(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:se(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function he(t,e){return function(){return t[e]}}function ve(t,e){var n,r,i,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,i=t.length;rdocument.createEvent("Event").timeStamp&&(an=function(){return sn.now()})}function cn(){var t,e;for(on=an(),nn=!0,Xe.sort((function(t,e){return t.id-e.id})),rn=0;rnrn&&Xe[n].id>t.id;)n--;Xe.splice(n+1,0,t)}else Xe.push(t);en||(en=!0,Zt(cn))}}(this)},ln.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Ft(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},ln.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ln.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},ln.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:B,set:B};function fn(t,e,n){dn.get=function(){return this[e][n]},dn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,dn)}var pn={lazy:!0};function hn(t,e,n){var r=!nt();"function"==typeof n?(dn.get=r?vn(e):mn(n),dn.set=B):(dn.get=n.get?r&&!1!==n.cache?vn(e):mn(n.get):B,dn.set=n.set||B),Object.defineProperty(t,e,dn)}function vn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),ut.target&&e.depend(),e.value}}function mn(t){return function(){return t.call(this,this)}}function gn(t,e,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var yn=0;function An(t){var e=t.options;if(t.super){var n=An(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}(t);r&&$(t.extendOptions,r),(e=t.options=Nt(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function _n(t){this._init(t)}function bn(t){return t&&(t.Ctor.options.name||t.tag)}function wn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:(n=t,"[object RegExp]"===u.call(n)&&t.test(e));var n}function Cn(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=bn(a.componentOptions);s&&!e(s)&&xn(n,o,r,i)}}}function xn(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,g(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=yn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Nt(An(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Qe(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=le(e._renderChildren,i),t.$scopedSlots=r,t._c=function(e,n,r,i){return Le(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Le(t,e,n,r,i,!0)};var o=n&&n.data;Tt(t,"$attrs",o&&o.attrs||r,null,!0),Tt(t,"$listeners",e._parentListeners||r,null,!0)}(e),Je(e,"beforeCreate"),function(t){var e=ue(t.$options.inject,t);e&&(wt(!1),Object.keys(e).forEach((function(n){Tt(t,n,e[n])})),wt(!0))}(e),function(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];t.$parent&&wt(!1);var o=function(o){i.push(o);var a=Pt(o,e,n,t);Tt(r,o,a),o in t||fn(t,"_props",o)};for(var a in e)o(a);wt(!0)}(t,e.props),e.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?B:k(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;l(e=t._data="function"==typeof e?function(t,e){dt();try{return t.call(e,e)}catch(t){return Ft(t,e,"data()"),{}}finally{ft()}}(e,t):e||{})||(e={});for(var n,r=Object.keys(e),i=t.$options.props,o=(t.$options.methods,r.length);o--;){var a=r[o];i&&A(i,a)||(void 0,36!==(n=(a+"").charCodeAt(0))&&95!==n&&fn(t,"_data",a))}xt(e,!0)}(t):xt(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new ln(t,a||B,B,pn)),i in t||hn(t,i,o)}}(t,e.computed),e.watch&&e.watch!==Z&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i1?E(e):e;for(var n=E(arguments,1),r='event handler for "'+t+'"',i=0,o=e.length;iparseInt(this.max)&&xn(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return M}};Object.defineProperty(t,"config",e),t.util={warn:st,extend:$,mergeOptions:Nt,defineReactive:Tt},t.set=kt,t.delete=Et,t.nextTick=Zt,t.observable=function(t){return xt(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,$(t.options.components,kn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Nt(this.options,t),this}}(t),function(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=e++,a.options=Nt(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)fn(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)hn(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,L.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=$({},a.options),i[r]=a,a}}(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(_n),Object.defineProperty(_n.prototype,"$isServer",{get:nt}),Object.defineProperty(_n.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(_n,"FunctionalRenderContext",{value:Be}),_n.version="2.6.11";var En=v("style,class"),$n=v("input,textarea,option,select,progress"),Sn=v("contenteditable,draggable,spellcheck"),Bn=v("events,caret,typing,plaintext-only"),Dn=v("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"),On="http://www.w3.org/1999/xlink",In=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Nn=function(t){return In(t)?t.slice(6,t.length):""},jn=function(t){return null==t||!1===t};function Pn(t,e){return{staticClass:Ln(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Ln(t,e){return t?e?t+" "+e:t:e||""}function Rn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r-1?sr(t,e,n):Dn(e)?jn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Sn(e)?t.setAttribute(e,function(t,e){return jn(e)||"false"===e?"false":"contenteditable"===t&&Bn(e)?e:"true"}(e,n)):In(e)?jn(n)?t.removeAttributeNS(On,Nn(e)):t.setAttributeNS(On,e,n):sr(t,e,n)}function sr(t,e,n){if(jn(n))t.removeAttribute(e);else{if(Y&&!G&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var cr={create:or,update:or};function ur(t,e){var n=e.elm,r=e.data,a=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=function(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Pn(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=Pn(e,n.data));return function(t,e){return o(t)||o(e)?Ln(t,Rn(e)):""}(e.staticClass,e.class)}(e),c=n._transitionClasses;o(c)&&(s=Ln(s,Rn(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var lr,dr={create:ur,update:ur};function fr(t,e,n){var r=lr;return function i(){null!==e.apply(null,arguments)&&vr(t,i,n,r)}}var pr=Wt&&!(X&&Number(X[1])<=53);function hr(t,e,n,r){if(pr){var i=on,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}lr.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function vr(t,e,n,r){(r||lr).removeEventListener(t,e._wrapper||e,n)}function mr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};lr=e.elm,function(t){if(o(t.__r)){var e=Y?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),ie(n,r,hr,vr,fr,e.context),lr=void 0}}var gr,yr={create:mr,update:mr};function Ar(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in o(c.__ob__)&&(c=e.data.domProps=$({},c)),s)n in c||(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=i(r)?"":String(r);_r(a,u)&&(a.value=u)}else if("innerHTML"===n&&Un(a.tagName)&&i(a.innerHTML)){(gr=gr||document.createElement("div")).innerHTML=""+r+" ";for(var l=gr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(r!==s[n])try{a[n]=r}catch(t){}}}}function _r(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var br={create:Ar,update:Ar},wr=_((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Cr(t){var e=xr(t.style);return t.staticStyle?$(t.staticStyle,e):e}function xr(t){return Array.isArray(t)?S(t):"string"==typeof t?wr(t):t}var Tr,kr=/^--/,Er=/\s*!important$/,$r=function(t,e,n){if(kr.test(e))t.style.setProperty(e,n);else if(Er.test(n))t.style.setProperty(T(e),n.replace(Er,""),"important");else{var r=Br(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(Ir).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function jr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ir).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Pr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&$(e,Lr(t.name||"v")),$(e,t),e}return"string"==typeof t?Lr(t):void 0}}var Lr=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Rr=q&&!G,Mr="transition",Fr="animation",Ur="transition",Hr="transitionend",zr="animation",qr="animationend";Rr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ur="WebkitTransition",Hr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(zr="WebkitAnimation",qr="webkitAnimationEnd"));var Wr=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Qr(t){Wr((function(){Wr(t)}))}function Vr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Nr(t,e))}function Yr(t,e){t._transitionClasses&&g(t._transitionClasses,e),jr(t,e)}function Gr(t,e,n){var r=Jr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Mr?Hr:qr,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n=Mr,l=a,d=o.length):e===Fr?u>0&&(n=Fr,l=u,d=c.length):d=(n=(l=Math.max(a,u))>0?a>u?Mr:Fr:null)?n===Mr?o.length:c.length:0,{type:n,timeout:l,propCount:d,hasTransform:n===Mr&&Kr.test(r[Ur+"Property"])}}function Xr(t,e){for(;t.length1}function ii(t,e){!0!==e.data.show&&ti(e)}var oi=function(t){var e,n,r={},c=t.modules,u=t.nodeOps;for(e=0;eh?A(t,i(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&b(e,f,h)}(f,v,g,n,l):o(g)?(o(t.text)&&u.setTextContent(f,""),A(f,null,g,0,g.length-1,n)):o(v)?b(v,0,v.length-1):o(t.text)&&u.setTextContent(f,""):t.text!==e.text&&u.setTextContent(f,e.text),o(h)&&o(p=h.hook)&&o(p=p.postpatch)&&p(t,e)}}}function T(t,e,n){if(a(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==o&&(a.selected=o);else if(I(li(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function ui(t,e){return e.every((function(e){return!I(e,t)}))}function li(t){return"_value"in t?t._value:t.value}function di(t){t.target.composing=!0}function fi(t){t.target.composing&&(t.target.composing=!1,pi(t.target,"input"))}function pi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function hi(t){return!t.componentInstance||t.data&&t.data.transition?t:hi(t.componentInstance._vnode)}var vi={model:ai,show:{bind:function(t,e,n){var r=e.value,i=(n=hi(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,ti(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=hi(n)).data&&n.data.transition?(n.data.show=!0,r?ti(n,(function(){t.style.display=t.__vOriginalDisplay})):ei(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},mi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function gi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?gi(He(e.children)):t}function yi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[w(o)]=i[o];return e}function Ai(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var _i=function(t){return t.tag||Ue(t)},bi=function(t){return"show"===t.name},wi={name:"transition",props:mi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(_i)).length){var r=this.mode,i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=gi(i);if(!o)return i;if(this._leaving)return Ai(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=yi(this),u=this._vnode,l=gi(u);if(o.data.directives&&o.data.directives.some(bi)&&(o.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,l)&&!Ue(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var d=l.data.transition=$({},c);if("out-in"===r)return this._leaving=!0,oe(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ai(t,i);if("in-out"===r){if(Ue(o))return u;var f,p=function(){f()};oe(c,"afterEnter",p),oe(c,"enterCancelled",p),oe(d,"delayLeave",(function(t){f=t}))}}return i}}},Ci=$({tag:String,moveClass:String},mi);function xi(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ti(t){t.data.newPos=t.elm.getBoundingClientRect()}function ki(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Ci.mode;var Ei={Transition:wi,TransitionGroup:{props:Ci,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Ye(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=yi(this),s=0;s-1?zn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:zn[t]=/HTMLUnknownElement/.test(e.toString())},$(_n.options.directives,vi),$(_n.options.components,Ei),_n.prototype.__patch__=q?oi:B,_n.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=vt),Je(t,"beforeMount"),r=function(){t._update(t._render(),n)},new ln(t,r,B,{before:function(){t._isMounted&&!t._isDestroyed&&Je(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Je(t,"mounted")),t}(this,t=t&&q?function(t){return"string"==typeof t?document.querySelector(t)||document.createElement("div"):t}(t):void 0,e)},q&&setTimeout((function(){M.devtools&&rt&&rt.emit("init",_n)}),0),t.exports=_n}).call(this,n(3),n(42).setImmediate)},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(43),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,c=1,u={},l=!1,d=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){h(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){o.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(t){var e=d.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(2);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(2),i=n(63),o=n(15),a=n(9),s=n(64),c=n(65);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.baseURL&&!s(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return u(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(16);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){window._=n(69);try{window.$=window.jQuery=n(71),n(72)}catch(t){}window.axios=n(10),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var r=document.head.querySelector('meta[name="csrf-token"]');r?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=r.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token")},function(t,e,n){(function(t,r){var i;(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",u="[object Array]",l="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object GeneratorFunction]",v="[object Map]",m="[object Number]",g="[object Object]",y="[object RegExp]",A="[object Set]",_="[object String]",b="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",x="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",$="[object Int16Array]",S="[object Int32Array]",B="[object Uint8Array]",D="[object Uint16Array]",O="[object Uint32Array]",I=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,R=RegExp(P.source),M=RegExp(L.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,V=RegExp(Q.source),Y=/^\s+|\s+$/g,G=/^\s+/,K=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,ct=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,dt=/['\n\r\u2028\u2029\\]/g,ft="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ht="[\\ud800-\\udfff]",vt="["+pt+"]",mt="["+ft+"]",gt="\\d+",yt="[\\u2700-\\u27bf]",At="[a-z\\xdf-\\xf6\\xf8-\\xff]",_t="[^\\ud800-\\udfff"+pt+gt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",bt="\\ud83c[\\udffb-\\udfff]",wt="[^\\ud800-\\udfff]",Ct="(?:\\ud83c[\\udde6-\\uddff]){2}",xt="[\\ud800-\\udbff][\\udc00-\\udfff]",Tt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",kt="(?:"+At+"|"+_t+")",Et="(?:"+Tt+"|"+_t+")",$t="(?:"+mt+"|"+bt+")"+"?",St="[\\ufe0e\\ufe0f]?"+$t+("(?:\\u200d(?:"+[wt,Ct,xt].join("|")+")[\\ufe0e\\ufe0f]?"+$t+")*"),Bt="(?:"+[yt,Ct,xt].join("|")+")"+St,Dt="(?:"+[wt+mt+"?",mt,Ct,xt,ht].join("|")+")",Ot=RegExp("['’]","g"),It=RegExp(mt,"g"),Nt=RegExp(bt+"(?="+bt+")|"+Dt+St,"g"),jt=RegExp([Tt+"?"+At+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[vt,Tt,"$"].join("|")+")",Et+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[vt,Tt+kt,"$"].join("|")+")",Tt+"?"+kt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Tt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gt,Bt].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+ft+"\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mt=-1,Ft={};Ft[T]=Ft[k]=Ft[E]=Ft[$]=Ft[S]=Ft[B]=Ft["[object Uint8ClampedArray]"]=Ft[D]=Ft[O]=!0,Ft[c]=Ft[u]=Ft[C]=Ft[l]=Ft[x]=Ft[d]=Ft[f]=Ft[p]=Ft[v]=Ft[m]=Ft[g]=Ft[y]=Ft[A]=Ft[_]=Ft[w]=!1;var Ut={};Ut[c]=Ut[u]=Ut[C]=Ut[x]=Ut[l]=Ut[d]=Ut[T]=Ut[k]=Ut[E]=Ut[$]=Ut[S]=Ut[v]=Ut[m]=Ut[g]=Ut[y]=Ut[A]=Ut[_]=Ut[b]=Ut[B]=Ut["[object Uint8ClampedArray]"]=Ut[D]=Ut[O]=!0,Ut[f]=Ut[p]=Ut[w]=!1;var Ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=parseFloat,qt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Qt="object"==typeof self&&self&&self.Object===Object&&self,Vt=Wt||Qt||Function("return this")(),Yt=e&&!e.nodeType&&e,Gt=Yt&&"object"==typeof r&&r&&!r.nodeType&&r,Kt=Gt&&Gt.exports===Yt,Jt=Kt&&Wt.process,Xt=function(){try{var t=Gt&&Gt.require&&Gt.require("util").types;return t||Jt&&Jt.binding&&Jt.binding("util")}catch(t){}}(),Zt=Xt&&Xt.isArrayBuffer,te=Xt&&Xt.isDate,ee=Xt&&Xt.isMap,ne=Xt&&Xt.isRegExp,re=Xt&&Xt.isSet,ie=Xt&&Xt.isTypedArray;function oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ae(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function Ne(t,e){for(var n=t.length;n--&&be(e,t[n],0)>-1;);return n}function je(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Pe=ke({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Le=ke({"&":"&","<":"<",">":">",'"':""","'":"'"});function Re(t){return"\\"+Ht[t]}function Me(t){return Pt.test(t)}function Fe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ue(t,e){return function(n){return t(e(n))}}function He(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Ye=function t(e){var n,r=(e=null==e?Vt:Ye.defaults(Vt.Object(),e,Ye.pick(Vt,Rt))).Array,i=e.Date,ft=e.Error,pt=e.Function,ht=e.Math,vt=e.Object,mt=e.RegExp,gt=e.String,yt=e.TypeError,At=r.prototype,_t=pt.prototype,bt=vt.prototype,wt=e["__core-js_shared__"],Ct=_t.toString,xt=bt.hasOwnProperty,Tt=0,kt=(n=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Et=bt.toString,$t=Ct.call(vt),St=Vt._,Bt=mt("^"+Ct.call(xt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dt=Kt?e.Buffer:void 0,Nt=e.Symbol,Pt=e.Uint8Array,Ht=Dt?Dt.allocUnsafe:void 0,Wt=Ue(vt.getPrototypeOf,vt),Qt=vt.create,Yt=bt.propertyIsEnumerable,Gt=At.splice,Jt=Nt?Nt.isConcatSpreadable:void 0,Xt=Nt?Nt.iterator:void 0,ye=Nt?Nt.toStringTag:void 0,ke=function(){try{var t=Zi(vt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ge=e.clearTimeout!==Vt.clearTimeout&&e.clearTimeout,Ke=i&&i.now!==Vt.Date.now&&i.now,Je=e.setTimeout!==Vt.setTimeout&&e.setTimeout,Xe=ht.ceil,Ze=ht.floor,tn=vt.getOwnPropertySymbols,en=Dt?Dt.isBuffer:void 0,nn=e.isFinite,rn=At.join,on=Ue(vt.keys,vt),an=ht.max,sn=ht.min,cn=i.now,un=e.parseInt,ln=ht.random,dn=At.reverse,fn=Zi(e,"DataView"),pn=Zi(e,"Map"),hn=Zi(e,"Promise"),vn=Zi(e,"Set"),mn=Zi(e,"WeakMap"),gn=Zi(vt,"create"),yn=mn&&new mn,An={},_n=Eo(fn),bn=Eo(pn),wn=Eo(hn),Cn=Eo(vn),xn=Eo(mn),Tn=Nt?Nt.prototype:void 0,kn=Tn?Tn.valueOf:void 0,En=Tn?Tn.toString:void 0;function $n(t){if(qa(t)&&!Ia(t)&&!(t instanceof On)){if(t instanceof Dn)return t;if(xt.call(t,"__wrapped__"))return $o(t)}return new Dn(t)}var Sn=function(){function t(){}return function(e){if(!za(e))return{};if(Qt)return Qt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Bn(){}function Dn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function On(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Kn(t,e,n,r,i,o){var a,s=1&e,u=2&e,f=4&e;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!za(t))return t;var w=Ia(t);if(w){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&xt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return gi(t,a)}else{var I=no(t),N=I==p||I==h;if(La(t))return di(t,s);if(I==g||I==c||N&&!i){if(a=u||N?{}:io(t),!s)return u?function(t,e){return yi(t,eo(t),e)}(t,function(t,e){return t&&yi(e,bs(e),t)}(a,t)):function(t,e){return yi(t,to(t),e)}(t,Qn(a,t))}else{if(!Ut[I])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case C:return fi(t);case l:case d:return new r(+t);case x:return function(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case k:case E:case $:case S:case B:case"[object Uint8ClampedArray]":case D:case O:return pi(t,n);case v:return new r;case m:case _:return new r(t);case y:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new r;case b:return i=t,kn?vt(kn.call(i)):{}}var i}(t,I,s)}}o||(o=new Ln);var j=o.get(t);if(j)return j;o.set(t,a),Ga(t)?t.forEach((function(r){a.add(Kn(r,e,n,r,t,o))})):Wa(t)&&t.forEach((function(r,i){a.set(i,Kn(r,e,n,i,t,o))}));var P=w?void 0:(f?u?Qi:Wi:u?bs:_s)(t);return se(P||t,(function(r,i){P&&(r=t[i=r]),zn(a,i,Kn(r,e,n,i,t,o))})),a}function Jn(t,e,n){var r=n.length;if(null==t)return!r;for(t=vt(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Xn(t,e,n){if("function"!=typeof t)throw new yt(o);return _o((function(){t.apply(void 0,n)}),e)}function Zn(t,e,n,r){var i=-1,o=de,a=!0,s=t.length,c=[],u=e.length;if(!s)return c;n&&(e=pe(e,Be(n))),r?(o=fe,a=!1):e.length>=200&&(o=Oe,a=!1,e=new Pn(e));t:for(;++i-1},Nn.prototype.set=function(t,e){var n=this.__data__,r=qn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new In,map:new(pn||Nn),string:new In}},jn.prototype.delete=function(t){var e=Ji(this,t).delete(t);return this.size-=e?1:0,e},jn.prototype.get=function(t){return Ji(this,t).get(t)},jn.prototype.has=function(t){return Ji(this,t).has(t)},jn.prototype.set=function(t,e){var n=Ji(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Pn.prototype.add=Pn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.clear=function(){this.__data__=new Nn,this.size=0},Ln.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ln.prototype.get=function(t){return this.__data__.get(t)},Ln.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!pn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(t,e),this.size=n.size,this};var tr=bi(cr),er=bi(ur,!0);function nr(t,e){var n=!0;return tr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function rr(t,e,n){for(var r=-1,i=t.length;++r0&&n(s)?e>1?or(s,e-1,n,r,i):he(i,s):r||(i[i.length]=s)}return i}var ar=wi(),sr=wi(!0);function cr(t,e){return t&&ar(t,e,_s)}function ur(t,e){return t&&sr(t,e,_s)}function lr(t,e){return le(e,(function(e){return Fa(t[e])}))}function dr(t,e){for(var n=0,r=(e=si(e,t)).length;null!=t&&ne}function vr(t,e){return null!=t&&xt.call(t,e)}function mr(t,e){return null!=t&&e in vt(t)}function gr(t,e,n){for(var i=n?fe:de,o=t[0].length,a=t.length,s=a,c=r(a),u=1/0,l=[];s--;){var d=t[s];s&&e&&(d=pe(d,Be(e))),u=sn(d.length,u),c[s]=!n&&(e||o>=120&&d.length>=120)?new Pn(s&&d):void 0}d=t[0];var f=-1,p=c[0];t:for(;++f=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)}))}function Ir(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&Gt.call(s,c,1),Gt.call(t,c,1);return t}function jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;ao(i)?Gt.call(t,i,1):Zr(t,i)}}return t}function Pr(t,e){return t+Ze(ln()*(e-t+1))}function Lr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=Ze(e/2))&&(t+=t)}while(e);return n}function Rr(t,e){return bo(vo(t,e,Qs),t+"")}function Mr(t){return Mn(Ss(t))}function Fr(t,e){var n=Ss(t);return xo(n,Gn(e,0,n.length))}function Ur(t,e,n,r){if(!za(t))return t;for(var i=-1,o=(e=si(e,t)).length,a=o-1,s=t;null!=s&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!Ja(a)&&(n?a<=e:a=200){var u=e?null:Li(t);if(u)return ze(u);a=!1,i=Oe,c=new Pn}else c=e?[]:s;t:for(;++r=r?t:Wr(t,e,n)}var li=Ge||function(t){return Vt.clearTimeout(t)};function di(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function fi(t){var e=new t.constructor(t.byteLength);return new Pt(e).set(new Pt(t)),e}function pi(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function hi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Ja(t),a=void 0!==e,s=null===e,c=e==e,u=Ja(e);if(!s&&!u&&!o&&t>e||o&&a&&c&&!s&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&t1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&so(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=vt(e);++r-1?i[o?e[a]:a]:void 0}}function Ei(t){return qi((function(e){var n=e.length,r=n,i=Dn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new yt(o);if(i&&!s&&"wrapper"==Yi(a))var s=new Dn([],!0)}for(r=s?r:n;++r1&&A.reverse(),d&&us))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var l=-1,d=!0,f=2&n?new Pn:void 0;for(o.set(t,e),o.set(e,t);++l-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(J,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return se(s,(function(n){var r="_."+n[0];e&n[1]&&!de(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(X);return e?e[1].split(Z):[]}(r),n)))}function Co(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function xo(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Yo(t,n)}));function ea(t){var e=$n(t);return e.__chain__=!0,e}function na(t,e){return e(t)}var ra=qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Yn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof On&&ao(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new Dn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var ia=Ai((function(t,e,n){xt.call(t,n)?++t[n]:Vn(t,n,1)}));var oa=ki(Oo),aa=ki(Io);function sa(t,e){return(Ia(t)?se:tr)(t,Ki(e,3))}function ca(t,e){return(Ia(t)?ce:er)(t,Ki(e,3))}var ua=Ai((function(t,e,n){xt.call(t,n)?t[n].push(e):Vn(t,n,[e])}));var la=Rr((function(t,e,n){var i=-1,o="function"==typeof e,a=ja(t)?r(t.length):[];return tr(t,(function(t){a[++i]=o?oe(e,t,n):yr(t,e,n)})),a})),da=Ai((function(t,e,n){Vn(t,n,e)}));function fa(t,e){return(Ia(t)?pe:Er)(t,Ki(e,3))}var pa=Ai((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var ha=Rr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&so(t,e[0],e[1])?e=[]:n>2&&so(e[0],e[1],e[2])&&(e=[e[0]]),Or(t,or(e,1),[])})),va=Ke||function(){return Vt.Date.now()};function ma(t,e,n){return e=n?void 0:e,Mi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ga(t,e){var n;if("function"!=typeof e)throw new yt(o);return t=rs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ya=Rr((function(t,e,n){var r=1;if(n.length){var i=He(n,Gi(ya));r|=32}return Mi(t,r,e,n,i)})),Aa=Rr((function(t,e,n){var r=3;if(n.length){var i=He(n,Gi(Aa));r|=32}return Mi(e,r,t,n,i)}));function _a(t,e,n){var r,i,a,s,c,u,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new yt(o);function h(e){var n=r,o=i;return r=i=void 0,l=e,s=t.apply(o,n)}function v(t){return l=t,c=_o(g,e),d?h(t):s}function m(t){var n=t-u;return void 0===u||n>=e||n<0||f&&t-l>=a}function g(){var t=va();if(m(t))return y(t);c=_o(g,function(t){var n=e-(t-u);return f?sn(n,a-(t-l)):n}(t))}function y(t){return c=void 0,p&&r?h(t):(r=i=void 0,s)}function A(){var t=va(),n=m(t);if(r=arguments,i=this,u=t,n){if(void 0===c)return v(u);if(f)return li(c),c=_o(g,e),h(u)}return void 0===c&&(c=_o(g,e)),s}return e=os(e)||0,za(n)&&(d=!!n.leading,a=(f="maxWait"in n)?an(os(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==c&&li(c),l=0,r=u=i=c=void 0},A.flush=function(){return void 0===c?s:y(va())},A}var ba=Rr((function(t,e){return Xn(t,1,e)})),wa=Rr((function(t,e,n){return Xn(t,os(e)||0,n)}));function Ca(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new yt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ca.Cache||jn),n}function xa(t){if("function"!=typeof t)throw new yt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ca.Cache=jn;var Ta=ci((function(t,e){var n=(e=1==e.length&&Ia(e[0])?pe(e[0],Be(Ki())):pe(or(e,1),Be(Ki()))).length;return Rr((function(r){for(var i=-1,o=sn(r.length,n);++i=e})),Oa=Ar(function(){return arguments}())?Ar:function(t){return qa(t)&&xt.call(t,"callee")&&!Yt.call(t,"callee")},Ia=r.isArray,Na=Zt?Be(Zt):function(t){return qa(t)&&pr(t)==C};function ja(t){return null!=t&&Ha(t.length)&&!Fa(t)}function Pa(t){return qa(t)&&ja(t)}var La=en||oc,Ra=te?Be(te):function(t){return qa(t)&&pr(t)==d};function Ma(t){if(!qa(t))return!1;var e=pr(t);return e==f||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Va(t)}function Fa(t){if(!za(t))return!1;var e=pr(t);return e==p||e==h||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ua(t){return"number"==typeof t&&t==rs(t)}function Ha(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function za(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qa(t){return null!=t&&"object"==typeof t}var Wa=ee?Be(ee):function(t){return qa(t)&&no(t)==v};function Qa(t){return"number"==typeof t||qa(t)&&pr(t)==m}function Va(t){if(!qa(t)||pr(t)!=g)return!1;var e=Wt(t);if(null===e)return!0;var n=xt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ct.call(n)==$t}var Ya=ne?Be(ne):function(t){return qa(t)&&pr(t)==y};var Ga=re?Be(re):function(t){return qa(t)&&no(t)==A};function Ka(t){return"string"==typeof t||!Ia(t)&&qa(t)&&pr(t)==_}function Ja(t){return"symbol"==typeof t||qa(t)&&pr(t)==b}var Xa=ie?Be(ie):function(t){return qa(t)&&Ha(t.length)&&!!Ft[pr(t)]};var Za=Ni(kr),ts=Ni((function(t,e){return t<=e}));function es(t){if(!t)return[];if(ja(t))return Ka(t)?Qe(t):gi(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=no(t);return(e==v?Fe:e==A?ze:Ss)(t)}function ns(t){return t?(t=os(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function rs(t){var e=ns(t),n=e%1;return e==e?n?e-n:e:0}function is(t){return t?Gn(rs(t),0,4294967295):0}function os(t){if("number"==typeof t)return t;if(Ja(t))return NaN;if(za(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=za(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Y,"");var n=ot.test(t);return n||st.test(t)?qt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function as(t){return yi(t,bs(t))}function ss(t){return null==t?"":Jr(t)}var cs=_i((function(t,e){if(fo(e)||ja(e))yi(e,_s(e),t);else for(var n in e)xt.call(e,n)&&zn(t,n,e[n])})),us=_i((function(t,e){yi(e,bs(e),t)})),ls=_i((function(t,e,n,r){yi(e,bs(e),t,r)})),ds=_i((function(t,e,n,r){yi(e,_s(e),t,r)})),fs=qi(Yn);var ps=Rr((function(t,e){t=vt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&so(e[0],e[1],i)&&(r=1);++n1),e})),yi(t,Qi(t),n),r&&(n=Kn(n,7,Hi));for(var i=e.length;i--;)Zr(n,e[i]);return n}));var Ts=qi((function(t,e){return null==t?{}:function(t,e){return Ir(t,e,(function(e,n){return ms(t,n)}))}(t,e)}));function ks(t,e){if(null==t)return{};var n=pe(Qi(t),(function(t){return[t]}));return e=Ki(e),Ir(t,n,(function(t,n){return e(t,n[0])}))}var Es=Ri(_s),$s=Ri(bs);function Ss(t){return null==t?[]:De(t,_s(t))}var Bs=xi((function(t,e,n){return e=e.toLowerCase(),t+(n?Ds(e):e)}));function Ds(t){return Ms(ss(t).toLowerCase())}function Os(t){return(t=ss(t))&&t.replace(ut,Pe).replace(It,"")}var Is=xi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ns=xi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),js=Ci("toLowerCase");var Ps=xi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ls=xi((function(t,e,n){return t+(n?" ":"")+Ms(e)}));var Rs=xi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ms=Ci("toUpperCase");function Fs(t,e,n){return t=ss(t),void 0===(e=n?void 0:e)?function(t){return Lt.test(t)}(t)?function(t){return t.match(jt)||[]}(t):function(t){return t.match(tt)||[]}(t):t.match(e)||[]}var Us=Rr((function(t,e){try{return oe(t,void 0,e)}catch(t){return Ma(t)?t:new ft(t)}})),Hs=qi((function(t,e){return se(e,(function(e){e=ko(e),Vn(t,e,ya(t[e],t))})),t}));function zs(t){return function(){return t}}var qs=Ei(),Ws=Ei(!0);function Qs(t){return t}function Vs(t){return Cr("function"==typeof t?t:Kn(t,1))}var Ys=Rr((function(t,e){return function(n){return yr(n,t,e)}})),Gs=Rr((function(t,e){return function(n){return yr(t,n,e)}}));function Ks(t,e,n){var r=_s(e),i=lr(e,r);null!=n||za(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=lr(e,_s(e)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Fa(t);return se(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,he([this.value()],arguments))})})),t}function Js(){}var Xs=Di(pe),Zs=Di(ue),tc=Di(ge);function ec(t){return co(t)?Te(ko(t)):function(t){return function(e){return dr(e,t)}}(t)}var nc=Ii(),rc=Ii(!0);function ic(){return[]}function oc(){return!1}var ac=Bi((function(t,e){return t+e}),0),sc=Pi("ceil"),cc=Bi((function(t,e){return t/e}),1),uc=Pi("floor");var lc,dc=Bi((function(t,e){return t*e}),1),fc=Pi("round"),pc=Bi((function(t,e){return t-e}),0);return $n.after=function(t,e){if("function"!=typeof e)throw new yt(o);return t=rs(t),function(){if(--t<1)return e.apply(this,arguments)}},$n.ary=ma,$n.assign=cs,$n.assignIn=us,$n.assignInWith=ls,$n.assignWith=ds,$n.at=fs,$n.before=ga,$n.bind=ya,$n.bindAll=Hs,$n.bindKey=Aa,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ia(t)?t:[t]},$n.chain=ea,$n.chunk=function(t,e,n){e=(n?so(t,e,n):void 0===e)?1:an(rs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=r(Xe(i/e));oi?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(t=ss(t))&&("string"==typeof e||null!=e&&!Ya(e))&&!(e=Jr(e))&&Me(t)?ui(Qe(t),0,n):t.split(e,n):[]},$n.spread=function(t,e){if("function"!=typeof t)throw new yt(o);return e=null==e?0:an(rs(e),0),Rr((function(n){var r=n[e],i=ui(n,0,e);return r&&he(i,r),oe(t,this,i)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?Wr(t,1,e):[]},$n.take=function(t,e,n){return t&&t.length?Wr(t,0,(e=n||void 0===e?1:rs(e))<0?0:e):[]},$n.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Wr(t,(e=r-(e=n||void 0===e?1:rs(e)))<0?0:e,r):[]},$n.takeRightWhile=function(t,e){return t&&t.length?ei(t,Ki(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?ei(t,Ki(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new yt(o);return za(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),_a(t,e,{leading:r,maxWait:e,trailing:i})},$n.thru=na,$n.toArray=es,$n.toPairs=Es,$n.toPairsIn=$s,$n.toPath=function(t){return Ia(t)?pe(t,ko):Ja(t)?[t]:gi(To(ss(t)))},$n.toPlainObject=as,$n.transform=function(t,e,n){var r=Ia(t),i=r||La(t)||Xa(t);if(e=Ki(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:za(t)&&Fa(o)?Sn(Wt(t)):{}}return(i?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},$n.unary=function(t){return ma(t,1)},$n.union=qo,$n.unionBy=Wo,$n.unionWith=Qo,$n.uniq=function(t){return t&&t.length?Xr(t):[]},$n.uniqBy=function(t,e){return t&&t.length?Xr(t,Ki(e,2)):[]},$n.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Xr(t,void 0,e):[]},$n.unset=function(t,e){return null==t||Zr(t,e)},$n.unzip=Vo,$n.unzipWith=Yo,$n.update=function(t,e,n){return null==t?t:ti(t,e,ai(n))},$n.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ti(t,e,ai(n),r)},$n.values=Ss,$n.valuesIn=function(t){return null==t?[]:De(t,bs(t))},$n.without=Go,$n.words=Fs,$n.wrap=function(t,e){return ka(ai(e),t)},$n.xor=Ko,$n.xorBy=Jo,$n.xorWith=Xo,$n.zip=Zo,$n.zipObject=function(t,e){return ii(t||[],e||[],zn)},$n.zipObjectDeep=function(t,e){return ii(t||[],e||[],Ur)},$n.zipWith=ta,$n.entries=Es,$n.entriesIn=$s,$n.extend=us,$n.extendWith=ls,Ks($n,$n),$n.add=ac,$n.attempt=Us,$n.camelCase=Bs,$n.capitalize=Ds,$n.ceil=sc,$n.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==e&&(e=(e=os(e))==e?e:0),Gn(os(t),e,n)},$n.clone=function(t){return Kn(t,4)},$n.cloneDeep=function(t){return Kn(t,5)},$n.cloneDeepWith=function(t,e){return Kn(t,5,e="function"==typeof e?e:void 0)},$n.cloneWith=function(t,e){return Kn(t,4,e="function"==typeof e?e:void 0)},$n.conformsTo=function(t,e){return null==e||Jn(t,e,_s(e))},$n.deburr=Os,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=cc,$n.endsWith=function(t,e,n){t=ss(t),e=Jr(e);var r=t.length,i=n=void 0===n?r:Gn(rs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},$n.eq=Sa,$n.escape=function(t){return(t=ss(t))&&M.test(t)?t.replace(L,Le):t},$n.escapeRegExp=function(t){return(t=ss(t))&&V.test(t)?t.replace(Q,"\\$&"):t},$n.every=function(t,e,n){var r=Ia(t)?ue:nr;return n&&so(t,e,n)&&(e=void 0),r(t,Ki(e,3))},$n.find=oa,$n.findIndex=Oo,$n.findKey=function(t,e){return Ae(t,Ki(e,3),cr)},$n.findLast=aa,$n.findLastIndex=Io,$n.findLastKey=function(t,e){return Ae(t,Ki(e,3),ur)},$n.floor=uc,$n.forEach=sa,$n.forEachRight=ca,$n.forIn=function(t,e){return null==t?t:ar(t,Ki(e,3),bs)},$n.forInRight=function(t,e){return null==t?t:sr(t,Ki(e,3),bs)},$n.forOwn=function(t,e){return t&&cr(t,Ki(e,3))},$n.forOwnRight=function(t,e){return t&&ur(t,Ki(e,3))},$n.get=vs,$n.gt=Ba,$n.gte=Da,$n.has=function(t,e){return null!=t&&ro(t,e,vr)},$n.hasIn=ms,$n.head=jo,$n.identity=Qs,$n.includes=function(t,e,n,r){t=ja(t)?t:Ss(t),n=n&&!r?rs(n):0;var i=t.length;return n<0&&(n=an(i+n,0)),Ka(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&be(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=an(r+i,0)),be(t,e,i)},$n.inRange=function(t,e,n){return e=ns(e),void 0===n?(n=e,e=0):n=ns(n),function(t,e,n){return t>=sn(e,n)&&t=-9007199254740991&&t<=9007199254740991},$n.isSet=Ga,$n.isString=Ka,$n.isSymbol=Ja,$n.isTypedArray=Xa,$n.isUndefined=function(t){return void 0===t},$n.isWeakMap=function(t){return qa(t)&&no(t)==w},$n.isWeakSet=function(t){return qa(t)&&"[object WeakSet]"==pr(t)},$n.join=function(t,e){return null==t?"":rn.call(t,e)},$n.kebabCase=Is,$n.last=Mo,$n.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?an(r+i,0):sn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):_e(t,Ce,i,!0)},$n.lowerCase=Ns,$n.lowerFirst=js,$n.lt=Za,$n.lte=ts,$n.max=function(t){return t&&t.length?rr(t,Qs,hr):void 0},$n.maxBy=function(t,e){return t&&t.length?rr(t,Ki(e,2),hr):void 0},$n.mean=function(t){return xe(t,Qs)},$n.meanBy=function(t,e){return xe(t,Ki(e,2))},$n.min=function(t){return t&&t.length?rr(t,Qs,kr):void 0},$n.minBy=function(t,e){return t&&t.length?rr(t,Ki(e,2),kr):void 0},$n.stubArray=ic,$n.stubFalse=oc,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=dc,$n.nth=function(t,e){return t&&t.length?Dr(t,rs(e)):void 0},$n.noConflict=function(){return Vt._===this&&(Vt._=St),this},$n.noop=Js,$n.now=va,$n.pad=function(t,e,n){t=ss(t);var r=(e=rs(e))?We(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Oi(Ze(i),n)+t+Oi(Xe(i),n)},$n.padEnd=function(t,e,n){t=ss(t);var r=(e=rs(e))?We(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=ln();return sn(t+i*(e-t+zt("1e-"+((i+"").length-1))),e)}return Pr(t,e)},$n.reduce=function(t,e,n){var r=Ia(t)?ve:Ee,i=arguments.length<3;return r(t,Ki(e,4),n,i,tr)},$n.reduceRight=function(t,e,n){var r=Ia(t)?me:Ee,i=arguments.length<3;return r(t,Ki(e,4),n,i,er)},$n.repeat=function(t,e,n){return e=(n?so(t,e,n):void 0===e)?1:rs(e),Lr(ss(t),e)},$n.replace=function(){var t=arguments,e=ss(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(t,e,n){var r=-1,i=(e=si(e,t)).length;for(i||(i=1,t=void 0);++r9007199254740991)return[];var n=4294967295,r=sn(t,4294967295);t-=4294967295;for(var i=Se(r,e=Ki(e));++n=o)return t;var s=n-We(r);if(s<1)return r;var c=a?ui(a,0,s).join(""):t.slice(0,s);if(void 0===i)return c+r;if(a&&(s+=c.length-s),Ya(i)){if(t.slice(s).search(i)){var u,l=c;for(i.global||(i=mt(i.source,ss(rt.exec(i))+"g")),i.lastIndex=0;u=i.exec(l);)var d=u.index;c=c.slice(0,void 0===d?s:d)}}else if(t.indexOf(Jr(i),s)!=s){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},$n.unescape=function(t){return(t=ss(t))&&R.test(t)?t.replace(P,Ve):t},$n.uniqueId=function(t){var e=++Tt;return ss(t)+e},$n.upperCase=Rs,$n.upperFirst=Ms,$n.each=sa,$n.eachRight=ca,$n.first=jo,Ks($n,(lc={},cr($n,(function(t,e){xt.call($n.prototype,e)||(lc[e]=t)})),lc),{chain:!1}),$n.VERSION="4.17.15",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),se(["drop","take"],(function(t,e){On.prototype[t]=function(n){n=void 0===n?1:an(rs(n),0);var r=this.__filtered__&&!e?new On(this):this.clone();return r.__filtered__?r.__takeCount__=sn(n,r.__takeCount__):r.__views__.push({size:sn(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},On.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;On.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ki(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");On.prototype[t]=function(){return this[n](1).value()[0]}})),se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");On.prototype[t]=function(){return this.__filtered__?new On(this):this[n](1)}})),On.prototype.compact=function(){return this.filter(Qs)},On.prototype.find=function(t){return this.filter(t).head()},On.prototype.findLast=function(t){return this.reverse().find(t)},On.prototype.invokeMap=Rr((function(t,e){return"function"==typeof t?new On(this):this.map((function(n){return yr(n,t,e)}))})),On.prototype.reject=function(t){return this.filter(xa(Ki(t)))},On.prototype.slice=function(t,e){t=rs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new On(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=rs(e))<0?n.dropRight(-e):n.take(e-t)),n)},On.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},cr(On.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=$n[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&($n.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof On,c=a[0],u=s||Ia(e),l=function(t){var e=i.apply($n,he([t],a));return r&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(s=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=o&&!d,h=s&&!f;if(!o&&u){e=h?e:new On(this);var v=t.apply(e,a);return v.__actions__.push({func:na,args:[l],thisArg:void 0}),new Dn(v,d)}return p&&h?t.apply(this,a):(v=this.thru(l),p?r?v.value()[0]:v.value():v)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=At[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ia(i)?i:[],t)}return this[n]((function(n){return e.apply(Ia(n)?n:[],t)}))}})),cr(On.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";xt.call(An,r)||(An[r]=[]),An[r].push({name:e,func:n})}})),An[$i(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var t=new On(this.__wrapped__);return t.__actions__=gi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=gi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=gi(this.__views__),t},On.prototype.reverse=function(){if(this.__filtered__){var t=new On(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},On.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ia(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$n.prototype.plant=function(t){for(var e,n=this;n instanceof Bn;){var r=$o(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},$n.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof On){var e=t;return this.__actions__.length&&(e=new On(this)),(e=e.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new Dn(e,this.__chain__)}return this.thru(zo)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Xt&&($n.prototype[Xt]=function(){return this}),$n}();Vt._=Ye,void 0===(i=function(){return Ye}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(3),n(70)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,c=o.slice,u=o.concat,l=o.push,d=o.indexOf,f={},p=f.toString,h=f.hasOwnProperty,v=h.toString,m=v.call(Object),g={},y=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},A=function(t){return null!=t&&t===t.window},_={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,n){var r,i,o=(n=n||a).createElement("script");if(o.text=t,e)for(r in _)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?f[p.call(t)]||"object":typeof t}var C=function(t,e){return new C.fn.init(t,e)},x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(t){var e=!!t&&"length"in t&&t.length,n=w(t);return!y(t)&&!A(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}C.fn=C.prototype={jquery:"3.4.1",constructor:C,length:0,toArray:function(){return c.call(this)},get:function(t){return null==t?c.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),Q=new RegExp(F),V=new RegExp("^"+R+"$"),Y={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),nt=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){f()},at=_t((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(B=N.call(b.childNodes),b.childNodes),B[b.childNodes.length].nodeType}catch(t){I={apply:B.length?function(t,e){O.apply(t,N.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,u,l,d,h,g,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&((e?e.ownerDocument||e:b)!==p&&f(e),e=e||p,v)){if(11!==w&&(d=Z.exec(t)))if(o=d[1]){if(9===w){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(y&&(u=y.getElementById(o))&&A(e,u)&&u.id===o)return r.push(u),r}else{if(d[2])return I.apply(r,e.getElementsByTagName(t)),r;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!E[t+" "]&&(!m||!m.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===w&&W.test(t)){for((l=e.getAttribute("id"))?l=l.replace(rt,it):e.setAttribute("id",l=_),s=(h=a(t)).length;s--;)h[s]="#"+l+" "+At(h[s]);g=h.join(","),y=tt.test(t)&>(e.parentNode)||e}try{return I.apply(r,y.querySelectorAll(g)),r}catch(e){E(t,!0)}finally{l===_&&e.removeAttribute("id")}}}return c(t.replace(H,"$1"),e,r,i)}function ct(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[_]=!0,t}function lt(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function ft(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function vt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ut((function(e){return e=+e,ut((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!G.test(e||n&&n.nodeName||"HTML")},f=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:b;return a!==p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,v=!o(p),b!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.attributes=lt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=lt((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(p.getElementsByClassName),n.getById=lt((function(t){return h.appendChild(t).id=_,!p.getElementsByName||!p.getElementsByName(_).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},g=[],m=[],(n.qsa=X.test(p.querySelectorAll))&&(lt((function(t){h.appendChild(t).innerHTML=" ",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+L+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+_+"-]").length||m.push("~="),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+_+"+*").length||m.push(".#.+[+~]")})),lt((function(t){t.innerHTML=" ";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=X.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&<((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",F)})),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),e=X.test(h.compareDocumentPosition),A=e||X.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},$=e?function(t,e){if(t===e)return d=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t===p||t.ownerDocument===b&&A(b,t)?-1:e===p||e.ownerDocument===b&&A(b,e)?1:l?j(l,t)-j(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t===p?-1:e===p?1:i?-1:o?1:l?j(l,t)-j(l,e):0;if(i===o)return ft(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ft(a[r],s[r]):a[r]===b?-1:s[r]===b?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if((t.ownerDocument||t)!==p&&f(t),n.matchesSelector&&v&&!E[e+" "]&&(!g||!g.test(e))&&(!m||!m.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){E(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!==p&&f(t),A(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!==p&&f(t);var i=r.attrHandle[e.toLowerCase()],o=i&&S.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(d=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort($),d){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ut,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Q.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=x[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&x(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,c){var u,l,d,f,p,h,v=o!==a?"nextSibling":"previousSibling",m=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!c&&!s,A=!1;if(m){if(o){for(;v;){for(f=e;f=f[v];)if(s?f.nodeName.toLowerCase()===g:1===f.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(A=(p=(u=(l=(d=(f=m)[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],f=p&&m.childNodes[p];f=++p&&f&&f[v]||(A=p=0)||h.pop();)if(1===f.nodeType&&++A&&f===e){l[t]=[w,p,A];break}}else if(y&&(A=p=(u=(l=(d=(f=e)[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===A)for(;(f=++p&&f&&f[v]||(A=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==g:1!==f.nodeType)||!++A||(y&&((l=(d=f[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]=[w,A]),f!==e)););return(A-=i)===r||A%r==0&&A/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[_]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=j(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ut((function(t){var e=[],n=[],r=s(t.replace(H,"$1"));return r[_]?ut((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return st(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ut((function(t){return V.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:vt(!1),disabled:vt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:mt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function wt(t,e,n,r,i){for(var o,a=[],s=0,c=t.length,u=null!=e;s-1&&(o[u]=!(a[u]=d))}}else g=wt(g===a?g.splice(h,g.length):g),i?i(null,a,g,c):I.apply(a,g)}))}function xt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],c=a?1:0,l=_t((function(t){return t===e}),s,!0),d=_t((function(t){return j(e,t)>-1}),s,!0),f=[function(t,n,r){var i=!a&&(r||n!==u)||((e=n).nodeType?l(t,n,r):d(t,n,r));return e=null,i}];c1&&bt(f),c>1&&At(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(H,"$1"),n,c0,i=t.length>0,o=function(o,a,s,c,l){var d,h,m,g=0,y="0",A=o&&[],_=[],b=u,C=o||i&&r.find.TAG("*",l),x=w+=null==b?1:Math.random()||.1,T=C.length;for(l&&(u=a===p||a||l);y!==T&&null!=(d=C[y]);y++){if(i&&d){for(h=0,a||d.ownerDocument===p||(f(d),s=!v);m=t[h++];)if(m(d,a||p,s)){c.push(d);break}l&&(w=x)}n&&((d=!m&&d)&&g--,o&&A.push(d))}if(g+=y,n&&y!==g){for(h=0;m=e[h++];)m(A,_,a,s);if(o){if(g>0)for(;y--;)A[y]||_[y]||(_[y]=D.call(c));_=wt(_)}I.apply(c,_),l&&!o&&_.length>0&&g+e.length>1&&st.uniqueSort(c)}return l&&(w=x,u=b),A};return n?ut(o):o}(o,i))).selector=t}return s},c=st.select=function(t,e,n,i){var o,c,u,l,d,f="function"==typeof t&&t,p=!i&&a(t=f.selector||t);if(n=n||[],1===p.length){if((c=p[0]=p[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&9===e.nodeType&&v&&r.relative[c[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;f&&(e=e.parentNode),t=t.slice(c.shift().value.length)}for(o=Y.needsContext.test(t)?0:c.length;o--&&(u=c[o],!r.relative[l=u.type]);)if((d=r.find[l])&&(i=d(u.matches[0].replace(et,nt),tt.test(c[0].type)&>(e.parentNode)||e))){if(c.splice(o,1),!(t=i.length&&At(c)))return I.apply(n,i),n;break}}return(f||s(t,p))(i,e,!v,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=_.split("").sort($).join("")===_,n.detectDuplicates=!!d,f(),n.sortDetached=lt((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),lt((function(t){return t.innerHTML=" ","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&<((function(t){return t.innerHTML=" ",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),lt((function(t){return null==t.getAttribute("disabled")}))||dt(P,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);C.find=k,C.expr=k.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=k.uniqueSort,C.text=k.getText,C.isXMLDoc=k.isXML,C.contains=k.contains,C.escapeSelector=k.escape;var E=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&C(t).is(n))break;r.push(t)}return r},$=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=C.expr.match.needsContext;function B(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function O(t,e,n){return y(e)?C.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?C.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?C.grep(t,(function(t){return d.call(e,t)>-1!==n})):C.filter(e,t,n)}C.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?C.find.matchesSelector(r,t)?[r]:[]:C.find.matches(t,C.grep(e,(function(t){return 1===t.nodeType})))},C.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(C(t).filter((function(){for(e=0;e1?C.uniqueSort(n):n},filter:function(t){return this.pushStack(O(this,t||[],!1))},not:function(t){return this.pushStack(O(this,t||[],!0))},is:function(t){return!!O(this,"string"==typeof t&&S.test(t)?C(t):t||[],!1).length}});var I,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||I,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),D.test(r[1])&&C.isPlainObject(e))for(r in e)y(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(C):C.makeArray(t,this)}).prototype=C.fn,I=C(a);var j=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}C.fn.extend({has:function(t){var e=C(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&C.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?d.call(C(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E(t,"parentNode")},parentsUntil:function(t,e,n){return E(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return E(t,"nextSibling")},prevAll:function(t){return E(t,"previousSibling")},nextUntil:function(t,e,n){return E(t,"nextSibling",n)},prevUntil:function(t,e,n){return E(t,"previousSibling",n)},siblings:function(t){return $((t.parentNode||{}).firstChild,t)},children:function(t){return $(t.firstChild)},contents:function(t){return void 0!==t.contentDocument?t.contentDocument:(B(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},(function(t,e){C.fn[t]=function(n,r){var i=C.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=C.filter(r,i)),this.length>1&&(P[t]||C.uniqueSort(i),j.test(t)&&i.reverse()),this.pushStack(i)}}));var R=/[^\x20\t\r\n\f]+/g;function M(t){return t}function F(t){throw t}function U(t,e,n,r){var i;try{t&&y(i=t.promise)?i.call(t).done(e).fail(n):t&&y(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}C.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return C.each(t.match(R)||[],(function(t,n){e[n]=!0})),e}(t):C.extend({},t);var e,n,r,i,o=[],a=[],s=-1,c=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?C.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},C.extend({Deferred:function(t){var e=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return C.Deferred((function(n){C.each(e,(function(e,r){var i=y(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,c=arguments,u=function(){var n,u;if(!(t=o&&(r!==F&&(s=void 0,c=[n]),e.rejectWith(s,c))}};t?l():(C.Deferred.getStackHook&&(l.stackTrace=C.Deferred.getStackHook()),n.setTimeout(l))}}return C.Deferred((function(n){e[0][3].add(a(0,n,y(i)?i:M,n.notifyWith)),e[1][3].add(a(0,n,y(t)?t:M)),e[2][3].add(a(0,n,y(r)?r:F))})).promise()},promise:function(t){return null!=t?C.extend(t,i):i}},o={};return C.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=c.call(arguments),o=C.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?c.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(U(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||y(i[n]&&i[n].then)))return o.then();for(;n--;)U(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&H.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},C.readyException=function(t){n.setTimeout((function(){throw t}))};var z=C.Deferred();function q(){a.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),C.ready()}C.fn.ready=function(t){return z.then(t).catch((function(t){C.readyException(t)})),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||z.resolveWith(a,[C]))}}),C.ready.then=z.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(C.ready):(a.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var W=function(t,e,n,r,i,o,a){var s=0,c=t.length,u=null==n;if("object"===w(n))for(s in i=!0,n)W(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,y(r)||(a=!0),u&&(a?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(C(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){Z.remove(this,t)}))}}),C.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=X.get(t,e),n&&(!r||Array.isArray(n)?r=X.access(t,e,C.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=C.queue(t,e),r=n.length,i=n.shift(),o=C._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){C.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return X.get(t,n)||X.access(t,n,{empty:C.Callbacks("once memory").add((function(){X.remove(t,[e+"queue",n])}))})}}),C.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i,yt={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function At(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&B(t,e)?C.merge([t],n):n}function _t(t,e){for(var n=0,r=t.length;n-1)i&&i.push(o);else if(u=st(o),a=At(d.appendChild(o),"script"),u&&_t(a),n)for(l=0;o=a[l++];)gt.test(o.type||"")&&n.push(o);return d}bt=a.createDocumentFragment().appendChild(a.createElement("div")),(wt=a.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),bt.appendChild(wt),g.checkClone=bt.cloneNode(!0).cloneNode(!0).lastChild.checked,bt.innerHTML="",g.noCloneChecked=!!bt.cloneNode(!0).lastChild.defaultValue;var Tt=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Et=/^([^.]*)(?:\.(.+)|)/;function $t(){return!0}function St(){return!1}function Bt(t,e){return t===function(){try{return a.activeElement}catch(t){}}()==("focus"===e)}function Dt(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)Dt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=St;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return C().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=C.guid++)),t.each((function(){C.event.add(this,e,i,r,n)}))}function Ot(t,e,n){n?(X.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=X.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=c.call(arguments),X.set(this,e,o),r=n(this,e),this[e](),o!==(i=X.get(this,e))||r?X.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i.value}else o.length&&(X.set(this,e,{value:C.event.trigger(C.extend(o[0],C.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===X.get(t,e)&&C.event.add(t,e,$t)}C.event={global:{},add:function(t,e,n,r,i){var o,a,s,c,u,l,d,f,p,h,v,m=X.get(t);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&C.find.matchesSelector(at,i),n.guid||(n.guid=C.guid++),(c=m.events)||(c=m.events={}),(a=m.handle)||(a=m.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(R)||[""]).length;u--;)p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=C.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=C.event.special[p]||{},l=C.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&C.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=c[p])||((f=c[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),d.add&&(d.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),C.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,c,u,l,d,f,p,h,v,m=X.hasData(t)&&X.get(t);if(m&&(c=m.events)){for(u=(e=(e||"").match(R)||[""]).length;u--;)if(p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=C.event.special[p]||{},f=c[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)l=f[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,d.remove&&d.remove.call(t,l));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(t,h,m.handle)||C.removeEvent(t,p,m.handle),delete c[p])}else for(p in c)C.event.remove(t,p+e[u],n,r,!0);C.isEmptyObject(c)&&X.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=C.event.fix(t),c=new Array(arguments.length),u=(X.get(this,"events")||{})[s.type]||[],l=C.event.special[s.type]||{};for(c[0]=s,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:C.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,c\x20\t\r\n\f]*)[^>]*)\/>/gi,Nt=/
\ No newline at end of file
+
diff --git a/resources/assets/js/components/transactions/EditTransaction.vue b/resources/assets/js/components/transactions/EditTransaction.vue
index c93341b1e2..6351239a7d 100644
--- a/resources/assets/js/components/transactions/EditTransaction.vue
+++ b/resources/assets/js/components/transactions/EditTransaction.vue
@@ -737,8 +737,8 @@
const uri = './api/v1/attachments';
const data = {
filename: fileData[key].name,
- model: 'TransactionJournal',
- model_id: fileData[key].journal,
+ attachable_type: 'TransactionJournal',
+ attachable_id: fileData[key].journal,
};
axios.post(uri, data)
.then(response => {
@@ -955,4 +955,4 @@
\ No newline at end of file
+
From 2a38c9b4ef440f9d987d256b01540825b4e818f5 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Mon, 10 Feb 2020 19:15:35 +0100
Subject: [PATCH 54/75] Fix a rare null pointer
---
app/Http/Controllers/Json/BoxController.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php
index 85da86b9d0..cc47398438 100644
--- a/app/Http/Controllers/Json/BoxController.php
+++ b/app/Http/Controllers/Json/BoxController.php
@@ -168,10 +168,11 @@ class BoxController extends Controller
/** @var array $journal */
foreach ($set as $journal) {
$currencyId = (int)$journal['currency_id'];
+ $amount = $journal['amount'] ?? '0';
$incomes[$currencyId] = $incomes[$currencyId] ?? '0';
- $incomes[$currencyId] = bcadd($incomes[$currencyId], app('steam')->positive($journal['amount']));
+ $incomes[$currencyId] = bcadd($incomes[$currencyId], app('steam')->positive($amount));
$sums[$currencyId] = $sums[$currencyId] ?? '0';
- $sums[$currencyId] = bcadd($sums[$currencyId], app('steam')->positive($journal['amount']));
+ $sums[$currencyId] = bcadd($sums[$currencyId], app('steam')->positive($amount));
}
// collect expenses
From 8d806e6a1dbb7043b2a023b238079a1ed3f60972 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Tue, 11 Feb 2020 05:34:36 +0100
Subject: [PATCH 55/75] Fix issues related to #3111
---
app/Exceptions/GracefulNotFoundHandler.php | 1 +
app/Services/Internal/Destroy/BudgetDestroyService.php | 3 +++
2 files changed, 4 insertions(+)
diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php
index 0b4b4c4ec0..5b7de43a1c 100644
--- a/app/Exceptions/GracefulNotFoundHandler.php
+++ b/app/Exceptions/GracefulNotFoundHandler.php
@@ -85,6 +85,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
return redirect(route('currencies.index'));
break;
case 'budgets.show':
+ case 'budgets.edit':
$request->session()->reflash();
return redirect(route('budgets.index'));
diff --git a/app/Services/Internal/Destroy/BudgetDestroyService.php b/app/Services/Internal/Destroy/BudgetDestroyService.php
index c3b574c3fb..2cc6377ab4 100644
--- a/app/Services/Internal/Destroy/BudgetDestroyService.php
+++ b/app/Services/Internal/Destroy/BudgetDestroyService.php
@@ -60,5 +60,8 @@ class BudgetDestroyService
// also delete all relations between categories and transactions:
DB::table('budget_transaction')->where('budget_id', (int)$budget->id)->delete();
+
+ // also delete all budget limits
+ $budget->budgetlimits()->delete();
}
}
From 529cb3d38708be981fcc14d9c2574d2e54326231 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Thu, 13 Feb 2020 20:09:27 +0100
Subject: [PATCH 56/75] Fix #3118
---
app/Api/V1/Controllers/CurrencyController.php | 4 ++++
app/Http/Controllers/CurrencyController.php | 8 ++++++++
app/Repositories/Currency/CurrencyRepository.php | 8 ++++++++
app/Repositories/Currency/CurrencyRepositoryInterface.php | 8 ++++++++
4 files changed, 28 insertions(+)
diff --git a/app/Api/V1/Controllers/CurrencyController.php b/app/Api/V1/Controllers/CurrencyController.php
index d85b2abaab..3a41ac79a4 100644
--- a/app/Api/V1/Controllers/CurrencyController.php
+++ b/app/Api/V1/Controllers/CurrencyController.php
@@ -318,6 +318,10 @@ class CurrencyController extends Controller
if ($this->repository->currencyInUse($currency)) {
throw new FireflyException('200006: Currency in use.'); // @codeCoverageIgnore
}
+ if ($this->repository->isFallbackCurrency($currency)) {
+ throw new FireflyException('200026: Currency is fallback.'); // @codeCoverageIgnore
+ }
+
$this->repository->destroy($currency);
return response()->json([], 204);
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index 163cbc051e..5f909449a0 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -183,6 +183,14 @@ class CurrencyController extends Controller
return redirect(route('currencies.index'));
}
+
+ if ($this->repository->isFallbackCurrency($currency)) {
+ $request->session()->flash('error', (string)trans('firefly.cannot_delete_fallback_currency', ['name' => e($currency->name)]));
+ Log::channel('audit')->info(sprintf('Tried to delete currency %s but is FALLBACK.', $currency->code));
+
+ return redirect(route('currencies.index'));
+ }
+
Log::channel('audit')->info(sprintf('Deleted currency %s.', $currency->code));
$this->repository->destroy($currency);
diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php
index 44d621a6bf..1cdd92e448 100644
--- a/app/Repositories/Currency/CurrencyRepository.php
+++ b/app/Repositories/Currency/CurrencyRepository.php
@@ -537,4 +537,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface
return $service->update($currency, $data);
}
+
+ /**
+ * @inheritDoc
+ */
+ public function isFallbackCurrency(TransactionCurrency $currency): bool
+ {
+ return $currency->code === config('firefly.default_currency', 'EUR');
+ }
}
diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php
index f1727f7380..603be5d4f8 100644
--- a/app/Repositories/Currency/CurrencyRepositoryInterface.php
+++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php
@@ -35,6 +35,14 @@ use Illuminate\Support\Collection;
*/
interface CurrencyRepositoryInterface
{
+
+ /**
+ * @param TransactionCurrency $currency
+ *
+ * @return bool
+ */
+ public function isFallbackCurrency(TransactionCurrency $currency): bool;
+
/**
* @param TransactionCurrency $currency
*
From fd04a38359167cc53db92c12ca9303171b5a7192 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Thu, 13 Feb 2020 20:09:59 +0100
Subject: [PATCH 57/75] Fix some button issues.
---
public/v1/js/app.js | 2 +-
public/v1/js/create_transaction.js | 2 +-
public/v1/js/edit_transaction.js | 2 +-
public/v1/js/profile.js | 2 +-
.../transactions/CreateTransaction.vue | 20 +-
.../transactions/EditTransaction.vue | 4 +-
yarn.lock | 470 +++++++++++++-----
7 files changed, 351 insertions(+), 151 deletions(-)
diff --git a/public/v1/js/app.js b/public/v1/js/app.js
index 616844ff43..8ef021e4ad 100644
--- a/public/v1/js/app.js
+++ b/public/v1/js/app.js
@@ -1 +1 @@
-!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=91)}([function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(41)},function(t,e,n){"use strict";var r=n(12),i=n(52),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===o.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=0&&d.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),v(t,e),e}function y(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function A(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=l++;n=u||(u=g(e)),r=w.bind(null,n,a,!1),i=w.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),v(t,e),e}(e),r=x.bind(null,n,e),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),r=C.bind(null,n),i=function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var r=[],i=0;i=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(o)})),t.exports=c}).call(this,n(11))},function(t,e,n){t.exports=n(51)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=u.length;e;){for(c=u,u=[];++d1)for(var n=1;nn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i div[data-v-61d92e31] {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%;\n}\n.ti-selected-item[data-v-61d92e31] {\n background-color: #5C6BC0;\n color: #fff;\n}\n',"",{version:3,sources:["C:/Users/johan/dev/vue-tags-input/vue-tags-input/C:/Users/johan/dev/vue-tags-input/vue-tags-input/vue-tags-input.scss"],names:[],mappings:"AAAA;EACE,uBAAuB;EACvB,mCAA8C;EAC9C,+JAAuM;EACvM,oBAAoB;EACpB,mBAAmB;CAAE;AAEvB;EACE,kCAAkC;EAClC,YAAY;EACZ,mBAAmB;EACnB,oBAAoB;EACpB,qBAAqB;EACrB,qBAAqB;EACrB,eAAe;EACf,oCAAoC;EACpC,mCAAmC;CAAE;AAEvC;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,YAAY;EACZ,aAAa;EACb,sBAAsB;CAAE;AAE1B;EACE,uBAAuB;CAAE;AAE3B;EACE,cAAc;CAAE;AAElB;EACE,8BAA8B;CAAE;AAElC;EACE,iBAAiB;EACjB,mBAAmB;EACnB,uBAAuB;CAAE;AAE3B;EACE,aAAa;CAAE;AACf;IACE,gBAAgB;CAAE;AAEtB;EACE,uBAAuB;EACvB,cAAc;EACd,aAAa;EACb,gBAAgB;CAAE;AAEpB;EACE,cAAc;EACd,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;CAAE;AAErB;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,cAAc;EACd,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,cAAc;CAAE;AAClB;IACE,cAAc;IACd,oBAAoB;CAAE;AACxB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,iBAAiB;CAAE;AACrB;IACE,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;CAAE;AACpB;MACE,gBAAgB;CAAE;AACtB;IACE,kBAAkB;CAAE;AACtB;IACE,0BAA0B;CAAE;AAEhC;EACE,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,YAAY;CAAE;AAElB;EACE,qBAAqB;CAAE;AAEzB;EACE,uBAAuB;EACvB,iBAAiB;EACjB,mBAAmB;EACnB,YAAY;EACZ,uBAAuB;EACvB,YAAY;CAAE;AAEhB;EACE,gBAAgB;EAChB,iBAAiB;EACjB,YAAY;CAAE;AAEhB;EACE,0BAA0B;EAC1B,YAAY;CAAE",file:"vue-tags-input.scss?vue&type=style&index=0&id=61d92e31&lang=scss&scoped=true&",sourcesContent:['@font-face {\n font-family: \'icomoon\';\n src: url("./assets/fonts/icomoon.eot?7grlse");\n src: url("./assets/fonts/icomoon.eot?7grlse#iefix") format("embedded-opentype"), url("./assets/fonts/icomoon.ttf?7grlse") format("truetype"), url("./assets/fonts/icomoon.woff?7grlse") format("woff");\n font-weight: normal;\n font-style: normal; }\n\n[class^="ti-icon-"], [class*=" ti-icon-"] {\n font-family: \'icomoon\' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale; }\n\n.ti-icon-check:before {\n content: "\\e902"; }\n\n.ti-icon-close:before {\n content: "\\e901"; }\n\n.ti-icon-undo:before {\n content: "\\e900"; }\n\nul {\n margin: 0px;\n padding: 0px;\n list-style-type: none; }\n\n*, *:before, *:after {\n box-sizing: border-box; }\n\ninput:focus {\n outline: none; }\n\ninput[disabled] {\n background-color: transparent; }\n\n.vue-tags-input {\n max-width: 450px;\n position: relative;\n background-color: #fff; }\n\ndiv.vue-tags-input.disabled {\n opacity: 0.5; }\n div.vue-tags-input.disabled * {\n cursor: default; }\n\n.ti-input {\n border: 1px solid #ccc;\n display: flex;\n padding: 4px;\n flex-wrap: wrap; }\n\n.ti-tags {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n line-height: 1em; }\n\n.ti-tag {\n background-color: #5C6BC0;\n color: #fff;\n border-radius: 2px;\n display: flex;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-tag:focus {\n outline: none; }\n .ti-tag .ti-content {\n display: flex;\n align-items: center; }\n .ti-tag .ti-tag-center {\n position: relative; }\n .ti-tag span {\n line-height: .85em; }\n .ti-tag span.ti-hidden {\n padding-left: 14px;\n visibility: hidden;\n height: 0px;\n white-space: pre; }\n .ti-tag .ti-actions {\n margin-left: 2px;\n display: flex;\n align-items: center;\n font-size: 1.15em; }\n .ti-tag .ti-actions i {\n cursor: pointer; }\n .ti-tag:last-child {\n margin-right: 4px; }\n .ti-tag.ti-invalid, .ti-tag.ti-tag.ti-deletion-mark {\n background-color: #e54d42; }\n\n.ti-new-tag-input-wrapper {\n display: flex;\n flex: 1 0 auto;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-new-tag-input-wrapper input {\n flex: 1 0 auto;\n min-width: 100px;\n border: none;\n padding: 0px;\n margin: 0px; }\n\n.ti-new-tag-input {\n line-height: initial; }\n\n.ti-autocomplete {\n border: 1px solid #ccc;\n border-top: none;\n position: absolute;\n width: 100%;\n background-color: #fff;\n z-index: 20; }\n\n.ti-item > div {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%; }\n\n.ti-selected-item {\n background-color: #5C6BC0;\n color: #fff; }\n'],sourceRoot:""}])},function(t,e,n){"use strict";t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){t.exports="data:font/ttf;base64,AAEAAAALAIAAAwAwT1MvMg8SBawAAAC8AAAAYGNtYXAXVtKJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZqWfozAAAAF4AAAA/GhlYWQPxZgIAAACdAAAADZoaGVhB4ADyAAAAqwAAAAkaG10eBIAAb4AAALQAAAAHGxvY2EAkgDiAAAC7AAAABBtYXhwAAkAHwAAAvwAAAAgbmFtZZlKCfsAAAMcAAABhnBvc3QAAwAAAAAEpAAAACAAAwOAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6QL//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAFYBAQO+AoEAHAAAATIXHgEXFhcHJicuAScmIyIGBxchERc2Nz4BNzYCFkpDQ28pKRdkECAfVTM0OT9wLZz+gJgdIiJLKSgCVRcYUjg5QiAzKys+ERIrJZoBgJoZFRQcCAgAAQDWAIEDKgLVAAsAAAEHFwcnByc3JzcXNwMq7u487u487u487u4Cme7uPO7uPO7uPO7uAAEAkgCBA4ACvQAFAAAlARcBJzcBgAHEPP4A7jz5AcQ8/gDuPAAAAAABAAAAAAAAH8nTUV8PPPUACwQAAAAAANZ1KhsAAAAA1nUqGwAAAAADvgLVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAO+AAEAAAAAAAAAAAAAAAAAAAAHBAAAAAAAAAAAAAAAAgAAAAQAAFYEAADWBAAAkgAAAAAACgAUAB4AUABqAH4AAQAAAAcAHQABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},function(t,e){t.exports="data:font/woff;base64,d09GRgABAAAAAAUQAAsAAAAABMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFrGNtYXAAAAFoAAAAVAAAAFQXVtKJZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAPwAAAD8pZ+jMGhlYWQAAALAAAAANgAAADYPxZgIaGhlYQAAAvgAAAAkAAAAJAeAA8hobXR4AAADHAAAABwAAAAcEgABvmxvY2EAAAM4AAAAEAAAABAAkgDibWF4cAAAA0gAAAAgAAAAIAAJAB9uYW1lAAADaAAAAYYAAAGGmUoJ+3Bvc3QAAATwAAAAIAAAACAAAwAAAAMDgAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QIDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkC//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQBWAQEDvgKBABwAAAEyFx4BFxYXByYnLgEnJiMiBgcXIREXNjc+ATc2AhZKQ0NvKSkXZBAgH1UzNDk/cC2c/oCYHSIiSykoAlUXGFI4OUIgMysrPhESKyWaAYCaGRUUHAgIAAEA1gCBAyoC1QALAAABBxcHJwcnNyc3FzcDKu7uPO7uPO7uPO7uApnu7jzu7jzu7jzu7gABAJIAgQOAAr0ABQAAJQEXASc3AYABxDz+AO48+QHEPP4A7jwAAAAAAQAAAAAAAB/J01FfDzz1AAsEAAAAAADWdSobAAAAANZ1KhsAAAAAA74C1QAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADvgABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABWBAAA1gQAAJIAAAAAAAoAFAAeAFAAagB+AAEAAAAHAB0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAHAAAAAQAAAAAAAgAHAGAAAQAAAAAAAwAHADYAAQAAAAAABAAHAHUAAQAAAAAABQALABUAAQAAAAAABgAHAEsAAQAAAAAACgAaAIoAAwABBAkAAQAOAAcAAwABBAkAAgAOAGcAAwABBAkAAwAOAD0AAwABBAkABAAOAHwAAwABBAkABQAWACAAAwABBAkABgAOAFIAAwABBAkACgA0AKRpY29tb29uAGkAYwBvAG0AbwBvAG5WZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADBpY29tb29uAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG5SZWd1bGFyAFIAZQBnAHUAbABhAHJpY29tb29uAGkAYwBvAG0AbwBvAG5Gb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-tags-input",class:[{"ti-disabled":t.disabled},{"ti-focus":t.focused}]},[n("div",{staticClass:"ti-input"},[t.tagsCopy?n("ul",{staticClass:"ti-tags"},[t._l(t.tagsCopy,(function(e,r){return n("li",{key:r,staticClass:"ti-tag",class:[{"ti-editing":t.tagsEditStatus[r]},e.tiClasses,e.classes,{"ti-deletion-mark":t.isMarked(r)}],style:e.style,attrs:{tabindex:"0"},on:{click:function(n){return t.$emit("tag-clicked",{tag:e,index:r})}}},[n("div",{staticClass:"ti-content"},[t.$scopedSlots["tag-left"]?n("div",{staticClass:"ti-tag-left"},[t._t("tag-left",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e(),t._v(" "),n("div",{ref:"tagCenter",refInFor:!0,staticClass:"ti-tag-center"},[t.$scopedSlots["tag-center"]?t._e():n("span",{class:{"ti-hidden":t.tagsEditStatus[r]},on:{click:function(e){return t.performEditTag(r)}}},[t._v(t._s(e.text))]),t._v(" "),t.$scopedSlots["tag-center"]?t._e():n("tag-input",{attrs:{scope:{edit:t.tagsEditStatus[r],maxlength:t.maxlength,tag:e,index:r,validateTag:t.createChangedTag,performCancelEdit:t.cancelEdit,performSaveEdit:t.performSaveTag}}}),t._v(" "),t._t("tag-center",null,{tag:e,index:r,maxlength:t.maxlength,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,validateTag:t.createChangedTag,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2),t._v(" "),t.$scopedSlots["tag-right"]?n("div",{staticClass:"ti-tag-right"},[t._t("tag-right",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e()]),t._v(" "),n("div",{staticClass:"ti-actions"},[t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:t.tagsEditStatus[r],expression:"tagsEditStatus[index]"}],staticClass:"ti-icon-undo",on:{click:function(e){return t.cancelEdit(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:!t.tagsEditStatus[r],expression:"!tagsEditStatus[index]"}],staticClass:"ti-icon-close",on:{click:function(e){return t.performDeleteTag(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._t("tag-actions",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)}):t._e()],2)])})),t._v(" "),n("li",{staticClass:"ti-new-tag-input-wrapper"},[n("input",t._b({ref:"newTagInput",staticClass:"ti-new-tag-input",class:[t.createClasses(t.newTag,t.tags,t.validation,t.isDuplicate)],attrs:{placeholder:t.placeholder,maxlength:t.maxlength,disabled:t.disabled,type:"text",size:"1"},domProps:{value:t.newTag},on:{keydown:[function(e){return t.performAddTags(t.filteredAutocompleteItems[t.selectedItem]||t.newTag,e)},function(e){return e.type.indexOf("key")||8===e.keyCode?t.invokeDelete(e):null},function(e){return e.type.indexOf("key")||9===e.keyCode?t.performBlur(e):null},function(e){return e.type.indexOf("key")||38===e.keyCode?t.selectItem(e,"before"):null},function(e){return e.type.indexOf("key")||40===e.keyCode?t.selectItem(e,"after"):null}],paste:t.addTagsFromPaste,input:t.updateNewTag,blur:function(e){return t.$emit("blur",e)},focus:function(e){t.focused=!0,t.$emit("focus",e)},click:function(e){!t.addOnlyFromAutocomplete&&(t.selectedItem=null)}}},"input",t.$attrs,!1))])],2):t._e()]),t._v(" "),t._t("between-elements"),t._v(" "),t.autocompleteOpen?n("div",{staticClass:"ti-autocomplete",on:{mouseout:function(e){t.selectedItem=null}}},[t._t("autocomplete-header"),t._v(" "),n("ul",t._l(t.filteredAutocompleteItems,(function(e,r){return n("li",{key:r,staticClass:"ti-item",class:[e.tiClasses,e.classes,{"ti-selected-item":t.isSelected(r)}],style:e.style,on:{mouseover:function(e){!t.disabled&&(t.selectedItem=r)}}},[t.$scopedSlots["autocomplete-item"]?t._t("autocomplete-item",null,{item:e,index:r,performAdd:function(e){return t.performAddTags(e,void 0,"autocomplete")},selected:t.isSelected(r)}):n("div",{on:{click:function(n){return t.performAddTags(e,void 0,"autocomplete")}}},[t._v("\n "+t._s(e.text)+"\n ")])],2)})),0),t._v(" "),t._t("autocomplete-footer")],2):t._e()],2)};r._withStripped=!0;var i=n(5),o=n.n(i),a=function(t){return JSON.parse(JSON.stringify(t))},s=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0;void 0===t.text&&(t={text:t});var i=function(t,e){return e.filter((function(e){var n=t.text;return"string"==typeof e.rule?!new RegExp(e.rule).test(n):e.rule instanceof RegExp?!e.rule.test(n):"[object Function]"==={}.toString.call(e.rule)?e.rule(t):void 0})).map((function(t){return t.classes}))}(t,n),o=function(t,e){for(var n=0;n1?n-1:0),i=1;i1?e-1:0),r=1;r=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems:function(){var t=this,e=this.autocompleteItems.map((function(e){return c(e,t.tags,t.validation,t.isDuplicate)}));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:s,getSelectedIndex:function(t){var e=this.filteredAutocompleteItems,n=this.selectedItem,r=e.length-1;if(0!==e.length)return null===n?0:"before"===t&&0===n?r:"after"===t&&n===r?0:"after"===t?n+1:n-1},selectDefaultItem:function(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem:function(t,e){t.preventDefault(),this.selectedItem=this.getSelectedIndex(e)},isSelected:function(t){return this.selectedItem===t},isMarked:function(t){return this.deletionMark===t},invokeDelete:function(){var t=this;if(this.deleteOnBackspace&&!(this.newTag.length>0)){var e=this.tagsCopy.length-1;null===this.deletionMark?(this.deletionMarkTime=setTimeout((function(){return t.deletionMark=null}),1e3),this.deletionMark=e):this.performDeleteTag(e)}},addTagsFromPaste:function(){var t=this;this.addFromPaste&&setTimeout((function(){return t.performAddTags(t.newTag)}),10)},performEditTag:function(t){var e=this;this.allowEditTags&&(this._events["before-editing-tag"]||this.editTag(t),this.$emit("before-editing-tag",{index:t,tag:this.tagsCopy[t],editTag:function(){return e.editTag(t)}}))},editTag:function(t){this.allowEditTags&&(this.toggleEditMode(t),this.focus(t))},toggleEditMode:function(t){this.allowEditTags&&!this.disabled&&this.$set(this.tagsEditStatus,t,!this.tagsEditStatus[t])},createChangedTag:function(t,e){var n=this.tagsCopy[t];n.text=e?e.target.value:this.tagsCopy[t].text,this.$set(this.tagsCopy,t,c(n,this.tagsCopy,this.validation,this.isDuplicate))},focus:function(t){var e=this;this.$nextTick((function(){var n=e.$refs.tagCenter[t].querySelector("input.ti-tag-input");n&&n.focus()}))},quote:function(t){return t.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit:function(t){this.tags[t]&&(this.tagsCopy[t]=a(c(this.tags[t],this.tags,this.validation,this.isDuplicate)),this.$set(this.tagsEditStatus,t,!1))},hasForbiddingAddRule:function(t){var e=this;return t.some((function(t){var n=e.validation.find((function(e){return t===e.classes}));return!!n&&n.disableAdd}))},createTagTexts:function(t){var e=this,n=new RegExp(this.separators.map((function(t){return e.quote(t)})).join("|"));return t.split(n).map((function(t){return{text:t}}))},performDeleteTag:function(t){var e=this;this._events["before-deleting-tag"]||this.deleteTag(t),this.$emit("before-deleting-tag",{index:t,tag:this.tagsCopy[t],deleteTag:function(){return e.deleteTag(t)}})},deleteTag:function(t){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(t,1),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey:function(t,e){var n=-1!==this[e].indexOf(t.keyCode)||-1!==this[e].indexOf(t.key);return n&&t.preventDefault(),!n},performAddTags:function(t,e,n){var r=this;if(!(this.disabled||e&&this.noTriggerKey(e,"addOnKey"))){var i=[];"object"===y(t)&&(i=[t]),"string"==typeof t&&(i=this.createTagTexts(t)),(i=i.filter((function(t){return t.text.trim().length>0}))).forEach((function(t){t=c(t,r.tags,r.validation,r.isDuplicate),r._events["before-adding-tag"]||r.addTag(t,n),r.$emit("before-adding-tag",{tag:t,addTag:function(){return r.addTag(t,n)}})}))}},duplicateFilter:function(t){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,t):!this.tagsCopy.find((function(e){return e.text===t.text}))},addTag:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"new-tag-input",r=this.filteredAutocompleteItems.map((function(t){return t.text}));this.addOnlyFromAutocomplete&&-1===r.indexOf(t.text)||this.$nextTick((function(){return e.maxTags&&e.maxTags<=e.tagsCopy.length?e.$emit("max-tags-reached",t):e.avoidAddingDuplicates&&!e.duplicateFilter(t)?e.$emit("adding-duplicate",t):void(e.hasForbiddingAddRule(t.tiClasses)||(e.$emit("input",""),e.tagsCopy.push(t),e._events["update:tags"]&&e.$emit("update:tags",e.tagsCopy),"autocomplete"===n&&e.$refs.newTagInput.focus(),e.$emit("tags-changed",e.tagsCopy)))}))},performSaveTag:function(t,e){var n=this,r=this.tagsCopy[t];this.disabled||e&&this.noTriggerKey(e,"addOnKey")||0!==r.text.trim().length&&(this._events["before-saving-tag"]||this.saveTag(t,r),this.$emit("before-saving-tag",{index:t,tag:r,saveTag:function(){return n.saveTag(t,r)}}))},saveTag:function(t,e){if(this.avoidAddingDuplicates){var n=a(this.tagsCopy),r=n.splice(t,1)[0];if(this.isDuplicate?this.isDuplicate(n,r):-1!==n.map((function(t){return t.text})).indexOf(r.text))return this.$emit("saving-duplicate",e)}this.hasForbiddingAddRule(e.tiClasses)||(this.$set(this.tagsCopy,t,e),this.toggleEditMode(t),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual:function(){var t=this;return!this.tagsCopy.some((function(e,n){return!o()(e,t.tags[n])}))},updateNewTag:function(t){var e=t.target.value;this.newTag=e,this.$emit("input",e)},initTags:function(){this.tagsCopy=u(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=a(this.tags).map((function(){return!1})),this._events["update:tags"]&&!this.tagsEqual()&&this.$emit("update:tags",this.tagsCopy)},blurredOnClick:function(t){this.$el.contains(t.target)||this.$el.contains(document.activeElement)||this.performBlur(t)},performBlur:function(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{value:function(t){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=t},tags:{handler:function(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created:function(){this.newTag=this.value,this.initTags()},mounted:function(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},destroyed:function(){document.removeEventListener("click",this.blurredOnClick)}},_=(n(9),f(A,r,[],!1,null,"61d92e31",null));_.options.__file="vue-tags-input/vue-tags-input.vue";var b=_.exports;n.d(e,"VueTagsInput",(function(){return b})),n.d(e,"createClasses",(function(){return s})),n.d(e,"createTag",(function(){return c})),n.d(e,"createTags",(function(){return u})),n.d(e,"TagInput",(function(){return h})),b.install=function(t){return t.component(b.name,b)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(b),e.default=b}])},function(t,e,n){"use strict";n.r(e),n.d(e,"Carousel",(function(){return l})),n.d(e,"Slide",(function(){return h})),n.d(e,"Collapse",(function(){return J})),n.d(e,"Dropdown",(function(){return X})),n.d(e,"Modal",(function(){return ht})),n.d(e,"Tab",(function(){return vt})),n.d(e,"Tabs",(function(){return mt})),n.d(e,"DatePicker",(function(){return _t})),n.d(e,"Affix",(function(){return Tt})),n.d(e,"Alert",(function(){return kt})),n.d(e,"Pagination",(function(){return Et})),n.d(e,"Tooltip",(function(){return St})),n.d(e,"Popover",(function(){return Bt})),n.d(e,"TimePicker",(function(){return Dt})),n.d(e,"Typeahead",(function(){return Ot})),n.d(e,"ProgressBar",(function(){return Nt})),n.d(e,"ProgressBarStack",(function(){return It})),n.d(e,"Breadcrumbs",(function(){return Pt})),n.d(e,"BreadcrumbItem",(function(){return jt})),n.d(e,"Btn",(function(){return dt})),n.d(e,"BtnGroup",(function(){return lt})),n.d(e,"BtnToolbar",(function(){return Lt})),n.d(e,"MultiSelect",(function(){return Rt})),n.d(e,"Navbar",(function(){return Mt})),n.d(e,"NavbarNav",(function(){return Ft})),n.d(e,"NavbarForm",(function(){return Ut})),n.d(e,"NavbarText",(function(){return Ht})),n.d(e,"tooltip",(function(){return Vt})),n.d(e,"popover",(function(){return Jt})),n.d(e,"scrollspy",(function(){return oe})),n.d(e,"MessageBox",(function(){return he})),n.d(e,"Notification",(function(){return $e})),n.d(e,"install",(function(){return Be}));var r=n(1),i=n.n(r);function o(t){return null!=t}function a(t){return"function"==typeof t}function s(t){return"number"==typeof t}function c(t){return"string"==typeof t}function u(){return"undefined"!=typeof window&&o(window.Promise)}var l={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"carousel slide",attrs:{"data-ride":"carousel"},on:{mouseenter:t.stopInterval,mouseleave:t.startInterval}},[t.indicators?t._t("indicators",[n("ol",{staticClass:"carousel-indicators"},t._l(t.slides,(function(e,r){return n("li",{class:{active:r===t.activeIndex},on:{click:function(e){return t.select(r)}}})})),0)],{select:t.select,activeIndex:t.activeIndex}):t._e(),t._v(" "),n("div",{staticClass:"carousel-inner",attrs:{role:"listbox"}},[t._t("default")],2),t._v(" "),t.controls?n("a",{staticClass:"left carousel-control",attrs:{href:"#",role:"button"},on:{click:function(e){return e.preventDefault(),t.prev()}}},[n("span",{class:t.iconControlLeft,attrs:{"aria-hidden":"true"}}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v("Previous")])]):t._e(),t._v(" "),t.controls?n("a",{staticClass:"right carousel-control",attrs:{href:"#",role:"button"},on:{click:function(e){return e.preventDefault(),t.next()}}},[n("span",{class:t.iconControlRight,attrs:{"aria-hidden":"true"}}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v("Next")])]):t._e()],2)},staticRenderFns:[],props:{value:Number,indicators:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},interval:{type:Number,default:5e3},iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{slides:[],activeIndex:0,timeoutId:0,intervalId:0}},watch:{interval:function(){this.startInterval()},value:function(t,e){this.run(t,e),this.activeIndex=t}},mounted:function(){o(this.value)&&(this.activeIndex=this.value),this.slides.length>0&&this.$select(this.activeIndex),this.startInterval()},beforeDestroy:function(){this.stopInterval()},methods:{run:function(t,e){var n=this,r=e||0,i=void 0;i=t>r?["next","left"]:["prev","right"],this.slides[t].slideClass[i[0]]=!0,this.$nextTick((function(){n.slides[t].$el.offsetHeight,n.slides.forEach((function(e,n){n===r?(e.slideClass.active=!0,e.slideClass[i[1]]=!0):n===t&&(e.slideClass[i[1]]=!0)})),n.timeoutId=setTimeout((function(){n.$select(t),n.$emit("change",t),n.timeoutId=0}),600)}))},startInterval:function(){var t=this;this.stopInterval(),this.interval>0&&(this.intervalId=setInterval((function(){t.next()}),this.interval))},stopInterval:function(){clearInterval(this.intervalId),this.intervalId=0},resetAllSlideClass:function(){this.slides.forEach((function(t){t.slideClass.active=!1,t.slideClass.left=!1,t.slideClass.right=!1,t.slideClass.next=!1,t.slideClass.prev=!1}))},$select:function(t){this.resetAllSlideClass(),this.slides[t].slideClass.active=!0},select:function(t){0===this.timeoutId&&t!==this.activeIndex&&(o(this.value)?this.$emit("input",t):(this.run(t,this.activeIndex),this.activeIndex=t))},prev:function(){this.select(0===this.activeIndex?this.slides.length-1:this.activeIndex-1)},next:function(){this.select(this.activeIndex===this.slides.length-1?0:this.activeIndex+1)}}};function d(t,e){if(Array.isArray(t)){var n=t.indexOf(e);n>=0&&t.splice(n,1)}}function f(t){return Array.prototype.slice.call(t||[])}function p(t,e,n){return n.indexOf(t)===e}var h={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"item",class:this.slideClass},[this._t("default")],2)},staticRenderFns:[],data:function(){return{slideClass:{active:!1,prev:!1,next:!1,left:!1,right:!1}}},created:function(){try{this.$parent.slides.push(this)}catch(t){throw new Error("Slide parent must be Carousel.")}},beforeDestroy:function(){d(this.$parent&&this.$parent.slides,this)}},v="mouseenter",m="mouseleave",g="focus",y="blur",A="click",_="input",b="keydown",w="keyup",C="resize",x="scroll",T="touchend",k="click",E="hover",$="focus",S="hover-focus",B="outside-click",D="top",O="right",I="bottom",N="left";function j(t){return window.getComputedStyle(t)}function P(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}var L=null,R=null;function M(t,e,n){t.addEventListener(e,n)}function F(t,e,n){t.removeEventListener(e,n)}function U(t){return t&&t.nodeType===Node.ELEMENT_NODE}function H(t){U(t)&&U(t.parentNode)&&t.parentNode.removeChild(t)}function z(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=e.length;--n>=0&&e.item(n)!==this;);return n>-1})}function q(t,e){if(U(t))if(t.className){var n=t.className.split(" ");n.indexOf(e)<0&&(n.push(e),t.className=n.join(" "))}else t.className=e}function W(t,e){if(U(t)&&t.className){for(var n=t.className.split(" "),r=[],i=0,o=n.length;i=i.height,u=r.left+r.width/2>=i.width/2,s=r.right-r.width/2+i.width/2<=o.width;break;case I:c=r.bottom+i.height<=o.height,u=r.left+r.width/2>=i.width/2,s=r.right-r.width/2+i.width/2<=o.width;break;case O:s=r.right+i.width<=o.width,a=r.top+r.height/2>=i.height/2,c=r.bottom-r.height/2+i.height/2<=o.height;break;case N:u=r.left>=i.width,a=r.top+r.height/2>=i.height/2,c=r.bottom-r.height/2+i.height/2<=o.height}return a&&s&&c&&u}function V(t){var e=t.scrollHeight>t.clientHeight,n=j(t);return e||"scroll"===n.overflow||"scroll"===n.overflowY}function Y(t){var e=document.body;if(t)W(e,"modal-open"),e.style.paddingRight=null;else{var n=-1!==window.navigator.appVersion.indexOf("MSIE 10")||!!window.MSInputMethodContext&&!!document.documentMode;(V(document.documentElement)||V(document.body))&&!n&&(e.style.paddingRight=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=P();if(null!==L&&!t&&e.height===R.height&&e.width===R.width)return L;if("loading"===document.readyState)return null;var n=document.createElement("div"),r=document.createElement("div");return n.style.width=r.style.width=n.style.height=r.style.height="100px",n.style.overflow="scroll",r.style.overflow="hidden",document.body.appendChild(n),document.body.appendChild(r),L=Math.abs(n.scrollHeight-r.scrollHeight),document.body.removeChild(n),document.body.removeChild(r),R=e,L}()+"px"),q(e,"modal-open")}}function G(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;z();for(var r=[],i=t.parentElement;i;){if(i.matches(e))r.push(i);else if(n&&(n===i||i.matches(n)))break;i=i.parentElement}return r}function K(t){U(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}var J={render:function(t){return t(this.tag,{},this.$slots.default)},props:{tag:{type:String,default:"div"},value:{type:Boolean,default:!1},transitionDuration:{type:Number,default:350}},data:function(){return{timeoutId:0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){var t=this.$el;q(t,"collapse"),this.value&&q(t,"in")},methods:{toggle:function(t){var e=this;clearTimeout(this.timeoutId);var n=this.$el;if(t){this.$emit("show"),W(n,"collapse"),n.style.height="auto";var r=window.getComputedStyle(n).height;n.style.height=null,q(n,"collapsing"),n.offsetHeight,n.style.height=r,this.timeoutId=setTimeout((function(){W(n,"collapsing"),q(n,"collapse"),q(n,"in"),n.style.height=null,e.timeoutId=0,e.$emit("shown")}),this.transitionDuration)}else this.$emit("hide"),n.style.height=window.getComputedStyle(n).height,W(n,"in"),W(n,"collapse"),n.offsetHeight,n.style.height=null,q(n,"collapsing"),this.timeoutId=setTimeout((function(){q(n,"collapse"),W(n,"collapsing"),n.style.height=null,e.timeoutId=0,e.$emit("hidden")}),this.transitionDuration)}}},X={render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(M(this.triggerEl,A,this.toggle),M(this.triggerEl,b,this.onKeyPress)),M(this.$refs.dropdown,b,this.onKeyPress),M(window,A,this.windowClicked),M(window,T,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(F(this.triggerEl,A,this.toggle),F(this.triggerEl,b,this.onKeyPress)),F(this.$refs.dropdown,b,this.onKeyPress),F(window,A,this.windowClicked),F(window,T,this.windowClicked)},methods:{onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,n=t.keyCode||t.which;if(27===n)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===n){var r=e.querySelector("li > a:focus");r&&r.click()}else if(38===n||40===n){t.preventDefault(),t.stopPropagation();var i=e.querySelector("li > a:focus"),o=e.querySelectorAll("li:not(.disabled) > a");if(i){for(var a=0;a0?K(o[a-1]):40===n&&a=0;a=o||s&&c}if(a){n=!0;break}}var u=this.$refs.dropdown.contains(e),l=this.$el.contains(e)&&!u,d=u&&"touchend"===t.type;l||n||d||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.documentElement,i=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),o=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=e.getBoundingClientRect(),s=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",n.menuRight?t.style.left=i+a.left+a.width-s.width+"px":t.style.left=i+a.left+"px",n.dropup?t.style.top=o+a.top-s.height-4+"px":t.style.top=o+a.top+a.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}},Z={uiv:{datePicker:{clear:"Clear",today:"Today",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",week1:"Mon",week2:"Tue",week3:"Wed",week4:"Thu",week5:"Fri",week6:"Sat",week7:"Sun"},timePicker:{am:"AM",pm:"PM"},modal:{cancel:"Cancel",ok:"OK"},multiSelect:{placeholder:"Select...",filterPlaceholder:"Search..."}}},tt=function(){var t=Object.getPrototypeOf(this).$t;if(a(t))try{return t.apply(this,arguments)}catch(t){return this.$t.apply(this,arguments)}},et=function(t,e){e=e||{};var n=tt.apply(this,arguments);if(o(n)&&!e.$$locale)return n;for(var r=t.split("."),i=e.$$locale||Z,a=0,s=r.length;a=0:i.value===i.inputValue,c=(n={btn:!0,active:i.inputType?s:i.active,disabled:i.disabled,"btn-block":i.block},it(n,"btn-"+i.type,Boolean(i.type)),it(n,"btn-"+i.size,Boolean(i.size)),n),u={click:function(t){i.disabled&&t instanceof Event&&(t.preventDefault(),t.stopPropagation())}},l=void 0,d=void 0,f=void 0;return i.href?(l="a",f=r,d=st(o,{on:u,class:c,attrs:{role:"button",href:i.href,target:i.target}})):i.to?(l="router-link",f=r,d=st(o,{nativeOn:u,class:c,props:{event:i.disabled?"":"click",to:i.to,replace:i.replace,append:i.append,exact:i.exact},attrs:{role:"button"}})):i.inputType?(l="label",d=st(o,{on:u,class:c}),f=[t("input",{attrs:{autocomplete:"off",type:i.inputType,checked:s?"checked":null,disabled:i.disabled},domProps:{checked:s},on:{change:function(){if("checkbox"===i.inputType){var t=i.value.slice();s?t.splice(t.indexOf(i.inputValue),1):t.push(i.inputValue),a.input(t)}else a.input(i.inputValue)}}}),r]):i.justified?(l=lt,d={},f=[t("button",st(o,{on:u,class:c,attrs:{type:i.nativeType,disabled:i.disabled}}),r)]):(l="button",f=r,d=st(o,{on:u,class:c,attrs:{type:i.nativeType,disabled:i.disabled}})),t(l,d,f)},props:{justified:{type:Boolean,default:!1},type:{type:String,default:"default"},nativeType:{type:String,default:"button"},size:String,block:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:null,inputValue:null,inputType:{type:String,validator:function(t){return"checkbox"===t||"radio"===t}}}},ft=function(){return document.querySelectorAll(".modal-backdrop")},pt=function(){return ft().length},ht={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"modal",class:{fade:t.transitionDuration>0},attrs:{tabindex:"-1",role:"dialog"},on:{click:function(e){return e.target!==e.currentTarget?null:t.backdropClicked(e)}}},[n("div",{ref:"dialog",staticClass:"modal-dialog",class:t.modalSizeClass,attrs:{role:"document"}},[n("div",{staticClass:"modal-content"},[t.header?n("div",{staticClass:"modal-header"},[t._t("header",[t.dismissBtn?n("button",{staticClass:"close",staticStyle:{position:"relative","z-index":"1060"},attrs:{type:"button","aria-label":"Close"},on:{click:function(e){return t.toggle(!1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]):t._e(),t._v(" "),n("h4",{staticClass:"modal-title"},[t._t("title",[t._v(t._s(t.title))])],2)])],2):t._e(),t._v(" "),n("div",{staticClass:"modal-body"},[t._t("default")],2),t._v(" "),t.footer?n("div",{staticClass:"modal-footer"},[t._t("footer",[n("btn",{attrs:{type:t.cancelType},on:{click:function(e){return t.toggle(!1,"cancel")}}},[n("span",[t._v(t._s(t.cancelText||t.t("uiv.modal.cancel")))])]),t._v(" "),n("btn",{attrs:{type:t.okType,"data-action":"auto-focus"},on:{click:function(e){return t.toggle(!1,"ok")}}},[n("span",[t._v(t._s(t.okText||t.t("uiv.modal.ok")))])])])],2):t._e()])]),t._v(" "),n("div",{ref:"backdrop",staticClass:"modal-backdrop",class:{fade:t.transitionDuration>0}})])},staticRenderFns:[],mixins:[at],components:{Btn:dt},props:{value:{type:Boolean,default:!1},title:String,size:String,backdrop:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},header:{type:Boolean,default:!0},cancelText:String,cancelType:{type:String,default:"default"},okText:String,okType:{type:String,default:"primary"},dismissBtn:{type:Boolean,default:!0},transitionDuration:{type:Number,default:150},autoFocus:{type:Boolean,default:!1},keyboard:{type:Boolean,default:!0},beforeClose:Function,zOffset:{type:Number,default:20},appendToBody:{type:Boolean,default:!1},displayStyle:{type:String,default:"block"}},data:function(){return{msg:"",timeoutId:0}},computed:{modalSizeClass:function(){return it({},"modal-"+this.size,Boolean(this.size))}},watch:{value:function(t){this.$toggle(t)}},mounted:function(){H(this.$refs.backdrop),M(window,w,this.onKeyPress),this.value&&this.$toggle(!0)},beforeDestroy:function(){clearTimeout(this.timeoutId),H(this.$refs.backdrop),H(this.$el),0===pt()&&Y(!0),F(window,w,this.onKeyPress)},methods:{onKeyPress:function(t){if(this.keyboard&&this.value&&27===t.keyCode){var e=this.$refs.backdrop,n=e.style.zIndex;n=n&&"auto"!==n?parseInt(n):0;for(var r=ft(),i=r.length,o=0;on)return}this.toggle(!1)}},toggle:function(t,e){(t||!a(this.beforeClose)||this.beforeClose(e))&&(this.msg=e,this.$emit("input",t))},$toggle:function(t){var e=this,n=this.$el,r=this.$refs.backdrop;if(clearTimeout(this.timeoutId),t){var i=pt();if(document.body.appendChild(r),this.appendToBody&&document.body.appendChild(n),n.style.display=this.displayStyle,n.scrollTop=0,r.offsetHeight,Y(!1),q(r,"in"),q(n,"in"),i>0){var o=parseInt(j(n).zIndex)||1050,a=parseInt(j(r).zIndex)||1040,s=i*this.zOffset;n.style.zIndex=""+(o+s),r.style.zIndex=""+(a+s)}this.timeoutId=setTimeout((function(){if(e.autoFocus){var t=e.$el.querySelector('[data-action="auto-focus"]');t&&t.focus()}e.$emit("show"),e.timeoutId=0}),this.transitionDuration)}else W(r,"in"),W(n,"in"),this.timeoutId=setTimeout((function(){n.style.display="none",H(r),e.appendToBody&&H(n),0===pt()&&Y(!0),e.$emit("hide",e.msg||"dismiss"),e.msg="",e.timeoutId=0,n.style.zIndex="",r.style.zIndex=""}),this.transitionDuration)},backdropClicked:function(t){this.backdrop&&this.toggle(!1)}}},vt={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"tab-pane",class:{fade:this.transition>0},attrs:{role:"tabpanel"}},[this._t("default")],2)},staticRenderFns:[],props:{title:{type:String,default:"Tab Title"},htmlTitle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},"tab-classes":{type:Object,default:function(){return{}}},group:String,pullRight:{type:Boolean,default:!1}},data:function(){return{active:!0,transition:150}},watch:{active:function(t){var e=this;t?setTimeout((function(){q(e.$el,"active"),e.$el.offsetHeight,q(e.$el,"in");try{e.$parent.$emit("after-change",e.$parent.activeIndex)}catch(t){throw new Error(" parent must be .")}}),this.transition):(W(this.$el,"in"),setTimeout((function(){W(e.$el,"active")}),this.transition))}},created:function(){try{this.$parent.tabs.push(this)}catch(t){throw new Error(" parent must be .")}},beforeDestroy:function(){d(this.$parent&&this.$parent.tabs,this)},methods:{show:function(){var t=this;this.$nextTick((function(){q(t.$el,"active"),q(t.$el,"in")}))}}},mt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",[n("ul",{class:t.navClasses,attrs:{role:"tablist"}},[t._l(t.groupedTabs,(function(e,r){return[e.tabs?n("dropdown",{class:t.getTabClasses(e),attrs:{role:"presentation",tag:"li"}},[n("a",{staticClass:"dropdown-toggle",attrs:{role:"tab",href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v(t._s(e.group)+" "),n("span",{staticClass:"caret"})]),t._v(" "),n("template",{slot:"dropdown"},t._l(e.tabs,(function(e){return n("li",{class:t.getTabClasses(e,!0)},[n("a",{attrs:{href:"#"},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}},[t._v(t._s(e.title))])])})),0)],2):n("li",{class:t.getTabClasses(e),attrs:{role:"presentation"}},[e.htmlTitle?n("a",{attrs:{role:"tab",href:"#"},domProps:{innerHTML:t._s(e.title)},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}}):n("a",{attrs:{role:"tab",href:"#"},domProps:{textContent:t._s(e.title)},on:{click:function(n){n.preventDefault(),t.select(t.tabs.indexOf(e))}}})])]})),t._v(" "),!t.justified&&t.$slots["nav-right"]?n("li",{staticClass:"pull-right"},[t._t("nav-right")],2):t._e()],2),t._v(" "),n("div",{staticClass:"tab-content"},[t._t("default")],2)])},staticRenderFns:[],components:{Dropdown:X},props:{value:{type:Number,validator:function(t){return t>=0}},transitionDuration:{type:Number,default:150},justified:Boolean,pills:Boolean,stacked:Boolean,customNavClass:null},data:function(){return{tabs:[],activeIndex:0}},watch:{value:{immediate:!0,handler:function(t){s(t)&&(this.activeIndex=t,this.selectCurrent())}},tabs:function(t){var e=this;t.forEach((function(t,n){t.transition=e.transitionDuration,n===e.activeIndex&&t.show()})),this.selectCurrent()}},computed:{navClasses:function(){var t={nav:!0,"nav-justified":this.justified,"nav-tabs":!this.pills,"nav-pills":this.pills,"nav-stacked":this.stacked&&this.pills},e=this.customNavClass;return o(e)?c(e)?ot({},t,it({},e,!0)):ot({},t,e):t},groupedTabs:function(){var t=[],e={};return this.tabs.forEach((function(n){n.group?(e.hasOwnProperty(n.group)?t[e[n.group]].tabs.push(n):(t.push({tabs:[n],group:n.group}),e[n.group]=t.length-1),n.active&&(t[e[n.group]].active=!0),n.pullRight&&(t[e[n.group]].pullRight=!0)):t.push(n)})),t}},methods:{getTabClasses:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={active:t.active,disabled:t.disabled,"pull-right":t.pullRight&&!e};return ot(n,t.tabClasses)},selectCurrent:function(){var t=this,e=!1;this.tabs.forEach((function(n,r){r===t.activeIndex?(e=!n.active,n.active=!0):n.active=!1})),e&&this.$emit("change",this.activeIndex)},selectValidate:function(t){var e=this;a(this.$listeners["before-change"])?this.$emit("before-change",this.activeIndex,t,(function(n){o(n)||e.$select(t)})):this.$select(t)},select:function(t){this.tabs[t].disabled||t===this.activeIndex||this.selectValidate(t)},$select:function(t){s(this.value)?this.$emit("input",t):(this.activeIndex=t,this.selectCurrent())}}};function gt(t,e){for(var n=e-(t+="").length;n>0;n--)t="0"+t;return t}var yt=["January","February","March","April","May","June","July","August","September","October","November","December"];function At(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}var _t={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:t.pickerStyle,attrs:{"data-role":"date-picker"},on:{click:t.onPickerClick}},[n("date-view",{directives:[{name:"show",rawName:"v-show",value:"d"===t.view,expression:"view==='d'"}],attrs:{month:t.currentMonth,year:t.currentYear,date:t.valueDateObj,today:t.now,limit:t.limit,"week-starts-with":t.weekStartsWith,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,"date-class":t.dateClass,"year-month-formatter":t.yearMonthFormatter,"week-numbers":t.weekNumbers,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"date-change":t.onDateChange,"view-change":t.onViewChange}}),t._v(" "),n("month-view",{directives:[{name:"show",rawName:"v-show",value:"m"===t.view,expression:"view==='m'"}],attrs:{month:t.currentMonth,year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),n("year-view",{directives:[{name:"show",rawName:"v-show",value:"y"===t.view,expression:"view==='y'"}],attrs:{year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight},on:{"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),t.todayBtn||t.clearBtn?n("div",[n("br"),t._v(" "),n("div",{staticClass:"text-center"},[t.todayBtn?n("btn",{attrs:{"data-action":"select",type:"info",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.today"))},on:{click:t.selectToday}}):t._e(),t._v(" "),t.clearBtn?n("btn",{attrs:{"data-action":"select",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.clear"))},on:{click:t.clearSelect}}):t._e()],1)]):t._e()],1)},staticRenderFns:[],mixins:[at],components:{DateView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevMonth}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:t.weekNumbers?6:5}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.changeView}},[n("b",[t._v(t._s(t.yearMonthStr))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextMonth}},[n("i",{class:t.iconControlRight})])],1)]),t._v(" "),n("tr",{attrs:{align:"center"}},[t.weekNumbers?n("td"):t._e(),t._v(" "),t._l(t.weekDays,(function(e){return n("td",{attrs:{width:"14.2857142857%"}},[n("small",[t._v(t._s(t.tWeekName(0===e?7:e)))])])}))],2)]),t._v(" "),n("tbody",t._l(t.monthDayRows,(function(e){return n("tr",[t.weekNumbers?n("td",{staticClass:"text-center",staticStyle:{"border-right":"1px solid #eee"}},[n("small",{staticClass:"text-muted"},[t._v(t._s(t.getWeekNumber(e[t.weekStartsWith])))])]):t._e(),t._v(" "),t._l(e,(function(e){return n("td",[n("btn",{class:e.classes,staticStyle:{border:"none"},attrs:{block:"",size:"sm","data-action":"select",type:t.getBtnType(e),disabled:e.disabled},on:{click:function(n){return t.select(e)}}},[n("span",{class:{"text-muted":t.month!==e.month},attrs:{"data-action":"select"}},[t._v(t._s(e.date))])])],1)}))],2)})),0)])},staticRenderFns:[],mixins:[at],props:{month:Number,year:Number,date:Date,today:Date,limit:Object,weekStartsWith:Number,iconControlLeft:String,iconControlRight:String,dateClass:Function,yearMonthFormatter:Function,weekNumbers:Boolean},components:{Btn:dt},computed:{weekDays:function(){for(var t=[],e=this.weekStartsWith;t.length<7;)t.push(e++),e>6&&(e=0);return t},yearMonthStr:function(){return this.yearMonthFormatter?this.yearMonthFormatter(this.year,this.month):o(this.month)?this.year+" "+this.t("uiv.datePicker.month"+(this.month+1)):this.year},monthDayRows:function(){var t,e,n=[],r=new Date(this.year,this.month,1),i=new Date(this.year,this.month,0).getDate(),o=r.getDay(),s=(t=this.month,e=this.year,new Date(e,t+1,0).getDate()),c=0;c=this.weekStartsWith>o?7-this.weekStartsWith:0-this.weekStartsWith;for(var u=0;u<6;u++){n.push([]);for(var l=0-c;l<7-c;l++){var d=7*u+l,f={year:this.year,disabled:!1};d0?f.month=this.month-1:(f.month=11,f.year--)):d=this.limit.from),this.limit&&this.limit.to&&(v=p0?t--:(t=11,e--,this.$emit("year-change",e)),this.$emit("month-change",t)},goNextMonth:function(){var t=this.month,e=this.year;this.month<11?t++:(t=0,e++,this.$emit("year-change",e)),this.$emit("month-change",t)},changeView:function(){this.$emit("view-change","m")}}},MonthView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:"4"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:function(e){return t.changeView()}}},[n("b",[t._v(t._s(t.year))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[n("i",{class:t.iconControlRight})])],1)])]),t._v(" "),n("tbody",t._l(t.rows,(function(e,r){return n("tr",t._l(e,(function(e,i){return n("td",{attrs:{colspan:"2",width:"33.333333%"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(3*r+i)},on:{click:function(e){return t.changeView(3*r+i)}}},[n("span",[t._v(t._s(t.tCell(e)))])])],1)})),0)})),0)])},staticRenderFns:[],components:{Btn:dt},mixins:[at],props:{month:Number,year:Number,iconControlLeft:String,iconControlRight:String},data:function(){return{rows:[]}},mounted:function(){for(var t=0;t<4;t++){this.rows.push([]);for(var e=0;e<3;e++)this.rows[t].push(3*t+e+1)}},methods:{tCell:function(t){return this.t("uiv.datePicker.month"+t)},getBtnClass:function(t){return t===this.month?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-1)},goNextYear:function(){this.$emit("year-change",this.year+1)},changeView:function(t){o(t)?(this.$emit("month-change",t),this.$emit("view-change","d")):this.$emit("view-change","y")}}},YearView:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[n("thead",[n("tr",[n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[n("i",{class:t.iconControlLeft})])],1),t._v(" "),n("td",{attrs:{colspan:"3"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"}},[n("b",[t._v(t._s(t.yearStr))])])],1),t._v(" "),n("td",[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[n("i",{class:t.iconControlRight})])],1)])]),t._v(" "),n("tbody",t._l(t.rows,(function(e){return n("tr",t._l(e,(function(e){return n("td",{attrs:{width:"20%"}},[n("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(e)},on:{click:function(n){return t.changeView(e)}}},[n("span",[t._v(t._s(e))])])],1)})),0)})),0)])},staticRenderFns:[],components:{Btn:dt},props:{year:Number,iconControlLeft:String,iconControlRight:String},computed:{rows:function(){for(var t=[],e=this.year-this.year%20,n=0;n<4;n++){t.push([]);for(var r=0;r<5;r++)t[n].push(e+5*n+r)}return t},yearStr:function(){var t=this.year-this.year%20;return t+" ~ "+(t+19)}},methods:{getBtnClass:function(t){return t===this.year?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-20)},goNextYear:function(){this.$emit("year-change",this.year+20)},changeView:function(t){this.$emit("year-change",t),this.$emit("view-change","m")}}},Btn:dt},props:{value:null,width:{type:Number,default:270},todayBtn:{type:Boolean,default:!0},clearBtn:{type:Boolean,default:!0},closeOnSelected:{type:Boolean,default:!0},limitFrom:null,limitTo:null,format:{type:String,default:"yyyy-MM-dd"},initialView:{type:String,default:"d"},dateParser:{type:Function,default:Date.parse},dateClass:Function,yearMonthFormatter:Function,weekStartsWith:{type:Number,default:0,validator:function(t){return t>=0&&t<=6}},weekNumbers:Boolean,iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{show:!1,now:new Date,currentMonth:0,currentYear:0,view:"d"}},computed:{valueDateObj:function(){var t=this.dateParser(this.value);if(isNaN(t))return null;var e=new Date(t);return 0!==e.getHours()&&(e=new Date(t+60*e.getTimezoneOffset()*1e3)),e},pickerStyle:function(){return{width:this.width+"px"}},limit:function(){var t={};if(this.limitFrom){var e=this.dateParser(this.limitFrom);isNaN(e)||((e=At(new Date(e))).setHours(0,0,0,0),t.from=e)}if(this.limitTo){var n=this.dateParser(this.limitTo);isNaN(n)||((n=At(new Date(n))).setHours(0,0,0,0),t.to=n)}return t}},mounted:function(){this.value?this.setMonthAndYearByValue(this.value):(this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView)},watch:{value:function(t,e){this.setMonthAndYearByValue(t,e)}},methods:{setMonthAndYearByValue:function(t,e){var n=this.dateParser(t);if(!isNaN(n)){var r=new Date(n);0!==r.getHours()&&(r=new Date(n+60*r.getTimezoneOffset()*1e3)),this.limit&&(this.limit.from&&r=this.limit.to)?this.$emit("input",e||""):(this.currentMonth=r.getMonth(),this.currentYear=r.getFullYear())}},onMonthChange:function(t){this.currentMonth=t},onYearChange:function(t){this.currentYear=t,this.currentMonth=void 0},onDateChange:function(t){if(t&&s(t.date)&&s(t.month)&&s(t.year)){var e=new Date(t.year,t.month,t.date);this.$emit("input",this.format?function(t,e){try{var n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=yt[r-1];return e.replace(/yyyy/g,n).replace(/MMMM/g,o).replace(/MMM/g,o.substring(0,3)).replace(/MM/g,gt(r,2)).replace(/dd/g,gt(i,2)).replace(/yy/g,n).replace(/M(?!a)/g,r).replace(/d/g,i)}catch(t){return""}}(e,this.format):e),this.currentMonth=t.month,this.currentYear=t.year}else this.$emit("input","")},onViewChange:function(t){this.view=t},selectToday:function(){this.view="d",this.onDateChange({date:this.now.getDate(),month:this.now.getMonth(),year:this.now.getFullYear()})},clearSelect:function(){this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView,this.onDateChange()},onPickerClick:function(t){"select"===t.target.getAttribute("data-action")&&this.closeOnSelected||t.stopPropagation()}}},bt="_uiv_scroll_handler",wt=[C,x],Ct=function(t,e){var n=e.value;a(n)&&(xt(t),t[bt]=n,wt.forEach((function(e){M(window,e,t[bt])})))},xt=function(t){wt.forEach((function(e){F(window,e,t[bt])})),delete t[bt]},Tt={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"hidden-print"},[e("div",{directives:[{name:"scroll",rawName:"v-scroll",value:this.onScroll,expression:"onScroll"}],class:this.classes,style:this.styles},[this._t("default")],2)])},staticRenderFns:[],directives:{scroll:{bind:Ct,unbind:xt,update:function(t,e){e.value!==e.oldValue&&Ct(t,e)}}},props:{offset:{type:Number,default:0}},data:function(){return{affixed:!1}},computed:{classes:function(){return{affix:this.affixed}},styles:function(){return{top:this.affixed?this.offset+"px":null}}},methods:{onScroll:function(){var t=this;if(this.$el.offsetWidth||this.$el.offsetHeight||this.$el.getClientRects().length){for(var e={},n={},r=this.$el.getBoundingClientRect(),i=document.body,o=["Top","Left"],a=0;an.top-this.offset;this.affixed!==u&&(this.affixed=u,this.affixed&&(this.$emit("affix"),this.$nextTick((function(){t.$emit("affixed")}))))}}}},kt={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.alertClass,attrs:{role:"alert"}},[this.dismissible?e("button",{staticClass:"close",attrs:{type:"button","aria-label":"Close"},on:{click:this.closeAlert}},[e("span",{attrs:{"aria-hidden":"true"}},[this._v("×")])]):this._e(),this._v(" "),this._t("default")],2)},staticRenderFns:[],props:{dismissible:{type:Boolean,default:!1},duration:{type:Number,default:0},type:{type:String,default:"info"}},data:function(){return{timeout:0}},computed:{alertClass:function(){var t;return it(t={alert:!0},"alert-"+this.type,Boolean(this.type)),it(t,"alert-dismissible",this.dismissible),t}},methods:{closeAlert:function(){clearTimeout(this.timeout),this.$emit("dismissed")}},mounted:function(){this.duration>0&&(this.timeout=setTimeout(this.closeAlert,this.duration))},destroyed:function(){clearTimeout(this.timeout)}},Et={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{class:t.navClasses,attrs:{"aria-label":"Page navigation"}},[n("ul",{staticClass:"pagination",class:t.classes},[t.boundaryLinks?n("li",{class:{disabled:t.value<=1||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"First"},on:{click:function(e){return e.preventDefault(),t.onPageChange(1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("«")])])]):t._e(),t._v(" "),t.directionLinks?n("li",{class:{disabled:t.value<=1||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Previous"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.value-1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("‹")])])]):t._e(),t._v(" "),t.sliceStart>0?n("li",{class:{disabled:t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Previous group"},on:{click:function(e){return e.preventDefault(),t.toPage(1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("…")])])]):t._e(),t._v(" "),t._l(t.sliceArray,(function(e){return n("li",{key:e,class:{active:t.value===e+1,disabled:t.disabled}},[n("a",{attrs:{href:"#",role:"button"},on:{click:function(n){return n.preventDefault(),t.onPageChange(e+1)}}},[t._v(t._s(e+1))])])})),t._v(" "),t.sliceStart=t.totalPage||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Next"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.value+1)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("›")])])]):t._e(),t._v(" "),t.boundaryLinks?n("li",{class:{disabled:t.value>=t.totalPage||t.disabled}},[n("a",{attrs:{href:"#",role:"button","aria-label":"Last"},on:{click:function(e){return e.preventDefault(),t.onPageChange(t.totalPage)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()],2)])},staticRenderFns:[],props:{value:{type:Number,required:!0,validator:function(t){return t>=1}},boundaryLinks:{type:Boolean,default:!1},directionLinks:{type:Boolean,default:!0},size:String,align:String,totalPage:{type:Number,required:!0,validator:function(t){return t>=0}},maxSize:{type:Number,default:5,validator:function(t){return t>=0}},disabled:Boolean},data:function(){return{sliceStart:0}},computed:{navClasses:function(){return it({},"text-"+this.align,Boolean(this.align))},classes:function(){return it({},"pagination-"+this.size,Boolean(this.size))},sliceArray:function(){return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=[],i=e;in+e){var r=this.totalPage-e;this.sliceStart=t>r?r:t-1}else te?t-e:0)},onPageChange:function(t){!this.disabled&&t>0&&t<=this.totalPage&&t!==this.value&&(this.$emit("input",t),this.$emit("change",t))},toPage:function(t){if(!this.disabled){var e=this.maxSize,n=this.sliceStart,r=this.totalPage-e,i=t?n-e:n+e;this.sliceStart=i<0?0:i>r?r:i}}},created:function(){this.$watch((function(t){return[t.value,t.maxSize,t.totalPage].join()}),this.calculateSliceStart,{immediate:!0})}},$t={props:{value:{type:Boolean,default:!1},tag:{type:String,default:"span"},placement:{type:String,default:D},autoPlacement:{type:Boolean,default:!0},appendTo:{type:String,default:"body"},transitionDuration:{type:Number,default:150},hideDelay:{type:Number,default:0},showDelay:{type:Number,default:0},enable:{type:Boolean,default:!0},enterable:{type:Boolean,default:!0},target:null,viewport:null},data:function(){return{triggerEl:null,hideTimeoutId:0,showTimeoutId:0,transitionTimeoutId:0}},watch:{value:function(t){t?this.show():this.hide()},trigger:function(){this.clearListeners(),this.initListeners()},target:function(t){this.clearListeners(),this.initTriggerElByTarget(t),this.initListeners()},allContent:function(t){var e=this;this.isNotEmpty()?this.$nextTick((function(){e.isShown()&&e.resetPosition()})):this.hide()},enable:function(t){t||this.hide()}},mounted:function(){var t=this;z(),H(this.$refs.popup),this.$nextTick((function(){t.initTriggerElByTarget(t.target),t.initListeners(),t.value&&t.show()}))},beforeDestroy:function(){this.clearListeners(),H(this.$refs.popup)},methods:{initTriggerElByTarget:function(t){if(t)c(t)?this.triggerEl=document.querySelector(t):U(t)?this.triggerEl=t:U(t.$el)&&(this.triggerEl=t.$el);else{var e=this.$el.querySelector('[data-role="trigger"]');if(e)this.triggerEl=e;else{var n=this.$el.firstChild;this.triggerEl=n===this.$refs.popup?null:n}}},initListeners:function(){this.triggerEl&&(this.trigger===E?(M(this.triggerEl,v,this.show),M(this.triggerEl,m,this.hide)):this.trigger===$?(M(this.triggerEl,g,this.show),M(this.triggerEl,y,this.hide)):this.trigger===S?(M(this.triggerEl,v,this.handleAuto),M(this.triggerEl,m,this.handleAuto),M(this.triggerEl,g,this.handleAuto),M(this.triggerEl,y,this.handleAuto)):this.trigger!==k&&this.trigger!==B||M(this.triggerEl,A,this.toggle)),M(window,A,this.windowClicked)},clearListeners:function(){this.triggerEl&&(F(this.triggerEl,g,this.show),F(this.triggerEl,y,this.hide),F(this.triggerEl,v,this.show),F(this.triggerEl,m,this.hide),F(this.triggerEl,A,this.toggle),F(this.triggerEl,v,this.handleAuto),F(this.triggerEl,m,this.handleAuto),F(this.triggerEl,g,this.handleAuto),F(this.triggerEl,y,this.handleAuto)),F(window,A,this.windowClicked)},resetPosition:function(){var t=this.$refs.popup;!function(t,e,n,r,i,s){var u=t&&t.className&&t.className.indexOf("popover")>=0,l=void 0,d=void 0;if(o(i)&&"body"!==i){var f=document.querySelector(i);d=f.scrollLeft,l=f.scrollTop}else{var p=document.documentElement;d=(window.pageXOffset||p.scrollLeft)-(p.clientLeft||0),l=(window.pageYOffset||p.scrollTop)-(p.clientTop||0)}if(r){var h=[O,I,N,D],v=function(e){h.forEach((function(e){W(t,e)})),q(t,e)};if(!Q(e,t,n)){for(var m=0,g=h.length;mE&&(_=E-A.height),b$&&(b=$-A.width),n===I?_-=C:n===N?b+=C:n===O?b-=C:_+=C}t.style.top=_+"px",t.style.left=b+"px"}(t,this.triggerEl,this.placement,this.autoPlacement,this.appendTo,this.viewport),t.offsetHeight},hideOnLeave:function(){(this.trigger===E||this.trigger===S&&!this.triggerEl.matches(":focus"))&&this.$hide()},toggle:function(){this.isShown()?this.hide():this.show()},show:function(){var t=this;if(this.enable&&this.triggerEl&&this.isNotEmpty()&&!this.isShown()){var e=this.$refs.popup,n=this.hideTimeoutId>0;n&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.transitionTimeoutId>0&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),this.showTimeoutId=setTimeout((function(){n||(e.className=t.name+" "+t.placement+" fade",document.querySelector(t.appendTo).appendChild(e),t.resetPosition());q(e,"in"),t.$emit("input",!0),t.$emit("show")}),this.showDelay)}},hide:function(){var t=this;this.showTimeoutId>0&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.isShown()&&(!this.enterable||this.trigger!==E&&this.trigger!==S?this.$hide():setTimeout((function(){t.$refs.popup.matches(":hover")||t.$hide()}),100))},$hide:function(){var t=this;this.isShown()&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0,W(t.$refs.popup,"in"),t.transitionTimeoutId=setTimeout((function(){t.transitionTimeoutId=0,H(t.$refs.popup),t.$emit("input",!1),t.$emit("hide")}),t.transitionDuration)}),this.hideDelay))},isShown:function(){return function(t,e){if(!U(t))return!1;for(var n=t.className.split(" "),r=0,i=n.length;r=1&&e<=12&&(this.meridian?this.hours=12===e?0:e:this.hours=12===e?12:e+12):e>=0&&e<=23&&(this.hours=e),this.setTime()}},minutesText:function(t){if(0!==this.minutes||""!==t){var e=parseInt(t);e>=0&&e<=59&&(this.minutes=e),this.setTime()}}},methods:{updateByValue:function(t){if(isNaN(t.getTime()))return this.hours=0,this.minutes=0,this.hoursText="",this.minutesText="",void(this.meridian=!0);this.hours=t.getHours(),this.minutes=t.getMinutes(),this.showMeridian?this.hours>=12?(12===this.hours?this.hoursText=this.hours+"":this.hoursText=gt(this.hours-12,2),this.meridian=!1):(0===this.hours?this.hoursText=12..toString():this.hoursText=gt(this.hours,2),this.meridian=!0):this.hoursText=gt(this.hours,2),this.minutesText=gt(this.minutes,2),this.$refs.hoursInput.value=this.hoursText,this.$refs.minutesInput.value=this.minutesText},addHour:function(t){t=t||this.hourStep,this.hours=this.hours>=23?0:this.hours+t},reduceHour:function(t){t=t||this.hourStep,this.hours=this.hours<=0?23:this.hours-t},addMinute:function(){this.minutes>=59?(this.minutes=0,this.addHour(1)):this.minutes+=this.minStep},reduceMinute:function(){this.minutes<=0?(this.minutes=60-this.minStep,this.reduceHour(1)):this.minutes-=this.minStep},changeTime:function(t,e){this.readonly||(t&&e?this.addHour():t&&!e?this.reduceHour():!t&&e?this.addMinute():this.reduceMinute(),this.setTime())},toggleMeridian:function(){this.meridian=!this.meridian,this.meridian?this.hours-=12:this.hours+=12,this.setTime()},onWheel:function(t,e){this.readonly||(t.preventDefault(),this.changeTime(e,t.deltaY<0))},setTime:function(){var t=this.value;if(isNaN(t.getTime())&&((t=new Date).setHours(0),t.setMinutes(0)),t.setHours(this.hours),t.setMinutes(this.minutes),this.max){var e=new Date(t);e.setHours(this.max.getHours()),e.setMinutes(this.max.getMinutes()),t=t>e?e:t}if(this.min){var n=new Date(t);n.setHours(this.min.getHours()),n.setMinutes(this.min.getMinutes()),t=t1&&void 0!==arguments[1]&&arguments[1];if(e)this.items=t.slice(0,this.limit);else{this.items=[],this.activeIndex=this.preselect?0:-1;for(var n=0,r=t.length;n=0)&&this.items.push(i),this.items.length>=this.limit)break}}},fetchItems:function(t,e){var n=this;if(clearTimeout(this.timeoutID),""!==t||this.openOnEmpty){if(this.data)this.prepareItems(this.data),this.open=this.hasEmptySlot()||Boolean(this.items.length);else if(this.asyncSrc)this.timeoutID=setTimeout((function(){var e,r,i,s;n.$emit("loading"),(e=n.asyncSrc+encodeURIComponent(t),r=new window.XMLHttpRequest,i={},s={then:function(t,e){return s.done(t).fail(e)},catch:function(t){return s.fail(t)},always:function(t){return s.done(t).fail(t)}},["done","fail"].forEach((function(t){i[t]=[],s[t]=function(e){return e instanceof Function&&i[t].push(e),s}})),s.done(JSON.parse),r.onreadystatechange=function(){if(4===r.readyState){var t={status:r.status};if(200===r.status){var e=r.responseText;for(var n in i.done)if(i.done.hasOwnProperty(n)&&a(i.done[n])){var s=i.done[n](e);o(s)&&(e=s)}}else i.fail.forEach((function(e){return e(t)}))}},r.open("GET",e),r.setRequestHeader("Accept","application/json"),r.send(),s).then((function(t){n.inputEl.matches(":focus")&&(n.prepareItems(n.asyncKey?t[n.asyncKey]:t,!0),n.open=n.hasEmptySlot()||Boolean(n.items.length)),n.$emit("loaded")})).catch((function(t){console.error(t),n.$emit("loaded-error")}))}),e);else if(this.asyncFunction){var r=function(t){n.inputEl.matches(":focus")&&(n.prepareItems(t,!0),n.open=n.hasEmptySlot()||Boolean(n.items.length)),n.$emit("loaded")};this.timeoutID=setTimeout((function(){n.$emit("loading"),n.asyncFunction(t,r)}),e)}}else this.open=!1},inputChanged:function(){var t=this.inputEl.value;this.fetchItems(t,this.debounce),this.$emit("input",this.forceSelect?void 0:t)},inputFocused:function(){if(this.openOnFocus){var t=this.inputEl.value;this.fetchItems(t,0)}},inputBlured:function(){var t=this;this.dropdownMenuEl.matches(":hover")||(this.open=!1),this.inputEl&&this.forceClear&&this.$nextTick((function(){void 0===t.value&&(t.inputEl.value="")}))},inputKeyPressed:function(t){if(t.stopPropagation(),this.open)switch(t.keyCode){case 13:this.activeIndex>=0?this.selectItem(this.items[this.activeIndex]):this.open=!1;break;case 27:this.open=!1;break;case 38:this.activeIndex=this.activeIndex>0?this.activeIndex-1:0;break;case 40:var e=this.items.length-1;this.activeIndex=this.activeIndex$&")}}},It={functional:!0,render:function(t,e){var n=e.props;return t("div",st(e.data,{class:it({"progress-bar":!0,"progress-bar-striped":n.striped,active:n.striped&&n.active},"progress-bar-"+n.type,Boolean(n.type)),style:{minWidth:n.minWidth?"2em":null,width:n.value+"%"},attrs:{role:"progressbar","aria-valuemin":0,"aria-valuenow":n.value,"aria-valuemax":100}}),n.label?n.labelText?n.labelText:n.value+"%":null)},props:{value:{type:Number,required:!0,validator:function(t){return t>=0&&t<=100}},labelText:String,type:String,label:{type:Boolean,default:!1},minWidth:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},active:{type:Boolean,default:!1}}},Nt={functional:!0,render:function(t,e){var n=e.props,r=e.data,i=e.children;return t("div",st(r,{class:"progress"}),i&&i.length?i:[t(It,{props:n})])}},jt={functional:!0,mixins:[ut],render:function(t,e){var n=e.props,r=e.data,i=e.children,o=void 0;return o=n.active?i:n.to?[t("router-link",{props:{to:n.to,replace:n.replace,append:n.append,exact:n.exact}},i)]:[t("a",{attrs:{href:n.href,target:n.target}},i)],t("li",st(r,{class:{active:n.active}}),o)},props:{active:{type:Boolean,default:!1}}},Pt={functional:!0,render:function(t,e){var n=e.props,r=e.data,i=e.children,o=[];return i&&i.length?o=i:n.items&&(o=n.items.map((function(e,r){return t(jt,{key:e.hasOwnProperty("key")?e.key:r,props:{active:e.hasOwnProperty("active")?e.active:r===n.items.length-1,href:e.href,target:e.target,to:e.to,replace:e.replace,append:e.append,exact:e.exact}},e.text)}))),t("ol",st(r,{class:"breadcrumb"}),o)},props:{items:Array}},Lt={functional:!0,render:function(t,e){var n=e.children;return t("div",st(e.data,{class:{"btn-toolbar":!0},attrs:{role:"toolbar"}}),n)}},Rt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("dropdown",{ref:"dropdown",style:t.containerStyles,attrs:{"not-close-elements":t.els,"append-to-body":t.appendToBody,disabled:t.disabled},nativeOn:{keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;t.showDropdown=!1}},model:{value:t.showDropdown,callback:function(e){t.showDropdown=e},expression:"showDropdown"}},[n("div",{staticClass:"form-control dropdown-toggle clearfix",class:t.selectClasses,attrs:{disabled:t.disabled,tabindex:"0","data-role":"trigger"},on:{focus:function(e){return t.$emit("focus",e)},blur:function(e){return t.$emit("blur",e)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}]}},[n("div",{class:t.selectTextClasses,staticStyle:{display:"inline-block","vertical-align":"middle"}},[t._v(t._s(t.selectedText))]),t._v(" "),n("div",{staticClass:"pull-right",staticStyle:{display:"inline-block","vertical-align":"middle"}},[n("span",[t._v(" ")]),t._v(" "),n("span",{staticClass:"caret"})])]),t._v(" "),n("template",{slot:"dropdown"},[t.filterable?n("li",{staticStyle:{padding:"4px 8px"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.filterInput,expression:"filterInput"}],ref:"filterInput",staticClass:"form-control input-sm",attrs:{"aria-label":"Filter...",type:"text",placeholder:t.filterPlaceholder||t.t("uiv.multiSelect.filterPlaceholder")},domProps:{value:t.filterInput},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}],input:function(e){e.target.composing||(t.filterInput=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.groupedOptions,(function(e){return[e.$group?n("li",{staticClass:"dropdown-header",domProps:{textContent:t._s(e.$group)}}):t._e(),t._v(" "),t._l(e.options,(function(e){return[n("li",{class:t.itemClasses(e),staticStyle:{outline:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.goNextOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.goPrevOption(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.selectOption(e))}],click:function(n){return n.stopPropagation(),t.toggle(e)},mouseenter:function(e){t.currentActive=-1}}},[t.isItemSelected(e)?n("a",{staticStyle:{outline:"0"},attrs:{role:"button"}},[n("b",[t._v(t._s(e[t.labelKey]))]),t._v(" "),t.selectedIcon?n("span",{class:t.selectedIconClasses}):t._e()]):n("a",{staticStyle:{outline:"0"},attrs:{role:"button"}},[n("span",[t._v(t._s(e[t.labelKey]))])])])]}))]}))],2)],2)},staticRenderFns:[],mixins:[at],components:{Dropdown:X},props:{value:{type:Array,required:!0},options:{type:Array,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},limit:{type:Number,default:0},size:String,placeholder:String,split:{type:String,default:", "},disabled:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},block:{type:Boolean,default:!1},collapseSelected:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterAutoFocus:{type:Boolean,default:!0},filterFunction:Function,filterPlaceholder:String,selectedIcon:{type:String,default:"glyphicon glyphicon-ok"},itemSelectedClass:String},data:function(){return{showDropdown:!1,els:[],filterInput:"",currentActive:-1}},computed:{containerStyles:function(){return{width:this.block?"100%":""}},filteredOptions:function(){var t=this;if(this.filterable&&this.filterInput){if(this.filterFunction)return this.filterFunction(this.filterInput);var e=this.filterInput.toLowerCase();return this.options.filter((function(n){return n[t.valueKey].toString().toLowerCase().indexOf(e)>=0||n[t.labelKey].toString().toLowerCase().indexOf(e)>=0}))}return this.options},groupedOptions:function(){var t=this;return this.filteredOptions.map((function(t){return t.group})).filter(p).map((function(e){return{options:t.filteredOptions.filter((function(t){return t.group===e})),$group:e}}))},flatternGroupedOptions:function(){if(this.groupedOptions&&this.groupedOptions.length){var t=[];return this.groupedOptions.forEach((function(e){t=t.concat(e.options)})),t}return[]},selectClasses:function(){return it({},"input-"+this.size,this.size)},selectedIconClasses:function(){var t;return it(t={},this.selectedIcon,!0),it(t,"pull-right",!0),t},selectTextClasses:function(){return{"text-muted":0===this.value.length}},labelValue:function(){var t=this,e=this.options.map((function(e){return e[t.valueKey]}));return this.value.map((function(n){var r=e.indexOf(n);return r>=0?t.options[r][t.labelKey]:n}))},selectedText:function(){if(this.value.length){var t=this.labelValue;if(this.collapseSelected){var e=t[0];return e+=t.length>1?this.split+"+"+(t.length-1):""}return t.join(this.split)}return this.placeholder||this.t("uiv.multiSelect.placeholder")}},watch:{showDropdown:function(t){var e=this;this.filterInput="",this.currentActive=-1,this.$emit("visible-change",t),t&&this.filterable&&this.filterAutoFocus&&this.$nextTick((function(){e.$refs.filterInput.focus()}))}},mounted:function(){this.els=[this.$el]},methods:{goPrevOption:function(){this.showDropdown&&(this.currentActive>0?this.currentActive--:this.currentActive=this.flatternGroupedOptions.length-1)},goNextOption:function(){this.showDropdown&&(this.currentActive=0&&t=0},toggle:function(t){if(!t.disabled){var e=t[this.valueKey],n=this.value.indexOf(e);if(1===this.limit){var r=n>=0?[]:[e];this.$emit("input",r),this.$emit("change",r)}else n>=0?(this.value.splice(n,1),this.$emit("change",this.value)):0===this.limit||this.value.length1&&void 0!==arguments[1]?arguments[1]:"body",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.el=t,this.opts=ot({},Xt.DEFAULTS,n),this.opts.target=e,this.scrollElement="body"===e?window:document.querySelector("[id="+e+"]"),this.selector="li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.scrollElement&&(this.refresh(),this.process())}Xt.DEFAULTS={offset:10,callback:function(t){return 0}},Xt.prototype.getScrollHeight=function(){return this.scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},Xt.prototype.refresh=function(){var t=this;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var e=f(this.el.querySelectorAll(this.selector)),n=this.scrollElement===window;e.map((function(e){var r=e.getAttribute("href");if(/^#./.test(r)){var i=document.documentElement,o=(n?document:t.scrollElement).querySelector("[id='"+r.slice(1)+"']"),a=(window.pageYOffset||i.scrollTop)-(i.clientTop||0);return[n?o.getBoundingClientRect().top+a:o.offsetTop+t.scrollElement.scrollTop,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t.offsets.push(e[0]),t.targets.push(e[1])}))},Xt.prototype.process=function(){var t=this.scrollElement===window,e=(t?window.pageYOffset:this.scrollElement.scrollTop)+this.opts.offset,n=this.getScrollHeight(),r=t?P().height:this.scrollElement.getBoundingClientRect().height,i=this.opts.offset+n-r,o=this.offsets,a=this.targets,s=this.activeTarget,c=void 0;if(this.scrollHeight!==n&&this.refresh(),e>=i)return s!==(c=a[a.length-1])&&this.activate(c);if(s&&e=o[c]&&(void 0===o[c+1]||e-1:t.input},on:{change:[function(e){var n=t.input,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.input=n.concat([null])):o>-1&&(t.input=n.slice(0,o).concat(n.slice(o+1)))}else t.input=i},function(e){t.dirty=!0}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)}}}):"radio"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.input,expression:"input"}],ref:"input",staticClass:"form-control",attrs:{required:"","data-action":"auto-focus",type:"radio"},domProps:{checked:t._q(t.input,null)},on:{change:[function(e){t.input=null},function(e){t.dirty=!0}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.input,expression:"input"}],ref:"input",staticClass:"form-control",attrs:{required:"","data-action":"auto-focus",type:t.inputType},domProps:{value:t.input},on:{change:function(e){t.dirty=!0},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.validate(e)},input:function(e){e.target.composing||(t.input=e.target.value)}}}),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.inputNotValid,expression:"inputNotValid"}],staticClass:"help-block"},[t._v(t._s(t.inputError))])])]):t._e(),t._v(" "),t.type===t.TYPES.ALERT?n("template",{slot:"footer"},[n("btn",{attrs:{type:t.okType,"data-action":"ok"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.okBtnText)},on:{click:function(e){return t.toggle(!1,"ok")}}})],1):n("template",{slot:"footer"},[n("btn",{attrs:{type:t.cancelType,"data-action":"cancel"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.cancelBtnText)},on:{click:function(e){return t.toggle(!1,"cancel")}}}),t._v(" "),t.type===t.TYPES.CONFIRM?n("btn",{attrs:{type:t.okType,"data-action":"ok"===t.autoFocus?"auto-focus":""},domProps:{textContent:t._s(t.okBtnText)},on:{click:function(e){return t.toggle(!1,"ok")}}}):n("btn",{attrs:{type:t.okType},domProps:{textContent:t._s(t.okBtnText)},on:{click:t.validate}})],1)],2)},staticRenderFns:[],mixins:[at],components:{Modal:ht,Btn:dt},props:{backdrop:null,title:String,content:String,html:{type:Boolean,default:!1},okText:String,okType:{type:String,default:"primary"},cancelText:String,cancelType:{type:String,default:"default"},type:{type:Number,default:se.ALERT},size:{type:String,default:"sm"},cb:{type:Function,required:!0},validator:{type:Function,default:function(){return null}},customClass:null,defaultValue:String,inputType:{type:String,default:"text"},autoFocus:{type:String,default:"ok"}},data:function(){return{TYPES:se,show:!1,input:"",dirty:!1}},mounted:function(){this.defaultValue&&(this.input=this.defaultValue)},computed:{closeOnBackdropClick:function(){return o(this.backdrop)?Boolean(this.backdrop):this.type!==se.ALERT},inputError:function(){return this.validator(this.input)},inputNotValid:function(){return this.dirty&&this.inputError},okBtnText:function(){return this.okText||this.t("uiv.modal.ok")},cancelBtnText:function(){return this.cancelText||this.t("uiv.modal.cancel")}},methods:{toggle:function(t,e){this.$refs.modal.toggle(t,e)},validate:function(){this.dirty=!0,o(this.inputError)||this.toggle(!1,{value:this.input})}}},ue=[],le=function(t){H(t.$el),t.$destroy(),d(ue,t)},de=function(t,e){return t===se.CONFIRM?"ok"===e:o(e)&&c(e.value)},fe=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=this.$i18n,c=new i.a({extends:ce,i18n:s,propsData:ot({type:t},e,{cb:function(e){le(c),a(n)?t===se.CONFIRM?de(t,e)?n(null,e):n(e):t===se.PROMPT&&de(t,e)?n(null,e.value):n(e):r&&o&&(t===se.CONFIRM?de(t,e)?r(e):o(e):t===se.PROMPT?de(t,e)?r(e.value):o(e):r(e))}})});c.$mount(),document.body.appendChild(c.$el),c.show=!0,ue.push(c)},pe=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];if(u())return new Promise((function(i,o){fe.apply(e,[t,n,r,i,o])}));fe.apply(this,[t,n,r])},he={alert:function(t,e){return pe.apply(this,[se.ALERT,t,e])},confirm:function(t,e){return pe.apply(this,[se.CONFIRM,t,e])},prompt:function(t,e){return pe.apply(this,[se.PROMPT,t,e])}},ve="success",me="info",ge="danger",ye="warning",Ae="top-left",_e="top-right",be="bottom-left",we="bottom-right",Ce="glyphicon",xe={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("alert",{staticClass:"fade",class:t.customClass,style:t.styles,attrs:{type:t.type,duration:t.duration,dismissible:t.dismissible},on:{dismissed:t.onDismissed}},[n("div",{staticClass:"media",staticStyle:{margin:"0"}},[t.icons?n("div",{staticClass:"media-left"},[n("span",{class:t.icons,staticStyle:{"font-size":"1.5em"}})]):t._e(),t._v(" "),n("div",{staticClass:"media-body"},[t.title?n("div",{staticClass:"media-heading"},[n("b",[t._v(t._s(t.title))])]):t._e(),t._v(" "),t.html?n("div",{domProps:{innerHTML:t._s(t.content)}}):n("div",[t._v(t._s(t.content))])])])])},staticRenderFns:[],components:{Alert:kt},props:{title:String,content:String,html:{type:Boolean,default:!1},duration:{type:Number,default:5e3},dismissible:{type:Boolean,default:!0},type:String,placement:String,icon:String,customClass:null,cb:{type:Function,required:!0},queue:{type:Array,required:!0},offsetY:{type:Number,default:15},offsetX:{type:Number,default:15},offset:{type:Number,default:15}},data:function(){return{height:0,top:0,horizontal:this.placement===Ae||this.placement===be?"left":"right",vertical:this.placement===Ae||this.placement===_e?"top":"bottom"}},created:function(){this.top=this.getTotalHeightOfQueue(this.queue)},mounted:function(){var t=this,e=this.$el;e.style[this.vertical]=this.top+"px",this.$nextTick((function(){e.style[t.horizontal]="-300px",t.height=e.offsetHeight,e.style[t.horizontal]=t.offsetX+"px",q(e,"in")}))},computed:{styles:function(){var t,e=this.queue,n=e.indexOf(this);return it(t={position:"fixed"},this.vertical,this.getTotalHeightOfQueue(e,n)+"px"),it(t,"width","300px"),it(t,"transition","all 0.3s ease-in-out"),t},icons:function(){if(c(this.icon))return this.icon;switch(this.type){case me:case ye:return Ce+" "+Ce+"-info-sign";case ve:return Ce+" "+Ce+"-ok-sign";case ge:return Ce+" "+Ce+"-remove-sign";default:return null}}},methods:{getTotalHeightOfQueue:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,n=this.offsetY,r=0;r2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=t.placement,c=Te[s];if(o(c)){var u=new i.a({extends:xe,propsData:ot({queue:c,placement:s},t,{cb:function(t){ke(c,u),a(e)?e(t):n&&r&&n(t)}})});u.$mount(),document.body.appendChild(u.$el),c.push(u)}},$e={notify:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(c(t)&&(t={content:t}),o(t.placement)||(t.placement=_e),u())return new Promise((function(n,r){Ee(t,e,n,r)}));Ee(t,e)}},Se=Object.freeze({MessageBox:he,Notification:$e}),Be=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};nt(e.locale),rt(e.i18n),Object.keys(zt).forEach((function(n){var r=e.prefix?e.prefix+n:n;t.component(r,zt[n])})),Object.keys(ae).forEach((function(n){var r=e.prefix?e.prefix+"-"+n:n;t.directive(r,ae[n])})),Object.keys(Se).forEach((function(n){var r=Se[n];Object.keys(r).forEach((function(n){var i=e.prefix?e.prefix+"_"+n:n;t.prototype["$"+i]=r[n]}))}))}},function(t,e,n){"use strict";var r={name:"CustomAttachments",props:{title:String,name:String,error:Array},methods:{hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{staticClass:"form-control",attrs:{multiple:"multiple",autocomplete:"off",placeholder:t.title,title:t.title,name:t.name,type:"file"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"73840c18",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CreateTransaction",components:{},mounted:function(){this.addTransactionToArray()},ready:function(){},methods:{convertData:function(){var t,e,n,r={transactions:[]};for(var i in this.transactions.length>1&&(r.group_title=this.group_title),t=this.transactionType?this.transactionType.toLowerCase():"invalid",e=this.transactions[0].source_account.type,n=this.transactions[0].destination_account.type,"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)&&(t="withdrawal"),"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(n)&&(t="deposit"),this.transactions)this.transactions.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&r.transactions.push(this.convertDataRow(this.transactions[i],i,t));return r},convertDataRow:function(t,e,n){var r,i,o,a,s,c,u=[],l=null,d=null;for(var f in i=t.source_account.id,o=t.source_account.name,a=t.destination_account.id,s=t.destination_account.name,c=t.date,e>0&&(c=this.transactions[0].date),"withdrawal"===n&&""===s&&(a=window.cashAccountId),"deposit"===n&&""===o&&(i=window.cashAccountId),e>0&&("withdrawal"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(i=this.transactions[0].source_account.id,o=this.transactions[0].source_account.name),e>0&&("deposit"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(a=this.transactions[0].destination_account.id,s=this.transactions[0].destination_account.name),u=[],l=null,d=null,t.tags)t.tags.hasOwnProperty(f)&&/^0$|^[1-9]\d*$/.test(f)&&f<=4294967294&&u.push(t.tags[f].text);return""!==t.foreign_amount.amount&&0!==parseFloat(t.foreign_amount.amount)&&(l=t.foreign_amount.amount,d=t.foreign_amount.currency_id),d===t.currency_id&&(l=null,d=null),0===a&&(a=null),0===i&&(i=null),r={type:n,date:c,amount:t.amount,currency_id:t.currency_id,description:t.description,source_id:i,source_name:o,destination_id:a,destination_name:s,category_name:t.category,interest_date:t.custom_fields.interest_date,book_date:t.custom_fields.book_date,process_date:t.custom_fields.process_date,due_date:t.custom_fields.due_date,payment_date:t.custom_fields.payment_date,invoice_date:t.custom_fields.invoice_date,internal_reference:t.custom_fields.internal_reference,notes:t.custom_fields.notes},u.length>0&&(r.tags=u),null!==l&&(r.foreign_amount=l,r.foreign_currency_id=d),parseInt(t.budget)>0&&(r.budget_id=parseInt(t.budget)),parseInt(t.piggy_bank)>0&&(r.piggy_bank_id=parseInt(t.piggy_bank)),r},submit:function(t){var e=this,n="./api/v1/transactions?_token="+document.head.querySelector('meta[name="csrf-token"]').content,r=this.convertData(),i=$(t.currentTarget);i.prop("disabled",!0),axios.post(n,r).then((function(t){0===e.collectAttachmentData(t)&&e.redirectUser(t.data.data.id,i,t.data.data)})).catch((function(t){console.error("Error in transaction submission."),console.error(t),e.parseErrors(t.response.data),i.prop("disabled",!1)})),t&&t.preventDefault()},escapeHTML:function(t){var e=document.createElement("div");return e.innerText=t,e.innerHTML},redirectUser:function(t,e,n){var r=this,i=null===n.attributes.group_title?n.attributes.transactions[0].description:n.attributes.group_title;this.createAnother?(this.success_message='Transaction #'+t+' ("'+this.escapeHTML(i)+'") has been stored.',this.error_message="",this.resetFormAfter&&(this.resetTransactions(),setTimeout((function(){return r.addTransactionToArray()}),50)),this.setDefaultErrors(),e&&e.prop("disabled",!1)):window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=created"},collectAttachmentData:function(t){var e=this,n=t.data.data.id,r=[],i=[],o=$('input[name="attachments[]"]');for(var a in o)if(o.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294)for(var s in o[a].files)o[a].files.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&r.push({journal:t.data.data.attributes.transactions[a].transaction_journal_id,file:o[a].files[s]});var c=r.length,u=function(o){var a,s,u;r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&(a=r[o],s=e,(u=new FileReader).onloadend=function(e){e.target.readyState===FileReader.DONE&&(i.push({name:r[o].file.name,journal:r[o].journal,content:new Blob([e.target.result])}),i.length===c&&s.uploadFiles(i,n,t.data.data))},u.readAsArrayBuffer(a.file))};for(var l in r)u(l);return c},uploadFiles:function(t,e,n){var r=this,i=t.length,o=0,a=function(a){if(t.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var s={filename:t[a].name,attachable_type:"TransactionJournal",attachable_id:t[a].journal};axios.post("./api/v1/attachments",s).then((function(s){var c="./api/v1/attachments/"+s.data.data.id+"/upload";axios.post(c,t[a].content).then((function(t){return++o===i&&r.redirectUser(e,null,n),!0})).catch((function(t){return console.error("Could not upload"),console.error(t),++o===i&&r.redirectUser(e,null,n),!1}))}))}};for(var s in t)a(s)},setDefaultErrors:function(){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(this.transactions[t].errors={source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}})},parseErrors:function(t){var e,n;for(var r in this.setDefaultErrors(),this.error_message="",t.message.length>0?this.error_message=this.$t("firefly.errors_submission"):this.error_message="",t.errors)if(t.errors.hasOwnProperty(r)){if("group_title"===r&&(this.group_title_errors=t.errors[r]),"group_title"!==r)switch(e=parseInt(r.split(".")[1]),n=r.split(".")[2]){case"amount":case"date":case"budget_id":case"description":case"tags":this.transactions[e].errors[n]=t.errors[r];break;case"source_name":case"source_id":this.transactions[e].errors.source_account=this.transactions[e].errors.source_account.concat(t.errors[r]);break;case"destination_name":case"destination_id":this.transactions[e].errors.destination_account=this.transactions[e].errors.destination_account.concat(t.errors[r]);break;case"foreign_amount":case"foreign_currency_id":this.transactions[e].errors.foreign_amount=this.transactions[e].errors.foreign_amount.concat(t.errors[r])}void 0!==this.transactions[e]&&(this.transactions[e].errors.source_account=Array.from(new Set(this.transactions[e].errors.source_account)),this.transactions[e].errors.destination_account=Array.from(new Set(this.transactions[e].errors.destination_account)))}},resetTransactions:function(){this.transactions=[]},addTransactionToArray:function(t){if(this.transactions.push({description:"",date:"",amount:"",category:"",piggy_bank:0,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:0,tags:[],custom_fields:{interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",internal_reference:"",notes:"",attachments:[]},foreign_amount:{amount:"",currency_id:0},source_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:["Asset account","Revenue account","Loan","Debt","Mortgage"],default_allowed_types:["Asset account","Revenue account","Loan","Debt","Mortgage"]},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:["Asset account","Expense account","Loan","Debt","Mortgage"],default_allowed_types:["Asset account","Expense account","Loan","Debt","Mortgage"]}}),1===this.transactions.length){var e=new Date;this.transactions[0].date=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)}t&&t.preventDefault()},setTransactionType:function(t){this.transactionType=t},deleteTransaction:function(t,e){for(var n in e.preventDefault(),this.transactions)this.transactions.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n);for(var r in this.transactions.splice(t,1),this.transactions)this.transactions.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)},limitSourceType:function(t){var e;for(e=0;e1?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("group-description",{attrs:{error:t.group_title_errors},model:{value:t.group_title,callback:function(e){t.group_title=e},expression:"group_title"}})],1)])])]):t._e(),t._v(" "),n("div",t._l(t.transactions,(function(e,r){return n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title splitTitle"},[t.transactions.length>1?n("span",[t._v(t._s(t.$t("firefly.split"))+" "+t._s(r+1)+" / "+t._s(t.transactions.length))]):t._e(),t._v(" "),1===t.transactions.length?n("span",[t._v(t._s(t.$t("firefly.transaction_journal_information")))]):t._e()]),t._v(" "),t.transactions.length>1?n("div",{staticClass:"box-tools pull-right",attrs:{x:""}},[n("button",{staticClass:"btn btn-xs btn-danger",attrs:{type:"button"},on:{click:function(e){return t.deleteTransaction(r,e)}}},[n("i",{staticClass:"fa fa-trash"})])]):t._e()]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-4"},[n("transaction-description",{attrs:{index:r,error:e.errors.description},model:{value:e.description,callback:function(n){t.$set(e,"description",n)},expression:"transaction.description"}}),t._v(" "),n("account-select",{attrs:{inputName:"source[]",title:t.$t("firefly.source_account"),accountName:e.source_account.name,accountTypeFilters:e.source_account.allowed_types,defaultAccountTypeFilters:e.source_account.default_allowed_types,transactionType:t.transactionType,index:r,error:e.errors.source_account},on:{"clear:value":function(e){return t.clearSource(r)},"select:account":function(e){return t.selectedSourceAccount(r,e)}}}),t._v(" "),n("account-select",{attrs:{inputName:"destination[]",title:t.$t("firefly.destination_account"),accountName:e.destination_account.name,accountTypeFilters:e.destination_account.allowed_types,defaultAccountTypeFilters:e.destination_account.default_allowed_types,transactionType:t.transactionType,index:r,error:e.errors.destination_account},on:{"clear:value":function(e){return t.clearDestination(r)},"select:account":function(e){return t.selectedDestinationAccount(r,e)}}}),t._v(" "),n("standard-date",{attrs:{index:r,error:e.errors.date},model:{value:e.date,callback:function(n){t.$set(e,"date",n)},expression:"transaction.date"}}),t._v(" "),0===r?n("div",[n("transaction-type",{attrs:{source:e.source_account.type,destination:e.destination_account.type},on:{"set:transactionType":function(e){return t.setTransactionType(e)},"act:limitSourceType":function(e){return t.limitSourceType(e)},"act:limitDestinationType":function(e){return t.limitDestinationType(e)}}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("amount",{attrs:{source:e.source_account,destination:e.destination_account,error:e.errors.amount,transactionType:t.transactionType},model:{value:e.amount,callback:function(n){t.$set(e,"amount",n)},expression:"transaction.amount"}}),t._v(" "),n("foreign-amount",{attrs:{source:e.source_account,destination:e.destination_account,transactionType:t.transactionType,error:e.errors.foreign_amount,title:t.$t("form.foreign_amount")},model:{value:e.foreign_amount,callback:function(n){t.$set(e,"foreign_amount",n)},expression:"transaction.foreign_amount"}})],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("budget",{attrs:{transactionType:t.transactionType,error:e.errors.budget_id,no_budget:t.$t("firefly.none_in_select_list")},model:{value:e.budget,callback:function(n){t.$set(e,"budget",n)},expression:"transaction.budget"}}),t._v(" "),n("category",{attrs:{transactionType:t.transactionType,error:e.errors.category},model:{value:e.category,callback:function(n){t.$set(e,"category",n)},expression:"transaction.category"}}),t._v(" "),n("piggy-bank",{attrs:{transactionType:t.transactionType,error:e.errors.piggy_bank,no_piggy_bank:t.$t("firefly.no_piggy_bank")},model:{value:e.piggy_bank,callback:function(n){t.$set(e,"piggy_bank",n)},expression:"transaction.piggy_bank"}}),t._v(" "),n("tags",{attrs:{error:e.errors.tags},model:{value:e.tags,callback:function(n){t.$set(e,"tags",n)},expression:"transaction.tags"}}),t._v(" "),n("custom-transaction-fields",{attrs:{error:e.errors.custom_errors},model:{value:e.custom_fields,callback:function(n){t.$set(e,"custom_fields",n)},expression:"transaction.custom_fields"}})],1)])]),t._v(" "),t.transactions.length-1===r?n("div",{staticClass:"box-footer"},[n("button",{staticClass:"split_add_btn btn btn-default",attrs:{type:"button"},on:{click:t.addTransactionToArray}},[t._v(t._s(t.$t("firefly.add_another_split")))])]):t._e()])])])})),0),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-3 col-md-4 col-sm-6 col-xs-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.submission"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createAnother,expression:"createAnother"}],attrs:{name:"create_another",type:"checkbox"},domProps:{checked:Array.isArray(t.createAnother)?t._i(t.createAnother,null)>-1:t.createAnother},on:{change:function(e){var n=t.createAnother,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.createAnother=n.concat([null])):o>-1&&(t.createAnother=n.slice(0,o).concat(n.slice(o+1)))}else t.createAnother=i}}}),t._v("\n "+t._s(t.$t("firefly.create_another"))+"\n ")]),t._v(" "),n("label",{class:{"text-muted":!1===this.createAnother}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.resetFormAfter,expression:"resetFormAfter"}],attrs:{disabled:!1===this.createAnother,name:"reset_form",type:"checkbox"},domProps:{checked:Array.isArray(t.resetFormAfter)?t._i(t.resetFormAfter,null)>-1:t.resetFormAfter},on:{change:function(e){var n=t.resetFormAfter,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.resetFormAfter=n.concat([null])):o>-1&&(t.resetFormAfter=n.slice(0,o).concat(n.slice(o+1)))}else t.resetFormAfter=i}}}),t._v("\n "+t._s(t.$t("firefly.reset_after"))+"\n\n ")])])]),t._v(" "),n("div",{staticClass:"box-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-success",attrs:{id:"submitButton"},on:{click:t.submit}},[t._v(t._s(t.$t("firefly.submit")))])])])])])])])}),[],!1,null,"0633d588",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"EditTransaction",props:{groupId:Number},mounted:function(){this.getGroup()},ready:function(){},methods:{positiveAmount:function(t){return t<0?-1*t:t},roundNumber:function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},selectedSourceAccount:function(t,e){if("string"==typeof e)return this.transactions[t].source_account.id=null,void(this.transactions[t].source_account.name=e);this.transactions[t].source_account={id:e.id,name:e.name,type:e.type,currency_id:e.currency_id,currency_name:e.currency_name,currency_code:e.currency_code,currency_decimal_places:e.currency_decimal_places,allowed_types:this.transactions[t].source_account.allowed_types}},selectedDestinationAccount:function(t,e){if("string"==typeof e)return this.transactions[t].destination_account.id=null,void(this.transactions[t].destination_account.name=e);this.transactions[t].destination_account={id:e.id,name:e.name,type:e.type,currency_id:e.currency_id,currency_name:e.currency_name,currency_code:e.currency_code,currency_decimal_places:e.currency_decimal_places,allowed_types:this.transactions[t].destination_account.allowed_types}},clearSource:function(t){this.transactions[t].source_account={id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:this.transactions[t].source_account.allowed_types},this.transactions[t].destination_account&&this.selectedDestinationAccount(t,this.transactions[t].destination_account)},setTransactionType:function(t){null!==t&&(this.transactionType=t)},deleteTransaction:function(t,e){for(var n in e.preventDefault(),this.transactions)this.transactions.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n);for(var r in this.transactions.splice(t,1),this.transactions)this.transactions.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)},clearDestination:function(t){this.transactions[t].destination_account={id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:this.transactions[t].destination_account.allowed_types},this.transactions[t].source_account&&this.selectedSourceAccount(t,this.transactions[t].source_account)},getGroup:function(){var t=this,e=window.location.href.split("/"),n="./api/v1/transactions/"+e[e.length-1]+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content;axios.get(n).then((function(e){t.processIncomingGroup(e.data.data)})).catch((function(t){}))},processIncomingGroup:function(t){this.group_title=t.attributes.group_title;var e=t.attributes.transactions.reverse();for(var n in e)if(e.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var r=e[n];this.processIncomingGroupRow(r)}},processIncomingGroupRow:function(t){this.setTransactionType(t.type);var e=[];for(var n in t.tags)t.tags.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&e.push({text:t.tags[n],tiClasses:[]});this.transactions.push({transaction_journal_id:t.transaction_journal_id,description:t.description,date:t.date.substr(0,10),amount:this.roundNumber(this.positiveAmount(t.amount),t.currency_decimal_places),category:t.category_name,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:t.budget_id,tags:e,custom_fields:{interest_date:t.interest_date,book_date:t.book_date,process_date:t.process_date,due_date:t.due_date,payment_date:t.payment_date,invoice_date:t.invoice_date,internal_reference:t.internal_reference,notes:t.notes},foreign_amount:{amount:this.roundNumber(this.positiveAmount(t.foreign_amount),t.foreign_currency_decimal_places),currency_id:t.foreign_currency_id},source_account:{id:t.source_id,name:t.source_name,type:t.source_type,currency_id:t.currency_id,currency_name:t.currency_name,currency_code:t.currency_code,currency_decimal_places:t.currency_decimal_places,allowed_types:[t.source_type]},destination_account:{id:t.destination_id,name:t.destination_name,type:t.destination_type,currency_id:t.currency_id,currency_name:t.currency_name,currency_code:t.currency_code,currency_decimal_places:t.currency_decimal_places,allowed_types:[t.destination_type]}})},convertData:function(){var t,e,n,r={transactions:[]};for(var i in this.transactions.length>1&&(r.group_title=this.group_title),t=this.transactionType?this.transactionType.toLowerCase():"invalid",e=this.transactions[0].source_account.type,n=this.transactions[0].destination_account.type,"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)&&(t="withdrawal"),"invalid"===t&&["Asset account","Loan","Debt","Mortgage"].includes(n)&&(t="deposit"),this.transactions)this.transactions.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&r.transactions.push(this.convertDataRow(this.transactions[i],i,t));return r},convertDataRow:function(t,e,n){var r,i,o,a,s,c,u=[],l=null,d=null;for(var f in i=t.source_account.id,o=t.source_account.name,a=t.destination_account.id,s=t.destination_account.name,c=t.date,e>0&&(c=this.transactions[0].date),"withdrawal"===n&&""===s&&(a=window.cashAccountId),"deposit"===n&&""===o&&(i=window.cashAccountId),e>0&&("withdrawal"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(i=this.transactions[0].source_account.id,o=this.transactions[0].source_account.name),e>0&&("deposit"===n.toLowerCase()||"transfer"===n.toLowerCase())&&(a=this.transactions[0].destination_account.id,s=this.transactions[0].destination_account.name),u=[],l=null,d=null,t.tags)t.tags.hasOwnProperty(f)&&/^0$|^[1-9]\d*$/.test(f)&&f<=4294967294&&u.push(t.tags[f].text);return""!==t.foreign_amount.amount&&0!==parseFloat(t.foreign_amount.amount)&&(l=t.foreign_amount.amount,d=t.foreign_amount.currency_id),d===t.currency_id&&(l=null,d=null),0===a&&(a=null),0===i&&(i=null),r={transaction_journal_id:t.transaction_journal_id,type:n,date:c,amount:t.amount,currency_id:t.currency_id,description:t.description,source_id:i,source_name:o,destination_id:a,destination_name:s,category_name:t.category,interest_date:t.custom_fields.interest_date,book_date:t.custom_fields.book_date,process_date:t.custom_fields.process_date,due_date:t.custom_fields.due_date,payment_date:t.custom_fields.payment_date,invoice_date:t.custom_fields.invoice_date,internal_reference:t.custom_fields.internal_reference,notes:t.custom_fields.notes,tags:u},null!==l&&(r.foreign_amount=l,r.foreign_currency_id=d),r.budget_id=parseInt(t.budget),parseInt(t.piggy_bank)>0&&(r.piggy_bank_id=parseInt(t.piggy_bank)),r},submit:function(t){var e=this,n=window.location.href.split("/"),r="./api/v1/transactions/"+n[n.length-1]+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content,i="PUT";this.storeAsNew&&(r="./api/v1/transactions?_token="+document.head.querySelector('meta[name="csrf-token"]').content,i="POST");var o=this.convertData(),a=$(t.currentTarget);a.prop("disabled",!0),axios({method:i,url:r,data:o}).then((function(t){0===e.collectAttachmentData(t)&&e.redirectUser(t.data.data.id)})).catch((function(t){e.parseErrors(t.response.data)})),t&&t.preventDefault(),a.prop("disabled",!1)},redirectUser:function(t){this.returnAfter?(this.setDefaultErrors(),this.storeAsNew?(this.success_message='Transaction #'+t+" has been created.",this.error_message=""):(this.success_message='The transaction has been updated.',this.error_message="")):this.storeAsNew?window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=created":window.location.href=window.previousUri+"?transaction_group_id="+t+"&message=updated"},collectAttachmentData:function(t){var e=this,n=t.data.data.id,r=[],i=[],o=$('input[name="attachments[]"]');for(var a in o)if(o.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294)for(var s in o[a].files)if(o[a].files.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var c=t.data.data.attributes.transactions.reverse();r.push({journal:c[a].transaction_journal_id,file:o[a].files[s]})}var u=r.length,l=function(t){var o,a,s;r.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(o=r[t],a=e,(s=new FileReader).onloadend=function(e){e.target.readyState===FileReader.DONE&&(i.push({name:r[t].file.name,journal:r[t].journal,content:new Blob([e.target.result])}),i.length===u&&a.uploadFiles(i,n))},s.readAsArrayBuffer(o.file))};for(var d in r)l(d);return u},uploadFiles:function(t,e){var n=this,r=t.length,i=0,o=function(o){if(t.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294){var a={filename:t[o].name,attachable_type:"TransactionJournal",attachable_id:t[o].journal};axios.post("./api/v1/attachments",a).then((function(a){var s="./api/v1/attachments/"+a.data.data.id+"/upload";axios.post(s,t[o].content).then((function(t){return++i===r&&n.redirectUser(e,null),!0})).catch((function(t){return console.error("Could not upload file."),console.error(t),i++,n.error_message="Could not upload attachment: "+t,i===r&&n.redirectUser(e,null),!1}))}))}};for(var a in t)o(a)},addTransaction:function(t){this.transactions.push({transaction_journal_id:0,description:"",date:"",amount:"",category:"",piggy_bank:0,errors:{source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}},budget:0,tags:[],custom_fields:{interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",internal_reference:"",notes:"",attachments:[]},foreign_amount:{amount:"",currency_id:0},source_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:[]},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2,allowed_types:[]}}),t&&t.preventDefault()},parseErrors:function(t){var e,n;for(var r in this.setDefaultErrors(),this.error_message="",t.message.length>0?this.error_message=this.$t("firefly.errors_submission"):this.error_message="",t.errors)if(t.errors.hasOwnProperty(r)&&("group_title"===r&&(this.group_title_errors=t.errors[r]),"group_title"!==r)){switch(e=parseInt(r.split(".")[1]),n=r.split(".")[2]){case"amount":case"date":case"budget_id":case"description":case"tags":this.transactions[e].errors[n]=t.errors[r];break;case"source_name":case"source_id":this.transactions[e].errors.source_account=this.transactions[e].errors.source_account.concat(t.errors[r]);break;case"destination_name":case"destination_id":this.transactions[e].errors.destination_account=this.transactions[e].errors.destination_account.concat(t.errors[r]);break;case"foreign_amount":case"foreign_currency_id":this.transactions[e].errors.foreign_amount=this.transactions[e].errors.foreign_amount.concat(t.errors[r])}this.transactions[e].errors.source_account=Array.from(new Set(this.transactions[e].errors.source_account)),this.transactions[e].errors.destination_account=Array.from(new Set(this.transactions[e].errors.destination_account))}},setDefaultErrors:function(){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&(this.transactions[t].errors={source_account:[],destination_account:[],description:[],amount:[],date:[],budget_id:[],foreign_amount:[],category:[],piggy_bank:[],tags:[],custom_errors:{interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[],internal_reference:[],notes:[],attachments:[]}})}},data:function(){return{group:this.groupId,error_message:"",success_message:"",transactions:[],group_title:"",returnAfter:!1,storeAsNew:!1,transactionType:null,group_title_errors:[],resetButtonDisabled:!0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{staticClass:"form-horizontal",attrs:{method:"POST",action:"#","accept-charset":"UTF-8",id:"store",enctype:"multipart/form-data"}},[n("input",{attrs:{name:"_token",type:"hidden",value:"xxx"}}),t._v(" "),""!==t.error_message?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"alert alert-danger alert-dismissible",attrs:{role:"alert"}},[n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":t.$t("firefly.close")}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),n("strong",[t._v(t._s(t.$t("firefly.flash_error")))]),t._v(" "+t._s(t.error_message)+"\n ")])])]):t._e(),t._v(" "),""!==t.success_message?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"alert alert-success alert-dismissible",attrs:{role:"alert"}},[n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":t.$t("firefly.close")}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),n("strong",[t._v(t._s(t.$t("firefly.flash_success")))]),t._v(" "),n("span",{domProps:{innerHTML:t._s(t.success_message)}})])])]):t._e(),t._v(" "),t.transactions.length>1?n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("group-description",{attrs:{error:t.group_title_errors},model:{value:t.group_title,callback:function(e){t.group_title=e},expression:"group_title"}})],1)])])]):t._e(),t._v(" "),n("div",t._l(t.transactions,(function(e,r){return n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title splitTitle"},[t.transactions.length>1?n("span",[t._v(t._s(t.$t("firefly.split"))+" "+t._s(r+1)+" / "+t._s(t.transactions.length))]):t._e(),t._v(" "),1===t.transactions.length?n("span",[t._v(t._s(t.$t("firefly.transaction_journal_information")))]):t._e()]),t._v(" "),t.transactions.length>1?n("div",{staticClass:"box-tools pull-right",attrs:{x:""}},[n("button",{staticClass:"btn btn-xs btn-danger",attrs:{type:"button"},on:{click:function(e){return t.deleteTransaction(r,e)}}},[n("i",{staticClass:"fa fa-trash"})])]):t._e()]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-4"},["reconciliation"!==t.transactionType.toLowerCase()?n("transaction-description",{attrs:{index:r,error:e.errors.description},model:{value:e.description,callback:function(n){t.$set(e,"description",n)},expression:"transaction.description"}}):t._e(),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("account-select",{attrs:{inputName:"source[]",title:t.$t("firefly.source_account"),accountName:e.source_account.name,accountTypeFilters:e.source_account.allowed_types,transactionType:t.transactionType,index:r,error:e.errors.source_account},on:{"clear:value":function(e){return t.clearSource(r)},"select:account":function(e){return t.selectedSourceAccount(r,e)}}}):t._e(),t._v(" "),"reconciliation"===t.transactionType.toLowerCase()?n("div",{staticClass:"form-group"},[n("div",{staticClass:"col-sm-12"},[n("p",{staticClass:"form-control-static",attrs:{id:"ffInput_source"}},[n("em",[t._v("\n "+t._s(t.$t("firefly.source_account_reconciliation"))+"\n ")])])])]):t._e(),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("account-select",{attrs:{inputName:"destination[]",title:t.$t("firefly.destination_account"),accountName:e.destination_account.name,accountTypeFilters:e.destination_account.allowed_types,transactionType:t.transactionType,index:r,error:e.errors.destination_account},on:{"clear:value":function(e){return t.clearDestination(r)},"select:account":function(e){return t.selectedDestinationAccount(r,e)}}}):t._e(),t._v(" "),"reconciliation"===t.transactionType.toLowerCase()?n("div",{staticClass:"form-group"},[n("div",{staticClass:"col-sm-12"},[n("p",{staticClass:"form-control-static",attrs:{id:"ffInput_dest"}},[n("em",[t._v("\n "+t._s(t.$t("firefly.destination_account_reconciliation"))+"\n ")])])])]):t._e(),t._v(" "),n("standard-date",{attrs:{index:r,error:e.errors.date},model:{value:e.date,callback:function(n){t.$set(e,"date",n)},expression:"transaction.date"}}),t._v(" "),0===r?n("div",[n("transaction-type",{attrs:{source:e.source_account.type,destination:e.destination_account.type},on:{"set:transactionType":function(e){return t.setTransactionType(e)},"act:limitSourceType":function(e){return t.limitSourceType(e)},"act:limitDestinationType":function(e){return t.limitDestinationType(e)}}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("amount",{attrs:{source:e.source_account,destination:e.destination_account,error:e.errors.amount,transactionType:t.transactionType},model:{value:e.amount,callback:function(n){t.$set(e,"amount",n)},expression:"transaction.amount"}}),t._v(" "),"reconciliation"!==t.transactionType.toLowerCase()?n("foreign-amount",{attrs:{source:e.source_account,destination:e.destination_account,transactionType:t.transactionType,error:e.errors.foreign_amount,no_currency:t.$t("firefly.none_in_select_list"),title:t.$t("form.foreign_amount")},model:{value:e.foreign_amount,callback:function(n){t.$set(e,"foreign_amount",n)},expression:"transaction.foreign_amount"}}):t._e()],1),t._v(" "),n("div",{staticClass:"col-lg-4"},[n("budget",{attrs:{transactionType:t.transactionType,error:e.errors.budget_id,no_budget:t.$t("firefly.none_in_select_list")},model:{value:e.budget,callback:function(n){t.$set(e,"budget",n)},expression:"transaction.budget"}}),t._v(" "),n("category",{attrs:{transactionType:t.transactionType,error:e.errors.category},model:{value:e.category,callback:function(n){t.$set(e,"category",n)},expression:"transaction.category"}}),t._v(" "),n("tags",{attrs:{transactionType:t.transactionType,tags:e.tags,error:e.errors.tags},model:{value:e.tags,callback:function(n){t.$set(e,"tags",n)},expression:"transaction.tags"}}),t._v(" "),n("custom-transaction-fields",{attrs:{error:e.errors.custom_errors},model:{value:e.custom_fields,callback:function(n){t.$set(e,"custom_fields",n)},expression:"transaction.custom_fields"}})],1)])]),t._v(" "),t.transactions.length-1===r&&"reconciliation"!==t.transactionType.toLowerCase()?n("div",{staticClass:"box-footer"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.addTransaction}},[t._v(t._s(t.$t("firefly.add_another_split")))])]):t._e()])])])})),0),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-3 col-md-4 col-sm-6 col-xs-12"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-header with-border"},[n("h3",{staticClass:"box-title"},[t._v("\n "+t._s(t.$t("firefly.submission"))+"\n ")])]),t._v(" "),n("div",{staticClass:"box-body"},[n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.returnAfter,expression:"returnAfter"}],attrs:{name:"return_after",type:"checkbox"},domProps:{checked:Array.isArray(t.returnAfter)?t._i(t.returnAfter,null)>-1:t.returnAfter},on:{change:function(e){var n=t.returnAfter,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.returnAfter=n.concat([null])):o>-1&&(t.returnAfter=n.slice(0,o).concat(n.slice(o+1)))}else t.returnAfter=i}}}),t._v("\n "+t._s(t.$t("firefly.after_update_create_another"))+"\n ")])]),t._v(" "),null!==t.transactionType&&"reconciliation"!==t.transactionType.toLowerCase()?n("div",{staticClass:"checkbox"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.storeAsNew,expression:"storeAsNew"}],attrs:{name:"store_as_new",type:"checkbox"},domProps:{checked:Array.isArray(t.storeAsNew)?t._i(t.storeAsNew,null)>-1:t.storeAsNew},on:{change:function(e){var n=t.storeAsNew,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.storeAsNew=n.concat([null])):o>-1&&(t.storeAsNew=n.slice(0,o).concat(n.slice(o+1)))}else t.storeAsNew=i}}}),t._v("\n "+t._s(t.$t("firefly.store_as_new"))+"\n ")])]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-success",on:{click:t.submit}},[t._v(t._s(t.$t("firefly.update_transaction")))])])])])])])])}),[],!1,null,"97868b94",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomDate",props:{value:String,title:String,name:String,error:Array},methods:{handleInput:function(t){this.$emit("input",this.$refs.date.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"date",staticClass:"form-control",attrs:{type:"date",name:t.name,title:t.title,autocomplete:"off",placeholder:t.title},domProps:{value:t.value?t.value.substr(0,10):""},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"30d0f0fe",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomString",props:{title:String,name:String,value:String,error:Array},methods:{handleInput:function(t){this.$emit("input",this.$refs.str.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"str",staticClass:"form-control",attrs:{type:"text",name:t.name,title:t.title,autocomplete:"off",placeholder:t.title},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"69529226",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomTextarea",props:{title:String,name:String,value:String,error:Array},data:function(){return{textValue:this.value}},methods:{handleInput:function(t){this.$emit("input",this.$refs.str.value)},hasError:function(){return this.error.length>0}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.textValue,expression:"textValue"}],ref:"str",staticClass:"form-control",attrs:{name:t.name,title:t.title,autocomplete:"off",rows:"8",placeholder:t.title},domProps:{value:t.textValue},on:{input:[function(e){e.target.composing||(t.textValue=e.target.value)},t.handleInput]}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"40389097",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"StandardDate",methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.date.value)}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.date"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"date",staticClass:"form-control",attrs:{type:"date",name:"date[]",title:t.$t("firefly.date"),autocomplete:"off",disabled:t.index>0,placeholder:t.$t("firefly.date")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"deecacf4",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"GroupDescription",methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.descr.value)}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"descr",staticClass:"form-control",attrs:{type:"text",name:"group_title",title:t.$t("firefly.split_transaction_title"),autocomplete:"off",placeholder:t.$t("firefly.split_transaction_title")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),0===t.error.length?n("p",{staticClass:"help-block"},[t._v("\n "+t._s(t.$t("firefly.split_transaction_title_help"))+"\n ")]):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"4d557a91",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:["error","value","index"],name:"TransactionDescription",mounted:function(){this.target=this.$refs.descr,this.descriptionAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/transaction-journals/all?search="},data:function(){return{descriptionAutoCompleteURI:null,name:null,description:null,target:null}},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){this.$emit("input",this.$refs.descr.value)},handleEnter:function(t){13===t.keyCode&&t.preventDefault()},selectedItem:function(t){void 0!==this.name&&"string"!=typeof this.name&&(this.$refs.descr.value=this.name.description,this.$emit("input",this.$refs.descr.value))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.description"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("input",{ref:"descr",staticClass:"form-control",attrs:{type:"text",name:"description[]",title:t.$t("firefly.description"),autocomplete:"off",placeholder:t.$t("firefly.description")},domProps:{value:t.value},on:{keypress:t.handleEnter,submit:function(t){t.preventDefault()},input:t.handleInput}}),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.descriptionAutoCompleteURI,target:t.target,"item-key":"description"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"e835e06e",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"CustomTransactionFields",props:["value","error"],mounted:function(){this.getPreference()},data:function(){return{customInterestDate:null,fields:[{interest_date:!1,book_date:!1,process_date:!1,due_date:!1,payment_date:!1,invoice_date:!1,internal_reference:!1,notes:!1,attachments:!1}]}},computed:{dateComponent:function(){return"custom-date"},stringComponent:function(){return"custom-string"},attachmentComponent:function(){return"custom-attachments"},textareaComponent:function(){return"custom-textarea"}},methods:{handleInput:function(t){this.$emit("input",this.value)},getPreference:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"api/v1/preferences/transaction_journal_optional_fields";axios.get(e).then((function(e){t.fields=e.data.data.attributes.data})).catch((function(){return console.warn("Oh. Something went wrong loading custom transaction fields.")}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[this.fields.interest_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.interest_date,name:"interest_date[]",title:t.$t("form.interest_date")},model:{value:t.value.interest_date,callback:function(e){t.$set(t.value,"interest_date",e)},expression:"value.interest_date"}}):t._e(),t._v(" "),this.fields.book_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.book_date,name:"book_date[]",title:t.$t("form.book_date")},model:{value:t.value.book_date,callback:function(e){t.$set(t.value,"book_date",e)},expression:"value.book_date"}}):t._e(),t._v(" "),this.fields.process_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.process_date,name:"process_date[]",title:t.$t("form.process_date")},model:{value:t.value.process_date,callback:function(e){t.$set(t.value,"process_date",e)},expression:"value.process_date"}}):t._e(),t._v(" "),this.fields.due_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.due_date,name:"due_date[]",title:t.$t("form.due_date")},model:{value:t.value.due_date,callback:function(e){t.$set(t.value,"due_date",e)},expression:"value.due_date"}}):t._e(),t._v(" "),this.fields.payment_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.payment_date,name:"payment_date[]",title:t.$t("form.payment_date")},model:{value:t.value.payment_date,callback:function(e){t.$set(t.value,"payment_date",e)},expression:"value.payment_date"}}):t._e(),t._v(" "),this.fields.invoice_date?n(t.dateComponent,{tag:"component",attrs:{error:t.error.invoice_date,name:"invoice_date[]",title:t.$t("form.invoice_date")},model:{value:t.value.invoice_date,callback:function(e){t.$set(t.value,"invoice_date",e)},expression:"value.invoice_date"}}):t._e(),t._v(" "),this.fields.internal_reference?n(t.stringComponent,{tag:"component",attrs:{error:t.error.internal_reference,name:"internal_reference[]",title:t.$t("form.internal_reference")},model:{value:t.value.internal_reference,callback:function(e){t.$set(t.value,"internal_reference",e)},expression:"value.internal_reference"}}):t._e(),t._v(" "),this.fields.attachments?n(t.attachmentComponent,{tag:"component",attrs:{error:t.error.attachments,name:"attachments[]",title:t.$t("firefly.attachments")},model:{value:t.value.attachments,callback:function(e){t.$set(t.value,"attachments",e)},expression:"value.attachments"}}):t._e(),t._v(" "),this.fields.notes?n(t.textareaComponent,{tag:"component",attrs:{error:t.error.notes,name:"notes[]",title:t.$t("firefly.notes")},model:{value:t.value.notes,callback:function(e){t.$set(t.value,"notes",e)},expression:"value.notes"}}):t._e()],1)}),[],!1,null,"1608b7b0",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"PiggyBank",props:["value","transactionType","error","no_piggy_bank"],mounted:function(){this.loadPiggies()},data:function(){return{piggies:[]}},methods:{handleInput:function(t){this.$emit("input",this.$refs.piggy.value)},hasError:function(){return this.error.length>0},loadPiggies:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/piggy-banks";axios.get(e,{}).then((function(e){for(var n in t.piggies=[{name_with_amount:t.no_piggy_bank,id:0}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&t.piggies.push(e.data[n])}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return void 0!==this.transactionType&&"Transfer"===this.transactionType?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12"},[this.piggies.length>0?n("select",{ref:"piggy",staticClass:"form-control",attrs:{name:"piggy_bank[]"},on:{input:t.handleInput}},t._l(this.piggies,(function(e){return n("option",{attrs:{label:e.name_with_amount},domProps:{value:e.id}},[t._v(t._s(e.name_with_amount))])})),0):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"1797c09a",null);e.a=o.exports},function(t,e,n){"use strict";var r=n(10),i=n.n(r),o=n(17),a={name:"Tags",components:{VueTagsInput:n.n(o).a},props:["value","error"],data:function(){return{tag:"",autocompleteItems:[],debounce:null,tags:this.value}},watch:{tag:"initItems"},methods:{update:function(t){this.autocompleteItems=[],this.tags=t,this.$emit("input",this.tags)},hasError:function(){return this.error.length>0},initItems:function(){var t=this;if(!(this.tag.length<2)){var e=document.getElementsByTagName("base")[0].href+"json/tags?search=".concat(this.tag);clearTimeout(this.debounce),this.debounce=setTimeout((function(){i.a.get(e).then((function(e){t.autocompleteItems=e.data.map((function(t){return{text:t.tag}}))})).catch((function(){return console.warn("Oh. Something went wrong loading tags.")}))}),600)}}}},s=n(0),c=Object(s.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.tags"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("vue-tags-input",{attrs:{tags:t.tags,classes:"form-input","autocomplete-items":t.autocompleteItems,"add-only-from-autocomplete":!1,placeholder:t.$t("firefly.tags")},on:{"tags-changed":t.update},model:{value:t.tag,callback:function(e){t.tag=e},expression:"tag"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"59692108",null);e.a=c.exports},function(t,e,n){"use strict";var r={name:"Category",props:{value:String,inputName:String,error:Array,accountName:{type:String,default:""}},data:function(){return{categoryAutoCompleteURI:null,name:null,target:null}},ready:function(){this.name=this.accountName},mounted:function(){this.target=this.$refs.input,this.categoryAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/categories?search="},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){"string"!=typeof this.$refs.input.value?this.$emit("input",this.$refs.input.value.name):this.$emit("input",this.$refs.input.value)},clearCategory:function(){this.name="",this.$refs.input.value="",this.$emit("input",this.$refs.input.value),this.$emit("clear:category")},selectedItem:function(t){void 0!==this.name&&(this.$emit("select:category",this.name),"string"!=typeof this.name?this.$emit("input",this.name.name):this.$emit("input",this.name))},handleEnter:function(t){13===t.keyCode&&t.preventDefault()}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.category"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"input-group"},[n("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",placeholder:t.$t("firefly.category"),autocomplete:"off","data-role":"input",name:"category[]",title:t.$t("firefly.category")},domProps:{value:t.value},on:{input:t.handleInput,keypress:t.handleEnter,submit:function(t){t.preventDefault()}}}),t._v(" "),n("span",{staticClass:"input-group-btn"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button"},on:{click:t.clearCategory}},[n("i",{staticClass:"fa fa-trash-o"})])])]),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.categoryAutoCompleteURI,target:t.target,"item-key":"name"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"4799245c",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"Amount",props:["source","destination","transactionType","value","error"],data:function(){return{sourceAccount:this.source,destinationAccount:this.destination,type:this.transactionType}},methods:{handleInput:function(t){this.$emit("input",this.$refs.amount.value)},hasError:function(){return this.error.length>0},changeData:function(){var t=this.transactionType;t||this.source.name||this.destination.name?(null===t&&(t=""),""!==t||""===this.source.currency_name?""!==t||""===this.destination.currency_name?"withdrawal"!==t.toLowerCase()&&"reconciliation"!==t.toLowerCase()&&"transfer"!==t.toLowerCase()?"Deposit"===t&&$(this.$refs.cur).text(this.destination.currency_name):$(this.$refs.cur).text(this.source.currency_name):$(this.$refs.cur).text(this.destination.currency_name):$(this.$refs.cur).text(this.source.currency_name)):$(this.$refs.cur).text("")}},watch:{source:function(){this.changeData()},destination:function(){this.changeData()},transactionType:function(){this.changeData()}},mounted:function(){this.changeData()}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-8 col-sm-offset-4 text-sm"},[t._v("\n "+t._s(t.$t("firefly.amount"))+"\n ")]),t._v(" "),n("label",{ref:"cur",staticClass:"col-sm-4 control-label"}),t._v(" "),n("div",{staticClass:"col-sm-8"},[n("input",{ref:"amount",staticClass:"form-control",attrs:{type:"number",step:"any",name:"amount[]",title:"$t('firefly.amount')",autocomplete:"off",placeholder:t.$t("firefly.amount")},domProps:{value:t.value},on:{input:t.handleInput}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"52fb4746",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"ForeignAmountSelect",props:["source","destination","transactionType","value","error","no_currency","title"],mounted:function(){this.liability=!1,this.loadCurrencies()},data:function(){return{currencies:[],enabledCurrencies:[],exclude:null,liability:!1}},watch:{source:function(){this.changeData()},destination:function(){this.changeData()},transactionType:function(){this.changeData()}},methods:{hasError:function(){return this.error.length>0},handleInput:function(t){var e={amount:this.$refs.amount.value,currency_id:this.$refs.currency_select.value};this.$emit("input",e)},changeData:function(){this.enabledCurrencies=[];var t=this.destination.type?this.destination.type.toLowerCase():"invalid",e=this.source.type?this.source.type.toLowerCase():"invalid",n=this.transactionType?this.transactionType.toLowerCase():"invalid",r=["loan","debt","mortgage"],i=-1!==r.indexOf(e),o=-1!==r.indexOf(t);if("transfer"===n||o||i)for(var a in this.liability=!0,this.currencies)this.currencies.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&this.currencies[a].id===this.destination.currency_id&&this.enabledCurrencies.push(this.currencies[a]);else if("withdrawal"===n&&this.source&&!1===i)for(var s in this.currencies)this.currencies.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&this.source.currency_id!==this.currencies[s].id&&this.enabledCurrencies.push(this.currencies[s]);else if("deposit"===n&&this.destination)for(var c in this.currencies)this.currencies.hasOwnProperty(c)&&/^0$|^[1-9]\d*$/.test(c)&&c<=4294967294&&this.destination.currency_id!==this.currencies[c].id&&this.enabledCurrencies.push(this.currencies[c]);else for(var u in this.currencies)this.currencies.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&this.enabledCurrencies.push(this.currencies[u])},loadCurrencies:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/currencies";axios.get(e,{}).then((function(e){for(var n in t.currencies=[{name:t.no_currency,id:0,enabled:!0}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&e.data[n].enabled&&(t.currencies.push(e.data[n]),t.enabledCurrencies.push(e.data[n]))}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return this.enabledCurrencies.length>1?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-8 col-sm-offset-4 text-sm"},[t._v("\n "+t._s(t.$t("form.foreign_amount"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-4"},[n("select",{ref:"currency_select",staticClass:"form-control",attrs:{name:"foreign_currency[]"},on:{input:t.handleInput}},t._l(this.enabledCurrencies,(function(e){return e.enabled?n("option",{attrs:{label:e.name},domProps:{value:e.id,selected:t.value.currency_id===e.id}},[t._v("\n "+t._s(e.name)+"\n ")]):t._e()})),0)]),t._v(" "),n("div",{staticClass:"col-sm-8"},[this.enabledCurrencies.length>0?n("input",{ref:"amount",staticClass:"form-control",attrs:{type:"number",step:"any",name:"foreign_amount[]",title:this.title,autocomplete:"off",placeholder:this.title},domProps:{value:t.value.amount},on:{input:t.handleInput}}):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"4317a62a",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:{source:String,destination:String,type:String},methods:{changeValue:function(){if(this.source&&this.destination){var t="";window.accountToTypes[this.source]?window.accountToTypes[this.source][this.destination]?t=window.accountToTypes[this.source][this.destination]:console.warn("User selected an impossible destination."):console.warn("User selected an impossible source."),""!==t&&(this.transactionType=t,this.sentence="You're creating a "+this.transactionType,this.$emit("act:limitSourceType",this.source),this.$emit("act:limitDestinationType",this.destination))}else this.sentence="",this.transactionType="";this.$emit("set:transactionType",this.transactionType)}},data:function(){return{transactionType:this.type,sentence:""}},watch:{source:function(){this.changeValue()},destination:function(){this.changeValue()}},name:"TransactionType"},i=n(0),o=Object(i.a)(r,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"form-group"},[e("div",{staticClass:"col-sm-12"},[""!==this.sentence?e("label",{staticClass:"control-label text-info"},[this._v("\n "+this._s(this.sentence)+"\n ")]):this._e()])])}),[],!1,null,"9524635e",null);e.a=o.exports},function(t,e,n){"use strict";var r={props:{inputName:String,title:String,index:Number,transactionType:String,error:Array,accountName:{type:String,default:""},accountTypeFilters:{type:Array,default:function(){return[]}},defaultAccountTypeFilters:{type:Array,default:function(){return[]}}},data:function(){return{accountAutoCompleteURI:null,name:null,trType:this.transactionType,target:null,inputDisabled:!1,allowedTypes:this.accountTypeFilters,defaultAllowedTypes:this.defaultAccountTypeFilters}},ready:function(){this.name=this.accountName},mounted:function(){this.target=this.$refs.input;var t=this.allowedTypes.join(",");this.name=this.accountName,this.accountAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/accounts?types="+t+"&search=",this.triggerTransactionType()},watch:{transactionType:function(){this.triggerTransactionType()},accountTypeFilters:function(){var t=this.accountTypeFilters.join(",");0===this.accountTypeFilters.length&&(t=this.defaultAccountTypeFilters.join(",")),this.accountAutoCompleteURI=document.getElementsByTagName("base")[0].href+"json/accounts?types="+t+"&search="},name:function(){}},methods:{hasError:function(){return this.error.length>0},triggerTransactionType:function(){if(this.name,null!==this.transactionType&&""!==this.transactionType&&(this.inputDisabled=!1,""!==this.transactionType.toString()&&this.index>0)){if("transfer"===this.transactionType.toString().toLowerCase())return void(this.inputDisabled=!0);if("withdrawal"===this.transactionType.toString().toLowerCase()&&"source"===this.inputName.substr(0,6).toLowerCase())return void(this.inputDisabled=!0);"deposit"===this.transactionType.toString().toLowerCase()&&"destination"===this.inputName.substr(0,11).toLowerCase()&&(this.inputDisabled=!0)}},selectedItem:function(t){void 0!==this.name&&("string"==typeof this.name&&this.$emit("clear:value"),this.$emit("select:account",this.name))},clearSource:function(t){this.name="",this.$emit("clear:value")},handleEnter:function(t){13===t.keyCode&&t.preventDefault()}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"input-group"},[n("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",placeholder:t.title,"data-index":t.index,autocomplete:"off","data-role":"input",disabled:t.inputDisabled,name:t.inputName,title:t.title},on:{keypress:t.handleEnter,submit:function(t){t.preventDefault()}}}),t._v(" "),n("span",{staticClass:"input-group-btn"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button"},on:{click:t.clearSource}},[n("i",{staticClass:"fa fa-trash-o"})])])]),t._v(" "),n("typeahead",{attrs:{"open-on-empty":!0,"open-on-focus":!0,"async-src":t.accountAutoCompleteURI,target:t.target,"item-key":"name_with_balance"},on:{input:t.selectedItem},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)])}),[],!1,null,"67fe0472",null);e.a=o.exports},function(t,e,n){"use strict";var r={name:"Budget",props:["transactionType","value","error","no_budget"],mounted:function(){this.loadBudgets()},data:function(){return{budgets:[]}},methods:{handleInput:function(t){this.$emit("input",this.$refs.budget.value)},hasError:function(){return this.error.length>0},loadBudgets:function(){var t=this,e=document.getElementsByTagName("base")[0].href+"json/budgets";axios.get(e,{}).then((function(e){for(var n in t.budgets=[{name:t.no_budget,id:0},{name:t.no_budget,id:null}],e.data)e.data.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&t.budgets.push(e.data[n])}))}}},i=n(0),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return void 0===this.transactionType||"withdrawal"===this.transactionType||"Withdrawal"===this.transactionType||""===this.transactionType||null===this.transactionType?n("div",{staticClass:"form-group",class:{"has-error":t.hasError()}},[n("div",{staticClass:"col-sm-12 text-sm"},[t._v("\n "+t._s(t.$t("firefly.budget"))+"\n ")]),t._v(" "),n("div",{staticClass:"col-sm-12"},[this.budgets.length>0?n("select",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"value"}],ref:"budget",staticClass:"form-control",attrs:{name:"budget[]"},on:{input:t.handleInput,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.value=e.target.multiple?n:n[0]}}},t._l(this.budgets,(function(e){return n("option",{attrs:{label:e.name},domProps:{value:e.id}},[t._v(t._s(e.name))])})),0):t._e(),t._v(" "),t._l(this.error,(function(e){return n("ul",{staticClass:"list-unstyled"},[n("li",{staticClass:"text-danger"},[t._v(t._s(e))])])}))],2)]):t._e()}),[],!1,null,"3ac92436",null);e.a=o.exports},,function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={data:function(){return{clients:[],createForm:{errors:[],name:"",redirect:""},editForm:{errors:[],name:"",redirect:""}}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getClients(),$("#modal-create-client").on("shown.bs.modal",(function(){$("#create-client-name").focus()})),$("#modal-edit-client").on("shown.bs.modal",(function(){$("#edit-client-name").focus()}))},getClients:function(){var t=this;axios.get("./oauth/clients").then((function(e){t.clients=e.data}))},showCreateClientForm:function(){$("#modal-create-client").modal("show")},store:function(){this.persistClient("post","./oauth/clients?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.createForm,"#modal-create-client")},edit:function(t){this.editForm.id=t.id,this.editForm.name=t.name,this.editForm.redirect=t.redirect,$("#modal-edit-client").modal("show")},update:function(){this.persistClient("put","./oauth/clients/"+this.editForm.id+"?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.editForm,"#modal-edit-client")},persistClient:function(t,e,n,i){var o=this;n.errors=[],axios[t](e,n).then((function(t){o.getClients(),n.name="",n.redirect="",n.errors=[],$(i).modal("hide")})).catch((function(t){"object"===r(t.response.data)?n.errors=_.flatten(_.toArray(t.response.data)):n.errors=["Something went wrong. Please try again."]}))},destroy:function(t){var e=this;axios.delete("./oauth/clients/"+t.id).then((function(t){e.getClients()}))}}},o=(n(44),n(0)),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[0===t.clients.length?n("p",{staticClass:"m-b-none"},[t._v("\n You have not created any OAuth clients.\n ")]):t._e(),t._v(" "),t.clients.length>0?n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.clients,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.id)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("code",[t._v(t._s(e.secret))])]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-default btn-xs",on:{click:function(n){return t.edit(e)}}},[t._v("\n Edit\n ")])]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-danger btn-xs",on:{click:function(n){return t.destroy(e)}}},[t._v("\n Delete\n ")])])])})),0)]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("a",{staticClass:"action-link btn btn-success",on:{click:t.showCreateClientForm}},[t._v("\n Create New Client\n ")])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-create-client",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(2),t._v(" "),n("div",{staticClass:"modal-body"},[t.createForm.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(3),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.createForm.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createForm.name,expression:"createForm.name"}],staticClass:"form-control",attrs:{id:"create-client-name",type:"text"},domProps:{value:t.createForm.name},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.store(e)},input:function(e){e.target.composing||t.$set(t.createForm,"name",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Something your users will recognize and trust.\n ")])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Redirect URL")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.createForm.redirect,expression:"createForm.redirect"}],staticClass:"form-control",attrs:{type:"text",name:"redirect"},domProps:{value:t.createForm.redirect},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.store(e)},input:function(e){e.target.composing||t.$set(t.createForm,"redirect",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Your application's authorization callback URL.\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.store}},[t._v("\n Create\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-edit-client",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(4),t._v(" "),n("div",{staticClass:"modal-body"},[t.editForm.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(5),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.editForm.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.editForm.name,expression:"editForm.name"}],staticClass:"form-control",attrs:{id:"edit-client-name",type:"text"},domProps:{value:t.editForm.name},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.update(e)},input:function(e){e.target.composing||t.$set(t.editForm,"name",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Something your users will recognize and trust.\n ")])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-3 control-label"},[t._v("Redirect URL")]),t._v(" "),n("div",{staticClass:"col-md-7"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.editForm.redirect,expression:"editForm.redirect"}],staticClass:"form-control",attrs:{type:"text",name:"redirect"},domProps:{value:t.editForm.redirect},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.update(e)},input:function(e){e.target.composing||t.$set(t.editForm,"redirect",e.target.value)}}}),t._v(" "),n("span",{staticClass:"help-block"},[t._v("\n Your application's authorization callback URL.\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.update}},[t._v("\n Save Changes\n ")])])])])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n OAuth Clients\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Client ID")]),this._v(" "),e("th",[this._v("Name")]),this._v(" "),e("th",[this._v("Secret")]),this._v(" "),e("th"),this._v(" "),e("th")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Create Client\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Edit Client\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])}],!1,null,"601b5408",null);e.a=a.exports},function(t,e,n){"use strict";var r={data:function(){return{tokens:[]}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getTokens()},getTokens:function(){var t=this;axios.get("./oauth/tokens").then((function(e){t.tokens=e.data}))},revoke:function(t){var e=this;axios.delete("./oauth/tokens/"+t.id).then((function(t){e.getTokens()}))}}},i=(n(47),n(0)),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.tokens.length>0?n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.tokens,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.client.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[e.scopes.length>0?n("span",[t._v("\n "+t._s(e.scopes.join(", "))+"\n ")]):t._e()]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link btn btn-danger btn-xs",on:{click:function(n){return t.revoke(e)}}},[t._v("\n Revoke\n ")])])])})),0)])])])]):t._e()])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n Authorized Applications\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Name")]),this._v(" "),e("th",[this._v("Scopes")]),this._v(" "),e("th")])])}],!1,null,"7a552af1",null);e.a=o.exports},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={data:function(){return{accessToken:null,tokens:[],scopes:[],form:{name:"",scopes:[],errors:[]}}},ready:function(){this.prepareComponent()},mounted:function(){this.prepareComponent()},methods:{prepareComponent:function(){this.getTokens(),this.getScopes(),$("#modal-create-token").on("shown.bs.modal",(function(){$("#create-token-name").focus()}))},getTokens:function(){var t=this;axios.get("./oauth/personal-access-tokens").then((function(e){t.tokens=e.data}))},getScopes:function(){var t=this;axios.get("./oauth/scopes").then((function(e){t.scopes=e.data}))},showCreateTokenForm:function(){$("#modal-create-token").modal("show")},store:function(){var t=this;this.accessToken=null,this.form.errors=[],axios.post("./oauth/personal-access-tokens?_token="+document.head.querySelector('meta[name="csrf-token"]').content,this.form).then((function(e){t.form.name="",t.form.scopes=[],t.form.errors=[],t.tokens.push(e.data.token),t.showAccessToken(e.data.accessToken)})).catch((function(e){"object"===r(e.response.data)?t.form.errors=_.flatten(_.toArray(e.response.data)):t.form.errors=["Something went wrong. Please try again."]}))},toggleScope:function(t){this.scopeIsAssigned(t)?this.form.scopes=_.reject(this.form.scopes,(function(e){return e==t})):this.form.scopes.push(t)},scopeIsAssigned:function(t){return _.indexOf(this.form.scopes,t)>=0},showAccessToken:function(t){$("#modal-create-token").modal("hide"),this.accessToken=t,$("#modal-access-token").modal("show")},revoke:function(t){var e=this;axios.delete("./oauth/personal-access-tokens/"+t.id).then((function(t){e.getTokens()}))}}},o=(n(49),n(0)),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",[n("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),n("div",{staticClass:"box-body"},[0===t.tokens.length?n("p",{staticClass:"m-b-none"},[t._v("\n You have not created any personal access tokens.\n ")]):t._e(),t._v(" "),t.tokens.length>0?n("table",{staticClass:"table table-borderless m-b-none"},[t._m(1),t._v(" "),n("tbody",t._l(t.tokens,(function(e){return n("tr",[n("td",{staticStyle:{"vertical-align":"middle"}},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),n("td",{staticStyle:{"vertical-align":"middle"}},[n("a",{staticClass:"action-link text-danger",on:{click:function(n){return t.revoke(e)}}},[t._v("\n Delete\n ")])])])})),0)]):t._e()]),t._v(" "),n("div",{staticClass:"box-footer"},[n("a",{staticClass:"action-link btn btn-success",on:{click:t.showCreateTokenForm}},[t._v("\n Create New Token\n ")])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-create-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(2),t._v(" "),n("div",{staticClass:"modal-body"},[t.form.errors.length>0?n("div",{staticClass:"alert alert-danger"},[t._m(3),t._v(" "),n("br"),t._v(" "),n("ul",t._l(t.form.errors,(function(e){return n("li",[t._v("\n "+t._s(e)+"\n ")])})),0)]):t._e(),t._v(" "),n("form",{staticClass:"form-horizontal",attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.store(e)}}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-4 control-label"},[t._v("Name")]),t._v(" "),n("div",{staticClass:"col-md-6"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"form-control",attrs:{id:"create-token-name",type:"text",name:"name"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}})])]),t._v(" "),t.scopes.length>0?n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-md-4 control-label"},[t._v("Scopes")]),t._v(" "),n("div",{staticClass:"col-md-6"},t._l(t.scopes,(function(e){return n("div",[n("div",{staticClass:"checkbox"},[n("label",[n("input",{attrs:{type:"checkbox"},domProps:{checked:t.scopeIsAssigned(e.id)},on:{click:function(n){return t.toggleScope(e.id)}}}),t._v("\n\n "+t._s(e.id)+"\n ")])])])})),0)]):t._e()])]),t._v(" "),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.store}},[t._v("\n Create\n ")])])])])]),t._v(" "),n("div",{staticClass:"modal fade",attrs:{id:"modal-access-token",tabindex:"-1",role:"dialog"}},[n("div",{staticClass:"modal-dialog"},[n("div",{staticClass:"modal-content"},[t._m(4),t._v(" "),n("div",{staticClass:"modal-body"},[n("p",[t._v("\n Here is your new personal access token. This is the only time it will be shown so don't lose it!\n You may now use this token to make API requests.\n ")]),t._v(" "),n("pre",[n("textarea",{staticClass:"form-control",staticStyle:{width:"100%"},attrs:{id:"tokenHidden",rows:"20"}},[t._v(t._s(t.accessToken))])])]),t._v(" "),t._m(5)])])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"box-header with-border"},[e("h3",{staticClass:"box-title"},[this._v("\n Personal Access Tokens\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("Name")]),this._v(" "),e("th")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Create Token\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Whoops!")]),this._v(" Something went wrong!")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-header"},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-hidden":"true"}},[this._v("×")]),this._v(" "),e("h4",{staticClass:"modal-title"},[this._v("\n Personal Access Token\n ")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"modal-footer"},[e("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal"}},[this._v("Close")])])}],!1,null,"8ff858a2",null);e.a=a.exports},function(t,e,n){"use strict";(function(e,n){var r=Object.freeze({});function i(t){return null==t}function o(t){return null!=t}function a(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function l(t){return"[object Object]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var y=Object.prototype.hasOwnProperty;function A(t,e){return y.call(t,e)}function _(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var b=/-(\w)/g,w=_((function(t){return t.replace(b,(function(t,e){return e?e.toUpperCase():""}))})),C=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),x=/\B([A-Z])/g,T=_((function(t){return t.replace(x,"-$1").toLowerCase()})),k=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function E(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function $(t,e){for(var n in e)t[n]=e[n];return t}function S(t){for(var e={},n=0;n0,K=V&&V.indexOf("edge/")>0,J=(V&&V.indexOf("android"),V&&/iphone|ipad|ipod|ios/.test(V)||"ios"===Q),X=(V&&/chrome\/\d+/.test(V),V&&/phantomjs/.test(V),V&&V.match(/firefox\/(\d+)/)),Z={}.watch,tt=!1;if(q)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(r){}var nt=function(){return void 0===U&&(U=!q&&!W&&void 0!==e&&e.process&&"server"===e.process.env.VUE_ENV),U},rt=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var ot,at="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);ot="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var st=B,ct=0,ut=function(){this.id=ct++,this.subs=[]};ut.prototype.addSub=function(t){this.subs.push(t)},ut.prototype.removeSub=function(t){g(this.subs,t)},ut.prototype.depend=function(){ut.target&&ut.target.addDep(this)},ut.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e-1)if(o&&!A(i,"default"))a=!1;else if(""===a||a===T(t)){var c=Mt(String,i.type);(c<0||s0&&(ce((c=t(c,(n||"")+"_"+r))[0])&&ce(l)&&(d[u]=mt(l.text+c[0].text),c.shift()),d.push.apply(d,c)):s(c)?ce(l)?d[u]=mt(l.text+c):""!==c&&d.push(mt(c)):ce(c)&&ce(l)?d[u]=mt(l.text+c.text):(a(e._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist"+n+"_"+r+"__"),d.push(c)));return d}(t):void 0}function ce(t){return o(t)&&o(t.text)&&!1===t.isComment}function ue(t,e){if(t){for(var n=Object.create(null),r=at?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=pe(e,c,t[c]))}else i={};for(var u in e)u in i||(i[u]=he(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),F(i,"$stable",a),F(i,"$key",s),F(i,"$hasNormal",o),i}function pe(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:se(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function he(t,e){return function(){return t[e]}}function ve(t,e){var n,r,i,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,i=t.length;rdocument.createEvent("Event").timeStamp&&(an=function(){return sn.now()})}function cn(){var t,e;for(on=an(),nn=!0,Xe.sort((function(t,e){return t.id-e.id})),rn=0;rnrn&&Xe[n].id>t.id;)n--;Xe.splice(n+1,0,t)}else Xe.push(t);en||(en=!0,Zt(cn))}}(this)},ln.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Ft(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},ln.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ln.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},ln.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:B,set:B};function fn(t,e,n){dn.get=function(){return this[e][n]},dn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,dn)}var pn={lazy:!0};function hn(t,e,n){var r=!nt();"function"==typeof n?(dn.get=r?vn(e):mn(n),dn.set=B):(dn.get=n.get?r&&!1!==n.cache?vn(e):mn(n.get):B,dn.set=n.set||B),Object.defineProperty(t,e,dn)}function vn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),ut.target&&e.depend(),e.value}}function mn(t){return function(){return t.call(this,this)}}function gn(t,e,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var yn=0;function An(t){var e=t.options;if(t.super){var n=An(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}(t);r&&$(t.extendOptions,r),(e=t.options=Nt(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function _n(t){this._init(t)}function bn(t){return t&&(t.Ctor.options.name||t.tag)}function wn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:(n=t,"[object RegExp]"===u.call(n)&&t.test(e));var n}function Cn(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=bn(a.componentOptions);s&&!e(s)&&xn(n,o,r,i)}}}function xn(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,g(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=yn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Nt(An(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Qe(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=le(e._renderChildren,i),t.$scopedSlots=r,t._c=function(e,n,r,i){return Le(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Le(t,e,n,r,i,!0)};var o=n&&n.data;Tt(t,"$attrs",o&&o.attrs||r,null,!0),Tt(t,"$listeners",e._parentListeners||r,null,!0)}(e),Je(e,"beforeCreate"),function(t){var e=ue(t.$options.inject,t);e&&(wt(!1),Object.keys(e).forEach((function(n){Tt(t,n,e[n])})),wt(!0))}(e),function(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];t.$parent&&wt(!1);var o=function(o){i.push(o);var a=Pt(o,e,n,t);Tt(r,o,a),o in t||fn(t,"_props",o)};for(var a in e)o(a);wt(!0)}(t,e.props),e.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?B:k(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;l(e=t._data="function"==typeof e?function(t,e){dt();try{return t.call(e,e)}catch(t){return Ft(t,e,"data()"),{}}finally{ft()}}(e,t):e||{})||(e={});for(var n,r=Object.keys(e),i=t.$options.props,o=(t.$options.methods,r.length);o--;){var a=r[o];i&&A(i,a)||(void 0,36!==(n=(a+"").charCodeAt(0))&&95!==n&&fn(t,"_data",a))}xt(e,!0)}(t):xt(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new ln(t,a||B,B,pn)),i in t||hn(t,i,o)}}(t,e.computed),e.watch&&e.watch!==Z&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i1?E(e):e;for(var n=E(arguments,1),r='event handler for "'+t+'"',i=0,o=e.length;iparseInt(this.max)&&xn(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return M}};Object.defineProperty(t,"config",e),t.util={warn:st,extend:$,mergeOptions:Nt,defineReactive:Tt},t.set=kt,t.delete=Et,t.nextTick=Zt,t.observable=function(t){return xt(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,$(t.options.components,kn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Nt(this.options,t),this}}(t),function(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=e++,a.options=Nt(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)fn(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)hn(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,L.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=$({},a.options),i[r]=a,a}}(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(_n),Object.defineProperty(_n.prototype,"$isServer",{get:nt}),Object.defineProperty(_n.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(_n,"FunctionalRenderContext",{value:Be}),_n.version="2.6.11";var En=v("style,class"),$n=v("input,textarea,option,select,progress"),Sn=v("contenteditable,draggable,spellcheck"),Bn=v("events,caret,typing,plaintext-only"),Dn=v("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"),On="http://www.w3.org/1999/xlink",In=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Nn=function(t){return In(t)?t.slice(6,t.length):""},jn=function(t){return null==t||!1===t};function Pn(t,e){return{staticClass:Ln(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Ln(t,e){return t?e?t+" "+e:t:e||""}function Rn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r-1?sr(t,e,n):Dn(e)?jn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Sn(e)?t.setAttribute(e,function(t,e){return jn(e)||"false"===e?"false":"contenteditable"===t&&Bn(e)?e:"true"}(e,n)):In(e)?jn(n)?t.removeAttributeNS(On,Nn(e)):t.setAttributeNS(On,e,n):sr(t,e,n)}function sr(t,e,n){if(jn(n))t.removeAttribute(e);else{if(Y&&!G&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var cr={create:or,update:or};function ur(t,e){var n=e.elm,r=e.data,a=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=function(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Pn(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=Pn(e,n.data));return function(t,e){return o(t)||o(e)?Ln(t,Rn(e)):""}(e.staticClass,e.class)}(e),c=n._transitionClasses;o(c)&&(s=Ln(s,Rn(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var lr,dr={create:ur,update:ur};function fr(t,e,n){var r=lr;return function i(){null!==e.apply(null,arguments)&&vr(t,i,n,r)}}var pr=Wt&&!(X&&Number(X[1])<=53);function hr(t,e,n,r){if(pr){var i=on,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}lr.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function vr(t,e,n,r){(r||lr).removeEventListener(t,e._wrapper||e,n)}function mr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};lr=e.elm,function(t){if(o(t.__r)){var e=Y?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),ie(n,r,hr,vr,fr,e.context),lr=void 0}}var gr,yr={create:mr,update:mr};function Ar(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in o(c.__ob__)&&(c=e.data.domProps=$({},c)),s)n in c||(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=i(r)?"":String(r);_r(a,u)&&(a.value=u)}else if("innerHTML"===n&&Un(a.tagName)&&i(a.innerHTML)){(gr=gr||document.createElement("div")).innerHTML=""+r+" ";for(var l=gr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(r!==s[n])try{a[n]=r}catch(t){}}}}function _r(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var br={create:Ar,update:Ar},wr=_((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Cr(t){var e=xr(t.style);return t.staticStyle?$(t.staticStyle,e):e}function xr(t){return Array.isArray(t)?S(t):"string"==typeof t?wr(t):t}var Tr,kr=/^--/,Er=/\s*!important$/,$r=function(t,e,n){if(kr.test(e))t.style.setProperty(e,n);else if(Er.test(n))t.style.setProperty(T(e),n.replace(Er,""),"important");else{var r=Br(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(Ir).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function jr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ir).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Pr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&$(e,Lr(t.name||"v")),$(e,t),e}return"string"==typeof t?Lr(t):void 0}}var Lr=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Rr=q&&!G,Mr="transition",Fr="animation",Ur="transition",Hr="transitionend",zr="animation",qr="animationend";Rr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ur="WebkitTransition",Hr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(zr="WebkitAnimation",qr="webkitAnimationEnd"));var Wr=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Qr(t){Wr((function(){Wr(t)}))}function Vr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Nr(t,e))}function Yr(t,e){t._transitionClasses&&g(t._transitionClasses,e),jr(t,e)}function Gr(t,e,n){var r=Jr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Mr?Hr:qr,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n=Mr,l=a,d=o.length):e===Fr?u>0&&(n=Fr,l=u,d=c.length):d=(n=(l=Math.max(a,u))>0?a>u?Mr:Fr:null)?n===Mr?o.length:c.length:0,{type:n,timeout:l,propCount:d,hasTransform:n===Mr&&Kr.test(r[Ur+"Property"])}}function Xr(t,e){for(;t.length1}function ii(t,e){!0!==e.data.show&&ti(e)}var oi=function(t){var e,n,r={},c=t.modules,u=t.nodeOps;for(e=0;eh?A(t,i(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&b(e,f,h)}(f,v,g,n,l):o(g)?(o(t.text)&&u.setTextContent(f,""),A(f,null,g,0,g.length-1,n)):o(v)?b(v,0,v.length-1):o(t.text)&&u.setTextContent(f,""):t.text!==e.text&&u.setTextContent(f,e.text),o(h)&&o(p=h.hook)&&o(p=p.postpatch)&&p(t,e)}}}function T(t,e,n){if(a(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==o&&(a.selected=o);else if(I(li(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function ui(t,e){return e.every((function(e){return!I(e,t)}))}function li(t){return"_value"in t?t._value:t.value}function di(t){t.target.composing=!0}function fi(t){t.target.composing&&(t.target.composing=!1,pi(t.target,"input"))}function pi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function hi(t){return!t.componentInstance||t.data&&t.data.transition?t:hi(t.componentInstance._vnode)}var vi={model:ai,show:{bind:function(t,e,n){var r=e.value,i=(n=hi(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,ti(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=hi(n)).data&&n.data.transition?(n.data.show=!0,r?ti(n,(function(){t.style.display=t.__vOriginalDisplay})):ei(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},mi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function gi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?gi(He(e.children)):t}function yi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[w(o)]=i[o];return e}function Ai(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var _i=function(t){return t.tag||Ue(t)},bi=function(t){return"show"===t.name},wi={name:"transition",props:mi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(_i)).length){var r=this.mode,i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=gi(i);if(!o)return i;if(this._leaving)return Ai(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=yi(this),u=this._vnode,l=gi(u);if(o.data.directives&&o.data.directives.some(bi)&&(o.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,l)&&!Ue(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var d=l.data.transition=$({},c);if("out-in"===r)return this._leaving=!0,oe(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ai(t,i);if("in-out"===r){if(Ue(o))return u;var f,p=function(){f()};oe(c,"afterEnter",p),oe(c,"enterCancelled",p),oe(d,"delayLeave",(function(t){f=t}))}}return i}}},Ci=$({tag:String,moveClass:String},mi);function xi(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ti(t){t.data.newPos=t.elm.getBoundingClientRect()}function ki(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Ci.mode;var Ei={Transition:wi,TransitionGroup:{props:Ci,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Ye(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=yi(this),s=0;s-1?zn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:zn[t]=/HTMLUnknownElement/.test(e.toString())},$(_n.options.directives,vi),$(_n.options.components,Ei),_n.prototype.__patch__=q?oi:B,_n.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=vt),Je(t,"beforeMount"),r=function(){t._update(t._render(),n)},new ln(t,r,B,{before:function(){t._isMounted&&!t._isDestroyed&&Je(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Je(t,"mounted")),t}(this,t=t&&q?function(t){return"string"==typeof t?document.querySelector(t)||document.createElement("div"):t}(t):void 0,e)},q&&setTimeout((function(){M.devtools&&rt&&rt.emit("init",_n)}),0),t.exports=_n}).call(this,n(3),n(42).setImmediate)},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(43),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,c=1,u={},l=!1,d=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){h(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){o.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(t){var e=d.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(2);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(2),i=n(63),o=n(15),a=n(9),s=n(64),c=n(65);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.baseURL&&!s(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return u(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(16);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){window._=n(69);try{window.$=window.jQuery=n(71),n(72)}catch(t){}window.axios=n(10),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var r=document.head.querySelector('meta[name="csrf-token"]');r?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=r.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token")},function(t,e,n){(function(t,r){var i;(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",u="[object Array]",l="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object GeneratorFunction]",v="[object Map]",m="[object Number]",g="[object Object]",y="[object RegExp]",A="[object Set]",_="[object String]",b="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",x="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",$="[object Int16Array]",S="[object Int32Array]",B="[object Uint8Array]",D="[object Uint16Array]",O="[object Uint32Array]",I=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,R=RegExp(P.source),M=RegExp(L.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,V=RegExp(Q.source),Y=/^\s+|\s+$/g,G=/^\s+/,K=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,ct=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,dt=/['\n\r\u2028\u2029\\]/g,ft="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ht="[\\ud800-\\udfff]",vt="["+pt+"]",mt="["+ft+"]",gt="\\d+",yt="[\\u2700-\\u27bf]",At="[a-z\\xdf-\\xf6\\xf8-\\xff]",_t="[^\\ud800-\\udfff"+pt+gt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",bt="\\ud83c[\\udffb-\\udfff]",wt="[^\\ud800-\\udfff]",Ct="(?:\\ud83c[\\udde6-\\uddff]){2}",xt="[\\ud800-\\udbff][\\udc00-\\udfff]",Tt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",kt="(?:"+At+"|"+_t+")",Et="(?:"+Tt+"|"+_t+")",$t="(?:"+mt+"|"+bt+")"+"?",St="[\\ufe0e\\ufe0f]?"+$t+("(?:\\u200d(?:"+[wt,Ct,xt].join("|")+")[\\ufe0e\\ufe0f]?"+$t+")*"),Bt="(?:"+[yt,Ct,xt].join("|")+")"+St,Dt="(?:"+[wt+mt+"?",mt,Ct,xt,ht].join("|")+")",Ot=RegExp("['’]","g"),It=RegExp(mt,"g"),Nt=RegExp(bt+"(?="+bt+")|"+Dt+St,"g"),jt=RegExp([Tt+"?"+At+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[vt,Tt,"$"].join("|")+")",Et+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[vt,Tt+kt,"$"].join("|")+")",Tt+"?"+kt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Tt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gt,Bt].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+ft+"\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mt=-1,Ft={};Ft[T]=Ft[k]=Ft[E]=Ft[$]=Ft[S]=Ft[B]=Ft["[object Uint8ClampedArray]"]=Ft[D]=Ft[O]=!0,Ft[c]=Ft[u]=Ft[C]=Ft[l]=Ft[x]=Ft[d]=Ft[f]=Ft[p]=Ft[v]=Ft[m]=Ft[g]=Ft[y]=Ft[A]=Ft[_]=Ft[w]=!1;var Ut={};Ut[c]=Ut[u]=Ut[C]=Ut[x]=Ut[l]=Ut[d]=Ut[T]=Ut[k]=Ut[E]=Ut[$]=Ut[S]=Ut[v]=Ut[m]=Ut[g]=Ut[y]=Ut[A]=Ut[_]=Ut[b]=Ut[B]=Ut["[object Uint8ClampedArray]"]=Ut[D]=Ut[O]=!0,Ut[f]=Ut[p]=Ut[w]=!1;var Ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=parseFloat,qt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Qt="object"==typeof self&&self&&self.Object===Object&&self,Vt=Wt||Qt||Function("return this")(),Yt=e&&!e.nodeType&&e,Gt=Yt&&"object"==typeof r&&r&&!r.nodeType&&r,Kt=Gt&&Gt.exports===Yt,Jt=Kt&&Wt.process,Xt=function(){try{var t=Gt&&Gt.require&&Gt.require("util").types;return t||Jt&&Jt.binding&&Jt.binding("util")}catch(t){}}(),Zt=Xt&&Xt.isArrayBuffer,te=Xt&&Xt.isDate,ee=Xt&&Xt.isMap,ne=Xt&&Xt.isRegExp,re=Xt&&Xt.isSet,ie=Xt&&Xt.isTypedArray;function oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ae(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function Ne(t,e){for(var n=t.length;n--&&be(e,t[n],0)>-1;);return n}function je(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Pe=ke({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Le=ke({"&":"&","<":"<",">":">",'"':""","'":"'"});function Re(t){return"\\"+Ht[t]}function Me(t){return Pt.test(t)}function Fe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ue(t,e){return function(n){return t(e(n))}}function He(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Ye=function t(e){var n,r=(e=null==e?Vt:Ye.defaults(Vt.Object(),e,Ye.pick(Vt,Rt))).Array,i=e.Date,ft=e.Error,pt=e.Function,ht=e.Math,vt=e.Object,mt=e.RegExp,gt=e.String,yt=e.TypeError,At=r.prototype,_t=pt.prototype,bt=vt.prototype,wt=e["__core-js_shared__"],Ct=_t.toString,xt=bt.hasOwnProperty,Tt=0,kt=(n=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Et=bt.toString,$t=Ct.call(vt),St=Vt._,Bt=mt("^"+Ct.call(xt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dt=Kt?e.Buffer:void 0,Nt=e.Symbol,Pt=e.Uint8Array,Ht=Dt?Dt.allocUnsafe:void 0,Wt=Ue(vt.getPrototypeOf,vt),Qt=vt.create,Yt=bt.propertyIsEnumerable,Gt=At.splice,Jt=Nt?Nt.isConcatSpreadable:void 0,Xt=Nt?Nt.iterator:void 0,ye=Nt?Nt.toStringTag:void 0,ke=function(){try{var t=Zi(vt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ge=e.clearTimeout!==Vt.clearTimeout&&e.clearTimeout,Ke=i&&i.now!==Vt.Date.now&&i.now,Je=e.setTimeout!==Vt.setTimeout&&e.setTimeout,Xe=ht.ceil,Ze=ht.floor,tn=vt.getOwnPropertySymbols,en=Dt?Dt.isBuffer:void 0,nn=e.isFinite,rn=At.join,on=Ue(vt.keys,vt),an=ht.max,sn=ht.min,cn=i.now,un=e.parseInt,ln=ht.random,dn=At.reverse,fn=Zi(e,"DataView"),pn=Zi(e,"Map"),hn=Zi(e,"Promise"),vn=Zi(e,"Set"),mn=Zi(e,"WeakMap"),gn=Zi(vt,"create"),yn=mn&&new mn,An={},_n=Eo(fn),bn=Eo(pn),wn=Eo(hn),Cn=Eo(vn),xn=Eo(mn),Tn=Nt?Nt.prototype:void 0,kn=Tn?Tn.valueOf:void 0,En=Tn?Tn.toString:void 0;function $n(t){if(qa(t)&&!Ia(t)&&!(t instanceof On)){if(t instanceof Dn)return t;if(xt.call(t,"__wrapped__"))return $o(t)}return new Dn(t)}var Sn=function(){function t(){}return function(e){if(!za(e))return{};if(Qt)return Qt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Bn(){}function Dn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function On(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Kn(t,e,n,r,i,o){var a,s=1&e,u=2&e,f=4&e;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!za(t))return t;var w=Ia(t);if(w){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&xt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return gi(t,a)}else{var I=no(t),N=I==p||I==h;if(La(t))return di(t,s);if(I==g||I==c||N&&!i){if(a=u||N?{}:io(t),!s)return u?function(t,e){return yi(t,eo(t),e)}(t,function(t,e){return t&&yi(e,bs(e),t)}(a,t)):function(t,e){return yi(t,to(t),e)}(t,Qn(a,t))}else{if(!Ut[I])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case C:return fi(t);case l:case d:return new r(+t);case x:return function(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case k:case E:case $:case S:case B:case"[object Uint8ClampedArray]":case D:case O:return pi(t,n);case v:return new r;case m:case _:return new r(t);case y:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new r;case b:return i=t,kn?vt(kn.call(i)):{}}var i}(t,I,s)}}o||(o=new Ln);var j=o.get(t);if(j)return j;o.set(t,a),Ga(t)?t.forEach((function(r){a.add(Kn(r,e,n,r,t,o))})):Wa(t)&&t.forEach((function(r,i){a.set(i,Kn(r,e,n,i,t,o))}));var P=w?void 0:(f?u?Qi:Wi:u?bs:_s)(t);return se(P||t,(function(r,i){P&&(r=t[i=r]),zn(a,i,Kn(r,e,n,i,t,o))})),a}function Jn(t,e,n){var r=n.length;if(null==t)return!r;for(t=vt(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Xn(t,e,n){if("function"!=typeof t)throw new yt(o);return _o((function(){t.apply(void 0,n)}),e)}function Zn(t,e,n,r){var i=-1,o=de,a=!0,s=t.length,c=[],u=e.length;if(!s)return c;n&&(e=pe(e,Be(n))),r?(o=fe,a=!1):e.length>=200&&(o=Oe,a=!1,e=new Pn(e));t:for(;++i-1},Nn.prototype.set=function(t,e){var n=this.__data__,r=qn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new In,map:new(pn||Nn),string:new In}},jn.prototype.delete=function(t){var e=Ji(this,t).delete(t);return this.size-=e?1:0,e},jn.prototype.get=function(t){return Ji(this,t).get(t)},jn.prototype.has=function(t){return Ji(this,t).has(t)},jn.prototype.set=function(t,e){var n=Ji(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Pn.prototype.add=Pn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.clear=function(){this.__data__=new Nn,this.size=0},Ln.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ln.prototype.get=function(t){return this.__data__.get(t)},Ln.prototype.has=function(t){return this.__data__.has(t)},Ln.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!pn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(t,e),this.size=n.size,this};var tr=bi(cr),er=bi(ur,!0);function nr(t,e){var n=!0;return tr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function rr(t,e,n){for(var r=-1,i=t.length;++r0&&n(s)?e>1?or(s,e-1,n,r,i):he(i,s):r||(i[i.length]=s)}return i}var ar=wi(),sr=wi(!0);function cr(t,e){return t&&ar(t,e,_s)}function ur(t,e){return t&&sr(t,e,_s)}function lr(t,e){return le(e,(function(e){return Fa(t[e])}))}function dr(t,e){for(var n=0,r=(e=si(e,t)).length;null!=t&&ne}function vr(t,e){return null!=t&&xt.call(t,e)}function mr(t,e){return null!=t&&e in vt(t)}function gr(t,e,n){for(var i=n?fe:de,o=t[0].length,a=t.length,s=a,c=r(a),u=1/0,l=[];s--;){var d=t[s];s&&e&&(d=pe(d,Be(e))),u=sn(d.length,u),c[s]=!n&&(e||o>=120&&d.length>=120)?new Pn(s&&d):void 0}d=t[0];var f=-1,p=c[0];t:for(;++f=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)}))}function Ir(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&Gt.call(s,c,1),Gt.call(t,c,1);return t}function jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;ao(i)?Gt.call(t,i,1):Zr(t,i)}}return t}function Pr(t,e){return t+Ze(ln()*(e-t+1))}function Lr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=Ze(e/2))&&(t+=t)}while(e);return n}function Rr(t,e){return bo(vo(t,e,Qs),t+"")}function Mr(t){return Mn(Ss(t))}function Fr(t,e){var n=Ss(t);return xo(n,Gn(e,0,n.length))}function Ur(t,e,n,r){if(!za(t))return t;for(var i=-1,o=(e=si(e,t)).length,a=o-1,s=t;null!=s&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!Ja(a)&&(n?a<=e:a=200){var u=e?null:Li(t);if(u)return ze(u);a=!1,i=Oe,c=new Pn}else c=e?[]:s;t:for(;++r=r?t:Wr(t,e,n)}var li=Ge||function(t){return Vt.clearTimeout(t)};function di(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function fi(t){var e=new t.constructor(t.byteLength);return new Pt(e).set(new Pt(t)),e}function pi(t,e){var n=e?fi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function hi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Ja(t),a=void 0!==e,s=null===e,c=e==e,u=Ja(e);if(!s&&!u&&!o&&t>e||o&&a&&c&&!s&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&t1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&so(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=vt(e);++r-1?i[o?e[a]:a]:void 0}}function Ei(t){return qi((function(e){var n=e.length,r=n,i=Dn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new yt(o);if(i&&!s&&"wrapper"==Yi(a))var s=new Dn([],!0)}for(r=s?r:n;++r1&&A.reverse(),d&&us))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var l=-1,d=!0,f=2&n?new Pn:void 0;for(o.set(t,e),o.set(e,t);++l-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(J,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return se(s,(function(n){var r="_."+n[0];e&n[1]&&!de(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(X);return e?e[1].split(Z):[]}(r),n)))}function Co(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function xo(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Yo(t,n)}));function ea(t){var e=$n(t);return e.__chain__=!0,e}function na(t,e){return e(t)}var ra=qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Yn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof On&&ao(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new Dn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var ia=Ai((function(t,e,n){xt.call(t,n)?++t[n]:Vn(t,n,1)}));var oa=ki(Oo),aa=ki(Io);function sa(t,e){return(Ia(t)?se:tr)(t,Ki(e,3))}function ca(t,e){return(Ia(t)?ce:er)(t,Ki(e,3))}var ua=Ai((function(t,e,n){xt.call(t,n)?t[n].push(e):Vn(t,n,[e])}));var la=Rr((function(t,e,n){var i=-1,o="function"==typeof e,a=ja(t)?r(t.length):[];return tr(t,(function(t){a[++i]=o?oe(e,t,n):yr(t,e,n)})),a})),da=Ai((function(t,e,n){Vn(t,n,e)}));function fa(t,e){return(Ia(t)?pe:Er)(t,Ki(e,3))}var pa=Ai((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var ha=Rr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&so(t,e[0],e[1])?e=[]:n>2&&so(e[0],e[1],e[2])&&(e=[e[0]]),Or(t,or(e,1),[])})),va=Ke||function(){return Vt.Date.now()};function ma(t,e,n){return e=n?void 0:e,Mi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ga(t,e){var n;if("function"!=typeof e)throw new yt(o);return t=rs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ya=Rr((function(t,e,n){var r=1;if(n.length){var i=He(n,Gi(ya));r|=32}return Mi(t,r,e,n,i)})),Aa=Rr((function(t,e,n){var r=3;if(n.length){var i=He(n,Gi(Aa));r|=32}return Mi(e,r,t,n,i)}));function _a(t,e,n){var r,i,a,s,c,u,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new yt(o);function h(e){var n=r,o=i;return r=i=void 0,l=e,s=t.apply(o,n)}function v(t){return l=t,c=_o(g,e),d?h(t):s}function m(t){var n=t-u;return void 0===u||n>=e||n<0||f&&t-l>=a}function g(){var t=va();if(m(t))return y(t);c=_o(g,function(t){var n=e-(t-u);return f?sn(n,a-(t-l)):n}(t))}function y(t){return c=void 0,p&&r?h(t):(r=i=void 0,s)}function A(){var t=va(),n=m(t);if(r=arguments,i=this,u=t,n){if(void 0===c)return v(u);if(f)return li(c),c=_o(g,e),h(u)}return void 0===c&&(c=_o(g,e)),s}return e=os(e)||0,za(n)&&(d=!!n.leading,a=(f="maxWait"in n)?an(os(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==c&&li(c),l=0,r=u=i=c=void 0},A.flush=function(){return void 0===c?s:y(va())},A}var ba=Rr((function(t,e){return Xn(t,1,e)})),wa=Rr((function(t,e,n){return Xn(t,os(e)||0,n)}));function Ca(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new yt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ca.Cache||jn),n}function xa(t){if("function"!=typeof t)throw new yt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ca.Cache=jn;var Ta=ci((function(t,e){var n=(e=1==e.length&&Ia(e[0])?pe(e[0],Be(Ki())):pe(or(e,1),Be(Ki()))).length;return Rr((function(r){for(var i=-1,o=sn(r.length,n);++i=e})),Oa=Ar(function(){return arguments}())?Ar:function(t){return qa(t)&&xt.call(t,"callee")&&!Yt.call(t,"callee")},Ia=r.isArray,Na=Zt?Be(Zt):function(t){return qa(t)&&pr(t)==C};function ja(t){return null!=t&&Ha(t.length)&&!Fa(t)}function Pa(t){return qa(t)&&ja(t)}var La=en||oc,Ra=te?Be(te):function(t){return qa(t)&&pr(t)==d};function Ma(t){if(!qa(t))return!1;var e=pr(t);return e==f||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Va(t)}function Fa(t){if(!za(t))return!1;var e=pr(t);return e==p||e==h||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ua(t){return"number"==typeof t&&t==rs(t)}function Ha(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function za(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qa(t){return null!=t&&"object"==typeof t}var Wa=ee?Be(ee):function(t){return qa(t)&&no(t)==v};function Qa(t){return"number"==typeof t||qa(t)&&pr(t)==m}function Va(t){if(!qa(t)||pr(t)!=g)return!1;var e=Wt(t);if(null===e)return!0;var n=xt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ct.call(n)==$t}var Ya=ne?Be(ne):function(t){return qa(t)&&pr(t)==y};var Ga=re?Be(re):function(t){return qa(t)&&no(t)==A};function Ka(t){return"string"==typeof t||!Ia(t)&&qa(t)&&pr(t)==_}function Ja(t){return"symbol"==typeof t||qa(t)&&pr(t)==b}var Xa=ie?Be(ie):function(t){return qa(t)&&Ha(t.length)&&!!Ft[pr(t)]};var Za=Ni(kr),ts=Ni((function(t,e){return t<=e}));function es(t){if(!t)return[];if(ja(t))return Ka(t)?Qe(t):gi(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=no(t);return(e==v?Fe:e==A?ze:Ss)(t)}function ns(t){return t?(t=os(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function rs(t){var e=ns(t),n=e%1;return e==e?n?e-n:e:0}function is(t){return t?Gn(rs(t),0,4294967295):0}function os(t){if("number"==typeof t)return t;if(Ja(t))return NaN;if(za(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=za(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Y,"");var n=ot.test(t);return n||st.test(t)?qt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function as(t){return yi(t,bs(t))}function ss(t){return null==t?"":Jr(t)}var cs=_i((function(t,e){if(fo(e)||ja(e))yi(e,_s(e),t);else for(var n in e)xt.call(e,n)&&zn(t,n,e[n])})),us=_i((function(t,e){yi(e,bs(e),t)})),ls=_i((function(t,e,n,r){yi(e,bs(e),t,r)})),ds=_i((function(t,e,n,r){yi(e,_s(e),t,r)})),fs=qi(Yn);var ps=Rr((function(t,e){t=vt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&so(e[0],e[1],i)&&(r=1);++n1),e})),yi(t,Qi(t),n),r&&(n=Kn(n,7,Hi));for(var i=e.length;i--;)Zr(n,e[i]);return n}));var Ts=qi((function(t,e){return null==t?{}:function(t,e){return Ir(t,e,(function(e,n){return ms(t,n)}))}(t,e)}));function ks(t,e){if(null==t)return{};var n=pe(Qi(t),(function(t){return[t]}));return e=Ki(e),Ir(t,n,(function(t,n){return e(t,n[0])}))}var Es=Ri(_s),$s=Ri(bs);function Ss(t){return null==t?[]:De(t,_s(t))}var Bs=xi((function(t,e,n){return e=e.toLowerCase(),t+(n?Ds(e):e)}));function Ds(t){return Ms(ss(t).toLowerCase())}function Os(t){return(t=ss(t))&&t.replace(ut,Pe).replace(It,"")}var Is=xi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ns=xi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),js=Ci("toLowerCase");var Ps=xi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ls=xi((function(t,e,n){return t+(n?" ":"")+Ms(e)}));var Rs=xi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ms=Ci("toUpperCase");function Fs(t,e,n){return t=ss(t),void 0===(e=n?void 0:e)?function(t){return Lt.test(t)}(t)?function(t){return t.match(jt)||[]}(t):function(t){return t.match(tt)||[]}(t):t.match(e)||[]}var Us=Rr((function(t,e){try{return oe(t,void 0,e)}catch(t){return Ma(t)?t:new ft(t)}})),Hs=qi((function(t,e){return se(e,(function(e){e=ko(e),Vn(t,e,ya(t[e],t))})),t}));function zs(t){return function(){return t}}var qs=Ei(),Ws=Ei(!0);function Qs(t){return t}function Vs(t){return Cr("function"==typeof t?t:Kn(t,1))}var Ys=Rr((function(t,e){return function(n){return yr(n,t,e)}})),Gs=Rr((function(t,e){return function(n){return yr(t,n,e)}}));function Ks(t,e,n){var r=_s(e),i=lr(e,r);null!=n||za(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=lr(e,_s(e)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Fa(t);return se(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,he([this.value()],arguments))})})),t}function Js(){}var Xs=Di(pe),Zs=Di(ue),tc=Di(ge);function ec(t){return co(t)?Te(ko(t)):function(t){return function(e){return dr(e,t)}}(t)}var nc=Ii(),rc=Ii(!0);function ic(){return[]}function oc(){return!1}var ac=Bi((function(t,e){return t+e}),0),sc=Pi("ceil"),cc=Bi((function(t,e){return t/e}),1),uc=Pi("floor");var lc,dc=Bi((function(t,e){return t*e}),1),fc=Pi("round"),pc=Bi((function(t,e){return t-e}),0);return $n.after=function(t,e){if("function"!=typeof e)throw new yt(o);return t=rs(t),function(){if(--t<1)return e.apply(this,arguments)}},$n.ary=ma,$n.assign=cs,$n.assignIn=us,$n.assignInWith=ls,$n.assignWith=ds,$n.at=fs,$n.before=ga,$n.bind=ya,$n.bindAll=Hs,$n.bindKey=Aa,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ia(t)?t:[t]},$n.chain=ea,$n.chunk=function(t,e,n){e=(n?so(t,e,n):void 0===e)?1:an(rs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=r(Xe(i/e));oi?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(t=ss(t))&&("string"==typeof e||null!=e&&!Ya(e))&&!(e=Jr(e))&&Me(t)?ui(Qe(t),0,n):t.split(e,n):[]},$n.spread=function(t,e){if("function"!=typeof t)throw new yt(o);return e=null==e?0:an(rs(e),0),Rr((function(n){var r=n[e],i=ui(n,0,e);return r&&he(i,r),oe(t,this,i)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?Wr(t,1,e):[]},$n.take=function(t,e,n){return t&&t.length?Wr(t,0,(e=n||void 0===e?1:rs(e))<0?0:e):[]},$n.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Wr(t,(e=r-(e=n||void 0===e?1:rs(e)))<0?0:e,r):[]},$n.takeRightWhile=function(t,e){return t&&t.length?ei(t,Ki(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?ei(t,Ki(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new yt(o);return za(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),_a(t,e,{leading:r,maxWait:e,trailing:i})},$n.thru=na,$n.toArray=es,$n.toPairs=Es,$n.toPairsIn=$s,$n.toPath=function(t){return Ia(t)?pe(t,ko):Ja(t)?[t]:gi(To(ss(t)))},$n.toPlainObject=as,$n.transform=function(t,e,n){var r=Ia(t),i=r||La(t)||Xa(t);if(e=Ki(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:za(t)&&Fa(o)?Sn(Wt(t)):{}}return(i?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},$n.unary=function(t){return ma(t,1)},$n.union=qo,$n.unionBy=Wo,$n.unionWith=Qo,$n.uniq=function(t){return t&&t.length?Xr(t):[]},$n.uniqBy=function(t,e){return t&&t.length?Xr(t,Ki(e,2)):[]},$n.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Xr(t,void 0,e):[]},$n.unset=function(t,e){return null==t||Zr(t,e)},$n.unzip=Vo,$n.unzipWith=Yo,$n.update=function(t,e,n){return null==t?t:ti(t,e,ai(n))},$n.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ti(t,e,ai(n),r)},$n.values=Ss,$n.valuesIn=function(t){return null==t?[]:De(t,bs(t))},$n.without=Go,$n.words=Fs,$n.wrap=function(t,e){return ka(ai(e),t)},$n.xor=Ko,$n.xorBy=Jo,$n.xorWith=Xo,$n.zip=Zo,$n.zipObject=function(t,e){return ii(t||[],e||[],zn)},$n.zipObjectDeep=function(t,e){return ii(t||[],e||[],Ur)},$n.zipWith=ta,$n.entries=Es,$n.entriesIn=$s,$n.extend=us,$n.extendWith=ls,Ks($n,$n),$n.add=ac,$n.attempt=Us,$n.camelCase=Bs,$n.capitalize=Ds,$n.ceil=sc,$n.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==e&&(e=(e=os(e))==e?e:0),Gn(os(t),e,n)},$n.clone=function(t){return Kn(t,4)},$n.cloneDeep=function(t){return Kn(t,5)},$n.cloneDeepWith=function(t,e){return Kn(t,5,e="function"==typeof e?e:void 0)},$n.cloneWith=function(t,e){return Kn(t,4,e="function"==typeof e?e:void 0)},$n.conformsTo=function(t,e){return null==e||Jn(t,e,_s(e))},$n.deburr=Os,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=cc,$n.endsWith=function(t,e,n){t=ss(t),e=Jr(e);var r=t.length,i=n=void 0===n?r:Gn(rs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},$n.eq=Sa,$n.escape=function(t){return(t=ss(t))&&M.test(t)?t.replace(L,Le):t},$n.escapeRegExp=function(t){return(t=ss(t))&&V.test(t)?t.replace(Q,"\\$&"):t},$n.every=function(t,e,n){var r=Ia(t)?ue:nr;return n&&so(t,e,n)&&(e=void 0),r(t,Ki(e,3))},$n.find=oa,$n.findIndex=Oo,$n.findKey=function(t,e){return Ae(t,Ki(e,3),cr)},$n.findLast=aa,$n.findLastIndex=Io,$n.findLastKey=function(t,e){return Ae(t,Ki(e,3),ur)},$n.floor=uc,$n.forEach=sa,$n.forEachRight=ca,$n.forIn=function(t,e){return null==t?t:ar(t,Ki(e,3),bs)},$n.forInRight=function(t,e){return null==t?t:sr(t,Ki(e,3),bs)},$n.forOwn=function(t,e){return t&&cr(t,Ki(e,3))},$n.forOwnRight=function(t,e){return t&&ur(t,Ki(e,3))},$n.get=vs,$n.gt=Ba,$n.gte=Da,$n.has=function(t,e){return null!=t&&ro(t,e,vr)},$n.hasIn=ms,$n.head=jo,$n.identity=Qs,$n.includes=function(t,e,n,r){t=ja(t)?t:Ss(t),n=n&&!r?rs(n):0;var i=t.length;return n<0&&(n=an(i+n,0)),Ka(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&be(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=an(r+i,0)),be(t,e,i)},$n.inRange=function(t,e,n){return e=ns(e),void 0===n?(n=e,e=0):n=ns(n),function(t,e,n){return t>=sn(e,n)&&t=-9007199254740991&&t<=9007199254740991},$n.isSet=Ga,$n.isString=Ka,$n.isSymbol=Ja,$n.isTypedArray=Xa,$n.isUndefined=function(t){return void 0===t},$n.isWeakMap=function(t){return qa(t)&&no(t)==w},$n.isWeakSet=function(t){return qa(t)&&"[object WeakSet]"==pr(t)},$n.join=function(t,e){return null==t?"":rn.call(t,e)},$n.kebabCase=Is,$n.last=Mo,$n.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?an(r+i,0):sn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):_e(t,Ce,i,!0)},$n.lowerCase=Ns,$n.lowerFirst=js,$n.lt=Za,$n.lte=ts,$n.max=function(t){return t&&t.length?rr(t,Qs,hr):void 0},$n.maxBy=function(t,e){return t&&t.length?rr(t,Ki(e,2),hr):void 0},$n.mean=function(t){return xe(t,Qs)},$n.meanBy=function(t,e){return xe(t,Ki(e,2))},$n.min=function(t){return t&&t.length?rr(t,Qs,kr):void 0},$n.minBy=function(t,e){return t&&t.length?rr(t,Ki(e,2),kr):void 0},$n.stubArray=ic,$n.stubFalse=oc,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=dc,$n.nth=function(t,e){return t&&t.length?Dr(t,rs(e)):void 0},$n.noConflict=function(){return Vt._===this&&(Vt._=St),this},$n.noop=Js,$n.now=va,$n.pad=function(t,e,n){t=ss(t);var r=(e=rs(e))?We(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Oi(Ze(i),n)+t+Oi(Xe(i),n)},$n.padEnd=function(t,e,n){t=ss(t);var r=(e=rs(e))?We(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=ln();return sn(t+i*(e-t+zt("1e-"+((i+"").length-1))),e)}return Pr(t,e)},$n.reduce=function(t,e,n){var r=Ia(t)?ve:Ee,i=arguments.length<3;return r(t,Ki(e,4),n,i,tr)},$n.reduceRight=function(t,e,n){var r=Ia(t)?me:Ee,i=arguments.length<3;return r(t,Ki(e,4),n,i,er)},$n.repeat=function(t,e,n){return e=(n?so(t,e,n):void 0===e)?1:rs(e),Lr(ss(t),e)},$n.replace=function(){var t=arguments,e=ss(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(t,e,n){var r=-1,i=(e=si(e,t)).length;for(i||(i=1,t=void 0);++r9007199254740991)return[];var n=4294967295,r=sn(t,4294967295);t-=4294967295;for(var i=Se(r,e=Ki(e));++n=o)return t;var s=n-We(r);if(s<1)return r;var c=a?ui(a,0,s).join(""):t.slice(0,s);if(void 0===i)return c+r;if(a&&(s+=c.length-s),Ya(i)){if(t.slice(s).search(i)){var u,l=c;for(i.global||(i=mt(i.source,ss(rt.exec(i))+"g")),i.lastIndex=0;u=i.exec(l);)var d=u.index;c=c.slice(0,void 0===d?s:d)}}else if(t.indexOf(Jr(i),s)!=s){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},$n.unescape=function(t){return(t=ss(t))&&R.test(t)?t.replace(P,Ve):t},$n.uniqueId=function(t){var e=++Tt;return ss(t)+e},$n.upperCase=Rs,$n.upperFirst=Ms,$n.each=sa,$n.eachRight=ca,$n.first=jo,Ks($n,(lc={},cr($n,(function(t,e){xt.call($n.prototype,e)||(lc[e]=t)})),lc),{chain:!1}),$n.VERSION="4.17.15",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),se(["drop","take"],(function(t,e){On.prototype[t]=function(n){n=void 0===n?1:an(rs(n),0);var r=this.__filtered__&&!e?new On(this):this.clone();return r.__filtered__?r.__takeCount__=sn(n,r.__takeCount__):r.__views__.push({size:sn(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},On.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;On.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ki(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");On.prototype[t]=function(){return this[n](1).value()[0]}})),se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");On.prototype[t]=function(){return this.__filtered__?new On(this):this[n](1)}})),On.prototype.compact=function(){return this.filter(Qs)},On.prototype.find=function(t){return this.filter(t).head()},On.prototype.findLast=function(t){return this.reverse().find(t)},On.prototype.invokeMap=Rr((function(t,e){return"function"==typeof t?new On(this):this.map((function(n){return yr(n,t,e)}))})),On.prototype.reject=function(t){return this.filter(xa(Ki(t)))},On.prototype.slice=function(t,e){t=rs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new On(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=rs(e))<0?n.dropRight(-e):n.take(e-t)),n)},On.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},cr(On.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=$n[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&($n.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof On,c=a[0],u=s||Ia(e),l=function(t){var e=i.apply($n,he([t],a));return r&&d?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(s=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=o&&!d,h=s&&!f;if(!o&&u){e=h?e:new On(this);var v=t.apply(e,a);return v.__actions__.push({func:na,args:[l],thisArg:void 0}),new Dn(v,d)}return p&&h?t.apply(this,a):(v=this.thru(l),p?r?v.value()[0]:v.value():v)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=At[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ia(i)?i:[],t)}return this[n]((function(n){return e.apply(Ia(n)?n:[],t)}))}})),cr(On.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";xt.call(An,r)||(An[r]=[]),An[r].push({name:e,func:n})}})),An[$i(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var t=new On(this.__wrapped__);return t.__actions__=gi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=gi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=gi(this.__views__),t},On.prototype.reverse=function(){if(this.__filtered__){var t=new On(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},On.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ia(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$n.prototype.plant=function(t){for(var e,n=this;n instanceof Bn;){var r=$o(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},$n.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof On){var e=t;return this.__actions__.length&&(e=new On(this)),(e=e.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new Dn(e,this.__chain__)}return this.thru(zo)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Xt&&($n.prototype[Xt]=function(){return this}),$n}();Vt._=Ye,void 0===(i=function(){return Ye}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(3),n(70)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,c=o.slice,u=o.concat,l=o.push,d=o.indexOf,f={},p=f.toString,h=f.hasOwnProperty,v=h.toString,m=v.call(Object),g={},y=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},A=function(t){return null!=t&&t===t.window},_={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,n){var r,i,o=(n=n||a).createElement("script");if(o.text=t,e)for(r in _)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?f[p.call(t)]||"object":typeof t}var C=function(t,e){return new C.fn.init(t,e)},x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(t){var e=!!t&&"length"in t&&t.length,n=w(t);return!y(t)&&!A(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}C.fn=C.prototype={jquery:"3.4.1",constructor:C,length:0,toArray:function(){return c.call(this)},get:function(t){return null==t?c.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),Q=new RegExp(F),V=new RegExp("^"+R+"$"),Y={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),nt=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){f()},at=_t((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(B=N.call(b.childNodes),b.childNodes),B[b.childNodes.length].nodeType}catch(t){I={apply:B.length?function(t,e){O.apply(t,N.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,u,l,d,h,g,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&((e?e.ownerDocument||e:b)!==p&&f(e),e=e||p,v)){if(11!==w&&(d=Z.exec(t)))if(o=d[1]){if(9===w){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(y&&(u=y.getElementById(o))&&A(e,u)&&u.id===o)return r.push(u),r}else{if(d[2])return I.apply(r,e.getElementsByTagName(t)),r;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!E[t+" "]&&(!m||!m.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===w&&W.test(t)){for((l=e.getAttribute("id"))?l=l.replace(rt,it):e.setAttribute("id",l=_),s=(h=a(t)).length;s--;)h[s]="#"+l+" "+At(h[s]);g=h.join(","),y=tt.test(t)&>(e.parentNode)||e}try{return I.apply(r,y.querySelectorAll(g)),r}catch(e){E(t,!0)}finally{l===_&&e.removeAttribute("id")}}}return c(t.replace(H,"$1"),e,r,i)}function ct(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[_]=!0,t}function lt(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function ft(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function vt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ut((function(e){return e=+e,ut((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!G.test(e||n&&n.nodeName||"HTML")},f=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:b;return a!==p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,v=!o(p),b!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.attributes=lt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=lt((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(p.getElementsByClassName),n.getById=lt((function(t){return h.appendChild(t).id=_,!p.getElementsByName||!p.getElementsByName(_).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},g=[],m=[],(n.qsa=X.test(p.querySelectorAll))&&(lt((function(t){h.appendChild(t).innerHTML=" ",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+L+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+_+"-]").length||m.push("~="),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+_+"+*").length||m.push(".#.+[+~]")})),lt((function(t){t.innerHTML=" ";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=X.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&<((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",F)})),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),e=X.test(h.compareDocumentPosition),A=e||X.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},$=e?function(t,e){if(t===e)return d=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t===p||t.ownerDocument===b&&A(b,t)?-1:e===p||e.ownerDocument===b&&A(b,e)?1:l?j(l,t)-j(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t===p?-1:e===p?1:i?-1:o?1:l?j(l,t)-j(l,e):0;if(i===o)return ft(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ft(a[r],s[r]):a[r]===b?-1:s[r]===b?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if((t.ownerDocument||t)!==p&&f(t),n.matchesSelector&&v&&!E[e+" "]&&(!g||!g.test(e))&&(!m||!m.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){E(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!==p&&f(t),A(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!==p&&f(t);var i=r.attrHandle[e.toLowerCase()],o=i&&S.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(d=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort($),d){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ut,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Q.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=x[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&x(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,c){var u,l,d,f,p,h,v=o!==a?"nextSibling":"previousSibling",m=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!c&&!s,A=!1;if(m){if(o){for(;v;){for(f=e;f=f[v];)if(s?f.nodeName.toLowerCase()===g:1===f.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(A=(p=(u=(l=(d=(f=m)[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],f=p&&m.childNodes[p];f=++p&&f&&f[v]||(A=p=0)||h.pop();)if(1===f.nodeType&&++A&&f===e){l[t]=[w,p,A];break}}else if(y&&(A=p=(u=(l=(d=(f=e)[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===A)for(;(f=++p&&f&&f[v]||(A=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==g:1!==f.nodeType)||!++A||(y&&((l=(d=f[_]||(f[_]={}))[f.uniqueID]||(d[f.uniqueID]={}))[t]=[w,A]),f!==e)););return(A-=i)===r||A%r==0&&A/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[_]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=j(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ut((function(t){var e=[],n=[],r=s(t.replace(H,"$1"));return r[_]?ut((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return st(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ut((function(t){return V.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:vt(!1),disabled:vt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:mt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function wt(t,e,n,r,i){for(var o,a=[],s=0,c=t.length,u=null!=e;s-1&&(o[u]=!(a[u]=d))}}else g=wt(g===a?g.splice(h,g.length):g),i?i(null,a,g,c):I.apply(a,g)}))}function xt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],c=a?1:0,l=_t((function(t){return t===e}),s,!0),d=_t((function(t){return j(e,t)>-1}),s,!0),f=[function(t,n,r){var i=!a&&(r||n!==u)||((e=n).nodeType?l(t,n,r):d(t,n,r));return e=null,i}];c1&&bt(f),c>1&&At(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(H,"$1"),n,c0,i=t.length>0,o=function(o,a,s,c,l){var d,h,m,g=0,y="0",A=o&&[],_=[],b=u,C=o||i&&r.find.TAG("*",l),x=w+=null==b?1:Math.random()||.1,T=C.length;for(l&&(u=a===p||a||l);y!==T&&null!=(d=C[y]);y++){if(i&&d){for(h=0,a||d.ownerDocument===p||(f(d),s=!v);m=t[h++];)if(m(d,a||p,s)){c.push(d);break}l&&(w=x)}n&&((d=!m&&d)&&g--,o&&A.push(d))}if(g+=y,n&&y!==g){for(h=0;m=e[h++];)m(A,_,a,s);if(o){if(g>0)for(;y--;)A[y]||_[y]||(_[y]=D.call(c));_=wt(_)}I.apply(c,_),l&&!o&&_.length>0&&g+e.length>1&&st.uniqueSort(c)}return l&&(w=x,u=b),A};return n?ut(o):o}(o,i))).selector=t}return s},c=st.select=function(t,e,n,i){var o,c,u,l,d,f="function"==typeof t&&t,p=!i&&a(t=f.selector||t);if(n=n||[],1===p.length){if((c=p[0]=p[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&9===e.nodeType&&v&&r.relative[c[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;f&&(e=e.parentNode),t=t.slice(c.shift().value.length)}for(o=Y.needsContext.test(t)?0:c.length;o--&&(u=c[o],!r.relative[l=u.type]);)if((d=r.find[l])&&(i=d(u.matches[0].replace(et,nt),tt.test(c[0].type)&>(e.parentNode)||e))){if(c.splice(o,1),!(t=i.length&&At(c)))return I.apply(n,i),n;break}}return(f||s(t,p))(i,e,!v,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=_.split("").sort($).join("")===_,n.detectDuplicates=!!d,f(),n.sortDetached=lt((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),lt((function(t){return t.innerHTML=" ","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&<((function(t){return t.innerHTML=" ",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),lt((function(t){return null==t.getAttribute("disabled")}))||dt(P,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);C.find=k,C.expr=k.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=k.uniqueSort,C.text=k.getText,C.isXMLDoc=k.isXML,C.contains=k.contains,C.escapeSelector=k.escape;var E=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&C(t).is(n))break;r.push(t)}return r},$=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=C.expr.match.needsContext;function B(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function O(t,e,n){return y(e)?C.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?C.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?C.grep(t,(function(t){return d.call(e,t)>-1!==n})):C.filter(e,t,n)}C.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?C.find.matchesSelector(r,t)?[r]:[]:C.find.matches(t,C.grep(e,(function(t){return 1===t.nodeType})))},C.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(C(t).filter((function(){for(e=0;e1?C.uniqueSort(n):n},filter:function(t){return this.pushStack(O(this,t||[],!1))},not:function(t){return this.pushStack(O(this,t||[],!0))},is:function(t){return!!O(this,"string"==typeof t&&S.test(t)?C(t):t||[],!1).length}});var I,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||I,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),D.test(r[1])&&C.isPlainObject(e))for(r in e)y(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(C):C.makeArray(t,this)}).prototype=C.fn,I=C(a);var j=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}C.fn.extend({has:function(t){var e=C(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&C.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?d.call(C(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E(t,"parentNode")},parentsUntil:function(t,e,n){return E(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return E(t,"nextSibling")},prevAll:function(t){return E(t,"previousSibling")},nextUntil:function(t,e,n){return E(t,"nextSibling",n)},prevUntil:function(t,e,n){return E(t,"previousSibling",n)},siblings:function(t){return $((t.parentNode||{}).firstChild,t)},children:function(t){return $(t.firstChild)},contents:function(t){return void 0!==t.contentDocument?t.contentDocument:(B(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},(function(t,e){C.fn[t]=function(n,r){var i=C.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=C.filter(r,i)),this.length>1&&(P[t]||C.uniqueSort(i),j.test(t)&&i.reverse()),this.pushStack(i)}}));var R=/[^\x20\t\r\n\f]+/g;function M(t){return t}function F(t){throw t}function U(t,e,n,r){var i;try{t&&y(i=t.promise)?i.call(t).done(e).fail(n):t&&y(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}C.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return C.each(t.match(R)||[],(function(t,n){e[n]=!0})),e}(t):C.extend({},t);var e,n,r,i,o=[],a=[],s=-1,c=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?C.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},C.extend({Deferred:function(t){var e=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return C.Deferred((function(n){C.each(e,(function(e,r){var i=y(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,c=arguments,u=function(){var n,u;if(!(t=o&&(r!==F&&(s=void 0,c=[n]),e.rejectWith(s,c))}};t?l():(C.Deferred.getStackHook&&(l.stackTrace=C.Deferred.getStackHook()),n.setTimeout(l))}}return C.Deferred((function(n){e[0][3].add(a(0,n,y(i)?i:M,n.notifyWith)),e[1][3].add(a(0,n,y(t)?t:M)),e[2][3].add(a(0,n,y(r)?r:F))})).promise()},promise:function(t){return null!=t?C.extend(t,i):i}},o={};return C.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=c.call(arguments),o=C.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?c.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(U(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||y(i[n]&&i[n].then)))return o.then();for(;n--;)U(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&H.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},C.readyException=function(t){n.setTimeout((function(){throw t}))};var z=C.Deferred();function q(){a.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),C.ready()}C.fn.ready=function(t){return z.then(t).catch((function(t){C.readyException(t)})),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||z.resolveWith(a,[C]))}}),C.ready.then=z.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(C.ready):(a.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var W=function(t,e,n,r,i,o,a){var s=0,c=t.length,u=null==n;if("object"===w(n))for(s in i=!0,n)W(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,y(r)||(a=!0),u&&(a?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(C(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){Z.remove(this,t)}))}}),C.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=X.get(t,e),n&&(!r||Array.isArray(n)?r=X.access(t,e,C.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=C.queue(t,e),r=n.length,i=n.shift(),o=C._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){C.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return X.get(t,n)||X.access(t,n,{empty:C.Callbacks("once memory").add((function(){X.remove(t,[e+"queue",n])}))})}}),C.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i,yt={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function At(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&B(t,e)?C.merge([t],n):n}function _t(t,e){for(var n=0,r=t.length;n-1)i&&i.push(o);else if(u=st(o),a=At(d.appendChild(o),"script"),u&&_t(a),n)for(l=0;o=a[l++];)gt.test(o.type||"")&&n.push(o);return d}bt=a.createDocumentFragment().appendChild(a.createElement("div")),(wt=a.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),bt.appendChild(wt),g.checkClone=bt.cloneNode(!0).cloneNode(!0).lastChild.checked,bt.innerHTML="",g.noCloneChecked=!!bt.cloneNode(!0).lastChild.defaultValue;var Tt=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Et=/^([^.]*)(?:\.(.+)|)/;function $t(){return!0}function St(){return!1}function Bt(t,e){return t===function(){try{return a.activeElement}catch(t){}}()==("focus"===e)}function Dt(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)Dt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=St;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return C().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=C.guid++)),t.each((function(){C.event.add(this,e,i,r,n)}))}function Ot(t,e,n){n?(X.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=X.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=c.call(arguments),X.set(this,e,o),r=n(this,e),this[e](),o!==(i=X.get(this,e))||r?X.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i.value}else o.length&&(X.set(this,e,{value:C.event.trigger(C.extend(o[0],C.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===X.get(t,e)&&C.event.add(t,e,$t)}C.event={global:{},add:function(t,e,n,r,i){var o,a,s,c,u,l,d,f,p,h,v,m=X.get(t);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&C.find.matchesSelector(at,i),n.guid||(n.guid=C.guid++),(c=m.events)||(c=m.events={}),(a=m.handle)||(a=m.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(R)||[""]).length;u--;)p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=C.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=C.event.special[p]||{},l=C.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&C.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=c[p])||((f=c[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),d.add&&(d.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),C.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,c,u,l,d,f,p,h,v,m=X.hasData(t)&&X.get(t);if(m&&(c=m.events)){for(u=(e=(e||"").match(R)||[""]).length;u--;)if(p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=C.event.special[p]||{},f=c[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)l=f[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,d.remove&&d.remove.call(t,l));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(t,h,m.handle)||C.removeEvent(t,p,m.handle),delete c[p])}else for(p in c)C.event.remove(t,p+e[u],n,r,!0);C.isEmptyObject(c)&&X.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=C.event.fix(t),c=new Array(arguments.length),u=(X.get(this,"events")||{})[s.type]||[],l=C.event.special[s.type]||{};for(c[0]=s,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:C.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,c\x20\t\r\n\f]*)[^>]*)\/>/gi,Nt=/