cloudcmd 19.1.19 → 19.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sw.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var t={4299(t){"use strict";const n=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const r=(...r)=>n(t,...e,...r),i=t.length-e.length-1,o=(t=>[function(n){return t(...arguments)},function(n,e){return t(...arguments)},function(n,e,r){return t(...arguments)},function(n,e,r,i){return t(...arguments)},function(n,e,r,i,o){return t(...arguments)}])(r)[i];return o||r};t.exports=n},5606(t){var n,e,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var s,a=[],u=!1,l=-1;function f(){u&&s&&(u=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!u){var t=c(f);u=!0;for(var n=a.length;n;){for(s=a,a=[];++l<n;)s&&s[l].run();l=-1,n=a.length}s=null,u=!1,function(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}(t)}}function d(t,n){this.fun=t,this.array=n}function p(){}r.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];a.push(new d(t,n)),1!==a.length||u||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}},n={};function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(()=>{"use strict";e(5606);var t=e(4299);const n=t((t,n)=>n.waitUntil(t())),r=t((t,n)=>{const{request:e}=n,{url:r}=e,o=i(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===e.method&&"basic"===e.type&&(o.startsWith("/api")||/^socket.io/.test(o)||n.respondWith(t(n)))}),i=t=>new URL(t).pathname,o="cloudcmd: Fri Jan 30 2026 21:04:39 GMT+0200 (Eastern European Standard Time)";globalThis.addEventListener("install",n(async function(){console.info(`cloudcmd: sw: install: ${o}`),await globalThis.skipWaiting()})),globalThis.addEventListener("fetch",r(async function(t){const{request:n}=t,{url:e}=n,r=((t,n)=>"/"!==t?n:new Request("/",{credentials:"same-origin"}))(i(e),t.request),c=await caches.open(o),s=await c.match(n);if(s)return s;const[a,u]=await(async(t,...n)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...n)]}catch(t){return[t]}})(fetch,r,{credentials:"same-origin"});return a?new Response(a.message):(await async function(t,n){return(await caches.open(o)).put(t,n)}(n,u.clone()),u)})),globalThis.addEventListener("activate",n(async function(){console.info(`cloudcmd: sw: activate: ${o}`),await globalThis.clients.claim();const t=await caches.keys(),n=caches.delete.bind(caches);await Promise.all(t.map(n))}))})()})();
1
+ (()=>{var t={4299(t){"use strict";const n=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const r=(...r)=>n(t,...e,...r),i=t.length-e.length-1,o=(t=>[function(n){return t(...arguments)},function(n,e){return t(...arguments)},function(n,e,r){return t(...arguments)},function(n,e,r,i){return t(...arguments)},function(n,e,r,i,o){return t(...arguments)}])(r)[i];return o||r};t.exports=n},5606(t){var n,e,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var a,s=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?s=a.concat(s):l=-1,s.length&&h())}function h(){if(!u){var t=c(f);u=!0;for(var n=s.length;n;){for(a=s,s=[];++l<n;)a&&a[l].run();l=-1,n=s.length}a=null,u=!1,function(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}(t)}}function d(t,n){this.fun=t,this.array=n}function p(){}r.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];s.push(new d(t,n)),1!==s.length||u||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}},n={};function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(()=>{"use strict";e(5606);var t=e(4299);const n=t((t,n)=>n.waitUntil(t())),r=t((t,n)=>{const{request:e}=n,{url:r}=e,o=i(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===e.method&&"basic"===e.type&&(o.startsWith("/api")||/^socket.io/.test(o)||n.respondWith(t(n)))}),i=t=>new URL(t).pathname,o="cloudcmd: Sat Jan 31 2026 22:48:29 GMT+0200 (Eastern European Standard Time)";globalThis.addEventListener("install",n(async function(){console.info(`cloudcmd: sw: install: ${o}`),await globalThis.skipWaiting()})),globalThis.addEventListener("fetch",r(async function(t){const{request:n}=t,{url:e}=n,r=((t,n)=>"/"!==t?n:new Request("/",{credentials:"same-origin"}))(i(e),t.request),c=await caches.open(o),a=await c.match(n);if(a)return a;const[s,u]=await(async(t,...n)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...n)]}catch(t){return[t]}})(fetch,r,{credentials:"same-origin"});return s?new Response(s.message):(await async function(t,n){return(await caches.open(o)).put(t,n)}(n,u.clone()),u)})),globalThis.addEventListener("activate",n(async function(){console.info(`cloudcmd: sw: activate: ${o}`),await globalThis.clients.claim();const t=await caches.keys(),n=caches.delete.bind(caches);await Promise.all(t.map(n))}))})()})();
2
2
  //# sourceMappingURL=sw.js.map
@@ -147,7 +147,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
147
147
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
148
148
 
149
149
  "use strict";
150
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurrentInfo: () => (/* binding */ CurrentInfo),\n/* harmony export */ changePanel: () => (/* binding */ changePanel),\n/* harmony export */ checkStorageHash: () => (/* binding */ checkStorageHash),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ deleteCurrent: () => (/* binding */ deleteCurrent),\n/* harmony export */ deleteSelected: () => (/* binding */ deleteSelected),\n/* harmony export */ duplicatePanel: () => (/* binding */ duplicatePanel),\n/* harmony export */ expandSelection: () => (/* binding */ expandSelection),\n/* harmony export */ getActiveFiles: () => (/* binding */ getActiveFiles),\n/* harmony export */ getAllFiles: () => (/* binding */ getAllFiles),\n/* harmony export */ getCSSVar: () => (/* binding */ getCSSVar),\n/* harmony export */ getCurrentData: () => (/* binding */ getCurrentData),\n/* harmony export */ getCurrentDate: () => (/* binding */ getCurrentDate),\n/* harmony export */ getCurrentDirName: () => (/* binding */ getCurrentDirName),\n/* harmony export */ getCurrentLink: () => (/* binding */ getCurrentLink),\n/* harmony export */ getCurrentMode: () => (/* binding */ getCurrentMode),\n/* harmony export */ getCurrentOwner: () => (/* binding */ getCurrentOwner),\n/* harmony export */ getCurrentSize: () => (/* binding */ getCurrentSize),\n/* harmony export */ getFM: () => (/* binding */ getFM),\n/* harmony export */ getFilenames: () => (/* binding */ getFilenames),\n/* harmony export */ getFiles: () => (/* binding */ getFiles),\n/* harmony export */ getNotCurrentDirPath: () => (/* binding */ getNotCurrentDirPath),\n/* harmony export */ getPackerExt: () => (/* binding */ getPackerExt),\n/* harmony export */ getPanel: () => (/* binding */ getPanel),\n/* harmony export */ getPanelPosition: () => (/* binding */ getPanelPosition),\n/* harmony export */ getParentDirPath: () => (/* binding */ getParentDirPath),\n/* harmony export */ getRefreshButton: () => (/* binding */ getRefreshButton),\n/* harmony export */ goToDirectory: () => (/* binding */ goToDirectory),\n/* harmony export */ hidePanel: () => (/* binding */ hidePanel),\n/* harmony export */ loadCurrentHash: () => (/* binding */ loadCurrentHash),\n/* harmony export */ loadCurrentSize: () => (/* binding */ loadCurrentSize),\n/* harmony export */ loadRemote: () => (/* binding */ loadRemote),\n/* harmony export */ loadSocket: () => (/* binding */ loadSocket),\n/* harmony export */ promptNewDir: () => (/* binding */ promptNewDir),\n/* harmony export */ promptNewFile: () => (/* binding */ promptNewFile),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ saveDataToStorage: () => (/* binding */ saveDataToStorage),\n/* harmony export */ scrollByPages: () => (/* binding */ scrollByPages),\n/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),\n/* harmony export */ setCurrentSize: () => (/* binding */ setCurrentSize),\n/* harmony export */ setHistory: () => (/* binding */ setHistory),\n/* harmony export */ showPanel: () => (/* binding */ showPanel),\n/* harmony export */ shrinkSelection: () => (/* binding */ shrinkSelection),\n/* harmony export */ swapPanels: () => (/* binding */ swapPanels),\n/* harmony export */ unselectFiles: () => (/* binding */ unselectFiles),\n/* harmony export */ updateCurrentInfo: () => (/* binding */ updateCurrentInfo)\n/* harmony export */ });\n/* harmony import */ var _dom_load__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _dom_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _images_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./images.mjs */ \"./client/dom/images.mjs\");\n/* harmony import */ var _operations_rename_current_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operations/rename-current.js */ \"./client/dom/operations/rename-current.js\");\n/* harmony import */ var _current_file_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./current-file.mjs */ \"./client/dom/current-file.mjs\");\n/* harmony import */ var _dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom-tree.mjs */ \"./client/dom/dom-tree.mjs\");\n/* harmony import */ var _cmd_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cmd.mjs */ \"./client/dom/cmd.mjs\");\n/* harmony import */ var _io_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./io/index.js */ \"./client/dom/io/index.js\");\n/* harmony import */ var _directory_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./directory.mjs */ \"./client/dom/directory.mjs\");\n/* harmony import */ var _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./buffer.mjs */ \"./client/dom/buffer.mjs\");\n/* harmony import */ var _load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./load-remote.mjs */ \"./client/dom/load-remote.mjs\");\n/* harmony import */ var _select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./select-by-pattern.mjs */ \"./client/dom/select-by-pattern.mjs\");\n/* global CloudCmd */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n assign\n} = Object;\nconst DOM = {\n getCurrentDirName,\n getNotCurrentDirPath,\n getParentDirPath,\n loadRemote,\n loadSocket,\n promptNewDir,\n promptNewFile,\n unselectFiles,\n getActiveFiles,\n getCurrentDate,\n getCurrentSize,\n loadCurrentSize,\n loadCurrentHash,\n setCurrentSize,\n getCurrentMode,\n getCurrentOwner,\n getCurrentData,\n getRefreshButton,\n getAllFiles,\n expandSelection,\n shrinkSelection,\n setHistory,\n getCurrentLink,\n getFilenames,\n checkStorageHash,\n saveDataToStorage,\n getFM,\n getPanelPosition,\n getCSSVar,\n getPanel,\n getFiles,\n showPanel,\n hidePanel,\n remove,\n deleteCurrent,\n deleteSelected,\n renameCurrent: _operations_rename_current_js__WEBPACK_IMPORTED_MODULE_8__,\n scrollIntoViewIfNeeded,\n scrollByPages,\n changePanel,\n getPackerExt,\n goToDirectory,\n duplicatePanel,\n swapPanels,\n updateCurrentInfo\n};\nassign(DOM, {\n ..._dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__,\n ..._current_file_mjs__WEBPACK_IMPORTED_MODULE_9__,\n ..._cmd_mjs__WEBPACK_IMPORTED_MODULE_11__\n});\nconst CurrentInfo = {};\nDOM.Images = _images_mjs__WEBPACK_IMPORTED_MODULE_7__;\nDOM.load = _dom_load__WEBPACK_IMPORTED_MODULE_0__;\nDOM.Files = _dom_files__WEBPACK_IMPORTED_MODULE_1__;\nDOM.RESTful = _dom_rest__WEBPACK_IMPORTED_MODULE_6__;\nDOM.IO = _io_index_js__WEBPACK_IMPORTED_MODULE_12__;\nDOM.Storage = _dom_storage__WEBPACK_IMPORTED_MODULE_5__;\nDOM.Dialog = _dom_dialog__WEBPACK_IMPORTED_MODULE_2__;\nDOM.CurrentInfo = CurrentInfo;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DOM);\nDOM.uploadDirectory = _directory_mjs__WEBPACK_IMPORTED_MODULE_13__.uploadDirectory;\nDOM.Buffer = _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__;\nDOM.Events = _dom_events__WEBPACK_IMPORTED_MODULE_3__;\nconst isString = a => typeof a === 'string';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\nfunction loadRemote(name, options, callback) {\n (0,_load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__.loadRemote)(name, options, callback);\n return DOM;\n}\nfunction loadSocket(callback) {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n}\n\n/**\n * create new folder\n *\n */\nasync function promptNewDir() {\n await promptNew('directory');\n}\n\n/**\n * create new file\n *\n * @typeName\n * @type\n */\nasync function promptNewFile() {\n await promptNew('file');\n}\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = `New ${typeName}` || 'File';\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.createDirectory(path);else await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n\n/**\n * get current directory name\n */\nfunction getCurrentDirName() {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n return href.replace(`${substr}/`, '') || '/';\n}\n\n/**\n * get current directory path\n */\nfunction getParentDirPath(panel) {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n}\n\n/**\n * get not current directory path\n */\nfunction getNotCurrentDirPath() {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n}\n\n/*\n * unselect all files\n */\nfunction unselectFiles(files) {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n}\n\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\nfunction getActiveFiles() {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n}\nfunction getCurrentDate(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n return DOM.getByDataName('js-date', current).textContent;\n}\n\n/**\n * get size\n * @currentFile\n */\nfunction getCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n\n /* если это папка - возвращаем слово dir вместо размера*/\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n}\n\n/**\n * get size\n * @currentFile\n */\nasync function loadCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n _images_mjs__WEBPACK_IMPORTED_MODULE_7__.show.load();\n if (name === '..') return;\n const [, size] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n DOM.setCurrentSize(size, current);\n _images_mjs__WEBPACK_IMPORTED_MODULE_7__.hide();\n return current;\n}\n\n/**\n * load hash\n * @callback\n * @currentFile\n */\nasync function loadCurrentHash(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n return data;\n}\n\n/**\n * set size\n * @currentFile\n */\nfunction setCurrentSize(size, currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentMode(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentOwner(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n}\n\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\nasync function getCurrentData(currentFile) {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n if (isDir) return await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(`${path}-data`)];\n const [e, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 ** 2 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n}\n\n/**\n * unified way to get RefreshButton\n */\nfunction getRefreshButton(panel = DOM.getPanel()) {\n return DOM.getByDataName('js-refresh', panel);\n}\nfunction getAllFiles() {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n const from = a => a === '..' ? 1 : 0;\n const i = from(name);\n return Array.from(files).slice(i);\n}\n\n/**\n * open dialog with expand selection\n */\nasync function expandSelection() {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * open dialog with shrink selection\n */\nasync function shrinkSelection() {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * setting history wrapper\n */\nfunction setHistory(data, title, url) {\n const ret = globalThis.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n}\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nfunction getCurrentLink(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n}\nfunction getFilenames(files) {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n}\n\n/**\n * check storage hash\n */\nasync function checkStorageHash(name) {\n const nameHash = `${name}-hash`;\n if (!isString(name)) throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(nameHash)]);\n return [loadHash, storeHash];\n}\n\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n */\nasync function saveDataToStorage(name, data, hash) {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = `${name}-hash`;\n const nameData = `${name}-data`;\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameHash, hash);\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameData, data);\n return hash;\n}\nfunction getFM() {\n const {\n parentElement\n } = DOM.getPanel();\n return parentElement;\n}\nfunction getPanelPosition(panel) {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n}\nfunction getCSSVar(name, {\n body = document.body\n} = {}) {\n const bodyStyle = getComputedStyle(body);\n return bodyStyle.getPropertyValue(`--${name}`);\n}\n\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\nfunction getPanel(options) {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n\n /* if {active : false} getting passive panel */\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n\n /* if two panels showed\n * then always work with passive\n * panel\n */\n if (globalThis.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n}\nfunction getFiles(element) {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n}\n\n/**\n * shows panel right or left (or active)\n */\nfunction showPanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n}\n\n/**\n * hides panel right or left (or active)\n */\nfunction hidePanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n}\n\n/**\n * remove child of element\n * @param child\n * @param element\n */\nfunction remove(child, element) {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n}\n\n/**\n * remove current file from file table\n * @param current\n *\n */\nfunction deleteCurrent(current) {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n}\n\n/**\n * remove selected files from file table\n * @Selected\n */\nfunction deleteSelected(selected) {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n}\n\n/**\n * rename current file\n *\n * @currentFile\n */\nfunction scrollIntoViewIfNeeded(element, center = false) {\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n}\n\n/* scroll on one page */\nfunction scrollByPages(element, pPages) {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n}\nfunction changePanel() {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n}\nfunction getPackerExt(type) {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n}\nasync function goToDirectory(overrides = {}) {\n const {\n Dialog\n } = DOM;\n const {\n prompt = Dialog.prompt,\n changeDir = CloudCmd.changeDir\n } = overrides;\n const msg = 'Go to directory:';\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await prompt(msg, dirPath);\n if (cancel) return;\n await changeDir(path);\n}\nasync function duplicatePanel() {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n const path = getPath(isDir);\n await CloudCmd.changeDir(path, {\n panel,\n noCurrent\n });\n}\nasync function swapPanels() {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.changeDir(path, {\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.changeDir(dirPathPassive, {\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n}\nfunction updateCurrentInfo(currentFile) {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = (0,_common_util__WEBPACK_IMPORTED_MODULE_4__.getExt)(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = files.parentElement || DOM.getPanel();\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/index.mjs\n}");
150
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurrentInfo: () => (/* binding */ CurrentInfo),\n/* harmony export */ changePanel: () => (/* binding */ changePanel),\n/* harmony export */ checkStorageHash: () => (/* binding */ checkStorageHash),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ deleteCurrent: () => (/* binding */ deleteCurrent),\n/* harmony export */ deleteSelected: () => (/* binding */ deleteSelected),\n/* harmony export */ duplicatePanel: () => (/* binding */ duplicatePanel),\n/* harmony export */ expandSelection: () => (/* binding */ expandSelection),\n/* harmony export */ getActiveFiles: () => (/* binding */ getActiveFiles),\n/* harmony export */ getAllFiles: () => (/* binding */ getAllFiles),\n/* harmony export */ getCSSVar: () => (/* binding */ getCSSVar),\n/* harmony export */ getCurrentData: () => (/* binding */ getCurrentData),\n/* harmony export */ getCurrentDate: () => (/* binding */ getCurrentDate),\n/* harmony export */ getCurrentDirName: () => (/* binding */ getCurrentDirName),\n/* harmony export */ getCurrentLink: () => (/* binding */ getCurrentLink),\n/* harmony export */ getCurrentMode: () => (/* binding */ getCurrentMode),\n/* harmony export */ getCurrentOwner: () => (/* binding */ getCurrentOwner),\n/* harmony export */ getCurrentSize: () => (/* binding */ getCurrentSize),\n/* harmony export */ getFM: () => (/* binding */ getFM),\n/* harmony export */ getFilenames: () => (/* binding */ getFilenames),\n/* harmony export */ getFiles: () => (/* binding */ getFiles),\n/* harmony export */ getNotCurrentDirPath: () => (/* binding */ getNotCurrentDirPath),\n/* harmony export */ getPackerExt: () => (/* binding */ getPackerExt),\n/* harmony export */ getPanel: () => (/* binding */ getPanel),\n/* harmony export */ getPanelPosition: () => (/* binding */ getPanelPosition),\n/* harmony export */ getParentDirPath: () => (/* binding */ getParentDirPath),\n/* harmony export */ getRefreshButton: () => (/* binding */ getRefreshButton),\n/* harmony export */ goToDirectory: () => (/* binding */ goToDirectory),\n/* harmony export */ hidePanel: () => (/* binding */ hidePanel),\n/* harmony export */ loadCurrentHash: () => (/* binding */ loadCurrentHash),\n/* harmony export */ loadCurrentSize: () => (/* binding */ loadCurrentSize),\n/* harmony export */ loadRemote: () => (/* binding */ loadRemote),\n/* harmony export */ loadSocket: () => (/* binding */ loadSocket),\n/* harmony export */ promptNewDir: () => (/* binding */ promptNewDir),\n/* harmony export */ promptNewFile: () => (/* binding */ promptNewFile),\n/* harmony export */ remove: () => (/* binding */ remove),\n/* harmony export */ saveDataToStorage: () => (/* binding */ saveDataToStorage),\n/* harmony export */ scrollByPages: () => (/* binding */ scrollByPages),\n/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),\n/* harmony export */ setCurrentSize: () => (/* binding */ setCurrentSize),\n/* harmony export */ setHistory: () => (/* binding */ setHistory),\n/* harmony export */ showPanel: () => (/* binding */ showPanel),\n/* harmony export */ shrinkSelection: () => (/* binding */ shrinkSelection),\n/* harmony export */ swapPanels: () => (/* binding */ swapPanels),\n/* harmony export */ unselectFiles: () => (/* binding */ unselectFiles),\n/* harmony export */ updateCurrentInfo: () => (/* binding */ updateCurrentInfo)\n/* harmony export */ });\n/* harmony import */ var _dom_load__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! #dom/load */ \"./client/dom/load.mjs\");\n/* harmony import */ var _dom_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/files */ \"./client/dom/files.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/events */ \"./client/dom/events/index.mjs\");\n/* harmony import */ var _common_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! #common/util */ \"./common/util.mjs\");\n/* harmony import */ var _dom_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _images_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./images.mjs */ \"./client/dom/images.mjs\");\n/* harmony import */ var _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operations/rename-current.mjs */ \"./client/dom/operations/rename-current.mjs\");\n/* harmony import */ var _current_file_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./current-file.mjs */ \"./client/dom/current-file.mjs\");\n/* harmony import */ var _dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom-tree.mjs */ \"./client/dom/dom-tree.mjs\");\n/* harmony import */ var _cmd_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cmd.mjs */ \"./client/dom/cmd.mjs\");\n/* harmony import */ var _io_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./io/index.js */ \"./client/dom/io/index.js\");\n/* harmony import */ var _directory_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./directory.mjs */ \"./client/dom/directory.mjs\");\n/* harmony import */ var _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./buffer.mjs */ \"./client/dom/buffer.mjs\");\n/* harmony import */ var _load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./load-remote.mjs */ \"./client/dom/load-remote.mjs\");\n/* harmony import */ var _select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./select-by-pattern.mjs */ \"./client/dom/select-by-pattern.mjs\");\n/* global CloudCmd */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst {\n assign\n} = Object;\nconst DOM = {\n getCurrentDirName,\n getNotCurrentDirPath,\n getParentDirPath,\n loadRemote,\n loadSocket,\n promptNewDir,\n promptNewFile,\n unselectFiles,\n getActiveFiles,\n getCurrentDate,\n getCurrentSize,\n loadCurrentSize,\n loadCurrentHash,\n setCurrentSize,\n getCurrentMode,\n getCurrentOwner,\n getCurrentData,\n getRefreshButton,\n getAllFiles,\n expandSelection,\n shrinkSelection,\n setHistory,\n getCurrentLink,\n getFilenames,\n checkStorageHash,\n saveDataToStorage,\n getFM,\n getPanelPosition,\n getCSSVar,\n getPanel,\n getFiles,\n showPanel,\n hidePanel,\n remove,\n deleteCurrent,\n deleteSelected,\n renameCurrent: _operations_rename_current_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n scrollIntoViewIfNeeded,\n scrollByPages,\n changePanel,\n getPackerExt,\n goToDirectory,\n duplicatePanel,\n swapPanels,\n updateCurrentInfo\n};\nassign(DOM, {\n ..._dom_tree_mjs__WEBPACK_IMPORTED_MODULE_10__,\n ..._current_file_mjs__WEBPACK_IMPORTED_MODULE_9__,\n ..._cmd_mjs__WEBPACK_IMPORTED_MODULE_11__\n});\nconst CurrentInfo = {};\nDOM.Images = _images_mjs__WEBPACK_IMPORTED_MODULE_7__;\nDOM.load = _dom_load__WEBPACK_IMPORTED_MODULE_0__;\nDOM.Files = _dom_files__WEBPACK_IMPORTED_MODULE_1__;\nDOM.RESTful = _dom_rest__WEBPACK_IMPORTED_MODULE_6__;\nDOM.IO = _io_index_js__WEBPACK_IMPORTED_MODULE_12__;\nDOM.Storage = _dom_storage__WEBPACK_IMPORTED_MODULE_5__;\nDOM.Dialog = _dom_dialog__WEBPACK_IMPORTED_MODULE_2__;\nDOM.CurrentInfo = CurrentInfo;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DOM);\nDOM.uploadDirectory = _directory_mjs__WEBPACK_IMPORTED_MODULE_13__.uploadDirectory;\nDOM.Buffer = _buffer_mjs__WEBPACK_IMPORTED_MODULE_14__;\nDOM.Events = _dom_events__WEBPACK_IMPORTED_MODULE_3__;\nconst isString = a => typeof a === 'string';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\nfunction loadRemote(name, options, callback) {\n (0,_load_remote_mjs__WEBPACK_IMPORTED_MODULE_15__.loadRemote)(name, options, callback);\n return DOM;\n}\nfunction loadSocket(callback) {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n}\n\n/**\n * create new folder\n *\n */\nasync function promptNewDir() {\n await promptNew('directory');\n}\n\n/**\n * create new file\n *\n * @typeName\n * @type\n */\nasync function promptNewFile() {\n await promptNew('file');\n}\nasync function promptNew(typeName) {\n const {\n Dialog\n } = DOM;\n const dir = DOM.getCurrentDirPath();\n const msg = `New ${typeName}` || 'File';\n const getName = () => {\n const name = DOM.getCurrentName();\n if (name === '..') return '';\n return name;\n };\n const name = getName();\n const [cancel, currentName] = await Dialog.prompt(msg, name);\n if (cancel) return;\n const path = `${dir}${currentName}`;\n if (typeName === 'directory') await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.createDirectory(path);else await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n\n/**\n * get current directory name\n */\nfunction getCurrentDirName() {\n const href = DOM.getCurrentDirPath().replace(/\\/$/, '');\n const substr = href.substr(href, href.lastIndexOf('/'));\n return href.replace(`${substr}/`, '') || '/';\n}\n\n/**\n * get current directory path\n */\nfunction getParentDirPath(panel) {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path !== '/') return path.slice(0, index);\n return path;\n}\n\n/**\n * get not current directory path\n */\nfunction getNotCurrentDirPath() {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n}\n\n/*\n * unselect all files\n */\nfunction unselectFiles(files) {\n files = files || DOM.getSelectedFiles();\n Array.from(files).forEach(DOM.toggleSelectedFile);\n}\n\n/**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\nfunction getActiveFiles() {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n if (!files.length && name !== '..') return [current];\n return files;\n}\nfunction getCurrentDate(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n return DOM.getByDataName('js-date', current).textContent;\n}\n\n/**\n * get size\n * @currentFile\n */\nfunction getCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n\n /* если это папка - возвращаем слово dir вместо размера*/\n const size = DOM.getByDataName('js-size', current).textContent.replace(/^<|>$/g, '');\n return size;\n}\n\n/**\n * get size\n * @currentFile\n */\nasync function loadCurrentSize(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n _images_mjs__WEBPACK_IMPORTED_MODULE_7__.show.load();\n if (name === '..') return;\n const [, size] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n DOM.setCurrentSize(size, current);\n _images_mjs__WEBPACK_IMPORTED_MODULE_7__.hide();\n return current;\n}\n\n/**\n * load hash\n * @callback\n * @currentFile\n */\nasync function loadCurrentHash(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(link + query);\n return data;\n}\n\n/**\n * set size\n * @currentFile\n */\nfunction setCurrentSize(size, currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n sizeElement.textContent = size;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentMode(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n return mode.textContent;\n}\n\n/**\n * @currentFile\n */\nfunction getCurrentOwner(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n return owner.textContent;\n}\n\n/**\n * unified way to get current file content\n *\n * @param currentFile\n */\nasync function getCurrentData(currentFile) {\n const {\n Dialog\n } = DOM;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n if (Info.name === '..') {\n Dialog.alert.noFiles();\n return [Error('No Files')];\n }\n if (isDir) return await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n const [hashNew, hash] = await DOM.checkStorageHash(path);\n if (!hashNew) return [Error(`Can't get hash of a file`)];\n if (hash === hashNew) return [null, await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(`${path}-data`)];\n const [e, data] = await _dom_rest__WEBPACK_IMPORTED_MODULE_6__.read(path);\n if (e) return [e, null];\n const ONE_MEGABYTE = 1024 ** 2 * 1024;\n const {\n length\n } = data;\n if (hash && length < ONE_MEGABYTE) await DOM.saveDataToStorage(path, data, hashNew);\n return [null, data];\n}\n\n/**\n * unified way to get RefreshButton\n */\nfunction getRefreshButton(panel = DOM.getPanel()) {\n return DOM.getByDataName('js-refresh', panel);\n}\nfunction getAllFiles() {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n const from = a => a === '..' ? 1 : 0;\n const i = from(name);\n return Array.from(files).slice(i);\n}\n\n/**\n * open dialog with expand selection\n */\nasync function expandSelection() {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * open dialog with shrink selection\n */\nasync function shrinkSelection() {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n await (0,_select_by_pattern_mjs__WEBPACK_IMPORTED_MODULE_16__.selectByPattern)(msg, files);\n}\n\n/**\n * setting history wrapper\n */\nfunction setHistory(data, title, url) {\n const ret = globalThis.history;\n const {\n prefix\n } = CloudCmd;\n url = prefix + url;\n if (ret) history.pushState(data, title, url);\n return ret;\n}\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nfunction getCurrentLink(currentFile) {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n}\nfunction getFilenames(files) {\n if (!files) throw Error('AllFiles could not be empty');\n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n const allFiles = Array.from(files);\n if (name === '..') allFiles.shift();\n const names = allFiles.map(current => {\n return DOM.getCurrentName(current);\n });\n return names;\n}\n\n/**\n * check storage hash\n */\nasync function checkStorageHash(name) {\n const nameHash = `${name}-hash`;\n if (!isString(name)) throw Error('name should be a string!');\n const [loadHash, storeHash] = await Promise.all([DOM.loadCurrentHash(), _dom_storage__WEBPACK_IMPORTED_MODULE_5__.get(nameHash)]);\n return [loadHash, storeHash];\n}\n\n/**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n */\nasync function saveDataToStorage(name, data, hash) {\n const isDir = DOM.isCurrentIsDir();\n if (isDir) return;\n hash = hash || (await DOM.loadCurrentHash());\n const nameHash = `${name}-hash`;\n const nameData = `${name}-data`;\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameHash, hash);\n await _dom_storage__WEBPACK_IMPORTED_MODULE_5__.set(nameData, data);\n return hash;\n}\nfunction getFM() {\n const {\n parentElement\n } = DOM.getPanel();\n return parentElement;\n}\nfunction getPanelPosition(panel) {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n}\nfunction getCSSVar(name, {\n body = document.body\n} = {}) {\n const bodyStyle = getComputedStyle(body);\n return bodyStyle.getPropertyValue(`--${name}`);\n}\n\n/** function getting panel active, or passive\n * @param options = {active: true}\n */\nfunction getPanel(options) {\n let files;\n let panel;\n let isLeft;\n let dataName = 'js-';\n const current = DOM.getCurrentFile();\n if (!current) {\n panel = DOM.getByDataName('js-left');\n } else {\n files = current.parentElement;\n panel = files.parentElement;\n isLeft = panel.getAttribute('data-name') === 'js-left';\n }\n\n /* if {active : false} getting passive panel */\n if (options && !options.active) {\n dataName += isLeft ? 'right' : 'left';\n panel = DOM.getByDataName(dataName);\n }\n\n /* if two panels showed\n * then always work with passive\n * panel\n */\n if (globalThis.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH) panel = DOM.getByDataName('js-left');\n if (!panel) throw Error('can not find Active Panel!');\n return panel;\n}\nfunction getFiles(element) {\n const files = DOM.getByDataName('js-files', element);\n return files.children || [];\n}\n\n/**\n * shows panel right or left (or active)\n */\nfunction showPanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n DOM.show(panel);\n return true;\n}\n\n/**\n * hides panel right or left (or active)\n */\nfunction hidePanel(active) {\n const panel = DOM.getPanel({\n active\n });\n if (!panel) return false;\n return DOM.hide(panel);\n}\n\n/**\n * remove child of element\n * @param child\n * @param element\n */\nfunction remove(child, element) {\n const parent = element || document.body;\n parent.removeChild(child);\n return DOM;\n}\n\n/**\n * remove current file from file table\n * @param current\n *\n */\nfunction deleteCurrent(current) {\n if (!current) DOM.getCurrentFile();\n const parent = current === null || current === void 0 ? void 0 : current.parentElement;\n const name = DOM.getCurrentName(current);\n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n}\n\n/**\n * remove selected files from file table\n * @Selected\n */\nfunction deleteSelected(selected) {\n selected = selected || DOM.getSelectedFiles();\n if (!selected) return;\n selected.map(DOM.deleteCurrent);\n}\n\n/**\n * rename current file\n *\n * @currentFile\n */\nfunction scrollIntoViewIfNeeded(element, center = false) {\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n}\n\n/* scroll on one page */\nfunction scrollByPages(element, pPages) {\n const ret = (element === null || element === void 0 ? void 0 : element.scrollByPages) && pPages;\n if (ret) element.scrollByPages(pPages);\n return ret;\n}\nfunction changePanel() {\n const Info = CurrentInfo;\n let panel = DOM.getPanel();\n CloudCmd.emit('passive-dir', Info.dirPath);\n const panelPassive = DOM.getPanel({\n active: false\n });\n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n let dataName = panel.getAttribute('data-name');\n TabPanel[dataName] = name;\n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n name = TabPanel[dataName];\n let files;\n let current;\n if (name) {\n current = DOM.getCurrentByName(name, panel);\n if (current) files = current.parentElement;\n }\n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n if (!current) [current] = filesPassive;\n }\n DOM.setCurrentFile(current, {\n history: true\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n return DOM;\n}\nfunction getPackerExt(type) {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n}\nasync function goToDirectory(overrides = {}) {\n const {\n Dialog\n } = DOM;\n const {\n prompt = Dialog.prompt,\n changeDir = CloudCmd.changeDir\n } = overrides;\n const msg = 'Go to directory:';\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await prompt(msg, dirPath);\n if (cancel) return;\n await changeDir(path);\n}\nasync function duplicatePanel() {\n const Info = CurrentInfo;\n const {\n isDir\n } = Info;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n const getPath = isDir => {\n if (isDir) return Info.path;\n return Info.dirPath;\n };\n const path = getPath(isDir);\n await CloudCmd.changeDir(path, {\n panel,\n noCurrent\n });\n}\nasync function swapPanels() {\n const Info = CurrentInfo;\n const {\n panel,\n files,\n element,\n panelPassive\n } = Info;\n const path = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n let currentIndex = files.indexOf(element);\n await CloudCmd.changeDir(path, {\n panel: panelPassive,\n noCurrent: true\n });\n await CloudCmd.changeDir(dirPathPassive, {\n panel\n });\n const length = Info.files.length - 1;\n if (currentIndex > length) currentIndex = length;\n const el = Info.files[currentIndex];\n DOM.setCurrentFile(el);\n}\nfunction updateCurrentInfo(currentFile) {\n const info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const files = current.parentElement;\n const panelPassive = DOM.getPanel({\n active: false\n });\n const filesPassive = DOM.getFiles(panelPassive);\n const name = DOM.getCurrentName(current);\n info.dir = DOM.getCurrentDirName();\n info.dirPath = DOM.getCurrentDirPath();\n info.parentDirPath = DOM.getParentDirPath();\n info.element = current;\n info.ext = (0,_common_util__WEBPACK_IMPORTED_MODULE_4__.getExt)(name);\n info.files = Array.from(files.children);\n info.filesPassive = Array.from(filesPassive);\n info.first = files.firstChild;\n info.getData = DOM.getCurrentData;\n info.last = files.lastChild;\n info.link = DOM.getCurrentLink(current);\n info.mode = DOM.getCurrentMode(current);\n info.name = name;\n info.path = DOM.getCurrentPath(current);\n info.panel = files.parentElement || DOM.getPanel();\n info.panelPassive = panelPassive;\n info.size = DOM.getCurrentSize(current);\n info.isDir = DOM.isCurrentIsDir();\n info.isSelected = DOM.isSelected(current);\n info.panelPosition = DOM.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel = info.panel.getAttribute('data-name') === info.panelPassive.getAttribute('data-name');\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/index.mjs\n}");
151
151
 
152
152
  /***/ },
153
153
 
@@ -195,14 +195,14 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
195
195
 
196
196
  /***/ },
197
197
 
198
- /***/ "./client/dom/operations/rename-current.js"
199
- /*!*************************************************!*\
200
- !*** ./client/dom/operations/rename-current.js ***!
201
- \*************************************************/
202
- (module, __unused_webpack_exports, __webpack_require__) {
198
+ /***/ "./client/dom/operations/rename-current.mjs"
199
+ /*!**************************************************!*\
200
+ !*** ./client/dom/operations/rename-current.mjs ***!
201
+ \**************************************************/
202
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
203
203
 
204
204
  "use strict";
205
- eval("{\n\n/* global CloudCmd */\nconst capitalize = __webpack_require__(/*! just-capitalize */ \"./node_modules/just-capitalize/index.cjs\");\nconst _Dialog = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\nconst Storage = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\nconst RESTful = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\nconst _currentFile = __webpack_require__(/*! ../current-file.mjs */ \"./client/dom/current-file.mjs\");\nmodule.exports = async (current, overrides = {}) => {\n const {\n refresh = CloudCmd.refresh,\n Dialog = _Dialog,\n currentFile = _currentFile\n } = overrides;\n const {\n isCurrentFile,\n getCurrentName,\n getCurrentFile,\n getCurrentByName,\n getCurrentType,\n getCurrentDirPath,\n setCurrentName\n } = currentFile;\n if (!isCurrentFile(current)) current = getCurrentFile();\n const from = getCurrentName(current);\n if (from === '..') return Dialog.alert.noFiles();\n const [cancel, to] = await Dialog.prompt('Rename', from);\n if (cancel) return;\n const nextFile = getCurrentByName(to);\n if (nextFile) {\n const type = getCurrentType(nextFile);\n const msg = `${capitalize(type)} \"${to}\" already exists. Proceed?`;\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n }\n if (from === to) return;\n const dirPath = getCurrentDirPath();\n const fromFull = `${dirPath}${from}`;\n const toFull = `${dirPath}${to}`;\n const [e] = await RESTful.rename(fromFull, toFull);\n if (e) return;\n setCurrentName(to, current);\n Storage.remove(dirPath);\n refresh();\n};\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/operations/rename-current.js\n}");
205
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var just_capitalize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! just-capitalize */ \"./node_modules/just-capitalize/index.mjs\");\n/* harmony import */ var _dom_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! #dom/dialog */ \"./client/dom/dialog.mjs\");\n/* harmony import */ var _dom_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! #dom/storage */ \"./client/dom/storage.mjs\");\n/* harmony import */ var _dom_rest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! #dom/rest */ \"./client/dom/rest.mjs\");\n/* harmony import */ var _current_file_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../current-file.mjs */ \"./client/dom/current-file.mjs\");\n/* global CloudCmd */\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (async (current, overrides = {}) => {\n const {\n refresh = CloudCmd.refresh,\n Dialog = _dom_dialog__WEBPACK_IMPORTED_MODULE_1__,\n currentFile = _current_file_mjs__WEBPACK_IMPORTED_MODULE_4__\n } = overrides;\n const {\n isCurrentFile,\n getCurrentName,\n getCurrentFile,\n getCurrentByName,\n getCurrentType,\n getCurrentDirPath,\n setCurrentName\n } = currentFile;\n if (!isCurrentFile(current)) current = getCurrentFile();\n const from = getCurrentName(current);\n if (from === '..') return Dialog.alert.noFiles();\n const [cancel, to] = await Dialog.prompt('Rename', from);\n if (cancel) return;\n const nextFile = getCurrentByName(to);\n if (nextFile) {\n const type = getCurrentType(nextFile);\n const msg = `${(0,just_capitalize__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)} \"${to}\" already exists. Proceed?`;\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n }\n if (from === to) return;\n const dirPath = getCurrentDirPath();\n const fromFull = `${dirPath}${from}`;\n const toFull = `${dirPath}${to}`;\n const [e] = await _dom_rest__WEBPACK_IMPORTED_MODULE_3__.rename(fromFull, toFull);\n if (e) return;\n setCurrentName(to, current);\n _dom_storage__WEBPACK_IMPORTED_MODULE_2__.remove(dirPath);\n refresh();\n});\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/dom/operations/rename-current.mjs\n}");
206
206
 
207
207
  /***/ },
208
208
 
@@ -873,7 +873,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-ext
873
873
  (__unused_webpack_module, exports, __webpack_require__) {
874
874
 
875
875
  "use strict";
876
- eval("{/* provided dependency */ var process = __webpack_require__(/*! process/browser */ \"./node_modules/process/browser.js\");\n\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nvar picocolors = __webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\");\nvar jsTokens = __webpack_require__(/*! js-tokens */ \"./node_modules/js-tokens/index.js\");\nvar helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ \"./node_modules/@babel/helper-validator-identifier/lib/index.js\");\n\nfunction isColorSupported() {\n return (typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? false : picocolors.isColorSupported\n );\n}\nconst compose = (f, g) => v => f(g(v));\nfunction buildDefs(colors) {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n reset: colors.reset\n };\n}\nconst defsOn = buildDefs(picocolors.createColors(true));\nconst defsOff = buildDefs(picocolors.createColors(false));\nfunction getDefs(enabled) {\n return enabled ? defsOn : defsOff;\n}\n\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\nconst NEWLINE$1 = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst BRACKET = /^[()[\\]{}]$/;\nlet tokenize;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst getTokenType = function (token, offset, text) {\n if (token.type === \"name\") {\n const tokenValue = token.value;\n if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {\n return \"keyword\";\n }\n if (JSX_TAG.test(tokenValue) && (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")) {\n return \"jsxIdentifier\";\n }\n const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));\n if (firstChar !== firstChar.toLowerCase()) {\n return \"capitalized\";\n }\n }\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n if (token.type === \"invalid\" && (token.value === \"@\" || token.value === \"#\")) {\n return \"punctuator\";\n }\n return token.type;\n};\ntokenize = function* (text) {\n let match;\n while (match = jsTokens.default.exec(text)) {\n const token = jsTokens.matchToToken(match);\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value\n };\n }\n};\nfunction highlight(text) {\n if (text === \"\") return \"\";\n const defs = getDefs(true);\n let highlighted = \"\";\n for (const {\n type,\n value\n } of tokenize(text)) {\n if (type in defs) {\n highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n return highlighted;\n}\n\nlet deprecationWarningShown = false;\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n if (startLine === -1) {\n start = 0;\n }\n if (endLine === -1) {\n end = source.length;\n }\n const lineDiff = endLine - startLine;\n const markerLines = {};\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n return {\n start,\n end,\n markerLines\n };\n}\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;\n const defs = getDefs(shouldHighlight);\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", defs.gutter(gutter.replace(/\\d/g, \" \")), \" \", markerSpacing, defs.marker(\"^\").repeat(numberOfMarkers)].join(\"\");\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [defs.marker(\">\"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : \"\", markerLine].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n }).join(\"\\n\");\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\nfunction index (rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}\n\nexports.codeFrameColumns = codeFrameColumns;\nexports[\"default\"] = index;\nexports.highlight = highlight;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@babel/code-frame/lib/index.js\n}");
876
+ eval("{/* provided dependency */ var process = __webpack_require__(/*! process/browser */ \"./node_modules/process/browser.js\");\n\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nvar picocolors = __webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\");\nvar jsTokens = __webpack_require__(/*! js-tokens */ \"./node_modules/js-tokens/index.js\");\nvar helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ \"./node_modules/@babel/helper-validator-identifier/lib/index.js\");\n\nfunction isColorSupported() {\n return (typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? false : picocolors.isColorSupported\n );\n}\nconst compose = (f, g) => v => f(g(v));\nfunction buildDefs(colors) {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n reset: colors.reset\n };\n}\nconst defsOn = buildDefs(picocolors.createColors(true));\nconst defsOff = buildDefs(picocolors.createColors(false));\nfunction getDefs(enabled) {\n return enabled ? defsOn : defsOff;\n}\n\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\nconst NEWLINE$1 = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst BRACKET = /^[()[\\]{}]$/;\nlet tokenize;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst getTokenType = function (token, offset, text) {\n if (token.type === \"name\") {\n const tokenValue = token.value;\n if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {\n return \"keyword\";\n }\n if (JSX_TAG.test(tokenValue) && (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")) {\n return \"jsxIdentifier\";\n }\n const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));\n if (firstChar !== firstChar.toLowerCase()) {\n return \"capitalized\";\n }\n }\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n if (token.type === \"invalid\" && (token.value === \"@\" || token.value === \"#\")) {\n return \"punctuator\";\n }\n return token.type;\n};\ntokenize = function* (text) {\n let match;\n while (match = jsTokens.default.exec(text)) {\n const token = jsTokens.matchToToken(match);\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value\n };\n }\n};\nfunction highlight(text) {\n if (text === \"\") return \"\";\n const defs = getDefs(true);\n let highlighted = \"\";\n for (const {\n type,\n value\n } of tokenize(text)) {\n if (type in defs) {\n highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n return highlighted;\n}\n\nlet deprecationWarningShown = false;\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nfunction getMarkerLines(loc, source, opts, startLineBaseZero) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line - startLineBaseZero;\n const startColumn = startLoc.column;\n const endLine = endLoc.line - startLineBaseZero;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n if (startLine === -1) {\n start = 0;\n }\n if (endLine === -1) {\n end = source.length;\n }\n const lineDiff = endLine - startLine;\n const markerLines = {};\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n return {\n start,\n end,\n markerLines\n };\n}\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;\n const startLineBaseZero = (opts.startLine || 1) - 1;\n const defs = getDefs(shouldHighlight);\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts, startLineBaseZero);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end + startLineBaseZero).length;\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", defs.gutter(gutter.replace(/\\d/g, \" \")), \" \", markerSpacing, defs.marker(\"^\").repeat(numberOfMarkers)].join(\"\");\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [defs.marker(\">\"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : \"\", markerLine].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n }).join(\"\\n\");\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\nfunction index (rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}\n\nexports.codeFrameColumns = codeFrameColumns;\nexports[\"default\"] = index;\nexports.highlight = highlight;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/@babel/code-frame/lib/index.js\n}");
877
877
 
878
878
  /***/ },
879
879
 
@@ -1685,13 +1685,14 @@ eval("{// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell\n// License: MIT.
1685
1685
 
1686
1686
  /***/ },
1687
1687
 
1688
- /***/ "./node_modules/just-capitalize/index.cjs"
1688
+ /***/ "./node_modules/just-capitalize/index.mjs"
1689
1689
  /*!************************************************!*\
1690
- !*** ./node_modules/just-capitalize/index.cjs ***!
1690
+ !*** ./node_modules/just-capitalize/index.mjs ***!
1691
1691
  \************************************************/
1692
- (module) {
1692
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1693
1693
 
1694
- eval("{module.exports = capitalize;\n\n/*\n capitalize('capitals'); // 'Capitals'\n capitalize('Capitals'); // 'Capitals'\n capitalize('CapiTALS'); // 'Capitals'\n capitalize('many Words'); // 'Many words'\n capitalize('!exclaim'); // '!exclaim'\n*/\n\nfunction capitalize(str) {\n if (typeof str != 'string') {\n throw Error('just-capitalize expects a string argument');\n }\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/just-capitalize/index.cjs\n}");
1694
+ "use strict";
1695
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ stringCapitalize)\n/* harmony export */ });\nvar stringCapitalize = capitalize;\n\n/*\n capitalize('capitals'); // 'Capitals'\n capitalize('Capitals'); // 'Capitals'\n capitalize('CapiTALS'); // 'Capitals'\n capitalize('many Words'); // 'Many words'\n capitalize('!exclaim'); // '!exclaim'\n*/\n\nfunction capitalize(str) {\n if (typeof str != 'string') {\n throw Error('just-capitalize expects a string argument');\n }\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n\n\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/just-capitalize/index.mjs\n}");
1695
1696
 
1696
1697
  /***/ },
1697
1698
 
package/dist-dev/sw.js CHANGED
@@ -16,7 +16,7 @@
16
16
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17
17
 
18
18
  "use strict";
19
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Fri Jan 30 2026 21:04:42 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.mjs\n}");
19
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sat Jan 31 2026 22:48:32 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.mjs\n}");
20
20
 
21
21
  /***/ },
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.1.19",
3
+ "version": "19.1.20",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -131,9 +131,9 @@
131
131
  "ponse": "^7.0.0",
132
132
  "pullout": "^5.0.0",
133
133
  "putout": "^41.0.0",
134
- "redzip": "^3.0.0",
134
+ "redzip": "^4.0.0",
135
135
  "rendy": "^4.1.3",
136
- "restafary": "^12.0.0",
136
+ "restafary": "^13.0.0",
137
137
  "restbox": "^4.0.0",
138
138
  "shortdate": "^2.0.0",
139
139
  "simport": "^1.0.1",
@@ -0,0 +1,8 @@
1
+ export const report = () => `Use 'if condition' instead of 'ternary expression'`;
2
+
3
+ export const replace = () => ({
4
+ 'const test = autoGlobals(require("supertape"))': `{
5
+ const {test: tape} = require('supertape');
6
+ const test = autoGlobals(tape);
7
+ }`,
8
+ });