diff --git a/apps/encryption/js/encryption.js b/apps/encryption/js/encryption.js deleted file mode 100644 index 3e528e8c18b10..0000000000000 --- a/apps/encryption/js/encryption.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors - * SPDX-FileCopyrightText: 2014-2015 ownCloud, Inc. - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * @namespace OC - */ -OC.Encryption = _.extend(OC.Encryption || {}, { - displayEncryptionWarning: function() { - if (!OC.currentUser || !OC.Notification.isHidden()) { - return - } - - $.get( - OC.generateUrl('/apps/encryption/ajax/getStatus'), - function(result) { - if (result.status === 'interactionNeeded') { - OC.Notification.show(result.data.message) - } - }, - ) - }, -}) -window.addEventListener('DOMContentLoaded', function() { - // wait for other apps/extensions to register their event handlers and file actions - // in the "ready" clause - _.defer(function() { - OC.Encryption.displayEncryptionWarning() - }) -}) diff --git a/apps/encryption/js/settings-admin.js b/apps/encryption/js/settings-admin.js deleted file mode 100644 index dd0c1823ede3d..0000000000000 --- a/apps/encryption/js/settings-admin.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors - * SPDX-FileCopyrightText: 2013-2015 ownCloud, Inc. - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -window.addEventListener('DOMContentLoaded', function() { - $('input:button[name="enableRecoveryKey"]').click(function() { - const recoveryStatus = $(this).attr('status') - const newRecoveryStatus = (1 + parseInt(recoveryStatus)) % 2 - const buttonValue = $(this).attr('value') - - const recoveryPassword = $('#encryptionRecoveryPassword').val() - const confirmPassword = $('#repeatEncryptionRecoveryPassword').val() - OC.msg.startSaving('#encryptionSetRecoveryKey .msg') - $.post( - OC.generateUrl('/apps/encryption/ajax/adminRecovery'), - { - adminEnableRecovery: newRecoveryStatus, - recoveryPassword, - confirmPassword, - }, - ).done(function(data) { - OC.msg.finishedSuccess('#encryptionSetRecoveryKey .msg', data.data.message) - - if (newRecoveryStatus === 0) { - $('p[name="changeRecoveryPasswordBlock"]').addClass('hidden') - $('input:button[name="enableRecoveryKey"]').attr('value', 'Enable recovery key') - $('input:button[name="enableRecoveryKey"]').attr('status', '0') - } else { - $('input:password[name="changeRecoveryPassword"]').val('') - $('p[name="changeRecoveryPasswordBlock"]').removeClass('hidden') - $('input:button[name="enableRecoveryKey"]').attr('value', 'Disable recovery key') - $('input:button[name="enableRecoveryKey"]').attr('status', '1') - } - }) - .fail(function(jqXHR) { - $('input:button[name="enableRecoveryKey"]').attr('value', buttonValue) - $('input:button[name="enableRecoveryKey"]').attr('status', recoveryStatus) - OC.msg.finishedError('#encryptionSetRecoveryKey .msg', JSON.parse(jqXHR.responseText).data.message) - }) - }) - - $('#repeatEncryptionRecoveryPassword').keyup(function(event) { - if (event.keyCode == 13) { - $('#enableRecoveryKey').click() - } - }) - - // change recovery password - - $('button:button[name="submitChangeRecoveryKey"]').click(function() { - const oldRecoveryPassword = $('#oldEncryptionRecoveryPassword').val() - const newRecoveryPassword = $('#newEncryptionRecoveryPassword').val() - const confirmNewPassword = $('#repeatedNewEncryptionRecoveryPassword').val() - OC.msg.startSaving('#encryptionChangeRecoveryKey .msg') - $.post( - OC.generateUrl('/apps/encryption/ajax/changeRecoveryPassword'), - { - oldPassword: oldRecoveryPassword, - newPassword: newRecoveryPassword, - confirmPassword: confirmNewPassword, - }, - ).done(function(data) { - OC.msg.finishedSuccess('#encryptionChangeRecoveryKey .msg', data.data.message) - }) - .fail(function(jqXHR) { - OC.msg.finishedError('#encryptionChangeRecoveryKey .msg', JSON.parse(jqXHR.responseText).data.message) - }) - }) - - $('#encryptHomeStorage').change(function() { - $.post( - OC.generateUrl('/apps/encryption/ajax/setEncryptHomeStorage'), - { - encryptHomeStorage: this.checked, - }, - ) - }) -}) diff --git a/apps/encryption/js/settings-personal.js b/apps/encryption/js/settings-personal.js deleted file mode 100644 index 76560afab58e7..0000000000000 --- a/apps/encryption/js/settings-personal.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors - * SPDX-FileCopyrightText: 2013-2015 ownCloud, Inc. - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -OC.Encryption = _.extend(OC.Encryption || {}, { - updatePrivateKeyPassword: function() { - const oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val() - const newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val() - OC.msg.startSaving('#ocDefaultEncryptionModule .msg') - $.post( - OC.generateUrl('/apps/encryption/ajax/updatePrivateKeyPassword'), - { - oldPassword: oldPrivateKeyPassword, - newPassword: newPrivateKeyPassword, - }, - ).done(function(data) { - OC.msg.finishedSuccess('#ocDefaultEncryptionModule .msg', data.message) - }).fail(function(jqXHR) { - OC.msg.finishedError('#ocDefaultEncryptionModule .msg', JSON.parse(jqXHR.responseText).message) - }) - }, -}) - -window.addEventListener('DOMContentLoaded', function() { - // Trigger ajax on recoveryAdmin status change - $('input:radio[name="userEnableRecovery"]').change(function() { - const recoveryStatus = $(this).val() - OC.msg.startAction('#userEnableRecovery .msg', 'Updating recovery keys. This can take some time...') - $.post( - OC.generateUrl('/apps/encryption/ajax/userSetRecovery'), - { - userEnableRecovery: recoveryStatus, - }, - ).done(function(data) { - OC.msg.finishedSuccess('#userEnableRecovery .msg', data.data.message) - }) - .fail(function(jqXHR) { - OC.msg.finishedError('#userEnableRecovery .msg', JSON.parse(jqXHR.responseText).data.message) - }) - // Ensure page is not reloaded on form submit - return false - }) - - // update private key password - - $('input:password[name="changePrivateKeyPassword"]').keyup(function(event) { - const oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val() - const newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val() - if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '') { - $('button:button[name="submitChangePrivateKeyPassword"]').removeAttr('disabled') - if (event.which === 13) { - OC.Encryption.updatePrivateKeyPassword() - } - } else { - $('button:button[name="submitChangePrivateKeyPassword"]').attr('disabled', 'true') - } - }) - - $('button:button[name="submitChangePrivateKeyPassword"]').click(function() { - OC.Encryption.updatePrivateKeyPassword() - }) -}) diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php index e7fb6bafb672d..cc172d18b3035 100644 --- a/apps/encryption/lib/Controller/RecoveryController.php +++ b/apps/encryption/lib/Controller/RecoveryController.php @@ -12,35 +12,23 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\DataResponse; -use OCP\IConfig; +use OCP\Encryption\Exceptions\GenericEncryptionException; use OCP\IL10N; use OCP\IRequest; +use Psr\Log\LoggerInterface; class RecoveryController extends Controller { - /** - * @param string $AppName - * @param IRequest $request - * @param IConfig $config - * @param IL10N $l - * @param Recovery $recovery - */ public function __construct( - $appName, + string $appName, IRequest $request, - private IConfig $config, private IL10N $l, private Recovery $recovery, + private LoggerInterface $logger, ) { parent::__construct($appName, $request); } - /** - * @param string $recoveryPassword - * @param string $confirmPassword - * @param string $adminEnableRecovery - * @return DataResponse - */ - public function adminRecovery($recoveryPassword, $confirmPassword, $adminEnableRecovery) { + public function adminRecovery(string $recoveryPassword, string $confirmPassword, bool $adminEnableRecovery): DataResponse { // Check if both passwords are the same if (empty($recoveryPassword)) { $errorMessage = $this->l->t('Missing recovery key password'); @@ -60,28 +48,28 @@ public function adminRecovery($recoveryPassword, $confirmPassword, $adminEnableR Http::STATUS_BAD_REQUEST); } - if (isset($adminEnableRecovery) && $adminEnableRecovery === '1') { - if ($this->recovery->enableAdminRecovery($recoveryPassword)) { - return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully enabled')]]); + try { + if ($adminEnableRecovery) { + if ($this->recovery->enableAdminRecovery($recoveryPassword)) { + return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully enabled')]]); + } + return new DataResponse(['data' => ['message' => $this->l->t('Could not enable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); + } else { + if ($this->recovery->disableAdminRecovery($recoveryPassword)) { + return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully disabled')]]); + } + return new DataResponse(['data' => ['message' => $this->l->t('Could not disable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); } - return new DataResponse(['data' => ['message' => $this->l->t('Could not enable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); - } elseif (isset($adminEnableRecovery) && $adminEnableRecovery === '0') { - if ($this->recovery->disableAdminRecovery($recoveryPassword)) { - return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully disabled')]]); + } catch (\Exception $e) { + $this->logger->error('Error enabling or disabling recovery key', ['exception' => $e]); + if ($e instanceof GenericEncryptionException) { + return new DataResponse(['data' => ['message' => $e->getMessage()]], Http::STATUS_INTERNAL_SERVER_ERROR); } - return new DataResponse(['data' => ['message' => $this->l->t('Could not disable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); + return new DataResponse([], Http::STATUS_INTERNAL_SERVER_ERROR); } - // this response should never be sent but just in case. - return new DataResponse(['data' => ['message' => $this->l->t('Missing parameters')]], Http::STATUS_BAD_REQUEST); } - /** - * @param string $newPassword - * @param string $oldPassword - * @param string $confirmPassword - * @return DataResponse - */ - public function changeRecoveryPassword($newPassword, $oldPassword, $confirmPassword) { + public function changeRecoveryPassword(string $newPassword, string $oldPassword, string $confirmPassword): DataResponse { //check if both passwords are the same if (empty($oldPassword)) { $errorMessage = $this->l->t('Please provide the old recovery password'); @@ -103,23 +91,30 @@ public function changeRecoveryPassword($newPassword, $oldPassword, $confirmPassw return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } - $result = $this->recovery->changeRecoveryKeyPassword($newPassword, - $oldPassword); + try { + $result = $this->recovery->changeRecoveryKeyPassword($newPassword, + $oldPassword); - if ($result) { - return new DataResponse( - [ - 'data' => [ - 'message' => $this->l->t('Password successfully changed.')] - ] - ); - } - return new DataResponse( - [ + if ($result) { + return new DataResponse( + [ + 'data' => [ + 'message' => $this->l->t('Password successfully changed.')] + ] + ); + } + return new DataResponse([ 'data' => [ 'message' => $this->l->t('Could not change the password. Maybe the old password was not correct.') ] ], Http::STATUS_BAD_REQUEST); + } catch (\Exception $e) { + $this->logger->error('Error changing recovery password', ['exception' => $e]); + if ($e instanceof GenericEncryptionException) { + return new DataResponse(['data' => ['message' => $e->getMessage()]], Http::STATUS_INTERNAL_SERVER_ERROR); + } + return new DataResponse([], Http::STATUS_INTERNAL_SERVER_ERROR); + } } /** diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php index 914432f78a321..582401502a1f3 100644 --- a/apps/encryption/lib/Controller/StatusController.php +++ b/apps/encryption/lib/Controller/StatusController.php @@ -68,8 +68,10 @@ public function getStatus() { return new DataResponse( [ 'status' => $status, + 'initStatus' => $this->session->getStatus(), 'data' => [ - 'message' => $message] + 'message' => $message, + ], ] ); } diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php index a5de4ba68ffa0..1ac2ab5ff5eeb 100644 --- a/apps/encryption/lib/Settings/Admin.php +++ b/apps/encryption/lib/Settings/Admin.php @@ -7,10 +7,13 @@ namespace OCA\Encryption\Settings; use OC\Files\View; +use OCA\Encryption\AppInfo\Application; use OCA\Encryption\Crypto\Crypt; use OCA\Encryption\Session; use OCA\Encryption\Util; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; +use OCP\IAppConfig; use OCP\IConfig; use OCP\IL10N; use OCP\ISession; @@ -27,6 +30,8 @@ public function __construct( private IConfig $config, private IUserManager $userManager, private ISession $session, + private IInitialState $initialState, + private IAppConfig $appConfig, ) { } @@ -48,19 +53,21 @@ public function getForm() { $this->userManager); // Check if an adminRecovery account is enabled for recovering files after lost pwd - $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled', '0'); + $recoveryAdminEnabled = $this->appConfig->getValueBool('encryption', 'recoveryAdminEnabled'); $session = new Session($this->session); $encryptHomeStorage = $util->shouldEncryptHomeStorage(); - $parameters = [ + $this->initialState->provideInitialState('adminSettings', [ 'recoveryEnabled' => $recoveryAdminEnabled, 'initStatus' => $session->getStatus(), 'encryptHomeStorage' => $encryptHomeStorage, 'masterKeyEnabled' => $util->isMasterKeyEnabled(), - ]; + ]); - return new TemplateResponse('encryption', 'settings-admin', $parameters, ''); + \OCP\Util::addStyle(Application::APP_ID, 'settings_admin'); + \OCP\Util::addScript(Application::APP_ID, 'settings_admin'); + return new TemplateResponse(Application::APP_ID, 'settings', renderAs: ''); } /** diff --git a/apps/encryption/lib/Settings/Personal.php b/apps/encryption/lib/Settings/Personal.php index 8814d3afb585f..cac6ff249eb6f 100644 --- a/apps/encryption/lib/Settings/Personal.php +++ b/apps/encryption/lib/Settings/Personal.php @@ -6,20 +6,25 @@ */ namespace OCA\Encryption\Settings; +use OCA\Encryption\AppInfo\Application; use OCA\Encryption\Session; use OCA\Encryption\Util; use OCP\AppFramework\Http\TemplateResponse; -use OCP\IConfig; +use OCP\AppFramework\Services\IInitialState; +use OCP\Encryption\IManager; +use OCP\IAppConfig; use OCP\IUserSession; use OCP\Settings\ISettings; class Personal implements ISettings { public function __construct( - private IConfig $config, private Session $session, private Util $util, private IUserSession $userSession, + private IInitialState $initialState, + private IAppConfig $appConfig, + private IManager $manager, ) { } @@ -28,7 +33,7 @@ public function __construct( * @since 9.1 */ public function getForm() { - $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled'); + $recoveryAdminEnabled = $this->appConfig->getValueBool('encryption', 'recoveryAdminEnabled'); $privateKeySet = $this->session->isPrivateKeySet(); if (!$recoveryAdminEnabled && $privateKeySet) { @@ -38,20 +43,23 @@ public function getForm() { $userId = $this->userSession->getUser()->getUID(); $recoveryEnabledForUser = $this->util->isRecoveryEnabledForUser($userId); - $parameters = [ + $this->initialState->provideInitialState('personalSettings', [ 'recoveryEnabled' => $recoveryAdminEnabled, 'recoveryEnabledForUser' => $recoveryEnabledForUser, 'privateKeySet' => $privateKeySet, 'initialized' => $this->session->getStatus(), - ]; - return new TemplateResponse('encryption', 'settings-personal', $parameters, ''); + ]); + + \OCP\Util::addStyle(Application::APP_ID, 'settings_personal'); + \OCP\Util::addScript(Application::APP_ID, 'settings_personal'); + return new TemplateResponse(Application::APP_ID, 'settings', renderAs: ''); } - /** - * @return string the section ID, e.g. 'sharing' - * @since 9.1 - */ public function getSection() { + if (!$this->manager->isEnabled()) { + return null; + } + return 'security'; } diff --git a/apps/encryption/src/components/SettingsAdminHomeStorage.vue b/apps/encryption/src/components/SettingsAdminHomeStorage.vue new file mode 100644 index 0000000000000..3c2a9a9ceb58d --- /dev/null +++ b/apps/encryption/src/components/SettingsAdminHomeStorage.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/apps/encryption/src/components/SettingsAdminRecoveryKey.vue b/apps/encryption/src/components/SettingsAdminRecoveryKey.vue new file mode 100644 index 0000000000000..f53bf368650aa --- /dev/null +++ b/apps/encryption/src/components/SettingsAdminRecoveryKey.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/apps/encryption/src/components/SettingsAdminRecoveryKeyChange.vue b/apps/encryption/src/components/SettingsAdminRecoveryKeyChange.vue new file mode 100644 index 0000000000000..e4e1fcbfc62e8 --- /dev/null +++ b/apps/encryption/src/components/SettingsAdminRecoveryKeyChange.vue @@ -0,0 +1,98 @@ + + + + + + + diff --git a/apps/encryption/src/components/SettingsPersonalChangePrivateKey.vue b/apps/encryption/src/components/SettingsPersonalChangePrivateKey.vue new file mode 100644 index 0000000000000..6631b17d12ffc --- /dev/null +++ b/apps/encryption/src/components/SettingsPersonalChangePrivateKey.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/apps/encryption/src/components/SettingsPersonalEnableRecovery.vue b/apps/encryption/src/components/SettingsPersonalEnableRecovery.vue new file mode 100644 index 0000000000000..b3aacd4fece1e --- /dev/null +++ b/apps/encryption/src/components/SettingsPersonalEnableRecovery.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/apps/encryption/src/encryption.ts b/apps/encryption/src/encryption.ts new file mode 100644 index 0000000000000..40eeb65e00ed8 --- /dev/null +++ b/apps/encryption/src/encryption.ts @@ -0,0 +1,21 @@ +/*! + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { getCurrentUser } from '@nextcloud/auth' +import axios from '@nextcloud/axios' +import { showWarning } from '@nextcloud/dialogs' +import { generateUrl } from '@nextcloud/router' + +window.addEventListener('DOMContentLoaded', async function() { + if (getCurrentUser() === null) { + // skip for public pages + return + } + + const { data } = await axios.get(generateUrl('/apps/encryption/ajax/getStatus')) + if (data.status === 'interactionNeeded') { + showWarning(data.data.message) + } +}) diff --git a/apps/encryption/src/settings-admin.ts b/apps/encryption/src/settings-admin.ts new file mode 100644 index 0000000000000..66cdc50de94a0 --- /dev/null +++ b/apps/encryption/src/settings-admin.ts @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { createApp } from 'vue' +import SettingsAdmin from './views/SettingsAdmin.vue' + +const app = createApp(SettingsAdmin) +app.mount('#encryption-settings-section') diff --git a/apps/encryption/src/settings-personal.ts b/apps/encryption/src/settings-personal.ts new file mode 100644 index 0000000000000..24d9c17fea9b0 --- /dev/null +++ b/apps/encryption/src/settings-personal.ts @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { createApp } from 'vue' +import SettingsPersonal from './views/SettingsPersonal.vue' + +const app = createApp(SettingsPersonal) +app.mount('#encryption-settings-section') diff --git a/apps/encryption/src/utils/logger.ts b/apps/encryption/src/utils/logger.ts new file mode 100644 index 0000000000000..2ea1a9c08feaf --- /dev/null +++ b/apps/encryption/src/utils/logger.ts @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { getLoggerBuilder } from '@nextcloud/logger' + +export const logger = getLoggerBuilder() + .setApp('encryption') + .build() diff --git a/apps/encryption/src/utils/types.ts b/apps/encryption/src/utils/types.ts new file mode 100644 index 0000000000000..661c10c6bd5ab --- /dev/null +++ b/apps/encryption/src/utils/types.ts @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +export const InitStatus = Object.freeze({ + NotInitialized: '0', + InitExecuted: '1', + InitSuccessful: '2', +}) diff --git a/apps/encryption/src/views/SettingsAdmin.vue b/apps/encryption/src/views/SettingsAdmin.vue new file mode 100644 index 0000000000000..b1c37325334a6 --- /dev/null +++ b/apps/encryption/src/views/SettingsAdmin.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/apps/encryption/src/views/SettingsPersonal.vue b/apps/encryption/src/views/SettingsPersonal.vue new file mode 100644 index 0000000000000..79a87b8098a4a --- /dev/null +++ b/apps/encryption/src/views/SettingsPersonal.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php deleted file mode 100644 index 432ba2f11b049..0000000000000 --- a/apps/encryption/templates/settings-admin.php +++ /dev/null @@ -1,83 +0,0 @@ - -
-

t('Default encryption module')); ?>

- - t('Encryption app is enabled but your keys are not initialized, please log-out and log-in again')); ?> - -

- /> -
- t('Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted')); ?> -

-
- -

- t('Enable recovery key')) : p($l->t('Disable recovery key')); ?> - -
- - t('The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.')) ?> - -
- - - -

-

- -

> - t('Change recovery key password:')); ?> - -
- -
- - - - -

- - -
diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php deleted file mode 100644 index 604bed53a8fcd..0000000000000 --- a/apps/encryption/templates/settings-personal.php +++ /dev/null @@ -1,79 +0,0 @@ - -
-

t('Basic encryption module')); ?>

- - - - t('Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.')); ?> - - -

- - -
- t('Set your old private key password to your current log-in password:')); ?> - t('If you do not remember your old password you can ask your administrator to recover your files.')); - endif; ?> -
- - -
- - -
- - -

- - -
-

- - -
- t('Enabling this option will allow you to reobtain access to your encrypted files in case of password loss')); ?> -
- /> - -
- - /> - -

- - diff --git a/apps/encryption/templates/settings.php b/apps/encryption/templates/settings.php new file mode 100644 index 0000000000000..013a8120cce28 --- /dev/null +++ b/apps/encryption/templates/settings.php @@ -0,0 +1,10 @@ + + +
diff --git a/apps/encryption/tests/Controller/RecoveryControllerTest.php b/apps/encryption/tests/Controller/RecoveryControllerTest.php index 717e31cf53bb1..242abe8861f3f 100644 --- a/apps/encryption/tests/Controller/RecoveryControllerTest.php +++ b/apps/encryption/tests/Controller/RecoveryControllerTest.php @@ -16,6 +16,7 @@ use OCP\IL10N; use OCP\IRequest; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Test\TestCase; class RecoveryControllerTest extends TestCase { @@ -28,11 +29,11 @@ class RecoveryControllerTest extends TestCase { public static function adminRecoveryProvider(): array { return [ - ['test', 'test', '1', 'Recovery key successfully enabled', Http::STATUS_OK], - ['', 'test', '1', 'Missing recovery key password', Http::STATUS_BAD_REQUEST], - ['test', '', '1', 'Please repeat the recovery key password', Http::STATUS_BAD_REQUEST], - ['test', 'something that doesn\'t match', '1', 'Repeated recovery key password does not match the provided recovery key password', Http::STATUS_BAD_REQUEST], - ['test', 'test', '0', 'Recovery key successfully disabled', Http::STATUS_OK], + ['test', 'test', true, 'Recovery key successfully enabled', Http::STATUS_OK], + ['', 'test', true, 'Missing recovery key password', Http::STATUS_BAD_REQUEST], + ['test', '', true, 'Please repeat the recovery key password', Http::STATUS_BAD_REQUEST], + ['test', 'something that doesn\'t match', true, 'Repeated recovery key password does not match the provided recovery key password', Http::STATUS_BAD_REQUEST], + ['test', 'test', false, 'Recovery key successfully disabled', Http::STATUS_OK], ]; } @@ -150,10 +151,12 @@ protected function setUp(): void { ->disableOriginalConstructor() ->getMock(); - $this->controller = new RecoveryController('encryption', + $this->controller = new RecoveryController( + 'encryption', $this->requestMock, - $this->configMock, $this->l10nMock, - $this->recoveryMock); + $this->recoveryMock, + $this->createMock(LoggerInterface::class), + ); } } diff --git a/apps/encryption/tests/Controller/StatusControllerTest.php b/apps/encryption/tests/Controller/StatusControllerTest.php index 1bbcad7741178..0c1f209078a39 100644 --- a/apps/encryption/tests/Controller/StatusControllerTest.php +++ b/apps/encryption/tests/Controller/StatusControllerTest.php @@ -56,7 +56,7 @@ protected function setUp(): void { */ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestGetStatus')] public function testGetStatus($status, $expectedStatus): void { - $this->sessionMock->expects($this->once()) + $this->sessionMock->expects($this->atLeastOnce()) ->method('getStatus')->willReturn($status); $result = $this->controller->getStatus(); $data = $result->getData(); diff --git a/apps/encryption/tests/Settings/AdminTest.php b/apps/encryption/tests/Settings/AdminTest.php index 8355cdf67295e..10d2a61c5279e 100644 --- a/apps/encryption/tests/Settings/AdminTest.php +++ b/apps/encryption/tests/Settings/AdminTest.php @@ -10,6 +10,8 @@ use OCA\Encryption\Settings\Admin; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; +use OCP\IAppConfig; use OCP\IConfig; use OCP\IL10N; use OCP\ISession; @@ -29,16 +31,20 @@ class AdminTest extends TestCase { protected IConfig&MockObject $config; protected IUserManager&MockObject $userManager; protected ISession&MockObject $session; + protected IInitialState&MockObject $initialState; + protected IAppConfig&MockObject $appConfig; protected function setUp(): void { parent::setUp(); - $this->l = $this->getMockBuilder(IL10N::class)->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class)->getMock(); - $this->config = $this->getMockBuilder(IConfig::class)->getMock(); - $this->userManager = $this->getMockBuilder(IUserManager::class)->getMock(); - $this->session = $this->getMockBuilder(ISession::class)->getMock(); + $this->l = $this->createMock(IL10N::class); + $this->logger = $this->createMock(LoggerInterface::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->config = $this->createMock(IConfig::class); + $this->userManager = $this->createMock(IUserManager::class); + $this->session = $this->createMock(ISession::class); + $this->initialState = $this->createMock(IInitialState::class); + $this->appConfig = $this->createMock(IAppConfig::class); $this->admin = new Admin( $this->l, @@ -46,11 +52,18 @@ protected function setUp(): void { $this->userSession, $this->config, $this->userManager, - $this->session + $this->session, + $this->initialState, + $this->appConfig, ); } public function testGetForm(): void { + $this->appConfig + ->method('getValueBool') + ->willReturnMap([ + ['encryption', 'recoveryAdminEnabled', true] + ]); $this->config ->method('getAppValue') ->willReturnCallback(function ($app, $key, $default) { @@ -62,13 +75,17 @@ public function testGetForm(): void { } return $default; }); - $params = [ - 'recoveryEnabled' => '1', - 'initStatus' => '0', - 'encryptHomeStorage' => true, - 'masterKeyEnabled' => true - ]; - $expected = new TemplateResponse('encryption', 'settings-admin', $params, ''); + + $this->initialState + ->expects(self::once()) + ->method('provideInitialState') + ->with('adminSettings', [ + 'recoveryEnabled' => true, + 'initStatus' => '0', + 'encryptHomeStorage' => true, + 'masterKeyEnabled' => true + ]); + $expected = new TemplateResponse('encryption', 'settings', renderAs: ''); $this->assertEquals($expected, $this->admin->getForm()); } diff --git a/build/frontend/apps/encryption b/build/frontend/apps/encryption new file mode 120000 index 0000000000000..bb16262bee69b --- /dev/null +++ b/build/frontend/apps/encryption @@ -0,0 +1 @@ +../../../apps/encryption \ No newline at end of file diff --git a/build/frontend/vite.config.ts b/build/frontend/vite.config.ts index 51c10d4baa0f7..4b1cfbdb113ce 100644 --- a/build/frontend/vite.config.ts +++ b/build/frontend/vite.config.ts @@ -12,6 +12,11 @@ const modules = { 'settings-admin-example-content': resolve(import.meta.dirname, 'apps/dav/src', 'settings-admin-example-content.ts'), 'settings-personal-availability': resolve(import.meta.dirname, 'apps/dav/src', 'settings-personal-availability.ts'), }, + encryption: { + encryption: resolve(import.meta.dirname, 'apps/encryption/src', 'encryption.ts'), + settings_admin: resolve(import.meta.dirname, 'apps/encryption/src', 'settings-admin.ts'), + settings_personal: resolve(import.meta.dirname, 'apps/encryption/src', 'settings-personal.ts'), + }, federation: { 'settings-admin': resolve(import.meta.dirname, 'apps/federation/src', 'settings-admin.ts'), }, diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 8c34578e3b13f..155ccd6ba42f4 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1135,9 +1135,6 @@ - - - @@ -1145,11 +1142,6 @@ - - - - - diff --git a/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs new file mode 100644 index 0000000000000..74e6e3bb1b80d --- /dev/null +++ b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs @@ -0,0 +1,2 @@ +import{b as g,p as y,q as v,c as p,u as o,o as n,N as h,w as _,g as V,t as k,r as x,s as M,j as d,e as f,F as q,C as w,E as U,G as j}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import{c as C}from"./index-FffHbzvj.chunk.mjs";import{a as E}from"./index-JpgrUA2Z-BU0x-nEh.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-Cr5LJw9O.chunk.mjs";import{g as N}from"./createElementId-DhjFt1I9-CmaX6aVQ.chunk.mjs";import{c as S}from"./NcNoteCard-CVhtNL04-DvQ-q8jC.chunk.mjs";import{N as A}from"./NcSelect-Czzsi3P_-DYeov0Mn.chunk.mjs";import{N as K}from"./NcCheckboxRadioSwitch-BCSKF7Tk-BfYgMYeK.chunk.mjs";import{N as z}from"./NcPasswordField-djttkA5Q-PPKLVftl.chunk.mjs";import{_ as B}from"./TrashCanOutline-Dy-u-_ok.chunk.mjs";import{a as c,C as b}from"./types-enGIHWiM.chunk.mjs";import{l as G}from"./logger-CrDakPzW.chunk.mjs";const P=g({__name:"ConfigurationEntry",props:y({configKey:{},configOption:{}},{modelValue:{type:[String,Boolean],default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=v(e,"modelValue");return(t,i)=>e.configOption.type!==o(c).Boolean?(n(),p(h(e.configOption.type===o(c).Password?o(z):o(B)),{key:0,modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=l=>a.value=l),name:e.configKey,required:!(e.configOption.flags&o(b).Optional),label:e.configOption.value,title:e.configOption.tooltip},null,8,["modelValue","name","required","label","title"])):(n(),p(o(K),{key:1,modelValue:a.value,"onUpdate:modelValue":i[1]||(i[1]=l=>a.value=l),type:"switch",title:e.configOption.tooltip},{default:_(()=>[V(k(e.configOption.value),1)]),_:1},8,["modelValue","title"]))}}),R=g({__name:"AuthMechanismRsa",props:y({authMechanism:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=v(e,"modelValue"),t=x();M(t,()=>{t.value&&(a.value.private_key="",a.value.public_key="")});async function i(){try{const{data:l}=await C.post(N("/apps/files_external/ajax/public_key.php"),{keyLength:t.value});a.value.private_key=l.data.private_key,a.value.public_key=l.data.public_key}catch(l){G.error("Error generating RSA key pair",{error:l}),E(s("files_external","Error generating key pair"))}}return(l,m)=>(n(),d("div",null,[(n(!0),d(q,null,w(e.authMechanism.configuration,(r,u)=>U((n(),p(P,{key:r.value,modelValue:a.value[u],"onUpdate:modelValue":O=>a.value[u]=O,"config-key":u,"config-option":r},null,8,["modelValue","onUpdate:modelValue","config-key","config-option"])),[[j,!(r.flags&o(b).Hidden)]])),128)),f(o(A),{modelValue:t.value,"onUpdate:modelValue":m[0]||(m[0]=r=>t.value=r),clearable:!1,"input-label":o(s)("files_external","Key size"),options:[1024,2048,4096],required:""},null,8,["modelValue","input-label"]),f(o(S),{disabled:!t.value,wide:"",onClick:i},{default:_(()=>[V(k(o(s)("files_external","Generate keys")),1)]),_:1},8,["disabled"])]))}}),$=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{$ as A,P as _}; +//# sourceMappingURL=AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map diff --git a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.license b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.license similarity index 100% rename from dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.license rename to dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.license diff --git a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.map b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map similarity index 97% rename from dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.map rename to dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map index 07336e685066a..70b410e0d8e56 100644 --- a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.map +++ b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"AuthMechanismRsa-Difzo-Vr.chunk.mjs","sources":["../build/frontend/apps/files_external/src/components/AddExternalStorageDialog/ConfigurationEntry.vue","../build/frontend/apps/files_external/src/views/AuthMechanismRsa.vue"],"sourcesContent":["\n\n\n\n\n","\n\n\n\n\n"],"names":["value","_useModel","__props","_unref","ConfigurationType","_createBlock","_resolveDynamicComponent","NcPasswordField","NcTextField","$event","ConfigurationFlag","NcCheckboxRadioSwitch","_createTextVNode","_toDisplayString","modelValue","keySize","ref","watch","generateKeys","data","axios","generateUrl","error","logger","showError","t","_createElementBlock","_openBlock","_Fragment","configOption","configKey","ConfigurationEntry","_vShow","_createVNode","NcSelect","NcButton"],"mappings":"y9BAaA,MAAMA,EAAQC,EAA6BC,EAAC,YAA6B,eAWjEA,EAAA,aAAa,OAASC,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EAC5B,aAAYqB,EACZ,gBAAeD,CAAA,8EAJN,CAAAG,EAAA,EAAAH,EAAa,MAAQ1B,EAAAO,CAAA,EAAkB,OAAM,CAAA,UAMxDuB,EAKY9B,EAAA+B,CAAA,EAAA,YAJFnB,EAAA,2CAAAA,EAAO,MAAAN,GACf,UAAW,GACX,cAAaN,EAAAsB,CAAA,EAAC,iBAAA,UAAA,EACd,QAAS,CAAA,KAAA,KAAA,IAAA,EACV,SAAA,EAAA,uCAEDQ,EAKW9B,EAAAgC,CAAA,EAAA,CAJT,UAAWpB,EAAA,MACZ,KAAA,GACC,QAAOG,CAAA,aACR,IAA0C,KAAvCf,EAAAsB,CAAA,EAAC,iBAAA,eAAA,CAAA,EAAA,CAAA,CAAA"} \ No newline at end of file +{"version":3,"file":"AuthMechanismRsa-C7Dhz5x5.chunk.mjs","sources":["../build/frontend/apps/files_external/src/components/AddExternalStorageDialog/ConfigurationEntry.vue","../build/frontend/apps/files_external/src/views/AuthMechanismRsa.vue"],"sourcesContent":["\n\n\n\n\n","\n\n\n\n\n"],"names":["value","_useModel","__props","_unref","ConfigurationType","_createBlock","_resolveDynamicComponent","NcPasswordField","NcTextField","$event","ConfigurationFlag","NcCheckboxRadioSwitch","_createTextVNode","_toDisplayString","modelValue","keySize","ref","watch","generateKeys","data","axios","generateUrl","error","logger","showError","t","_createElementBlock","_openBlock","_Fragment","configOption","configKey","ConfigurationEntry","_vShow","_createVNode","NcSelect","NcButton"],"mappings":"s/BAaA,MAAMA,EAAQC,EAA6BC,EAAC,YAA6B,eAWjEA,EAAA,aAAa,OAASC,EAAAC,CAAA,EAAkB,aAF/CC,EAOiCC,EAN3BJ,EAAA,aAAa,OAASC,EAAAC,CAAA,EAAkB,SAAWD,EAAAI,CAAA,EAAkBJ,EAAAK,CAAA,CAAW,EAAA,kBAE5ER,EAAA,2CAAAA,EAAK,MAAAS,GACb,KAAMP,EAAA,UACN,WAAYA,EAAA,aAAa,MAAQC,EAAAO,CAAA,EAAkB,UAC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AS,CAAA,KAAA,KAAA,IAAA,EACV,SAAA,EAAA,uCAEDQ,EAKW9B,EAAAgC,CAAA,EAAA,CAJT,UAAWpB,EAAA,MACZ,KAAA,GACC,QAAOG,CAAA,aACR,IAA0C,KAAvCf,EAAAsB,CAAA,EAAC,iBAAA,eAAA,CAAA,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.map.license b/dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map.license similarity index 100% rename from dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs.map.license rename to dist/AuthMechanismRsa-C7Dhz5x5.chunk.mjs.map.license diff --git a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs b/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs deleted file mode 100644 index 40041780e2354..0000000000000 --- a/dist/AuthMechanismRsa-Difzo-Vr.chunk.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{b as y,m as g,i as v,c as p,u as o,o as n,W as h,w as _,g as V,t as k,r as x,j as M,s as d,e as f,F as w,B as U,D as j,E as q}from"./preload-helper-BcKx2dRj.chunk.mjs";import{c as E}from"./index-SiCbjwnT.chunk.mjs";import{s as S}from"./index-JpgrUA2Z-C-bEcc7c.chunk.mjs";import{t as s}from"./index-DxX3M173.chunk.mjs";import{c as A}from"./createElementId-DhjFt1I9-sbdxHOjK.chunk.mjs";import{c as B}from"./NcNoteCard-CVhtNL04-Bouqxu_R.chunk.mjs";import{N as C}from"./NcSelect-Czzsi3P_-j1mYabKj.chunk.mjs";import{N as K}from"./NcCheckboxRadioSwitch-BCSKF7Tk-CW55vp24.chunk.mjs";import{N}from"./NcPasswordField-djttkA5Q-CzbXWkK5.chunk.mjs";import{_ as z}from"./TrashCanOutline-ChT1dy1U.chunk.mjs";import{a as c,C as b}from"./types-DcmYTSbP.chunk.mjs";import{l as P}from"./logger-jRfHvDBB.chunk.mjs";const R=y({__name:"ConfigurationEntry",props:g({configKey:{},configOption:{}},{modelValue:{type:[String,Boolean],default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=v(e,"modelValue");return(t,i)=>e.configOption.type!==o(c).Boolean?(n(),p(h(e.configOption.type===o(c).Password?o(N):o(z)),{key:0,modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=l=>a.value=l),name:e.configKey,required:!(e.configOption.flags&o(b).Optional),label:e.configOption.value,title:e.configOption.tooltip},null,8,["modelValue","name","required","label","title"])):(n(),p(o(K),{key:1,modelValue:a.value,"onUpdate:modelValue":i[1]||(i[1]=l=>a.value=l),type:"switch",title:e.configOption.tooltip},{default:_(()=>[V(k(e.configOption.value),1)]),_:1},8,["modelValue","title"]))}}),D=y({__name:"AuthMechanismRsa",props:g({authMechanism:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=v(e,"modelValue"),t=x();M(t,()=>{t.value&&(a.value.private_key="",a.value.public_key="")});async function i(){try{const{data:l}=await E.post(A("/apps/files_external/ajax/public_key.php"),{keyLength:t.value});a.value.private_key=l.data.private_key,a.value.public_key=l.data.public_key}catch(l){P.error("Error generating RSA key pair",{error:l}),S(s("files_external","Error generating key pair"))}}return(l,m)=>(n(),d("div",null,[(n(!0),d(w,null,U(e.authMechanism.configuration,(r,u)=>j((n(),p(R,{key:r.value,modelValue:a.value[u],"onUpdate:modelValue":O=>a.value[u]=O,"config-key":u,"config-option":r},null,8,["modelValue","onUpdate:modelValue","config-key","config-option"])),[[q,!(r.flags&o(b).Hidden)]])),128)),f(o(C),{modelValue:t.value,"onUpdate:modelValue":m[0]||(m[0]=r=>t.value=r),clearable:!1,"input-label":o(s)("files_external","Key size"),options:[1024,2048,4096],required:""},null,8,["modelValue","input-label"]),f(o(B),{disabled:!t.value,wide:"",onClick:i},{default:_(()=>[V(k(o(s)("files_external","Generate keys")),1)]),_:1},8,["disabled"])]))}}),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));export{$ as A,R as _}; -//# sourceMappingURL=AuthMechanismRsa-Difzo-Vr.chunk.mjs.map diff --git a/dist/ContentCopy-CXMLuDDD.chunk.mjs b/dist/ContentCopy-CXMLuDDD.chunk.mjs deleted file mode 100644 index 569997374da04..0000000000000 --- a/dist/ContentCopy-CXMLuDDD.chunk.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{r as g,_ as p,t as h}from"./createElementId-DhjFt1I9-sbdxHOjK.chunk.mjs";import{b as C,s as i,o as e,A as o,v as s,p as _,g as y,t as r,u as d,e as A,q as m}from"./preload-helper-BcKx2dRj.chunk.mjs";import{_ as H}from"./_plugin-vue_export-helper-CqVUm19z.chunk.mjs";const b={name:"HelpCircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},k=["aria-hidden","aria-label"],v=["fill","width","height"],V={d:"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},w={key:0};function z(a,l,t,c,u,f){return e(),i("span",m(a.$attrs,{"aria-hidden":t.title?null:"true","aria-label":t.title,class:"material-design-icon help-circle-icon",role:"img",onClick:l[0]||(l[0]=n=>a.$emit("click",n))}),[(e(),i("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[o("path",V,[t.title?(e(),i("title",w,r(t.title),1)):s("",!0)])],8,v))],16,k)}const M=p(b,[["render",z]]);g();const S={class:"settings-section"},x={class:"settings-section__name"},$=["aria-label","href","title"],I={key:0,class:"settings-section__desc"},N=C({__name:"NcSettingsSection",props:{name:{},description:{default:""},docUrl:{default:""}},setup(a){const l=h("External documentation");return(t,c)=>(e(),i("div",S,[o("h2",x,[y(r(t.name)+" ",1),t.docUrl?(e(),i("a",{key:0,"aria-label":d(l),class:"settings-section__info",href:t.docUrl,rel:"noreferrer nofollow",target:"_blank",title:d(l)},[A(M,{size:20})],8,$)):s("",!0)]),t.description?(e(),i("p",I,r(t.description),1)):s("",!0),_(t.$slots,"default",{},void 0,!0)]))}}),T=p(N,[["__scopeId","data-v-9cedb949"]]),U={name:"ContentCopyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},B=["aria-hidden","aria-label"],L=["fill","width","height"],Z={d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"},q={key:0};function E(a,l,t,c,u,f){return e(),i("span",m(a.$attrs,{"aria-hidden":t.title?null:"true","aria-label":t.title,class:"material-design-icon content-copy-icon",role:"img",onClick:l[0]||(l[0]=n=>a.$emit("click",n))}),[(e(),i("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[o("path",Z,[t.title?(e(),i("title",q,r(t.title),1)):s("",!0)])],8,L))],16,B)}const F=H(U,[["render",E]]);export{F as I,T as N}; -//# sourceMappingURL=ContentCopy-CXMLuDDD.chunk.mjs.map diff --git a/dist/ContentCopy-ZLU3Pysp.chunk.mjs b/dist/ContentCopy-ZLU3Pysp.chunk.mjs new file mode 100644 index 0000000000000..a54821821fd63 --- /dev/null +++ b/dist/ContentCopy-ZLU3Pysp.chunk.mjs @@ -0,0 +1,2 @@ +import{r as g,_ as p,t as h}from"./createElementId-DhjFt1I9-CmaX6aVQ.chunk.mjs";import{b as C,j as i,o as e,k as o,l as s,m as _,g as k,t as r,u as d,e as y,z as f}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import{a as H}from"./index-xFugdZPW.chunk.mjs";const b={name:"HelpCircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},A=["aria-hidden","aria-label"],v=["fill","width","height"],z={d:"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},V={key:0};function w(a,l,t,c,m,u){return e(),i("span",f(a.$attrs,{"aria-hidden":t.title?null:"true","aria-label":t.title,class:"material-design-icon help-circle-icon",role:"img",onClick:l[0]||(l[0]=n=>a.$emit("click",n))}),[(e(),i("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[o("path",z,[t.title?(e(),i("title",V,r(t.title),1)):s("",!0)])],8,v))],16,A)}const M=p(b,[["render",w]]);g();const S={class:"settings-section"},x={class:"settings-section__name"},$=["aria-label","href","title"],I={key:0,class:"settings-section__desc"},N=C({__name:"NcSettingsSection",props:{name:{},description:{default:""},docUrl:{default:""}},setup(a){const l=h("External documentation");return(t,c)=>(e(),i("div",S,[o("h2",x,[k(r(t.name)+" ",1),t.docUrl?(e(),i("a",{key:0,"aria-label":d(l),class:"settings-section__info",href:t.docUrl,rel:"noreferrer nofollow",target:"_blank",title:d(l)},[y(M,{size:20})],8,$)):s("",!0)]),t.description?(e(),i("p",I,r(t.description),1)):s("",!0),_(t.$slots,"default",{},void 0,!0)]))}}),T=p(N,[["__scopeId","data-v-9cedb949"]]),U={name:"ContentCopyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},B=["aria-hidden","aria-label"],L=["fill","width","height"],Z={d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"},j={key:0};function E(a,l,t,c,m,u){return e(),i("span",f(a.$attrs,{"aria-hidden":t.title?null:"true","aria-label":t.title,class:"material-design-icon content-copy-icon",role:"img",onClick:l[0]||(l[0]=n=>a.$emit("click",n))}),[(e(),i("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[o("path",Z,[t.title?(e(),i("title",j,r(t.title),1)):s("",!0)])],8,L))],16,B)}const F=H(U,[["render",E]]);export{F as I,T as N}; +//# sourceMappingURL=ContentCopy-ZLU3Pysp.chunk.mjs.map diff --git a/dist/ContentCopy-CXMLuDDD.chunk.mjs.license b/dist/ContentCopy-ZLU3Pysp.chunk.mjs.license similarity index 100% rename from dist/ContentCopy-CXMLuDDD.chunk.mjs.license rename to dist/ContentCopy-ZLU3Pysp.chunk.mjs.license diff --git a/dist/ContentCopy-CXMLuDDD.chunk.mjs.map b/dist/ContentCopy-ZLU3Pysp.chunk.mjs.map similarity index 98% rename from dist/ContentCopy-CXMLuDDD.chunk.mjs.map rename to dist/ContentCopy-ZLU3Pysp.chunk.mjs.map index bf3ba1446f24c..e1809cc4d30ff 100644 --- a/dist/ContentCopy-CXMLuDDD.chunk.mjs.map +++ b/dist/ContentCopy-ZLU3Pysp.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"ContentCopy-CXMLuDDD.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcSettingsSection-DYXU4pOK.mjs","../node_modules/vue-material-design-icons/ContentCopy.vue"],"sourcesContent":["import '../assets/NcSettingsSection-f5rBJsKJ.css';\nimport { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, defineComponent, renderSlot, createTextVNode, unref, createVNode } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nimport { r as register, a as t } from \"./_l10n-DrTiip5c.mjs\";\nconst _sfc_main$1 = {\n name: \"HelpCircleIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nconst _hoisted_1$1 = [\"aria-hidden\", \"aria-label\"];\nconst _hoisted_2$1 = [\"fill\", \"width\", \"height\"];\nconst _hoisted_3$1 = { d: \"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z\" };\nconst _hoisted_4$1 = { key: 0 };\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps(_ctx.$attrs, {\n \"aria-hidden\": $props.title ? null : \"true\",\n \"aria-label\": $props.title,\n class: \"material-design-icon help-circle-icon\",\n role: \"img\",\n onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit(\"click\", $event))\n }), [\n (openBlock(), createElementBlock(\"svg\", {\n fill: $props.fillColor,\n class: \"material-design-icon__svg\",\n width: $props.size,\n height: $props.size,\n viewBox: \"0 0 24 24\"\n }, [\n createElementVNode(\"path\", _hoisted_3$1, [\n $props.title ? (openBlock(), createElementBlock(\"title\", _hoisted_4$1, toDisplayString($props.title), 1)) : createCommentVNode(\"\", true)\n ])\n ], 8, _hoisted_2$1))\n ], 16, _hoisted_1$1);\n}\nconst HelpCircle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [[\"render\", _sfc_render]]);\nregister();\nconst _hoisted_1 = { class: \"settings-section\" };\nconst _hoisted_2 = { class: \"settings-section__name\" };\nconst _hoisted_3 = [\"aria-label\", \"href\", \"title\"];\nconst _hoisted_4 = {\n key: 0,\n class: \"settings-section__desc\"\n};\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcSettingsSection\",\n props: {\n name: {},\n description: { default: \"\" },\n docUrl: { default: \"\" }\n },\n setup(__props) {\n const ariaLabel = t(\"External documentation\");\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", _hoisted_1, [\n createElementVNode(\"h2\", _hoisted_2, [\n createTextVNode(toDisplayString(_ctx.name) + \" \", 1),\n _ctx.docUrl ? (openBlock(), createElementBlock(\"a\", {\n key: 0,\n \"aria-label\": unref(ariaLabel),\n class: \"settings-section__info\",\n href: _ctx.docUrl,\n rel: \"noreferrer nofollow\",\n target: \"_blank\",\n title: unref(ariaLabel)\n }, [\n createVNode(HelpCircle, { size: 20 })\n ], 8, _hoisted_3)) : createCommentVNode(\"\", true)\n ]),\n _ctx.description ? (openBlock(), createElementBlock(\"p\", _hoisted_4, toDisplayString(_ctx.description), 1)) : createCommentVNode(\"\", true),\n renderSlot(_ctx.$slots, \"default\", {}, void 0, true)\n ]);\n };\n }\n});\nconst NcSettingsSection = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-9cedb949\"]]);\nexport {\n NcSettingsSection as N\n};\n//# sourceMappingURL=NcSettingsSection-DYXU4pOK.mjs.map\n","\n\n"],"names":["_sfc_main$1","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","openBlock","createElementBlock","mergeProps","$event","createElementVNode","toDisplayString","createCommentVNode","HelpCircle","_export_sfc","register","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","defineComponent","__props","ariaLabel","t","createTextVNode","unref","createVNode","renderSlot","NcSettingsSection","_createElementBl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EAAA,CAAA,EAAAQ,GAAET,EAAA,MAAK,QAAUS,CAAM,WACjCqB,EAQM,MAAA,CARA,KAAM5B,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACX8B,EAEO,OAFPd,EAEO,CADQhB,EAAA,OAAb+B,EAAA,EAAAH,EAAuC,YAAhB5B,EAAA,KAAK,EAAA,CAAA","x_google_ignoreList":[0,1]} \ No newline at end of file +{"version":3,"file":"ContentCopy-ZLU3Pysp.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcSettingsSection-DYXU4pOK.mjs","../node_modules/vue-material-design-icons/ContentCopy.vue"],"sourcesContent":["import '../assets/NcSettingsSection-f5rBJsKJ.css';\nimport { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, defineComponent, renderSlot, createTextVNode, unref, createVNode } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nimport { r as register, a as t } from \"./_l10n-DrTiip5c.mjs\";\nconst _sfc_main$1 = {\n name: \"HelpCircleIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nconst _hoisted_1$1 = [\"aria-hidden\", \"aria-label\"];\nconst _hoisted_2$1 = [\"fill\", \"width\", \"height\"];\nconst _hoisted_3$1 = { d: \"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z\" };\nconst _hoisted_4$1 = { key: 0 };\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps(_ctx.$attrs, {\n \"aria-hidden\": $props.title ? null : \"true\",\n \"aria-label\": $props.title,\n class: \"material-design-icon help-circle-icon\",\n role: \"img\",\n onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit(\"click\", $event))\n }), [\n (openBlock(), createElementBlock(\"svg\", {\n fill: $props.fillColor,\n class: \"material-design-icon__svg\",\n width: $props.size,\n height: $props.size,\n viewBox: \"0 0 24 24\"\n }, [\n createElementVNode(\"path\", _hoisted_3$1, [\n $props.title ? (openBlock(), createElementBlock(\"title\", _hoisted_4$1, toDisplayString($props.title), 1)) : createCommentVNode(\"\", true)\n ])\n ], 8, _hoisted_2$1))\n ], 16, _hoisted_1$1);\n}\nconst HelpCircle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [[\"render\", _sfc_render]]);\nregister();\nconst _hoisted_1 = { class: \"settings-section\" };\nconst _hoisted_2 = { class: \"settings-section__name\" };\nconst _hoisted_3 = [\"aria-label\", \"href\", \"title\"];\nconst _hoisted_4 = {\n key: 0,\n class: \"settings-section__desc\"\n};\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"NcSettingsSection\",\n props: {\n name: {},\n description: { default: \"\" },\n docUrl: { default: \"\" }\n },\n setup(__props) {\n const ariaLabel = t(\"External documentation\");\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", _hoisted_1, [\n createElementVNode(\"h2\", _hoisted_2, [\n createTextVNode(toDisplayString(_ctx.name) + \" \", 1),\n _ctx.docUrl ? (openBlock(), createElementBlock(\"a\", {\n key: 0,\n \"aria-label\": unref(ariaLabel),\n class: \"settings-section__info\",\n href: _ctx.docUrl,\n rel: \"noreferrer nofollow\",\n target: \"_blank\",\n title: unref(ariaLabel)\n }, [\n createVNode(HelpCircle, { size: 20 })\n ], 8, _hoisted_3)) : createCommentVNode(\"\", true)\n ]),\n _ctx.description ? (openBlock(), createElementBlock(\"p\", _hoisted_4, toDisplayString(_ctx.description), 1)) : createCommentVNode(\"\", true),\n renderSlot(_ctx.$slots, \"default\", {}, void 0, true)\n ]);\n };\n }\n});\nconst NcSettingsSection = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-9cedb949\"]]);\nexport {\n NcSettingsSection as N\n};\n//# sourceMappingURL=NcSettingsSection-DYXU4pOK.mjs.map\n","\n\n"],"names":["_sfc_main$1","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","openBlock","createElementBlock","mergeProps","$event","createElementVNode","toDisplayString","createCommentVNode","HelpCircle","_export_sfc","register","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","defineComponent","__props","ariaLabel","t","createTextVNode","unref","createVNode","renderSlot","NcSettingsSection","_createElementBlock","_mergeProps","_createElementVNode","_openBlock"],"mappings":"sQAIA,MAAMA,EAAc,CAClB,KAAM,iBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,MACZ,EACI,UAAW,CACT,KAAM,OACN,QAAS,cACf,EACI,KAAM,CACJ,KAAM,OACN,QAAS,EACf,CACA,CACA,EACMC,EAAe,CAAC,cAAe,YAAY,EAC3CC,EAAe,CAAC,OAAQ,QAAS,QAAQ,EACzCC,EAAe,CAAE,EAAG,mUAAmU,EACvVC,EAAe,CAAE,IAAK,CAAC,EAC7B,SAASC,EAAYC,EAAMC,EAAQC,EAAQC,EAAQC,EAAOC,EAAU,CAClE,OAAOC,EAAS,EAAIC,EAAmB,OAAQC,EAAWR,EAAK,OAAQ,CACrE,cAAeE,EAAO,MAAQ,KAAO,OACrC,aAAcA,EAAO,MACrB,MAAO,wCACP,KAAM,MACN,QAASD,EAAO,CAAC,IAAMA,EAAO,CAAC,EAAKQ,GAAWT,EAAK,MAAM,QAASS,CAAM,EAC7E,CAAG,EAAG,EACDH,EAAS,EAAIC,EAAmB,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WAAW,EAAG,CAAC,GAAKY,EAAmB,GAAI,EAAI,EACzIgB,EAAW5B,EAAK,OAAQ,UAAW,CAAA,EAAI,OAAQ,EAAI,CAC3D,CAAO,EAEL,CACF,CAAC,EACK6B,EAAoCf,EAAYM,EAAW,CAAC,CAAC,YAAa,iBAAiB,CAAC,CAAC,EClE9FA,EAAU,CACb,KAAM,kBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,6DAxBYF,EAAA,CAAA,EAAE,4HAA4H,+CAXxIY,EAeO,OAfPC,EAAc/B,EAAA,OAAM,CACb,cAAaE,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,yCACN,KAAK,MACJ,QAAKD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAQ,GAAET,EAAA,MAAK,QAAUS,CAAM,WACjCqB,EAQM,MAAA,CARA,KAAM5B,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACX8B,EAEO,OAFPd,EAEO,CADQhB,EAAA,OAAb+B,EAAA,EAAAH,EAAuC,YAAhB5B,EAAA,KAAK,EAAA,CAAA","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/dist/ContentCopy-CXMLuDDD.chunk.mjs.map.license b/dist/ContentCopy-ZLU3Pysp.chunk.mjs.map.license similarity index 100% rename from dist/ContentCopy-CXMLuDDD.chunk.mjs.map.license rename to dist/ContentCopy-ZLU3Pysp.chunk.mjs.map.license diff --git a/dist/CredentialsDialog-BJfz1BoE.chunk.mjs b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs new file mode 100644 index 0000000000000..9b11078210d6e --- /dev/null +++ b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs @@ -0,0 +1,2 @@ +import{t}from"./translation-DoG5ZELJ-Cr5LJw9O.chunk.mjs";import{N as m}from"./index-JpgrUA2Z-BU0x-nEh.chunk.mjs";import{N as d}from"./NcNoteCard-CVhtNL04-DvQ-q8jC.chunk.mjs";import{N as p}from"./NcPasswordField-djttkA5Q-PPKLVftl.chunk.mjs";import{_ as c}from"./TrashCanOutline-Dy-u-_ok.chunk.mjs";import{b as g,r as n,c as f,o as h,w as x,e as s,u as e}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import"./index-6_gsQFyp.chunk.mjs";import"./index-xFugdZPW.chunk.mjs";import"./createElementId-DhjFt1I9-CmaX6aVQ.chunk.mjs";import"./mdi-Ds-fACAT.chunk.mjs";import"./index-FffHbzvj.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcInputField-Bwsh2aHY-CDnfv5zO.chunk.mjs";const D=g({__name:"CredentialsDialog",emits:["close"],setup(_){const o=n(""),r=n(""),u=[{label:t("files_external","Confirm"),type:"submit",variant:"primary"}];return(i,a)=>(h(),f(e(m),{buttons:u,class:"external-storage-auth","close-on-click-outside":"","data-cy-external-storage-auth":"","is-form":"",name:e(t)("files_external","Storage credentials"),"out-transition":"",onSubmit:a[2]||(a[2]=l=>i.$emit("close",{login:o.value,password:r.value})),"onUpdate:open":a[3]||(a[3]=l=>i.$emit("close"))},{default:x(()=>[s(e(d),{class:"external-storage-auth__header",text:e(t)("files_external","To access the storage, you need to provide the authentication credentials."),type:"info"},null,8,["text"]),s(e(c),{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),autofocus:"",class:"external-storage-auth__login","data-cy-external-storage-auth-dialog-login":"",label:e(t)("files_external","Login"),placeholder:e(t)("files_external","Enter the storage login"),minlength:"2",name:"login",required:""},null,8,["modelValue","label","placeholder"]),s(e(p),{modelValue:r.value,"onUpdate:modelValue":a[1]||(a[1]=l=>r.value=l),class:"external-storage-auth__password","data-cy-external-storage-auth-dialog-password":"",label:e(t)("files_external","Password"),placeholder:e(t)("files_external","Enter the storage password"),name:"password",required:""},null,8,["modelValue","label","placeholder"])]),_:1},8,["name"]))}});export{D as default}; +//# sourceMappingURL=CredentialsDialog-BJfz1BoE.chunk.mjs.map diff --git a/dist/CredentialsDialog-CkguwCxy.chunk.mjs.license b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs.license similarity index 100% rename from dist/CredentialsDialog-CkguwCxy.chunk.mjs.license rename to dist/CredentialsDialog-BJfz1BoE.chunk.mjs.license diff --git a/dist/CredentialsDialog-CkguwCxy.chunk.mjs.map b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs.map similarity index 96% rename from dist/CredentialsDialog-CkguwCxy.chunk.mjs.map rename to dist/CredentialsDialog-BJfz1BoE.chunk.mjs.map index 6ceff74486f1e..85e96a61fa029 100644 --- a/dist/CredentialsDialog-CkguwCxy.chunk.mjs.map +++ b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"CredentialsDialog-CkguwCxy.chunk.mjs","sources":["../build/frontend/apps/files_external/src/views/CredentialsDialog.vue"],"sourcesContent":["\n\n\n\n\n"],"names":["login","ref","password","dialogButtons","t","_createBlock","_unref","NcDialog","_cache","$event","$emit","_createVNode","NcNoteCard","NcTextField","NcPasswordField"],"mappings":"svBAiBA,MAAMA,EAAQC,EAAI,EAAE,EACdC,EAAWD,EAAI,EAAE,EAEjBE,EAA0D,CAAC,CAChE,MAAOC,EAAE,iBAAkB,SAAS,EACpC,KAAM,SACN,QAAS,SAAA,CACT,oBAIAC,EAqCWC,EAAAC,CAAA,EAAA,CApCT,QAASJ,EACV,MAAM,wBACN,yBAAA,GACA,gCAAA,GACA,UAAA,GACC,KAAMG,EAAAF,CAAA,EAAC,iBAAA,qBAAA,EACR,iBAAA,GACC,SAAMI,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEC,EAAAA,MAAK,QAAA,CAAA,MAAYV,EAAA,eAAOE,EAAA,MAAQ,GACxC,+BAAaQ,EAAAA,MAAK,OAAA,EAAA,aAEnB,IAGe,CAHfC,EAGeL,EAAAM,CAAA,EAAA,CAFd,MAAM,gCACL,KAAMN,EAAAF,CAAA,EAAC,iBAAA,4EAAA,EACR,KAAK,MAAA,mBAGNO,EASYL,EAAAO,CAAA,EAAA,YARFb,EAAA,2CAAAA,EAAK,MAAAS,GACd,UAAA,GACA,MAAM,+BACN,6CAAA,GACC,MAAOH,EAAAF,CAAA,EAAC,iBAAA,OAAA,EACR,YAAaE,EAAAF,CAAA,EAAC,iBAAA,yBAAA,EACf,UAAU,IACV,KAAK,QACL,SAAA,EAAA,+CAGDO,EAOYL,EAAAQ,CAAA,EAAA,YANFZ,EAAA,2CAAAA,EAAQ,MAAAO,GACjB,MAAM,kCACN,gDAAA,GACC,MAAOH,EAAAF,CAAA,EAAC,iBAAA,UAAA,EACR,YAAaE,EAAAF,CAAA,EAAC,iBAAA,4BAAA,EACf,KAAK,WACL,SAAA,EAAA"} \ No newline at end of file +{"version":3,"file":"CredentialsDialog-BJfz1BoE.chunk.mjs","sources":["../build/frontend/apps/files_external/src/views/CredentialsDialog.vue"],"sourcesContent":["\n\n\n\n\n"],"names":["login","ref","password","dialogButtons","t","_createBlock","_unref","NcDialog","_cache","$event","$emit","_createVNode","NcNoteCard","NcTextField","NcPasswordField"],"mappings":"kvBAiBA,MAAMA,EAAQC,EAAI,EAAE,EACdC,EAAWD,EAAI,EAAE,EAEjBE,EAA0D,CAAC,CAChE,MAAOC,EAAE,iBAAkB,SAAS,EACpC,KAAM,SACN,QAAS,SAAA,CACT,oBAIAC,EAqCWC,EAAAC,CAAA,EAAA,CApCT,QAASJ,EACV,MAAM,wBACN,yBAAA,GACA,gCAAA,GACA,UAAA,GACC,KAAMG,EAAAF,CAAA,EAAC,iBAAA,qBAAA,EACR,iBAAA,GACC,SAAMI,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEC,EAAAA,MAAK,QAAA,CAAA,MAAYV,EAAA,eAAOE,EAAA,MAAQ,GACxC,+BAAaQ,EAAAA,MAAK,OAAA,EAAA,aAEnB,IAGe,CAHfC,EAGeL,EAAAM,CAAA,EAAA,CAFd,MAAM,gCACL,KAAMN,EAAAF,CAAA,EAAC,iBAAA,4EAAA,EACR,KAAK,MAAA,mBAGNO,EASYL,EAAAO,CAAA,EAAA,YARFb,EAAA,2CAAAA,EAAK,MAAAS,GACd,UAAA,GACA,MAAM,+BACN,6CAAA,GACC,MAAOH,EAAAF,CAAA,EAAC,iBAAA,OAAA,EACR,YAAaE,EAAAF,CAAA,EAAC,iBAAA,yBAAA,EACf,UAAU,IACV,KAAK,QACL,SAAA,EAAA,+CAGDO,EAOYL,EAAAQ,CAAA,EAAA,YANFZ,EAAA,2CAAAA,EAAQ,MAAAO,GACjB,MAAM,kCACN,gDAAA,GACC,MAAOH,EAAAF,CAAA,EAAC,iBAAA,UAAA,EACR,YAAaE,EAAAF,CAAA,EAAC,iBAAA,4BAAA,EACf,KAAK,WACL,SAAA,EAAA"} \ No newline at end of file diff --git a/dist/CredentialsDialog-CkguwCxy.chunk.mjs.map.license b/dist/CredentialsDialog-BJfz1BoE.chunk.mjs.map.license similarity index 100% rename from dist/CredentialsDialog-CkguwCxy.chunk.mjs.map.license rename to dist/CredentialsDialog-BJfz1BoE.chunk.mjs.map.license diff --git a/dist/CredentialsDialog-CkguwCxy.chunk.mjs b/dist/CredentialsDialog-CkguwCxy.chunk.mjs deleted file mode 100644 index ab961786575d1..0000000000000 --- a/dist/CredentialsDialog-CkguwCxy.chunk.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{t}from"./index-DxX3M173.chunk.mjs";import{N as m}from"./index-JpgrUA2Z-C-bEcc7c.chunk.mjs";import{N as d}from"./NcNoteCard-CVhtNL04-Bouqxu_R.chunk.mjs";import{N as p}from"./NcPasswordField-djttkA5Q-CzbXWkK5.chunk.mjs";import{_ as c}from"./TrashCanOutline-ChT1dy1U.chunk.mjs";import{b as g,r as n,c as f,o as h,w as x,e as s,u as e}from"./preload-helper-BcKx2dRj.chunk.mjs";import"./mdi-D9N03AQK.chunk.mjs";import"./_plugin-vue_export-helper-CqVUm19z.chunk.mjs";import"./createElementId-DhjFt1I9-sbdxHOjK.chunk.mjs";import"./PencilOutline-CKHP5rG_.chunk.mjs";import"./index-SiCbjwnT.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcInputField-Bwsh2aHY-B1JPZ-0t.chunk.mjs";const D=g({__name:"CredentialsDialog",emits:["close"],setup(_){const o=n(""),r=n(""),u=[{label:t("files_external","Confirm"),type:"submit",variant:"primary"}];return(i,a)=>(h(),f(e(m),{buttons:u,class:"external-storage-auth","close-on-click-outside":"","data-cy-external-storage-auth":"","is-form":"",name:e(t)("files_external","Storage credentials"),"out-transition":"",onSubmit:a[2]||(a[2]=l=>i.$emit("close",{login:o.value,password:r.value})),"onUpdate:open":a[3]||(a[3]=l=>i.$emit("close"))},{default:x(()=>[s(e(d),{class:"external-storage-auth__header",text:e(t)("files_external","To access the storage, you need to provide the authentication credentials."),type:"info"},null,8,["text"]),s(e(c),{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),autofocus:"",class:"external-storage-auth__login","data-cy-external-storage-auth-dialog-login":"",label:e(t)("files_external","Login"),placeholder:e(t)("files_external","Enter the storage login"),minlength:"2",name:"login",required:""},null,8,["modelValue","label","placeholder"]),s(e(p),{modelValue:r.value,"onUpdate:modelValue":a[1]||(a[1]=l=>r.value=l),class:"external-storage-auth__password","data-cy-external-storage-auth-dialog-password":"",label:e(t)("files_external","Password"),placeholder:e(t)("files_external","Enter the storage password"),name:"password",required:""},null,8,["modelValue","label","placeholder"])]),_:1},8,["name"]))}});export{D as default}; -//# sourceMappingURL=CredentialsDialog-CkguwCxy.chunk.mjs.map diff --git a/dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs b/dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs similarity index 52% rename from dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs rename to dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs index 804f2df7c6e05..e52ad5c0ed2bc 100644 --- a/dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs +++ b/dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs @@ -1,9 +1,9 @@ -import{f as Xe,s as b,o as g,c as B,v as G,e as $,n as Yt,w as k,p as je,A as T,x as fe,g as be,t as x,q as ie,G as Re,F as oe,ag as It,a7 as pe,r as P,a5 as Ei,a1 as _e,b as me,l as O,a6 as st,j as Qt,V as Zt,y as Ie,u as w,k as bi,B as ke,m as _i,i as Nt,I as wi,z as yi,a4 as Ti,J as Ii}from"./preload-helper-BcKx2dRj.chunk.mjs";import{u as Ni,e as Ai,s as Ci,g as Li,f as $e,h as Di,o as Ri,z as Oi,B as Si,i as ki,C as Fi,D as $i,E as Pi,F as Bi,G as xi,H as Mi,I as At,w as Ui,c as zi}from"./mdi-D9N03AQK.chunk.mjs";import{j as lt,O as Gi,P as A,N as Vi,Q as ye,s as ct}from"./index-JpgrUA2Z-C-bEcc7c.chunk.mjs";import{N as Ct}from"./index-DHIaL2KO.chunk.mjs";import{r as Xi,B as He}from"./string_decoder-BO00msnV.chunk.mjs";import{i as Ne,g as ji,e as Hi,f as Wi,h as Kt,d as Ce,j as Te,a as qi,b as Jt}from"./index-DxX3M173.chunk.mjs";import{_ as Pe,d as Yi,a as Qi,c as ut}from"./createElementId-DhjFt1I9-sbdxHOjK.chunk.mjs";import{a as Zi,u as Ki,_ as Ji}from"./index-C5s_osov.chunk.mjs";import{c as we,g as er,a as ei}from"./NcNoteCard-CVhtNL04-Bouqxu_R.chunk.mjs";import{N as ti}from"./NcCheckboxRadioSwitch-BCSKF7Tk-CW55vp24.chunk.mjs";import{S as Lt}from"./ShareType-suoNfd7y.chunk.mjs";import{P as tr,a as ir}from"./NcBreadcrumbs-DYfGaSjT-DJBt8Xp4.chunk.mjs";import{c as ii}from"./index-SiCbjwnT.chunk.mjs";import{l as ri}from"./_plugin-vue_export-helper-CqVUm19z.chunk.mjs";import{N as Dt,c as Rt,a as Ot}from"./NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs";import{N as rr}from"./NcSelect-Czzsi3P_-j1mYabKj.chunk.mjs";import{_ as ar}from"./TrashCanOutline-ChT1dy1U.chunk.mjs";import"./PencilOutline-CKHP5rG_.chunk.mjs";import"./NcPasswordField-djttkA5Q-CzbXWkK5.chunk.mjs";import"./NcInputField-Bwsh2aHY-B1JPZ-0t.chunk.mjs";const nr={name:"ChevronRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},sr=["aria-hidden","aria-label"],or=["fill","width","height"],lr={d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},cr={key:0};function ur(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon chevron-right-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",lr,[i.title?(g(),b("title",cr,x(i.title),1)):G("",!0)])],8,or))],16,sr)}const dr=Pe(nr,[["render",ur]]),pr={name:"NcBreadcrumb",components:{NcActions:lt,ChevronRight:dr,NcButton:we},inheritAttrs:!1,props:{name:{type:String,required:!0},title:{type:String,default:null},to:{type:[String,Object],default:void 0},href:{type:String,default:void 0},icon:{type:String,default:""},forceIconText:{type:Boolean,default:!1},disableDrop:{type:Boolean,default:!1},forceMenu:{type:Boolean,default:!1},open:{type:Boolean,default:!1},class:{type:[String,Array,Object],default:""}},emits:["dragenter","dragleave","dropped","update:open"],setup(){const e=Yi();return{actionsContainer:`.vue-crumb[data-crumb-id="${e}"]`,crumbId:e}},data(){return{hovering:!1}},computed:{linkAttributes(){return this.to?{to:this.to,...this.$attrs}:this.href?{href:this.href,...this.$attrs}:this.$attrs}},methods:{onOpenChange(e){this.$emit("update:open",e)},dropped(e){return this.disableDrop||(this.$emit("dropped",e,this.to||this.href),this.$parent.$emit("dropped",e,this.to||this.href),this.hovering=!1),!1},dragEnter(e){this.$emit("dragenter",e),!this.disableDrop&&(this.hovering=!0)},dragLeave(e){this.$emit("dragleave",e),!this.disableDrop&&(e.target.contains(e.relatedTarget)||this.$refs.crumb.contains(e.relatedTarget)||(this.hovering=!1))}}},mr=["data-crumb-id"];function hr(e,r,i,n,c,m){const u=Xe("NcButton"),f=Xe("NcActions"),d=Xe("ChevronRight");return g(),b("li",{ref:"crumb",class:fe(["vue-crumb",[{"vue-crumb--hovered":c.hovering},e.$props.class]]),"data-crumb-id":n.crumbId,draggable:"false",onDragstart:Re(()=>{},["prevent"]),onDrop:r[0]||(r[0]=Re((...p)=>m.dropped&&m.dropped(...p),["prevent"])),onDragover:Re(()=>{},["prevent"]),onDragenter:r[1]||(r[1]=(...p)=>m.dragEnter&&m.dragEnter(...p)),onDragleave:r[2]||(r[2]=(...p)=>m.dragLeave&&m.dragLeave(...p))},[(i.name||i.icon||e.$slots.icon)&&!e.$slots.default?(g(),B(u,ie({key:0,"aria-label":i.icon?i.name:void 0,variant:"tertiary"},m.linkAttributes),Yt({_:2},[e.$slots.icon||i.icon?{name:"icon",fn:k(()=>[je(e.$slots,"icon",{},()=>[T("span",{class:fe([i.icon,"icon"])},null,2)],!0)]),key:"0"}:void 0,!(e.$slots.icon||i.icon)||i.forceIconText?{name:"default",fn:k(()=>[be(x(i.name),1)]),key:"1"}:void 0]),1040,["aria-label"])):G("",!0),e.$slots.default?(g(),B(f,{key:1,ref:"actions",container:n.actionsContainer,"force-menu":i.forceMenu,"force-name":"","menu-name":i.name,open:i.open,title:i.title,variant:"tertiary","onUpdate:open":m.onOpenChange},{icon:k(()=>[je(e.$slots,"menu-icon",{},void 0,!0)]),default:k(()=>[je(e.$slots,"default",{},void 0,!0)]),_:3},8,["container","force-menu","menu-name","open","title","onUpdate:open"])):G("",!0),$(d,{class:"vue-crumb__separator",size:20})],42,mr)}const Fe=Pe(pr,[["render",hr],["__scopeId","data-v-28ef52a4"]]),fr={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gr=["aria-hidden","aria-label"],vr=["fill","width","height"],Er={d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"},br={key:0};function _r(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon folder-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",Er,[i.title?(g(),b("title",br,x(i.title),1)):G("",!0)])],8,vr))],16,gr)}const St=Pe(fr,[["render",_r]]),q="vue-crumb",wr={name:"NcBreadcrumbs",components:{NcActions:lt,NcActionButton:Ot,NcActionRouter:Rt,NcActionLink:Dt,NcBreadcrumb:Fe,IconFolder:St},props:{rootIcon:{type:String,default:"icon-home"},ariaLabel:{type:String,default:null}},emits:["dropped"],data(){return{hiddenIndices:[],menuBreadcrumbProps:{name:"",forceMenu:!0,disableDrop:!0,open:!1},breadcrumbsRefs:[]}},created(){window.addEventListener("resize",Ai(()=>{this.handleWindowResize()},100)),Ci("navigation-toggled",this.delayedResize)},mounted(){this.handleWindowResize()},updated(){this.delayedResize(),this.$nextTick(()=>{this.hideCrumbs()})},beforeUnmount(){window.removeEventListener("resize",this.handleWindowResize),Ni("navigation-toggled",this.delayedResize)},methods:{closeActions(e){this.$refs.actionsBreadcrumb.$el.contains(e.relatedTarget)||(this.menuBreadcrumbProps.open=!1)},async delayedResize(){await this.$nextTick(),this.handleWindowResize()},handleWindowResize(){if(!this.$refs.container)return;const e=this.breadcrumbsRefs.length,r=[],i=this.$refs.container.offsetWidth;let n=this.getTotalWidth();this.$refs.breadcrumb__actions&&(n+=this.$refs.breadcrumb__actions.offsetWidth);let c=n-i;c+=c>0?64:0;let m=0;const u=Math.floor(e/2);for(;c>0&&mf-d))||(this.hiddenIndices=r)},arraysEqual(e,r){if(e.length!==r.length)return!1;if(e===r)return!0;if(e===null||r===null)return!1;for(let i=0;ie+this.getWidth(r.$el,i===this.breadcrumbsRefs.length-1),0)},getWidth(e,r){if(!e?.classList)return 0;const i=e.classList.contains(`${q}--hidden`);e.style.minWidth="auto",r&&(e.style.maxWidth="210px"),e.classList.remove(`${q}--hidden`);const n=e.offsetWidth;return i&&e.classList.add(`${q}--hidden`),e.style.minWidth="",e.style.maxWidth="",n},preventDefault(e){return e.preventDefault&&e.preventDefault(),!1},dragStart(e){return this.preventDefault(e)},dropped(e,r,i){i||this.$emit("dropped",e,r),this.menuBreadcrumbProps.open=!1;const n=document.querySelectorAll(`.${q}`);for(const c of n)c.classList.remove(`${q}--hovered`);return this.preventDefault(e)},dragOver(e){return this.preventDefault(e)},dragEnter(e,r){if(!r&&e.target.closest){const i=e.target.closest(`.${q}`);if(i.classList&&i.classList.contains(q)){const n=document.querySelectorAll(`.${q}`);for(const c of n)c.classList.remove(`${q}--hovered`);i.classList.add(`${q}--hovered`)}}},dragLeave(e,r){if(!r&&!e.target.contains(e.relatedTarget)&&e.target.closest){const i=e.target.closest(`.${q}`);if(i.contains(e.relatedTarget))return;i.classList&&i.classList.contains(q)&&i.classList.remove(`${q}--hovered`)}},hideCrumbs(){this.breadcrumbsRefs.forEach((e,r)=>{e?.$el?.classList&&(this.hiddenIndices.includes(r)?e.$el.classList.add(`${q}--hidden`):e.$el.classList.remove(`${q}--hidden`))})},isBreadcrumb(e){return e?.type?.name==="NcBreadcrumb"}},render(){let e=[];if(this.$slots.default?.().forEach(c=>{if(this.isBreadcrumb(c)){e.push(c);return}c?.type===oe&&c?.children?.forEach?.(m=>{this.isBreadcrumb(m)&&e.push(m)})}),e.length===0)return;e[0]=It(e[0],{icon:this.rootIcon,ref:"breadcrumbs"});const r=[];e=e.map((c,m)=>It(c,{ref:u=>{r[m]=u}}));const i=[...e];this.hiddenIndices.length&&i.splice(Math.round(e.length/2),0,pe(Fe,{class:"dropdown",...this.menuBreadcrumbProps,"aria-hidden":!0,ref:"actionsBreadcrumb",key:"actions-breadcrumb-1",onDragenter:()=>{this.menuBreadcrumbProps.open=!0},onDragleave:this.closeActions,"onUpdate:open":c=>{this.menuBreadcrumbProps.open=c}},{default:()=>this.hiddenIndices.filter(c=>c<=e.length-1).map(c=>{const m=e[c],{to:u,href:f,disableDrop:d,name:p,...l}=m.props;delete l.ref;let v=Ot,E="";f&&(v=Dt,E=f),u&&(v=Rt,E=u);const I=pe(St,{size:20});return pe(v,{...l,class:q,href:f||null,to:u||null,draggable:!1,onDragstart:this.dragStart,onDrop:V=>this.dropped(V,E,d),onDragover:this.dragOver,onDragenter:V=>this.dragEnter(V,d),onDragleave:V=>this.dragLeave(V,d)},{default:()=>p,icon:()=>I})})}));const n=[pe("nav",{"aria-label":this.ariaLabel},[pe("ul",{class:"breadcrumb__crumbs"},[i])])];return Gi(this.$slots.actions?.())&&n.push(pe("div",{class:"breadcrumb__actions",ref:"breadcrumb__actions"},this.$slots.actions?.())),this.breadcrumbsRefs=r,pe("div",{class:["breadcrumb",{"breadcrumb--collapsed":this.hiddenIndices.length===e.length-2}],ref:"container"},n)}},yr=Pe(wr,[["__scopeId","data-v-af2b1226"]]);function ue(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function kt(e,r,i){Tr(e,r),r.set(e,i)}function Tr(e,r){if(r.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H(e,r){var i=ai(e,r,"get");return Ir(e,i)}function Ir(e,r){return r.get?r.get.call(e):r.value}function Ft(e,r,i){var n=ai(e,r,"set");return Nr(e,n,i),i}function ai(e,r,i){if(!r.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return r.get(e)}function Nr(e,r,i){if(r.set)r.set.call(e,i);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=i}}var Ar=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",Y=new WeakMap,ve=new WeakMap;class Be{constructor(r){var{executor:i=()=>{},internals:n=pt(),promise:c=new Promise((m,u)=>i(m,u,f=>{n.onCancelList.push(f)}))}=r;kt(this,Y,{writable:!0,value:void 0}),kt(this,ve,{writable:!0,value:void 0}),ue(this,Ar,"CancelablePromise"),this.cancel=this.cancel.bind(this),Ft(this,Y,n),Ft(this,ve,c||new Promise((m,u)=>i(m,u,f=>{n.onCancelList.push(f)})))}then(r,i){return Oe(H(this,ve).then(Le(r,H(this,Y)),Le(i,H(this,Y))),H(this,Y))}catch(r){return Oe(H(this,ve).catch(Le(r,H(this,Y))),H(this,Y))}finally(r,i){return i&&H(this,Y).onCancelList.push(r),Oe(H(this,ve).finally(Le(()=>{if(r)return i&&(H(this,Y).onCancelList=H(this,Y).onCancelList.filter(n=>n!==r)),r()},H(this,Y))),H(this,Y))}cancel(){H(this,Y).isCanceled=!0;var r=H(this,Y).onCancelList;H(this,Y).onCancelList=[];for(var i of r)if(typeof i=="function")try{i()}catch(n){console.error(n)}}isCanceled(){return H(this,Y).isCanceled===!0}}class re extends Be{constructor(r){super({executor:r})}}ue(re,"all",function(e){return De(e,Promise.all(e))}),ue(re,"allSettled",function(e){return De(e,Promise.allSettled(e))}),ue(re,"any",function(e){return De(e,Promise.any(e))}),ue(re,"race",function(e){return De(e,Promise.race(e))}),ue(re,"resolve",function(e){return $t(Promise.resolve(e))}),ue(re,"reject",function(e){return $t(Promise.reject(e))}),ue(re,"isCancelable",dt);function $t(e){return Oe(e,pt())}function dt(e){return e instanceof re||e instanceof Be}function Le(e,r){if(e)return i=>{if(!r.isCanceled){var n=e(i);return dt(n)&&r.onCancelList.push(n.cancel),n}return i}}function Oe(e,r){return new Be({internals:r,promise:e})}function De(e,r){var i=pt();return i.onCancelList.push(()=>{for(var n of e)dt(n)&&n.cancel()}),new Be({internals:i,promise:r})}function pt(){return{isCanceled:!1,onCancelList:[]}}const Cr=Li().setApp("@nextcloud/files").detectUser().build();var le=(e=>(e.Folder="folder",e.File="file",e))(le||{}),ee=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(ee||{});const ni=function(e,r){return e.match(r)!==null},ce=(e,r)=>{if(e.id&&typeof e.id!="number")throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&typeof e.displayname!="string")throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||typeof e.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&typeof e.size!="number"&&e.size!==void 0)throw new Error("Invalid size type");if("permissions"in e&&e.permissions!==void 0&&!(typeof e.permissions=="number"&&e.permissions>=ee.NONE&&e.permissions<=ee.ALL))throw new Error("Invalid permissions");if(e.owner&&e.owner!==null&&typeof e.owner!="string")throw new Error("Invalid owner type");if(e.attributes&&typeof e.attributes!="object")throw new Error("Invalid attributes type");if(e.root&&typeof e.root!="string")throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&ni(e.source,r)){const i=e.source.match(r)[0];if(!e.source.includes(Te(i,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(mt).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var mt=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(mt||{});class xe{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(xe.prototype)).filter(r=>typeof r[1].get=="function"&&r[0]!=="__proto__").map(r=>r[0]);handler={set:(r,i,n)=>this.readonlyAttributes.includes(i)?!1:Reflect.set(r,i,n),deleteProperty:(r,i)=>this.readonlyAttributes.includes(i)?!1:Reflect.deleteProperty(r,i),get:(r,i,n)=>this.readonlyAttributes.includes(i)?(Cr.warn(`Accessing "Node.attributes.${i}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,i)):Reflect.get(r,i,n)};constructor(r,i){r.mime||(r.mime="application/octet-stream"),ce(r,i||this._knownDavService),this._data={displayname:r.attributes?.displayname,...r,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(r.attributes??{}),i&&(this._knownDavService=i)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:r}=new URL(this.source);return r+Hi(this.source.slice(r.length))}get basename(){return Wi(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(r){ce({...this._data,displayname:r},this._knownDavService),this._data.displayname=r}get extension(){return Kt(this.source)}get dirname(){if(this.root){let i=this.source;this.isDavResource&&(i=i.split(this._knownDavService).pop());const n=i.indexOf(this.root),c=this.root.replace(/\/$/,"");return Ce(i.slice(n+c.length)||"/")}const r=new URL(this.source);return Ce(r.pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(r){r??="application/octet-stream",ce({...this._data,mime:r},this._knownDavService),this._data.mime=r}get mtime(){return this._data.mtime}set mtime(r){ce({...this._data,mtime:r},this._knownDavService),this._data.mtime=r}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(r){ce({...this._data,size:r},this._knownDavService),this.updateMtime(),this._data.size=r}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?ee.READ:this._data.permissions!==void 0?this._data.permissions:ee.NONE}set permissions(r){ce({...this._data,permissions:r},this._knownDavService),this.updateMtime(),this._data.permissions=r}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return ni(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&Ce(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let r=this.source;this.isDavResource&&(r=r.split(this._knownDavService).pop());const i=r.indexOf(this.root),n=this.root.replace(/\/$/,"");return r.slice(i+n.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(r){ce({...this._data,status:r},this._knownDavService),this._data.status=r}get data(){return structuredClone(this._data)}move(r){ce({...this._data,source:r},this._knownDavService);const i=this.basename;this._data.source=r,this.displayname===i&&this.basename!==i&&(this.displayname=this.basename)}rename(r){if(r.includes("/"))throw new Error("Invalid basename");this.move(Ce(this.source)+"/"+r)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(r){for(const[i,n]of Object.entries(r))try{n===void 0?delete this.attributes[i]:this.attributes[i]=n}catch(c){if(c instanceof TypeError)continue;throw c}}}class ht extends xe{get type(){return le.File}clone(){return new ht(this.data)}}class ft extends xe{constructor(r){super({...r,mime:"httpd/unix-directory"})}get type(){return le.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new ft(this.data)}}const Lr=function(e=""){let r=ee.NONE;return e&&((e.includes("C")||e.includes("K"))&&(r|=ee.CREATE),e.includes("G")&&(r|=ee.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(r|=ee.UPDATE),e.includes("D")&&(r|=ee.DELETE),e.includes("R")&&(r|=ee.SHARE)),r},Dr=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],Rr={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},gt=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...Dr]),window._nc_dav_properties.map(e=>`<${e} />`).join(" ")},vt=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...Rr}),Object.keys(window._nc_dav_namespaces).map(e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ")},si=function(){return` +import{f as Xe,j as b,o as g,c as B,l as G,e as $,y as Yt,w as k,m as je,k as T,n as fe,g as be,t as x,z as re,H as Re,F as oe,ag as It,a7 as pe,r as P,a5 as Er,a1 as _e,b as me,x as O,a6 as st,s as Qt,Y as Zt,A as Ie,u as w,v as br,C as ke,p as _r,q as Nt,J as wr,B as yr,a4 as Tr,K as Ir}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import{u as Nr,d as Ar,s as Cr,g as Lr,a as $e,b as Dr,o as Rr,c as Or,p as Sr,e as kr}from"./index-6_gsQFyp.chunk.mjs";import{i as lt,R as Fr,S as A,N as $r,T as ye,a as ct}from"./index-JpgrUA2Z-BU0x-nEh.chunk.mjs";import{N as At}from"./index-Dw2b3ZVY.chunk.mjs";import{r as Pr,B as He}from"./string_decoder-BO00msnV.chunk.mjs";import{i as Ne,b as Br,e as xr,c as Mr,f as Kt,d as Ce,j as Te,g as Ur,l as Jt}from"./index-xFugdZPW.chunk.mjs";import{_ as Pe,c as zr,b as Gr,g as ut}from"./createElementId-DhjFt1I9-CmaX6aVQ.chunk.mjs";import{a as Vr,u as Xr}from"./index-DY1sONrk.chunk.mjs";import{g as jr,a as er}from"./translation-DoG5ZELJ-Cr5LJw9O.chunk.mjs";import{c as we,a as tr}from"./NcNoteCard-CVhtNL04-DvQ-q8jC.chunk.mjs";import{N as rr}from"./NcCheckboxRadioSwitch-BCSKF7Tk-BfYgMYeK.chunk.mjs";import{N as Ct,c as Lt,a as Dt,_ as Hr}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-BCDyH1PU.chunk.mjs";import{r as Wr,s as qr,t as Yr,u as Qr,v as Zr,w as Kr,x as Rt,o as Jr,c as ei}from"./mdi-Ds-fACAT.chunk.mjs";import{S as Ot}from"./ShareType-suoNfd7y.chunk.mjs";import{P as ti,a as ri}from"./NcBreadcrumbs-DYfGaSjT-C9-fXuZb.chunk.mjs";import{c as ir}from"./index-FffHbzvj.chunk.mjs";import{N as ii}from"./NcSelect-Czzsi3P_-DYeov0Mn.chunk.mjs";import{_ as ai}from"./TrashCanOutline-Dy-u-_ok.chunk.mjs";import"./NcPasswordField-djttkA5Q-PPKLVftl.chunk.mjs";import"./NcInputField-Bwsh2aHY-CDnfv5zO.chunk.mjs";const ni={name:"ChevronRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},si=["aria-hidden","aria-label"],oi=["fill","width","height"],li={d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},ci={key:0};function ui(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon chevron-right-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",li,[r.title?(g(),b("title",ci,x(r.title),1)):G("",!0)])],8,oi))],16,si)}const di=Pe(ni,[["render",ui]]),pi={name:"NcBreadcrumb",components:{NcActions:lt,ChevronRight:di,NcButton:we},inheritAttrs:!1,props:{name:{type:String,required:!0},title:{type:String,default:null},to:{type:[String,Object],default:void 0},href:{type:String,default:void 0},icon:{type:String,default:""},forceIconText:{type:Boolean,default:!1},disableDrop:{type:Boolean,default:!1},forceMenu:{type:Boolean,default:!1},open:{type:Boolean,default:!1},class:{type:[String,Array,Object],default:""}},emits:["dragenter","dragleave","dropped","update:open"],setup(){const e=zr();return{actionsContainer:`.vue-crumb[data-crumb-id="${e}"]`,crumbId:e}},data(){return{hovering:!1}},computed:{linkAttributes(){return this.to?{to:this.to,...this.$attrs}:this.href?{href:this.href,...this.$attrs}:this.$attrs}},methods:{onOpenChange(e){this.$emit("update:open",e)},dropped(e){return this.disableDrop||(this.$emit("dropped",e,this.to||this.href),this.$parent.$emit("dropped",e,this.to||this.href),this.hovering=!1),!1},dragEnter(e){this.$emit("dragenter",e),!this.disableDrop&&(this.hovering=!0)},dragLeave(e){this.$emit("dragleave",e),!this.disableDrop&&(e.target.contains(e.relatedTarget)||this.$refs.crumb.contains(e.relatedTarget)||(this.hovering=!1))}}},mi=["data-crumb-id"];function hi(e,i,r,n,c,m){const u=Xe("NcButton"),f=Xe("NcActions"),d=Xe("ChevronRight");return g(),b("li",{ref:"crumb",class:fe(["vue-crumb",[{"vue-crumb--hovered":c.hovering},e.$props.class]]),"data-crumb-id":n.crumbId,draggable:"false",onDragstart:Re(()=>{},["prevent"]),onDrop:i[0]||(i[0]=Re((...p)=>m.dropped&&m.dropped(...p),["prevent"])),onDragover:Re(()=>{},["prevent"]),onDragenter:i[1]||(i[1]=(...p)=>m.dragEnter&&m.dragEnter(...p)),onDragleave:i[2]||(i[2]=(...p)=>m.dragLeave&&m.dragLeave(...p))},[(r.name||r.icon||e.$slots.icon)&&!e.$slots.default?(g(),B(u,re({key:0,"aria-label":r.icon?r.name:void 0,variant:"tertiary"},m.linkAttributes),Yt({_:2},[e.$slots.icon||r.icon?{name:"icon",fn:k(()=>[je(e.$slots,"icon",{},()=>[T("span",{class:fe([r.icon,"icon"])},null,2)],!0)]),key:"0"}:void 0,!(e.$slots.icon||r.icon)||r.forceIconText?{name:"default",fn:k(()=>[be(x(r.name),1)]),key:"1"}:void 0]),1040,["aria-label"])):G("",!0),e.$slots.default?(g(),B(f,{key:1,ref:"actions",container:n.actionsContainer,"force-menu":r.forceMenu,"force-name":"","menu-name":r.name,open:r.open,title:r.title,variant:"tertiary","onUpdate:open":m.onOpenChange},{icon:k(()=>[je(e.$slots,"menu-icon",{},void 0,!0)]),default:k(()=>[je(e.$slots,"default",{},void 0,!0)]),_:3},8,["container","force-menu","menu-name","open","title","onUpdate:open"])):G("",!0),$(d,{class:"vue-crumb__separator",size:20})],42,mi)}const Fe=Pe(pi,[["render",hi],["__scopeId","data-v-28ef52a4"]]),fi={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gi=["aria-hidden","aria-label"],vi=["fill","width","height"],Ei={d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"},bi={key:0};function _i(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon folder-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",Ei,[r.title?(g(),b("title",bi,x(r.title),1)):G("",!0)])],8,vi))],16,gi)}const St=Pe(fi,[["render",_i]]),q="vue-crumb",wi={name:"NcBreadcrumbs",components:{NcActions:lt,NcActionButton:Dt,NcActionRouter:Lt,NcActionLink:Ct,NcBreadcrumb:Fe,IconFolder:St},props:{rootIcon:{type:String,default:"icon-home"},ariaLabel:{type:String,default:null}},emits:["dropped"],data(){return{hiddenIndices:[],menuBreadcrumbProps:{name:"",forceMenu:!0,disableDrop:!0,open:!1},breadcrumbsRefs:[]}},created(){window.addEventListener("resize",Ar(()=>{this.handleWindowResize()},100)),Cr("navigation-toggled",this.delayedResize)},mounted(){this.handleWindowResize()},updated(){this.delayedResize(),this.$nextTick(()=>{this.hideCrumbs()})},beforeUnmount(){window.removeEventListener("resize",this.handleWindowResize),Nr("navigation-toggled",this.delayedResize)},methods:{closeActions(e){this.$refs.actionsBreadcrumb.$el.contains(e.relatedTarget)||(this.menuBreadcrumbProps.open=!1)},async delayedResize(){await this.$nextTick(),this.handleWindowResize()},handleWindowResize(){if(!this.$refs.container)return;const e=this.breadcrumbsRefs.length,i=[],r=this.$refs.container.offsetWidth;let n=this.getTotalWidth();this.$refs.breadcrumb__actions&&(n+=this.$refs.breadcrumb__actions.offsetWidth);let c=n-r;c+=c>0?64:0;let m=0;const u=Math.floor(e/2);for(;c>0&&mf-d))||(this.hiddenIndices=i)},arraysEqual(e,i){if(e.length!==i.length)return!1;if(e===i)return!0;if(e===null||i===null)return!1;for(let r=0;re+this.getWidth(i.$el,r===this.breadcrumbsRefs.length-1),0)},getWidth(e,i){if(!e?.classList)return 0;const r=e.classList.contains(`${q}--hidden`);e.style.minWidth="auto",i&&(e.style.maxWidth="210px"),e.classList.remove(`${q}--hidden`);const n=e.offsetWidth;return r&&e.classList.add(`${q}--hidden`),e.style.minWidth="",e.style.maxWidth="",n},preventDefault(e){return e.preventDefault&&e.preventDefault(),!1},dragStart(e){return this.preventDefault(e)},dropped(e,i,r){r||this.$emit("dropped",e,i),this.menuBreadcrumbProps.open=!1;const n=document.querySelectorAll(`.${q}`);for(const c of n)c.classList.remove(`${q}--hovered`);return this.preventDefault(e)},dragOver(e){return this.preventDefault(e)},dragEnter(e,i){if(!i&&e.target.closest){const r=e.target.closest(`.${q}`);if(r.classList&&r.classList.contains(q)){const n=document.querySelectorAll(`.${q}`);for(const c of n)c.classList.remove(`${q}--hovered`);r.classList.add(`${q}--hovered`)}}},dragLeave(e,i){if(!i&&!e.target.contains(e.relatedTarget)&&e.target.closest){const r=e.target.closest(`.${q}`);if(r.contains(e.relatedTarget))return;r.classList&&r.classList.contains(q)&&r.classList.remove(`${q}--hovered`)}},hideCrumbs(){this.breadcrumbsRefs.forEach((e,i)=>{e?.$el?.classList&&(this.hiddenIndices.includes(i)?e.$el.classList.add(`${q}--hidden`):e.$el.classList.remove(`${q}--hidden`))})},isBreadcrumb(e){return e?.type?.name==="NcBreadcrumb"}},render(){let e=[];if(this.$slots.default?.().forEach(c=>{if(this.isBreadcrumb(c)){e.push(c);return}c?.type===oe&&c?.children?.forEach?.(m=>{this.isBreadcrumb(m)&&e.push(m)})}),e.length===0)return;e[0]=It(e[0],{icon:this.rootIcon,ref:"breadcrumbs"});const i=[];e=e.map((c,m)=>It(c,{ref:u=>{i[m]=u}}));const r=[...e];this.hiddenIndices.length&&r.splice(Math.round(e.length/2),0,pe(Fe,{class:"dropdown",...this.menuBreadcrumbProps,"aria-hidden":!0,ref:"actionsBreadcrumb",key:"actions-breadcrumb-1",onDragenter:()=>{this.menuBreadcrumbProps.open=!0},onDragleave:this.closeActions,"onUpdate:open":c=>{this.menuBreadcrumbProps.open=c}},{default:()=>this.hiddenIndices.filter(c=>c<=e.length-1).map(c=>{const m=e[c],{to:u,href:f,disableDrop:d,name:p,...l}=m.props;delete l.ref;let v=Dt,E="";f&&(v=Ct,E=f),u&&(v=Lt,E=u);const I=pe(St,{size:20});return pe(v,{...l,class:q,href:f||null,to:u||null,draggable:!1,onDragstart:this.dragStart,onDrop:V=>this.dropped(V,E,d),onDragover:this.dragOver,onDragenter:V=>this.dragEnter(V,d),onDragleave:V=>this.dragLeave(V,d)},{default:()=>p,icon:()=>I})})}));const n=[pe("nav",{"aria-label":this.ariaLabel},[pe("ul",{class:"breadcrumb__crumbs"},[r])])];return Fr(this.$slots.actions?.())&&n.push(pe("div",{class:"breadcrumb__actions",ref:"breadcrumb__actions"},this.$slots.actions?.())),this.breadcrumbsRefs=i,pe("div",{class:["breadcrumb",{"breadcrumb--collapsed":this.hiddenIndices.length===e.length-2}],ref:"container"},n)}},yi=Pe(wi,[["__scopeId","data-v-af2b1226"]]);function ue(e,i,r){return i in e?Object.defineProperty(e,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[i]=r,e}function kt(e,i,r){Ti(e,i),i.set(e,r)}function Ti(e,i){if(i.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H(e,i){var r=ar(e,i,"get");return Ii(e,r)}function Ii(e,i){return i.get?i.get.call(e):i.value}function Ft(e,i,r){var n=ar(e,i,"set");return Ni(e,n,r),r}function ar(e,i,r){if(!i.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return i.get(e)}function Ni(e,i,r){if(i.set)i.set.call(e,r);else{if(!i.writable)throw new TypeError("attempted to set read only private field");i.value=r}}var Ai=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",Y=new WeakMap,ve=new WeakMap;class Be{constructor(i){var{executor:r=()=>{},internals:n=pt(),promise:c=new Promise((m,u)=>r(m,u,f=>{n.onCancelList.push(f)}))}=i;kt(this,Y,{writable:!0,value:void 0}),kt(this,ve,{writable:!0,value:void 0}),ue(this,Ai,"CancelablePromise"),this.cancel=this.cancel.bind(this),Ft(this,Y,n),Ft(this,ve,c||new Promise((m,u)=>r(m,u,f=>{n.onCancelList.push(f)})))}then(i,r){return Oe(H(this,ve).then(Le(i,H(this,Y)),Le(r,H(this,Y))),H(this,Y))}catch(i){return Oe(H(this,ve).catch(Le(i,H(this,Y))),H(this,Y))}finally(i,r){return r&&H(this,Y).onCancelList.push(i),Oe(H(this,ve).finally(Le(()=>{if(i)return r&&(H(this,Y).onCancelList=H(this,Y).onCancelList.filter(n=>n!==i)),i()},H(this,Y))),H(this,Y))}cancel(){H(this,Y).isCanceled=!0;var i=H(this,Y).onCancelList;H(this,Y).onCancelList=[];for(var r of i)if(typeof r=="function")try{r()}catch(n){console.error(n)}}isCanceled(){return H(this,Y).isCanceled===!0}}class ie extends Be{constructor(i){super({executor:i})}}ue(ie,"all",function(e){return De(e,Promise.all(e))}),ue(ie,"allSettled",function(e){return De(e,Promise.allSettled(e))}),ue(ie,"any",function(e){return De(e,Promise.any(e))}),ue(ie,"race",function(e){return De(e,Promise.race(e))}),ue(ie,"resolve",function(e){return $t(Promise.resolve(e))}),ue(ie,"reject",function(e){return $t(Promise.reject(e))}),ue(ie,"isCancelable",dt);function $t(e){return Oe(e,pt())}function dt(e){return e instanceof ie||e instanceof Be}function Le(e,i){if(e)return r=>{if(!i.isCanceled){var n=e(r);return dt(n)&&i.onCancelList.push(n.cancel),n}return r}}function Oe(e,i){return new Be({internals:i,promise:e})}function De(e,i){var r=pt();return r.onCancelList.push(()=>{for(var n of e)dt(n)&&n.cancel()}),new Be({internals:r,promise:i})}function pt(){return{isCanceled:!1,onCancelList:[]}}const Ci=Lr().setApp("@nextcloud/files").detectUser().build();var le=(e=>(e.Folder="folder",e.File="file",e))(le||{}),ee=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(ee||{});const nr=function(e,i){return e.match(i)!==null},ce=(e,i)=>{if(e.id&&typeof e.id!="number")throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&typeof e.displayname!="string")throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||typeof e.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&typeof e.size!="number"&&e.size!==void 0)throw new Error("Invalid size type");if("permissions"in e&&e.permissions!==void 0&&!(typeof e.permissions=="number"&&e.permissions>=ee.NONE&&e.permissions<=ee.ALL))throw new Error("Invalid permissions");if(e.owner&&e.owner!==null&&typeof e.owner!="string")throw new Error("Invalid owner type");if(e.attributes&&typeof e.attributes!="object")throw new Error("Invalid attributes type");if(e.root&&typeof e.root!="string")throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&nr(e.source,i)){const r=e.source.match(i)[0];if(!e.source.includes(Te(r,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(mt).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var mt=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(mt||{});class xe{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(xe.prototype)).filter(i=>typeof i[1].get=="function"&&i[0]!=="__proto__").map(i=>i[0]);handler={set:(i,r,n)=>this.readonlyAttributes.includes(r)?!1:Reflect.set(i,r,n),deleteProperty:(i,r)=>this.readonlyAttributes.includes(r)?!1:Reflect.deleteProperty(i,r),get:(i,r,n)=>this.readonlyAttributes.includes(r)?(Ci.warn(`Accessing "Node.attributes.${r}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,r)):Reflect.get(i,r,n)};constructor(i,r){i.mime||(i.mime="application/octet-stream"),ce(i,r||this._knownDavService),this._data={displayname:i.attributes?.displayname,...i,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(i.attributes??{}),r&&(this._knownDavService=r)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:i}=new URL(this.source);return i+xr(this.source.slice(i.length))}get basename(){return Mr(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(i){ce({...this._data,displayname:i},this._knownDavService),this._data.displayname=i}get extension(){return Kt(this.source)}get dirname(){if(this.root){let r=this.source;this.isDavResource&&(r=r.split(this._knownDavService).pop());const n=r.indexOf(this.root),c=this.root.replace(/\/$/,"");return Ce(r.slice(n+c.length)||"/")}const i=new URL(this.source);return Ce(i.pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(i){i??="application/octet-stream",ce({...this._data,mime:i},this._knownDavService),this._data.mime=i}get mtime(){return this._data.mtime}set mtime(i){ce({...this._data,mtime:i},this._knownDavService),this._data.mtime=i}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(i){ce({...this._data,size:i},this._knownDavService),this.updateMtime(),this._data.size=i}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?ee.READ:this._data.permissions!==void 0?this._data.permissions:ee.NONE}set permissions(i){ce({...this._data,permissions:i},this._knownDavService),this.updateMtime(),this._data.permissions=i}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return nr(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&Ce(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let i=this.source;this.isDavResource&&(i=i.split(this._knownDavService).pop());const r=i.indexOf(this.root),n=this.root.replace(/\/$/,"");return i.slice(r+n.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(i){ce({...this._data,status:i},this._knownDavService),this._data.status=i}get data(){return structuredClone(this._data)}move(i){ce({...this._data,source:i},this._knownDavService);const r=this.basename;this._data.source=i,this.displayname===r&&this.basename!==r&&(this.displayname=this.basename)}rename(i){if(i.includes("/"))throw new Error("Invalid basename");this.move(Ce(this.source)+"/"+i)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(i){for(const[r,n]of Object.entries(i))try{n===void 0?delete this.attributes[r]:this.attributes[r]=n}catch(c){if(c instanceof TypeError)continue;throw c}}}class ht extends xe{get type(){return le.File}clone(){return new ht(this.data)}}class ft extends xe{constructor(i){super({...i,mime:"httpd/unix-directory"})}get type(){return le.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new ft(this.data)}}const Li=function(e=""){let i=ee.NONE;return e&&((e.includes("C")||e.includes("K"))&&(i|=ee.CREATE),e.includes("G")&&(i|=ee.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(i|=ee.UPDATE),e.includes("D")&&(i|=ee.DELETE),e.includes("R")&&(i|=ee.SHARE)),i},Di=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],Ri={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},gt=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...Di]),window._nc_dav_properties.map(e=>`<${e} />`).join(" ")},vt=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...Ri}),Object.keys(window._nc_dav_namespaces).map(e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ")},sr=function(){return` ${gt()} - `},Or=function(){return` + `},Oi=function(){return` ${gt()} @@ -11,7 +11,7 @@ import{f as Xe,s as b,o as g,c as B,v as G,e as $,n as Yt,w as k,p as je,A as T, 1 - `},Sr=function(e){return` + `},Si=function(e){return` @@ -65,13 +65,13 @@ import{f as Xe,s as b,o as g,c as B,v as G,e as $,n as Yt,w as k,p as je,A as T, 0 -`};function kr(){return Ne()?`/files/${ji()}`:`/files/${$e()?.uid}`}const Ae=kr();function Fr(){const e=Qi("dav");return Ne()?e.replace("remote.php","public.php"):e}const oi=Fr(),$r=function(e=oi,r={}){const i=Zi(e,{headers:r});function n(c){i.setHeaders({...r,"X-Requested-With":"XMLHttpRequest",requesttoken:c??""})}return Ri(n),n(Di()),Ki().patch("fetch",(c,m)=>{const u=m.headers;return u?.method&&(m.method=u.method,delete u.method),fetch(c,m)}),i},Pr=(e,r="/",i=Ae)=>{const n=new AbortController;return new re(async(c,m,u)=>{u(()=>n.abort());try{const f=(await e.getDirectoryContents(`${i}${r}`,{signal:n.signal,details:!0,data:Or(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(d=>d.filename!==r).map(d=>Me(d,i));c(f)}catch(f){m(f)}})},Me=function(e,r=Ae,i=oi){let n=$e()?.uid;if(Ne())n=n??"anonymous";else if(!n)throw new Error("No user id found");const c=e.props,m=Lr(c?.permissions),u=String(c?.["owner-id"]||n),f=c.fileid||0,d=new Date(Date.parse(e.lastmod)),p=new Date(Date.parse(c.creationdate)),l={id:f,source:`${i}${e.filename}`,mtime:!isNaN(d.getTime())&&d.getTime()!==0?d:void 0,crtime:!isNaN(p.getTime())&&p.getTime()!==0?p:void 0,mime:e.mime||"application/octet-stream",displayname:c.displayname!==void 0?String(c.displayname):void 0,size:c?.size||Number.parseInt(c.getcontentlength||"0"),status:f<0?mt.FAILED:void 0,permissions:m,owner:u,root:r,attributes:{...e,...c,hasPreview:c?.["has-preview"]}};return delete l.attributes?.props,e.type==="file"?new ht(l):new ft(l)};var Br=Xi();const xr=Oi(Br);var We={},Pt,Bt;function li(){return Bt||(Bt=1,Pt=typeof Si=="object"&&We&&We.NODE_DEBUG&&/\bsemver\b/i.test(We.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Pt}var qe,xt;function ci(){if(xt)return qe;xt=1;const e="2.0.0",r=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,c=r-6;return qe={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:i,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},qe}var Ye={exports:{}},Mt;function Mr(){return Mt||(Mt=1,(function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:c}=ci(),m=li();r=e.exports={};const u=r.re=[],f=r.safeRe=[],d=r.src=[],p=r.safeSrc=[],l=r.t={};let v=0;const E="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",c],[E,n]],V=W=>{for(const[X,te]of I)W=W.split(`${X}*`).join(`${X}{0,${te}}`).split(`${X}+`).join(`${X}{1,${te}}`);return W},_=(W,X,te)=>{const J=V(X),C=v++;m(W,C,X),l[W]=C,d[C]=X,p[C]=J,u[C]=new RegExp(X,te?"g":void 0),f[C]=new RegExp(J,te?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E}*`),_("MAINVERSION",`(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${d[l.NONNUMERICIDENTIFIER]}|${d[l.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${d[l.NONNUMERICIDENTIFIER]}|${d[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${d[l.PRERELEASEIDENTIFIER]}(?:\\.${d[l.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${d[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[l.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${E}+`),_("BUILD",`(?:\\+(${d[l.BUILDIDENTIFIER]}(?:\\.${d[l.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${d[l.MAINVERSION]}${d[l.PRERELEASE]}?${d[l.BUILD]}?`),_("FULL",`^${d[l.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${d[l.MAINVERSIONLOOSE]}${d[l.PRERELEASELOOSE]}?${d[l.BUILD]}?`),_("LOOSE",`^${d[l.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${d[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${d[l.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:${d[l.PRERELEASE]})?${d[l.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:${d[l.PRERELEASELOOSE]})?${d[l.BUILD]}?)?)?`),_("XRANGE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),_("COERCE",`${d[l.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",d[l.COERCEPLAIN]+`(?:${d[l.PRERELEASE]})?(?:${d[l.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",d[l.COERCE],!0),_("COERCERTLFULL",d[l.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${d[l.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",_("TILDE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${d[l.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",_("CARET",`^${d[l.LONECARET]}${d[l.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${d[l.LONECARET]}${d[l.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${d[l.GTLT]}\\s*(${d[l.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]}|${d[l.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${d[l.XRANGEPLAIN]})\\s+-\\s+(${d[l.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${d[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[l.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ye,Ye.exports)),Ye.exports}var Qe,Ut;function Ur(){if(Ut)return Qe;Ut=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return Qe=i=>i?typeof i!="object"?e:i:r,Qe}var Ze,zt;function zr(){if(zt)return Ze;zt=1;const e=/^[0-9]+$/,r=(i,n)=>{if(typeof i=="number"&&typeof n=="number")return i===n?0:ir(n,i)},Ze}var Ke,Gt;function ui(){if(Gt)return Ke;Gt=1;const e=li(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ci(),{safeRe:n,t:c}=Mr(),m=Ur(),{compareIdentifiers:u}=zr();class f{constructor(p,l){if(l=m(l),p instanceof f){if(p.loose===!!l.loose&&p.includePrerelease===!!l.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",p,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const v=p.trim().match(l.loose?n[c.LOOSE]:n[c.FULL]);if(!v)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+v[1],this.minor=+v[2],this.patch=+v[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");v[4]?this.prerelease=v[4].split(".").map(E=>{if(/^[0-9]+$/.test(E)){const I=+E;if(I>=0&&Ip.major?1:this.minorp.minor?1:this.patchp.patch?1:0}comparePre(p){if(p instanceof f||(p=new f(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let l=0;do{const v=this.prerelease[l],E=p.prerelease[l];if(e("prerelease compare",l,v,E),v===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(v===void 0)return-1;if(v!==E)return u(v,E)}while(++l)}compareBuild(p){p instanceof f||(p=new f(p,this.options));let l=0;do{const v=this.build[l],E=p.build[l];if(e("build compare",l,v,E),v===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(v===void 0)return-1;if(v!==E)return u(v,E)}while(++l)}inc(p,l,v){if(p.startsWith("pre")){if(!l&&v===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const E=`-${l}`.match(this.options.loose?n[c.PRERELEASELOOSE]:n[c.PRERELEASE]);if(!E||E[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,v);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,v);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,v),this.inc("pre",l,v);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,v),this.inc("pre",l,v);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const E=Number(v)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let I=this.prerelease.length;for(;--I>=0;)typeof this.prerelease[I]=="number"&&(this.prerelease[I]++,I=-2);if(I===-1){if(l===this.prerelease.join(".")&&v===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(E)}}if(l){let I=[l,E];v===!1&&(I=[l]),u(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=I):this.prerelease=I}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ke=f,Ke}var Je,Vt;function Gr(){if(Vt)return Je;Vt=1;const e=ui();return Je=(r,i)=>new e(r,i).major,Je}Gr();var et,Xt;function Vr(){if(Xt)return et;Xt=1;const e=ui();return et=(r,i,n=!1)=>{if(r instanceof e)return r;try{return new e(r,i)}catch(c){if(!n)return null;throw c}},et}var tt,jt;function Xr(){if(jt)return tt;jt=1;const e=Vr();return tt=(r,i)=>{const n=e(r,i);return n?n.version:null},tt}Xr();var Ht={},Wt;function jr(){return Wt||(Wt=1,(function(e){(function(r){r.parser=function(a,t){return new n(a,t)},r.SAXParser=n,r.SAXStream=l,r.createStream=p,r.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(a,t){if(!(this instanceof n))return new n(a,t);var h=this;m(h),h.q=h.c="",h.bufferCheckPosition=r.MAX_BUFFER_LENGTH,h.opt=t||{},h.opt.lowercase=h.opt.lowercase||h.opt.lowercasetags,h.looseCase=h.opt.lowercase?"toLowerCase":"toUpperCase",h.tags=[],h.closed=h.closedRoot=h.sawRoot=!1,h.tag=h.error=null,h.strict=!!a,h.noscript=!!(a||h.opt.noscript),h.state=o.BEGIN,h.strictEntities=h.opt.strictEntities,h.ENTITIES=h.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),h.attribList=[],h.opt.xmlns&&(h.ns=Object.create(_)),h.opt.unquotedAttributeValues===void 0&&(h.opt.unquotedAttributeValues=!a),h.trackPosition=h.opt.position!==!1,h.trackPosition&&(h.position=h.line=h.column=0),y(h,"onready")}Object.create||(Object.create=function(a){function t(){}t.prototype=a;var h=new t;return h}),Object.keys||(Object.keys=function(a){var t=[];for(var h in a)a.hasOwnProperty(h)&&t.push(h);return t});function c(a){for(var t=Math.max(r.MAX_BUFFER_LENGTH,10),h=0,s=0,L=i.length;st)switch(i[s]){case"textNode":ne(a);break;case"cdata":N(a,"oncdata",a.cdata),a.cdata="";break;case"script":N(a,"onscript",a.script),a.script="";break;default:ge(a,"Max buffer length exceeded: "+i[s])}h=Math.max(h,U)}var z=r.MAX_BUFFER_LENGTH-h;a.bufferCheckPosition=z+a.position}function m(a){for(var t=0,h=i.length;t"||C(a)}function D(a,t){return a.test(t)}function ae(a,t){return!D(a,t)}var o=0;r.STATE={BEGIN:o++,BEGIN_WHITESPACE:o++,TEXT:o++,TEXT_ENTITY:o++,OPEN_WAKA:o++,SGML_DECL:o++,SGML_DECL_QUOTED:o++,DOCTYPE:o++,DOCTYPE_QUOTED:o++,DOCTYPE_DTD:o++,DOCTYPE_DTD_QUOTED:o++,COMMENT_STARTING:o++,COMMENT:o++,COMMENT_ENDING:o++,COMMENT_ENDED:o++,CDATA:o++,CDATA_ENDING:o++,CDATA_ENDING_2:o++,PROC_INST:o++,PROC_INST_BODY:o++,PROC_INST_ENDING:o++,OPEN_TAG:o++,OPEN_TAG_SLASH:o++,ATTRIB:o++,ATTRIB_NAME:o++,ATTRIB_NAME_SAW_WHITE:o++,ATTRIB_VALUE:o++,ATTRIB_VALUE_QUOTED:o++,ATTRIB_VALUE_CLOSED:o++,ATTRIB_VALUE_UNQUOTED:o++,ATTRIB_VALUE_ENTITY_Q:o++,ATTRIB_VALUE_ENTITY_U:o++,CLOSE_TAG:o++,CLOSE_TAG_SAW_WHITE:o++,SCRIPT:o++,SCRIPT_ENDING:o++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(a){var t=r.ENTITIES[a],h=typeof t=="number"?String.fromCharCode(t):t;r.ENTITIES[a]=h});for(var S in r.STATE)r.STATE[r.STATE[S]]=S;o=r.STATE;function y(a,t,h){a[t]&&a[t](h)}function N(a,t,h){a.textNode&&ne(a),y(a,t,h)}function ne(a){a.textNode=Et(a.opt,a.textNode),a.textNode&&y(a,"ontext",a.textNode),a.textNode=""}function Et(a,t){return a.trim&&(t=t.trim()),a.normalize&&(t=t.replace(/\s+/g," ")),t}function ge(a,t){return ne(a),a.trackPosition&&(t+=` +`};function ki(){return Ne()?`/files/${Br()}`:`/files/${$e()?.uid}`}const Ae=ki();function Fi(){const e=Gr("dav");return Ne()?e.replace("remote.php","public.php"):e}const or=Fi(),$i=function(e=or,i={}){const r=Vr(e,{headers:i});function n(c){r.setHeaders({...i,"X-Requested-With":"XMLHttpRequest",requesttoken:c??""})}return Rr(n),n(Dr()),Xr().patch("fetch",(c,m)=>{const u=m.headers;return u?.method&&(m.method=u.method,delete u.method),fetch(c,m)}),r},Pi=(e,i="/",r=Ae)=>{const n=new AbortController;return new ie(async(c,m,u)=>{u(()=>n.abort());try{const f=(await e.getDirectoryContents(`${r}${i}`,{signal:n.signal,details:!0,data:Oi(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(d=>d.filename!==i).map(d=>Me(d,r));c(f)}catch(f){m(f)}})},Me=function(e,i=Ae,r=or){let n=$e()?.uid;if(Ne())n=n??"anonymous";else if(!n)throw new Error("No user id found");const c=e.props,m=Li(c?.permissions),u=String(c?.["owner-id"]||n),f=c.fileid||0,d=new Date(Date.parse(e.lastmod)),p=new Date(Date.parse(c.creationdate)),l={id:f,source:`${r}${e.filename}`,mtime:!isNaN(d.getTime())&&d.getTime()!==0?d:void 0,crtime:!isNaN(p.getTime())&&p.getTime()!==0?p:void 0,mime:e.mime||"application/octet-stream",displayname:c.displayname!==void 0?String(c.displayname):void 0,size:c?.size||Number.parseInt(c.getcontentlength||"0"),status:f<0?mt.FAILED:void 0,permissions:m,owner:u,root:i,attributes:{...e,...c,hasPreview:c?.["has-preview"]}};return delete l.attributes?.props,e.type==="file"?new ht(l):new ft(l)};var Bi=Pr();const xi=Or(Bi);var We={},Pt,Bt;function lr(){return Bt||(Bt=1,Pt=typeof Sr=="object"&&We&&We.NODE_DEBUG&&/\bsemver\b/i.test(We.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Pt}var qe,xt;function cr(){if(xt)return qe;xt=1;const e="2.0.0",i=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,c=i-6;return qe={MAX_LENGTH:i,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},qe}var Ye={exports:{}},Mt;function Mi(){return Mt||(Mt=1,(function(e,i){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:c}=cr(),m=lr();i=e.exports={};const u=i.re=[],f=i.safeRe=[],d=i.src=[],p=i.safeSrc=[],l=i.t={};let v=0;const E="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",c],[E,n]],V=W=>{for(const[X,te]of I)W=W.split(`${X}*`).join(`${X}{0,${te}}`).split(`${X}+`).join(`${X}{1,${te}}`);return W},_=(W,X,te)=>{const J=V(X),C=v++;m(W,C,X),l[W]=C,d[C]=X,p[C]=J,u[C]=new RegExp(X,te?"g":void 0),f[C]=new RegExp(J,te?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E}*`),_("MAINVERSION",`(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})\\.(${d[l.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})\\.(${d[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${d[l.NONNUMERICIDENTIFIER]}|${d[l.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${d[l.NONNUMERICIDENTIFIER]}|${d[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${d[l.PRERELEASEIDENTIFIER]}(?:\\.${d[l.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${d[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[l.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${E}+`),_("BUILD",`(?:\\+(${d[l.BUILDIDENTIFIER]}(?:\\.${d[l.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${d[l.MAINVERSION]}${d[l.PRERELEASE]}?${d[l.BUILD]}?`),_("FULL",`^${d[l.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${d[l.MAINVERSIONLOOSE]}${d[l.PRERELEASELOOSE]}?${d[l.BUILD]}?`),_("LOOSE",`^${d[l.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${d[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${d[l.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:\\.(${d[l.XRANGEIDENTIFIER]})(?:${d[l.PRERELEASE]})?${d[l.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[l.XRANGEIDENTIFIERLOOSE]})(?:${d[l.PRERELEASELOOSE]})?${d[l.BUILD]}?)?)?`),_("XRANGE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${d[l.GTLT]}\\s*${d[l.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${d[l.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",d[l.COERCEPLAIN]+`(?:${d[l.PRERELEASE]})?(?:${d[l.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",d[l.COERCE],!0),_("COERCERTLFULL",d[l.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${d[l.LONETILDE]}\\s+`,!0),i.tildeTrimReplace="$1~",_("TILDE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${d[l.LONETILDE]}${d[l.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${d[l.LONECARET]}\\s+`,!0),i.caretTrimReplace="$1^",_("CARET",`^${d[l.LONECARET]}${d[l.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${d[l.LONECARET]}${d[l.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${d[l.GTLT]}\\s*(${d[l.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${d[l.GTLT]}\\s*(${d[l.LOOSEPLAIN]}|${d[l.XRANGEPLAIN]})`,!0),i.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${d[l.XRANGEPLAIN]})\\s+-\\s+(${d[l.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${d[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[l.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ye,Ye.exports)),Ye.exports}var Qe,Ut;function Ui(){if(Ut)return Qe;Ut=1;const e=Object.freeze({loose:!0}),i=Object.freeze({});return Qe=r=>r?typeof r!="object"?e:r:i,Qe}var Ze,zt;function zi(){if(zt)return Ze;zt=1;const e=/^[0-9]+$/,i=(r,n)=>{if(typeof r=="number"&&typeof n=="number")return r===n?0:ri(n,r)},Ze}var Ke,Gt;function ur(){if(Gt)return Ke;Gt=1;const e=lr(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:r}=cr(),{safeRe:n,t:c}=Mi(),m=Ui(),{compareIdentifiers:u}=zi();class f{constructor(p,l){if(l=m(l),p instanceof f){if(p.loose===!!l.loose&&p.includePrerelease===!!l.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>i)throw new TypeError(`version is longer than ${i} characters`);e("SemVer",p,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const v=p.trim().match(l.loose?n[c.LOOSE]:n[c.FULL]);if(!v)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+v[1],this.minor=+v[2],this.patch=+v[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");v[4]?this.prerelease=v[4].split(".").map(E=>{if(/^[0-9]+$/.test(E)){const I=+E;if(I>=0&&Ip.major?1:this.minorp.minor?1:this.patchp.patch?1:0}comparePre(p){if(p instanceof f||(p=new f(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let l=0;do{const v=this.prerelease[l],E=p.prerelease[l];if(e("prerelease compare",l,v,E),v===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(v===void 0)return-1;if(v!==E)return u(v,E)}while(++l)}compareBuild(p){p instanceof f||(p=new f(p,this.options));let l=0;do{const v=this.build[l],E=p.build[l];if(e("build compare",l,v,E),v===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(v===void 0)return-1;if(v!==E)return u(v,E)}while(++l)}inc(p,l,v){if(p.startsWith("pre")){if(!l&&v===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const E=`-${l}`.match(this.options.loose?n[c.PRERELEASELOOSE]:n[c.PRERELEASE]);if(!E||E[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,v);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,v);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,v),this.inc("pre",l,v);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,v),this.inc("pre",l,v);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const E=Number(v)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let I=this.prerelease.length;for(;--I>=0;)typeof this.prerelease[I]=="number"&&(this.prerelease[I]++,I=-2);if(I===-1){if(l===this.prerelease.join(".")&&v===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(E)}}if(l){let I=[l,E];v===!1&&(I=[l]),u(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=I):this.prerelease=I}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ke=f,Ke}var Je,Vt;function Gi(){if(Vt)return Je;Vt=1;const e=ur();return Je=(i,r)=>new e(i,r).major,Je}Gi();var et,Xt;function Vi(){if(Xt)return et;Xt=1;const e=ur();return et=(i,r,n=!1)=>{if(i instanceof e)return i;try{return new e(i,r)}catch(c){if(!n)return null;throw c}},et}var tt,jt;function Xi(){if(jt)return tt;jt=1;const e=Vi();return tt=(i,r)=>{const n=e(i,r);return n?n.version:null},tt}Xi();var Ht={},Wt;function ji(){return Wt||(Wt=1,(function(e){(function(i){i.parser=function(a,t){return new n(a,t)},i.SAXParser=n,i.SAXStream=l,i.createStream=p,i.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];i.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(a,t){if(!(this instanceof n))return new n(a,t);var h=this;m(h),h.q=h.c="",h.bufferCheckPosition=i.MAX_BUFFER_LENGTH,h.opt=t||{},h.opt.lowercase=h.opt.lowercase||h.opt.lowercasetags,h.looseCase=h.opt.lowercase?"toLowerCase":"toUpperCase",h.tags=[],h.closed=h.closedRoot=h.sawRoot=!1,h.tag=h.error=null,h.strict=!!a,h.noscript=!!(a||h.opt.noscript),h.state=o.BEGIN,h.strictEntities=h.opt.strictEntities,h.ENTITIES=h.strictEntities?Object.create(i.XML_ENTITIES):Object.create(i.ENTITIES),h.attribList=[],h.opt.xmlns&&(h.ns=Object.create(_)),h.opt.unquotedAttributeValues===void 0&&(h.opt.unquotedAttributeValues=!a),h.trackPosition=h.opt.position!==!1,h.trackPosition&&(h.position=h.line=h.column=0),y(h,"onready")}Object.create||(Object.create=function(a){function t(){}t.prototype=a;var h=new t;return h}),Object.keys||(Object.keys=function(a){var t=[];for(var h in a)a.hasOwnProperty(h)&&t.push(h);return t});function c(a){for(var t=Math.max(i.MAX_BUFFER_LENGTH,10),h=0,s=0,L=r.length;st)switch(r[s]){case"textNode":ne(a);break;case"cdata":N(a,"oncdata",a.cdata),a.cdata="";break;case"script":N(a,"onscript",a.script),a.script="";break;default:ge(a,"Max buffer length exceeded: "+r[s])}h=Math.max(h,U)}var z=i.MAX_BUFFER_LENGTH-h;a.bufferCheckPosition=z+a.position}function m(a){for(var t=0,h=r.length;t"||C(a)}function D(a,t){return a.test(t)}function ae(a,t){return!D(a,t)}var o=0;i.STATE={BEGIN:o++,BEGIN_WHITESPACE:o++,TEXT:o++,TEXT_ENTITY:o++,OPEN_WAKA:o++,SGML_DECL:o++,SGML_DECL_QUOTED:o++,DOCTYPE:o++,DOCTYPE_QUOTED:o++,DOCTYPE_DTD:o++,DOCTYPE_DTD_QUOTED:o++,COMMENT_STARTING:o++,COMMENT:o++,COMMENT_ENDING:o++,COMMENT_ENDED:o++,CDATA:o++,CDATA_ENDING:o++,CDATA_ENDING_2:o++,PROC_INST:o++,PROC_INST_BODY:o++,PROC_INST_ENDING:o++,OPEN_TAG:o++,OPEN_TAG_SLASH:o++,ATTRIB:o++,ATTRIB_NAME:o++,ATTRIB_NAME_SAW_WHITE:o++,ATTRIB_VALUE:o++,ATTRIB_VALUE_QUOTED:o++,ATTRIB_VALUE_CLOSED:o++,ATTRIB_VALUE_UNQUOTED:o++,ATTRIB_VALUE_ENTITY_Q:o++,ATTRIB_VALUE_ENTITY_U:o++,CLOSE_TAG:o++,CLOSE_TAG_SAW_WHITE:o++,SCRIPT:o++,SCRIPT_ENDING:o++},i.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},i.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(i.ENTITIES).forEach(function(a){var t=i.ENTITIES[a],h=typeof t=="number"?String.fromCharCode(t):t;i.ENTITIES[a]=h});for(var S in i.STATE)i.STATE[i.STATE[S]]=S;o=i.STATE;function y(a,t,h){a[t]&&a[t](h)}function N(a,t,h){a.textNode&&ne(a),y(a,t,h)}function ne(a){a.textNode=Et(a.opt,a.textNode),a.textNode&&y(a,"ontext",a.textNode),a.textNode=""}function Et(a,t){return a.trim&&(t=t.trim()),a.normalize&&(t=t.replace(/\s+/g," ")),t}function ge(a,t){return ne(a),a.trackPosition&&(t+=` Line: `+a.line+` Column: `+a.column+` -Char: `+a.c),t=new Error(t),a.error=t,y(a,"onerror",t),a}function bt(a){return a.sawRoot&&!a.closedRoot&&R(a,"Unclosed root tag"),a.state!==o.BEGIN&&a.state!==o.BEGIN_WHITESPACE&&a.state!==o.TEXT&&ge(a,"Unexpected end"),ne(a),a.c="",a.closed=!0,y(a,"onend"),n.call(a,a.strict,a.opt),a}function R(a,t){if(typeof a!="object"||!(a instanceof n))throw new Error("bad call to strictFail");a.strict&&ge(a,t)}function hi(a){a.strict||(a.tagName=a.tagName[a.looseCase]());var t=a.tags[a.tags.length-1]||a,h=a.tag={name:a.tagName,attributes:{}};a.opt.xmlns&&(h.ns=t.ns),a.attribList.length=0,N(a,"onopentagstart",h)}function Ue(a,t){var h=a.indexOf(":"),s=h<0?["",a]:a.split(":"),L=s[0],U=s[1];return t&&a==="xmlns"&&(L="xmlns",U=""),{prefix:L,local:U}}function ze(a){if(a.strict||(a.attribName=a.attribName[a.looseCase]()),a.attribList.indexOf(a.attribName)!==-1||a.tag.attributes.hasOwnProperty(a.attribName)){a.attribName=a.attribValue="";return}if(a.opt.xmlns){var t=Ue(a.attribName,!0),h=t.prefix,s=t.local;if(h==="xmlns")if(s==="xml"&&a.attribValue!==I)R(a,"xml: prefix must be bound to "+I+` +Char: `+a.c),t=new Error(t),a.error=t,y(a,"onerror",t),a}function bt(a){return a.sawRoot&&!a.closedRoot&&R(a,"Unclosed root tag"),a.state!==o.BEGIN&&a.state!==o.BEGIN_WHITESPACE&&a.state!==o.TEXT&&ge(a,"Unexpected end"),ne(a),a.c="",a.closed=!0,y(a,"onend"),n.call(a,a.strict,a.opt),a}function R(a,t){if(typeof a!="object"||!(a instanceof n))throw new Error("bad call to strictFail");a.strict&&ge(a,t)}function hr(a){a.strict||(a.tagName=a.tagName[a.looseCase]());var t=a.tags[a.tags.length-1]||a,h=a.tag={name:a.tagName,attributes:{}};a.opt.xmlns&&(h.ns=t.ns),a.attribList.length=0,N(a,"onopentagstart",h)}function Ue(a,t){var h=a.indexOf(":"),s=h<0?["",a]:a.split(":"),L=s[0],U=s[1];return t&&a==="xmlns"&&(L="xmlns",U=""),{prefix:L,local:U}}function ze(a){if(a.strict||(a.attribName=a.attribName[a.looseCase]()),a.attribList.indexOf(a.attribName)!==-1||a.tag.attributes.hasOwnProperty(a.attribName)){a.attribName=a.attribValue="";return}if(a.opt.xmlns){var t=Ue(a.attribName,!0),h=t.prefix,s=t.local;if(h==="xmlns")if(s==="xml"&&a.attribValue!==I)R(a,"xml: prefix must be bound to "+I+` Actual: `+a.attribValue);else if(s==="xmlns"&&a.attribValue!==V)R(a,"xmlns: prefix must be bound to "+V+` -Actual: `+a.attribValue);else{var L=a.tag,U=a.tags[a.tags.length-1]||a;L.ns===U.ns&&(L.ns=Object.create(U.ns)),L.ns[s]=a.attribValue}a.attribList.push([a.attribName,a.attribValue])}else a.tag.attributes[a.attribName]=a.attribValue,N(a,"onattribute",{name:a.attribName,value:a.attribValue});a.attribName=a.attribValue=""}function de(a,t){if(a.opt.xmlns){var h=a.tag,s=Ue(a.tagName);h.prefix=s.prefix,h.local=s.local,h.uri=h.ns[s.prefix]||"",h.prefix&&!h.uri&&(R(a,"Unbound namespace prefix: "+JSON.stringify(a.tagName)),h.uri=s.prefix);var L=a.tags[a.tags.length-1]||a;h.ns&&L.ns!==h.ns&&Object.keys(h.ns).forEach(function(Tt){N(a,"onopennamespace",{prefix:Tt,uri:h.ns[Tt]})});for(var U=0,z=a.attribList.length;U",a.tagName="",a.state=o.SCRIPT;return}N(a,"onscript",a.script),a.script=""}var t=a.tags.length,h=a.tagName;a.strict||(h=h[a.looseCase]());for(var s=h;t--;){var L=a.tags[t];if(L.name!==s)R(a,"Unexpected close tag");else break}if(t<0){R(a,"Unmatched closing tag: "+a.tagName),a.textNode+="",a.state=o.TEXT;return}a.tagName=h;for(var U=a.tags.length;U-- >t;){var z=a.tag=a.tags.pop();a.tagName=a.tag.name,N(a,"onclosetag",a.tagName);var Q={};for(var Z in z.ns)Q[Z]=z.ns[Z];var he=a.tags[a.tags.length-1]||a;a.opt.xmlns&&z.ns!==he.ns&&Object.keys(z.ns).forEach(function(j){var se=z.ns[j];N(a,"onclosenamespace",{prefix:j,uri:se})})}t===0&&(a.closedRoot=!0),a.tagName=a.attribValue=a.attribName="",a.attribList.length=0,a.state=o.TEXT}function fi(a){var t=a.entity,h=t.toLowerCase(),s,L="";return a.ENTITIES[t]?a.ENTITIES[t]:a.ENTITIES[h]?a.ENTITIES[h]:(t=h,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),L=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),L=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||L.toLowerCase()!==t?(R(a,"Invalid character entity"),"&"+a.entity+";"):String.fromCodePoint(s))}function _t(a,t){t==="<"?(a.state=o.OPEN_WAKA,a.startTagPosition=a.position):C(t)||(R(a,"Non-whitespace before first tag."),a.textNode=t,a.state=o.TEXT)}function wt(a,t){var h="";return t",a.tagName="",a.state=o.SCRIPT;return}N(a,"onscript",a.script),a.script=""}var t=a.tags.length,h=a.tagName;a.strict||(h=h[a.looseCase]());for(var s=h;t--;){var L=a.tags[t];if(L.name!==s)R(a,"Unexpected close tag");else break}if(t<0){R(a,"Unmatched closing tag: "+a.tagName),a.textNode+="",a.state=o.TEXT;return}a.tagName=h;for(var U=a.tags.length;U-- >t;){var z=a.tag=a.tags.pop();a.tagName=a.tag.name,N(a,"onclosetag",a.tagName);var Q={};for(var Z in z.ns)Q[Z]=z.ns[Z];var he=a.tags[a.tags.length-1]||a;a.opt.xmlns&&z.ns!==he.ns&&Object.keys(z.ns).forEach(function(j){var se=z.ns[j];N(a,"onclosenamespace",{prefix:j,uri:se})})}t===0&&(a.closedRoot=!0),a.tagName=a.attribValue=a.attribName="",a.attribList.length=0,a.state=o.TEXT}function fr(a){var t=a.entity,h=t.toLowerCase(),s,L="";return a.ENTITIES[t]?a.ENTITIES[t]:a.ENTITIES[h]?a.ENTITIES[h]:(t=h,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),L=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),L=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||L.toLowerCase()!==t?(R(a,"Invalid character entity"),"&"+a.entity+";"):String.fromCodePoint(s))}function _t(a,t){t==="<"?(a.state=o.OPEN_WAKA,a.startTagPosition=a.position):C(t)||(R(a,"Non-whitespace before first tag."),a.textNode=t,a.state=o.TEXT)}function wt(a,t){var h="";return t"?(N(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=o.TEXT):(F(s)&&(t.state=o.SGML_DECL_QUOTED),t.sgmlDecl+=s);continue;case o.SGML_DECL_QUOTED:s===t.q&&(t.state=o.SGML_DECL,t.q=""),t.sgmlDecl+=s;continue;case o.DOCTYPE:s===">"?(t.state=o.TEXT,N(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=s,s==="["?t.state=o.DOCTYPE_DTD:F(s)&&(t.state=o.DOCTYPE_QUOTED,t.q=s));continue;case o.DOCTYPE_QUOTED:t.doctype+=s,s===t.q&&(t.q="",t.state=o.DOCTYPE);continue;case o.DOCTYPE_DTD:s==="]"?(t.doctype+=s,t.state=o.DOCTYPE):s==="<"?(t.state=o.OPEN_WAKA,t.startTagPosition=t.position):F(s)?(t.doctype+=s,t.state=o.DOCTYPE_DTD_QUOTED,t.q=s):t.doctype+=s;continue;case o.DOCTYPE_DTD_QUOTED:t.doctype+=s,s===t.q&&(t.state=o.DOCTYPE_DTD,t.q="");continue;case o.COMMENT:s==="-"?t.state=o.COMMENT_ENDING:t.comment+=s;continue;case o.COMMENT_ENDING:s==="-"?(t.state=o.COMMENT_ENDED,t.comment=Et(t.opt,t.comment),t.comment&&N(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+s,t.state=o.COMMENT);continue;case o.COMMENT_ENDED:s!==">"?(R(t,"Malformed comment"),t.comment+="--"+s,t.state=o.COMMENT):t.doctype&&t.doctype!==!0?t.state=o.DOCTYPE_DTD:t.state=o.TEXT;continue;case o.CDATA:s==="]"?t.state=o.CDATA_ENDING:t.cdata+=s;continue;case o.CDATA_ENDING:s==="]"?t.state=o.CDATA_ENDING_2:(t.cdata+="]"+s,t.state=o.CDATA);continue;case o.CDATA_ENDING_2:s===">"?(t.cdata&&N(t,"oncdata",t.cdata),N(t,"onclosecdata"),t.cdata="",t.state=o.TEXT):s==="]"?t.cdata+="]":(t.cdata+="]]"+s,t.state=o.CDATA);continue;case o.PROC_INST:s==="?"?t.state=o.PROC_INST_ENDING:C(s)?t.state=o.PROC_INST_BODY:t.procInstName+=s;continue;case o.PROC_INST_BODY:if(!t.procInstBody&&C(s))continue;s==="?"?t.state=o.PROC_INST_ENDING:t.procInstBody+=s;continue;case o.PROC_INST_ENDING:s===">"?(N(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=o.TEXT):(t.procInstBody+="?"+s,t.state=o.PROC_INST_BODY);continue;case o.OPEN_TAG:D(X,s)?t.tagName+=s:(hi(t),s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:(C(s)||R(t,"Invalid character in tag name"),t.state=o.ATTRIB));continue;case o.OPEN_TAG_SLASH:s===">"?(de(t,!0),Ge(t)):(R(t,"Forward-slash in opening tag not followed by >"),t.state=o.ATTRIB);continue;case o.ATTRIB:if(C(s))continue;s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:D(W,s)?(t.attribName=s,t.attribValue="",t.state=o.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case o.ATTRIB_NAME:s==="="?t.state=o.ATTRIB_VALUE:s===">"?(R(t,"Attribute without value"),t.attribValue=t.attribName,ze(t),de(t)):C(s)?t.state=o.ATTRIB_NAME_SAW_WHITE:D(X,s)?t.attribName+=s:R(t,"Invalid attribute name");continue;case o.ATTRIB_NAME_SAW_WHITE:if(s==="=")t.state=o.ATTRIB_VALUE;else{if(C(s))continue;R(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",N(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",s===">"?de(t):D(W,s)?(t.attribName=s,t.state=o.ATTRIB_NAME):(R(t,"Invalid attribute name"),t.state=o.ATTRIB)}continue;case o.ATTRIB_VALUE:if(C(s))continue;F(s)?(t.q=s,t.state=o.ATTRIB_VALUE_QUOTED):(t.opt.unquotedAttributeValues||ge(t,"Unquoted attribute value"),t.state=o.ATTRIB_VALUE_UNQUOTED,t.attribValue=s);continue;case o.ATTRIB_VALUE_QUOTED:if(s!==t.q){s==="&"?t.state=o.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=s;continue}ze(t),t.q="",t.state=o.ATTRIB_VALUE_CLOSED;continue;case o.ATTRIB_VALUE_CLOSED:C(s)?t.state=o.ATTRIB:s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:D(W,s)?(R(t,"No whitespace between attributes"),t.attribName=s,t.attribValue="",t.state=o.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case o.ATTRIB_VALUE_UNQUOTED:if(!M(s)){s==="&"?t.state=o.ATTRIB_VALUE_ENTITY_U:t.attribValue+=s;continue}ze(t),s===">"?de(t):t.state=o.ATTRIB;continue;case o.CLOSE_TAG:if(t.tagName)s===">"?Ge(t):D(X,s)?t.tagName+=s:t.script?(t.script+=""?Ge(t):R(t,"Invalid characters in closing tag");continue;case o.TEXT_ENTITY:case o.ATTRIB_VALUE_ENTITY_Q:case o.ATTRIB_VALUE_ENTITY_U:var z,Q;switch(t.state){case o.TEXT_ENTITY:z=o.TEXT,Q="textNode";break;case o.ATTRIB_VALUE_ENTITY_Q:z=o.ATTRIB_VALUE_QUOTED,Q="attribValue";break;case o.ATTRIB_VALUE_ENTITY_U:z=o.ATTRIB_VALUE_UNQUOTED,Q="attribValue";break}if(s===";"){var Z=fi(t);t.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(Z)?(t.entity="",t.state=z,t.write(Z)):(t[Q]+=Z,t.entity="",t.state=z)}else D(t.entity.length?J:te,s)?t.entity+=s:(R(t,"Invalid character in entity name"),t[Q]+="&"+t.entity+s,t.entity="",t.state=z);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&c(t),t}String.fromCodePoint||(function(){var a=String.fromCharCode,t=Math.floor,h=function(){var s=16384,L=[],U,z,Q=-1,Z=arguments.length;if(!Z)return"";for(var he="";++Q1114111||t(j)!==j)throw RangeError("Invalid code point: "+j);j<=65535?L.push(j):(j-=65536,U=(j>>10)+55296,z=j%1024+56320,L.push(U,z)),(Q+1===Z||L.length>s)&&(he+=a.apply(null,L),L.length=0)}return he};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:h,configurable:!0,writable:!0}):String.fromCodePoint=h})()})(e)})(Ht)),Ht}jr();var Se=(e=>(e.ReservedName="reserved name",e.Character="character",e.Extension="extension",e))(Se||{});class Ee extends Error{constructor(r){super(`Invalid ${r.reason} '${r.segment}' in filename '${r.filename}'`,{cause:r})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function Hr(e){const r=er().files,i=r.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const u of i)if(e.includes(u))throw new Ee({segment:u,reason:"character",filename:e});if(e=e.toLocaleLowerCase(),(r.forbidden_filenames??[".htaccess"]).includes(e))throw new Ee({filename:e,segment:e,reason:"reserved name"});const n=e.indexOf(".",1),c=e.substring(0,n===-1?void 0:n);if((r.forbidden_filename_basenames??[]).includes(c))throw new Ee({filename:e,segment:c,reason:"reserved name"});const m=r.forbidden_filename_extensions??[".part",".filepart"];for(const u of m)if(e.length>u.length&&e.endsWith(u))throw new Ee({segment:u,reason:"extension",filename:e})}const it=["B","KB","MB","GB","TB","PB"],rt=["B","KiB","MiB","GiB","TiB","PiB"];function Wr(e,r=!1,i=!1,n=!1){i=i&&!n,typeof e=="string"&&(e=Number(e));let c=e>0?Math.floor(Math.log(e)/Math.log(n?1e3:1024)):0;c=Math.min((i?rt.length:it.length)-1,c);const m=i?rt[c]:it[c];let u=(e/Math.pow(n?1e3:1024,c)).toFixed(1);return r===!0&&c===0?(u!=="0.0"?"< 1 ":"0 ")+(i?rt[1]:it[1]):(c<2?u=parseFloat(u).toFixed(0):u=parseFloat(u).toLocaleString(Jt()),u+" "+m)}function qt(e){return e instanceof Date?e.toISOString():String(e)}function qr(e,r,i){r=r??[m=>m],i=i??[];const n=r.map((m,u)=>(i[u]??"asc")==="asc"?1:-1),c=Intl.Collator([qi(),Jt()],{numeric:!0,usage:"sort"});return[...e].sort((m,u)=>{for(const[f,d]of r.entries()){const p=c.compare(qt(d(m)),qt(d(u)));if(p!==0)return p*n[f]}return 0})}function Yr(e,r={}){const i={sortingMode:"basename",sortingOrder:"asc",...r};function n(u){const f=u.displayname||u.attributes?.displayname||u.basename||"";return u.type===le.Folder?f:f.lastIndexOf(".")>0?f.slice(0,f.lastIndexOf(".")):f}const c=[...i.sortFavoritesFirst?[u=>u.attributes?.favorite!==1]:[],...i.sortFoldersFirst?[u=>u.type!=="folder"]:[],...i.sortingMode!=="basename"?[u=>u[i.sortingMode]??u.attributes[i.sortingMode]]:[],u=>n(u),u=>u.basename],m=[...i.sortFavoritesFirst?["asc"]:[],...i.sortFoldersFirst?["asc"]:[],...i.sortingMode==="mtime"?[i.sortingOrder==="asc"?"desc":"asc"]:[],...i.sortingMode!=="mtime"&&i.sortingMode!=="basename"?[i.sortingOrder]:[],i.sortingOrder,i.sortingOrder];return qr(e,c,m)}const Qr=new tr({concurrency:5});function Zr(e){const{resolve:r,promise:i}=Promise.withResolvers();return Qr.add(()=>{const n=new Image;return n.onerror=()=>r(!1),n.onload=()=>r(!0),n.src=e,i}),i}function Kr(e,r={}){r={size:32,cropPreview:!1,mimeFallback:!0,...r};try{const i=e.attributes?.previewUrl||ut("/core/preview?fileId={fileid}",{fileid:e.fileid});let n;try{n=new URL(i)}catch{n=new URL(i,window.location.origin)}return n.searchParams.set("x",`${r.size}`),n.searchParams.set("y",`${r.size}`),n.searchParams.set("mimeFallback",`${r.mimeFallback}`),n.searchParams.set("a",r.cropPreview===!0?"0":"1"),n.searchParams.set("c",`${e.attributes.etag}`),n}catch{return null}}function Jr(e,r){const i=P(null),n=P(!1);return Ei(()=>{n.value=!1,i.value=Kr(_e(e),_e(r||{})),i.value&&_e(e).type===le.File&&Zr(i.value.href).then(c=>{n.value=c})}),{previewURL:i,previewLoaded:n}}const K=(e,r)=>{const i=e.__vccOpts||e;for(const[n,c]of r)i[n]=c;return i},ea={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ta=["aria-hidden","aria-label"],ia=["fill","width","height"],ra={d:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"},aa={key:0};function na(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon file-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",ra,[i.title?(g(),b("title",aa,x(i.title),1)):G("",!0)])],8,ia))],16,ta)}const ot=K(ea,[["render",na]]),sa={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},oa=["aria-hidden","aria-label"],la=["fill","width","height"],ca={d:"M7,10L12,15L17,10H7Z"},ua={key:0};function da(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon menu-down-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",ca,[i.title?(g(),b("title",ua,x(i.title),1)):G("",!0)])],8,la))],16,oa)}const at=K(sa,[["render",da]]),pa={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ma=["aria-hidden","aria-label"],ha=["fill","width","height"],fa={d:"M7,15L12,10L17,15H7Z"},ga={key:0};function va(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon menu-up-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",fa,[i.title?(g(),b("title",ga,x(i.title),1)):G("",!0)])],8,ha))],16,ma)}const nt=K(pa,[["render",va]]),Ea={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ba=["aria-hidden","aria-label"],_a=["fill","width","height"],wa={d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"},ya={key:0};function Ta(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon folder-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",wa,[i.title?(g(),b("title",ya,x(i.title),1)):G("",!0)])],8,_a))],16,ba)}const di=K(Ea,[["render",Ta]]),pi={"file-picker__file-icon":"_file-picker__file-icon_3v9zx_9","file-picker__file-icon--primary":"_file-picker__file-icon--primary_3v9zx_21","file-picker__file-icon-overlay":"_file-picker__file-icon-overlay_3v9zx_25"},Ia=me({__name:"FilePreview",props:{node:{},cropImagePreviews:{type:Boolean}},setup(e){const r=e,i=P(pi),{previewURL:n,previewLoaded:c}=Jr(Zt(r,"node"),O(()=>({cropPreview:r.cropImagePreviews}))),m=O(()=>r.node.type===le.File),u=O(()=>{if(r.node.type!==le.Folder)return null;if(r.node.attributes?.["is-encrypted"]===1)return Bi;if(r.node.attributes?.["is-tag"])return xi;const f=Object.values(r.node.attributes?.["share-types"]||{}).flat();if(f.some(d=>d===Lt.Link||d===Lt.Email))return Mi;if(f.length>0)return At;switch(r.node.attributes?.["mount-type"]){case"external":case"external-session":return zi;case"group":return Ui;case"shared":return At}return null});return(f,d)=>(g(),b("div",{style:Ii(w(c)?{backgroundImage:`url(${w(n)})`}:void 0),class:fe(i.value["file-picker__file-icon"])},[w(c)?G("",!0):(g(),b(oe,{key:0},[m.value?(g(),B(ot,{key:0,size:32})):(g(),b(oe,{key:1},[u.value?(g(),B(w(ei),{key:0,class:fe(i.value["file-picker__file-icon-overlay"]),inline:"",path:u.value,size:16},null,8,["class","path"])):G("",!0),$(di,{class:fe(i.value["file-picker__file-icon--primary"]),size:32},null,8,["class"])],64))],64))],6))}}),Na=["tabindex","aria-selected","data-filename"],Aa={class:"row-name"},Ca={class:"file-picker__name-container","data-testid":"row-name"},La=["title","textContent"],Da=["textContent"],Ra={class:"row-size"},Oa={class:"row-modified"},Sa=me({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:{},cropImagePreviews:{type:Boolean}},emits:["update:selected","enterDirectory"],setup(e,{emit:r}){const i=e,n=r,c=O(()=>i.node.mtime??0),m=O(()=>Kt(i.node.displayname)),u=O(()=>i.node.displayname.slice(0,m.value?-m.value.length:void 0)),f=O(()=>i.node.type===le.Folder),d=O(()=>i.canPick&&(i.allowPickDirectory||!f.value)),p=O(()=>(i.node.permissions&ee.READ)===ee.READ);function l(){d.value&&n("update:selected",!i.selected)}function v(){f.value?p.value&&n("enterDirectory",i.node):l()}function E(I){I.key==="Enter"&&v()}return(I,V)=>(g(),b("tr",ie({tabindex:e.showCheckbox&&!f.value?void 0:0,"aria-selected":d.value?e.selected:void 0,class:["file-picker__row",[{"file-picker__row--selected":e.selected&&!e.showCheckbox,"file-picker__row--not-navigatable":f.value&&!p.value,"file-picker__row--not-pickable":!d.value}]],"data-filename":e.node.basename,"data-testid":"file-list-row"},Ti({click:v,...!e.showCheckbox||f.value?{keydown:E}:{}},!0)),[e.showCheckbox?(g(),b("td",{key:0,class:"row-checkbox",onClick:Re(()=>{},["stop"])},[$(w(ti),{"aria-label":w(A)("Select the row for {nodename}",{nodename:u.value}),disabled:!d.value,"data-testid":"row-checkbox","model-value":e.selected,"onUpdate:modelValue":l},null,8,["aria-label","disabled","model-value"])])):G("",!0),T("td",Aa,[T("div",Ca,[$(Ia,{node:e.node,"crop-image-previews":e.cropImagePreviews},null,8,["node","crop-image-previews"]),T("div",{class:"file-picker__file-name",title:u.value,textContent:x(u.value)},null,8,La),T("div",{class:"file-picker__file-extension",textContent:x(m.value)},null,8,Da)])]),T("td",Ra,x(w(Wr)(e.node.size||0)),1),T("td",Oa,[$(w(Ji),{timestamp:c.value,"ignore-seconds":""},null,8,["timestamp"])])],16,Na))}}),ka=K(Sa,[["__scopeId","data-v-2af740c4"]]),Fa={"aria-hidden":"true",class:"file-picker__row loading-row"},$a={key:0,class:"row-checkbox"},Pa={class:"row-name"},Ba={class:"row-wrapper"},xa=me({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup(e){return(r,i)=>(g(),b("tr",Fa,[e.showCheckbox?(g(),b("td",$a,[...i[0]||(i[0]=[T("span",null,null,-1)])])):G("",!0),T("td",Pa,[T("div",Ba,[T("span",{class:fe(w(pi)["file-picker__file-icon"])},null,2),i[1]||(i[1]=T("span",null,null,-1))])]),i[2]||(i[2]=T("td",{class:"row-size"},[T("span")],-1)),i[3]||(i[3]=T("td",{class:"row-modified"},[T("span")],-1))]))}}),Ma=K(xa,[["__scopeId","data-v-1f96131b"]]);function mi(){const e=ri("files","config",null),r=P(e?.show_hidden??!0),i=P(e?.sort_favorites_first??!0),n=P(e?.crop_image_previews??!0);return Ie(async()=>{if(Ne())ye.debug("Skip loading files settings - currently on public share");else try{const{data:c}=await ii.get(ut("/apps/files/api/v1/configs"));r.value=c?.data?.show_hidden??!1,i.value=c?.data?.sort_favorites_first??!0,n.value=c?.data?.crop_image_previews??!0}catch(c){ye.error("Could not load files settings",{error:c}),ct(A("Could not load files settings"))}}),{showHiddenFiles:r,sortFavoritesFirst:i,cropImagePreviews:n}}function Ua(e){const r=p=>p==="asc"?"ascending":p==="desc"?"descending":"none",i=ri("files","viewConfigs",null),n=P({sortBy:i?.files?.sorting_mode??"basename",order:r(i?.files?.sorting_direction??"asc")}),c=P({sortBy:i?.recent?.sorting_mode??"basename",order:r(i?.recent?.sorting_direction??"asc")}),m=P({sortBy:i?.favorites?.sorting_mode??"basename",order:r(i?.favorites?.sorting_direction??"asc")});Ie(async()=>{if(Ne())ye.debug("Skip loading files views - currently on public share");else try{const{data:p}=await ii.get(ut("/apps/files/api/v1/views"));n.value={sortBy:p?.data?.files?.sorting_mode??"basename",order:r(p?.data?.files?.sorting_direction)},m.value={sortBy:p?.data?.favorites?.sorting_mode??"basename",order:r(p?.data?.favorites?.sorting_direction)},c.value={sortBy:p?.data?.recent?.sorting_mode??"basename",order:r(p?.data?.recent?.sorting_direction)}}catch(p){ye.error("Could not load files views",{error:p}),ct(A("Could not load files views"))}});const u=O(()=>_e(e||"files")==="files"?n.value:_e(e)==="recent"?c.value:m.value),f=O(()=>u.value.sortBy),d=O(()=>u.value.order);return{filesViewConfig:n,favoritesViewConfig:m,recentViewConfig:c,currentConfig:u,sortBy:f,order:d}}const za={key:0,class:"row-checkbox"},Ga={class:"hidden-visually"},Va=["aria-sort"],Xa={class:"header-wrapper"},ja={key:2,style:{width:"44px"}},Ha=["aria-sort"],Wa={key:2,style:{width:"44px"}},qa=["aria-sort"],Ya={key:2,style:{width:"44px"}},Qa=me({__name:"FileList",props:_i({currentView:{},multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:{},canPick:{type:Function}},{path:{required:!0},pathModifiers:{},selectedFiles:{required:!0},selectedFilesModifiers:{}}),emits:["update:path","update:selectedFiles"],setup(e){const r=Nt(e,"path"),i=Nt(e,"selectedFiles"),n=e,c=P(),{currentConfig:m}=Ua(n.currentView),u=O(()=>c.value??m.value),f=O(()=>u.value.sortBy==="basename"?u.value.order==="none"?void 0:u.value.order:void 0),d=O(()=>u.value.sortBy==="size"?u.value.order==="none"?void 0:u.value.order:void 0),p=O(()=>u.value.sortBy==="mtime"?u.value.order==="none"?void 0:u.value.order:void 0);function l(F){u.value.sortBy===F?u.value.order==="ascending"?c.value={sortBy:u.value.sortBy,order:"descending"}:c.value={sortBy:u.value.sortBy,order:"ascending"}:c.value={sortBy:F,order:"ascending"}}const{sortFavoritesFirst:v,cropImagePreviews:E}=mi(),I=O(()=>Yr(n.files,{sortFoldersFirst:!0,sortFavoritesFirst:v.value,sortingOrder:u.value.order==="descending"?"desc":"asc",sortingMode:u.value.sortBy})),V=O(()=>n.files.filter(F=>n.allowPickDirectory||F.type!==le.Folder)),_=O(()=>!n.loading&&i.value.length>0&&i.value.length>=V.value.length);function W(){i.value.lengthM.path!==F.path):n.multiselect?i.value=[...i.value,F]:i.value=[F]}function te(F){r.value=F.path}const J=P(4),C=P();{const F=()=>wi(()=>{const M=C.value?.parentElement?.children||[];let D=C.value?.parentElement?.clientHeight||450;for(let ae=0;ae{window.addEventListener("resize",F),F()}),yi(()=>{window.removeEventListener("resize",F)})}return(F,M)=>(g(),b("div",{ref_key:"fileContainer",ref:C,class:"file-picker__files"},[T("table",null,[T("thead",null,[T("tr",null,[e.multiselect?(g(),b("th",za,[T("span",Ga,x(w(A)("Select entry")),1),e.multiselect?(g(),B(w(ti),{key:0,"aria-label":w(A)("Select all entries"),"data-testid":"select-all-checkbox","model-value":_.value,"onUpdate:modelValue":W},null,8,["aria-label","model-value"])):G("",!0)])):G("",!0),T("th",{"aria-sort":f.value,class:"row-name"},[T("div",Xa,[M[3]||(M[3]=T("span",{class:"file-picker__header-preview"},null,-1)),$(w(we),{"data-test":"file-picker_sort-name",variant:"tertiary",wide:"",onClick:M[0]||(M[0]=D=>l("basename"))},{icon:k(()=>[f.value==="ascending"?(g(),B(nt,{key:0,size:20})):f.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",ja))]),default:k(()=>[be(" "+x(w(A)("Name")),1)]),_:1})])],8,Va),T("th",{"aria-sort":d.value,class:"row-size"},[$(w(we),{variant:"tertiary",wide:"",onClick:M[1]||(M[1]=D=>l("size"))},{icon:k(()=>[d.value==="ascending"?(g(),B(nt,{key:0,size:20})):d.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",Wa))]),default:k(()=>[be(" "+x(w(A)("Size")),1)]),_:1})],8,Ha),T("th",{"aria-sort":p.value,class:"row-modified"},[$(w(we),{variant:"tertiary",wide:"",onClick:M[2]||(M[2]=D=>l("mtime"))},{icon:k(()=>[p.value==="ascending"?(g(),B(nt,{key:0,size:20})):p.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",Ya))]),default:k(()=>[be(" "+x(w(A)("Modified")),1)]),_:1})],8,qa)])]),T("tbody",null,[e.loading?(g(!0),b(oe,{key:0},ke(J.value,D=>(g(),B(Ma,{key:D,"show-checkbox":e.multiselect},null,8,["show-checkbox"]))),128)):(g(!0),b(oe,{key:1},ke(I.value,D=>(g(),B(ka,{key:D.fileid||D.path,"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":(e.multiselect||i.value.length===0||i.value.includes(D))&&(e.canPick===void 0||e.canPick(D)),selected:i.value.includes(D),node:D,"crop-image-previews":w(E),"onUpdate:selected":ae=>X(D),onEnterDirectory:te},null,8,["allow-pick-directory","show-checkbox","can-pick","selected","node","crop-image-previews","onUpdate:selected"]))),128))])])],512))}}),Za=K(Qa,[["__scopeId","data-v-68ec5c33"]]),Ka={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ja=["aria-hidden","aria-label"],en=["fill","width","height"],tn={d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},rn={key:0};function an(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon home-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",tn,[i.title?(g(),b("title",rn,x(i.title),1)):G("",!0)])],8,en))],16,Ja)}const nn=K(Ka,[["render",an]]),sn={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},on=["aria-hidden","aria-label"],ln=["fill","width","height"],cn={d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},un={key:0};function dn(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon plus-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",cn,[i.title?(g(),b("title",un,x(i.title),1)):G("",!0)])],8,ln))],16,on)}const pn=K(sn,[["render",dn]]),mn=me({__name:"FilePickerBreadcrumbs",props:{path:{},showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:r}){const i=e,n=r,c=P(!1),m=P(""),u=bi("nameInput");function f(){const l=m.value.trim(),v=u.value?.$el?.querySelector("input");let E="";try{Hr(l)}catch(I){if(!(I instanceof Ee))throw I;switch(I.reason){case Se.Character:E=A('"{char}" is not allowed inside a folder name.',{char:I.segment});break;case Se.ReservedName:E=A('"{segment}" is a reserved name and not allowed for folder names.',{segment:I.segment});break;case Se.Extension:E=A('Folder names must not end with "{extension}".',{extension:I.segment});break;default:E=A("Invalid folder name.")}}return v&&v.setCustomValidity(E),E===""}function d(){const l=m.value.trim();f()&&(c.value=!1,n("create-node",l),m.value="")}const p=O(()=>i.path.split("/").filter(l=>l!=="").map((l,v,E)=>({name:l,path:"/"+E.slice(0,v+1).join("/")})));return(l,v)=>(g(),B(w(yr),{class:"file-picker__breadcrumbs"},Yt({default:k(()=>[$(w(Fe),{name:w(A)("All files"),title:w(A)("Home"),onClick:v[0]||(v[0]=E=>n("update:path","/"))},{icon:k(()=>[$(nn,{size:20})]),_:1},8,["name","title"]),(g(!0),b(oe,null,ke(p.value,E=>(g(),B(w(Fe),{key:E.path,name:E.name,title:E.path,onClick:I=>n("update:path",E.path)},null,8,["name","title","onClick"]))),128))]),_:2},[e.showMenu?{name:"actions",fn:k(()=>[$(w(lt),{open:c.value,"onUpdate:open":v[2]||(v[2]=E=>c.value=E),"aria-label":w(A)("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":w(A)("New"),variant:"secondary",onClose:v[3]||(v[3]=E=>m.value="")},{icon:k(()=>[$(pn,{size:20})]),default:k(()=>[$(w(ir),{ref_key:"nameInput",ref:u,modelValue:m.value,"onUpdate:modelValue":[v[1]||(v[1]=E=>m.value=E),f],label:w(A)("New folder"),placeholder:w(A)("New folder name"),onSubmit:d},{icon:k(()=>[$(di,{size:20})]),_:1},8,["modelValue","label","placeholder"])]),_:1},8,["open","aria-label","menu-name"])]),key:"0"}:void 0]),1024))}}),hn=K(mn,[["__scopeId","data-v-4ce40fd0"]]),fn={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gn=["aria-hidden","aria-label"],vn=["fill","width","height"],En={d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},bn={key:0};function _n(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon close-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",En,[i.title?(g(),b("title",bn,x(i.title),1)):G("",!0)])],8,vn))],16,gn)}const wn=K(fn,[["render",_n]]),yn={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Tn=["aria-hidden","aria-label"],In=["fill","width","height"],Nn={d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"},An={key:0};function Cn(e,r,i,n,c,m){return g(),b("span",ie(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon magnify-icon",role:"img",onClick:r[0]||(r[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[T("path",Nn,[i.title?(g(),b("title",An,x(i.title),1)):G("",!0)])],8,In))],16,Tn)}const Ln=K(yn,[["render",Cn]]);function Dn(e){const r=[{id:"files",label:A("All files"),icon:Fi},{id:"recent",label:A("Recent"),icon:$i},{id:"favorites",label:A("Favorites"),icon:Pi}],i=e.value?r.filter(({id:n})=>n==="files"):r;return{allViews:r,availableViews:i}}const Rn={key:0,class:"file-picker__side"},On=me({__name:"FilePickerNavigation",props:{currentView:{},filterString:{},isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:r}){const i=e,n=r,{availableViews:c}=Dn(P($e()===null)),m=O(()=>c.filter(f=>f.id===i.currentView)[0]??c[0]),u=f=>n("update:filterString",f.toString());return(f,d)=>(g(),b(oe,null,[$(w(ar),{class:"file-picker__filter-input",label:w(A)("Filter file list"),"show-trailing-button":!!e.filterString,"model-value":e.filterString,"onUpdate:modelValue":u,onTrailingButtonClick:d[0]||(d[0]=p=>u(""))},{"trailing-button-icon":k(()=>[$(wn,{size:16})]),default:k(()=>[$(Ln,{size:16})]),_:1},8,["label","show-trailing-button","model-value"]),w(c).length>1&&!e.disabledNavigation?(g(),b(oe,{key:0},[e.isCollapsed?(g(),B(w(rr),{key:1,"aria-label":w(A)("Current view selector"),clearable:!1,searchable:!1,options:w(c),"model-value":m.value,"onUpdate:modelValue":d[1]||(d[1]=p=>n("update:currentView",p.id))},null,8,["aria-label","options","model-value"])):(g(),b("ul",Rn,[(g(!0),b(oe,null,ke(w(c),p=>(g(),b("li",{key:p.id},[$(w(we),{variant:e.currentView===p.id?"primary":"tertiary",wide:!0,onClick:l=>f.$emit("update:currentView",p.id)},{icon:k(()=>[$(w(ei),{path:p.icon,size:20},null,8,["path"])]),default:k(()=>[be(" "+x(p.label),1)]),_:2},1032,["variant","onClick"])]))),128))]))],64)):G("",!0)],64))}}),Sn=K(On,[["__scopeId","data-v-b91fd905"]]);function kn(e){const r=new AbortController,i=Math.round(Date.now()/1e3)-3600*24*14;return new re(async(n,c,m)=>{m(()=>r.abort());try{const{data:u}=await e.search("/",{signal:r.signal,details:!0,data:Sr(i)}),f=u.results.map(d=>Me(d));n(f)}catch(u){c(u)}})}function Fn(e,r){const i=new AbortController;return new re(async(n,c,m)=>{m(()=>i.abort());try{const u=(await e.getDirectoryContents(Te(Ae,r),{signal:i.signal,details:!0,includeSelf:!0,data:si()})).data.map(f=>Me(f));n({contents:u.filter(({path:f})=>f!==r),folder:u.find(({path:f})=>f===r)})}catch(u){c(u)}})}async function $n(e,r){const{data:i}=await e.stat(Te(Ae,r),{details:!0,data:si()});return Me(i)}function Pn(e,r){const i=$r(),n=st([]),c=st(null),m=P(!0),u=P(null);async function f(p){const l=Te(r.value,p);await i.createDirectory(Te(Ae,l));const v=await $n(i,l);return n.value=[...n.value,v],v}async function d(){u.value&&u.value.cancel(),m.value=!0,e.value==="favorites"?u.value=Pr(i,r.value):e.value==="recent"?u.value=kn(i):u.value=Fn(i,r.value);const p=await u.value;if(p)"folder"in p?(c.value=p.folder,n.value=p.contents):(c.value=null,n.value=p);else return;u.value=null,m.value=!1}return Qt([e,r],()=>d()),Ie(()=>d()),{isLoading:m,files:n,folder:c,loadFiles:d,createDirectory:f}}function Bn(e){const r=O(()=>e.value.map(i=>i.split("/")));return{isSupportedMimeType:i=>{const n=i.split("/");return r.value.some(([c,m])=>(n[0]===c||c==="*")&&(n[1]===m||m==="*"))}}}const xn={class:"file-picker__main"},Mn={key:1,class:"file-picker__view"},Un=me({__name:"FilePicker",props:{buttons:{},name:{},allowPickDirectory:{type:Boolean,default:!1},noMenu:{type:Boolean,default:!1},disabledNavigation:{type:Boolean,default:!1},filterFn:{type:Function,default:void 0},canPickFn:{type:Function,default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!1},path:{default:void 0}},emits:["close"],setup(e,{emit:r}){const i=e,n=r,c=P(!0),m=P("files"),u=P(window?.sessionStorage.getItem("NC.FilePicker.LastPath")||"/"),f=P(""),d=O({get:()=>m.value==="files"?f.value||i.path||u.value:"/",set:S=>{f.value=S}}),p=st([]),{files:l,folder:v,isLoading:E,loadFiles:I,createDirectory:V}=Pn(m,d);Qt([f],()=>{i.path===void 0&&f.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",f.value),p.value=[]});let _=!1;const W=O(()=>{const S=p.value.length===0&&i.allowPickDirectory&&v.value?[v.value]:p.value;return(typeof i.buttons=="function"?i.buttons(S,d.value,m.value):i.buttons).map(y=>({...y,disabled:y.disabled||E.value,callback:()=>{_=!0,X(y.callback,S)}}))});async function X(S,y){await S(y),n("close",y),_=!1}const te=O(()=>m.value==="favorites"?A("Favorites"):m.value==="recent"?A("Recent"):""),J=P(""),{isSupportedMimeType:C}=Bn(Zt(i,"mimetypeFilter"));Ie(()=>I());const{showHiddenFiles:F}=mi(),M=O(()=>{let S=l.value;return F.value||(S=S.filter(y=>!y.basename.startsWith("."))),i.mimetypeFilter.length>0&&(S=S.filter(y=>y.type==="folder"||y.mime&&C(y.mime))),J.value&&(S=S.filter(y=>y.basename.toLowerCase().includes(J.value.toLowerCase()))),i.filterFn&&(S=S.filter(y=>i.filterFn(y))),S}),D=O(()=>m.value==="files"?A("Upload some content or sync with your devices!"):m.value==="recent"?A("Files and folders you recently modified will show up here."):A("Files and folders you mark as favorite will show up here."));async function ae(S){try{const y=await V(S);f.value=y.path,ki("files:node:created",l.value.filter(N=>N.basename===S)[0])}catch(y){ye.warn("Could not create new folder",{name:S,error:y}),ct(A("Could not create the new folder"))}}function o(S){!S&&!_&&n("close")}return(S,y)=>(g(),B(w(Vi),{open:c.value,"onUpdate:open":[y[6]||(y[6]=N=>c.value=N),o],buttons:W.value,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation"},{navigation:k(({isCollapsed:N})=>[$(Sn,{"current-view":m.value,"onUpdate:currentView":y[0]||(y[0]=ne=>m.value=ne),"filter-string":J.value,"onUpdate:filterString":y[1]||(y[1]=ne=>J.value=ne),"is-collapsed":N,"disabled-navigation":e.disabledNavigation},null,8,["current-view","filter-string","is-collapsed","disabled-navigation"])]),default:k(()=>[T("div",xn,[m.value==="files"?(g(),B(hn,{key:0,path:d.value,"onUpdate:path":y[2]||(y[2]=N=>d.value=N),"show-menu":!e.noMenu,onCreateNode:ae},null,8,["path","show-menu"])):(g(),b("div",Mn,[T("h3",null,x(te.value),1)])),w(E)||M.value.length>0?(g(),B(Za,{key:2,path:d.value,"onUpdate:path":[y[3]||(y[3]=N=>d.value=N),y[5]||(y[5]=N=>m.value="files")],"selected-files":p.value,"onUpdate:selectedFiles":y[4]||(y[4]=N=>p.value=N),"allow-pick-directory":e.allowPickDirectory,"current-view":m.value,files:M.value,multiselect:e.multiselect,loading:w(E),name:te.value,"can-pick":e.canPickFn},null,8,["path","selected-files","allow-pick-directory","current-view","files","multiselect","loading","name","can-pick"])):J.value?(g(),B(w(Ct),{key:3,name:w(A)("No matching files"),description:w(A)("No files matching your filter were found.")},{icon:k(()=>[$(ot)]),_:1},8,["name","description"])):(g(),B(w(Ct),{key:4,name:w(A)("No files in here"),description:D.value},{icon:k(()=>[$(ot)]),_:1},8,["name","description"]))])]),_:1},8,["open","buttons","name"]))}}),os=K(Un,[["__scopeId","data-v-303416d3"]]);export{os as default}; -//# sourceMappingURL=FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.map +`?(t.line++,t.column=0):t.column++);t.textNode+=a.substring(L,h-1)}s==="<"&&!(t.sawRoot&&t.closedRoot&&!t.strict)?(t.state=o.OPEN_WAKA,t.startTagPosition=t.position):(!C(s)&&(!t.sawRoot||t.closedRoot)&&R(t,"Text data outside of root node."),s==="&"?t.state=o.TEXT_ENTITY:t.textNode+=s);continue;case o.SCRIPT:s==="<"?t.state=o.SCRIPT_ENDING:t.script+=s;continue;case o.SCRIPT_ENDING:s==="/"?t.state=o.CLOSE_TAG:(t.script+="<"+s,t.state=o.SCRIPT);continue;case o.OPEN_WAKA:if(s==="!")t.state=o.SGML_DECL,t.sgmlDecl="";else if(!C(s))if(D(W,s))t.state=o.OPEN_TAG,t.tagName=s;else if(s==="/")t.state=o.CLOSE_TAG,t.tagName="";else if(s==="?")t.state=o.PROC_INST,t.procInstName=t.procInstBody="";else{if(R(t,"Unencoded <"),t.startTagPosition+1"?(N(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=o.TEXT):(F(s)&&(t.state=o.SGML_DECL_QUOTED),t.sgmlDecl+=s);continue;case o.SGML_DECL_QUOTED:s===t.q&&(t.state=o.SGML_DECL,t.q=""),t.sgmlDecl+=s;continue;case o.DOCTYPE:s===">"?(t.state=o.TEXT,N(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=s,s==="["?t.state=o.DOCTYPE_DTD:F(s)&&(t.state=o.DOCTYPE_QUOTED,t.q=s));continue;case o.DOCTYPE_QUOTED:t.doctype+=s,s===t.q&&(t.q="",t.state=o.DOCTYPE);continue;case o.DOCTYPE_DTD:s==="]"?(t.doctype+=s,t.state=o.DOCTYPE):s==="<"?(t.state=o.OPEN_WAKA,t.startTagPosition=t.position):F(s)?(t.doctype+=s,t.state=o.DOCTYPE_DTD_QUOTED,t.q=s):t.doctype+=s;continue;case o.DOCTYPE_DTD_QUOTED:t.doctype+=s,s===t.q&&(t.state=o.DOCTYPE_DTD,t.q="");continue;case o.COMMENT:s==="-"?t.state=o.COMMENT_ENDING:t.comment+=s;continue;case o.COMMENT_ENDING:s==="-"?(t.state=o.COMMENT_ENDED,t.comment=Et(t.opt,t.comment),t.comment&&N(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+s,t.state=o.COMMENT);continue;case o.COMMENT_ENDED:s!==">"?(R(t,"Malformed comment"),t.comment+="--"+s,t.state=o.COMMENT):t.doctype&&t.doctype!==!0?t.state=o.DOCTYPE_DTD:t.state=o.TEXT;continue;case o.CDATA:s==="]"?t.state=o.CDATA_ENDING:t.cdata+=s;continue;case o.CDATA_ENDING:s==="]"?t.state=o.CDATA_ENDING_2:(t.cdata+="]"+s,t.state=o.CDATA);continue;case o.CDATA_ENDING_2:s===">"?(t.cdata&&N(t,"oncdata",t.cdata),N(t,"onclosecdata"),t.cdata="",t.state=o.TEXT):s==="]"?t.cdata+="]":(t.cdata+="]]"+s,t.state=o.CDATA);continue;case o.PROC_INST:s==="?"?t.state=o.PROC_INST_ENDING:C(s)?t.state=o.PROC_INST_BODY:t.procInstName+=s;continue;case o.PROC_INST_BODY:if(!t.procInstBody&&C(s))continue;s==="?"?t.state=o.PROC_INST_ENDING:t.procInstBody+=s;continue;case o.PROC_INST_ENDING:s===">"?(N(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=o.TEXT):(t.procInstBody+="?"+s,t.state=o.PROC_INST_BODY);continue;case o.OPEN_TAG:D(X,s)?t.tagName+=s:(hr(t),s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:(C(s)||R(t,"Invalid character in tag name"),t.state=o.ATTRIB));continue;case o.OPEN_TAG_SLASH:s===">"?(de(t,!0),Ge(t)):(R(t,"Forward-slash in opening tag not followed by >"),t.state=o.ATTRIB);continue;case o.ATTRIB:if(C(s))continue;s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:D(W,s)?(t.attribName=s,t.attribValue="",t.state=o.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case o.ATTRIB_NAME:s==="="?t.state=o.ATTRIB_VALUE:s===">"?(R(t,"Attribute without value"),t.attribValue=t.attribName,ze(t),de(t)):C(s)?t.state=o.ATTRIB_NAME_SAW_WHITE:D(X,s)?t.attribName+=s:R(t,"Invalid attribute name");continue;case o.ATTRIB_NAME_SAW_WHITE:if(s==="=")t.state=o.ATTRIB_VALUE;else{if(C(s))continue;R(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",N(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",s===">"?de(t):D(W,s)?(t.attribName=s,t.state=o.ATTRIB_NAME):(R(t,"Invalid attribute name"),t.state=o.ATTRIB)}continue;case o.ATTRIB_VALUE:if(C(s))continue;F(s)?(t.q=s,t.state=o.ATTRIB_VALUE_QUOTED):(t.opt.unquotedAttributeValues||ge(t,"Unquoted attribute value"),t.state=o.ATTRIB_VALUE_UNQUOTED,t.attribValue=s);continue;case o.ATTRIB_VALUE_QUOTED:if(s!==t.q){s==="&"?t.state=o.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=s;continue}ze(t),t.q="",t.state=o.ATTRIB_VALUE_CLOSED;continue;case o.ATTRIB_VALUE_CLOSED:C(s)?t.state=o.ATTRIB:s===">"?de(t):s==="/"?t.state=o.OPEN_TAG_SLASH:D(W,s)?(R(t,"No whitespace between attributes"),t.attribName=s,t.attribValue="",t.state=o.ATTRIB_NAME):R(t,"Invalid attribute name");continue;case o.ATTRIB_VALUE_UNQUOTED:if(!M(s)){s==="&"?t.state=o.ATTRIB_VALUE_ENTITY_U:t.attribValue+=s;continue}ze(t),s===">"?de(t):t.state=o.ATTRIB;continue;case o.CLOSE_TAG:if(t.tagName)s===">"?Ge(t):D(X,s)?t.tagName+=s:t.script?(t.script+=""?Ge(t):R(t,"Invalid characters in closing tag");continue;case o.TEXT_ENTITY:case o.ATTRIB_VALUE_ENTITY_Q:case o.ATTRIB_VALUE_ENTITY_U:var z,Q;switch(t.state){case o.TEXT_ENTITY:z=o.TEXT,Q="textNode";break;case o.ATTRIB_VALUE_ENTITY_Q:z=o.ATTRIB_VALUE_QUOTED,Q="attribValue";break;case o.ATTRIB_VALUE_ENTITY_U:z=o.ATTRIB_VALUE_UNQUOTED,Q="attribValue";break}if(s===";"){var Z=fr(t);t.opt.unparsedEntities&&!Object.values(i.XML_ENTITIES).includes(Z)?(t.entity="",t.state=z,t.write(Z)):(t[Q]+=Z,t.entity="",t.state=z)}else D(t.entity.length?J:te,s)?t.entity+=s:(R(t,"Invalid character in entity name"),t[Q]+="&"+t.entity+s,t.entity="",t.state=z);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&c(t),t}String.fromCodePoint||(function(){var a=String.fromCharCode,t=Math.floor,h=function(){var s=16384,L=[],U,z,Q=-1,Z=arguments.length;if(!Z)return"";for(var he="";++Q1114111||t(j)!==j)throw RangeError("Invalid code point: "+j);j<=65535?L.push(j):(j-=65536,U=(j>>10)+55296,z=j%1024+56320,L.push(U,z)),(Q+1===Z||L.length>s)&&(he+=a.apply(null,L),L.length=0)}return he};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:h,configurable:!0,writable:!0}):String.fromCodePoint=h})()})(e)})(Ht)),Ht}ji();var Se=(e=>(e.ReservedName="reserved name",e.Character="character",e.Extension="extension",e))(Se||{});class Ee extends Error{constructor(i){super(`Invalid ${i.reason} '${i.segment}' in filename '${i.filename}'`,{cause:i})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function Hi(e){const i=Ur().files,r=i.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const u of r)if(e.includes(u))throw new Ee({segment:u,reason:"character",filename:e});if(e=e.toLocaleLowerCase(),(i.forbidden_filenames??[".htaccess"]).includes(e))throw new Ee({filename:e,segment:e,reason:"reserved name"});const n=e.indexOf(".",1),c=e.substring(0,n===-1?void 0:n);if((i.forbidden_filename_basenames??[]).includes(c))throw new Ee({filename:e,segment:c,reason:"reserved name"});const m=i.forbidden_filename_extensions??[".part",".filepart"];for(const u of m)if(e.length>u.length&&e.endsWith(u))throw new Ee({segment:u,reason:"extension",filename:e})}const rt=["B","KB","MB","GB","TB","PB"],it=["B","KiB","MiB","GiB","TiB","PiB"];function Wi(e,i=!1,r=!1,n=!1){r=r&&!n,typeof e=="string"&&(e=Number(e));let c=e>0?Math.floor(Math.log(e)/Math.log(n?1e3:1024)):0;c=Math.min((r?it.length:rt.length)-1,c);const m=r?it[c]:rt[c];let u=(e/Math.pow(n?1e3:1024,c)).toFixed(1);return i===!0&&c===0?(u!=="0.0"?"< 1 ":"0 ")+(r?it[1]:rt[1]):(c<2?u=parseFloat(u).toFixed(0):u=parseFloat(u).toLocaleString(er()),u+" "+m)}function qt(e){return e instanceof Date?e.toISOString():String(e)}function qi(e,i,r){i=i??[m=>m],r=r??[];const n=i.map((m,u)=>(r[u]??"asc")==="asc"?1:-1),c=Intl.Collator([jr(),er()],{numeric:!0,usage:"sort"});return[...e].sort((m,u)=>{for(const[f,d]of i.entries()){const p=c.compare(qt(d(m)),qt(d(u)));if(p!==0)return p*n[f]}return 0})}function Yi(e,i={}){const r={sortingMode:"basename",sortingOrder:"asc",...i};function n(u){const f=u.displayname||u.attributes?.displayname||u.basename||"";return u.type===le.Folder?f:f.lastIndexOf(".")>0?f.slice(0,f.lastIndexOf(".")):f}const c=[...r.sortFavoritesFirst?[u=>u.attributes?.favorite!==1]:[],...r.sortFoldersFirst?[u=>u.type!=="folder"]:[],...r.sortingMode!=="basename"?[u=>u[r.sortingMode]??u.attributes[r.sortingMode]]:[],u=>n(u),u=>u.basename],m=[...r.sortFavoritesFirst?["asc"]:[],...r.sortFoldersFirst?["asc"]:[],...r.sortingMode==="mtime"?[r.sortingOrder==="asc"?"desc":"asc"]:[],...r.sortingMode!=="mtime"&&r.sortingMode!=="basename"?[r.sortingOrder]:[],r.sortingOrder,r.sortingOrder];return qi(e,c,m)}const Qi=new ti({concurrency:5});function Zi(e){const{resolve:i,promise:r}=Promise.withResolvers();return Qi.add(()=>{const n=new Image;return n.onerror=()=>i(!1),n.onload=()=>i(!0),n.src=e,r}),r}function Ki(e,i={}){i={size:32,cropPreview:!1,mimeFallback:!0,...i};try{const r=e.attributes?.previewUrl||ut("/core/preview?fileId={fileid}",{fileid:e.fileid});let n;try{n=new URL(r)}catch{n=new URL(r,window.location.origin)}return n.searchParams.set("x",`${i.size}`),n.searchParams.set("y",`${i.size}`),n.searchParams.set("mimeFallback",`${i.mimeFallback}`),n.searchParams.set("a",i.cropPreview===!0?"0":"1"),n.searchParams.set("c",`${e.attributes.etag}`),n}catch{return null}}function Ji(e,i){const r=P(null),n=P(!1);return Er(()=>{n.value=!1,r.value=Ki(_e(e),_e(i||{})),r.value&&_e(e).type===le.File&&Zi(r.value.href).then(c=>{n.value=c})}),{previewURL:r,previewLoaded:n}}const K=(e,i)=>{const r=e.__vccOpts||e;for(const[n,c]of i)r[n]=c;return r},ea={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ta=["aria-hidden","aria-label"],ra=["fill","width","height"],ia={d:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"},aa={key:0};function na(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon file-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",ia,[r.title?(g(),b("title",aa,x(r.title),1)):G("",!0)])],8,ra))],16,ta)}const ot=K(ea,[["render",na]]),sa={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},oa=["aria-hidden","aria-label"],la=["fill","width","height"],ca={d:"M7,10L12,15L17,10H7Z"},ua={key:0};function da(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon menu-down-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",ca,[r.title?(g(),b("title",ua,x(r.title),1)):G("",!0)])],8,la))],16,oa)}const at=K(sa,[["render",da]]),pa={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ma=["aria-hidden","aria-label"],ha=["fill","width","height"],fa={d:"M7,15L12,10L17,15H7Z"},ga={key:0};function va(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon menu-up-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",fa,[r.title?(g(),b("title",ga,x(r.title),1)):G("",!0)])],8,ha))],16,ma)}const nt=K(pa,[["render",va]]),Ea={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ba=["aria-hidden","aria-label"],_a=["fill","width","height"],wa={d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"},ya={key:0};function Ta(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon folder-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",wa,[r.title?(g(),b("title",ya,x(r.title),1)):G("",!0)])],8,_a))],16,ba)}const dr=K(Ea,[["render",Ta]]),pr={"file-picker__file-icon":"_file-picker__file-icon_3v9zx_9","file-picker__file-icon--primary":"_file-picker__file-icon--primary_3v9zx_21","file-picker__file-icon-overlay":"_file-picker__file-icon-overlay_3v9zx_25"},Ia=me({__name:"FilePreview",props:{node:{},cropImagePreviews:{type:Boolean}},setup(e){const i=e,r=P(pr),{previewURL:n,previewLoaded:c}=Ji(Zt(i,"node"),O(()=>({cropPreview:i.cropImagePreviews}))),m=O(()=>i.node.type===le.File),u=O(()=>{if(i.node.type!==le.Folder)return null;if(i.node.attributes?.["is-encrypted"]===1)return Qr;if(i.node.attributes?.["is-tag"])return Zr;const f=Object.values(i.node.attributes?.["share-types"]||{}).flat();if(f.some(d=>d===Ot.Link||d===Ot.Email))return Kr;if(f.length>0)return Rt;switch(i.node.attributes?.["mount-type"]){case"external":case"external-session":return ei;case"group":return Jr;case"shared":return Rt}return null});return(f,d)=>(g(),b("div",{style:Ir(w(c)?{backgroundImage:`url(${w(n)})`}:void 0),class:fe(r.value["file-picker__file-icon"])},[w(c)?G("",!0):(g(),b(oe,{key:0},[m.value?(g(),B(ot,{key:0,size:32})):(g(),b(oe,{key:1},[u.value?(g(),B(w(tr),{key:0,class:fe(r.value["file-picker__file-icon-overlay"]),inline:"",path:u.value,size:16},null,8,["class","path"])):G("",!0),$(dr,{class:fe(r.value["file-picker__file-icon--primary"]),size:32},null,8,["class"])],64))],64))],6))}}),Na=["tabindex","aria-selected","data-filename"],Aa={class:"row-name"},Ca={class:"file-picker__name-container","data-testid":"row-name"},La=["title","textContent"],Da=["textContent"],Ra={class:"row-size"},Oa={class:"row-modified"},Sa=me({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:{},cropImagePreviews:{type:Boolean}},emits:["update:selected","enterDirectory"],setup(e,{emit:i}){const r=e,n=i,c=O(()=>r.node.mtime??0),m=O(()=>Kt(r.node.displayname)),u=O(()=>r.node.displayname.slice(0,m.value?-m.value.length:void 0)),f=O(()=>r.node.type===le.Folder),d=O(()=>r.canPick&&(r.allowPickDirectory||!f.value)),p=O(()=>(r.node.permissions&ee.READ)===ee.READ);function l(){d.value&&n("update:selected",!r.selected)}function v(){f.value?p.value&&n("enterDirectory",r.node):l()}function E(I){I.key==="Enter"&&v()}return(I,V)=>(g(),b("tr",re({tabindex:e.showCheckbox&&!f.value?void 0:0,"aria-selected":d.value?e.selected:void 0,class:["file-picker__row",[{"file-picker__row--selected":e.selected&&!e.showCheckbox,"file-picker__row--not-navigatable":f.value&&!p.value,"file-picker__row--not-pickable":!d.value}]],"data-filename":e.node.basename,"data-testid":"file-list-row"},Tr({click:v,...!e.showCheckbox||f.value?{keydown:E}:{}},!0)),[e.showCheckbox?(g(),b("td",{key:0,class:"row-checkbox",onClick:Re(()=>{},["stop"])},[$(w(rr),{"aria-label":w(A)("Select the row for {nodename}",{nodename:u.value}),disabled:!d.value,"data-testid":"row-checkbox","model-value":e.selected,"onUpdate:modelValue":l},null,8,["aria-label","disabled","model-value"])])):G("",!0),T("td",Aa,[T("div",Ca,[$(Ia,{node:e.node,"crop-image-previews":e.cropImagePreviews},null,8,["node","crop-image-previews"]),T("div",{class:"file-picker__file-name",title:u.value,textContent:x(u.value)},null,8,La),T("div",{class:"file-picker__file-extension",textContent:x(m.value)},null,8,Da)])]),T("td",Ra,x(w(Wi)(e.node.size||0)),1),T("td",Oa,[$(w(Hr),{timestamp:c.value,"ignore-seconds":""},null,8,["timestamp"])])],16,Na))}}),ka=K(Sa,[["__scopeId","data-v-2af740c4"]]),Fa={"aria-hidden":"true",class:"file-picker__row loading-row"},$a={key:0,class:"row-checkbox"},Pa={class:"row-name"},Ba={class:"row-wrapper"},xa=me({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup(e){return(i,r)=>(g(),b("tr",Fa,[e.showCheckbox?(g(),b("td",$a,[...r[0]||(r[0]=[T("span",null,null,-1)])])):G("",!0),T("td",Pa,[T("div",Ba,[T("span",{class:fe(w(pr)["file-picker__file-icon"])},null,2),r[1]||(r[1]=T("span",null,null,-1))])]),r[2]||(r[2]=T("td",{class:"row-size"},[T("span")],-1)),r[3]||(r[3]=T("td",{class:"row-modified"},[T("span")],-1))]))}}),Ma=K(xa,[["__scopeId","data-v-1f96131b"]]);function mr(){const e=Jt("files","config",null),i=P(e?.show_hidden??!0),r=P(e?.sort_favorites_first??!0),n=P(e?.crop_image_previews??!0);return Ie(async()=>{if(Ne())ye.debug("Skip loading files settings - currently on public share");else try{const{data:c}=await ir.get(ut("/apps/files/api/v1/configs"));i.value=c?.data?.show_hidden??!1,r.value=c?.data?.sort_favorites_first??!0,n.value=c?.data?.crop_image_previews??!0}catch(c){ye.error("Could not load files settings",{error:c}),ct(A("Could not load files settings"))}}),{showHiddenFiles:i,sortFavoritesFirst:r,cropImagePreviews:n}}function Ua(e){const i=p=>p==="asc"?"ascending":p==="desc"?"descending":"none",r=Jt("files","viewConfigs",null),n=P({sortBy:r?.files?.sorting_mode??"basename",order:i(r?.files?.sorting_direction??"asc")}),c=P({sortBy:r?.recent?.sorting_mode??"basename",order:i(r?.recent?.sorting_direction??"asc")}),m=P({sortBy:r?.favorites?.sorting_mode??"basename",order:i(r?.favorites?.sorting_direction??"asc")});Ie(async()=>{if(Ne())ye.debug("Skip loading files views - currently on public share");else try{const{data:p}=await ir.get(ut("/apps/files/api/v1/views"));n.value={sortBy:p?.data?.files?.sorting_mode??"basename",order:i(p?.data?.files?.sorting_direction)},m.value={sortBy:p?.data?.favorites?.sorting_mode??"basename",order:i(p?.data?.favorites?.sorting_direction)},c.value={sortBy:p?.data?.recent?.sorting_mode??"basename",order:i(p?.data?.recent?.sorting_direction)}}catch(p){ye.error("Could not load files views",{error:p}),ct(A("Could not load files views"))}});const u=O(()=>_e(e||"files")==="files"?n.value:_e(e)==="recent"?c.value:m.value),f=O(()=>u.value.sortBy),d=O(()=>u.value.order);return{filesViewConfig:n,favoritesViewConfig:m,recentViewConfig:c,currentConfig:u,sortBy:f,order:d}}const za={key:0,class:"row-checkbox"},Ga={class:"hidden-visually"},Va=["aria-sort"],Xa={class:"header-wrapper"},ja={key:2,style:{width:"44px"}},Ha=["aria-sort"],Wa={key:2,style:{width:"44px"}},qa=["aria-sort"],Ya={key:2,style:{width:"44px"}},Qa=me({__name:"FileList",props:_r({currentView:{},multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:{},canPick:{type:Function}},{path:{required:!0},pathModifiers:{},selectedFiles:{required:!0},selectedFilesModifiers:{}}),emits:["update:path","update:selectedFiles"],setup(e){const i=Nt(e,"path"),r=Nt(e,"selectedFiles"),n=e,c=P(),{currentConfig:m}=Ua(n.currentView),u=O(()=>c.value??m.value),f=O(()=>u.value.sortBy==="basename"?u.value.order==="none"?void 0:u.value.order:void 0),d=O(()=>u.value.sortBy==="size"?u.value.order==="none"?void 0:u.value.order:void 0),p=O(()=>u.value.sortBy==="mtime"?u.value.order==="none"?void 0:u.value.order:void 0);function l(F){u.value.sortBy===F?u.value.order==="ascending"?c.value={sortBy:u.value.sortBy,order:"descending"}:c.value={sortBy:u.value.sortBy,order:"ascending"}:c.value={sortBy:F,order:"ascending"}}const{sortFavoritesFirst:v,cropImagePreviews:E}=mr(),I=O(()=>Yi(n.files,{sortFoldersFirst:!0,sortFavoritesFirst:v.value,sortingOrder:u.value.order==="descending"?"desc":"asc",sortingMode:u.value.sortBy})),V=O(()=>n.files.filter(F=>n.allowPickDirectory||F.type!==le.Folder)),_=O(()=>!n.loading&&r.value.length>0&&r.value.length>=V.value.length);function W(){r.value.lengthM.path!==F.path):n.multiselect?r.value=[...r.value,F]:r.value=[F]}function te(F){i.value=F.path}const J=P(4),C=P();{const F=()=>wr(()=>{const M=C.value?.parentElement?.children||[];let D=C.value?.parentElement?.clientHeight||450;for(let ae=0;ae{window.addEventListener("resize",F),F()}),yr(()=>{window.removeEventListener("resize",F)})}return(F,M)=>(g(),b("div",{ref_key:"fileContainer",ref:C,class:"file-picker__files"},[T("table",null,[T("thead",null,[T("tr",null,[e.multiselect?(g(),b("th",za,[T("span",Ga,x(w(A)("Select entry")),1),e.multiselect?(g(),B(w(rr),{key:0,"aria-label":w(A)("Select all entries"),"data-testid":"select-all-checkbox","model-value":_.value,"onUpdate:modelValue":W},null,8,["aria-label","model-value"])):G("",!0)])):G("",!0),T("th",{"aria-sort":f.value,class:"row-name"},[T("div",Xa,[M[3]||(M[3]=T("span",{class:"file-picker__header-preview"},null,-1)),$(w(we),{"data-test":"file-picker_sort-name",variant:"tertiary",wide:"",onClick:M[0]||(M[0]=D=>l("basename"))},{icon:k(()=>[f.value==="ascending"?(g(),B(nt,{key:0,size:20})):f.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",ja))]),default:k(()=>[be(" "+x(w(A)("Name")),1)]),_:1})])],8,Va),T("th",{"aria-sort":d.value,class:"row-size"},[$(w(we),{variant:"tertiary",wide:"",onClick:M[1]||(M[1]=D=>l("size"))},{icon:k(()=>[d.value==="ascending"?(g(),B(nt,{key:0,size:20})):d.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",Wa))]),default:k(()=>[be(" "+x(w(A)("Size")),1)]),_:1})],8,Ha),T("th",{"aria-sort":p.value,class:"row-modified"},[$(w(we),{variant:"tertiary",wide:"",onClick:M[2]||(M[2]=D=>l("mtime"))},{icon:k(()=>[p.value==="ascending"?(g(),B(nt,{key:0,size:20})):p.value==="descending"?(g(),B(at,{key:1,size:20})):(g(),b("span",Ya))]),default:k(()=>[be(" "+x(w(A)("Modified")),1)]),_:1})],8,qa)])]),T("tbody",null,[e.loading?(g(!0),b(oe,{key:0},ke(J.value,D=>(g(),B(Ma,{key:D,"show-checkbox":e.multiselect},null,8,["show-checkbox"]))),128)):(g(!0),b(oe,{key:1},ke(I.value,D=>(g(),B(ka,{key:D.fileid||D.path,"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":(e.multiselect||r.value.length===0||r.value.includes(D))&&(e.canPick===void 0||e.canPick(D)),selected:r.value.includes(D),node:D,"crop-image-previews":w(E),"onUpdate:selected":ae=>X(D),onEnterDirectory:te},null,8,["allow-pick-directory","show-checkbox","can-pick","selected","node","crop-image-previews","onUpdate:selected"]))),128))])])],512))}}),Za=K(Qa,[["__scopeId","data-v-68ec5c33"]]),Ka={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ja=["aria-hidden","aria-label"],en=["fill","width","height"],tn={d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},rn={key:0};function an(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon home-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",tn,[r.title?(g(),b("title",rn,x(r.title),1)):G("",!0)])],8,en))],16,Ja)}const nn=K(Ka,[["render",an]]),sn={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},on=["aria-hidden","aria-label"],ln=["fill","width","height"],cn={d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},un={key:0};function dn(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon plus-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",cn,[r.title?(g(),b("title",un,x(r.title),1)):G("",!0)])],8,ln))],16,on)}const pn=K(sn,[["render",dn]]),mn=me({__name:"FilePickerBreadcrumbs",props:{path:{},showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:i}){const r=e,n=i,c=P(!1),m=P(""),u=br("nameInput");function f(){const l=m.value.trim(),v=u.value?.$el?.querySelector("input");let E="";try{Hi(l)}catch(I){if(!(I instanceof Ee))throw I;switch(I.reason){case Se.Character:E=A('"{char}" is not allowed inside a folder name.',{char:I.segment});break;case Se.ReservedName:E=A('"{segment}" is a reserved name and not allowed for folder names.',{segment:I.segment});break;case Se.Extension:E=A('Folder names must not end with "{extension}".',{extension:I.segment});break;default:E=A("Invalid folder name.")}}return v&&v.setCustomValidity(E),E===""}function d(){const l=m.value.trim();f()&&(c.value=!1,n("create-node",l),m.value="")}const p=O(()=>r.path.split("/").filter(l=>l!=="").map((l,v,E)=>({name:l,path:"/"+E.slice(0,v+1).join("/")})));return(l,v)=>(g(),B(w(yi),{class:"file-picker__breadcrumbs"},Yt({default:k(()=>[$(w(Fe),{name:w(A)("All files"),title:w(A)("Home"),onClick:v[0]||(v[0]=E=>n("update:path","/"))},{icon:k(()=>[$(nn,{size:20})]),_:1},8,["name","title"]),(g(!0),b(oe,null,ke(p.value,E=>(g(),B(w(Fe),{key:E.path,name:E.name,title:E.path,onClick:I=>n("update:path",E.path)},null,8,["name","title","onClick"]))),128))]),_:2},[e.showMenu?{name:"actions",fn:k(()=>[$(w(lt),{open:c.value,"onUpdate:open":v[2]||(v[2]=E=>c.value=E),"aria-label":w(A)("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":w(A)("New"),variant:"secondary",onClose:v[3]||(v[3]=E=>m.value="")},{icon:k(()=>[$(pn,{size:20})]),default:k(()=>[$(w(ri),{ref_key:"nameInput",ref:u,modelValue:m.value,"onUpdate:modelValue":[v[1]||(v[1]=E=>m.value=E),f],label:w(A)("New folder"),placeholder:w(A)("New folder name"),onSubmit:d},{icon:k(()=>[$(dr,{size:20})]),_:1},8,["modelValue","label","placeholder"])]),_:1},8,["open","aria-label","menu-name"])]),key:"0"}:void 0]),1024))}}),hn=K(mn,[["__scopeId","data-v-4ce40fd0"]]),fn={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gn=["aria-hidden","aria-label"],vn=["fill","width","height"],En={d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},bn={key:0};function _n(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon close-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",En,[r.title?(g(),b("title",bn,x(r.title),1)):G("",!0)])],8,vn))],16,gn)}const wn=K(fn,[["render",_n]]),yn={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Tn=["aria-hidden","aria-label"],In=["fill","width","height"],Nn={d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"},An={key:0};function Cn(e,i,r,n,c,m){return g(),b("span",re(e.$attrs,{"aria-hidden":r.title?null:"true","aria-label":r.title,class:"material-design-icon magnify-icon",role:"img",onClick:i[0]||(i[0]=u=>e.$emit("click",u))}),[(g(),b("svg",{fill:r.fillColor,class:"material-design-icon__svg",width:r.size,height:r.size,viewBox:"0 0 24 24"},[T("path",Nn,[r.title?(g(),b("title",An,x(r.title),1)):G("",!0)])],8,In))],16,Tn)}const Ln=K(yn,[["render",Cn]]);function Dn(e){const i=[{id:"files",label:A("All files"),icon:Wr},{id:"recent",label:A("Recent"),icon:qr},{id:"favorites",label:A("Favorites"),icon:Yr}],r=e.value?i.filter(({id:n})=>n==="files"):i;return{allViews:i,availableViews:r}}const Rn={key:0,class:"file-picker__side"},On=me({__name:"FilePickerNavigation",props:{currentView:{},filterString:{},isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:i}){const r=e,n=i,{availableViews:c}=Dn(P($e()===null)),m=O(()=>c.filter(f=>f.id===r.currentView)[0]??c[0]),u=f=>n("update:filterString",f.toString());return(f,d)=>(g(),b(oe,null,[$(w(ai),{class:"file-picker__filter-input",label:w(A)("Filter file list"),"show-trailing-button":!!e.filterString,"model-value":e.filterString,"onUpdate:modelValue":u,onTrailingButtonClick:d[0]||(d[0]=p=>u(""))},{"trailing-button-icon":k(()=>[$(wn,{size:16})]),default:k(()=>[$(Ln,{size:16})]),_:1},8,["label","show-trailing-button","model-value"]),w(c).length>1&&!e.disabledNavigation?(g(),b(oe,{key:0},[e.isCollapsed?(g(),B(w(ii),{key:1,"aria-label":w(A)("Current view selector"),clearable:!1,searchable:!1,options:w(c),"model-value":m.value,"onUpdate:modelValue":d[1]||(d[1]=p=>n("update:currentView",p.id))},null,8,["aria-label","options","model-value"])):(g(),b("ul",Rn,[(g(!0),b(oe,null,ke(w(c),p=>(g(),b("li",{key:p.id},[$(w(we),{variant:e.currentView===p.id?"primary":"tertiary",wide:!0,onClick:l=>f.$emit("update:currentView",p.id)},{icon:k(()=>[$(w(tr),{path:p.icon,size:20},null,8,["path"])]),default:k(()=>[be(" "+x(p.label),1)]),_:2},1032,["variant","onClick"])]))),128))]))],64)):G("",!0)],64))}}),Sn=K(On,[["__scopeId","data-v-b91fd905"]]);function kn(e){const i=new AbortController,r=Math.round(Date.now()/1e3)-3600*24*14;return new ie(async(n,c,m)=>{m(()=>i.abort());try{const{data:u}=await e.search("/",{signal:i.signal,details:!0,data:Si(r)}),f=u.results.map(d=>Me(d));n(f)}catch(u){c(u)}})}function Fn(e,i){const r=new AbortController;return new ie(async(n,c,m)=>{m(()=>r.abort());try{const u=(await e.getDirectoryContents(Te(Ae,i),{signal:r.signal,details:!0,includeSelf:!0,data:sr()})).data.map(f=>Me(f));n({contents:u.filter(({path:f})=>f!==i),folder:u.find(({path:f})=>f===i)})}catch(u){c(u)}})}async function $n(e,i){const{data:r}=await e.stat(Te(Ae,i),{details:!0,data:sr()});return Me(r)}function Pn(e,i){const r=$i(),n=st([]),c=st(null),m=P(!0),u=P(null);async function f(p){const l=Te(i.value,p);await r.createDirectory(Te(Ae,l));const v=await $n(r,l);return n.value=[...n.value,v],v}async function d(){u.value&&u.value.cancel(),m.value=!0,e.value==="favorites"?u.value=Pi(r,i.value):e.value==="recent"?u.value=kn(r):u.value=Fn(r,i.value);const p=await u.value;if(p)"folder"in p?(c.value=p.folder,n.value=p.contents):(c.value=null,n.value=p);else return;u.value=null,m.value=!1}return Qt([e,i],()=>d()),Ie(()=>d()),{isLoading:m,files:n,folder:c,loadFiles:d,createDirectory:f}}function Bn(e){const i=O(()=>e.value.map(r=>r.split("/")));return{isSupportedMimeType:r=>{const n=r.split("/");return i.value.some(([c,m])=>(n[0]===c||c==="*")&&(n[1]===m||m==="*"))}}}const xn={class:"file-picker__main"},Mn={key:1,class:"file-picker__view"},Un=me({__name:"FilePicker",props:{buttons:{},name:{},allowPickDirectory:{type:Boolean,default:!1},noMenu:{type:Boolean,default:!1},disabledNavigation:{type:Boolean,default:!1},filterFn:{type:Function,default:void 0},canPickFn:{type:Function,default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!1},path:{default:void 0}},emits:["close"],setup(e,{emit:i}){const r=e,n=i,c=P(!0),m=P("files"),u=P(window?.sessionStorage.getItem("NC.FilePicker.LastPath")||"/"),f=P(""),d=O({get:()=>m.value==="files"?f.value||r.path||u.value:"/",set:S=>{f.value=S}}),p=st([]),{files:l,folder:v,isLoading:E,loadFiles:I,createDirectory:V}=Pn(m,d);Qt([f],()=>{r.path===void 0&&f.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",f.value),p.value=[]});let _=!1;const W=O(()=>{const S=p.value.length===0&&r.allowPickDirectory&&v.value?[v.value]:p.value;return(typeof r.buttons=="function"?r.buttons(S,d.value,m.value):r.buttons).map(y=>({...y,disabled:y.disabled||E.value,callback:()=>{_=!0,X(y.callback,S)}}))});async function X(S,y){await S(y),n("close",y),_=!1}const te=O(()=>m.value==="favorites"?A("Favorites"):m.value==="recent"?A("Recent"):""),J=P(""),{isSupportedMimeType:C}=Bn(Zt(r,"mimetypeFilter"));Ie(()=>I());const{showHiddenFiles:F}=mr(),M=O(()=>{let S=l.value;return F.value||(S=S.filter(y=>!y.basename.startsWith("."))),r.mimetypeFilter.length>0&&(S=S.filter(y=>y.type==="folder"||y.mime&&C(y.mime))),J.value&&(S=S.filter(y=>y.basename.toLowerCase().includes(J.value.toLowerCase()))),r.filterFn&&(S=S.filter(y=>r.filterFn(y))),S}),D=O(()=>m.value==="files"?A("Upload some content or sync with your devices!"):m.value==="recent"?A("Files and folders you recently modified will show up here."):A("Files and folders you mark as favorite will show up here."));async function ae(S){try{const y=await V(S);f.value=y.path,kr("files:node:created",l.value.filter(N=>N.basename===S)[0])}catch(y){ye.warn("Could not create new folder",{name:S,error:y}),ct(A("Could not create the new folder"))}}function o(S){!S&&!_&&n("close")}return(S,y)=>(g(),B(w($r),{open:c.value,"onUpdate:open":[y[6]||(y[6]=N=>c.value=N),o],buttons:W.value,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation"},{navigation:k(({isCollapsed:N})=>[$(Sn,{"current-view":m.value,"onUpdate:currentView":y[0]||(y[0]=ne=>m.value=ne),"filter-string":J.value,"onUpdate:filterString":y[1]||(y[1]=ne=>J.value=ne),"is-collapsed":N,"disabled-navigation":e.disabledNavigation},null,8,["current-view","filter-string","is-collapsed","disabled-navigation"])]),default:k(()=>[T("div",xn,[m.value==="files"?(g(),B(hn,{key:0,path:d.value,"onUpdate:path":y[2]||(y[2]=N=>d.value=N),"show-menu":!e.noMenu,onCreateNode:ae},null,8,["path","show-menu"])):(g(),b("div",Mn,[T("h3",null,x(te.value),1)])),w(E)||M.value.length>0?(g(),B(Za,{key:2,path:d.value,"onUpdate:path":[y[3]||(y[3]=N=>d.value=N),y[5]||(y[5]=N=>m.value="files")],"selected-files":p.value,"onUpdate:selectedFiles":y[4]||(y[4]=N=>p.value=N),"allow-pick-directory":e.allowPickDirectory,"current-view":m.value,files:M.value,multiselect:e.multiselect,loading:w(E),name:te.value,"can-pick":e.canPickFn},null,8,["path","selected-files","allow-pick-directory","current-view","files","multiselect","loading","name","can-pick"])):J.value?(g(),B(w(At),{key:3,name:w(A)("No matching files"),description:w(A)("No files matching your filter were found.")},{icon:k(()=>[$(ot)]),_:1},8,["name","description"])):(g(),B(w(At),{key:4,name:w(A)("No files in here"),description:D.value},{icon:k(()=>[$(ot)]),_:1},8,["name","description"]))])]),_:1},8,["open","buttons","name"]))}}),os=K(Un,[["__scopeId","data-v-303416d3"]]);export{os as default}; +//# sourceMappingURL=FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.map diff --git a/dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.license b/dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.license similarity index 100% rename from dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.license rename to dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.license diff --git a/dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.map b/dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.map similarity index 72% rename from dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.map rename to dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.map index a2a8d4b4980ee..a7db9671f92cd 100644 --- a/dist/FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs.map +++ b/dist/FilePicker-W-IYpVkn-BYPHbfcD.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"FilePicker-W-IYpVkn-Ca41jN7j.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcBreadcrumb-Bwkn3eve.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcBreadcrumbs-PN5_hHQn.mjs","../node_modules/cancelable-promise/esm/CancelablePromise.mjs","../node_modules/@nextcloud/dialogs/node_modules/@nextcloud/files/dist/chunks/dav-Rt1kTtvI.mjs","../node_modules/@nextcloud/dialogs/node_modules/@nextcloud/files/dist/index.mjs","../node_modules/@nextcloud/dialogs/dist/chunks/preview-BIbJGxXF.mjs","../node_modules/@nextcloud/dialogs/dist/chunks/_plugin-vue_export-helper-1tPrXgE0.mjs","../node_modules/@nextcloud/dialogs/dist/chunks/FilePicker-W-IYpVkn.mjs"],"sourcesContent":["import '../assets/NcBreadcrumb-CHjeSh0y.css';\nimport { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, resolveComponent, withModifiers, normalizeClass, createBlock, createVNode, createSlots, withCtx, renderSlot, createTextVNode } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nimport { N as NcButton } from \"./NcButton-Dc8V4Urj.mjs\";\nimport { c as createElementId } from \"./createElementId-DhjFt1I9.mjs\";\nimport { N as NcActions } from \"./NcActions-DWmvh7-Y.mjs\";\nconst _sfc_main$1 = {\n name: \"ChevronRightIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nconst _hoisted_1$1 = [\"aria-hidden\", \"aria-label\"];\nconst _hoisted_2 = [\"fill\", \"width\", \"height\"];\nconst _hoisted_3 = { d: \"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z\" };\nconst _hoisted_4 = { key: 0 };\nfunction _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps(_ctx.$attrs, {\n \"aria-hidden\": $props.title ? null : \"true\",\n \"aria-label\": $props.title,\n class: \"material-design-icon chevron-right-icon\",\n role: \"img\",\n onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit(\"click\", $event))\n }), [\n (openBlock(), createElementBlock(\"svg\", {\n fill: $props.fillColor,\n class: \"material-design-icon__svg\",\n width: $props.size,\n height: $props.size,\n viewBox: \"0 0 24 24\"\n }, [\n createElementVNode(\"path\", _hoisted_3, [\n $props.title ? (openBlock(), createElementBlock(\"title\", _hoisted_4, toDisplayString($props.title), 1)) : createCommentVNode(\"\", true)\n ])\n ], 8, _hoisted_2))\n ], 16, _hoisted_1$1);\n}\nconst ChevronRight = /* @__PURE__ */ _export_sfc(_sfc_main$1, [[\"render\", _sfc_render$1]]);\nconst _sfc_main = {\n name: \"NcBreadcrumb\",\n components: {\n NcActions,\n ChevronRight,\n NcButton\n },\n inheritAttrs: false,\n props: {\n /**\n * The main text content of the entry.\n */\n name: {\n type: String,\n required: true\n },\n /**\n * The title attribute of the element.\n */\n title: {\n type: String,\n default: null\n },\n /**\n * Route Location the link should navigate to when clicked on.\n *\n * @see https://v3.router.vuejs.org/api/#to\n */\n to: {\n type: [String, Object],\n default: void 0\n },\n /**\n * Set this prop if your app doesn't use vue-router, breadcrumbs will show as normal links.\n */\n href: {\n type: String,\n default: void 0\n },\n /**\n * Set a css icon-class to show an icon along name text (if forceIconText is provided, otherwise just icon).\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * Enables text to accompany the icon, if the icon was provided. The text that will be displayed is the name prop.\n */\n forceIconText: {\n type: Boolean,\n default: false\n },\n /**\n * Disable dropping on this breadcrumb.\n */\n disableDrop: {\n type: Boolean,\n default: false\n },\n /**\n * Force the actions to display in a three dot menu\n */\n forceMenu: {\n type: Boolean,\n default: false\n },\n /**\n * Open state of the Actions menu\n */\n open: {\n type: Boolean,\n default: false\n },\n /**\n * CSS class to apply to the root element.\n */\n class: {\n type: [String, Array, Object],\n default: \"\"\n }\n },\n emits: [\n \"dragenter\",\n \"dragleave\",\n \"dropped\",\n \"update:open\"\n ],\n setup() {\n const crumbId = createElementId();\n return {\n actionsContainer: `.vue-crumb[data-crumb-id=\"${crumbId}\"]`,\n crumbId\n };\n },\n data() {\n return {\n /**\n * Variable to track if we hover over the breadcrumb\n */\n hovering: false\n };\n },\n computed: {\n /**\n * The attributes to pass to `router-link` or `a`\n */\n linkAttributes() {\n if (this.to) {\n return { to: this.to, ...this.$attrs };\n } else if (this.href) {\n return { href: this.href, ...this.$attrs };\n }\n return this.$attrs;\n }\n },\n methods: {\n /**\n * Function to handle changing the open state of the Actions menu\n * $emit the open state.\n *\n * @param {boolean} open The open state of the Actions menu\n */\n onOpenChange(open) {\n this.$emit(\"update:open\", open);\n },\n /**\n * Function to handle a drop on the breadcrumb.\n * $emit the event and the path, remove the hovering state.\n *\n * @param {object} e The drop event\n * @return {boolean}\n */\n dropped(e) {\n if (this.disableDrop) {\n return false;\n }\n this.$emit(\"dropped\", e, this.to || this.href);\n this.$parent.$emit(\"dropped\", e, this.to || this.href);\n this.hovering = false;\n return false;\n },\n /**\n * Add the hovering state on drag enter\n *\n * @param {DragEvent} e The drag-enter event\n */\n dragEnter(e) {\n this.$emit(\"dragenter\", e);\n if (this.disableDrop) {\n return;\n }\n this.hovering = true;\n },\n /**\n * Remove the hovering state on drag leave\n *\n * @param {DragEvent} e The drag leave event\n */\n dragLeave(e) {\n this.$emit(\"dragleave\", e);\n if (this.disableDrop) {\n return;\n }\n if (e.target.contains(e.relatedTarget) || this.$refs.crumb.contains(e.relatedTarget)) {\n return;\n }\n this.hovering = false;\n }\n }\n};\nconst _hoisted_1 = [\"data-crumb-id\"];\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_NcButton = resolveComponent(\"NcButton\");\n const _component_NcActions = resolveComponent(\"NcActions\");\n const _component_ChevronRight = resolveComponent(\"ChevronRight\");\n return openBlock(), createElementBlock(\"li\", {\n ref: \"crumb\",\n class: normalizeClass([\"vue-crumb\", [{ \"vue-crumb--hovered\": $data.hovering }, _ctx.$props.class]]),\n \"data-crumb-id\": $setup.crumbId,\n draggable: \"false\",\n onDragstart: withModifiers(() => {\n }, [\"prevent\"]),\n onDrop: _cache[0] || (_cache[0] = withModifiers((...args) => $options.dropped && $options.dropped(...args), [\"prevent\"])),\n onDragover: withModifiers(() => {\n }, [\"prevent\"]),\n onDragenter: _cache[1] || (_cache[1] = (...args) => $options.dragEnter && $options.dragEnter(...args)),\n onDragleave: _cache[2] || (_cache[2] = (...args) => $options.dragLeave && $options.dragLeave(...args))\n }, [\n ($props.name || $props.icon || _ctx.$slots.icon) && !_ctx.$slots.default ? (openBlock(), createBlock(_component_NcButton, mergeProps({\n key: 0,\n \"aria-label\": $props.icon ? $props.name : void 0,\n variant: \"tertiary\"\n }, $options.linkAttributes), createSlots({ _: 2 }, [\n _ctx.$slots.icon || $props.icon ? {\n name: \"icon\",\n fn: withCtx(() => [\n renderSlot(_ctx.$slots, \"icon\", {}, () => [\n createElementVNode(\"span\", {\n class: normalizeClass([$props.icon, \"icon\"])\n }, null, 2)\n ], true)\n ]),\n key: \"0\"\n } : void 0,\n !(_ctx.$slots.icon || $props.icon) || $props.forceIconText ? {\n name: \"default\",\n fn: withCtx(() => [\n createTextVNode(toDisplayString($props.name), 1)\n ]),\n key: \"1\"\n } : void 0\n ]), 1040, [\"aria-label\"])) : createCommentVNode(\"\", true),\n _ctx.$slots.default ? (openBlock(), createBlock(_component_NcActions, {\n key: 1,\n ref: \"actions\",\n container: $setup.actionsContainer,\n \"force-menu\": $props.forceMenu,\n \"force-name\": \"\",\n \"menu-name\": $props.name,\n open: $props.open,\n title: $props.title,\n variant: \"tertiary\",\n \"onUpdate:open\": $options.onOpenChange\n }, {\n icon: withCtx(() => [\n renderSlot(_ctx.$slots, \"menu-icon\", {}, void 0, true)\n ]),\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"default\", {}, void 0, true)\n ]),\n _: 3\n }, 8, [\"container\", \"force-menu\", \"menu-name\", \"open\", \"title\", \"onUpdate:open\"])) : createCommentVNode(\"\", true),\n createVNode(_component_ChevronRight, {\n class: \"vue-crumb__separator\",\n size: 20\n })\n ], 42, _hoisted_1);\n}\nconst NcBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__scopeId\", \"data-v-28ef52a4\"]]);\nexport {\n NcBreadcrumb as N\n};\n//# sourceMappingURL=NcBreadcrumb-Bwkn3eve.mjs.map\n","import '../assets/NcBreadcrumbs-DYfGaSjT.css';\nimport { unsubscribe, subscribe } from \"@nextcloud/event-bus\";\nimport debounce from \"debounce\";\nimport { createElementBlock, openBlock, mergeProps, createElementVNode, createCommentVNode, toDisplayString, Fragment, cloneVNode, h } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nimport { N as NcActions, i as isSlotPopulated } from \"./NcActions-DWmvh7-Y.mjs\";\nimport { N as NcActionButton } from \"./NcActionButton-pKOSrlGE.mjs\";\nimport { N as NcActionLink } from \"./NcActionLink-vEvKSV4N.mjs\";\nimport { N as NcActionRouter } from \"./NcActionRouter-oT-YU_jf.mjs\";\nimport { N as NcBreadcrumb } from \"./NcBreadcrumb-Bwkn3eve.mjs\";\nconst _sfc_main$1 = {\n name: \"FolderIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nconst _hoisted_1 = [\"aria-hidden\", \"aria-label\"];\nconst _hoisted_2 = [\"fill\", \"width\", \"height\"];\nconst _hoisted_3 = { d: \"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\" };\nconst _hoisted_4 = { key: 0 };\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps(_ctx.$attrs, {\n \"aria-hidden\": $props.title ? null : \"true\",\n \"aria-label\": $props.title,\n class: \"material-design-icon folder-icon\",\n role: \"img\",\n onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit(\"click\", $event))\n }), [\n (openBlock(), createElementBlock(\"svg\", {\n fill: $props.fillColor,\n class: \"material-design-icon__svg\",\n width: $props.size,\n height: $props.size,\n viewBox: \"0 0 24 24\"\n }, [\n createElementVNode(\"path\", _hoisted_3, [\n $props.title ? (openBlock(), createElementBlock(\"title\", _hoisted_4, toDisplayString($props.title), 1)) : createCommentVNode(\"\", true)\n ])\n ], 8, _hoisted_2))\n ], 16, _hoisted_1);\n}\nconst IconFolder = /* @__PURE__ */ _export_sfc(_sfc_main$1, [[\"render\", _sfc_render]]);\nconst crumbClass = \"vue-crumb\";\nconst _sfc_main = {\n name: \"NcBreadcrumbs\",\n components: {\n NcActions,\n NcActionButton,\n NcActionRouter,\n NcActionLink,\n NcBreadcrumb,\n IconFolder\n },\n props: {\n /**\n * Set a css icon-class for the icon of the root breadcrumb to be used.\n */\n rootIcon: {\n type: String,\n default: \"icon-home\"\n },\n /**\n * Set the aria-label of the nav element.\n */\n ariaLabel: {\n type: String,\n default: null\n }\n },\n emits: [\"dropped\"],\n data() {\n return {\n /**\n * Array to track the hidden breadcrumbs by their index.\n * Comparing two crumbs somehow does not work, so we use the indices.\n */\n hiddenIndices: [],\n /**\n * This is the props of the middle Action menu\n * that show the ellipsised breadcrumbs\n */\n menuBreadcrumbProps: {\n // Don't show a name for this breadcrumb, only the Actions menu\n name: \"\",\n forceMenu: true,\n // Don't allow dropping directly on the actions breadcrumb\n disableDrop: true,\n // Is the menu open or not\n open: false\n },\n breadcrumbsRefs: []\n };\n },\n created() {\n window.addEventListener(\"resize\", debounce(() => {\n this.handleWindowResize();\n }, 100));\n subscribe(\"navigation-toggled\", this.delayedResize);\n },\n mounted() {\n this.handleWindowResize();\n },\n updated() {\n this.delayedResize();\n this.$nextTick(() => {\n this.hideCrumbs();\n });\n },\n beforeUnmount() {\n window.removeEventListener(\"resize\", this.handleWindowResize);\n unsubscribe(\"navigation-toggled\", this.delayedResize);\n },\n methods: {\n /**\n * Close the actions menu\n *\n * @param {object} e The event\n */\n closeActions(e) {\n if (this.$refs.actionsBreadcrumb.$el.contains(e.relatedTarget)) {\n return;\n }\n this.menuBreadcrumbProps.open = false;\n },\n /**\n * Call the resize function after a delay\n */\n async delayedResize() {\n await this.$nextTick();\n this.handleWindowResize();\n },\n /**\n * Check the width of the breadcrumb and hide breadcrumbs\n * if we overflow otherwise.\n */\n handleWindowResize() {\n if (!this.$refs.container) {\n return;\n }\n const nrCrumbs = this.breadcrumbsRefs.length;\n const hiddenIndices = [];\n const availableWidth = this.$refs.container.offsetWidth;\n let totalWidth = this.getTotalWidth();\n if (this.$refs.breadcrumb__actions) {\n totalWidth += this.$refs.breadcrumb__actions.offsetWidth;\n }\n let overflow = totalWidth - availableWidth;\n overflow += overflow > 0 ? 64 : 0;\n let i = 0;\n const startIndex = Math.floor(nrCrumbs / 2);\n while (overflow > 0 && i < nrCrumbs - 2) {\n const currentIndex = startIndex + (i % 2 ? i + 1 : i) / 2 * Math.pow(-1, i + nrCrumbs % 2);\n overflow -= this.getWidth(this.breadcrumbsRefs[currentIndex]?.$el, currentIndex === this.breadcrumbsRefs.length - 1);\n hiddenIndices.push(currentIndex);\n i++;\n }\n if (!this.arraysEqual(this.hiddenIndices, hiddenIndices.sort((a, b) => a - b))) {\n this.hiddenIndices = hiddenIndices;\n }\n },\n /**\n * Checks if two arrays are equal.\n * Only works for primitive arrays, but that's enough here.\n *\n * @param {Array} a The first array\n * @param {Array} b The second array\n * @return {boolean} Wether the arrays are equal\n */\n arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n } else if (a === b) {\n return true;\n } else if (a === null || b === null) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n },\n /**\n * Calculates the total width of all breadcrumbs\n *\n * @return {number} The total width\n */\n getTotalWidth() {\n return this.breadcrumbsRefs.reduce((width, crumb, index) => width + this.getWidth(crumb.$el, index === this.breadcrumbsRefs.length - 1), 0);\n },\n /**\n * Calculates the width of the provided element\n *\n * @param {object} el The element\n * @param {boolean} isLast Is this the last crumb\n * @return {number} The width\n */\n getWidth(el, isLast) {\n if (!el?.classList) {\n return 0;\n }\n const hide = el.classList.contains(`${crumbClass}--hidden`);\n el.style.minWidth = \"auto\";\n if (isLast) {\n el.style.maxWidth = \"210px\";\n }\n el.classList.remove(`${crumbClass}--hidden`);\n const w = el.offsetWidth;\n if (hide) {\n el.classList.add(`${crumbClass}--hidden`);\n }\n el.style.minWidth = \"\";\n el.style.maxWidth = \"\";\n return w;\n },\n /**\n * Prevents the default of a provided event\n *\n * @param {object} e The event\n * @return {boolean}\n */\n preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n return false;\n },\n /**\n * Handles the drag start.\n * Prevents a breadcrumb from being draggable.\n *\n * @param {object} e The event\n * @return {boolean}\n */\n dragStart(e) {\n return this.preventDefault(e);\n },\n /**\n * Handles when something is dropped on the breadcrumb.\n *\n * @param {object} e The drop event\n * @param {string} path The path of the breadcrumb\n * @param {boolean} disabled Whether dropping is disabled for this breadcrumb\n * @return {boolean}\n */\n dropped(e, path, disabled) {\n if (!disabled) {\n this.$emit(\"dropped\", e, path);\n }\n this.menuBreadcrumbProps.open = false;\n const crumbs = document.querySelectorAll(`.${crumbClass}`);\n for (const crumb of crumbs) {\n crumb.classList.remove(`${crumbClass}--hovered`);\n }\n return this.preventDefault(e);\n },\n /**\n * Handles the drag over event\n *\n * @param {object} e The drag over event\n * @return {boolean}\n */\n dragOver(e) {\n return this.preventDefault(e);\n },\n /**\n * Handles the drag enter event\n *\n * @param {object} e The drag over event\n * @param {boolean} disabled Whether dropping is disabled for this breadcrumb\n */\n dragEnter(e, disabled) {\n if (disabled) {\n return;\n }\n if (e.target.closest) {\n const target = e.target.closest(`.${crumbClass}`);\n if (target.classList && target.classList.contains(crumbClass)) {\n const crumbs = document.querySelectorAll(`.${crumbClass}`);\n for (const crumb of crumbs) {\n crumb.classList.remove(`${crumbClass}--hovered`);\n }\n target.classList.add(`${crumbClass}--hovered`);\n }\n }\n },\n /**\n * Handles the drag leave event\n *\n * @param {object} e The drag leave event\n * @param {boolean} disabled Whether dropping is disabled for this breadcrumb\n */\n dragLeave(e, disabled) {\n if (disabled) {\n return;\n }\n if (e.target.contains(e.relatedTarget)) {\n return;\n }\n if (e.target.closest) {\n const target = e.target.closest(`.${crumbClass}`);\n if (target.contains(e.relatedTarget)) {\n return;\n }\n if (target.classList && target.classList.contains(crumbClass)) {\n target.classList.remove(`${crumbClass}--hovered`);\n }\n }\n },\n /**\n * Check for each crumb if we have to hide it and\n * add it to the array of all crumbs.\n */\n hideCrumbs() {\n this.breadcrumbsRefs.forEach((crumb, i) => {\n if (crumb?.$el?.classList) {\n if (this.hiddenIndices.includes(i)) {\n crumb.$el.classList.add(`${crumbClass}--hidden`);\n } else {\n crumb.$el.classList.remove(`${crumbClass}--hidden`);\n }\n }\n });\n },\n isBreadcrumb(vnode) {\n return vnode?.type?.name === \"NcBreadcrumb\";\n }\n },\n /**\n * The render function to display the component\n *\n * @return {object|undefined} The created VNode\n */\n render() {\n let breadcrumbs = [];\n this.$slots.default?.().forEach((vnode) => {\n if (this.isBreadcrumb(vnode)) {\n breadcrumbs.push(vnode);\n return;\n }\n if (vnode?.type === Fragment) {\n vnode?.children?.forEach?.((child) => {\n if (this.isBreadcrumb(child)) {\n breadcrumbs.push(child);\n }\n });\n }\n });\n if (breadcrumbs.length === 0) {\n return;\n }\n breadcrumbs[0] = cloneVNode(breadcrumbs[0], {\n icon: this.rootIcon,\n ref: \"breadcrumbs\"\n });\n const breadcrumbsRefs = [];\n breadcrumbs = breadcrumbs.map((crumb, index) => cloneVNode(crumb, {\n ref: (crumb2) => {\n breadcrumbsRefs[index] = crumb2;\n }\n }));\n const crumbs = [...breadcrumbs];\n if (this.hiddenIndices.length) {\n crumbs.splice(\n Math.round(breadcrumbs.length / 2),\n 0,\n // The Actions menu\n // Use a breadcrumb component for the hidden breadcrumbs\n // eslint-disable-line @stylistic/function-call-argument-newline\n h(NcBreadcrumb, {\n class: \"dropdown\",\n ...this.menuBreadcrumbProps,\n // Hide the dropdown menu from screen-readers,\n // since the crumbs in the menu are still in the list.\n \"aria-hidden\": true,\n // Add a ref to the Actions menu\n ref: \"actionsBreadcrumb\",\n key: \"actions-breadcrumb-1\",\n // Add handlers so the Actions menu opens on hover\n onDragenter: () => {\n this.menuBreadcrumbProps.open = true;\n },\n onDragleave: this.closeActions,\n // Make sure we keep the same open state\n // as the Actions component\n \"onUpdate:open\": (open) => {\n this.menuBreadcrumbProps.open = open;\n }\n // Add all hidden breadcrumbs as ActionRouter or ActionLink\n }, {\n default: () => this.hiddenIndices.filter((index) => index <= breadcrumbs.length - 1).map((index) => {\n const crumb = breadcrumbs[index];\n const {\n // Get the parameters from the breadcrumb component props\n to,\n href,\n disableDrop,\n name,\n // Props to forward\n ...propsToForward\n } = crumb.props;\n delete propsToForward.ref;\n let element = NcActionButton;\n let path = \"\";\n if (href) {\n element = NcActionLink;\n path = href;\n }\n if (to) {\n element = NcActionRouter;\n path = to;\n }\n const folderIcon = h(IconFolder, {\n size: 20\n });\n return h(element, {\n ...propsToForward,\n class: crumbClass,\n href: href || null,\n to: to || null,\n // Prevent the breadcrumbs from being draggable\n draggable: false,\n // Add the drag and drop handlers\n onDragstart: this.dragStart,\n onDrop: ($event) => this.dropped($event, path, disableDrop),\n onDragover: this.dragOver,\n onDragenter: ($event) => this.dragEnter($event, disableDrop),\n onDragleave: ($event) => this.dragLeave($event, disableDrop)\n }, {\n default: () => name,\n icon: () => folderIcon\n });\n })\n })\n );\n }\n const wrapper = [h(\"nav\", { \"aria-label\": this.ariaLabel }, [h(\"ul\", { class: \"breadcrumb__crumbs\" }, [crumbs])])];\n if (isSlotPopulated(this.$slots.actions?.())) {\n wrapper.push(h(\"div\", { class: \"breadcrumb__actions\", ref: \"breadcrumb__actions\" }, this.$slots.actions?.()));\n }\n this.breadcrumbsRefs = breadcrumbsRefs;\n return h(\"div\", { class: [\"breadcrumb\", { \"breadcrumb--collapsed\": this.hiddenIndices.length === breadcrumbs.length - 2 }], ref: \"container\" }, wrapper);\n }\n};\nconst NcBreadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-af2b1226\"]]);\nexport {\n NcBreadcrumbs as N\n};\n//# sourceMappingURL=NcBreadcrumbs-PN5_hHQn.mjs.map\n","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar toStringTag = typeof Symbol !== 'undefined' ? Symbol.toStringTag : '@@toStringTag';\n\nvar _internals = /*#__PURE__*/new WeakMap();\n\nvar _promise = /*#__PURE__*/new WeakMap();\n\nclass CancelablePromiseInternal {\n constructor(_ref) {\n var {\n executor = () => {},\n internals = defaultInternals(),\n promise = new Promise((resolve, reject) => executor(resolve, reject, onCancel => {\n internals.onCancelList.push(onCancel);\n }))\n } = _ref;\n\n _classPrivateFieldInitSpec(this, _internals, {\n writable: true,\n value: void 0\n });\n\n _classPrivateFieldInitSpec(this, _promise, {\n writable: true,\n value: void 0\n });\n\n _defineProperty(this, toStringTag, 'CancelablePromise');\n\n this.cancel = this.cancel.bind(this);\n\n _classPrivateFieldSet(this, _internals, internals);\n\n _classPrivateFieldSet(this, _promise, promise || new Promise((resolve, reject) => executor(resolve, reject, onCancel => {\n internals.onCancelList.push(onCancel);\n })));\n }\n\n then(onfulfilled, onrejected) {\n return makeCancelable(_classPrivateFieldGet(this, _promise).then(createCallback(onfulfilled, _classPrivateFieldGet(this, _internals)), createCallback(onrejected, _classPrivateFieldGet(this, _internals))), _classPrivateFieldGet(this, _internals));\n }\n\n catch(onrejected) {\n return makeCancelable(_classPrivateFieldGet(this, _promise).catch(createCallback(onrejected, _classPrivateFieldGet(this, _internals))), _classPrivateFieldGet(this, _internals));\n }\n\n finally(onfinally, runWhenCanceled) {\n if (runWhenCanceled) {\n _classPrivateFieldGet(this, _internals).onCancelList.push(onfinally);\n }\n\n return makeCancelable(_classPrivateFieldGet(this, _promise).finally(createCallback(() => {\n if (onfinally) {\n if (runWhenCanceled) {\n _classPrivateFieldGet(this, _internals).onCancelList = _classPrivateFieldGet(this, _internals).onCancelList.filter(callback => callback !== onfinally);\n }\n\n return onfinally();\n }\n }, _classPrivateFieldGet(this, _internals))), _classPrivateFieldGet(this, _internals));\n }\n\n cancel() {\n _classPrivateFieldGet(this, _internals).isCanceled = true;\n\n var callbacks = _classPrivateFieldGet(this, _internals).onCancelList;\n\n _classPrivateFieldGet(this, _internals).onCancelList = [];\n\n for (var callback of callbacks) {\n if (typeof callback === 'function') {\n try {\n callback();\n } catch (err) {\n console.error(err);\n }\n }\n }\n }\n\n isCanceled() {\n return _classPrivateFieldGet(this, _internals).isCanceled === true;\n }\n\n}\n\nexport class CancelablePromise extends CancelablePromiseInternal {\n constructor(executor) {\n super({\n executor\n });\n }\n\n}\n\n_defineProperty(CancelablePromise, \"all\", function all(iterable) {\n return makeAllCancelable(iterable, Promise.all(iterable));\n});\n\n_defineProperty(CancelablePromise, \"allSettled\", function allSettled(iterable) {\n return makeAllCancelable(iterable, Promise.allSettled(iterable));\n});\n\n_defineProperty(CancelablePromise, \"any\", function any(iterable) {\n return makeAllCancelable(iterable, Promise.any(iterable));\n});\n\n_defineProperty(CancelablePromise, \"race\", function race(iterable) {\n return makeAllCancelable(iterable, Promise.race(iterable));\n});\n\n_defineProperty(CancelablePromise, \"resolve\", function resolve(value) {\n return cancelable(Promise.resolve(value));\n});\n\n_defineProperty(CancelablePromise, \"reject\", function reject(reason) {\n return cancelable(Promise.reject(reason));\n});\n\n_defineProperty(CancelablePromise, \"isCancelable\", isCancelablePromise);\n\nexport default CancelablePromise;\nexport function cancelable(promise) {\n return makeCancelable(promise, defaultInternals());\n}\nexport function isCancelablePromise(promise) {\n return promise instanceof CancelablePromise || promise instanceof CancelablePromiseInternal;\n}\n\nfunction createCallback(onResult, internals) {\n if (onResult) {\n return arg => {\n if (!internals.isCanceled) {\n var result = onResult(arg);\n\n if (isCancelablePromise(result)) {\n internals.onCancelList.push(result.cancel);\n }\n\n return result;\n }\n\n return arg;\n };\n }\n}\n\nfunction makeCancelable(promise, internals) {\n return new CancelablePromiseInternal({\n internals,\n promise\n });\n}\n\nfunction makeAllCancelable(iterable, promise) {\n var internals = defaultInternals();\n internals.onCancelList.push(() => {\n for (var resolvable of iterable) {\n if (isCancelablePromise(resolvable)) {\n resolvable.cancel();\n }\n }\n });\n return new CancelablePromiseInternal({\n internals,\n promise\n });\n}\n\nfunction defaultInternals() {\n return {\n isCanceled: false,\n onCancelList: []\n };\n}\n//# sourceMappingURL=CancelablePromise.mjs.map","import { getCurrentUser, onRequestTokenUpdate, getRequestToken } from \"@nextcloud/auth\";\nimport { isPublicShare, getSharingToken } from \"@nextcloud/sharing/public\";\nimport { generateRemoteUrl } from \"@nextcloud/router\";\nimport { CancelablePromise } from \"cancelable-promise\";\nimport { createClient, getPatcher } from \"webdav\";\nimport { getLoggerBuilder } from \"@nextcloud/logger\";\nimport { join, encodePath, basename, extname, dirname } from \"@nextcloud/paths\";\nconst logger = getLoggerBuilder().setApp(\"@nextcloud/files\").detectUser().build();\nvar FileType = /* @__PURE__ */ ((FileType2) => {\n FileType2[\"Folder\"] = \"folder\";\n FileType2[\"File\"] = \"file\";\n return FileType2;\n})(FileType || {});\nvar Permission = /* @__PURE__ */ ((Permission2) => {\n Permission2[Permission2[\"NONE\"] = 0] = \"NONE\";\n Permission2[Permission2[\"CREATE\"] = 4] = \"CREATE\";\n Permission2[Permission2[\"READ\"] = 1] = \"READ\";\n Permission2[Permission2[\"UPDATE\"] = 2] = \"UPDATE\";\n Permission2[Permission2[\"DELETE\"] = 8] = \"DELETE\";\n Permission2[Permission2[\"SHARE\"] = 16] = \"SHARE\";\n Permission2[Permission2[\"ALL\"] = 31] = \"ALL\";\n return Permission2;\n})(Permission || {});\nconst isDavResource = function(source, davService) {\n return source.match(davService) !== null;\n};\nconst validateData = (data, davService) => {\n if (data.id && typeof data.id !== \"number\") {\n throw new Error(\"Invalid id type of value\");\n }\n if (!data.source) {\n throw new Error(\"Missing mandatory source\");\n }\n try {\n new URL(data.source);\n } catch (e) {\n throw new Error(\"Invalid source format, source must be a valid URL\");\n }\n if (!data.source.startsWith(\"http\")) {\n throw new Error(\"Invalid source format, only http(s) is supported\");\n }\n if (data.displayname && typeof data.displayname !== \"string\") {\n throw new Error(\"Invalid displayname type\");\n }\n if (data.mtime && !(data.mtime instanceof Date)) {\n throw new Error(\"Invalid mtime type\");\n }\n if (data.crtime && !(data.crtime instanceof Date)) {\n throw new Error(\"Invalid crtime type\");\n }\n if (!data.mime || typeof data.mime !== \"string\" || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n throw new Error(\"Missing or invalid mandatory mime\");\n }\n if (\"size\" in data && typeof data.size !== \"number\" && data.size !== void 0) {\n throw new Error(\"Invalid size type\");\n }\n if (\"permissions\" in data && data.permissions !== void 0 && !(typeof data.permissions === \"number\" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {\n throw new Error(\"Invalid permissions\");\n }\n if (data.owner && data.owner !== null && typeof data.owner !== \"string\") {\n throw new Error(\"Invalid owner type\");\n }\n if (data.attributes && typeof data.attributes !== \"object\") {\n throw new Error(\"Invalid attributes type\");\n }\n if (data.root && typeof data.root !== \"string\") {\n throw new Error(\"Invalid root type\");\n }\n if (data.root && !data.root.startsWith(\"/\")) {\n throw new Error(\"Root must start with a leading slash\");\n }\n if (data.root && !data.source.includes(data.root)) {\n throw new Error(\"Root must be part of the source\");\n }\n if (data.root && isDavResource(data.source, davService)) {\n const service = data.source.match(davService)[0];\n if (!data.source.includes(join(service, data.root))) {\n throw new Error(\"The root must be relative to the service. e.g /files/emma\");\n }\n }\n if (data.status && !Object.values(NodeStatus).includes(data.status)) {\n throw new Error(\"Status must be a valid NodeStatus\");\n }\n};\nvar NodeStatus = /* @__PURE__ */ ((NodeStatus2) => {\n NodeStatus2[\"NEW\"] = \"new\";\n NodeStatus2[\"FAILED\"] = \"failed\";\n NodeStatus2[\"LOADING\"] = \"loading\";\n NodeStatus2[\"LOCKED\"] = \"locked\";\n return NodeStatus2;\n})(NodeStatus || {});\nclass Node {\n _data;\n _attributes;\n _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === \"function\" && e[0] !== \"__proto__\").map((e) => e[0]);\n handler = {\n set: (target, prop, value) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.set(target, prop, value);\n },\n deleteProperty: (target, prop) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.deleteProperty(target, prop);\n },\n // TODO: This is deprecated and only needed for files v3\n get: (target, prop, receiver) => {\n if (this.readonlyAttributes.includes(prop)) {\n logger.warn(`Accessing \"Node.attributes.${prop}\" is deprecated, access it directly on the Node instance.`);\n return Reflect.get(this, prop);\n }\n return Reflect.get(target, prop, receiver);\n }\n };\n constructor(data, davService) {\n if (!data.mime) {\n data.mime = \"application/octet-stream\";\n }\n validateData(data, davService || this._knownDavService);\n this._data = {\n // TODO: Remove with next major release, this is just for compatibility\n displayname: data.attributes?.displayname,\n ...data,\n attributes: {}\n };\n this._attributes = new Proxy(this._data.attributes, this.handler);\n this.update(data.attributes ?? {});\n if (davService) {\n this._knownDavService = davService;\n }\n }\n /**\n * Get the source url to this object\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get source() {\n return this._data.source.replace(/\\/$/i, \"\");\n }\n /**\n * Get the encoded source url to this object for requests purposes\n */\n get encodedSource() {\n const { origin } = new URL(this.source);\n return origin + encodePath(this.source.slice(origin.length));\n }\n /**\n * Get this object name\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get basename() {\n return basename(this.source);\n }\n /**\n * The nodes displayname\n * By default the display name and the `basename` are identical,\n * but it is possible to have a different name. This happens\n * on the files app for example for shared folders.\n */\n get displayname() {\n return this._data.displayname || this.basename;\n }\n /**\n * Set the displayname\n */\n set displayname(displayname) {\n validateData({ ...this._data, displayname }, this._knownDavService);\n this._data.displayname = displayname;\n }\n /**\n * Get this object's extension\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get extension() {\n return extname(this.source);\n }\n /**\n * Get the directory path leading to this object\n * Will use the relative path to root if available\n *\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get dirname() {\n if (this.root) {\n let source = this.source;\n if (this.isDavResource) {\n source = source.split(this._knownDavService).pop();\n }\n const firstMatch = source.indexOf(this.root);\n const root = this.root.replace(/\\/$/, \"\");\n return dirname(source.slice(firstMatch + root.length) || \"/\");\n }\n const url = new URL(this.source);\n return dirname(url.pathname);\n }\n /**\n * Get the file mime\n */\n get mime() {\n return this._data.mime || \"application/octet-stream\";\n }\n /**\n * Set the file mime\n * Removing the mime type will set it to `application/octet-stream`\n */\n set mime(mime) {\n mime ??= \"application/octet-stream\";\n validateData({ ...this._data, mime }, this._knownDavService);\n this._data.mime = mime;\n }\n /**\n * Get the file modification time\n */\n get mtime() {\n return this._data.mtime;\n }\n /**\n * Set the file modification time\n */\n set mtime(mtime) {\n validateData({ ...this._data, mtime }, this._knownDavService);\n this._data.mtime = mtime;\n }\n /**\n * Get the file creation time\n * There is no setter as the creation time is not meant to be changed\n */\n get crtime() {\n return this._data.crtime;\n }\n /**\n * Get the file size\n */\n get size() {\n return this._data.size;\n }\n /**\n * Set the file size\n */\n set size(size) {\n validateData({ ...this._data, size }, this._knownDavService);\n this.updateMtime();\n this._data.size = size;\n }\n /**\n * Get the file attribute\n * This contains all additional attributes not provided by the Node class\n */\n get attributes() {\n return this._attributes;\n }\n /**\n * Get the file permissions\n */\n get permissions() {\n if (this.owner === null && !this.isDavResource) {\n return Permission.READ;\n }\n return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;\n }\n /**\n * Set the file permissions\n */\n set permissions(permissions) {\n validateData({ ...this._data, permissions }, this._knownDavService);\n this.updateMtime();\n this._data.permissions = permissions;\n }\n /**\n * Get the file owner\n * There is no setter as the owner is not meant to be changed\n */\n get owner() {\n if (!this.isDavResource) {\n return null;\n }\n return this._data.owner;\n }\n /**\n * Is this a dav-related resource ?\n */\n get isDavResource() {\n return isDavResource(this.source, this._knownDavService);\n }\n /**\n * @deprecated use `isDavResource` instead - will be removed in next major version.\n */\n get isDavRessource() {\n return this.isDavResource;\n }\n /**\n * Get the dav root of this object\n * There is no setter as the root is not meant to be changed\n */\n get root() {\n if (this._data.root) {\n return this._data.root.replace(/^(.+)\\/$/, \"$1\");\n }\n if (this.isDavResource) {\n const root = dirname(this.source);\n return root.split(this._knownDavService).pop() || null;\n }\n return null;\n }\n /**\n * Get the absolute path of this object relative to the root\n */\n get path() {\n if (this.root) {\n let source = this.source;\n if (this.isDavResource) {\n source = source.split(this._knownDavService).pop();\n }\n const firstMatch = source.indexOf(this.root);\n const root = this.root.replace(/\\/$/, \"\");\n return source.slice(firstMatch + root.length) || \"/\";\n }\n return (this.dirname + \"/\" + this.basename).replace(/\\/\\//g, \"/\");\n }\n /**\n * Get the node id if defined.\n * There is no setter as the fileid is not meant to be changed\n */\n get fileid() {\n return this._data?.id;\n }\n /**\n * Get the node status.\n */\n get status() {\n return this._data?.status;\n }\n /**\n * Set the node status.\n */\n set status(status) {\n validateData({ ...this._data, status }, this._knownDavService);\n this._data.status = status;\n }\n /**\n * Get the node data\n */\n get data() {\n return structuredClone(this._data);\n }\n /**\n * Move the node to a new destination\n *\n * @param {string} destination the new source.\n * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n */\n move(destination) {\n validateData({ ...this._data, source: destination }, this._knownDavService);\n const oldBasename = this.basename;\n this._data.source = destination;\n if (this.displayname === oldBasename && this.basename !== oldBasename) {\n this.displayname = this.basename;\n }\n }\n /**\n * Rename the node\n * This aliases the move method for easier usage\n *\n * @param basename The new name of the node\n */\n rename(basename2) {\n if (basename2.includes(\"/\")) {\n throw new Error(\"Invalid basename\");\n }\n this.move(dirname(this.source) + \"/\" + basename2);\n }\n /**\n * Update the mtime if exists\n */\n updateMtime() {\n if (this._data.mtime) {\n this._data.mtime = /* @__PURE__ */ new Date();\n }\n }\n /**\n * Update the attributes of the node\n * Warning, updating attributes will NOT automatically update the mtime.\n *\n * @param attributes The new attributes to update on the Node attributes\n */\n update(attributes) {\n for (const [name, value] of Object.entries(attributes)) {\n try {\n if (value === void 0) {\n delete this.attributes[name];\n } else {\n this.attributes[name] = value;\n }\n } catch (e) {\n if (e instanceof TypeError) {\n continue;\n }\n throw e;\n }\n }\n }\n}\nclass File extends Node {\n get type() {\n return FileType.File;\n }\n /**\n * Returns a clone of the file\n */\n clone() {\n return new File(this.data);\n }\n}\nclass Folder extends Node {\n constructor(data) {\n super({\n ...data,\n mime: \"httpd/unix-directory\"\n });\n }\n get type() {\n return FileType.Folder;\n }\n get extension() {\n return null;\n }\n get mime() {\n return \"httpd/unix-directory\";\n }\n /**\n * Returns a clone of the folder\n */\n clone() {\n return new Folder(this.data);\n }\n}\nconst parsePermissions = function(permString = \"\") {\n let permissions = Permission.NONE;\n if (!permString) {\n return permissions;\n }\n if (permString.includes(\"C\") || permString.includes(\"K\")) {\n permissions |= Permission.CREATE;\n }\n if (permString.includes(\"G\")) {\n permissions |= Permission.READ;\n }\n if (permString.includes(\"W\") || permString.includes(\"N\") || permString.includes(\"V\")) {\n permissions |= Permission.UPDATE;\n }\n if (permString.includes(\"D\")) {\n permissions |= Permission.DELETE;\n }\n if (permString.includes(\"R\")) {\n permissions |= Permission.SHARE;\n }\n return permissions;\n};\nconst defaultDavProperties = [\n \"d:getcontentlength\",\n \"d:getcontenttype\",\n \"d:getetag\",\n \"d:getlastmodified\",\n \"d:creationdate\",\n \"d:displayname\",\n \"d:quota-available-bytes\",\n \"d:resourcetype\",\n \"nc:has-preview\",\n \"nc:is-encrypted\",\n \"nc:mount-type\",\n \"oc:comments-unread\",\n \"oc:favorite\",\n \"oc:fileid\",\n \"oc:owner-display-name\",\n \"oc:owner-id\",\n \"oc:permissions\",\n \"oc:size\"\n];\nconst defaultDavNamespaces = {\n d: \"DAV:\",\n nc: \"http://nextcloud.org/ns\",\n oc: \"http://owncloud.org/ns\",\n ocs: \"http://open-collaboration-services.org/ns\"\n};\nconst registerDavProperty = function(prop, namespace = { nc: \"http://nextcloud.org/ns\" }) {\n if (typeof window._nc_dav_properties === \"undefined\") {\n window._nc_dav_properties = [...defaultDavProperties];\n window._nc_dav_namespaces = { ...defaultDavNamespaces };\n }\n const namespaces = { ...window._nc_dav_namespaces, ...namespace };\n if (window._nc_dav_properties.find((search) => search === prop)) {\n logger.warn(`${prop} already registered`, { prop });\n return false;\n }\n if (prop.startsWith(\"<\") || prop.split(\":\").length !== 2) {\n logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });\n return false;\n }\n const ns = prop.split(\":\")[0];\n if (!namespaces[ns]) {\n logger.error(`${prop} namespace unknown`, { prop, namespaces });\n return false;\n }\n window._nc_dav_properties.push(prop);\n window._nc_dav_namespaces = namespaces;\n return true;\n};\nconst getDavProperties = function() {\n if (typeof window._nc_dav_properties === \"undefined\") {\n window._nc_dav_properties = [...defaultDavProperties];\n }\n return window._nc_dav_properties.map((prop) => `<${prop} />`).join(\" \");\n};\nconst getDavNameSpaces = function() {\n if (typeof window._nc_dav_namespaces === \"undefined\") {\n window._nc_dav_namespaces = { ...defaultDavNamespaces };\n }\n return Object.keys(window._nc_dav_namespaces).map((ns) => `xmlns:${ns}=\"${window._nc_dav_namespaces?.[ns]}\"`).join(\" \");\n};\nconst getDefaultPropfind = function() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t`;\n};\nconst getFavoritesReport = function() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`;\n};\nconst getRecentSearch = function(lastModified) {\n return `\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${getCurrentUser()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${lastModified}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`;\n};\nfunction getRootPath() {\n if (isPublicShare()) {\n return `/files/${getSharingToken()}`;\n }\n return `/files/${getCurrentUser()?.uid}`;\n}\nconst defaultRootPath = getRootPath();\nfunction getRemoteURL() {\n const url = generateRemoteUrl(\"dav\");\n if (isPublicShare()) {\n return url.replace(\"remote.php\", \"public.php\");\n }\n return url;\n}\nconst defaultRemoteURL = getRemoteURL();\nconst getClient = function(remoteURL = defaultRemoteURL, headers = {}) {\n const client = createClient(remoteURL, { headers });\n function setHeaders(token) {\n client.setHeaders({\n ...headers,\n // Add this so the server knows it is an request from the browser\n \"X-Requested-With\": \"XMLHttpRequest\",\n // Inject user auth\n requesttoken: token ?? \"\"\n });\n }\n onRequestTokenUpdate(setHeaders);\n setHeaders(getRequestToken());\n const patcher = getPatcher();\n patcher.patch(\"fetch\", (url, options) => {\n const headers2 = options.headers;\n if (headers2?.method) {\n options.method = headers2.method;\n delete headers2.method;\n }\n return fetch(url, options);\n });\n return client;\n};\nconst getFavoriteNodes = (davClient, path = \"/\", davRoot = defaultRootPath) => {\n const controller = new AbortController();\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n onCancel(() => controller.abort());\n try {\n const contentsResponse = await davClient.getDirectoryContents(`${davRoot}${path}`, {\n signal: controller.signal,\n details: true,\n data: getFavoritesReport(),\n headers: {\n // see getClient for patched webdav client\n method: \"REPORT\"\n },\n includeSelf: true\n });\n const nodes = contentsResponse.data.filter((node) => node.filename !== path).map((result) => resultToNode(result, davRoot));\n resolve(nodes);\n } catch (error) {\n reject(error);\n }\n });\n};\nconst resultToNode = function(node, filesRoot = defaultRootPath, remoteURL = defaultRemoteURL) {\n let userId = getCurrentUser()?.uid;\n if (isPublicShare()) {\n userId = userId ?? \"anonymous\";\n } else if (!userId) {\n throw new Error(\"No user id found\");\n }\n const props = node.props;\n const permissions = parsePermissions(props?.permissions);\n const owner = String(props?.[\"owner-id\"] || userId);\n const id = props.fileid || 0;\n const mtime = new Date(Date.parse(node.lastmod));\n const crtime = new Date(Date.parse(props.creationdate));\n const nodeData = {\n id,\n source: `${remoteURL}${node.filename}`,\n mtime: !isNaN(mtime.getTime()) && mtime.getTime() !== 0 ? mtime : void 0,\n crtime: !isNaN(crtime.getTime()) && crtime.getTime() !== 0 ? crtime : void 0,\n mime: node.mime || \"application/octet-stream\",\n // Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380\n displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,\n size: props?.size || Number.parseInt(props.getcontentlength || \"0\"),\n // The fileid is set to -1 for failed requests\n status: id < 0 ? NodeStatus.FAILED : void 0,\n permissions,\n owner,\n root: filesRoot,\n attributes: {\n ...node,\n ...props,\n hasPreview: props?.[\"has-preview\"]\n }\n };\n delete nodeData.attributes?.props;\n return node.type === \"file\" ? new File(nodeData) : new Folder(nodeData);\n};\nexport {\n FileType as F,\n Node as N,\n Permission as P,\n getRemoteURL as a,\n defaultRemoteURL as b,\n getClient as c,\n defaultRootPath as d,\n getFavoriteNodes as e,\n defaultDavProperties as f,\n getRootPath as g,\n defaultDavNamespaces as h,\n registerDavProperty as i,\n getDavProperties as j,\n getDavNameSpaces as k,\n getDefaultPropfind as l,\n getFavoritesReport as m,\n getRecentSearch as n,\n logger as o,\n parsePermissions as p,\n File as q,\n resultToNode as r,\n Folder as s,\n NodeStatus as t\n};\n//# sourceMappingURL=dav-Rt1kTtvI.mjs.map\n","import { o as logger, F as FileType } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { q, s, N, t, P, c, l, m, n, a, g, p, b, r, d, h, f, k, j, e, i } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nimport require$$1 from \"string_decoder\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { extname, basename } from \"@nextcloud/paths\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nvar DefaultType = /* @__PURE__ */ ((DefaultType2) => {\n DefaultType2[\"DEFAULT\"] = \"default\";\n DefaultType2[\"HIDDEN\"] = \"hidden\";\n return DefaultType2;\n})(DefaultType || {});\nclass FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get title() {\n return this._action.title;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get hotkey() {\n return this._action.hotkey;\n }\n get order() {\n return this._action.order;\n }\n get parent() {\n return this._action.parent;\n }\n get default() {\n return this._action.default;\n }\n get destructive() {\n return this._action.destructive;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"title\" in action && typeof action.title !== \"function\") {\n throw new Error(\"Invalid title function\");\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (\"execBatch\" in action && typeof action.execBatch !== \"function\") {\n throw new Error(\"Invalid execBatch function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (action.destructive !== void 0 && typeof action.destructive !== \"boolean\") {\n throw new Error(\"Invalid destructive flag\");\n }\n if (\"parent\" in action && typeof action.parent !== \"string\") {\n throw new Error(\"Invalid parent\");\n }\n if (action.default && !Object.values(DefaultType).includes(action.default)) {\n throw new Error(\"Invalid default\");\n }\n if (\"inline\" in action && typeof action.inline !== \"function\") {\n throw new Error(\"Invalid inline function\");\n }\n if (\"renderInline\" in action && typeof action.renderInline !== \"function\") {\n throw new Error(\"Invalid renderInline function\");\n }\n if (\"hotkey\" in action && action.hotkey !== void 0) {\n if (typeof action.hotkey !== \"object\") {\n throw new Error(\"Invalid hotkey configuration\");\n }\n if (typeof action.hotkey.key !== \"string\" || !action.hotkey.key) {\n throw new Error(\"Missing or invalid hotkey key\");\n }\n if (typeof action.hotkey.description !== \"string\" || !action.hotkey.description) {\n throw new Error(\"Missing or invalid hotkey description\");\n }\n }\n }\n}\nconst registerFileAction = function(action) {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n if (window._nc_fileactions.find((search) => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nconst getFileActions = function() {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n return window._nc_fileactions;\n};\nclass FileListAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get order() {\n return this._action.order;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"iconSvgInline\" in action && typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n }\n}\nconst registerFileListAction = (action) => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n if (window._nc_filelistactions.find((listAction) => listAction.id === action.id)) {\n logger.error(`FileListAction with id \"${action.id}\" is already registered`, { action });\n return;\n }\n window._nc_filelistactions.push(action);\n};\nconst getFileListActions = () => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n return window._nc_filelistactions;\n};\nfunction getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, \"default\") ? x[\"default\"] : x;\n}\nvar debug_1;\nvar hasRequiredDebug;\nfunction requireDebug() {\n if (hasRequiredDebug) return debug_1;\n hasRequiredDebug = 1;\n const debug = typeof process === \"object\" && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error(\"SEMVER\", ...args) : () => {\n };\n debug_1 = debug;\n return debug_1;\n}\nvar constants;\nvar hasRequiredConstants;\nfunction requireConstants() {\n if (hasRequiredConstants) return constants;\n hasRequiredConstants = 1;\n const SEMVER_SPEC_VERSION = \"2.0.0\";\n const MAX_LENGTH = 256;\n const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */\n 9007199254740991;\n const MAX_SAFE_COMPONENT_LENGTH = 16;\n const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;\n const RELEASE_TYPES = [\n \"major\",\n \"premajor\",\n \"minor\",\n \"preminor\",\n \"patch\",\n \"prepatch\",\n \"prerelease\"\n ];\n constants = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 1,\n FLAG_LOOSE: 2\n };\n return constants;\n}\nvar re = { exports: {} };\nvar hasRequiredRe;\nfunction requireRe() {\n if (hasRequiredRe) return re.exports;\n hasRequiredRe = 1;\n (function(module, exports) {\n const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH\n } = requireConstants();\n const debug = requireDebug();\n exports = module.exports = {};\n const re2 = exports.re = [];\n const safeRe = exports.safeRe = [];\n const src = exports.src = [];\n const safeSrc = exports.safeSrc = [];\n const t2 = exports.t = {};\n let R = 0;\n const LETTERDASHNUMBER = \"[a-zA-Z0-9-]\";\n const safeRegexReplacements = [\n [\"\\\\s\", 1],\n [\"\\\\d\", MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]\n ];\n const makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n }\n return value;\n };\n const createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value);\n const index = R++;\n debug(name, index, value);\n t2[name] = index;\n src[index] = value;\n safeSrc[index] = safe;\n re2[index] = new RegExp(value, isGlobal ? \"g\" : void 0);\n safeRe[index] = new RegExp(safe, isGlobal ? \"g\" : void 0);\n };\n createToken(\"NUMERICIDENTIFIER\", \"0|[1-9]\\\\d*\");\n createToken(\"NUMERICIDENTIFIERLOOSE\", \"\\\\d+\");\n createToken(\"NONNUMERICIDENTIFIER\", `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n createToken(\"MAINVERSION\", `(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"MAINVERSIONLOOSE\", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASE\", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);\n createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);\n createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n createToken(\"BUILD\", `(?:\\\\+(${src[t2.BUILDIDENTIFIER]}(?:\\\\.${src[t2.BUILDIDENTIFIER]})*))`);\n createToken(\"FULLPLAIN\", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);\n createToken(\"FULL\", `^${src[t2.FULLPLAIN]}$`);\n createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);\n createToken(\"LOOSE\", `^${src[t2.LOOSEPLAIN]}$`);\n createToken(\"GTLT\", \"((?:<|>)?=?)\");\n createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken(\"XRANGEIDENTIFIER\", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAIN]}$`);\n createToken(\"XRANGELOOSE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COERCEPLAIN\", `${\"(^|[^\\\\d])(\\\\d{1,\"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);\n createToken(\"COERCE\", `${src[t2.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken(\"COERCEFULL\", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\\\d])`);\n createToken(\"COERCERTL\", src[t2.COERCE], true);\n createToken(\"COERCERTLFULL\", src[t2.COERCEFULL], true);\n createToken(\"LONETILDE\", \"(?:~>?)\");\n createToken(\"TILDETRIM\", `(\\\\s*)${src[t2.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = \"$1~\";\n createToken(\"TILDE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"TILDELOOSE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"LONECARET\", \"(?:\\\\^)\");\n createToken(\"CARETTRIM\", `(\\\\s*)${src[t2.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = \"$1^\";\n createToken(\"CARET\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"CARETLOOSE\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COMPARATORLOOSE\", `^${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]})$|^$`);\n createToken(\"COMPARATOR\", `^${src[t2.GTLT]}\\\\s*(${src[t2.FULLPLAIN]})$|^$`);\n createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = \"$1$2$3\";\n createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t2.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAIN]})\\\\s*$`);\n createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t2.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAINLOOSE]})\\\\s*$`);\n createToken(\"STAR\", \"(<|>)?=?\\\\s*\\\\*\");\n createToken(\"GTE0\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");\n createToken(\"GTE0PRE\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\");\n })(re, re.exports);\n return re.exports;\n}\nvar parseOptions_1;\nvar hasRequiredParseOptions;\nfunction requireParseOptions() {\n if (hasRequiredParseOptions) return parseOptions_1;\n hasRequiredParseOptions = 1;\n const looseOption = Object.freeze({ loose: true });\n const emptyOpts = Object.freeze({});\n const parseOptions = (options) => {\n if (!options) {\n return emptyOpts;\n }\n if (typeof options !== \"object\") {\n return looseOption;\n }\n return options;\n };\n parseOptions_1 = parseOptions;\n return parseOptions_1;\n}\nvar identifiers;\nvar hasRequiredIdentifiers;\nfunction requireIdentifiers() {\n if (hasRequiredIdentifiers) return identifiers;\n hasRequiredIdentifiers = 1;\n const numeric = /^[0-9]+$/;\n const compareIdentifiers = (a2, b2) => {\n if (typeof a2 === \"number\" && typeof b2 === \"number\") {\n return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;\n }\n const anum = numeric.test(a2);\n const bnum = numeric.test(b2);\n if (anum && bnum) {\n a2 = +a2;\n b2 = +b2;\n }\n return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;\n };\n const rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);\n identifiers = {\n compareIdentifiers,\n rcompareIdentifiers\n };\n return identifiers;\n}\nvar semver;\nvar hasRequiredSemver;\nfunction requireSemver() {\n if (hasRequiredSemver) return semver;\n hasRequiredSemver = 1;\n const debug = requireDebug();\n const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();\n const { safeRe: re2, t: t2 } = requireRe();\n const parseOptions = requireParseOptions();\n const { compareIdentifiers } = requireIdentifiers();\n class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== \"string\") {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n );\n }\n debug(\"SemVer\", version, options);\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n const m2 = version.trim().match(options.loose ? re2[t2.LOOSE] : re2[t2.FULL]);\n if (!m2) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n this.major = +m2[1];\n this.minor = +m2[2];\n this.patch = +m2[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError(\"Invalid major version\");\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError(\"Invalid minor version\");\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError(\"Invalid patch version\");\n }\n if (!m2[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m2[4].split(\".\").map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m2[5] ? m2[5].split(\".\") : [];\n this.format();\n }\n format() {\n this.version = `${this.major}.${this.minor}.${this.patch}`;\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join(\".\")}`;\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug(\"SemVer.compare\", this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === \"string\" && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.major < other.major) {\n return -1;\n }\n if (this.major > other.major) {\n return 1;\n }\n if (this.minor < other.minor) {\n return -1;\n }\n if (this.minor > other.minor) {\n return 1;\n }\n if (this.patch < other.patch) {\n return -1;\n }\n if (this.patch > other.patch) {\n return 1;\n }\n return 0;\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n let i2 = 0;\n do {\n const a2 = this.prerelease[i2];\n const b2 = other.prerelease[i2];\n debug(\"prerelease compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i2 = 0;\n do {\n const a2 = this.build[i2];\n const b2 = other.build[i2];\n debug(\"build compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier, identifierBase) {\n if (release.startsWith(\"pre\")) {\n if (!identifier && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier is empty\");\n }\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re2[t2.PRERELEASELOOSE] : re2[t2.PRERELEASE]);\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`);\n }\n }\n }\n switch (release) {\n case \"premajor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"preminor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"prepatch\":\n this.prerelease.length = 0;\n this.inc(\"patch\", identifier, identifierBase);\n this.inc(\"pre\", identifier, identifierBase);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case \"prerelease\":\n if (this.prerelease.length === 0) {\n this.inc(\"patch\", identifier, identifierBase);\n }\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"release\":\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`);\n }\n this.prerelease.length = 0;\n break;\n case \"major\":\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"minor\":\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"patch\":\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case \"pre\": {\n const base = Number(identifierBase) ? 1 : 0;\n if (this.prerelease.length === 0) {\n this.prerelease = [base];\n } else {\n let i2 = this.prerelease.length;\n while (--i2 >= 0) {\n if (typeof this.prerelease[i2] === \"number\") {\n this.prerelease[i2]++;\n i2 = -2;\n }\n }\n if (i2 === -1) {\n if (identifier === this.prerelease.join(\".\") && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier already exists\");\n }\n this.prerelease.push(base);\n }\n }\n if (identifier) {\n let prerelease = [identifier, base];\n if (identifierBase === false) {\n prerelease = [identifier];\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease;\n }\n } else {\n this.prerelease = prerelease;\n }\n }\n break;\n }\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.raw = this.format();\n if (this.build.length) {\n this.raw += `+${this.build.join(\".\")}`;\n }\n return this;\n }\n }\n semver = SemVer;\n return semver;\n}\nvar major_1;\nvar hasRequiredMajor;\nfunction requireMajor() {\n if (hasRequiredMajor) return major_1;\n hasRequiredMajor = 1;\n const SemVer = requireSemver();\n const major2 = (a2, loose) => new SemVer(a2, loose).major;\n major_1 = major2;\n return major_1;\n}\nvar majorExports = requireMajor();\nconst major = /* @__PURE__ */ getDefaultExportFromCjs(majorExports);\nvar parse_1;\nvar hasRequiredParse;\nfunction requireParse() {\n if (hasRequiredParse) return parse_1;\n hasRequiredParse = 1;\n const SemVer = requireSemver();\n const parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version;\n }\n try {\n return new SemVer(version, options);\n } catch (er) {\n if (!throwErrors) {\n return null;\n }\n throw er;\n }\n };\n parse_1 = parse;\n return parse_1;\n}\nvar valid_1;\nvar hasRequiredValid;\nfunction requireValid() {\n if (hasRequiredValid) return valid_1;\n hasRequiredValid = 1;\n const parse = requireParse();\n const valid2 = (version, options) => {\n const v = parse(version, options);\n return v ? v.version : null;\n };\n valid_1 = valid2;\n return valid_1;\n}\nvar validExports = requireValid();\nconst valid = /* @__PURE__ */ getDefaultExportFromCjs(validExports);\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass ProxyBus {\n bus;\n constructor(bus2) {\n if (typeof bus2.getVersion !== \"function\" || !valid(bus2.getVersion())) {\n console.warn(\"Proxying an event bus with an unknown or invalid version\");\n } else if (major(bus2.getVersion()) !== major(this.getVersion())) {\n console.warn(\n \"Proxying an event bus of version \" + bus2.getVersion() + \" with \" + this.getVersion()\n );\n }\n this.bus = bus2;\n }\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.bus.subscribe(name, handler);\n }\n unsubscribe(name, handler) {\n this.bus.unsubscribe(name, handler);\n }\n emit(name, ...event) {\n this.bus.emit(name, ...event);\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass SimpleBus {\n handlers = /* @__PURE__ */ new Map();\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).concat(\n handler\n )\n );\n }\n unsubscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).filter((h2) => h2 !== handler)\n );\n }\n emit(name, ...event) {\n const handlers = this.handlers.get(name) || [];\n handlers.forEach((h2) => {\n try {\n ;\n h2(event[0]);\n } catch (e2) {\n console.error(\"could not invoke event listener\", e2);\n }\n });\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nlet bus = null;\nfunction getBus() {\n if (bus !== null) {\n return bus;\n }\n if (typeof window === \"undefined\") {\n return new Proxy({}, {\n get: () => {\n return () => console.error(\n \"Window not available, EventBus can not be established!\"\n );\n }\n });\n }\n if (window.OC?._eventBus && typeof window._nc_event_bus === \"undefined\") {\n console.warn(\n \"found old event bus instance at OC._eventBus. Update your version!\"\n );\n window._nc_event_bus = window.OC._eventBus;\n }\n if (typeof window?._nc_event_bus !== \"undefined\") {\n bus = new ProxyBus(window._nc_event_bus);\n } else {\n bus = window._nc_event_bus = new SimpleBus();\n }\n return bus;\n}\nfunction emit(name, ...event) {\n getBus().emit(name, ...event);\n}\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nclass FileListFilter extends TypedEventTarget {\n id;\n order;\n constructor(id, order = 100) {\n super();\n this.id = id;\n this.order = order;\n }\n filter(nodes) {\n throw new Error(\"Not implemented\");\n }\n updateChips(chips) {\n this.dispatchTypedEvent(\"update:chips\", new CustomEvent(\"update:chips\", { detail: chips }));\n }\n filterUpdated() {\n this.dispatchTypedEvent(\"update:filter\", new CustomEvent(\"update:filter\"));\n }\n}\nfunction registerFileListFilter(filter) {\n if (!window._nc_filelist_filters) {\n window._nc_filelist_filters = /* @__PURE__ */ new Map();\n }\n if (window._nc_filelist_filters.has(filter.id)) {\n throw new Error(`File list filter \"${filter.id}\" already registered`);\n }\n window._nc_filelist_filters.set(filter.id, filter);\n emit(\"files:filter:added\", filter);\n}\nfunction unregisterFileListFilter(filterId) {\n if (window._nc_filelist_filters && window._nc_filelist_filters.has(filterId)) {\n window._nc_filelist_filters.delete(filterId);\n emit(\"files:filter:removed\", filterId);\n }\n}\nfunction getFileListFilters() {\n if (!window._nc_filelist_filters) {\n return [];\n }\n return [...window._nc_filelist_filters.values()];\n}\nclass Header {\n _header;\n constructor(header) {\n this.validateHeader(header);\n this._header = header;\n }\n get id() {\n return this._header.id;\n }\n get order() {\n return this._header.order;\n }\n get enabled() {\n return this._header.enabled;\n }\n get render() {\n return this._header.render;\n }\n get updated() {\n return this._header.updated;\n }\n validateHeader(header) {\n if (!header.id || !header.render || !header.updated) {\n throw new Error(\"Invalid header: id, render and updated are required\");\n }\n if (typeof header.id !== \"string\") {\n throw new Error(\"Invalid id property\");\n }\n if (header.enabled !== void 0 && typeof header.enabled !== \"function\") {\n throw new Error(\"Invalid enabled property\");\n }\n if (header.render && typeof header.render !== \"function\") {\n throw new Error(\"Invalid render property\");\n }\n if (header.updated && typeof header.updated !== \"function\") {\n throw new Error(\"Invalid updated property\");\n }\n }\n}\nconst registerFileListHeaders = function(header) {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n if (window._nc_filelistheader.find((search) => search.id === header.id)) {\n logger.error(`Header ${header.id} already registered`, { header });\n return;\n }\n window._nc_filelistheader.push(header);\n};\nconst getFileListHeaders = function() {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n return window._nc_filelistheader;\n};\nclass Navigation extends TypedEventTarget {\n _views = [];\n _currentView = null;\n /**\n * Register a new view on the navigation\n * @param view The view to register\n * @throws `Error` is thrown if a view with the same id is already registered\n */\n register(view) {\n if (this._views.find((search) => search.id === view.id)) {\n throw new Error(`View id ${view.id} is already registered`);\n }\n this._views.push(view);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n /**\n * Remove a registered view\n * @param id The id of the view to remove\n */\n remove(id) {\n const index = this._views.findIndex((view) => view.id === id);\n if (index !== -1) {\n this._views.splice(index, 1);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n }\n /**\n * Set the currently active view\n * @fires UpdateActiveViewEvent\n * @param view New active view\n */\n setActive(view) {\n this._currentView = view;\n const event = new CustomEvent(\"updateActive\", { detail: view });\n this.dispatchTypedEvent(\"updateActive\", event);\n }\n /**\n * The currently active files view\n */\n get active() {\n return this._currentView;\n }\n /**\n * All registered views\n */\n get views() {\n return this._views;\n }\n}\nconst getNavigation = function() {\n if (typeof window._nc_navigation === \"undefined\") {\n window._nc_navigation = new Navigation();\n logger.debug(\"Navigation service initialized\");\n }\n return window._nc_navigation;\n};\nclass Column {\n _column;\n constructor(column) {\n isValidColumn(column);\n this._column = column;\n }\n get id() {\n return this._column.id;\n }\n get title() {\n return this._column.title;\n }\n get render() {\n return this._column.render;\n }\n get sort() {\n return this._column.sort;\n }\n get summary() {\n return this._column.summary;\n }\n}\nconst isValidColumn = function(column) {\n if (!column.id || typeof column.id !== \"string\") {\n throw new Error(\"A column id is required\");\n }\n if (!column.title || typeof column.title !== \"string\") {\n throw new Error(\"A column title is required\");\n }\n if (!column.render || typeof column.render !== \"function\") {\n throw new Error(\"A render function is required\");\n }\n if (column.sort && typeof column.sort !== \"function\") {\n throw new Error(\"Column sortFunction must be a function\");\n }\n if (column.summary && typeof column.summary !== \"function\") {\n throw new Error(\"Column summary must be a function\");\n }\n return true;\n};\nvar sax$1 = {};\nvar hasRequiredSax;\nfunction requireSax() {\n if (hasRequiredSax) return sax$1;\n hasRequiredSax = 1;\n (function(exports) {\n (function(sax2) {\n sax2.parser = function(strict, opt) {\n return new SAXParser(strict, opt);\n };\n sax2.SAXParser = SAXParser;\n sax2.SAXStream = SAXStream;\n sax2.createStream = createStream;\n sax2.MAX_BUFFER_LENGTH = 64 * 1024;\n var buffers = [\n \"comment\",\n \"sgmlDecl\",\n \"textNode\",\n \"tagName\",\n \"doctype\",\n \"procInstName\",\n \"procInstBody\",\n \"entity\",\n \"attribName\",\n \"attribValue\",\n \"cdata\",\n \"script\"\n ];\n sax2.EVENTS = [\n \"text\",\n \"processinginstruction\",\n \"sgmldeclaration\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"opencdata\",\n \"cdata\",\n \"closecdata\",\n \"error\",\n \"end\",\n \"ready\",\n \"script\",\n \"opennamespace\",\n \"closenamespace\"\n ];\n function SAXParser(strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt);\n }\n var parser = this;\n clearBuffers(parser);\n parser.q = parser.c = \"\";\n parser.bufferCheckPosition = sax2.MAX_BUFFER_LENGTH;\n parser.opt = opt || {};\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\";\n parser.tags = [];\n parser.closed = parser.closedRoot = parser.sawRoot = false;\n parser.tag = parser.error = null;\n parser.strict = !!strict;\n parser.noscript = !!(strict || parser.opt.noscript);\n parser.state = S.BEGIN;\n parser.strictEntities = parser.opt.strictEntities;\n parser.ENTITIES = parser.strictEntities ? Object.create(sax2.XML_ENTITIES) : Object.create(sax2.ENTITIES);\n parser.attribList = [];\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS);\n }\n if (parser.opt.unquotedAttributeValues === void 0) {\n parser.opt.unquotedAttributeValues = !strict;\n }\n parser.trackPosition = parser.opt.position !== false;\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0;\n }\n emit2(parser, \"onready\");\n }\n if (!Object.create) {\n Object.create = function(o) {\n function F() {\n }\n F.prototype = o;\n var newf = new F();\n return newf;\n };\n }\n if (!Object.keys) {\n Object.keys = function(o) {\n var a2 = [];\n for (var i2 in o) if (o.hasOwnProperty(i2)) a2.push(i2);\n return a2;\n };\n }\n function checkBufferLength(parser) {\n var maxAllowed = Math.max(sax2.MAX_BUFFER_LENGTH, 10);\n var maxActual = 0;\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n var len = parser[buffers[i2]].length;\n if (len > maxAllowed) {\n switch (buffers[i2]) {\n case \"textNode\":\n closeText(parser);\n break;\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n break;\n case \"script\":\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n break;\n default:\n error(parser, \"Max buffer length exceeded: \" + buffers[i2]);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n var m2 = sax2.MAX_BUFFER_LENGTH - maxActual;\n parser.bufferCheckPosition = m2 + parser.position;\n }\n function clearBuffers(parser) {\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n parser[buffers[i2]] = \"\";\n }\n }\n function flushBuffers(parser) {\n closeText(parser);\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n }\n }\n SAXParser.prototype = {\n end: function() {\n end(this);\n },\n write,\n resume: function() {\n this.error = null;\n return this;\n },\n close: function() {\n return this.write(null);\n },\n flush: function() {\n flushBuffers(this);\n }\n };\n var Stream;\n try {\n Stream = require(\"stream\").Stream;\n } catch (ex) {\n Stream = function() {\n };\n }\n if (!Stream) Stream = function() {\n };\n var streamWraps = sax2.EVENTS.filter(function(ev) {\n return ev !== \"error\" && ev !== \"end\";\n });\n function createStream(strict, opt) {\n return new SAXStream(strict, opt);\n }\n function SAXStream(strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt);\n }\n Stream.apply(this);\n this._parser = new SAXParser(strict, opt);\n this.writable = true;\n this.readable = true;\n var me = this;\n this._parser.onend = function() {\n me.emit(\"end\");\n };\n this._parser.onerror = function(er) {\n me.emit(\"error\", er);\n me._parser.error = null;\n };\n this._decoder = null;\n streamWraps.forEach(function(ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function() {\n return me._parser[\"on\" + ev];\n },\n set: function(h2) {\n if (!h2) {\n me.removeAllListeners(ev);\n me._parser[\"on\" + ev] = h2;\n return h2;\n }\n me.on(ev, h2);\n },\n enumerable: true,\n configurable: false\n });\n });\n }\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n });\n SAXStream.prototype.write = function(data) {\n if (typeof Buffer === \"function\" && typeof Buffer.isBuffer === \"function\" && Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require$$1.StringDecoder;\n this._decoder = new SD(\"utf8\");\n }\n data = this._decoder.write(data);\n }\n this._parser.write(data.toString());\n this.emit(\"data\", data);\n return true;\n };\n SAXStream.prototype.end = function(chunk) {\n if (chunk && chunk.length) {\n this.write(chunk);\n }\n this._parser.end();\n return true;\n };\n SAXStream.prototype.on = function(ev, handler) {\n var me = this;\n if (!me._parser[\"on\" + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\" + ev] = function() {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);\n args.splice(0, 0, ev);\n me.emit.apply(me, args);\n };\n }\n return Stream.prototype.on.call(me, ev, handler);\n };\n var CDATA = \"[CDATA[\";\n var DOCTYPE = \"DOCTYPE\";\n var XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\n var XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n function isWhitespace(c2) {\n return c2 === \" \" || c2 === \"\\n\" || c2 === \"\\r\" || c2 === \"\t\";\n }\n function isQuote(c2) {\n return c2 === '\"' || c2 === \"'\";\n }\n function isAttribEnd(c2) {\n return c2 === \">\" || isWhitespace(c2);\n }\n function isMatch(regex, c2) {\n return regex.test(c2);\n }\n function notMatch(regex, c2) {\n return !isMatch(regex, c2);\n }\n var S = 0;\n sax2.STATE = {\n BEGIN: S++,\n // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++,\n // leading whitespace\n TEXT: S++,\n // general stuff\n TEXT_ENTITY: S++,\n // & and such.\n OPEN_WAKA: S++,\n // <\n SGML_DECL: S++,\n // \n SCRIPT: S++,\n // \n\n\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files_version')\n\t.detectUser()\n\t.build()\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nexport default `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n","/*!\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getClient } from '@nextcloud/files/dav'\nimport moment from '@nextcloud/moment'\nimport { encodePath, join } from '@nextcloud/paths'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport davRequest from '../utils/davRequest.ts'\nimport logger from '../utils/logger.ts'\n\nexport interface Version {\n\tfileId: string // The id of the file associated to the version.\n\tlabel: string // 'Current version' or ''\n\tauthor: string | null // UID for the author of the version\n\tauthorName: string | null // Display name of the author\n\tfilename: string // File name relative to the version DAV endpoint\n\tbasename: string // A base name generated from the mtime\n\tmime: string // Empty for the current version, else the actual mime type of the version\n\tetag: string // Empty for the current version, else the actual mime type of the version\n\tsize: number // File size in bytes\n\ttype: string // 'file'\n\tmtime: number // Version creation date as a timestamp\n\tpermissions: string // Only readable: 'R'\n\tpreviewUrl: string // Preview URL of the version\n\turl: string // Download URL of the version\n\tsource: string // The WebDAV endpoint of the resource\n\tfileVersion: string | null // The version id, null for the current version\n}\n\nconst client = getClient()\n\n/**\n * Get file versions for a given node\n *\n * @param node - The node to fetch versions for\n */\nexport async function fetchVersions(node: INode): Promise {\n\tconst path = `/versions/${getCurrentUser()?.uid}/versions/${node.fileid}`\n\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: davRequest,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed\n\n\t\tconst versions = response.data\n\t\t\t// Filter out root\n\t\t\t.filter(({ mime }) => mime !== '')\n\t\t\t.map((version) => formatVersion(version as Required, node))\n\n\t\tconst authorIds = new Set(versions.map((version) => String(version.author)))\n\t\tconst authors = await axios.post(generateUrl('/displaynames'), { users: [...authorIds] })\n\n\t\tfor (const version of versions) {\n\t\t\tconst author = authors.data.users[version.author ?? '']\n\t\t\tif (author) {\n\t\t\t\tversion.authorName = author\n\t\t\t}\n\t\t}\n\n\t\treturn versions\n\t} catch (exception) {\n\t\tlogger.error('Could not fetch version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Restore the given version\n *\n * @param version - The version to restore\n */\nexport async function restoreVersion(version: Version) {\n\ttry {\n\t\tlogger.debug('Restoring version', { url: version.url })\n\t\tawait client.moveFile(\n\t\t\t`/versions/${getCurrentUser()?.uid}/versions/${version.fileId}/${version.fileVersion}`,\n\t\t\t`/versions/${getCurrentUser()?.uid}/restore/target`,\n\t\t)\n\t} catch (exception) {\n\t\tlogger.error('Could not restore version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Format version\n *\n * @param version - The version data from WebDAV\n * @param node - The original node\n */\nfunction formatVersion(version: Required, node: INode): Version {\n\tconst mtime = moment(version.lastmod).unix() * 1000\n\tlet previewUrl = ''\n\n\tif (mtime === node.mtime?.getTime()) { // Version is the current one\n\t\tpreviewUrl = generateUrl('/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1', {\n\t\t\tfileId: node.fileid,\n\t\t\tfileEtag: node.attributes.etag,\n\t\t})\n\t} else {\n\t\tpreviewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', {\n\t\t\tfile: node.path,\n\t\t\tfileVersion: version.basename,\n\t\t})\n\t}\n\n\treturn {\n\t\tfileId: node.fileid!.toString(),\n\t\t// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)\n\t\tlabel: version.props['version-label'] ? String(version.props['version-label']) : '',\n\t\tauthor: version.props['version-author'] ? String(version.props['version-author']) : null,\n\t\tauthorName: null,\n\t\tfilename: version.filename,\n\t\tbasename: moment(mtime).format('LLL'),\n\t\tmime: version.mime,\n\t\tetag: `${version.props.getetag}`,\n\t\tsize: version.size,\n\t\ttype: version.type,\n\t\tmtime,\n\t\tpermissions: 'R',\n\t\tpreviewUrl,\n\t\turl: join('/remote.php/dav', version.filename),\n\t\tsource: generateRemoteUrl('dav') + encodePath(version.filename),\n\t\tfileVersion: version.basename,\n\t}\n}\n\n/**\n * Set version label\n *\n * @param version - The version to set the label for\n * @param newLabel - The new label\n */\nexport async function setVersionLabel(version: Version, newLabel: string) {\n\treturn await client.customRequest(\n\t\tversion.filename,\n\t\t{\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata: `\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${newLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`,\n\t\t},\n\t)\n}\n\n/**\n * Delete version\n *\n * @param version - The version to delete\n */\nexport async function deleteVersion(version: Version) {\n\tawait client.deleteFile(version.filename)\n}\n","\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","props","__props","emit","__emit","previewLoaded","ref","previewErrored","capabilities","loadState","humanReadableSize","computed","formatFileSize","versionLabel","label","t","versionAuthor","getCurrentUser","versionHumanExplicitDate","moment","downloadURL","getRootUrl","enableLabeling","enableDeletion","hasDeletePermissions","hasPermission","Permission","hasUpdatePermissions","isDownloadable","attribute","labelUpdate","restoreVersion","deleteVersion","nextTick","click","event","compareVersion","node","permission","_createBlock","_unref","NcListItem","_createVNode","ImageOffOutline","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","NcAvatar","_hoisted_8","_hoisted_9","NcDateTime","NcActionButton","Pencil","_createTextVNode","FileCompare","BackupRestore","NcActionLink","Download","Delete","labelInput","useTemplateRef","internalLabel","dialogButtons","buttons","setVersionLabel","svgCheck","watchEffect","NcDialog","$emit","NcTextField","_toDisplayString","logger","getLoggerBuilder","_sfc_main$1","defineComponent","containerHeight","containerTop","containerBottom","currentRowTop","currentRowBottom","visibleSections","section","visibleRows","row","distance","visibleItems","rows","items","rowIdToKeyMap","item","usedTokens","key","unusedTokens","finalMapping","id","totalHeight","sectionHeight","paddingTop","buffer","value","currentRowTopDistanceFromTop","entries","entry","cr","_normalizeStyle","_renderSlot","davRequest","client","getClient","fetchVersions","path","versions","mime","version","formatVersion","authorIds","authors","axios","generateUrl","author","exception","mtime","previewUrl","join","generateRemoteUrl","encodePath","newLabel","__expose","setActive","isMobile","useIsMobile","isActive","loading","showVersionLabelForm","editedVersion","watch","toRef","currentVersionMtime","orderedVersions","a","b","sections","initialVersionMtime","canView","canCompare","active","handleRestore","restoredNode","restoreStartedEventState","showSuccess","showError","handleLabelUpdateRequest","handleLabelUpdate","oldLabel","handleDelete","index","openVersion","_versions","v","VirtualScrolling","_withCtx","_Fragment","_renderList","VersionEntry","NcLoadingIcon","VersionLabelDialog"],"mappings":"w3CAoBA,MAAKA,GAAU,CACb,KAAM,oBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,uPAAuP,iDAXnQC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,2CACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACXG,EAEO,OAFPP,GAEO,CADQI,EAAA,OAAbI,EAAA,EAAAP,EAAuC,aAAhBG,EAAA,KAAK,EAAA,CAAA,6DCO/BL,GAAU,CACb,KAAM,kBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,wMAAwM,iDAXpNC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb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,mBAAkBtD,EAAI,SAAS,QAAQ,QAAU2D,EAAA,MACjD,QAAOc,EACP,UAASzH,EACT,UAAS+G,EACT,yBAAsBK,EAAyBpE,EAAI,SAAS,OAAO,EACnE,SAAQuE,CAAA,sJAIF,SACV,IAAkE,CAA7CtB,EAAA,WAArB9F,EAAkEC,EAAA6H,EAAA,EAAA,OAApC,MAAM,2BAAA,oCAI/B9B,EAAA,WADPhG,EAIqC+H,GAAA,OAF5B,KAAMhC,EAAA,qCAAAA,EAAoB,MAAAxI,GACjC,MAAOyI,EAAA,MAAc,MACrB,iBAAckB,CAAA","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"FilesVersionsSidebarTab-DJgFZnW4.chunk.mjs","sources":["../node_modules/vue-material-design-icons/BackupRestore.vue","../node_modules/vue-material-design-icons/FileCompare.vue","../node_modules/vue-material-design-icons/ImageOffOutline.vue","../build/frontend/apps/files_versions/src/components/VersionEntry.vue","../build/frontend/apps/files_versions/src/components/VersionLabelDialog.vue","../build/frontend/apps/files_versions/src/utils/logger.ts","../build/frontend/apps/files_versions/src/components/VirtualScrolling.vue","../build/frontend/apps/files_versions/src/utils/davRequest.ts","../build/frontend/apps/files_versions/src/utils/versions.ts","../build/frontend/apps/files_versions/src/views/FilesVersionsSidebarTab.vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files_version')\n\t.detectUser()\n\t.build()\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nexport default `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n","/*!\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getClient } from '@nextcloud/files/dav'\nimport moment from '@nextcloud/moment'\nimport { encodePath, join } from '@nextcloud/paths'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport davRequest from '../utils/davRequest.ts'\nimport logger from '../utils/logger.ts'\n\nexport interface Version {\n\tfileId: string // The id of the file associated to the version.\n\tlabel: string // 'Current version' or ''\n\tauthor: string | null // UID for the author of the version\n\tauthorName: string | null // Display name of the author\n\tfilename: string // File name relative to the version DAV endpoint\n\tbasename: string // A base name generated from the mtime\n\tmime: string // Empty for the current version, else the actual mime type of the version\n\tetag: string // Empty for the current version, else the actual mime type of the version\n\tsize: number // File size in bytes\n\ttype: string // 'file'\n\tmtime: number // Version creation date as a timestamp\n\tpermissions: string // Only readable: 'R'\n\tpreviewUrl: string // Preview URL of the version\n\turl: string // Download URL of the version\n\tsource: string // The WebDAV endpoint of the resource\n\tfileVersion: string | null // The version id, null for the current version\n}\n\nconst client = getClient()\n\n/**\n * Get file versions for a given node\n *\n * @param node - The node to fetch versions for\n */\nexport async function fetchVersions(node: INode): Promise {\n\tconst path = `/versions/${getCurrentUser()?.uid}/versions/${node.fileid}`\n\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: davRequest,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed\n\n\t\tconst versions = response.data\n\t\t\t// Filter out root\n\t\t\t.filter(({ mime }) => mime !== '')\n\t\t\t.map((version) => formatVersion(version as Required, node))\n\n\t\tconst authorIds = new Set(versions.map((version) => String(version.author)))\n\t\tconst authors = await axios.post(generateUrl('/displaynames'), { users: [...authorIds] })\n\n\t\tfor (const version of versions) {\n\t\t\tconst author = authors.data.users[version.author ?? '']\n\t\t\tif (author) {\n\t\t\t\tversion.authorName = author\n\t\t\t}\n\t\t}\n\n\t\treturn versions\n\t} catch (exception) {\n\t\tlogger.error('Could not fetch version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Restore the given version\n *\n * @param version - The version to restore\n */\nexport async function restoreVersion(version: Version) {\n\ttry {\n\t\tlogger.debug('Restoring version', { url: version.url })\n\t\tawait client.moveFile(\n\t\t\t`/versions/${getCurrentUser()?.uid}/versions/${version.fileId}/${version.fileVersion}`,\n\t\t\t`/versions/${getCurrentUser()?.uid}/restore/target`,\n\t\t)\n\t} catch (exception) {\n\t\tlogger.error('Could not restore version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Format version\n *\n * @param version - The version data from WebDAV\n * @param node - The original node\n */\nfunction formatVersion(version: Required, node: INode): Version {\n\tconst mtime = moment(version.lastmod).unix() * 1000\n\tlet previewUrl = ''\n\n\tif (mtime === node.mtime?.getTime()) { // Version is the current one\n\t\tpreviewUrl = generateUrl('/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1', {\n\t\t\tfileId: node.fileid,\n\t\t\tfileEtag: node.attributes.etag,\n\t\t})\n\t} else {\n\t\tpreviewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', {\n\t\t\tfile: node.path,\n\t\t\tfileVersion: version.basename,\n\t\t})\n\t}\n\n\treturn {\n\t\tfileId: node.fileid!.toString(),\n\t\t// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)\n\t\tlabel: version.props['version-label'] ? String(version.props['version-label']) : '',\n\t\tauthor: version.props['version-author'] ? String(version.props['version-author']) : null,\n\t\tauthorName: null,\n\t\tfilename: version.filename,\n\t\tbasename: moment(mtime).format('LLL'),\n\t\tmime: version.mime,\n\t\tetag: `${version.props.getetag}`,\n\t\tsize: version.size,\n\t\ttype: version.type,\n\t\tmtime,\n\t\tpermissions: 'R',\n\t\tpreviewUrl,\n\t\turl: join('/remote.php/dav', version.filename),\n\t\tsource: generateRemoteUrl('dav') + encodePath(version.filename),\n\t\tfileVersion: version.basename,\n\t}\n}\n\n/**\n * Set version label\n *\n * @param version - The version to set the label for\n * @param newLabel - The new label\n */\nexport async function setVersionLabel(version: Version, newLabel: string) {\n\treturn await client.customRequest(\n\t\tversion.filename,\n\t\t{\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata: `\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${newLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`,\n\t\t},\n\t)\n}\n\n/**\n * Delete version\n *\n * @param version - The version to delete\n */\nexport async function deleteVersion(version: Version) {\n\tawait client.deleteFile(version.filename)\n}\n","\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","props","__props","emit","__emit","previewLoaded","ref","previewErrored","capabilities","loadState","humanReadableSize","computed","formatFileSize","versionLabel","label","t","versionAuthor","getCurrentUser","versionHumanExplicitDate","moment","downloadURL","getRootUrl","enableLabeling","enableDeletion","hasDeletePermissions","hasPermission","Permission","hasUpdatePermissions","isDownloadable","attribute","labelUpdate","restoreVersion","deleteVersion","nextTick","click","event","compareVersion","node","permission","_createBlock","_unref","NcListItem","_createVNode","ImageOffOutline","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","NcAvatar","_hoisted_8","_hoisted_9","NcDateTime","NcActionButton","Pencil","_createTextVNode","FileCompare","BackupRestore","NcActionLink","Download","Delete","labelInput","useTemplateRef","internalLabel","dialogButtons","buttons","setVersionLabel","svgCheck","watchEffect","NcDialog","$emit","NcTextField","_toDisplayString","logger","getLoggerBuilder","_sfc_main$1","defineComponent","containerHeight","containerTop","containerBottom","currentRowTop","currentRowBottom","visibleSections","section","visibleRows","row","distance","visibleItems","rows","items","rowIdToKeyMap","item","usedTokens","key","unusedTokens","finalMapping","id","totalHeight","sectionHeight","paddingTop","buffer","value","currentRowTopDistanceFromTop","entries","entry","cr","_normalizeStyle","_renderSlot","davRequest","client","getClient","fetchVersions","path","versions","mime","version","formatVersion","authorIds","authors","axios","generateUrl","author","exception","mtime","previewUrl","join","generateRemoteUrl","encodePath","newLabel","__expose","setActive","isMobile","useIsMobile","isActive","loading","showVersionLabelForm","editedVersion","watch","toRef","currentVersionMtime","orderedVersions","a","b","sections","initialVersionMtime","canView","canCompare","active","handleRestore","restoredNode","restoreStartedEventState","showSuccess","showError","handleLabelUpdateRequest","handleLabelUpdate","oldLabel","handleDelete","index","openVersion","_versions","v","VirtualScrolling","_withCtx","_Fragment","_renderList","VersionEntry","NcLoadingIcon","VersionLabelDialog"],"mappings":"w4CAoBA,MAAKA,GAAU,CACb,KAAM,oBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,uPAAuP,iDAXnQC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,2CACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACXG,EAEO,OAFPP,GAEO,CADQI,EAAA,OAAbI,EAAA,EAAAP,EAAuC,aAAhBG,EAAA,KAAK,EAAA,CAAA,6DCO/BL,GAAU,CACb,KAAM,kBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,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,MAAK,CAAA,EAAI,QAAQ,MAC1B,WAAU4D,EAAA,MACV,cAAaC,EAAA,MACb,eAAcb,EAAA,MACd,QAAShD,EAAI,SAAS,QACtB,KAAMlF,EAAA,KACN,aAAYkF,EAAI,SAAS,QAAQ,QAAUsD,EAAA,MAC3C,mBAAkBtD,EAAI,SAAS,QAAQ,QAAU2D,EAAA,MACjD,QAAOc,EACP,UAASzH,EACT,UAAS+G,EACT,yBAAsBK,EAAyBpE,EAAI,SAAS,OAAO,EACnE,SAAQuE,CAAA,sJAIF,SACV,IAAkE,CAA7CtB,EAAA,WAArB9F,EAAkEC,EAAA6H,EAAA,EAAA,OAApC,MAAM,2BAAA,oCAI/B9B,EAAA,WADPhG,EAIqC+H,GAAA,OAF5B,KAAMhC,EAAA,qCAAAA,EAAoB,MAAAxI,GACjC,MAAOyI,EAAA,MAAc,MACrB,iBAAckB,CAAA","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/dist/FilesVersionsSidebarTab-BUpjD0Zh.chunk.mjs.map.license b/dist/FilesVersionsSidebarTab-DJgFZnW4.chunk.mjs.map.license similarity index 100% rename from dist/FilesVersionsSidebarTab-BUpjD0Zh.chunk.mjs.map.license rename to dist/FilesVersionsSidebarTab-DJgFZnW4.chunk.mjs.map.license diff --git a/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs b/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs deleted file mode 100644 index 36e4ffa91bed7..0000000000000 --- a/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{a as g,f as C,d as I}from"./NcNoteCard-CVhtNL04-Bouqxu_R.chunk.mjs";import{h as S,i as p}from"./index-JpgrUA2Z-C-bEcc7c.chunk.mjs";import{_ as m}from"./createElementId-DhjFt1I9-sbdxHOjK.chunk.mjs";import{f as x,s as i,o as e,A as o,p as h,c as f,v as c,J as b,x as d,t as l,q as v,e as V,w}from"./preload-helper-BcKx2dRj.chunk.mjs";const M={beforeUpdate(){this.text=this.getText()},data(){return{text:this.getText()}},computed:{isLongText(){return this.text&&this.text.trim().length>20}},methods:{getText(){return this.$slots.default?.()[0].children?.trim?.()||""}}},_={mixins:[M],props:{icon:{type:String,default:""},name:{type:String,default:""},title:{type:String,default:""},closeAfterClick:{type:Boolean,default:!1},ariaLabel:{type:String,default:null}},inject:{closeMenu:{from:S}},emits:["click"],created(){"ariaHidden"in this.$attrs},computed:{isIconUrl(){try{return!!new URL(this.icon,this.icon.startsWith("/")?window.location.origin:void 0)}catch{return!1}}},methods:{onClick(t){this.$emit("click",t),this.closeAfterClick&&this.closeMenu(!1)}}},L={name:"NcActionButton",components:{NcIconSvgWrapper:g},mixins:[_],inject:{isInSemanticMenu:{from:p,default:!1}},props:{disabled:{type:Boolean,default:!1},isMenu:{type:Boolean,default:!1},type:{type:String,default:"button",validator:t=>["button","checkbox","radio","reset","submit"].includes(t)},modelValue:{type:[Boolean,String],default:null},value:{type:String,default:null},description:{type:String,default:""}},emits:["update:modelValue"],setup(){return{mdiCheck:I,mdiChevronRight:C}},computed:{isFocusable(){return!this.disabled},isChecked(){return this.type==="radio"&&typeof this.modelValue!="boolean"?this.modelValue===this.value:this.modelValue},nativeType(){return this.type==="submit"||this.type==="reset"?this.type:"button"},buttonAttributes(){const t={};return this.isInSemanticMenu?(t.role="menuitem",this.type==="radio"?(t.role="menuitemradio",t["aria-checked"]=this.isChecked?"true":"false"):(this.type==="checkbox"||this.nativeType==="button"&&this.modelValue!==null)&&(t.role="menuitemcheckbox",t["aria-checked"]=this.modelValue===null?"mixed":this.modelValue?"true":"false")):this.modelValue!==null&&this.nativeType==="button"&&(t["aria-pressed"]=this.modelValue?"true":"false"),t}},methods:{handleClick(t){this.onClick(t),(this.modelValue!==null||this.type!=="button")&&(this.type==="radio"?typeof this.modelValue!="boolean"?this.isChecked||this.$emit("update:modelValue",this.value):this.$emit("update:modelValue",!this.isChecked):this.$emit("update:modelValue",!this.isChecked))}}},$=["role"],T=["aria-label","disabled","title","type"],U={class:"action-button__longtext-wrapper"},A={key:0,class:"action-button__name"},N=["textContent"],R={key:2,class:"action-button__text"},W=["textContent"],j={key:2,class:"action-button__pressed-icon material-design-icon"};function B(t,s,a,u,k,n){const r=x("NcIconSvgWrapper");return e(),i("li",{class:d(["action",{"action--disabled":a.disabled}]),role:n.isInSemanticMenu&&"presentation"},[o("button",v({"aria-label":t.ariaLabel,class:["action-button button-vue",{"action-button--active":n.isChecked,focusable:n.isFocusable}],disabled:a.disabled,title:t.title,type:n.nativeType},n.buttonAttributes,{onClick:s[0]||(s[0]=(...y)=>n.handleClick&&n.handleClick(...y))}),[h(t.$slots,"icon",{},()=>[o("span",{class:d([[t.isIconUrl?"action-button__icon--url":t.icon],"action-button__icon"]),style:b({backgroundImage:t.isIconUrl?`url(${t.icon})`:null}),"aria-hidden":"true"},null,6)],!0),o("span",U,[t.name?(e(),i("strong",A,l(t.name),1)):c("",!0),t.isLongText?(e(),i("span",{key:1,class:"action-button__longtext",textContent:l(t.text)},null,8,N)):(e(),i("span",R,l(t.text),1)),a.description?(e(),i("span",{key:3,class:"action-button__description",textContent:l(a.description)},null,8,W)):c("",!0)]),a.isMenu?(e(),f(r,{key:0,class:"action-button__menu-icon",directional:"",path:u.mdiChevronRight},null,8,["path"])):n.isChecked?(e(),f(r,{key:1,path:u.mdiCheck,class:"action-button__pressed-icon"},null,8,["path"])):n.isChecked===!1?(e(),i("span",j)):c("",!0),c("",!0)],16,T)],10,$)}const lt=m(L,[["render",B],["__scopeId","data-v-6c2daf4e"]]),q={name:"NcActionLink",mixins:[_],inject:{isInSemanticMenu:{from:p,default:!1}},props:{href:{type:String,required:!0,validator:t=>{try{return new URL(t)}catch{return t.startsWith("#")||t.startsWith("/")}}},download:{type:String,default:null},target:{type:String,default:"_self",validator:t=>t&&(!t.startsWith("_")||["_blank","_self","_parent","_top"].indexOf(t)>-1)},title:{type:String,default:null}}},F=["role"],O=["download","href","aria-label","target","title","role"],H={key:0,class:"action-link__longtext-wrapper"},J={class:"action-link__name"},z=["textContent"],D=["textContent"],E={key:2,class:"action-link__text"};function G(t,s,a,u,k,n){return e(),i("li",{class:"action",role:n.isInSemanticMenu&&"presentation"},[o("a",{download:a.download,href:a.href,"aria-label":t.ariaLabel,target:a.target,title:a.title,class:"action-link focusable",rel:"nofollow noreferrer noopener",role:n.isInSemanticMenu&&"menuitem",onClick:s[0]||(s[0]=(...r)=>t.onClick&&t.onClick(...r))},[h(t.$slots,"icon",{},()=>[o("span",{"aria-hidden":"true",class:d(["action-link__icon",[t.isIconUrl?"action-link__icon--url":t.icon]]),style:b({backgroundImage:t.isIconUrl?`url(${t.icon})`:null})},null,6)],!0),t.name?(e(),i("span",H,[o("strong",J,l(t.name),1),s[1]||(s[1]=o("br",null,null,-1)),o("span",{class:"action-link__longtext",textContent:l(t.text)},null,8,z)])):t.isLongText?(e(),i("span",{key:1,class:"action-link__longtext",textContent:l(t.text)},null,8,D)):(e(),i("span",E,l(t.text),1)),c("",!0)],8,O)],8,F)}const st=m(q,[["render",G],["__scopeId","data-v-32f01b7a"]]),K={name:"NcActionRouter",mixins:[_],inject:{isInSemanticMenu:{from:p,default:!1}},props:{to:{type:[String,Object],required:!0}}},P=["role"],Q={key:0,class:"action-router__longtext-wrapper"},X={class:"action-router__name"},Y=["textContent"],Z=["textContent"],tt={key:2,class:"action-router__text"};function et(t,s,a,u,k,n){const r=x("RouterLink");return e(),i("li",{class:"action",role:n.isInSemanticMenu&&"presentation"},[V(r,{"aria-label":t.ariaLabel,class:"action-router focusable",rel:"nofollow noreferrer noopener",role:n.isInSemanticMenu&&"menuitem",title:t.title,to:a.to,onClick:t.onClick},{default:w(()=>[h(t.$slots,"icon",{},()=>[o("span",{"aria-hidden":"true",class:d(["action-router__icon",[t.isIconUrl?"action-router__icon--url":t.icon]]),style:b({backgroundImage:t.isIconUrl?`url(${t.icon})`:null})},null,6)],!0),t.name?(e(),i("span",Q,[o("strong",X,l(t.name),1),s[0]||(s[0]=o("br",null,null,-1)),o("span",{class:"action-router__longtext",textContent:l(t.text)},null,8,Y)])):t.isLongText?(e(),i("span",{key:1,class:"action-router__longtext",textContent:l(t.text)},null,8,Z)):(e(),i("span",tt,l(t.text),1)),c("",!0)]),_:3},8,["aria-label","role","title","to","onClick"])],8,P)}const rt=m(K,[["render",et],["__scopeId","data-v-87267750"]]);export{M as A,st as N,lt as a,_ as b,rt as c}; -//# sourceMappingURL=NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs.map diff --git a/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs.map b/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs.map deleted file mode 100644 index 608b0284afdd2..0000000000000 --- a/dist/NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NcActionRouter-oT-YU_jf-CGKyc3aD.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/actionGlobal-BZFdtdJL.mjs","../node_modules/@nextcloud/vue/dist/chunks/actionText-DYzDdbVe.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcActionButton-pKOSrlGE.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcActionLink-vEvKSV4N.mjs","../node_modules/@nextcloud/vue/dist/chunks/NcActionRouter-oT-YU_jf.mjs"],"sourcesContent":["const ActionGlobalMixin = {\n beforeUpdate() {\n this.text = this.getText();\n },\n data() {\n return {\n // $slots are not reactive.\n // We need to update the content manually\n text: this.getText()\n };\n },\n computed: {\n isLongText() {\n return this.text && this.text.trim().length > 20;\n }\n },\n methods: {\n getText() {\n return this.$slots.default?.()[0].children?.trim?.() || \"\";\n }\n }\n};\nexport {\n ActionGlobalMixin as A\n};\n//# sourceMappingURL=actionGlobal-BZFdtdJL.mjs.map\n","import { warn } from \"vue\";\nimport { N as NC_ACTIONS_CLOSE_MENU } from \"./useNcActions-CiGWxAJE.mjs\";\nimport { A as ActionGlobalMixin } from \"./actionGlobal-BZFdtdJL.mjs\";\nconst ActionTextMixin = {\n mixins: [ActionGlobalMixin],\n props: {\n /**\n * Icon to show with the action, can be either a CSS class or an URL\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * The main text content of the entry.\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * The title attribute of the element.\n */\n title: {\n type: String,\n default: \"\"\n },\n /**\n * Whether we close the Actions menu after the click\n */\n closeAfterClick: {\n type: Boolean,\n default: false\n },\n /**\n * Aria label for the button. Not needed if the button has text.\n */\n ariaLabel: {\n type: String,\n default: null\n }\n },\n inject: {\n closeMenu: {\n from: NC_ACTIONS_CLOSE_MENU\n }\n },\n emits: [\n \"click\"\n ],\n created() {\n if (\"ariaHidden\" in this.$attrs) {\n warn(\"[NcAction*]: Do not set the ariaHidden attribute as the root element will inherit the incorrect aria-hidden.\");\n }\n },\n computed: {\n /**\n * Check if icon prop is an URL\n *\n * @return {boolean} Whether the icon prop is an URL\n */\n isIconUrl() {\n try {\n return !!new URL(this.icon, this.icon.startsWith(\"/\") ? window.location.origin : void 0);\n } catch {\n return false;\n }\n }\n },\n methods: {\n onClick(event) {\n this.$emit(\"click\", event);\n if (this.closeAfterClick) {\n this.closeMenu(false);\n }\n }\n }\n};\nexport {\n ActionTextMixin as A\n};\n//# sourceMappingURL=actionText-DYzDdbVe.mjs.map\n","import '../assets/NcActionButton-Bb0ihLdt.css';\nimport { c as mdiChevronRight, d as mdiCheck } from \"./mdi-XFJRiRqJ.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper-BvLanNaW.mjs\";\nimport { A as ActionTextMixin } from \"./actionText-DYzDdbVe.mjs\";\nimport { a as NC_ACTIONS_IS_SEMANTIC_MENU } from \"./useNcActions-CiGWxAJE.mjs\";\nimport { resolveComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, mergeProps, renderSlot, createBlock, createCommentVNode, normalizeStyle, toDisplayString } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nconst _sfc_main = {\n name: \"NcActionButton\",\n components: {\n NcIconSvgWrapper\n },\n mixins: [ActionTextMixin],\n inject: {\n isInSemanticMenu: {\n from: NC_ACTIONS_IS_SEMANTIC_MENU,\n default: false\n }\n },\n props: {\n /**\n * disabled state of the action button\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * If this is a menu, a chevron icon will\n * be added at the end of the line\n */\n isMenu: {\n type: Boolean,\n default: false\n },\n /**\n * The button's behavior, by default the button acts like a normal button with optional toggle button behavior if `modelValue` is `true` or `false`.\n * But you can also set to checkbox button behavior with tri-state or radio button like behavior.\n * This extends the native HTML button type attribute.\n */\n type: {\n type: String,\n default: \"button\",\n validator: (behavior) => [\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\"].includes(behavior)\n },\n /**\n * The buttons state if `type` is 'checkbox' or 'radio' (meaning if it is pressed / selected).\n * For checkbox and toggle button behavior - boolean value.\n * For radio button behavior - could be a boolean checked or a string with the value of the button.\n * Note: Unlike native radio buttons, NcActionButton are not grouped by name, so you need to connect them by bind correct modelValue.\n *\n * **This is not availabe for `type='submit'` or `type='reset'`**\n *\n * If using `type='checkbox'` a `model-value` of `true` means checked, `false` means unchecked and `null` means indeterminate (tri-state)\n * For `type='radio'` `null` is equal to `false`\n */\n modelValue: {\n type: [Boolean, String],\n default: null\n },\n /**\n * The value used for the `modelValue` when this component is used with radio behavior\n * Similar to the `value` attribute of ``\n */\n value: {\n type: String,\n default: null\n },\n /**\n * Small underlying text content of the entry\n */\n description: {\n type: String,\n default: \"\"\n }\n },\n emits: [\"update:modelValue\"],\n setup() {\n return {\n mdiCheck,\n mdiChevronRight\n };\n },\n computed: {\n /**\n * determines if the action is focusable\n *\n * @return {boolean} is the action focusable ?\n */\n isFocusable() {\n return !this.disabled;\n },\n /**\n * The current \"checked\" or \"pressed\" state for the model behavior\n */\n isChecked() {\n if (this.type === \"radio\" && typeof this.modelValue !== \"boolean\") {\n return this.modelValue === this.value;\n }\n return this.modelValue;\n },\n /**\n * The native HTML type to set on the button\n */\n nativeType() {\n if (this.type === \"submit\" || this.type === \"reset\") {\n return this.type;\n }\n return \"button\";\n },\n /**\n * HTML attributes to bind to the