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C,KAAKC,SAASC,KAK1D,IAAIC,EAAkB,CACrB,KAAM,GAaPrD,EAAoBQ,EAAES,EAAKqC,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BpK,KACvD,IAKI6G,EAAUqD,EALV5C,EAAWtH,EAAK,GAChBqK,EAAcrK,EAAK,GACnBsK,EAAUtK,EAAK,GAGI2H,EAAI,EAC3B,GAAGL,EAASiD,MAAMtJ,GAAgC,IAAxBgJ,EAAgBhJ,KAAa,CACtD,IAAI4F,KAAYwD,EACZzD,EAAoB4B,EAAE6B,EAAaxD,KACrCD,EAAoBO,EAAEN,GAAYwD,EAAYxD,IAGhD,GAAGyD,EAAS,IAAIjD,EAASiD,EAAQ1D,EAClC,CAEA,IADGwD,GAA4BA,EAA2BpK,GACrD2H,EAAIL,EAAS9F,OAAQmG,IACzBuC,EAAU5C,EAASK,GAChBf,EAAoB4B,EAAEyB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOtD,EAAoBQ,EAAEC,EAAO,EAGjCmD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqBO,KAAK,KAAM,IAC3DF,EAAmB/D,KAAO0D,EAAqBO,KAAK,KAAMF,EAAmB/D,KAAKiE,KAAKF,QClDvF5D,EAAoB+D,QAAKpH,ECGzB,IAAIqH,EAAsBhE,EAAoBQ,OAAE7D,EAAW,CAAC,OAAO,IAAOqD,EAAoB,SAC9FgE,EAAsBhE,EAAoBQ,EAAEwD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack://nextcloud/./apps/files_trashbin/src/trashbin.scss?8b2e","webpack:///nextcloud/apps/files_trashbin/src/services/client.ts","webpack:///nextcloud/apps/files_trashbin/src/services/trashbin.ts","webpack:///nextcloud/apps/files/src/logger.js","webpack:///nextcloud/apps/files_trashbin/src/actions/restoreAction.ts","webpack:///nextcloud/apps/files_trashbin/src/files-init.ts","webpack:///nextcloud/apps/files_trashbin/src/trashbin.scss","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./trashbin.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./trashbin.scss\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { davGetClient } from '@nextcloud/files';\n// init WebDAV client\nexport const rootPath = `/trashbin/${getCurrentUser()?.uid}/trash`;\nexport const client = davGetClient();\n","import { File, Folder, davResultToNode, getDavNameSpaces, getDavProperties } from '@nextcloud/files';\nimport { client, rootPath } from './client';\nimport { generateUrl } from '@nextcloud/router';\nconst data = `<?xml version=\"1.0\"?>\n<d:propfind ${getDavNameSpaces()}>\n\t<d:prop>\n\t\t<nc:trashbin-deletion-time />\n\t\t<nc:trashbin-original-location />\n\t\t<nc:trashbin-title />\n\t\t${getDavProperties()}\n\t</d:prop>\n</d:propfind>`;\nconst resultToNode = (stat) => {\n const node = davResultToNode(stat, rootPath);\n node.attributes.previewUrl = generateUrl('/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32', { fileid: node.fileid });\n return node;\n};\nexport const getContents = async (path = '/') => {\n const contentsResponse = await client.getDirectoryContents(`${rootPath}${path}`, {\n details: true,\n data,\n includeSelf: true,\n });\n const contents = contentsResponse.data.map(resultToNode);\n const [folder] = contents.splice(contents.findIndex((node) => node.dirname === path), 1);\n return {\n folder: folder,\n contents,\n };\n};\n","/**\n * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files')\n\t.detectUser()\n\t.build()\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { emit } from '@nextcloud/event-bus';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { Permission, Node, View, registerFileAction, FileAction } from '@nextcloud/files';\nimport { translate as t } from '@nextcloud/l10n';\nimport axios from '@nextcloud/axios';\nimport History from '@mdi/svg/svg/history.svg?raw';\nimport logger from '../../../files/src/logger.js';\nimport { encodePath } from '@nextcloud/paths';\nregisterFileAction(new FileAction({\n id: 'restore',\n displayName() {\n return t('files_trashbin', 'Restore');\n },\n iconSvgInline: () => History,\n enabled(nodes, view) {\n // Only available in the trashbin view\n if (view.id !== 'trashbin') {\n return false;\n }\n // Only available if all nodes have read permission\n return nodes.length > 0 && nodes\n .map(node => node.permissions)\n .every(permission => (permission & Permission.READ) !== 0);\n },\n async exec(node) {\n try {\n const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`));\n await axios({\n method: 'MOVE',\n url: node.encodedSource,\n headers: {\n destination,\n },\n });\n // Let's pretend the file is deleted since\n // we don't know the restored location\n emit('files:node:deleted', node);\n return true;\n }\n catch (error) {\n logger.error(error);\n return false;\n }\n },\n async execBatch(nodes, view, dir) {\n return Promise.all(nodes.map(node => this.exec(node, view, dir)));\n },\n order: 1,\n inline: () => true,\n}));\n","/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport './trashbin.scss';\nimport { translate as t } from '@nextcloud/l10n';\nimport DeleteSvg from '@mdi/svg/svg/delete.svg?raw';\nimport moment from '@nextcloud/moment';\nimport { getContents } from './services/trashbin';\n// Register restore action\nimport './actions/restoreAction';\nimport { Column, Node, View, getNavigation } from '@nextcloud/files';\nimport { dirname, joinPaths } from '@nextcloud/paths';\nconst parseOriginalLocation = (node) => {\n const path = node.attributes?.['trashbin-original-location'] !== undefined ? String(node.attributes?.['trashbin-original-location']) : null;\n if (!path) {\n return t('files_trashbin', 'Unknown');\n }\n const dir = dirname(path);\n if (dir === path) { // Node is in root folder\n return t('files_trashbin', 'All files');\n }\n return joinPaths(t('files_trashbin', 'All files'), dir);\n};\nconst Navigation = getNavigation();\nNavigation.register(new View({\n id: 'trashbin',\n name: t('files_trashbin', 'Deleted files'),\n caption: t('files_trashbin', 'List of files that have been deleted.'),\n emptyTitle: t('files_trashbin', 'No deleted files'),\n emptyCaption: t('files_trashbin', 'Files and folders you have deleted will show up here'),\n icon: DeleteSvg,\n order: 50,\n sticky: true,\n defaultSortKey: 'deleted',\n columns: [\n new Column({\n id: 'original-location',\n title: t('files_trashbin', 'Original location'),\n render(node) {\n const originalLocation = parseOriginalLocation(node);\n const span = document.createElement('span');\n span.title = originalLocation;\n span.textContent = originalLocation;\n return span;\n },\n sort(nodeA, nodeB) {\n const locationA = parseOriginalLocation(nodeA);\n const locationB = parseOriginalLocation(nodeB);\n return locationA.localeCompare(locationB);\n },\n }),\n new Column({\n id: 'deleted',\n title: t('files_trashbin', 'Deleted'),\n render(node) {\n const deletionTime = node.attributes?.['trashbin-deletion-time'];\n const span = document.createElement('span');\n if (deletionTime) {\n span.title = moment.unix(deletionTime).format('LLL');\n span.textContent = moment.unix(deletionTime).fromNow();\n return span;\n }\n // Unknown deletion time\n span.textContent = t('files_trashbin', 'A long time ago');\n return span;\n },\n sort(nodeA, nodeB) {\n const deletionTimeA = nodeA.attributes?.['trashbin-deletion-time'] || nodeA?.mtime || 0;\n const deletionTimeB = nodeB.attributes?.['trashbin-deletion-time'] || nodeB?.mtime || 0;\n return deletionTimeB - deletionTimeA;\n },\n }),\n ],\n getContents,\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, `.files-list__row-trashbin-original-location{width:150px !important}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files_trashbin/src/trashbin.scss\"],\"names\":[],\"mappings\":\"AAAA,4CACE,sBAAA\",\"sourcesContent\":[\".files-list__row-trashbin-original-location {\\n width: 150px !important;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2573;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2573: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(29276)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","rootPath","concat","_getCurrentUser","getCurrentUser","uid","client","davGetClient","data","getDavNameSpaces","getDavProperties","resultToNode","stat","node","davResultToNode","attributes","previewUrl","generateUrl","fileid","getLoggerBuilder","setApp","detectUser","build","registerFileAction","FileAction","id","displayName","t","iconSvgInline","enabled","nodes","view","length","map","permissions","every","permission","Permission","READ","exec","destination","generateRemoteUrl","encodePath","basename","axios","method","url","encodedSource","headers","emit","error","logger","execBatch","dir","Promise","all","this","order","inline","parseOriginalLocation","_node$attributes","_node$attributes2","path","undefined","String","dirname","joinPaths","getNavigation","register","View","name","caption","emptyTitle","emptyCaption","icon","sticky","defaultSortKey","columns","Column","title","render","originalLocation","span","document","createElement","textContent","sort","nodeA","nodeB","locationA","locationB","localeCompare","_node$attributes3","deletionTime","moment","unix","format","fromNow","_nodeA$attributes","_nodeB$attributes","deletionTimeA","mtime","getContents","async","arguments","contents","getDirectoryContents","details","includeSelf","folder","splice","findIndex","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","key","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","resolve","g","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""}