diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 4d0859b1988..94addb2b785 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -323,6 +323,7 @@ class AppManager implements IAppManager { public function clearAppsCache() { $settingsMemCache = $this->memCacheFactory->createDistributed('settings'); $settingsMemCache->clear('listApps'); + $this->appInfos = []; } /** diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 70f1b16e3c6..0a5d31a9873 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -887,6 +887,7 @@ class OC_App { } self::registerAutoloading($appId, $appPath); + \OC::$server->getAppManager()->clearAppsCache(); $appData = self::getAppInfo($appId); self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); @@ -900,6 +901,7 @@ class OC_App { self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']); self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']); // update appversion in app manager + \OC::$server->getAppManager()->clearAppsCache(); \OC::$server->getAppManager()->getAppVersion($appId, false); // run upgrade code diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 4840d71d756..b0d04500f35 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -100,6 +100,7 @@ interface IAppManager { * * @param string $appId * @param \OCP\IGroup[] $groups + * @throws \Exception * @since 8.0.0 */ public function enableAppForGroups($appId, $groups); diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index 325b6a0daf0..8cfa2a004e4 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -38,11 +38,14 @@ use OC\App\AppStore\Version\VersionParser; use OC\App\DependencyAnalyzer; use OC\App\Platform; use OC\Installer; +use OC_App; use OCP\App\IAppManager; use \OCP\AppFramework\Controller; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\ContentSecurityPolicy; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\TemplateResponse; +use OCP\ILogger; use OCP\INavigationManager; use OCP\IRequest; use OCP\IL10N; @@ -54,11 +57,6 @@ use OCP\L10N\IFactory; * @package OC\Settings\Controller */ class AppSettingsController extends Controller { - const CAT_ENABLED = 0; - const CAT_DISABLED = 1; - const CAT_ALL_INSTALLED = 2; - const CAT_APP_BUNDLES = 3; - const CAT_UPDATES = 4; /** @var \OCP\IL10N */ private $l10n; @@ -80,6 +78,11 @@ class AppSettingsController extends Controller { private $installer; /** @var IURLGenerator */ private $urlGenerator; + /** @var ILogger */ + private $logger; + + /** @var array */ + private $allApps = []; /** * @param string $appName @@ -94,6 +97,7 @@ class AppSettingsController extends Controller { * @param BundleFetcher $bundleFetcher * @param Installer $installer * @param IURLGenerator $urlGenerator + * @param ILogger $logger */ public function __construct(string $appName, IRequest $request, @@ -106,7 +110,8 @@ class AppSettingsController extends Controller { IFactory $l10nFactory, BundleFetcher $bundleFetcher, Installer $installer, - IURLGenerator $urlGenerator) { + IURLGenerator $urlGenerator, + ILogger $logger) { parent::__construct($appName, $request); $this->l10n = $l10n; $this->config = $config; @@ -118,26 +123,25 @@ class AppSettingsController extends Controller { $this->bundleFetcher = $bundleFetcher; $this->installer = $installer; $this->urlGenerator = $urlGenerator; + $this->logger = $logger; } /** * @NoCSRFRequired * - * @param string $category * @return TemplateResponse */ - public function viewApps($category = '') { - if ($category === '') { - $category = 'installed'; - } - + public function viewApps(): TemplateResponse { + \OC_Util::addScript('settings', 'apps'); + \OC_Util::addVendorScript('core', 'marked/marked.min'); $params = []; - $params['category'] = $category; $params['appstoreEnabled'] = $this->config->getSystemValue('appstoreenabled', true) === true; - $params['urlGenerator'] = $this->urlGenerator; + $params['updateCount'] = count($this->getAppsWithUpdates()); + $params['developerDocumentation'] = $this->urlGenerator->linkToDocs('developer-manual'); + $params['bundles'] = $this->getBundles(); $this->navigationManager->setActiveEntry('core_apps'); - $templateResponse = new TemplateResponse($this->appName, 'apps', $params, 'user'); + $templateResponse = new TemplateResponse('settings', 'settings', ['serverData' => $params]); $policy = new ContentSecurityPolicy(); $policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com'); $templateResponse->setContentSecurityPolicy($policy); @@ -145,17 +149,45 @@ class AppSettingsController extends Controller { return $templateResponse; } + private function getAppsWithUpdates() { + $appClass = new \OC_App(); + $apps = $appClass->listAllApps(); + foreach($apps as $key => $app) { + $newVersion = $this->installer->isUpdateAvailable($app['id']); + if($newVersion === false) { + unset($apps[$key]); + } + } + return $apps; + } + + private function getBundles() { + $result = []; + $bundles = $this->bundleFetcher->getBundles(); + foreach ($bundles as $bundle) { + $result[] = [ + 'name' => $bundle->getName(), + 'id' => $bundle->getIdentifier(), + 'appIdentifiers' => $bundle->getAppIdentifiers() + ]; + } + return $result; + + } + + /** + * Get all available categories + * + * @return JSONResponse + */ + public function listCategories(): JSONResponse { + return new JSONResponse($this->getAllCategories()); + } + private function getAllCategories() { $currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2); - $updateCount = count($this->getAppsWithUpdates()); - $formattedCategories = [ - ['id' => self::CAT_ALL_INSTALLED, 'ident' => 'installed', 'displayName' => (string)$this->l10n->t('Your apps')], - ['id' => self::CAT_UPDATES, 'ident' => 'updates', 'displayName' => (string)$this->l10n->t('Updates'), 'counter' => $updateCount], - ['id' => self::CAT_ENABLED, 'ident' => 'enabled', 'displayName' => (string)$this->l10n->t('Enabled apps')], - ['id' => self::CAT_DISABLED, 'ident' => 'disabled', 'displayName' => (string)$this->l10n->t('Disabled apps')], - ['id' => self::CAT_APP_BUNDLES, 'ident' => 'app-bundles', 'displayName' => (string)$this->l10n->t('App bundles')], - ]; + $formattedCategories = []; $categories = $this->categoryFetcher->get(); foreach($categories as $category) { $formattedCategories[] = [ @@ -168,39 +200,117 @@ class AppSettingsController extends Controller { return $formattedCategories; } + private function fetchApps() { + $appClass = new \OC_App(); + $apps = $appClass->listAllApps(); + foreach ($apps as $app) { + $app['installed'] = true; + $this->allApps[$app['id']] = $app; + } + + $apps = $this->getAppsForCategory(''); + foreach ($apps as $app) { + $app['appstore'] = true; + if (!array_key_exists($app['id'], $this->allApps)) { + $this->allApps[$app['id']] = $app; + } else { + $this->allApps[$app['id']] = array_merge($this->allApps[$app['id']], $app); + } + } + + // add bundle information + $bundles = $this->bundleFetcher->getBundles(); + foreach($bundles as $bundle) { + foreach($bundle->getAppIdentifiers() as $identifier) { + foreach($this->allApps as &$app) { + if($app['id'] === $identifier) { + $app['bundleId'] = $bundle->getIdentifier(); + continue; + } + } + } + } + } + + private function getAllApps() { + return $this->allApps; + } /** - * Get all available categories + * Get all available apps in a category * + * @param string $category * @return JSONResponse + * @throws \Exception */ - public function listCategories() { - return new JSONResponse($this->getAllCategories()); + public function listApps(): JSONResponse { + + $this->fetchApps(); + $apps = $this->getAllApps(); + + $dependencyAnalyzer = new DependencyAnalyzer(new Platform($this->config), $this->l10n); + + // Extend existing app details + $apps = array_map(function($appData) use ($dependencyAnalyzer) { + $appstoreData = $appData['appstoreData']; + $appData['screenshot'] = isset($appstoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appstoreData['screenshots'][0]['url']) : ''; + + $newVersion = $this->installer->isUpdateAvailable($appData['id']); + if($newVersion && $this->appManager->isInstalled($appData['id'])) { + $appData['update'] = $newVersion; + } + + // fix groups to be an array + $groups = array(); + if (is_string($appData['groups'])) { + $groups = json_decode($appData['groups']); + } + $appData['groups'] = $groups; + $appData['canUnInstall'] = !$appData['active'] && $appData['removable']; + + // fix licence vs license + if (isset($appData['license']) && !isset($appData['licence'])) { + $appData['licence'] = $appData['license']; + } + + // analyse dependencies + $missing = $dependencyAnalyzer->analyze($appData); + $appData['canInstall'] = empty($missing); + $appData['missingDependencies'] = $missing; + + $appData['missingMinOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['min-version']); + $appData['missingMaxOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['max-version']); + + return $appData; + }, $apps); + + usort($apps, [$this, 'sortApps']); + + return new JSONResponse(['apps' => $apps, 'status' => 'success']); } /** - * Get all apps for a category + * Get all apps for a category from the app store * * @param string $requestedCategory * @return array + * @throws \Exception */ - private function getAppsForCategory($requestedCategory) { + private function getAppsForCategory($requestedCategory = ''): array { $versionParser = new VersionParser(); $formattedApps = []; $apps = $this->appFetcher->get(); foreach($apps as $app) { - if (isset($app['isFeatured'])) { - $app['featured'] = $app['isFeatured']; - } - // Skip all apps not in the requested category - $isInCategory = false; - foreach($app['categories'] as $category) { - if($category === $requestedCategory) { - $isInCategory = true; + if ($requestedCategory !== '') { + $isInCategory = false; + foreach($app['categories'] as $category) { + if($category === $requestedCategory) { + $isInCategory = true; + } + } + if(!$isInCategory) { + continue; } - } - if(!$isInCategory) { - continue; } $nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']); @@ -240,7 +350,7 @@ class AppSettingsController extends Controller { $currentVersion = ''; if($this->appManager->isInstalled($app['id'])) { - $currentVersion = \OC_App::getAppVersion($app['id']); + $currentVersion = $this->appManager->getAppVersion($app['id']); } else { $currentLanguage = $app['releases'][0]['version']; } @@ -249,6 +359,7 @@ class AppSettingsController extends Controller { 'id' => $app['id'], 'name' => isset($app['translations'][$currentLanguage]['name']) ? $app['translations'][$currentLanguage]['name'] : $app['translations']['en']['name'], 'description' => isset($app['translations'][$currentLanguage]['description']) ? $app['translations'][$currentLanguage]['description'] : $app['translations']['en']['description'], + 'summary' => isset($app['translations'][$currentLanguage]['summary']) ? $app['translations'][$currentLanguage]['summary'] : $app['translations']['en']['summary'], 'license' => $app['releases'][0]['licenses'], 'author' => $authors, 'shipped' => false, @@ -267,208 +378,168 @@ class AppSettingsController extends Controller { $nextCloudVersionDependencies, $phpDependencies ), - 'level' => ($app['featured'] === true) ? 200 : 100, + 'level' => ($app['isFeatured'] === true) ? 200 : 100, 'missingMaxOwnCloudVersion' => false, 'missingMinOwnCloudVersion' => false, 'canInstall' => true, - 'preview' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($app['screenshots'][0]['url']) : '', + 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($app['screenshots'][0]['url']) : '', 'score' => $app['ratingOverall'], 'ratingNumOverall' => $app['ratingNumOverall'], - 'ratingNumThresholdReached' => $app['ratingNumOverall'] > 5 ? true : false, + 'ratingNumThresholdReached' => $app['ratingNumOverall'] > 5, 'removable' => $existsLocally, 'active' => $this->appManager->isEnabledForUser($app['id']), 'needsDownload' => !$existsLocally, 'groups' => $groups, 'fromAppStore' => true, + 'appstoreData' => $app, ]; - - - $newVersion = $this->installer->isUpdateAvailable($app['id']); - if($newVersion && $this->appManager->isInstalled($app['id'])) { - $formattedApps[count($formattedApps)-1]['update'] = $newVersion; - } } return $formattedApps; } - private function getAppsWithUpdates() { - $appClass = new \OC_App(); - $apps = $appClass->listAllApps(); - foreach($apps as $key => $app) { - $newVersion = $this->installer->isUpdateAvailable($app['id']); - if($newVersion !== false) { - $apps[$key]['update'] = $newVersion; - } else { - unset($apps[$key]); - } - } - usort($apps, function ($a, $b) { - $a = (string)$a['name']; - $b = (string)$b['name']; - if ($a === $b) { - return 0; - } - return ($a < $b) ? -1 : 1; - }); - return $apps; + /** + * @PasswordConfirmationRequired + * + * @param string $appId + * @param array $groups + * @return JSONResponse + */ + public function enableApp(string $appId, array $groups = []): JSONResponse { + return $this->enableApps([$appId], $groups); } /** - * Get all available apps in a category + * Enable one or more apps * - * @param string $category + * apps will be enabled for specific groups only if $groups is defined + * + * @PasswordConfirmationRequired + * @param array $appIds + * @param array $groups * @return JSONResponse */ - public function listApps($category = '') { - $appClass = new \OC_App(); + public function enableApps(array $appIds, array $groups = []): JSONResponse { + try { + $updateRequired = false; - switch ($category) { - // installed apps - case 'installed': - $apps = $appClass->listAllApps(); + foreach ($appIds as $appId) { + $appId = OC_App::cleanAppId($appId); - foreach($apps as $key => $app) { - $newVersion = $this->installer->isUpdateAvailable($app['id']); - $apps[$key]['update'] = $newVersion; - } + // Check if app is already downloaded + /** @var Installer $installer */ + $installer = \OC::$server->query(Installer::class); + $isDownloaded = $installer->isDownloaded($appId); - usort($apps, function ($a, $b) { - $a = (string)$a['name']; - $b = (string)$b['name']; - if ($a === $b) { - return 0; - } - return ($a < $b) ? -1 : 1; - }); - break; - // updates - case 'updates': - $apps = $this->getAppsWithUpdates(); - break; - // enabled apps - case 'enabled': - $apps = $appClass->listAllApps(); - $apps = array_filter($apps, function ($app) { - return $app['active']; - }); - - foreach($apps as $key => $app) { - $newVersion = $this->installer->isUpdateAvailable($app['id']); - $apps[$key]['update'] = $newVersion; + if(!$isDownloaded) { + $installer->downloadApp($appId); } - usort($apps, function ($a, $b) { - $a = (string)$a['name']; - $b = (string)$b['name']; - if ($a === $b) { - return 0; - } - return ($a < $b) ? -1 : 1; - }); - break; - // disabled apps - case 'disabled': - $apps = $appClass->listAllApps(); - $apps = array_filter($apps, function ($app) { - return !$app['active']; - }); - - $apps = array_map(function ($app) { - $newVersion = $this->installer->isUpdateAvailable($app['id']); - if ($newVersion !== false) { - $app['update'] = $newVersion; - } - return $app; - }, $apps); - - usort($apps, function ($a, $b) { - $a = (string)$a['name']; - $b = (string)$b['name']; - if ($a === $b) { - return 0; - } - return ($a < $b) ? -1 : 1; - }); - break; - case 'app-bundles': - $bundles = $this->bundleFetcher->getBundles(); - $apps = []; - foreach($bundles as $bundle) { - $newCategory = true; - $allApps = $appClass->listAllApps(); - $categories = $this->getAllCategories(); - foreach($categories as $singleCategory) { - $newApps = $this->getAppsForCategory($singleCategory['id']); - foreach($allApps as $app) { - foreach($newApps as $key => $newApp) { - if($app['id'] === $newApp['id']) { - unset($newApps[$key]); - } - } - } - $allApps = array_merge($allApps, $newApps); - } + $installer->installApp($appId); - foreach($bundle->getAppIdentifiers() as $identifier) { - foreach($allApps as $app) { - if($app['id'] === $identifier) { - if($newCategory) { - $app['newCategory'] = true; - $app['categoryName'] = $bundle->getName(); - } - $app['bundleId'] = $bundle->getIdentifier(); - $newCategory = false; - $apps[] = $app; - continue; - } - } - } + if (count($groups) > 0) { + $this->appManager->enableAppForGroups($appId, $this->getGroupList($groups)); + } else { + $this->appManager->enableApp($appId); } - break; - default: - $apps = $this->getAppsForCategory($category); - - // sort by score - usort($apps, function ($a, $b) { - $a = (int)$a['score']; - $b = (int)$b['score']; - if ($a === $b) { - return 0; - } - return ($a > $b) ? -1 : 1; - }); - break; - } + if (\OC_App::shouldUpgrade($appId)) { + $updateRequired = true; + } + } + return new JSONResponse(['data' => ['update_required' => $updateRequired]]); - // fix groups to be an array - $dependencyAnalyzer = new DependencyAnalyzer(new Platform($this->config), $this->l10n); - $apps = array_map(function($app) use ($dependencyAnalyzer) { + } catch (\Exception $e) { + $this->logger->logException($e); + return new JSONResponse(['data' => ['message' => $e->getMessage()]], Http::STATUS_INTERNAL_SERVER_ERROR); + } + } - // fix groups - $groups = array(); - if (is_string($app['groups'])) { - $groups = json_decode($app['groups']); + private function getGroupList(array $groups) { + $groupManager = \OC::$server->getGroupManager(); + $groupsList = []; + foreach ($groups as $group) { + $groupItem = $groupManager->get($group); + if ($groupItem instanceof \OCP\IGroup) { + $groupsList[] = $groupManager->get($group); } - $app['groups'] = $groups; - $app['canUnInstall'] = !$app['active'] && $app['removable']; + } + return $groupsList; + } - // fix licence vs license - if (isset($app['license']) && !isset($app['licence'])) { - $app['licence'] = $app['license']; + /** + * @PasswordConfirmationRequired + * + * @param string $appId + * @return JSONResponse + */ + public function disableApp(string $appId): JSONResponse { + return $this->disableApps([$appId]); + } + + /** + * @PasswordConfirmationRequired + * + * @param array $appIds + * @return JSONResponse + */ + public function disableApps(array $appIds): JSONResponse { + try { + foreach ($appIds as $appId) { + $appId = OC_App::cleanAppId($appId); + $this->appManager->disableApp($appId); } + return new JSONResponse([]); + } catch (\Exception $e) { + $this->logger->logException($e); + return new JSONResponse(['data' => ['message' => $e->getMessage()]], Http::STATUS_INTERNAL_SERVER_ERROR); + } + } - // analyse dependencies - $missing = $dependencyAnalyzer->analyze($app); - $app['canInstall'] = empty($missing); - $app['missingDependencies'] = $missing; + /** + * @PasswordConfirmationRequired + * + * @param string $appId + * @return JSONResponse + */ + public function uninstallApp(string $appId): JSONResponse { + $appId = OC_App::cleanAppId($appId); + $result = $this->installer->removeApp($appId); + if($result !== false) { + $this->appManager->clearAppsCache(); + return new JSONResponse(['data' => ['appid' => $appId]]); + } + return new JSONResponse(['data' => ['message' => $this->l10n->t('Couldn\'t remove app.')]], Http::STATUS_INTERNAL_SERVER_ERROR); + } - $app['missingMinOwnCloudVersion'] = !isset($app['dependencies']['nextcloud']['@attributes']['min-version']); - $app['missingMaxOwnCloudVersion'] = !isset($app['dependencies']['nextcloud']['@attributes']['max-version']); + /** + * @param string $appId + * @return JSONResponse + */ + public function updateApp(string $appId): JSONResponse { + $appId = OC_App::cleanAppId($appId); + + $this->config->setSystemValue('maintenance', true); + try { + $result = $this->installer->updateAppstoreApp($appId); + $this->config->setSystemValue('maintenance', false); + } catch (\Exception $ex) { + $this->config->setSystemValue('maintenance', false); + return new JSONResponse(['data' => ['message' => $ex->getMessage()]], Http::STATUS_INTERNAL_SERVER_ERROR); + } - return $app; - }, $apps); + if ($result !== false) { + return new JSONResponse(['data' => ['appid' => $appId]]); + } + return new JSONResponse(['data' => ['message' => $this->l10n->t('Couldn\'t update app.')]], Http::STATUS_INTERNAL_SERVER_ERROR); + } - return new JSONResponse(['apps' => $apps, 'status' => 'success']); + private function sortApps($a, $b) { + $a = (string)$a['name']; + $b = (string)$b['name']; + if ($a === $b) { + return 0; + } + return ($a < $b) ? -1 : 1; } + } diff --git a/settings/ajax/disableapp.php b/settings/ajax/disableapp.php deleted file mode 100644 index d719c3e9f23..00000000000 --- a/settings/ajax/disableapp.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @author Kamil Domanski - * @author Lukas Reschke - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ -\OC_JSON::checkAdminUser(); -\OC_JSON::callCheck(); - -$lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); -if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay - $l = \OC::$server->getL10N('core'); - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); - exit(); -} - -if (!array_key_exists('appid', $_POST)) { - OC_JSON::error(); - exit; -} - -$appIds = (array)$_POST['appid']; -foreach($appIds as $appId) { - $appId = OC_App::cleanAppId($appId); - \OC::$server->getAppManager()->disableApp($appId); -} -OC_JSON::success(); diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php deleted file mode 100644 index 0ecc001a24c..00000000000 --- a/settings/ajax/enableapp.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @author Christopher Schäpers - * @author Kamil Domanski - * @author Lukas Reschke - * @author Robin Appelman - * @author Thomas Müller - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -use OCP\ILogger; - -OC_JSON::checkAdminUser(); -\OC_JSON::callCheck(); - -$lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); -if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay - $l = \OC::$server->getL10N('core'); - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); - exit(); -} - -$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : []; -$appIds = isset($_POST['appIds']) ? (array)$_POST['appIds'] : []; - -try { - $updateRequired = false; - foreach($appIds as $appId) { - $app = new OC_App(); - $appId = OC_App::cleanAppId($appId); - $app->enable($appId, $groups); - if(\OC_App::shouldUpgrade($appId)) { - $updateRequired = true; - } - } - - OC_JSON::success(['data' => ['update_required' => $updateRequired]]); -} catch (Exception $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::DEBUG, - 'app' => 'core', - ]); - OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); -} diff --git a/settings/ajax/uninstallapp.php b/settings/ajax/uninstallapp.php deleted file mode 100644 index 26100d3b066..00000000000 --- a/settings/ajax/uninstallapp.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @author Lukas Reschke - * @author Robin Appelman - * @author Roeland Jago Douma - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ -\OC_JSON::checkAdminUser(); -\OC_JSON::callCheck(); - -$lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); -if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay - $l = \OC::$server->getL10N('core'); - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); - exit(); -} - -if (!array_key_exists('appid', $_POST)) { - OC_JSON::error(); - exit; -} - -$appId = (string)$_POST['appid']; -$appId = OC_App::cleanAppId($appId); - -// FIXME: move to controller -/** @var \OC\Installer $installer */ -$installer = \OC::$server->query(\OC\Installer::class); -$result = $installer->removeApp($app); -if($result !== false) { - // FIXME: Clear the cache - move that into some sane helper method - \OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-0'); - \OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-1'); - OC_JSON::success(array('data' => array('appid' => $appId))); -} else { - $l = \OC::$server->getL10N('settings'); - OC_JSON::error(array('data' => array( 'message' => $l->t("Couldn't remove app.") ))); -} diff --git a/settings/ajax/updateapp.php b/settings/ajax/updateapp.php deleted file mode 100644 index d37e1cfcaed..00000000000 --- a/settings/ajax/updateapp.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @author Frank Karlitschek - * @author Georg Ehrke - * @author Lukas Reschke - * @author Robin Appelman - * @author Roeland Jago Douma - * @author Thomas Müller - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ -\OC_JSON::checkAdminUser(); -\OC_JSON::callCheck(); - -if (!array_key_exists('appid', $_POST)) { - \OC_JSON::error(array( - 'message' => 'No AppId given!' - )); - return; -} - -$appId = (string)$_POST['appid']; -$appId = OC_App::cleanAppId($appId); - -$config = \OC::$server->getConfig(); -$config->setSystemValue('maintenance', true); -try { - $installer = \OC::$server->query(\OC\Installer::class); - $result = $installer->updateAppstoreApp($appId); - $config->setSystemValue('maintenance', false); -} catch(Exception $ex) { - $config->setSystemValue('maintenance', false); - OC_JSON::error(array('data' => array( 'message' => $ex->getMessage() ))); - return; -} - -if($result !== false) { - OC_JSON::success(array('data' => array('appid' => $appId))); -} else { - $l = \OC::$server->getL10N('settings'); - OC_JSON::error(array('data' => array( 'message' => $l->t("Couldn't update app.") ))); -} diff --git a/settings/css/settings.scss b/settings/css/settings.scss index 6adac7704cd..27269b23848 100644 --- a/settings/css/settings.scss +++ b/settings/css/settings.scss @@ -756,38 +756,118 @@ span.version { opacity: .5; } -@media (min-width: 1601px) { - #apps-list .section { - width: 22%; - box-sizing: border-box; - &:nth-child(4n) { - margin-right: 20px; - } +.app-settings-content { + #searchresults { + display: none; + } +} +#apps-list.store { + .section { + border: 0; + } + .app-name { + display: block; + margin: 5px 0; + } + .app-name, .app-image * { + cursor: pointer; + } + .app-summary { + opacity: .7; + } + .app-image-icon .icon-settings-dark { + width: 100%; + height: 150px; + background-size: 45px; + opacity: 0.5; + } + .app-score-image { + height: 14px; + } + .actions { + margin-top: 10px; } } -@media (min-width: 1201px) and (max-width: 1600px) { - #apps-list .section { - width: 30%; - box-sizing: border-box; - &:nth-child(3n) { - margin-right: 20px; +#app-sidebar #app-details-view { + h2 { + .icon-settings-dark, + svg { + display: inline-block; + width: 16px; + height: 16px; + margin-right: 10px; + opacity: .7; } } + .app-level { + margin-bottom: 10px; + } + .app-author, .app-licence { + color: $color-text-details; + } + .app-dependencies { + margin: 10px 0; + } + .app-description p { + margin: 10px 0; + } + .close { + position: absolute; + top: 0; + right: 0; + padding: 14px; + opacity: 0.5; + z-index: 1; + }. + .actions { + display: flex; + } } -@media (min-width: 901px) and (max-width: 1200px), (min-width: 601px) and (max-width: 770px) { - #apps-list .section { - width: 40%; - box-sizing: border-box; - &:nth-child(2n) { - margin-right: 20px; - } +@media only screen and (min-width: 1601px) { + .store .section { + width: 25%; + } + .with-app-sidebar .store .section { + width: 33%; + } +} + +@media only screen and (max-width: 1600px) { + .store .section { + width: 25%; + } + .with-app-sidebar .store .section { + width: 33%; + } +} + +@media only screen and (max-width: 1400px) { + .store .section { + width: 33%; + } + .with-app-sidebar .store .section { + width: 50%; + } +} + +@media only screen and (max-width: 900px) { + .store .section { + width: 50%; + } + .with-app-sidebar .store .section { + width: 100%; } } -/* hide app version and level on narrower screens */ @media only screen and (max-width: 768px) { + .store .section { + width: 50%; + } +} +/* hide app version and level on narrower screens */ +@media only screen and (max-width: 900px) { #apps-list.installed { .app-version, .app-level { display: none !important; @@ -795,7 +875,7 @@ span.version { } } -@media only screen and (max-width: 700px) { +@media only screen and (max-width: 500px) { #apps-list.installed .app-groups { display: none !important; } @@ -877,30 +957,15 @@ span.version { list-style-position: inside; } -/* Transition to complete width! */ - -.app { - &:hover, &:active { - max-width: inherit; - } -} - .appslink { text-decoration: underline; } -.score { - color: #666; - font-weight: bold; - font-size: 0.8em; -} -.appinfo .documentation { - margin-top: 1em; - margin-bottom: 1em; -} - -#apps-list { +#apps-list, #apps-list-search { + .section { + cursor: pointer; + } &.installed { display: table; width: 100%; @@ -919,6 +984,9 @@ span.version { padding: 6px; box-sizing: border-box; } + &.selected { + background-color: nc-darken($color-main-background, 3%); + } } .groups-enable { margin-top: 0; @@ -931,11 +999,22 @@ span.version { height: auto; text-align: right; } - .app-image-icon svg { + .app-image-icon svg, + .app-image-icon .icon-settings-dark { margin-top: 5px; width: 20px; height: 20px; opacity: .5; + background-size: cover; + display: inline-block; + } + .actions { + text-align: right; + .icon-loading-small { + display: inline-block; + top: 4px; + margin-right: 10px; + } } } &:not(.installed) .app-image-icon svg { @@ -946,8 +1025,6 @@ span.version { height: 64px; opacity: .1; } - position: relative; - height: 100%; display: flex; flex-wrap: wrap; align-content: flex-start; @@ -957,10 +1034,7 @@ span.version { .section { position: relative; flex: 0 0 auto; - margin-left: 20px; - &.apps-experimental { - flex-basis: 90%; - } + h2.app-name { display: block; margin: 8px 0; @@ -1016,10 +1090,6 @@ span.version { } } -.installed .actions { - text-align: right; -} - /* LOG */ #log { white-space: normal; diff --git a/settings/js/apps.js b/settings/js/apps.js index 4fca8539563..e860f1dbed1 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -1,610 +1,6 @@ /* global Handlebars */ - -Handlebars.registerHelper('score', function() { - if(this.score) { - var score = Math.round( this.score * 10 ); - var imageName = 'rating/s' + score + '.svg'; - - return new Handlebars.SafeString(''); - } - return new Handlebars.SafeString(''); -}); -Handlebars.registerHelper('level', function() { - if(typeof this.level !== 'undefined') { - if(this.level === 200) { - return new Handlebars.SafeString('' + t('settings', 'Official') + ''); - } - } -}); - OC.Settings = OC.Settings || {}; OC.Settings.Apps = OC.Settings.Apps || { - markedOptions: {}, - - setupGroupsSelect: function($elements) { - OC.Settings.setupGroupsSelect($elements, { - placeholder: t('core', 'All') - }); - }, - - State: { - currentCategory: null, - currentCategoryElements: null, - apps: null, - $updateNotification: null, - availableUpdates: 0 - }, - - loadCategories: function() { - if (this._loadCategoriesCall) { - this._loadCategoriesCall.abort(); - } - - var categories = [ - {displayName: t('settings', 'Your apps'), ident: 'installed', id: '0'}, - {displayName: t('settings', 'Enabled apps'), ident: 'enabled', id: '1'}, - {displayName: t('settings', 'Disabled apps'), ident: 'disabled', id: '2'} - ]; - - var source = $("#categories-template").html(); - var template = Handlebars.compile(source); - var html = template(categories); - $('#apps-categories').html(html); - - OC.Settings.Apps.loadCategory($('#app-navigation').attr('data-category')); - - this._loadCategoriesCall = $.ajax(OC.generateUrl('settings/apps/categories'), { - data:{}, - type:'GET', - success:function (jsondata) { - var html = template(jsondata); - var updateCategory = $.grep(jsondata, function(element, index) { - return element.ident === 'updates' - }); - $('#apps-categories').html(html); - $('#app-category-' + OC.Settings.Apps.State.currentCategory).addClass('active'); - if (updateCategory.length === 1) { - OC.Settings.Apps.State.availableUpdates = updateCategory[0].counter; - OC.Settings.Apps.refreshUpdateCounter(); - } - }, - complete: function() { - $('#app-navigation').removeClass('icon-loading'); - } - }); - - }, - - loadCategory: function(categoryId) { - if (OC.Settings.Apps.State.currentCategory === categoryId) { - return; - } - if (this._loadCategoryCall) { - this._loadCategoryCall.abort(); - } - - $('#app-content').addClass('icon-loading'); - $('#apps-list') - .removeClass('hidden') - .html(''); - $('#apps-list-empty').addClass('hidden'); - $('#app-category-' + OC.Settings.Apps.State.currentCategory).removeClass('active'); - $('#app-category-' + categoryId).addClass('active'); - OC.Settings.Apps.State.currentCategory = categoryId; - - this._loadCategoryCall = $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}', { - categoryId: categoryId - }), { - type:'GET', - success: function (apps) { - OC.Settings.Apps.State.currentCategoryElements = apps.apps; - var appListWithIndex = _.indexBy(apps.apps, 'id'); - OC.Settings.Apps.State.apps = appListWithIndex; - var appList = _.map(appListWithIndex, function(app) { - // default values for missing fields - return _.extend({level: 0}, app); - }); - var source; - if (categoryId === 'enabled' || categoryId === 'updates' || categoryId === 'disabled' || categoryId === 'installed' || categoryId === 'app-bundles') { - source = $("#app-template-installed").html(); - $('#apps-list').addClass('installed'); - } else { - source = $("#app-template").html(); - $('#apps-list').removeClass('installed'); - } - var template = Handlebars.compile(source); - - if (appList.length) { - if(categoryId !== 'app-bundles') { - appList.sort(function (a, b) { - if (a.active !== b.active) { - return (a.active ? -1 : 1) - } - if (a.update !== b.update) { - return (a.update ? -1 : 1) - } - return OC.Util.naturalSortCompare(a.name, b.name); - }); - } - - var firstExperimental = false; - var hasNewUpdates = false; - _.each(appList, function(app) { - if(app.level === 0 && firstExperimental === false) { - firstExperimental = true; - OC.Settings.Apps.renderApp(app, template, null, true); - } else { - OC.Settings.Apps.renderApp(app, template, null, false); - } - - if (app.update) { - hasNewUpdates = true; - var $update = $('#app-' + app.id + ' .update'); - $update.removeClass('hidden'); - $update.val(t('settings', 'Update to %s').replace(/%s/g, app.update)); - } - }); - // reload updates if a list with new updates is loaded - if (hasNewUpdates) { - OC.Settings.Apps.reloadUpdates(); - } else { - // hide update category after all updates are installed - // and the user is switching away from the empty updates view - OC.Settings.Apps.refreshUpdateCounter(); - } - } else { - if (categoryId === 'updates') { - OC.Settings.Apps.showEmptyUpdates(); - } else { - $('#apps-list').addClass('hidden'); - $('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'No apps found for your version')); - $('#app-list-empty-icon').addClass('icon-search').removeClass('icon-download'); - } - } - - $('.enable.needs-download').tooltip({ - title: t('settings', 'The app will be downloaded from the app store'), - placement: 'bottom', - container: 'body' - }); - - $('.app-level .official').tooltip({ - title: t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.'), - placement: 'bottom', - container: 'body' - }); - $('.app-level .approved').tooltip({ - title: t('settings', 'Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use.'), - placement: 'bottom', - container: 'body' - }); - $('.app-level .experimental').tooltip({ - title: t('settings', 'This app is not checked for security issues and is new or known to be unstable. Install at your own risk.'), - placement: 'bottom', - container: 'body' - }); - }, - complete: function() { - $('#app-content').removeClass('icon-loading'); - } - }); - }, - - renderApp: function(app, template, selector, firstExperimental) { - if (!template) { - var source = $("#app-template").html(); - template = Handlebars.compile(source); - } - if (typeof app === 'string') { - app = OC.Settings.Apps.State.apps[app]; - } - app.firstExperimental = firstExperimental; - - if (!app.preview) { - app.preview = OC.imagePath('core', 'places/default-app-icon'); - app.previewAsIcon = true; - } - - if (_.isArray(app.author)) { - var authors = []; - _.each(app.author, function (author) { - if (typeof author === 'string') { - authors.push(author); - } else { - authors.push(author['@value']); - } - }); - app.author = authors.join(', '); - } else if (typeof app.author !== 'string') { - app.author = app.author['@value']; - } - - // Parse markdown in app description - app.description = DOMPurify.sanitize( - marked(app.description.trim(), OC.Settings.Apps.markedOptions), - { - SAFE_FOR_JQUERY: true, - ALLOWED_TAGS: [ - 'strong', - 'p', - 'a', - 'ul', - 'ol', - 'li', - 'em', - 'del', - 'blockquote' - ] - } - ); - - var html = template(app); - if (selector) { - selector.html(html); - } else { - $('#apps-list').append(html); - } - - var page = $('#app-' + app.id); - - if (app.preview) { - var currentImage = new Image(); - currentImage.src = app.preview; - - currentImage.onload = function() { - /* Trigger color inversion for placeholder image too */ - if(app.previewAsIcon) { - page.find('.app-image') - .append(OC.Settings.Apps.imageUrl(app.preview, false)) - .removeClass('icon-loading'); - } else { - page.find('.app-image') - .append(OC.Settings.Apps.imageUrl(app.preview, app.fromAppStore)) - .removeClass('icon-loading'); - } - }; - } - - // set group select properly - if(OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') || - OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging') || - OC.Settings.Apps.isType(app, 'prevent_group_restriction')) { - page.find(".groups-enable").hide(); - page.find(".groups-enable__checkbox").prop('checked', false); - } else { - page.find('.group_select').val((app.groups || []).join('|')); - if (app.active) { - if (app.groups.length) { - OC.Settings.Apps.setupGroupsSelect(page.find('.group_select')); - page.find(".groups-enable__checkbox").prop('checked', true); - } else { - page.find(".groups-enable__checkbox").prop('checked', false); - } - page.find(".groups-enable").show(); - } else { - page.find(".groups-enable").hide(); - } - } - }, - - /** - * Returns the image for apps listing - * url : the url of the image - * appfromstore: bool to check whether the app is fetched from store or not. - */ - - imageUrl : function (url, appfromstore) { - var img; - if (appfromstore) { - img = ''; - img += ''; - } else { - var rnd = Math.floor((Math.random() * 100 )) + new Date().getSeconds() + new Date().getMilliseconds(); - img = ''; - img += '' - img += ''; - } - return img; - }, - - isType: function(app, type){ - return app.types && app.types.indexOf(type) !== -1; - }, - - /** - * Checks the server health. - * - * If the promise fails, the server is broken. - * - * @return {Promise} promise - */ - _checkServerHealth: function() { - return $.get(OC.generateUrl('apps/files')); - }, - - enableAppBundle:function(bundleId, active, element, groups) { - if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { - OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.enableAppBundle, this, bundleId, active, element, groups), { - text: t('settings', 'Installing apps requires you to confirm your password'), - confirm: t('settings', 'Install app bundle'), - }); - return; - } - - var apps = OC.Settings.Apps.State.currentCategoryElements; - var appsToEnable = []; - apps.forEach(function(app) { - if(app['bundleId'] === bundleId) { - if(app['active'] === false) { - appsToEnable.push(app['id']); - } - } - }); - - OC.Settings.Apps.enableApp(appsToEnable, false, groups); - }, - - /** - * @param {string[]} appId - * @param {boolean} active - * @param {array} groups - */ - enableApp:function(appId, active, groups) { - if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { - OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.enableApp, this, appId, active, groups), { - text: ( active ? t('settings', 'Disabling apps requires you to confirm your password') : t('settings', 'Enabling apps requires you to confirm your password') ), - confirm: ( active ? t('settings', 'Disable app') : t('settings', 'Enable app') ), - }); - return; - } - - var elements = []; - appId.forEach(function(appId) { - elements.push($('#app-'+appId+' .enable')); - }); - - var self = this; - appId.forEach(function(appId) { - OC.Settings.Apps.hideErrorMessage(appId); - }); - groups = groups || []; - var appItems = []; - appId.forEach(function(appId) { - appItems.push($('div#app-'+appId+'')); - }); - - if(active && !groups.length) { - elements.forEach(function(element) { - element.val(t('settings','Disabling app …')); - }); - $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appId},function(result) { - if(!result || result.status !== 'success') { - if (result.data && result.data.message) { - OC.Settings.Apps.showErrorMessage(appId, result.data.message); - appItems.forEach(function(appItem) { - appItem.data('errormsg', result.data.message); - }) - } else { - OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while disabling app')); - appItems.forEach(function(appItem) { - appItem.data('errormsg', t('settings', 'Error while disabling app')); - }); - } - elements.forEach(function(element) { - element.val(t('settings','Disable')); - }); - appItems.forEach(function(appItem) { - appItem.addClass('appwarning'); - }); - } else { - OC.Settings.Apps.rebuildNavigation(); - appItems.forEach(function(appItem) { - appItem.data('active', false); - appItem.data('groups', ''); - }); - elements.forEach(function(element) { - element.data('active', false); - }); - appItems.forEach(function(appItem) { - appItem.removeClass('active'); - }); - elements.forEach(function(element) { - element.val(t('settings', 'Enable')); - element.parent().find(".groups-enable").hide(); - element.parent().find('.group_select').hide().val(null); - }); - OC.Settings.Apps.State.apps[appId].active = false; - } - },'json'); - } else { - // TODO: display message to admin to not refresh the page! - // TODO: lock UI to prevent further operations - elements.forEach(function(element) { - element.val(t('settings', 'Enabling app …')); - }); - - var appIdArray = []; - if( typeof appId === 'string' ) { - appIdArray = [appId]; - } else { - appIdArray = appId; - } - $.post(OC.filePath('settings','ajax','enableapp.php'),{appIds: appIdArray, groups: groups},function(result) { - if(!result || result.status !== 'success') { - if (result.data && result.data.message) { - OC.Settings.Apps.showErrorMessage(appId, result.data.message); - appItems.forEach(function(appItem) { - appItem.data('errormsg', result.data.message); - }); - } else { - OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while enabling app')); - appItems.forEach(function(appItem) { - appItem.data('errormsg', t('settings', 'Error while disabling app')); - }); - } - elements.forEach(function(element) { - element.val(t('settings', 'Enable')); - }); - appItems.forEach(function(appItem) { - appItem.addClass('appwarning'); - }); - } else { - self._checkServerHealth().done(function() { - if (result.data.update_required) { - OC.Settings.Apps.showReloadMessage(); - - setTimeout(function() { - location.reload(); - }, 5000); - } - - OC.Settings.Apps.rebuildNavigation(); - appItems.forEach(function(appItem) { - appItem.data('active', true); - }); - elements.forEach(function(element) { - element.data('active', true); - }); - appItems.forEach(function(appItem) { - appItem.addClass('active'); - }); - elements.forEach(function(element) { - element.val(t('settings', 'Disable')); - }); - var app = OC.Settings.Apps.State.apps[appId]; - app.active = true; - - if (OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') || - OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging')) { - elements.forEach(function(element) { - element.parent().find(".groups-enable").prop('checked', true); - element.parent().find(".groups-enable").hide(); - element.parent().find('.group_select').hide().val(null); - }); - } else { - elements.forEach(function(element) { - element.parent().find("#groups-enable").show(); - }); - if (groups) { - appItems.forEach(function(appItem) { - appItem.data('groups', JSON.stringify(groups)); - }); - } else { - appItems.forEach(function(appItem) { - appItem.data('groups', ''); - }); - } - } - }).fail(function() { - // server borked, emergency disable app - $.post(OC.webroot + '/index.php/disableapp', {appid: appId}, function() { - OC.Settings.Apps.showErrorMessage( - appId, - t('settings', 'Error: This app can not be enabled because it makes the server unstable') - ); - appItems.forEach(function(appItem) { - appItem.data('errormsg', t('settings', 'Error while enabling app')); - }); - elements.forEach(function(element) { - element.val(t('settings', 'Enable')); - }); - appItems.forEach(function(appItem) { - appItem.addClass('appwarning'); - }); - }).fail(function() { - OC.Settings.Apps.showErrorMessage( - appId, - t('settings', 'Error: Could not disable broken app') - ); - appItems.forEach(function(appItem) { - appItem.data('errormsg', t('settings', 'Error while disabling broken app')); - }); - elements.forEach(function(element) { - element.val(t('settings', 'Enable')); - }); - }); - }); - } - },'json') - .fail(function() { - OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while enabling app')); - appItems.forEach(function(appItem) { - appItem.data('errormsg', t('settings', 'Error while enabling app')); - appItem.data('active', false); - appItem.addClass('appwarning'); - }); - elements.forEach(function(element) { - element.val(t('settings', 'Enable')); - }); - }); - } - }, - - showEmptyUpdates: function() { - $('#apps-list').addClass('hidden'); - $('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'App up to date')); - $('#app-list-empty-icon').removeClass('icon-search').addClass('icon-download'); - }, - - updateApp:function(appId, element) { - var oldButtonText = element.val(); - element.val(t('settings','Updating …')); - OC.Settings.Apps.hideErrorMessage(appId); - $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appId},function(result) { - if(!result || result.status !== 'success') { - if (result.data && result.data.message) { - OC.Settings.Apps.showErrorMessage(appId, result.data.message); - } else { - OC.Settings.Apps.showErrorMessage(appId, t('settings','Could not update app')); - } - element.val(oldButtonText); - } - else { - element.val(t('settings','Updated')); - element.hide(); - - var $update = $('#app-' + appId + ' .update'); - $update.addClass('hidden'); - var $version = $('#app-' + appId + ' .app-version'); - $version.text(OC.Settings.Apps.State.apps[appId]['update']); - - OC.Settings.Apps.State.availableUpdates--; - OC.Settings.Apps.refreshUpdateCounter(); - - if (OC.Settings.Apps.State.currentCategory === 'updates') { - $('#app-' + appId).remove(); - if (OC.Settings.Apps.State.availableUpdates === 0) { - OC.Settings.Apps.showEmptyUpdates(); - } - } - } - },'json'); - }, - - uninstallApp:function(appId, element) { - if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { - OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.uninstallApp, this, appId, element), { - text: t('settings', 'Uninstalling apps requires you to confirm your password'), - confirm: t('settings', 'Uninstall') - }); - return; - } - - OC.Settings.Apps.hideErrorMessage(appId); - element.val(t('settings','Removing …')); - $.post(OC.filePath('settings','ajax','uninstallapp.php'),{appid:appId},function(result) { - if(!result || result.status !== 'success') { - OC.Settings.Apps.showErrorMessage(appId, t('settings','Could not remove app')); - element.val(t('settings','Remove')); - } else { - OC.Settings.Apps.rebuildNavigation(); - element.parents('#apps-list > .section').fadeOut(function() { - this.remove(); - }); - } - },'json'); - }, - rebuildNavigation: function() { $.getJSON(OC.linkToOCS('core/navigation', 2) + 'apps?format=json').done(function(response){ if(response.ocs.meta.status === 'ok') { @@ -691,334 +87,5 @@ OC.Settings.Apps = OC.Settings.Apps || { $(window).trigger('resize'); } }); - }, - - reloadUpdates: function() { - if (this._loadUpdatesCall) { - this._loadUpdatesCall.abort(); - } - this._loadUpdatesCall = $.ajax(OC.generateUrl('settings/apps/list?category=updates'), { - type:'GET', - success: function (apps) { - OC.Settings.Apps.State.availableUpdates = apps.apps.length; - OC.Settings.Apps.refreshUpdateCounter(); - } - }); - }, - - refreshUpdateCounter: function() { - var $appCategoryUpdates = $('#app-category-updates'); - var $updateCount = $appCategoryUpdates.find('.app-navigation-entry-utils-counter'); - if (OC.Settings.Apps.State.availableUpdates > 0) { - $updateCount.html(OC.Settings.Apps.State.availableUpdates); - $appCategoryUpdates.show(); - } else { - $updateCount.empty(); - if (OC.Settings.Apps.State.currentCategory !== 'updates') { - $appCategoryUpdates.hide(); - } - } - }, - - showErrorMessage: function(appId, message) { - $('div#app-'+appId+' .warning') - .show() - .text(message); - }, - - hideErrorMessage: function(appId) { - $('div#app-'+appId+' .warning') - .hide() - .text(''); - }, - - showReloadMessage: function() { - OC.dialogs.info( - t( - 'settings', - 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.' - ), - t('settings','App update'), - function () { - window.location.reload(); - }, - true - ); - }, - - /** - * Splits the query by spaces and tries to find all substring in the app - * @param {string} string - * @param {string} query - * @returns {boolean} - */ - _search: function(string, query) { - var keywords = query.split(' '), - stringLower = string.toLowerCase(), - found = true; - - _.each(keywords, function(keyword) { - found = found && stringLower.indexOf(keyword) !== -1; - }); - - return found; - }, - - filter: function(query) { - var $appList = $('#apps-list'), - $emptyList = $('#apps-list-empty'); - $('#app-list-empty-icon').addClass('icon-search').removeClass('icon-download'); - $appList.removeClass('hidden'); - $appList.find('.section').removeClass('hidden'); - $emptyList.addClass('hidden'); - - if (query === '') { - return; - } - - query = query.toLowerCase(); - $appList.find('.section').addClass('hidden'); - - // App Name - var apps = _.filter(OC.Settings.Apps.State.apps, function (app) { - return OC.Settings.Apps._search(app.name, query); - }); - - // App ID - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - return OC.Settings.Apps._search(app.id, query); - })); - - // App Description - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - return OC.Settings.Apps._search(app.description, query); - })); - - // Author Name - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - var authors = []; - if (_.isArray(app.author)) { - _.each(app.author, function (author) { - if (typeof author === 'string') { - authors.push(author); - } else { - authors.push(author['@value']); - if (!_.isUndefined(author['@attributes']['homepage'])) { - authors.push(author['@attributes']['homepage']); - } - if (!_.isUndefined(author['@attributes']['mail'])) { - authors.push(author['@attributes']['mail']); - } - } - }); - return OC.Settings.Apps._search(authors.join(' '), query); - } else if (typeof app.author !== 'string') { - authors.push(app.author['@value']); - if (!_.isUndefined(app.author['@attributes']['homepage'])) { - authors.push(app.author['@attributes']['homepage']); - } - if (!_.isUndefined(app.author['@attributes']['mail'])) { - authors.push(app.author['@attributes']['mail']); - } - return OC.Settings.Apps._search(authors.join(' '), query); - } - return OC.Settings.Apps._search(app.author, query); - })); - - // App status - if (t('settings', 'Official').toLowerCase().indexOf(query) !== -1) { - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - return app.level === 200; - })); - } - if (t('settings', 'Approved').toLowerCase().indexOf(query) !== -1) { - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - return app.level === 100; - })); - } - if (t('settings', 'Experimental').toLowerCase().indexOf(query) !== -1) { - apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) { - return app.level !== 100 && app.level !== 200; - })); - } - - apps = _.uniq(apps, function(app){return app.id;}); - - if (apps.length === 0) { - $appList.addClass('hidden'); - $emptyList.removeClass('hidden'); - $emptyList.removeClass('hidden').find('h2').text(t('settings', 'No apps found for {query}', { - query: query - })); - } else { - _.each(apps, function (app) { - $('#app-' + app.id).removeClass('hidden'); - }); - - $('#searchresults').hide(); - } - }, - - _onPopState: function(params) { - params = _.extend({ - category: 'enabled' - }, params); - - OC.Settings.Apps.loadCategory(params.category); - }, - - /** - * Initializes the apps list - */ - initialize: function($el) { - - var renderer = new marked.Renderer(); - renderer.link = function(href, title, text) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return ''; - } - - if (prot.indexOf('http:') !== 0 && prot.indexOf('https:') !== 0) { - return ''; - } - - var out = ''; - return out; - }; - renderer.image = function(href, title, text) { - if (text) { - return text; - } - return title; - }; - renderer.blockquote = function(quote) { - return quote; - }; - - OC.Settings.Apps.markedOptions = { - renderer: renderer, - gfm: false, - highlight: false, - tables: false, - breaks: false, - pedantic: false, - sanitize: true, - smartLists: true, - smartypants: false - }; - - OC.Plugins.register('OCA.Search', OC.Settings.Apps.Search); - OC.Settings.Apps.loadCategories(); - OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this)); - - $(document).on('click', 'ul#apps-categories li', function () { - var categoryId = $(this).data('categoryId'); - OC.Settings.Apps.loadCategory(categoryId); - OC.Util.History.pushState({ - category: categoryId - }); - $('#searchbox').val(''); - }); - - $(document).on('click', '.app-description-toggle-show', function () { - $(this).addClass('hidden'); - $(this).siblings('.app-description-toggle-hide').removeClass('hidden'); - $(this).siblings('.app-description-container').slideDown(); - }); - $(document).on('click', '.app-description-toggle-hide', function () { - $(this).addClass('hidden'); - $(this).siblings('.app-description-toggle-show').removeClass('hidden'); - $(this).siblings('.app-description-container').slideUp(); - }); - - $(document).on('click', '#apps-list input.enable', function () { - var appId = $(this).data('appid'); - var bundleId = $(this).data('bundleid'); - var element = $(this); - var active = $(this).data('active'); - - var category = $('#app-navigation').attr('data-category'); - if(bundleId) { - OC.Settings.Apps.enableAppBundle(bundleId, active, element); - element.val(t('settings', 'Enable all')); - } else { - OC.Settings.Apps.enableApp([appId], active); - } - }); - - $(document).on('click', '#apps-list input.uninstall', function () { - var appId = $(this).data('appid'); - var element = $(this); - - OC.Settings.Apps.uninstallApp(appId, element); - }); - - $(document).on('click', '#apps-list input.update', function () { - var appId = $(this).data('appid'); - var element = $(this); - - OC.Settings.Apps.updateApp(appId, element); - }); - - $(document).on('change', '.group_select', function() { - var element = $(this).closest('.section').find('input.enable'); - var groups = $(this).val(); - if (groups && groups !== '') { - groups = groups.split('|'); - } else { - groups = []; - } - - var appId = element.data('appid'); - if (appId) { - OC.Settings.Apps.enableApp([appId], false, groups); - OC.Settings.Apps.State.apps[appId].groups = groups; - } - }); - - $(document).on('change', ".groups-enable__checkbox", function() { - var $select = $(this).closest('.section').find('.group_select'); - $select.val(''); - - if (this.checked) { - OC.Settings.Apps.setupGroupsSelect($select); - } else { - $select.select2('destroy'); - } - - $select.change(); - }); - - $(document).on('click', '#enable-experimental-apps', function () { - var state = $(this).prop('checked'); - $.ajax(OC.generateUrl('settings/apps/experimental'), { - data: {state: state}, - type: 'POST', - success:function () { - location.reload(); - } - }); - }); - } -}; - -OC.Settings.Apps.Search = { - attach: function (search) { - search.setFilter('settings', OC.Settings.Apps.filter); - } -}; - -$(document).ready(function () { - // HACK: FIXME: use plugin approach - if (!window.TESTING) { - OC.Settings.Apps.initialize($('#apps-list')); } -}); +}; \ No newline at end of file diff --git a/settings/js/main.js b/settings/js/main.js index a4f2404a8a1..dcb4d50ac83 100644 --- a/settings/js/main.js +++ b/settings/js/main.js @@ -1,56 +1,3437 @@ -!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,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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="/dist/",n(n.s=109)}([function(t,e,n){var r=n(2),i=n(37),o=n(12),s=n(20),a=n(18),u=function(t,e,n){var c,l,f,p,d=t&u.F,h=t&u.G,v=t&u.S,m=t&u.P,g=t&u.B,y=h?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=h?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in h&&(n=e),n)f=((l=!d&&y&&void 0!==y[c])?y:n)[c],p=g&&l?a(f,r):m&&"function"==typeof f?a(Function.call,f):f,y&&s(y,c,f,t&u.U),b[c]!=f&&o(b,c,p),m&&_[c]!=f&&(_[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(1);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){"use strict";(function(t,n){ -/*! - * Vue.js v2.5.16 - * (c) 2014-2018 Evan You - * Released under the MIT License. - */ -var r=Object.freeze({});function i(t){return void 0===t||null===t}function o(t){return void 0!==t&&null!==t}function s(t){return!0===t}function a(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function u(t){return null!==t&&"object"==typeof t}var c=Object.prototype.toString;function l(t){return"[object Object]"===c.call(t)}function f(t){return"[object RegExp]"===c.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return null==t?"":"object"==typeof t?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 b=Object.prototype.hasOwnProperty;function _(t,e){return b.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,O=w(function(t){return t.replace(x,function(t,e){return e?e.toUpperCase():""})}),S=w(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),C=/\B([A-Z])/g,k=w(function(t){return t.replace(C,"-$1").toLowerCase()});var E=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 A(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 L(t){for(var e={},n=0;n0,J=K&&K.indexOf("edge/")>0,X=(K&&K.indexOf("android"),K&&/iphone|ipad|ipod|ios/.test(K)||"ios"===W),Z=(K&&/chrome\/\d+/.test(K),{}.watch),tt=!1;if(q)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(t){}var nt=function(){return void 0===V&&(V=!q&&!z&&void 0!==t&&"server"===t.process.env.VUE_ENV),V},rt=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var ot,st="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 at=T,ut=0,ct=function(){this.id=ut++,this.subs=[]};ct.prototype.addSub=function(t){this.subs.push(t)},ct.prototype.removeSub=function(t){y(this.subs,t)},ct.prototype.depend=function(){ct.target&&ct.target.addDep(this)},ct.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e-1)if(o&&!_(i,"default"))s=!1;else if(""===s||s===k(t)){var u=Bt(String,i.type);(u<0||a0&&(le((c=t(c,(n||"")+"_"+u))[0])&&le(f)&&(r[l]=mt(f.text+c[0].text),c.shift()),r.push.apply(r,c)):a(c)?le(f)?r[l]=mt(f.text+c):""!==c&&r.push(mt(c)):le(c)&&le(f)?r[l]=mt(f.text+c.text):(s(e._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist"+n+"_"+u+"__"),r.push(c)));return r}(t):void 0}function le(t){return o(t)&&o(t.text)&&!1===t.isComment}function fe(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function pe(t){return t.isComment&&t.asyncFactory}function de(t){if(Array.isArray(t))for(var e=0;e$e&&Se[n].id>t.id;)n--;Se.splice(n+1,0,t)}else Se.push(t);Ee||(Ee=!0,te(Le))}}(this)},Pe.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Gt(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Pe.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pe.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Pe.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var je={enumerable:!0,configurable:!0,get:T,set:T};function Ne(t,e,n){je.get=function(){return this[e][n]},je.set=function(t){this[e][n]=t},Object.defineProperty(t,n,je)}function Me(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&&xt(!1);var o=function(o){i.push(o);var s=Ft(o,e,n,t);Et(r,o,s),o in t||Ne(t,"_props",o)};for(var s in e)o(s);xt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?T:E(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){ft();try{return t.call(e,e)}catch(t){return Gt(t,e,"data()"),{}}finally{pt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);for(;i--;){var o=n[i];0,r&&_(r,o)||(void 0,36!==(s=(o+"").charCodeAt(0))&&95!==s&&Ne(t,"_data",o))}var s;kt(e,!0)}(t):kt(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],s="function"==typeof o?o:o.get;0,r||(n[i]=new Pe(t,s||T,T,Ue)),i in t||Ie(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;i=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function pn(t){this._init(t)}function dn(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;var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=Ut(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)Ne(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)Ie(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,F.forEach(function(t){s[t]=n[t]}),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=$({},s.options),i[r]=s,s}}function hn(t){return t&&(t.Ctor.options.name||t.tag)}function vn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function mn(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var s=n[o];if(s){var a=hn(s.componentOptions);a&&!e(a)&&gn(n,o,r,i)}}}function gn(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,y(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=cn++,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,n._parentElm=e._parentElm,n._refElm=e._refElm;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=Ut(ln(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&&me(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=ge(e._renderChildren,i),t.$scopedSlots=r,t._c=function(e,n,r,i){return un(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return un(t,e,n,r,i,!0)};var o=n&&n.data;Et(t,"$attrs",o&&o.attrs||r,null,!0),Et(t,"$listeners",e._parentListeners||r,null,!0)}(e),Oe(e,"beforeCreate"),function(t){var e=De(t.$options.inject,t);e&&(xt(!1),Object.keys(e).forEach(function(n){Et(t,n,e[n])}),xt(!0))}(e),Me(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),Oe(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(pn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=At,t.prototype.$delete=$t,t.prototype.$watch=function(t,e,n){if(l(e))return Re(this,t,e,n);(n=n||{}).user=!0;var r=new Pe(this,t,e,n);return n.immediate&&e.call(this,r.value),function(){r.teardown()}}}(pn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){if(Array.isArray(t))for(var r=0,i=t.length;r1?A(e):e;for(var n=A(arguments,1),r=0,i=e.length;rparseInt(this.max)&&gn(s,a[0],a,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return D}};Object.defineProperty(t,"config",e),t.util={warn:at,extend:$,mergeOptions:Ut,defineReactive:Et},t.set=At,t.delete=$t,t.nextTick=te,t.options=Object.create(null),F.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,$(t.options.components,bn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=A(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=Ut(this.options,t),this}}(t),dn(t),function(t){F.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)}(pn),Object.defineProperty(pn.prototype,"$isServer",{get:nt}),Object.defineProperty(pn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(pn,"FunctionalRenderContext",{value:Ze}),pn.version="2.5.16";var _n=v("style,class"),wn=v("input,textarea,option,select,progress"),xn=function(t,e,n){return"value"===n&&wn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},On=v("contenteditable,draggable,spellcheck"),Sn=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"),Cn="http://www.w3.org/1999/xlink",kn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},En=function(t){return kn(t)?t.slice(6,t.length):""},An=function(t){return null==t||!1===t};function $n(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Ln(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=Ln(e,n.data));return function(t,e){if(o(t)||o(e))return Tn(t,Pn(e));return""}(e.staticClass,e.class)}function Ln(t,e){return{staticClass:Tn(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Tn(t,e){return t?e?t+" "+e:t:e||""}function Pn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r-1?rr(t,e,n):Sn(e)?An(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):On(e)?t.setAttribute(e,An(n)||"false"===n?"false":"true"):kn(e)?An(n)?t.removeAttributeNS(Cn,En(e)):t.setAttributeNS(Cn,e,n):rr(t,e,n)}function rr(t,e,n){if(An(n))t.removeAttribute(e);else{if(Y&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var ir={create:er,update:er};function or(t,e){var n=e.elm,r=e.data,s=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(s)||i(s.staticClass)&&i(s.class)))){var a=$n(e),u=n._transitionClasses;o(u)&&(a=Tn(a,Pn(u))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var sr,ar,ur,cr,lr,fr,pr={create:or,update:or},dr=/[\w).+\-_$\]]/;function hr(t){var e,n,r,i,o,s=!1,a=!1,u=!1,c=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(v=t.charAt(h));h--);v&&dr.test(v)||(c=!0)}}else void 0===i?(d=r+1,i=t.slice(0,r).trim()):m();function m(){(o||(o=[])).push(t.slice(d,r).trim()),d=r+1}if(void 0===i?i=t.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:t.slice(0,cr),key:'"'+t.slice(cr+1)+'"'}:{exp:t,key:null};ar=t,cr=lr=fr=0;for(;!Ar();)$r(ur=Er())?Tr(ur):91===ur&&Lr(ur);return{exp:t.slice(0,lr),key:t.slice(lr+1,fr)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function Er(){return ar.charCodeAt(++cr)}function Ar(){return cr>=sr}function $r(t){return 34===t||39===t}function Lr(t){var e=1;for(lr=cr;!Ar();)if($r(t=Er()))Tr(t);else if(91===t&&e++,93===t&&e--,0===e){fr=cr;break}}function Tr(t){for(var e=t;!Ar()&&(t=Er())!==e;);}var Pr,jr="__r",Nr="__c";function Mr(t,e,n,r,i){var o;e=(o=e)._withTask||(o._withTask=function(){Qt=!0;var t=o.apply(null,arguments);return Qt=!1,t}),n&&(e=function(t,e,n){var r=Pr;return function i(){null!==t.apply(null,arguments)&&Ur(e,i,n,r)}}(e,t,r)),Pr.addEventListener(t,e,tt?{capture:r,passive:i}:r)}function Ur(t,e,n,r){(r||Pr).removeEventListener(t,e._withTask||e,n)}function Ir(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Pr=e.elm,function(t){if(o(t[jr])){var e=Y?"change":"input";t[e]=[].concat(t[jr],t[e]||[]),delete t[jr]}o(t[Nr])&&(t.change=[].concat(t[Nr],t.change||[]),delete t[Nr])}(n),se(n,r,Mr,Ur,e.context),Pr=void 0}}var Fr={create:Ir,update:Ir};function Rr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,s=e.elm,a=t.data.domProps||{},u=e.data.domProps||{};for(n in o(u.__ob__)&&(u=e.data.domProps=$({},u)),a)i(u[n])&&(s[n]="");for(n in u){if(r=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n){s._value=r;var c=i(r)?"":String(r);Dr(s,c)&&(s.value=c)}else s[n]=r}}}function Dr(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.lazy)return!1;if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Br={create:Rr,update:Rr},Gr=w(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 Vr(t){var e=Hr(t.style);return t.staticStyle?$(t.staticStyle,e):e}function Hr(t){return Array.isArray(t)?L(t):"string"==typeof t?Gr(t):t}var qr,zr=/^--/,Wr=/\s*!important$/,Kr=function(t,e,n){if(zr.test(e))t.style.setProperty(e,n);else if(Wr.test(n))t.style.setProperty(e,n.replace(Wr,""),"important");else{var r=Qr(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(/\s+/).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 ti(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).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 ei(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&$(e,ni(t.name||"v")),$(e,t),e}return"string"==typeof t?ni(t):void 0}}var ni=w(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"}}),ri=q&&!Q,ii="transition",oi="animation",si="transition",ai="transitionend",ui="animation",ci="animationend";ri&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(si="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ui="WebkitAnimation",ci="webkitAnimationEnd"));var li=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function fi(t){li(function(){li(t)})}function pi(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Zr(t,e))}function di(t,e){t._transitionClasses&&y(t._transitionClasses,e),ti(t,e)}function hi(t,e,n){var r=mi(t,e),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a=i===ii?ai:ci,u=0,c=function(){t.removeEventListener(a,l),n()},l=function(e){e.target===t&&++u>=s&&c()};setTimeout(function(){u0&&(n=ii,l=s,f=o.length):e===oi?c>0&&(n=oi,l=c,f=u.length):f=(n=(l=Math.max(s,c))>0?s>c?ii:oi:null)?n===ii?o.length:u.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ii&&vi.test(r[si+"Property"])}}function gi(t,e){for(;t.length1}function Oi(t,e){!0!==e.data.show&&bi(e)}var Si=function(t){var e,n,r={},u=t.modules,c=t.nodeOps;for(e=0;eh?b(t,i(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&w(0,e,p,h)}(u,d,h,n,a):o(h)?(o(t.text)&&c.setTextContent(u,""),b(u,null,h,0,h.length-1,n)):o(d)?w(0,d,0,d.length-1):o(t.text)&&c.setTextContent(u,""):t.text!==e.text&&c.setTextContent(u,e.text),o(p)&&o(l=p.hook)&&o(l=l.postpatch)&&l(t,e)}}}function C(t,e,n){if(s(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,s.selected!==o&&(s.selected=o);else if(N($i(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));i||(t.selectedIndex=-1)}}function Ai(t,e){return e.every(function(e){return!N(e,t)})}function $i(t){return"_value"in t?t._value:t.value}function Li(t){t.target.composing=!0}function Ti(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 ji(t){return!t.componentInstance||t.data&&t.data.transition?t:ji(t.componentInstance._vnode)}var Ni={model:Ci,show:{bind:function(t,e,n){var r=e.value,i=(n=ji(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,bi(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=ji(n)).data&&n.data.transition?(n.data.show=!0,r?bi(n,function(){t.style.display=t.__vOriginalDisplay}):_i(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 Ui(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ui(de(e.children)):t}function Ii(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[O(o)]=i[o];return e}function Fi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ri={name:"transition",props:Mi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(function(t){return t.tag||pe(t)})).length){0;var r=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=Ui(i);if(!o)return i;if(this._leaving)return Fi(t,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var u=(o.data||(o.data={})).transition=Ii(this),c=this._vnode,l=Ui(c);if(o.data.directives&&o.data.directives.some(function(t){return"show"===t.name})&&(o.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,l)&&!pe(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=$({},u);if("out-in"===r)return this._leaving=!0,ae(f,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),Fi(t,i);if("in-out"===r){if(pe(o))return c;var p,d=function(){p()};ae(u,"afterEnter",d),ae(u,"enterCancelled",d),ae(f,"delayLeave",function(t){p=t})}}return i}}},Di=$({tag:String,moveClass:String},Mi);function Bi(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Gi(t){t.data.newPos=t.elm.getBoundingClientRect()}function Vi(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 Di.mode;var Hi={Transition:Ri,TransitionGroup:{props:Di,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=[],s=Ii(this),a=0;a-1?Fn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Fn[t]=/HTMLUnknownElement/.test(e.toString())},$(pn.options.directives,Ni),$(pn.options.components,Hi),pn.prototype.__patch__=q?Si:T,pn.prototype.$mount=function(t,e){return function(t,e,n){return t.$el=e,t.$options.render||(t.$options.render=vt),Oe(t,"beforeMount"),new Pe(t,function(){t._update(t._render(),n)},T,null,!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Oe(t,"mounted")),t}(this,t=t&&q?Dn(t):void 0,e)},q&&setTimeout(function(){D.devtools&&rt&&rt.emit("init",pn)},0);var qi=/\{\{((?:.|\n)+?)\}\}/g,zi=/[-.*+?^${}()|[\]\/\\]/g,Wi=w(function(t){var e=t[0].replace(zi,"\\$&"),n=t[1].replace(zi,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")});var Ki={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=Sr(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=Or(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var Yi,Qi={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=Sr(t,"style");n&&(t.staticStyle=JSON.stringify(Gr(n)));var r=Or(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},Ji=function(t){return(Yi=Yi||document.createElement("div")).innerHTML=t,Yi.textContent},Xi=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Zi=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),eo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,no="[a-zA-Z_][\\w\\-\\.]*",ro="((?:"+no+"\\:)?"+no+")",io=new RegExp("^<"+ro),oo=/^\s*(\/?)>/,so=new RegExp("^<\\/"+ro+"[^>]*>"),ao=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},vo=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,go=v("pre,textarea",!0),yo=function(t,e){return t&&go(t)&&"\n"===e[0]};function bo(t,e){var n=e?mo:vo;return t.replace(n,function(t){return ho[t]})}var _o,wo,xo,Oo,So,Co,ko,Eo,Ao=/^@|^v-on:/,$o=/^v-|^@|^:/,Lo=/([^]*?)\s+(?:in|of)\s+([^]*)/,To=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Po=/^\(|\)$/g,jo=/:(.*)$/,No=/^:|^v-bind:/,Mo=/\.[^.]+/g,Uo=w(Ji);function Io(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},n=0,r=t.length;n]*>)","i")),p=t.replace(f,function(t,n,r){return c=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),yo(l,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});u+=t.length-p.length,t=p,k(l,u-c,u)}else{var d=t.indexOf("<");if(0===d){if(uo.test(t)){var h=t.indexOf("--\x3e");if(h>=0){e.shouldKeepComment&&e.comment(t.substring(4,h)),O(h+3);continue}}if(co.test(t)){var v=t.indexOf("]>");if(v>=0){O(v+2);continue}}var m=t.match(ao);if(m){O(m[0].length);continue}var g=t.match(so);if(g){var y=u;O(g[0].length),k(g[1],y,u);continue}var b=S();if(b){C(b),yo(r,t)&&O(1);continue}}var _=void 0,w=void 0,x=void 0;if(d>=0){for(w=t.slice(d);!(so.test(w)||io.test(w)||uo.test(w)||co.test(w)||(x=w.indexOf("<",1))<0);)d+=x,w=t.slice(d);_=t.substring(0,d),O(d)}d<0&&(_=t,t=""),e.chars&&_&&e.chars(_)}if(t===n){e.chars&&e.chars(t);break}}function O(e){u+=e,t=t.substring(e)}function S(){var e=t.match(io);if(e){var n,r,i={tagName:e[1],attrs:[],start:u};for(O(e[0].length);!(n=t.match(oo))&&(r=t.match(eo));)O(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],O(n[0].length),i.end=u,i}}function C(t){var n=t.tagName,u=t.unarySlash;o&&("p"===r&&to(n)&&k(r),a(n)&&r===n&&k(n));for(var c=s(n)||!!u,l=t.attrs.length,f=new Array(l),p=0;p=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=i.length-1;c>=s;c--)e.end&&e.end(i[c].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,o):"p"===a&&(e.start&&e.start(t,[],!1,n,o),e.end&&e.end(t,n,o))}k()}(t,{warn:_o,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,o,c){var l=r&&r.ns||Eo(t);Y&&"svg"===l&&(o=function(t){for(var e=[],n=0;nu&&(a.push(o=t.slice(u,i)),s.push(JSON.stringify(o)));var c=hr(r[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),u=i+r[0].length}return u-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),xr(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+kr(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+kr(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+kr(e,"$$c")+"}",null,!0)}(t,r,i);else if("input"===o&&"radio"===s)!function(t,e,n){var r=n&&n.number,i=Or(t,"value")||"null";yr(t,"checked","_q("+e+","+(i=r?"_n("+i+")":i)+")"),xr(t,"change",kr(e,i),null,!0)}(t,r,i);else if("input"===o||"textarea"===o)!function(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,u=!o&&"range"!==r,c=o?"change":"range"===r?jr:"input",l="$event.target.value";a&&(l="$event.target.value.trim()"),s&&(l="_n("+l+")");var f=kr(e,l);u&&(f="if($event.target.composing)return;"+f),yr(t,"value","("+e+")"),xr(t,c,f,null,!0),(a||s)&&xr(t,"blur","$forceUpdate()")}(t,r,i);else if(!D.isReservedTag(o))return Cr(t,r,i),!1;return!0},text:function(t,e){e.value&&yr(t,"textContent","_s("+e.value+")")},html:function(t,e){e.value&&yr(t,"innerHTML","_s("+e.value+")")}},isPreTag:function(t){return"pre"===t},isUnaryTag:Xi,mustUseProp:xn,canBeLeftOpenTag:Zi,isReservedTag:Un,getTagNamespace:In,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(zo)},Qo=w(function(t){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))});function Jo(t,e){t&&(Wo=Qo(e.staticKeys||""),Ko=e.isReservedTag||P,function t(e){e.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Ko(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Wo)))}(e);if(1===e.type){if(!Ko(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var n=0,r=e.children.length;n|^function\s*\(/,Zo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ts={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},es={esc:"Escape",tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]},ns=function(t){return"if("+t+")return null;"},rs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ns("$event.target !== $event.currentTarget"),ctrl:ns("!$event.ctrlKey"),shift:ns("!$event.shiftKey"),alt:ns("!$event.altKey"),meta:ns("!$event.metaKey"),left:ns("'button' in $event && $event.button !== 0"),middle:ns("'button' in $event && $event.button !== 1"),right:ns("'button' in $event && $event.button !== 2")};function is(t,e,n){var r=e?"nativeOn:{":"on:{";for(var i in t)r+='"'+i+'":'+os(i,t[i])+",";return r.slice(0,-1)+"}"}function os(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return os(t,e)}).join(",")+"]";var n=Zo.test(e.value),r=Xo.test(e.value);if(e.modifiers){var i="",o="",s=[];for(var a in e.modifiers)if(rs[a])o+=rs[a],ts[a]&&s.push(a);else if("exact"===a){var u=e.modifiers;o+=ns(["ctrl","shift","alt","meta"].filter(function(t){return!u[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else s.push(a);return s.length&&(i+=function(t){return"if(!('button' in $event)&&"+t.map(ss).join("&&")+")return null;"}(s)),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function ss(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=ts[t],r=es[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var as={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:T},us=function(t){this.options=t,this.warn=t.warn||mr,this.transforms=gr(t.modules,"transformCode"),this.dataGenFns=gr(t.modules,"genData"),this.directives=$($({},as),t.directives);var e=t.isReservedTag||P;this.maybeComponent=function(t){return!e(t.tag)},this.onceId=0,this.staticRenderFns=[]};function cs(t,e){var n=new us(e);return{render:"with(this){return "+(t?ls(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function ls(t,e){if(t.staticRoot&&!t.staticProcessed)return fs(t,e);if(t.once&&!t.onceProcessed)return ps(t,e);if(t.for&&!t.forProcessed)return function(t,e,n,r){var i=t.for,o=t.alias,s=t.iterator1?","+t.iterator1:"",a=t.iterator2?","+t.iterator2:"";0;return t.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+s+a+"){return "+(n||ls)(t,e)+"})"}(t,e);if(t.if&&!t.ifProcessed)return ds(t,e);if("template"!==t.tag||t.slotTarget){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=ms(t,e),i="_t("+n+(r?","+r:""),o=t.attrs&&"{"+t.attrs.map(function(t){return O(t.name)+":"+t.value}).join(",")+"}",s=t.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=","+o);s&&(i+=(o?"":",null")+","+s);return i+")"}(t,e);var n;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:ms(e,n,!0);return"_c("+t+","+hs(e,n)+(r?","+r:"")+")"}(t.component,t,e);else{var r=t.plain?void 0:hs(t,e),i=t.inlineTemplate?null:ms(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
',Os.innerHTML.indexOf(" ")>0}var ks=!!q&&Cs(!1),Es=!!q&&Cs(!0),As=w(function(t){var e=Dn(t);return e&&e.innerHTML}),$s=pn.prototype.$mount;pn.prototype.$mount=function(t,e){if((t=t&&Dn(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=As(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){0;var i=Ss(r,{shouldDecodeNewlines:ks,shouldDecodeNewlinesForHref:Es,delimiters:n.delimiters,comments:n.comments},this),o=i.render,s=i.staticRenderFns;n.render=o,n.staticRenderFns=s}}return $s.call(this,t,e)},pn.compile=Ss,e.a=pn}).call(this,n(51),n(239).setImmediate)},function(t,e,n){var r=n(68)("wks"),i=n(25),o=n(2).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(3),i=n(100),o=n(44),s=Object.defineProperty;e.f=n(9)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(23),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){t.exports=!n(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(105),i=n(236),o=Object.prototype.toString;function s(t){return"[object Array]"===o.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;nn;)i[n]=e[n++];return i},$t=function(t,e,n){B(t,e,{get:function(){return this._d[n]}})},Lt=function(t){var e,n,r,i,o,s,a=x(t),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,p=E(a);if(void 0!=p&&!O(p)){for(s=p.call(a),r=[],e=0;!(o=s.next()).done;e++)r.push(o.value);a=r}for(f&&u>2&&(l=c(l,arguments[2],2)),e=0,n=v(a.length),i=kt(this,n);n>e;e++)i[e]=f?l(a[e],e):a[e];return i},Tt=function(){for(var t=0,e=arguments.length,n=kt(this,e);e>t;)n[t]=arguments[t++];return n},Pt=!!q&&o(function(){dt.call(new q(1))}),jt=function(){return dt.apply(Pt?ft.call(Ct(this)):Ct(this),arguments)},Nt={copyWithin:function(t,e){return F.call(Ct(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return X(Ct(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return I.apply(Ct(this),arguments)},filter:function(t){return Et(this,Q(Ct(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Z(Ct(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Y(Ct(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Ct(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ct.apply(Ct(this),arguments)},lastIndexOf:function(t){return st.apply(Ct(this),arguments)},map:function(t){return wt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(Ct(this),arguments)},reduceRight:function(t){return ut.apply(Ct(this),arguments)},reverse:function(){for(var t,e=Ct(this).length,n=Math.floor(e/2),r=0;r1?arguments[1]:void 0)},sort:function(t){return lt.call(Ct(this),t)},subarray:function(t,e){var n=Ct(this),r=n.length,i=g(t,r);return new(P(n,n[gt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:g(e,r))-i))}},Mt=function(t,e){return Et(this,ft.call(Ct(this),t,e))},Ut=function(t){Ct(this);var e=St(arguments[1],1),n=this.length,r=x(t),i=v(r.length),o=0;if(i+e>n)throw V("Wrong length!");for(;o255?255:255&r),i.v[d](n*e+i.o,r,xt)}(this,n,t)},enumerable:!0})};b?(h=n(function(t,n,r,i){l(t,h,c,"_d");var o,s,a,u,f=0,d=0;if(w(n)){if(!(n instanceof W||"ArrayBuffer"==(u=_(n))||"SharedArrayBuffer"==u))return bt in n?At(h,n):Lt.call(h,n);o=n,d=St(r,e);var g=n.byteLength;if(void 0===i){if(g%e)throw V("Wrong length!");if((s=g-d)<0)throw V("Wrong length!")}else if((s=v(i)*e)+d>g)throw V("Wrong length!");a=s/e}else a=m(n),o=new W(s=a*e);for(p(t,"_d",{b:o,o:d,l:s,e:a,v:new K(o)});f0?r:n)(t)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(1);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){var r=n(5)("unscopables"),i=Array.prototype;void 0==i[r]&&n(12)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e,n){var r=n(11),i=n(17),o=n(69)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){t.exports={}},function(t,e,n){var r=n(7).f,i=n(11),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(23),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(20);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e){t.exports=!1},function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=66)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(10),i=n(43),o=n(31),s=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(77),i=n(21);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(9),i=n(52),o=n(18),s=n(55),a=n(53),u=function(t,e,n){var c,l,f,p,d=t&u.F,h=t&u.G,v=t&u.S,m=t&u.P,g=t&u.B,y=h?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=h?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in h&&(n=e),n)l=!d&&y&&void 0!==y[c],f=(l?y:n)[c],p=g&&l?a(f,r):m&&"function"==typeof f?a(Function.call,f):f,y&&s(y,c,f,t&u.U),b[c]!=f&&o(b,c,p),m&&_[c]!=f&&(_[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(3),i=n(15);t.exports=n(1)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(29)("wks"),i=n(16),o=n(0).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(48),i=n(22);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(109),i=n(110);t.exports=n(35)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(8);t.exports=function(t,e){return!!t&&r(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(0),i=n(11),o=n(74),s=n(6),a=function(t,e,n){var u,c,l,f=t&a.F,p=t&a.G,d=t&a.S,h=t&a.P,v=t&a.B,m=t&a.W,g=p?i:i[e]||(i[e]={}),y=g.prototype,b=p?r:d?r[e]:(r[e]||{}).prototype;for(u in p&&(n=e),n)(c=!f&&b&&void 0!==b[u])&&u in g||(l=c?b[u]:n[u],g[u]=p&&"function"!=typeof b[u]?n[u]:v&&c?o(l,r):m&&b[u]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((g.virtual||(g.virtual={}))[u]=l,t&a.R&&y&&!y[u]&&s(y,u,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){t.exports={}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(3).f,i=n(2),o=n(7)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(29)("keys"),i=n(16);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(0),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(0),i=n(11),o=n(25),s=n(33),a=n(3).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e,n){var r=n(53),i=n(36),o=n(57),s=n(37),a=n(104);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,f=6==t,p=5==t||f,d=e||a;return function(e,a,h){for(var v,m,g=o(e),y=i(g),b=r(a,h,3),_=s(y.length),w=0,x=n?d(e,_):u?d(e,0):void 0;_>w;w++)if((p||w in y)&&(v=y[w],m=b(v,w,g),t))if(n)x[w]=m;else if(m)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:x.push(v)}else if(l)return!1;return f?-1:c||l?l:x}}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(51);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(56),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(111)("wks"),i=n(58),o=n(9).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";function r(t){return!(0===t||(!Array.isArray(t)||0!==t.length)&&t)}function i(t){return function(){return!t.apply(void 0,arguments)}}function o(t,e,n,r){return t.filter(function(t){return function(t,e){return void 0===t&&(t="undefined"),null===t&&(t="null"),!1===t&&(t="false"),-1!==t.toString().toLowerCase().indexOf(e.trim())}(r(t,n),e)})}function s(t){return t.filter(function(t){return!t.$isLabel})}function a(t,e){return function(n){return n.reduce(function(n,r){return r[t]&&r[t].length?(n.push({$groupLabel:r[e],$isLabel:!0}),n.concat(r[t])):n},[])}}var u=n(65),c=n.n(u),l=n(59),f=(n.n(l),n(122)),p=(n.n(f),n(64)),d=n.n(p),h=n(120),v=(n.n(h),n(121)),m=(n.n(v),n(117)),g=(n.n(m),n(123)),y=(n.n(g),n(118)),b=(n.n(y),n(119)),_=(n.n(b),function(){for(var t=arguments.length,e=new Array(t),n=0;n-1},isSelected:function(t){var e=this.trackBy?t[this.trackBy]:t;return this.valueKeys.indexOf(e)>-1},getOptionLabel:function(t){if(r(t))return"";if(t.isTag)return t.label;if(t.$isLabel)return t.$groupLabel;var e=this.customLabel(t,this.label);return r(e)?"":e},select:function(t,e){if(t.$isLabel&&this.groupSelect)this.selectGroup(t);else if(!(-1!==this.blockKeys.indexOf(e)||this.disabled||t.$isDisabled||t.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==e||this.pointerDirty)){if(t.isTag)this.$emit("tag",t.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(t))return void("Tab"!==e&&this.removeElement(t));this.$emit("select",t,this.id),this.multiple?this.$emit("input",this.internalValue.concat([t]),this.id):this.$emit("input",t,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup:function(t){var e=this,n=this.options.find(function(n){return n[e.groupLabel]===t.$groupLabel});if(n)if(this.wholeGroupSelected(n)){this.$emit("remove",n[this.groupValues],this.id);var r=this.internalValue.filter(function(t){return-1===n[e.groupValues].indexOf(t)});this.$emit("input",r,this.id)}else{var o=n[this.groupValues].filter(i(this.isSelected));this.$emit("select",o,this.id),this.$emit("input",this.internalValue.concat(o),this.id)}},wholeGroupSelected:function(t){return t[this.groupValues].every(this.isSelected)},removeElement:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.disabled){if(!this.allowEmpty&&this.internalValue.length<=1)return void this.deactivate();var n="object"===c()(t)?this.valueKeys.indexOf(t[this.trackBy]):this.valueKeys.indexOf(t);if(this.$emit("remove",t,this.id),this.multiple){var r=this.internalValue.slice(0,n).concat(this.internalValue.slice(n+1));this.$emit("input",r,this.id)}else this.$emit("input",null,this.id);this.closeOnSelect&&e&&this.deactivate()}},removeLastElement:function(){-1===this.blockKeys.indexOf("Delete")&&0===this.search.length&&Array.isArray(this.internalValue)&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate:function(){var t=this;this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&0===this.pointer&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.$nextTick(function(){return t.$refs.search.focus()})):this.$el.focus(),this.$emit("open",this.id))},deactivate:function(){this.isOpen&&(this.isOpen=!1,this.searchable?this.$refs.search.blur():this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle:function(){this.isOpen?this.deactivate():this.activate()},adjustPosition:function(){if("undefined"!=typeof window){var t=this.$el.getBoundingClientRect().top,e=window.innerHeight-this.$el.getBoundingClientRect().bottom;e>this.maxHeight||e>t||"below"===this.openDirection||"bottom"===this.openDirection?(this.prefferedOpenDirection="below",this.optimizedHeight=Math.min(e-40,this.maxHeight)):(this.prefferedOpenDirection="above",this.optimizedHeight=Math.min(t-40,this.maxHeight))}}}}},function(t,e,n){"use strict";var r=n(59);n.n(r),e.a={data:function(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition:function(){return this.pointer*this.optionHeight},visibleElements:function(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions:function(){this.pointerAdjust()},isOpen:function(){this.pointerDirty=!1}},methods:{optionHighlight:function(t,e){return{"multiselect__option--highlight":t===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(e)}},groupHighlight:function(t,e){var n=this;if(!this.groupSelect)return["multiselect__option--disabled"];var r=this.options.find(function(t){return t[n.groupLabel]===e.$groupLabel});return[this.groupSelect?"multiselect__option--group":"multiselect__option--disabled",{"multiselect__option--highlight":t===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(r)}]},addPointerElement:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Enter",e=t.key;this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward:function(){this.pointer0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset:function(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust:function(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet:function(t){this.pointer=t,this.pointerDirty=!0}}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(13),i=n(0).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=!n(1)&&!n(12)(function(){return 7!=Object.defineProperty(n(42)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(25),i=n(23),o=n(49),s=n(6),a=n(2),u=n(24),c=n(79),l=n(27),f=n(86),p=n(7)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,v,m,g,y){c(n,e,v);var b,_,w,x=function(t){if(!d&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},O=e+" Iterator",S="values"==m,C=!1,k=t.prototype,E=k[p]||k["@@iterator"]||m&&k[m],A=E||x(m),$=m?S?x("entries"):A:void 0,L="Array"==e&&k.entries||E;if(L&&(w=f(L.call(new t)))!==Object.prototype&&(l(w,O,!0),r||a(w,p)||s(w,p,h)),S&&E&&"values"!==E.name&&(C=!0,A=function(){return E.call(this)}),r&&!y||!d&&!C&&k[p]||s(k,p,A),u[e]=A,u[O]=h,m)if(b={values:S?A:x("values"),keys:g?A:x("keys"),entries:$},y)for(_ in b)_ in k||o(k,_,b[_]);else i(i.P+i.F*(d||C),e,b);return b}},function(t,e,n){var r=n(10),i=n(83),o=n(22),s=n(28)("IE_PROTO"),a=function(){},u=function(){var t,e=n(42)("iframe"),r=o.length;for(e.style.display="none",n(76).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write(" diff --git a/settings/src/components/appList.vue b/settings/src/components/appList.vue new file mode 100644 index 00000000000..734bc9d55fa --- /dev/null +++ b/settings/src/components/appList.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/settings/src/components/appList/appItem.vue b/settings/src/components/appList/appItem.vue new file mode 100644 index 00000000000..5a4a503f3c9 --- /dev/null +++ b/settings/src/components/appList/appItem.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/settings/src/components/appList/appScore.vue b/settings/src/components/appList/appScore.vue new file mode 100644 index 00000000000..bf04c688186 --- /dev/null +++ b/settings/src/components/appList/appScore.vue @@ -0,0 +1,38 @@ + + + + \ No newline at end of file diff --git a/settings/src/components/appManagement.vue b/settings/src/components/appManagement.vue new file mode 100644 index 00000000000..efeb2b444a2 --- /dev/null +++ b/settings/src/components/appManagement.vue @@ -0,0 +1,117 @@ + + + diff --git a/settings/src/components/appNavigation.vue b/settings/src/components/appNavigation.vue index a3ae2620a97..bab69194372 100644 --- a/settings/src/components/appNavigation.vue +++ b/settings/src/components/appNavigation.vue @@ -6,7 +6,7 @@
-
+