\\n\\t\\n\\t\\t\\n\\n\\t\\t{{ size }}\\n\\n\\t\\t\\n\\t\\t\\t•\\n\\t\\t\\t\\n\\t\\t\\n\\n\\t\\t\\n\\t\\t\\t•\\n\\t\\t\\t\\n\\t\\t\\n\\t
\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"filesSidebarSubname\": `_filesSidebarSubname_yXZVi`,\n\t\"filesSidebarSubname__separator\": `_filesSidebarSubname__separator__OQUr`,\n\t\"filesSidebarSubname__userBubble\": `_filesSidebarSubname__userBubble_XTdWm`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","import { getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav';\nimport { join } from 'path';\nimport logger from '../logger.ts';\nimport { useFilesStore } from '../store/files.ts';\nimport { getPinia } from '../store/index.ts';\nimport { useSearchStore } from '../store/search.ts';\nimport { client } from './WebdavClient.ts';\nimport { searchNodes } from './WebDavSearch.ts';\n/**\n * Get contents implementation for the files view.\n * This also allows to fetch local search results when the user is currently filtering.\n *\n * @param path - The path to query\n * @param options - Options\n * @param options.signal - Abort signal to cancel the request\n */\nexport async function getContents(path = '/', options) {\n const searchStore = useSearchStore(getPinia());\n if (searchStore.query.length < 3) {\n return await defaultGetContents(path, options);\n }\n return await getLocalSearch(path, searchStore.query, options?.signal);\n}\n/**\n * Generic `getContents` implementation for the users files.\n *\n * @param path - The path to get the contents\n * @param options - Options\n * @param options.signal - Abort signal to cancel the request\n */\nexport async function defaultGetContents(path, options) {\n path = join(getRootPath(), path);\n const propfindPayload = getDefaultPropfind();\n const contentsResponse = await client.getDirectoryContents(path, {\n details: true,\n data: propfindPayload,\n includeSelf: true,\n signal: options?.signal,\n });\n const root = contentsResponse.data[0];\n const contents = contentsResponse.data.slice(1);\n if (root?.filename !== path && `${root?.filename}/` !== path) {\n logger.debug(`Exepected \"${path}\" but got filename \"${root.filename}\" instead.`);\n throw new Error('Root node does not match requested path');\n }\n return {\n folder: resultToNode(root),\n contents: contents.map((result) => {\n try {\n return resultToNode(result);\n }\n catch (error) {\n logger.error(`Invalid node detected '${result.basename}'`, { error });\n return null;\n }\n }).filter(Boolean),\n };\n}\n/**\n * Get the local search results for the current folder.\n *\n * @param path - The path\n * @param query - The current search query\n * @param signal - The aboort signal\n */\nasync function getLocalSearch(path, query, signal) {\n const filesStore = useFilesStore(getPinia());\n let folder = filesStore.getDirectoryByPath('files', path);\n if (!folder) {\n const rootPath = join(getRootPath(), path);\n const stat = await client.stat(rootPath, { details: true });\n folder = resultToNode(stat.data);\n }\n const contents = await searchNodes(query, { dir: path, signal });\n return {\n folder,\n contents,\n };\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { subscribe } from '@nextcloud/event-bus';\nimport { File, FileType, getNavigation } from '@nextcloud/files';\nimport { dirname } from '@nextcloud/paths';\nimport { defineStore } from 'pinia';\nimport Vue from 'vue';\nimport logger from '../logger.ts';\nimport { useFilesStore } from './files.ts';\n/**\n *\n * @param args\n */\nexport function usePathsStore(...args) {\n const files = useFilesStore(...args);\n const store = defineStore('paths', {\n state: () => ({\n paths: {},\n }),\n getters: {\n getPath: (state) => {\n return (service, path) => {\n if (!state.paths[service]) {\n return undefined;\n }\n return state.paths[service][path];\n };\n },\n },\n actions: {\n addPath(payload) {\n // If it doesn't exists, init the service state\n if (!this.paths[payload.service]) {\n Vue.set(this.paths, payload.service, {});\n }\n // Now we can set the provided path\n Vue.set(this.paths[payload.service], payload.path, payload.source);\n },\n deletePath(service, path) {\n // skip if service does not exist\n if (!this.paths[service]) {\n return;\n }\n Vue.delete(this.paths[service], path);\n },\n onCreatedNode(node) {\n const service = getNavigation()?.active?.id || 'files';\n if (!node.fileid) {\n logger.error('Node has no fileid', { node });\n return;\n }\n // Only add path if it's a folder\n if (node.type === FileType.Folder) {\n this.addPath({\n service,\n path: node.path,\n source: node.source,\n });\n }\n // Update parent folder children if exists\n // If the folder is the root, get it and update it\n this.addNodeToParentChildren(node);\n },\n onDeletedNode(node) {\n const service = getNavigation()?.active?.id || 'files';\n if (node.type === FileType.Folder) {\n // Delete the path\n this.deletePath(service, node.path);\n }\n this.deleteNodeFromParentChildren(node);\n },\n onMovedNode({ node, oldSource }) {\n const service = getNavigation()?.active?.id || 'files';\n // Update the path of the node\n if (node.type === FileType.Folder) {\n // Delete the old path if it exists\n const oldPath = Object.entries(this.paths[service]).find(([, source]) => source === oldSource);\n if (oldPath?.[0]) {\n this.deletePath(service, oldPath[0]);\n }\n // Add the new path\n this.addPath({\n service,\n path: node.path,\n source: node.source,\n });\n }\n // Dummy simple clone of the renamed node from a previous state\n const oldNode = new File({\n source: oldSource,\n owner: node.owner,\n mime: node.mime,\n root: node.root,\n });\n this.deleteNodeFromParentChildren(oldNode);\n this.addNodeToParentChildren(node);\n },\n deleteNodeFromParentChildren(node) {\n const service = getNavigation()?.active?.id || 'files';\n // Update children of a root folder\n const parentSource = dirname(node.source);\n const folder = (node.dirname === '/' ? files.getRoot(service) : files.getNode(parentSource));\n if (folder) {\n // ensure sources are unique\n const children = new Set(folder._children ?? []);\n children.delete(node.source);\n Vue.set(folder, '_children', [...children.values()]);\n logger.debug('Children updated', { parent: folder, node, children: folder._children });\n return;\n }\n logger.debug('Parent path does not exists, skipping children update', { node });\n },\n addNodeToParentChildren(node) {\n const service = getNavigation()?.active?.id || 'files';\n // Update children of a root folder\n const parentSource = dirname(node.source);\n const folder = (node.dirname === '/' ? files.getRoot(service) : files.getNode(parentSource));\n if (folder) {\n // ensure sources are unique\n const children = new Set(folder._children ?? []);\n children.add(node.source);\n Vue.set(folder, '_children', [...children.values()]);\n logger.debug('Children updated', { parent: folder, node, children: folder._children });\n return;\n }\n logger.debug('Parent path does not exists, skipping children update', { node });\n },\n },\n });\n const pathsStore = store(...args);\n // Make sure we only register the listeners once\n if (!pathsStore._initialized) {\n subscribe('files:node:created', pathsStore.onCreatedNode);\n subscribe('files:node:deleted', pathsStore.onDeletedNode);\n subscribe('files:node:moved', pathsStore.onMovedNode);\n pathsStore._initialized = true;\n }\n return pathsStore;\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.toast-loading-icon{margin-inline-start:-4px;min-width:26px}.app-content[data-v-3b8f401d]{display:flex;overflow:hidden;flex-direction:column;max-height:100%;position:relative !important}.files-list__header[data-v-3b8f401d]{display:flex;align-items:center;flex:0 0;max-width:100%;margin-block:var(--app-navigation-padding, 4px);margin-inline:calc(var(--default-clickable-area, 44px) + 2*var(--app-navigation-padding, 4px)) var(--app-navigation-padding, 4px)}.files-list__header--public[data-v-3b8f401d]{margin-inline:0 var(--app-navigation-padding, 4px)}.files-list__header>*[data-v-3b8f401d]{flex:0 0}.files-list__header-share-button[data-v-3b8f401d]{color:var(--color-text-maxcontrast) !important}.files-list__header-share-button--shared[data-v-3b8f401d]{color:var(--color-main-text) !important}.files-list__header-actions[data-v-3b8f401d]{min-width:fit-content !important;margin-inline:calc(var(--default-grid-baseline)*2)}.files-list__before[data-v-3b8f401d]{display:flex;flex-direction:column;gap:calc(var(--default-grid-baseline)*2);margin-inline:calc(var(--default-clickable-area) + 2*var(--app-navigation-padding))}.files-list__empty-view-wrapper[data-v-3b8f401d]{display:flex;height:100%}.files-list__refresh-icon[data-v-3b8f401d]{flex:0 0 var(--default-clickable-area);width:var(--default-clickable-area);height:var(--default-clickable-area)}.files-list__loading-icon[data-v-3b8f401d]{margin:auto}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/views/FilesList.vue\"],\"names\":[],\"mappings\":\"AACA,oBAEC,wBAAA,CAEA,cAAA,CAGD,8BAEC,YAAA,CACA,eAAA,CACA,qBAAA,CACA,eAAA,CACA,4BAAA,CAIA,qCACC,YAAA,CACA,kBAAA,CAEA,QAAA,CACA,cAAA,CAEA,+CAAA,CACA,iIAAA,CAEA,6CAEC,kDAAA,CAGD,uCAGC,QAAA,CAGD,kDACC,8CAAA,CAEA,0DACC,uCAAA,CAIF,6CACC,gCAAA,CACA,kDAAA,CAIF,qCACC,YAAA,CACA,qBAAA,CACA,wCAAA,CACA,mFAAA,CAGD,iDACC,YAAA,CACA,WAAA,CAGD,2CACC,sCAAA,CACA,mCAAA,CACA,oCAAA,CAGD,2CACC,WAAA\",\"sourcesContent\":[\"\\n:global(.toast-loading-icon) {\\n\\t// Reduce start margin (it was made for text but this is an icon)\\n\\tmargin-inline-start: -4px;\\n\\t// 16px icon + 5px on both sides\\n\\tmin-width: 26px;\\n}\\n\\n.app-content {\\n\\t// Virtual list needs to be full height and is scrollable\\n\\tdisplay: flex;\\n\\toverflow: hidden;\\n\\tflex-direction: column;\\n\\tmax-height: 100%;\\n\\tposition: relative !important;\\n}\\n\\n.files-list {\\n\\t&__header {\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\t// Do not grow or shrink (vertically)\\n\\t\\tflex: 0 0;\\n\\t\\tmax-width: 100%;\\n\\t\\t// Align with the navigation toggle icon\\n\\t\\tmargin-block: var(--app-navigation-padding, 4px);\\n\\t\\tmargin-inline: calc(var(--default-clickable-area, 44px) + 2 * var(--app-navigation-padding, 4px)) var(--app-navigation-padding, 4px);\\n\\n\\t\\t&--public {\\n\\t\\t\\t// There is no navigation toggle on public shares\\n\\t\\t\\tmargin-inline: 0 var(--app-navigation-padding, 4px);\\n\\t\\t}\\n\\n\\t\\t>* {\\n\\t\\t\\t// Do not grow or shrink (horizontally)\\n\\t\\t\\t// Only the breadcrumbs shrinks\\n\\t\\t\\tflex: 0 0;\\n\\t\\t}\\n\\n\\t\\t&-share-button {\\n\\t\\t\\tcolor: var(--color-text-maxcontrast) !important;\\n\\n\\t\\t\\t&--shared {\\n\\t\\t\\t\\tcolor: var(--color-main-text) !important;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&-actions {\\n\\t\\t\\tmin-width: fit-content !important;\\n\\t\\t\\tmargin-inline: calc(var(--default-grid-baseline) * 2);\\n\\t\\t}\\n\\t}\\n\\n\\t&__before {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\tgap: calc(var(--default-grid-baseline) * 2);\\n\\t\\tmargin-inline: calc(var(--default-clickable-area) + 2 * var(--app-navigation-padding));\\n\\t}\\n\\n\\t&__empty-view-wrapper {\\n\\t\\tdisplay: flex;\\n\\t\\theight: 100%;\\n\\t}\\n\\n\\t&__refresh-icon {\\n\\t\\tflex: 0 0 var(--default-clickable-area);\\n\\t\\twidth: var(--default-clickable-area);\\n\\t\\theight: var(--default-clickable-area);\\n\\t}\\n\\n\\t&__loading-icon {\\n\\t\\tmargin: auto;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__column-sort-button[data-v-4a8557e6]{margin:0 calc(var(--button-padding, var(--cell-margin))*-1);min-width:calc(100% - 3*var(--cell-margin)) !important}.files-list__column-sort-button-text[data-v-4a8557e6]{color:var(--color-text-maxcontrast);font-weight:normal}.files-list__column-sort-button-icon[data-v-4a8557e6]{color:var(--color-text-maxcontrast);opacity:0;transition:opacity var(--animation-quick);inset-inline-start:-10px}.files-list__column-sort-button--size .files-list__column-sort-button-icon[data-v-4a8557e6]{inset-inline-start:10px}.files-list__column-sort-button--active .files-list__column-sort-button-icon[data-v-4a8557e6],.files-list__column-sort-button:hover .files-list__column-sort-button-icon[data-v-4a8557e6],.files-list__column-sort-button:focus .files-list__column-sort-button-icon[data-v-4a8557e6],.files-list__column-sort-button:active .files-list__column-sort-button-icon[data-v-4a8557e6]{opacity:1}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FilesListTableHeaderButton.vue\"],\"names\":[],\"mappings\":\"AACA,iDAEC,2DAAA,CACA,sDAAA,CAEA,sDACC,mCAAA,CACA,kBAAA,CAGD,sDACC,mCAAA,CACA,SAAA,CACA,yCAAA,CACA,wBAAA,CAGD,4FACC,uBAAA,CAGD,mXAIC,SAAA\",\"sourcesContent\":[\"\\n.files-list__column-sort-button {\\n\\t// Compensate for cells margin\\n\\tmargin: 0 calc(var(--button-padding, var(--cell-margin)) * -1);\\n\\tmin-width: calc(100% - 3 * var(--cell-margin))!important;\\n\\n\\t&-text {\\n\\t\\tcolor: var(--color-text-maxcontrast);\\n\\t\\tfont-weight: normal;\\n\\t}\\n\\n\\t&-icon {\\n\\t\\tcolor: var(--color-text-maxcontrast);\\n\\t\\topacity: 0;\\n\\t\\ttransition: opacity var(--animation-quick);\\n\\t\\tinset-inline-start: -10px;\\n\\t}\\n\\n\\t&--size &-icon {\\n\\t\\tinset-inline-start: 10px;\\n\\t}\\n\\n\\t&--active &-icon,\\n\\t&:hover &-icon,\\n\\t&:focus &-icon,\\n\\t&:active &-icon {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__drag-drop-notice[data-v-165997de]{display:flex;align-items:center;justify-content:center;width:100%;min-height:102px;margin:0;user-select:none;color:var(--color-text-maxcontrast);background-color:var(--color-main-background);border-color:#000}.files-list__drag-drop-notice h3[data-v-165997de]{margin-inline-start:16px;color:inherit}.files-list__drag-drop-notice-wrapper[data-v-165997de]{display:flex;align-items:center;justify-content:center;height:15vh;max-height:70%;padding:0 5vw;border:2px var(--color-border-dark) dashed;border-radius:var(--border-radius-large)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/DragAndDropNotice.vue\"],\"names\":[],\"mappings\":\"AACA,+CACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,UAAA,CAEA,gBAAA,CACA,QAAA,CACA,gBAAA,CACA,mCAAA,CACA,6CAAA,CACA,iBAAA,CAEA,kDACC,wBAAA,CACA,aAAA,CAGD,uDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,WAAA,CACA,cAAA,CACA,aAAA,CACA,0CAAA,CACA,wCAAA\",\"sourcesContent\":[\"\\n.files-list__drag-drop-notice {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\twidth: 100%;\\n\\t// Breadcrumbs height + row thead height\\n\\tmin-height: calc(58px + 44px);\\n\\tmargin: 0;\\n\\tuser-select: none;\\n\\tcolor: var(--color-text-maxcontrast);\\n\\tbackground-color: var(--color-main-background);\\n\\tborder-color: black;\\n\\n\\th3 {\\n\\t\\tmargin-inline-start: 16px;\\n\\t\\tcolor: inherit;\\n\\t}\\n\\n\\t&-wrapper {\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\tjustify-content: center;\\n\\t\\theight: 15vh;\\n\\t\\tmax-height: 70%;\\n\\t\\tpadding: 0 5vw;\\n\\t\\tborder: 2px var(--color-border-dark) dashed;\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list--grid tbody.files-list__tbody{--item-padding: 16px;--icon-preview-size: 166px;--name-height: var(--default-clickable-area);--mtime-height: calc(var(--font-size-small) + var(--default-grid-baseline));--row-width: calc(var(--icon-preview-size) + var(--item-padding) * 2);--row-height: calc(var(--icon-preview-size) + var(--name-height) + var(--mtime-height) + var(--item-padding) * 2);--checkbox-padding: 0px;display:grid;grid-template-columns:repeat(auto-fill, var(--row-width));align-content:center;align-items:center;justify-content:space-around;justify-items:center}.files-list--grid tbody.files-list__tbody tr{display:flex;flex-direction:column;width:var(--row-width);height:var(--row-height);border:none;border-radius:var(--border-radius-large);padding:var(--item-padding)}.files-list--grid tbody.files-list__tbody .files-list__row-checkbox{position:absolute;z-index:9;top:calc(var(--item-padding)/2);inset-inline-start:calc(var(--item-padding)/2);overflow:hidden;--checkbox-container-size: 44px;width:var(--checkbox-container-size);height:var(--checkbox-container-size)}.files-list--grid tbody.files-list__tbody .files-list__row-checkbox .checkbox-radio-switch__content::after{content:\"\";width:16px;height:16px;position:absolute;inset-inline-start:50%;margin-inline-start:-8px;z-index:-1;background:var(--color-main-background)}.files-list--grid tbody.files-list__tbody .files-list__row-icon-favorite{position:absolute;top:0;inset-inline-end:0;display:flex;align-items:center;justify-content:center;width:var(--clickable-area);height:var(--clickable-area)}.files-list--grid tbody.files-list__tbody .files-list__row-name{display:flex;flex-direction:column;width:var(--icon-preview-size);height:calc(var(--icon-preview-size) + var(--name-height));overflow:visible}.files-list--grid tbody.files-list__tbody .files-list__row-name span.files-list__row-icon{width:var(--icon-preview-size);height:var(--icon-preview-size)}.files-list--grid tbody.files-list__tbody .files-list__row-name .files-list__row-name-text{margin:0;margin-inline-start:-4px;padding:0px 4px}.files-list--grid tbody.files-list__tbody .files-list__row-mtime{width:var(--icon-preview-size);height:var(--mtime-height);font-size:var(--font-size-small)}.files-list--grid tbody.files-list__tbody .files-list__row-actions{position:absolute;inset-inline-end:calc(var(--clickable-area)/4);inset-block-end:calc(var(--mtime-height)/2);width:var(--clickable-area);height:var(--clickable-area)}@media screen and (max-width: 768px){.files-list--grid tbody.files-list__tbody{--mtime-height: 0px}.files-list--grid tbody.files-list__tbody .files-list__row-actions{inset-block-end:var(--item-padding)}.files-list--grid tbody.files-list__tbody .files-list__row-name-text{padding-inline-end:var(--clickable-area) !important}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FilesListVirtual.vue\"],\"names\":[],\"mappings\":\"AAEA,0CACC,oBAAA,CACA,0BAAA,CACA,4CAAA,CACA,2EAAA,CACA,qEAAA,CACA,iHAAA,CACA,uBAAA,CACA,YAAA,CACA,yDAAA,CAEA,oBAAA,CACA,kBAAA,CACA,4BAAA,CACA,oBAAA,CAEA,6CACC,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,wBAAA,CACA,WAAA,CACA,wCAAA,CACA,2BAAA,CAID,oEACC,iBAAA,CACA,SAAA,CACA,+BAAA,CACA,8CAAA,CACA,eAAA,CACA,+BAAA,CACA,oCAAA,CACA,qCAAA,CAGA,2GACC,UAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,sBAAA,CACA,wBAAA,CACA,UAAA,CACA,uCAAA,CAKF,yEACC,iBAAA,CACA,KAAA,CACA,kBAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,2BAAA,CACA,4BAAA,CAGD,gEACC,YAAA,CACA,qBAAA,CACA,8BAAA,CACA,0DAAA,CAEA,gBAAA,CAEA,0FACC,8BAAA,CACA,+BAAA,CAGD,2FACC,QAAA,CAEA,wBAAA,CACA,eAAA,CAIF,iEACC,8BAAA,CACA,0BAAA,CACA,gCAAA,CAGD,mEACC,iBAAA,CACA,8CAAA,CACA,2CAAA,CACA,2BAAA,CACA,4BAAA,CAIF,qCAEC,0CACC,mBAAA,CAGA,mEACC,mCAAA,CAID,qEACC,mDAAA,CAAA\",\"sourcesContent\":[\"\\n// Grid mode\\n.files-list--grid tbody.files-list__tbody {\\n\\t--item-padding: 16px;\\n\\t--icon-preview-size: 166px;\\n\\t--name-height: var(--default-clickable-area);\\n\\t--mtime-height: calc(var(--font-size-small) + var(--default-grid-baseline));\\n\\t--row-width: calc(var(--icon-preview-size) + var(--item-padding) * 2);\\n\\t--row-height: calc(var(--icon-preview-size) + var(--name-height) + var(--mtime-height) + var(--item-padding) * 2);\\n\\t--checkbox-padding: 0px;\\n\\tdisplay: grid;\\n\\tgrid-template-columns: repeat(auto-fill, var(--row-width));\\n\\n\\talign-content: center;\\n\\talign-items: center;\\n\\tjustify-content: space-around;\\n\\tjustify-items: center;\\n\\n\\ttr {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\twidth: var(--row-width);\\n\\t\\theight: var(--row-height);\\n\\t\\tborder: none;\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\t\\tpadding: var(--item-padding);\\n\\t}\\n\\n\\t// Checkbox in the top left\\n\\t.files-list__row-checkbox {\\n\\t\\tposition: absolute;\\n\\t\\tz-index: 9;\\n\\t\\ttop: calc(var(--item-padding) / 2);\\n\\t\\tinset-inline-start: calc(var(--item-padding) / 2);\\n\\t\\toverflow: hidden;\\n\\t\\t--checkbox-container-size: 44px;\\n\\t\\twidth: var(--checkbox-container-size);\\n\\t\\theight: var(--checkbox-container-size);\\n\\n\\t\\t// Add a background to the checkbox so we do not see the image through it.\\n\\t\\t.checkbox-radio-switch__content::after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\twidth: 16px;\\n\\t\\t\\theight: 16px;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\tinset-inline-start: 50%;\\n\\t\\t\\tmargin-inline-start: -8px;\\n\\t\\t\\tz-index: -1;\\n\\t\\t\\tbackground: var(--color-main-background);\\n\\t\\t}\\n\\t}\\n\\n\\t// Star icon in the top right\\n\\t.files-list__row-icon-favorite {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tinset-inline-end: 0;\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\tjustify-content: center;\\n\\t\\twidth: var(--clickable-area);\\n\\t\\theight: var(--clickable-area);\\n\\t}\\n\\n\\t.files-list__row-name {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\twidth: var(--icon-preview-size);\\n\\t\\theight: calc(var(--icon-preview-size) + var(--name-height));\\n\\t\\t// Ensure that the name outline is visible.\\n\\t\\toverflow: visible;\\n\\n\\t\\tspan.files-list__row-icon {\\n\\t\\t\\twidth: var(--icon-preview-size);\\n\\t\\t\\theight: var(--icon-preview-size);\\n\\t\\t}\\n\\n\\t\\t.files-list__row-name-text {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\t// Ensure that the outline is not too close to the text.\\n\\t\\t\\tmargin-inline-start: -4px;\\n\\t\\t\\tpadding: 0px 4px;\\n\\t\\t}\\n\\t}\\n\\n\\t.files-list__row-mtime {\\n\\t\\twidth: var(--icon-preview-size);\\n\\t\\theight: var(--mtime-height);\\n\\t\\tfont-size: var(--font-size-small);\\n\\t}\\n\\n\\t.files-list__row-actions {\\n\\t\\tposition: absolute;\\n\\t\\tinset-inline-end: calc(var(--clickable-area) / 4);\\n\\t\\tinset-block-end: calc(var(--mtime-height) / 2);\\n\\t\\twidth: var(--clickable-area);\\n\\t\\theight: var(--clickable-area);\\n\\t}\\n}\\n\\n@media screen and (max-width: 768px) {\\n\\t// there is no mtime\\n\\t.files-list--grid tbody.files-list__tbody {\\n\\t\\t--mtime-height: 0px;\\n\\n\\t\\t// so we move the action to the name\\n\\t\\t.files-list__row-actions {\\n\\t\\t\\tinset-block-end: var(--item-padding);\\n\\t\\t}\\n\\n\\t\\t// and we need to keep space on the name for the actions\\n\\t\\t.files-list__row-name-text {\\n\\t\\t\\tpadding-inline-end: var(--clickable-area) !important;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `button.files-list__row-name-link[data-v-53dbef88]{background-color:unset;border:none;font-weight:normal}button.files-list__row-name-link[data-v-53dbef88]:active{background-color:unset !important}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FileEntry/FileEntryName.vue\"],\"names\":[],\"mappings\":\"AACA,kDACC,sBAAA,CACA,WAAA,CACA,kBAAA,CAEA,yDAEC,iCAAA\",\"sourcesContent\":[\"\\nbutton.files-list__row-name-link {\\n\\tbackground-color: unset;\\n\\tborder: none;\\n\\tfont-weight: normal;\\n\\n\\t&:active {\\n\\t\\t// No active styles - handled by the row entry\\n\\t\\tbackground-color: unset !important;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { l as logger, F as FileType } from \"./chunks/folder-CeyZUHai.mjs\";\nimport { a, b, N, c, P } from \"./chunks/folder-CeyZUHai.mjs\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nimport isSvg from \"is-svg\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { extname, basename } from \"@nextcloud/paths\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nconst DefaultType = Object.freeze({\n DEFAULT: \"default\",\n HIDDEN: \"hidden\"\n});\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}\nfunction registerFileAction(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}\nfunction getFileActions() {\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}\nfunction 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}\nfunction 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 t = 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 t[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[t.NUMERICIDENTIFIER]})\\\\.(${src[t.NUMERICIDENTIFIER]})\\\\.(${src[t.NUMERICIDENTIFIER]})`);\n createToken(\"MAINVERSIONLOOSE\", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);\n createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASE\", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`);\n createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);\n createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n createToken(\"BUILD\", `(?:\\\\+(${src[t.BUILDIDENTIFIER]}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`);\n createToken(\"FULLPLAIN\", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);\n createToken(\"FULL\", `^${src[t.FULLPLAIN]}$`);\n createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);\n createToken(\"LOOSE\", `^${src[t.LOOSEPLAIN]}$`);\n createToken(\"GTLT\", \"((?:<|>)?=?)\");\n createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken(\"XRANGEIDENTIFIER\", `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\\\.(${src[t.XRANGEIDENTIFIER]})(?:\\\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);\n createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);\n createToken(\"XRANGE\", `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`);\n createToken(\"XRANGELOOSE\", `^${src[t.GTLT]}\\\\s*${src[t.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[t.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken(\"COERCEFULL\", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\\\d])`);\n createToken(\"COERCERTL\", src[t.COERCE], true);\n createToken(\"COERCERTLFULL\", src[t.COERCEFULL], true);\n createToken(\"LONETILDE\", \"(?:~>?)\");\n createToken(\"TILDETRIM\", `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = \"$1~\";\n createToken(\"TILDE\", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);\n createToken(\"TILDELOOSE\", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);\n createToken(\"LONECARET\", \"(?:\\\\^)\");\n createToken(\"CARETTRIM\", `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = \"$1^\";\n createToken(\"CARET\", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);\n createToken(\"CARETLOOSE\", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);\n createToken(\"COMPARATORLOOSE\", `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`);\n createToken(\"COMPARATOR\", `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`);\n createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = \"$1$2$3\";\n createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t.XRANGEPLAIN]})\\\\s*$`);\n createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t.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 } = 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 m = version.trim().match(options.loose ? re2[t.LOOSE] : re2[t.FULL]);\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n this.major = +m[1];\n this.minor = +m[2];\n this.patch = +m[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 (!m[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m[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 = m[5] ? m[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 i = 0;\n do {\n const a2 = this.prerelease[i];\n const b2 = other.prerelease[i];\n debug(\"prerelease compare\", i, 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 (++i);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i = 0;\n do {\n const a2 = this.build[i];\n const b2 = other.build[i];\n debug(\"build compare\", i, 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 (++i);\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[t.PRERELEASELOOSE] : re2[t.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 i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === \"number\") {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -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((h) => h !== handler)\n );\n }\n emit(name, ...event) {\n const handlers = this.handlers.get(name) || [];\n handlers.forEach((h) => {\n try {\n ;\n h(event[0]);\n } catch (e) {\n console.error(\"could not invoke event listener\", e);\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}\nfunction registerFileListHeaders(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}\nfunction getFileListHeaders() {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n return window._nc_filelistheader;\n}\nfunction checkOptionalProperty(obj, property, type) {\n if (typeof obj[property] !== \"undefined\") {\n if (type === \"array\") {\n if (!Array.isArray(obj[property])) {\n throw new Error(`View ${property} must be an array`);\n }\n } else if (typeof obj[property] !== type) {\n throw new Error(`View ${property} must be a ${type}`);\n } else if (type === \"object\" && (obj[property] === null || Array.isArray(obj[property]))) {\n throw new Error(`View ${property} must be an object`);\n }\n }\n}\nclass Column {\n _column;\n constructor(column) {\n validateColumn(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}\nfunction validateColumn(column) {\n if (typeof column !== \"object\" || column === null) {\n throw new Error(\"View column must be an object\");\n }\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 checkOptionalProperty(column, \"sort\", \"function\");\n checkOptionalProperty(column, \"summary\", \"function\");\n}\nclass View {\n _view;\n constructor(view) {\n validateView(view);\n this._view = view;\n }\n get id() {\n return this._view.id;\n }\n get name() {\n return this._view.name;\n }\n get caption() {\n return this._view.caption;\n }\n get emptyTitle() {\n return this._view.emptyTitle;\n }\n get emptyCaption() {\n return this._view.emptyCaption;\n }\n get getContents() {\n return this._view.getContents;\n }\n get hidden() {\n return this._view.hidden;\n }\n get icon() {\n return this._view.icon;\n }\n set icon(icon) {\n this._view.icon = icon;\n }\n get order() {\n return this._view.order;\n }\n set order(order) {\n this._view.order = order;\n }\n get params() {\n return this._view.params;\n }\n set params(params) {\n this._view.params = params;\n }\n get columns() {\n return this._view.columns;\n }\n get emptyView() {\n return this._view.emptyView;\n }\n get parent() {\n return this._view.parent;\n }\n get sticky() {\n return this._view.sticky;\n }\n get expanded() {\n return this._view.expanded;\n }\n set expanded(expanded) {\n this._view.expanded = expanded;\n }\n get defaultSortKey() {\n return this._view.defaultSortKey;\n }\n get loadChildViews() {\n return this._view.loadChildViews;\n }\n}\nfunction validateView(view) {\n if (!view.icon || typeof view.icon !== \"string\" || !isSvg(view.icon)) {\n throw new Error(\"View icon is required and must be a valid svg string\");\n }\n if (!view.id || typeof view.id !== \"string\") {\n throw new Error(\"View id is required and must be a string\");\n }\n if (!view.getContents || typeof view.getContents !== \"function\") {\n throw new Error(\"View getContents is required and must be a function\");\n }\n if (!view.name || typeof view.name !== \"string\") {\n throw new Error(\"View name is required and must be a string\");\n }\n checkOptionalProperty(view, \"caption\", \"string\");\n checkOptionalProperty(view, \"columns\", \"array\");\n checkOptionalProperty(view, \"defaultSortKey\", \"string\");\n checkOptionalProperty(view, \"emptyCaption\", \"string\");\n checkOptionalProperty(view, \"emptyTitle\", \"string\");\n checkOptionalProperty(view, \"emptyView\", \"function\");\n checkOptionalProperty(view, \"expanded\", \"boolean\");\n checkOptionalProperty(view, \"hidden\", \"boolean\");\n checkOptionalProperty(view, \"loadChildViews\", \"function\");\n checkOptionalProperty(view, \"order\", \"number\");\n checkOptionalProperty(view, \"params\", \"object\");\n checkOptionalProperty(view, \"parent\", \"string\");\n checkOptionalProperty(view, \"sticky\", \"boolean\");\n if (view.columns) {\n view.columns.forEach(validateColumn);\n const columnIds = view.columns.reduce((set, column) => set.add(column.id), /* @__PURE__ */ new Set());\n if (columnIds.size !== view.columns.length) {\n throw new Error(\"View columns must have unique ids\");\n }\n }\n}\nclass Navigation extends TypedEventTarget {\n _views = [];\n _currentView = null;\n /**\n * Register a new view on the navigation\n *\n * @param view The view to register\n * @throws {Error} if a view with the same id is already registered\n * @throws {Error} if the registered view is invalid\n */\n register(view) {\n if (this._views.find((search) => search.id === view.id)) {\n throw new Error(`IView id ${view.id} is already registered`);\n }\n validateView(view);\n this._views.push(view);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n /**\n * Remove a registered view\n *\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 *\n * @param id - The id of the view to set as active\n * @throws {Error} If no view with the given id was registered\n * @fires UpdateActiveViewEvent\n */\n setActive(id) {\n if (id === null) {\n this._currentView = null;\n } else {\n const view = this._views.find(({ id: viewId }) => viewId === id);\n if (!view) {\n throw new Error(`No view with ${id} registered`);\n }\n this._currentView = view;\n }\n const event = new CustomEvent(\"updateActive\", { detail: this._currentView });\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}\nfunction getNavigation() {\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}\nconst NewMenuEntryCategory = Object.freeze({\n /**\n * For actions where the user is intended to upload from their device\n */\n UploadFromDevice: 0,\n /**\n * For actions that create new nodes on the server without uploading\n */\n CreateNew: 1,\n /**\n * For everything not matching the other categories\n */\n Other: 2\n});\nclass NewMenu {\n _entries = [];\n registerEntry(entry) {\n this.validateEntry(entry);\n entry.category = entry.category ?? NewMenuEntryCategory.CreateNew;\n this._entries.push(entry);\n }\n unregisterEntry(entry) {\n const entryIndex = typeof entry === \"string\" ? this.getEntryIndex(entry) : this.getEntryIndex(entry.id);\n if (entryIndex === -1) {\n logger.warn(\"Entry not found, nothing removed\", { entry, entries: this.getEntries() });\n return;\n }\n this._entries.splice(entryIndex, 1);\n }\n /**\n * Get the list of registered entries\n *\n * @param context - The creation context. Usually the current folder\n */\n getEntries(context) {\n if (context) {\n return this._entries.filter((entry) => typeof entry.enabled === \"function\" ? entry.enabled(context) : true);\n }\n return this._entries;\n }\n getEntryIndex(id) {\n return this._entries.findIndex((entry) => entry.id === id);\n }\n validateEntry(entry) {\n if (!entry.id || !entry.displayName || !entry.iconSvgInline || !entry.handler) {\n throw new Error(\"Invalid entry\");\n }\n if (typeof entry.id !== \"string\" || typeof entry.displayName !== \"string\") {\n throw new Error(\"Invalid id or displayName property\");\n }\n if (entry.iconSvgInline && typeof entry.iconSvgInline !== \"string\") {\n throw new Error(\"Invalid icon provided\");\n }\n if (entry.enabled !== void 0 && typeof entry.enabled !== \"function\") {\n throw new Error(\"Invalid enabled property\");\n }\n if (typeof entry.handler !== \"function\") {\n throw new Error(\"Invalid handler property\");\n }\n if (\"order\" in entry && typeof entry.order !== \"number\") {\n throw new Error(\"Invalid order property\");\n }\n if (this.getEntryIndex(entry.id) !== -1) {\n throw new Error(\"Duplicate entry\");\n }\n }\n}\nfunction getNewFileMenu() {\n if (typeof window._nc_newfilemenu === \"undefined\") {\n window._nc_newfilemenu = new NewMenu();\n logger.debug(\"NewFileMenu initialized\");\n }\n return window._nc_newfilemenu;\n}\nfunction addNewFileMenuEntry(entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.registerEntry(entry);\n}\nfunction removeNewFileMenuEntry(entry) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.unregisterEntry(entry);\n}\nfunction getNewFileMenuEntries(context) {\n const newFileMenu = getNewFileMenu();\n return newFileMenu.getEntries(context).sort((a2, b2) => {\n if (a2.order !== void 0 && b2.order !== void 0 && a2.order !== b2.order) {\n return a2.order - b2.order;\n }\n return a2.displayName.localeCompare(b2.displayName, void 0, { numeric: true, sensitivity: \"base\" });\n });\n}\nfunction registerSidebarAction(action) {\n validateSidebarAction(action);\n window._nc_files_sidebar_actions ??= /* @__PURE__ */ new Map();\n if (window._nc_files_sidebar_actions.has(action.id)) {\n logger.warn(`Sidebar action with id \"${action.id}\" already registered. Skipping.`);\n return;\n }\n window._nc_files_sidebar_actions.set(action.id, action);\n logger.debug(`New sidebar action with id \"${action.id}\" registered.`);\n}\nfunction getSidebarActions() {\n if (window._nc_files_sidebar_actions) {\n return [...window._nc_files_sidebar_actions.values()];\n }\n return [];\n}\nfunction validateSidebarAction(action) {\n if (typeof action !== \"object\") {\n throw new Error(\"Sidebar action is not an object\");\n }\n if (!action.id || typeof action.id !== \"string\" || action.id !== CSS.escape(action.id)) {\n throw new Error(\"Sidebar actions need to have an id conforming to the HTML id attribute specifications\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Sidebar actions need to have a displayName function\");\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Sidebar actions need to have a iconSvgInline function\");\n }\n if (!action.enabled || typeof action.enabled !== \"function\") {\n throw new Error(\"Sidebar actions need to have an enabled function\");\n }\n if (!action.onClick || typeof action.onClick !== \"function\") {\n throw new Error(\"Sidebar actions need to have an onClick function\");\n }\n}\nfunction registerSidebarTab(tab) {\n validateSidebarTab(tab);\n window._nc_files_sidebar_tabs ??= /* @__PURE__ */ new Map();\n if (window._nc_files_sidebar_tabs.has(tab.id)) {\n logger.warn(`Sidebar tab with id \"${tab.id}\" already registered. Skipping.`);\n return;\n }\n window._nc_files_sidebar_tabs.set(tab.id, tab);\n logger.debug(`New sidebar tab with id \"${tab.id}\" registered.`);\n}\nfunction getSidebarTabs() {\n if (window._nc_files_sidebar_tabs) {\n return [...window._nc_files_sidebar_tabs.values()];\n }\n return [];\n}\nfunction validateSidebarTab(tab) {\n if (typeof tab !== \"object\") {\n throw new Error(\"Sidebar tab is not an object\");\n }\n if (!tab.id || typeof tab.id !== \"string\" || tab.id !== CSS.escape(tab.id)) {\n throw new Error(\"Sidebar tabs need to have an id conforming to the HTML id attribute specifications\");\n }\n if (!tab.tagName || typeof tab.tagName !== \"string\") {\n throw new Error(\"Sidebar tabs need to have the tagName name set\");\n }\n if (!tab.tagName.match(/^[a-z][a-z0-9-_]+$/)) {\n throw new Error('Sidebar tab \"tagName\" is invalid');\n }\n if (!tab.displayName || typeof tab.displayName !== \"string\") {\n throw new Error(\"Sidebar tabs need to have a name set\");\n }\n if (typeof tab.iconSvgInline !== \"string\" || !isSvg(tab.iconSvgInline)) {\n throw new Error(\"Sidebar tabs need to have an valid SVG icon\");\n }\n if (typeof tab.order !== \"number\") {\n throw new Error(\"Sidebar tabs need to have a numeric order set\");\n }\n if (tab.enabled && typeof tab.enabled !== \"function\") {\n throw new Error('Sidebar tab \"enabled\" is not a function');\n }\n if (tab.onInit && typeof tab.onInit !== \"function\") {\n throw new Error('Sidebar tab \"onInit\" is not a function');\n }\n}\nclass SidebarProxy {\n get #impl() {\n return window.OCA?.Files?._sidebar?.();\n }\n get available() {\n return !!this.#impl;\n }\n get isOpen() {\n return this.#impl?.isOpen ?? false;\n }\n get activeTab() {\n return this.#impl?.activeTab;\n }\n get node() {\n return this.#impl?.node;\n }\n open(node, tab) {\n this.#impl?.open(node, tab);\n }\n close() {\n this.#impl?.close();\n }\n setActiveTab(tabId) {\n this.#impl?.setActiveTab(tabId);\n }\n registerTab(tab) {\n registerSidebarTab(tab);\n }\n getTabs(context) {\n return this.#impl?.getTabs(context) ?? [];\n }\n getActions(context) {\n return this.#impl?.getActions(context) ?? [];\n }\n registerAction(action) {\n registerSidebarAction(action);\n }\n}\nfunction getSidebar() {\n return new SidebarProxy();\n}\nconst InvalidFilenameErrorReason = Object.freeze({\n ReservedName: \"reserved name\",\n Character: \"character\",\n Extension: \"extension\"\n});\nclass InvalidFilenameError extends Error {\n constructor(options) {\n super(`Invalid ${options.reason} '${options.segment}' in filename '${options.filename}'`, { cause: options });\n }\n /**\n * The filename that was validated\n */\n get filename() {\n return this.cause.filename;\n }\n /**\n * Reason why the validation failed\n */\n get reason() {\n return this.cause.reason;\n }\n /**\n * Part of the filename that caused this error\n */\n get segment() {\n return this.cause.segment;\n }\n}\nfunction validateFilename(filename) {\n const capabilities = getCapabilities().files;\n const forbiddenCharacters = capabilities.forbidden_filename_characters ?? [\"/\", \"\\\\\"];\n for (const character of forbiddenCharacters) {\n if (filename.includes(character)) {\n throw new InvalidFilenameError({ segment: character, reason: InvalidFilenameErrorReason.Character, filename });\n }\n }\n filename = filename.toLocaleLowerCase();\n const forbiddenFilenames = capabilities.forbidden_filenames ?? [\".htaccess\"];\n if (forbiddenFilenames.includes(filename)) {\n throw new InvalidFilenameError({ filename, segment: filename, reason: InvalidFilenameErrorReason.ReservedName });\n }\n const endOfBasename = filename.indexOf(\".\", 1);\n const basename2 = filename.substring(0, endOfBasename === -1 ? void 0 : endOfBasename);\n const forbiddenFilenameBasenames = capabilities.forbidden_filename_basenames ?? [];\n if (forbiddenFilenameBasenames.includes(basename2)) {\n throw new InvalidFilenameError({ filename, segment: basename2, reason: InvalidFilenameErrorReason.ReservedName });\n }\n const forbiddenFilenameExtensions = capabilities.forbidden_filename_extensions ?? [];\n for (const extension of forbiddenFilenameExtensions) {\n if (filename.length > extension.length && filename.endsWith(extension)) {\n throw new InvalidFilenameError({ segment: extension, reason: InvalidFilenameErrorReason.Extension, filename });\n }\n }\n}\nfunction isFilenameValid(filename) {\n try {\n validateFilename(filename);\n return true;\n } catch (error) {\n if (error instanceof InvalidFilenameError) {\n return false;\n }\n throw error;\n }\n}\nfunction getUniqueName(name, otherNames, options) {\n const opts = {\n suffix: (n) => `(${n})`,\n ignoreFileExtension: false,\n ...options\n };\n let newName = name;\n let i = 1;\n while (otherNames.includes(newName)) {\n const ext = opts.ignoreFileExtension ? \"\" : extname(name);\n const base = basename(name, ext);\n newName = `${base} ${opts.suffix(i++)}${ext}`;\n }\n return newName;\n}\nconst humanList = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\nconst humanListBinary = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\"];\nfunction formatFileSize(size, skipSmallSizes = false, binaryPrefixes = false, base1000 = false) {\n binaryPrefixes = binaryPrefixes && !base1000;\n if (typeof size === \"string\") {\n size = Number(size);\n }\n let order = size > 0 ? Math.floor(Math.log(size) / Math.log(base1000 ? 1e3 : 1024)) : 0;\n order = Math.min((binaryPrefixes ? humanListBinary.length : humanList.length) - 1, order);\n const readableFormat = binaryPrefixes ? humanListBinary[order] : humanList[order];\n let relativeSize = (size / Math.pow(base1000 ? 1e3 : 1024, order)).toFixed(1);\n if (skipSmallSizes === true && order === 0) {\n return (relativeSize !== \"0.0\" ? \"< 1 \" : \"0 \") + (binaryPrefixes ? humanListBinary[1] : humanList[1]);\n }\n if (order < 2) {\n relativeSize = parseFloat(relativeSize).toFixed(0);\n } else {\n relativeSize = parseFloat(relativeSize).toLocaleString(getCanonicalLocale());\n }\n return relativeSize + \" \" + readableFormat;\n}\nfunction parseFileSize(value, forceBinary = false) {\n try {\n value = `${value}`.toLocaleLowerCase().replaceAll(/\\s+/g, \"\").replaceAll(\",\", \".\");\n } catch {\n return null;\n }\n const match = value.match(/^([0-9]*(\\.[0-9]*)?)([kmgtp]?)(i?)b?$/);\n if (match === null || match[1] === \".\" || match[1] === \"\") {\n return null;\n }\n const bytesArray = {\n \"\": 0,\n k: 1,\n m: 2,\n g: 3,\n t: 4,\n p: 5,\n e: 6\n };\n const decimalString = `${match[1]}`;\n const base = match[4] === \"i\" || forceBinary ? 1024 : 1e3;\n return Math.round(Number.parseFloat(decimalString) * base ** bytesArray[match[3]]);\n}\nfunction stringify(value) {\n if (value instanceof Date) {\n return value.toISOString();\n }\n return String(value);\n}\nfunction orderBy(collection, identifiers2, orders) {\n identifiers2 = identifiers2 ?? [(value) => value];\n orders = orders ?? [];\n const sorting = identifiers2.map((_, index) => (orders[index] ?? \"asc\") === \"asc\" ? 1 : -1);\n const collator = Intl.Collator(\n [getLanguage(), getCanonicalLocale()],\n {\n // handle 10 as ten and not as one-zero\n numeric: true,\n usage: \"sort\"\n }\n );\n return [...collection].sort((a2, b2) => {\n for (const [index, identifier] of identifiers2.entries()) {\n const value = collator.compare(stringify(identifier(a2)), stringify(identifier(b2)));\n if (value !== 0) {\n return value * sorting[index];\n }\n }\n return 0;\n });\n}\nconst FilesSortingMode = Object.freeze({\n Name: \"basename\",\n Modified: \"mtime\",\n Size: \"size\"\n});\nfunction sortNodes(nodes, options = {}) {\n const sortingOptions = {\n // Default to sort by name\n sortingMode: FilesSortingMode.Name,\n // Default to sort ascending\n sortingOrder: \"asc\",\n ...options\n };\n function basename2(node) {\n const name = node.displayname || node.attributes?.displayname || node.basename || \"\";\n if (node.type === FileType.Folder) {\n return name;\n }\n return name.lastIndexOf(\".\") > 0 ? name.slice(0, name.lastIndexOf(\".\")) : name;\n }\n const identifiers2 = [\n // 1: Sort favorites first if enabled\n ...sortingOptions.sortFavoritesFirst ? [(v) => v.attributes?.favorite !== 1] : [],\n // 2: Sort folders first if sorting by name\n ...sortingOptions.sortFoldersFirst ? [(v) => v.type !== \"folder\"] : [],\n // 3: Use sorting mode if NOT basename (to be able to use display name too)\n ...sortingOptions.sortingMode !== FilesSortingMode.Name ? [(v) => v[sortingOptions.sortingMode] ?? v.attributes[sortingOptions.sortingMode]] : [],\n // 4: Use display name if available, fallback to name\n (v) => basename2(v),\n // 5: Finally, use basename if all previous sorting methods failed\n (v) => v.basename\n ];\n const orders = [\n // (for 1): always sort favorites before normal files\n ...sortingOptions.sortFavoritesFirst ? [\"asc\"] : [],\n // (for 2): always sort folders before files\n ...sortingOptions.sortFoldersFirst ? [\"asc\"] : [],\n // (for 3): Reverse if sorting by mtime as mtime higher means edited more recent -> lower\n ...sortingOptions.sortingMode === FilesSortingMode.Modified ? [sortingOptions.sortingOrder === \"asc\" ? \"desc\" : \"asc\"] : [],\n // (also for 3 so make sure not to conflict with 2 and 3)\n ...sortingOptions.sortingMode !== FilesSortingMode.Modified && sortingOptions.sortingMode !== FilesSortingMode.Name ? [sortingOptions.sortingOrder] : [],\n // for 4: use configured sorting direction\n sortingOptions.sortingOrder,\n // for 5: use configured sorting direction\n sortingOptions.sortingOrder\n ];\n return orderBy(nodes, identifiers2, orders);\n}\nexport {\n Column,\n DefaultType,\n a as File,\n FileAction,\n FileListAction,\n FileListFilter,\n FileType,\n FilesSortingMode,\n b as Folder,\n Header,\n InvalidFilenameError,\n InvalidFilenameErrorReason,\n Navigation,\n NewMenuEntryCategory,\n N as Node,\n c as NodeStatus,\n P as Permission,\n View,\n addNewFileMenuEntry,\n formatFileSize,\n getFileActions,\n getFileListActions,\n getFileListFilters,\n getFileListHeaders,\n getNavigation,\n getNewFileMenu,\n getNewFileMenuEntries,\n getSidebar,\n getSidebarActions,\n getSidebarTabs,\n getUniqueName,\n isFilenameValid,\n orderBy,\n parseFileSize,\n registerFileAction,\n registerFileListAction,\n registerFileListFilter,\n registerFileListHeaders,\n registerSidebarAction,\n registerSidebarTab,\n removeNewFileMenuEntry,\n sortNodes,\n unregisterFileListFilter,\n validateColumn,\n validateFilename,\n validateView\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport MagnifySvg from '@mdi/svg/svg/magnify.svg?raw';\nimport { getNavigation, View } from '@nextcloud/files';\nimport { t } from '@nextcloud/l10n';\nimport Vue from 'vue';\nimport { getContents } from '../services/Search.ts';\nimport { VIEW_ID as FILES_VIEW_ID } from './files.ts';\nexport const VIEW_ID = 'search';\n/**\n * Register the search-in-files view\n */\nexport function registerSearchView() {\n let instance;\n let view;\n const Navigation = getNavigation();\n Navigation.register(new View({\n id: VIEW_ID,\n name: t('files', 'Search'),\n caption: t('files', 'Search results within your files.'),\n async emptyView(el) {\n if (!view) {\n view = (await import('./SearchEmptyView.vue')).default;\n }\n else {\n instance.$destroy();\n }\n instance = new Vue(view);\n instance.$mount(el);\n },\n icon: MagnifySvg,\n order: 10,\n parent: FILES_VIEW_ID,\n // it should be shown expanded\n expanded: true,\n // this view is hidden by default and only shown when active\n hidden: true,\n getContents,\n }));\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.favorite-marker-icon[data-v-4505d262]{color:var(--color-favorite);min-width:unset !important;min-height:unset !important}.favorite-marker-icon[data-v-4505d262] svg{width:20px !important;height:20px !important;max-width:unset !important;max-height:unset !important}.favorite-marker-icon[data-v-4505d262] svg path{stroke:var(--color-main-background);stroke-width:8px;stroke-linejoin:round;paint-order:stroke}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FileEntry/FavoriteIcon.vue\"],\"names\":[],\"mappings\":\"AACA,uCACC,2BAAA,CAEA,0BAAA,CACG,2BAAA,CAGF,4CAEC,qBAAA,CACA,sBAAA,CAGA,0BAAA,CACA,2BAAA,CAGA,iDACC,mCAAA,CACA,gBAAA,CACA,qBAAA,CACA,kBAAA\",\"sourcesContent\":[\"\\n.favorite-marker-icon {\\n\\tcolor: var(--color-favorite);\\n\\t// Override NcIconSvgWrapper defaults (clickable area)\\n\\tmin-width: unset !important;\\n min-height: unset !important;\\n\\n\\t:deep() {\\n\\t\\tsvg {\\n\\t\\t\\t// We added a stroke for a11y so we must increase the size to include the stroke\\n\\t\\t\\twidth: 20px !important;\\n\\t\\t\\theight: 20px !important;\\n\\n\\t\\t\\t// Override NcIconSvgWrapper defaults of 20px\\n\\t\\t\\tmax-width: unset !important;\\n\\t\\t\\tmax-height: unset !important;\\n\\n\\t\\t\\t// Sow a border around the icon for better contrast\\n\\t\\t\\tpath {\\n\\t\\t\\t\\tstroke: var(--color-main-background);\\n\\t\\t\\t\\tstroke-width: 8px;\\n\\t\\t\\t\\tstroke-linejoin: round;\\n\\t\\t\\t\\tpaint-order: stroke;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__column[data-v-5eed91ff]{user-select:none;color:var(--color-text-maxcontrast) !important}.files-list__column--sortable[data-v-5eed91ff]{cursor:pointer}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FilesListTableHeader.vue\"],\"names\":[],\"mappings\":\"AACA,qCACC,gBAAA,CAEA,8CAAA,CAEA,+CACC,cAAA\",\"sourcesContent\":[\"\\n.files-list__column {\\n\\tuser-select: none;\\n\\t// Make sure the cell colors don't apply to column headers\\n\\tcolor: var(--color-text-maxcontrast) !important;\\n\\n\\t&--sortable {\\n\\t\\tcursor: pointer;\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { subscribe } from '@nextcloud/event-bus';\nimport { getNavigation } from '@nextcloud/files';\nimport { defineStore } from 'pinia';\nimport { ref, watch } from 'vue';\nimport logger from '../logger.ts';\nexport const useActiveStore = defineStore('active', () => {\n /**\n * The currently active action\n */\n const activeAction = ref();\n /**\n * The currently active folder\n */\n const activeFolder = ref();\n /**\n * The current active node within the folder\n */\n const activeNode = ref();\n /**\n * The current active view\n */\n const activeView = ref();\n // Set the active node on the router params\n watch(activeNode, () => {\n if (typeof activeNode.value?.fileid !== 'number' || activeNode.value.fileid === activeFolder.value?.fileid) {\n return;\n }\n logger.debug('Updating active fileid in URL query', { fileid: activeNode.value.fileid });\n window.OCP.Files.Router.goToRoute(null, { ...window.OCP.Files.Router.params, fileid: String(activeNode.value.fileid) }, { ...window.OCP.Files.Router.query }, true);\n });\n initialize();\n /**\n * Unset the active node if deleted\n *\n * @param node - The node thats deleted\n */\n function onDeletedNode(node) {\n if (activeNode.value && activeNode.value.source === node.source) {\n activeNode.value = undefined;\n }\n }\n /**\n * Callback to update the current active view\n *\n * @param view - The new active view\n */\n function onChangedView(view = null) {\n logger.debug('Setting active view', { view });\n activeView.value = view ?? undefined;\n activeNode.value = undefined;\n }\n /**\n * Initalize the store - connect all event listeners.\n *\n */\n function initialize() {\n const navigation = getNavigation();\n onChangedView(navigation.active);\n // Make sure we only register the listeners once\n subscribe('files:node:deleted', onDeletedNode);\n // Or you can react to changes of the current active view\n navigation.addEventListener('updateActive', (event) => {\n onChangedView(event.detail);\n });\n }\n return {\n activeAction,\n activeFolder,\n activeNode,\n activeView,\n };\n});\n","/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { defaultRootPath, getDavNameSpaces, getDavProperties, resultToNode } from '@nextcloud/files/dav';\nimport { getBaseUrl } from '@nextcloud/router';\nimport logger from '../logger.ts';\nimport { client } from './WebdavClient.ts';\n/**\n * Search for nodes matching the given query.\n *\n * @param query - Search query\n * @param options - Options\n * @param options.dir - The base directory to scope the search to\n * @param options.signal - Abort signal for the request\n */\nexport async function searchNodes(query, { dir, signal }) {\n const user = getCurrentUser();\n if (!user) {\n // the search plugin only works for user roots\n return [];\n }\n query = query.trim();\n if (query.length < 3) {\n // the search plugin only works with queries of at least 3 characters\n return [];\n }\n if (dir && !dir.startsWith('/')) {\n dir = `/${dir}`;\n }\n logger.debug('Searching for nodes', { query, dir });\n const { data } = await client.search('/', {\n details: true,\n signal,\n data: `\n