cloudcmd 19.0.16 → 19.1.0
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/ChangeLog +14 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/bin/cloudcmd.mjs +1 -1
- package/common/try-to-promise-all.js +1 -1
- package/dist/cloudcmd.common.js +2 -2
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/columns/name-size-date.js +0 -7
- package/dist/columns/name-size.js +0 -7
- package/dist/config.js +0 -7
- package/dist/help.js +0 -7
- package/dist/modules/cloud.js +1 -1
- package/dist/modules/cloud.js.map +1 -1
- package/dist/modules/command-line.js +1 -1
- package/dist/modules/command-line.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-file-vim.js.map +1 -1
- package/dist/modules/edit-file.js +1 -1
- package/dist/modules/edit-file.js.map +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit-names-vim.js.map +1 -1
- package/dist/modules/edit-names.js +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/help.js +1 -1
- package/dist/modules/help.js.map +1 -1
- package/dist/modules/konsole.js +1 -1
- package/dist/modules/konsole.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/polyfill.js +1 -1
- package/dist/modules/polyfill.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/nojs.js +0 -7
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/terminal.js +0 -7
- package/dist/themes/dark.js +0 -7
- package/dist/themes/light.js +0 -7
- package/dist/user-menu.js +0 -7
- package/dist/view.js +0 -7
- package/dist-dev/cloudcmd.common.js +463 -430
- package/dist-dev/cloudcmd.js +12 -6
- package/dist-dev/columns/name-size-date.js +3 -3
- package/dist-dev/columns/name-size.js +3 -3
- package/dist-dev/config.js +3 -3
- package/dist-dev/help.js +3 -3
- package/dist-dev/modules/cloud.js +6 -0
- package/dist-dev/modules/command-line.js +6 -0
- package/dist-dev/modules/config.js +6 -0
- package/dist-dev/modules/contact.js +6 -0
- package/dist-dev/modules/edit-file-vim.js +6 -0
- package/dist-dev/modules/edit-file.js +6 -0
- package/dist-dev/modules/edit-names-vim.js +6 -0
- package/dist-dev/modules/edit-names.js +6 -0
- package/dist-dev/modules/edit.js +6 -0
- package/dist-dev/modules/help.js +6 -0
- package/dist-dev/modules/konsole.js +6 -0
- package/dist-dev/modules/markdown.js +6 -0
- package/dist-dev/modules/menu.js +6 -0
- package/dist-dev/modules/operation.js +6 -0
- package/dist-dev/modules/polyfill.js +6 -0
- package/dist-dev/modules/terminal-run.js +6 -0
- package/dist-dev/modules/terminal.js +6 -0
- package/dist-dev/modules/upload.js +6 -0
- package/dist-dev/modules/user-menu.js +6 -0
- package/dist-dev/modules/view.js +6 -0
- package/dist-dev/nojs.js +3 -3
- package/dist-dev/sw.js +60 -14
- package/dist-dev/terminal.js +3 -3
- package/dist-dev/themes/dark.js +3 -3
- package/dist-dev/themes/light.js +3 -3
- package/dist-dev/user-menu.js +3 -3
- package/dist-dev/view.js +3 -3
- package/package.json +5 -5
- package/server/columns.mjs +3 -2
- package/server/config.js +2 -2
- package/server/route.mjs +1 -1
- package/server/server.mjs +1 -1
- package/server/terminal.js +1 -1
- package/server/theme.mjs +2 -3
- package/server/user-menu.mjs +1 -1
- package/server/validate.mjs +1 -1
- package/dist/columns/name-size-date.js.map +0 -1
- package/dist/columns/name-size.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/help.js.map +0 -1
- package/dist/nojs.js.map +0 -1
- package/dist/terminal.js.map +0 -1
- package/dist/themes/dark.js.map +0 -1
- package/dist/themes/light.js.map +0 -1
- package/dist/user-menu.js.map +0 -1
- package/dist/view.js.map +0 -1
|
@@ -8,1491 +8,1524 @@
|
|
|
8
8
|
*/
|
|
9
9
|
(globalThis["webpackChunkcloudcmd"] = globalThis["webpackChunkcloudcmd"] || []).push([["cloudcmd.common"],{
|
|
10
10
|
|
|
11
|
-
/***/ "./client/client.js"
|
|
11
|
+
/***/ "./client/client.js"
|
|
12
12
|
/*!**************************!*\
|
|
13
13
|
!*** ./client/client.js ***!
|
|
14
14
|
\**************************/
|
|
15
|
-
|
|
15
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
16
16
|
|
|
17
17
|
"use strict";
|
|
18
|
-
eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = DOM.getCSSVar('min-one-panel-width');\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, overrides = {}) => {\n const {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = overrides;\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName,\n showDotFiles: CloudCmd.config('showDotFiles')\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n CloudCmd.route(location.hash);\n };\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const [, file] = query;\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n ({\n Listeners\n } = CloudCmd);\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param data - данные о файлах\n * @param panelParam\n * @param options - history, noCurrent, showDotFiles\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent,\n showDotFiles\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n showDotFiles,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js\n}");
|
|
18
|
+
eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = DOM.getCSSVar('min-one-panel-width');\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, overrides = {}) => {\n const {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = overrides;\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName,\n showDotFiles: CloudCmd.config('showDotFiles')\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n CloudCmd.route(location.hash);\n };\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const [, file] = query;\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n ({\n Listeners\n } = CloudCmd);\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param data - данные о файлах\n * @param panelParam\n * @param options - history, noCurrent, showDotFiles\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent,\n showDotFiles\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n showDotFiles,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js\n}");
|
|
19
19
|
|
|
20
|
-
/***/ }
|
|
20
|
+
/***/ },
|
|
21
21
|
|
|
22
|
-
/***/ "./client/cloudcmd.js"
|
|
22
|
+
/***/ "./client/cloudcmd.js"
|
|
23
23
|
/*!****************************!*\
|
|
24
24
|
!*** ./client/cloudcmd.js ***!
|
|
25
25
|
\****************************/
|
|
26
|
-
|
|
26
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
27
27
|
|
|
28
28
|
"use strict";
|
|
29
29
|
eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n if (window.CloudCmd.config('menu') === 'aleman') setTimeout(() => {\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/processor-html */ \"https://esm.sh/@putout/processor-html\"));\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! https://esm.sh/@putout/bundle */ \"https://esm.sh/@putout/bundle\"));\n }, 100);\n};\nwindow.CloudCmd = module.exports;\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js\n}");
|
|
30
30
|
|
|
31
|
-
/***/ }
|
|
31
|
+
/***/ },
|
|
32
32
|
|
|
33
|
-
/***/ "./client/dom/buffer.js"
|
|
33
|
+
/***/ "./client/dom/buffer.js"
|
|
34
34
|
/*!******************************!*\
|
|
35
35
|
!*** ./client/dom/buffer.js ***!
|
|
36
36
|
\******************************/
|
|
37
|
-
|
|
37
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
38
38
|
|
|
39
39
|
"use strict";
|
|
40
40
|
eval("{\n\n/* global CloudCmd */\nconst tryToPromiseAll = __webpack_require__(/*! ../../common/try-to-promise-all */ \"./common/try-to-promise-all.js\");\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\nconst DOM = __webpack_require__(/*! ./ */ \"./client/dom/index.js\");\nmodule.exports = new BufferProto();\nfunction BufferProto() {\n const Info = DOM.CurrentInfo;\n const CLASS = 'cut-file';\n const COPY = 'copy';\n const CUT = 'cut';\n const Buffer = {\n cut: callIfEnabled.bind(null, cut),\n copy: callIfEnabled.bind(null, copy),\n clear: callIfEnabled.bind(null, clear),\n paste: callIfEnabled.bind(null, paste)\n };\n function showMessage(msg) {\n DOM.Dialog.alert(msg);\n }\n function getNames() {\n const files = DOM.getActiveFiles();\n return DOM.getFilenames(files);\n }\n function addCutClass() {\n const files = DOM.getActiveFiles();\n for (const element of files) {\n element.classList.add(CLASS);\n }\n }\n function rmCutClass() {\n const files = DOM.getByClassAll(CLASS);\n for (const element of files) {\n element.classList.remove(CLASS);\n }\n }\n function callIfEnabled(callback) {\n const is = CloudCmd.config('buffer');\n if (is) return callback();\n showMessage('Buffer disabled in config!');\n }\n async function readBuffer() {\n const [e, cp, ct] = await tryToPromiseAll([Storage.getJson(COPY), Storage.getJson(CUT)]);\n return [e, cp, ct];\n }\n async function copy() {\n const names = getNames();\n const from = Info.dirPath;\n await clear();\n if (!names.length) return;\n await Storage.remove(CUT);\n await Storage.setJson(COPY, {\n from,\n names\n });\n }\n async function cut() {\n const names = getNames();\n const from = Info.dirPath;\n await clear();\n if (!names.length) return;\n addCutClass();\n await Storage.setJson(CUT, {\n from,\n names\n });\n }\n async function clear() {\n await Storage.remove(COPY);\n await Storage.remove(CUT);\n rmCutClass();\n }\n async function paste() {\n const [error, cp, ct] = await readBuffer();\n if (error || !cp && !ct) return showMessage(error || 'Buffer is empty!');\n const opStr = cp ? 'copy' : 'move';\n const data = cp || ct;\n const {\n Operation\n } = CloudCmd;\n const msg = 'Path is same!';\n const to = Info.dirPath;\n if (data.from === to) return showMessage(msg);\n Operation.show(opStr, {\n ...data,\n to\n });\n await clear();\n }\n return Buffer;\n}\n\n//# sourceURL=file://cloudcmd/client/dom/buffer.js\n}");
|
|
41
41
|
|
|
42
|
-
/***/ }
|
|
42
|
+
/***/ },
|
|
43
43
|
|
|
44
|
-
/***/ "./client/dom/current-file.js"
|
|
44
|
+
/***/ "./client/dom/current-file.js"
|
|
45
45
|
/*!************************************!*\
|
|
46
46
|
!*** ./client/dom/current-file.js ***!
|
|
47
47
|
\************************************/
|
|
48
|
-
|
|
48
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
49
49
|
|
|
50
50
|
"use strict";
|
|
51
|
-
eval("{\n\n/* global DOM */\n/* global CloudCmd */\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n atob,\n btoa\n} = __webpack_require__(/*! ../../common/base64 */ \"./common/base64.js\");\nconst {\n encode,\n decode\n} = __webpack_require__(/*! ../../common/entity */ \"./common/entity.js\");\nconst {\n getTitle,\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nlet Title;\nconst CURRENT_FILE = 'current-file';\nconst encodeNBSP = a => a === null || a === void 0 ? void 0 : a.replace('\\xa0', ' ');\nconst decodeNBSP = a => a === null || a === void 0 ? void 0 : a.replace(' ', '\\xa0');\nmodule.exports._CURRENT_FILE = CURRENT_FILE;\n/**\n * set name from current (or param) file\n *\n * @param name\n * @param current\n */\nmodule.exports.setCurrentName = (name, current) => {\n const Info = DOM.CurrentInfo;\n const {\n link\n } = Info;\n const {\n prefix\n } = CloudCmd;\n const dir = prefix + FS + Info.dirPath;\n const encoded = encode(name);\n link.title = encoded;\n link.href = dir + encoded;\n link.innerHTML = encoded;\n current.setAttribute('data-name', createNameAttribute(name));\n CloudCmd.emit('current-file', current);\n return link;\n};\n\n/**\n * get name from current (or param) file\n *\n * @param currentFile\n */\nmodule.exports.getCurrentName = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n if (!current) return '';\n return parseNameAttribute(current.getAttribute('data-name'));\n};\n\n/**\n * Generate a `data-name` attribute for the given filename\n * @param name The string name to encode\n */\nconst createNameAttribute = name => {\n const encoded = btoa(encodeURI(name));\n return `js-file-${encoded}`;\n};\n\n/**\n * Parse a `data-name` attribute string back into the original filename\n * @param attribute The string we wish to decode\n */\nconst parseNameAttribute = attribute => {\n attribute = attribute.replace('js-file-', '');\n return decodeNBSP(decodeURI(atob(attribute)));\n};\nmodule.exports._parseNameAttribute = parseNameAttribute;\nconst parseHrefAttribute = (prefix, attribute) => {\n attribute = attribute.replace(RegExp('^' + prefix + FS), '');\n return decode(decodeNBSP(attribute));\n};\nmodule.exports._parseHrefAttribute = parseHrefAttribute;\n/**\n * get current direcotory path\n */\nmodule.exports.getCurrentDirPath = (panel = DOM.getPanel()) => {\n const path = DOM.getByDataName('js-path', panel);\n return path.textContent;\n};\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nmodule.exports.getCurrentPath = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const [element] = DOM.getByTag('a', current);\n const {\n prefix\n } = CloudCmd;\n return parseHrefAttribute(prefix, element.getAttribute('href'));\n};\n\n/**\n * get current direcotory name\n */\nmodule.exports.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 direcotory path\n */\nmodule.exports.getParentDirPath = panel => {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path === '/') return path;\n return path.slice(0, index);\n};\n\n/**\n * get not current direcotory path\n */\nmodule.exports.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n};\n\n/**\n * unified way to get current file\n *\n * @currentFile\n */\nmodule.exports.getCurrentFile = () => {\n return DOM.getByClass(CURRENT_FILE);\n};\n\n/**\n * get current file by name\n */\nmodule.exports.getCurrentByName = (name, panel = DOM.CurrentInfo.panel) => {\n const dataName = 'js-file-' + btoa(encodeURI(encodeNBSP(name)));\n return DOM.getByDataName(dataName, panel);\n};\n\n/**\n * private function thet unset currentfile\n *\n * @currentFile\n */\nfunction unsetCurrentFile(currentFile) {\n const is = DOM.isCurrentFile(currentFile);\n if (!is) return;\n currentFile.classList.remove(CURRENT_FILE);\n}\n\n/**\n * unified way to set current file\n */\nmodule.exports.setCurrentFile = (currentFile, options) => {\n const o = options;\n const currentFileWas = DOM.getCurrentFile();\n if (!currentFile) return DOM;\n let pathWas = '';\n if (currentFileWas) {\n pathWas = DOM.getCurrentDirPath();\n unsetCurrentFile(currentFileWas);\n }\n currentFile.classList.add(CURRENT_FILE);\n const path = DOM.getCurrentDirPath();\n const name = CloudCmd.config('name');\n if (path !== pathWas) {\n DOM.setTitle(getTitle({\n name,\n path\n }));\n\n /* history could be present\n * but it should be false\n * to prevent default behavior\n */\n if (!o || o.history) {\n const historyPath = path === '/' ? path : FS + path;\n DOM.setHistory(historyPath, null, historyPath);\n }\n }\n\n /* scrolling to current file */\n const CENTER = true;\n DOM.scrollIntoViewIfNeeded(currentFile, CENTER);\n CloudCmd.emit('current-file', currentFile);\n CloudCmd.emit('current-path', path);\n CloudCmd.emit('current-name', DOM.getCurrentName(currentFile));\n return DOM;\n};\nthis.setCurrentByName = name => {\n const current = DOM.getCurrentByName(name);\n return DOM.setCurrentFile(current);\n};\n\n/*\n * set current file by position\n *\n * @param layer - element\n * @param - position {x, y}\n */\nmodule.exports.getCurrentByPosition = ({\n x,\n y\n}) => {\n const element = document.elementFromPoint(x, y);\n const getEl = el => {\n const {\n tagName\n } = el;\n const isChild = /A|SPAN|LI/.test(tagName);\n if (!isChild) return null;\n if (tagName === 'A') return el.parentElement.parentElement;\n if (tagName === 'SPAN') return el.parentElement;\n return el;\n };\n const el = getEl(element);\n if (el && el.tagName !== 'LI') return null;\n return el;\n};\n\n/**\n * current file check\n *\n * @param currentFile\n */\nmodule.exports.isCurrentFile = currentFile => {\n if (!currentFile) return false;\n return DOM.isContainClass(currentFile, CURRENT_FILE);\n};\n\n/**\n * set title or create title element\n *\n * @param name\n */\nmodule.exports.setTitle = name => {\n if (!Title) Title = DOM.getByTag('title')[0] || createElement('title', {\n innerHTML: name,\n parent: document.head\n });\n Title.textContent = name;\n return DOM;\n};\n\n/**\n * check is current file is a directory\n *\n * @param currentFile\n */\nmodule.exports.isCurrentIsDir = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const fileType = DOM.getCurrentType(current);\n const isZip =
|
|
51
|
+
eval("{\n\n/* global DOM */\n/* global CloudCmd */\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n atob,\n btoa\n} = __webpack_require__(/*! ../../common/base64 */ \"./common/base64.js\");\nconst {\n encode,\n decode\n} = __webpack_require__(/*! ../../common/entity */ \"./common/entity.js\");\nconst {\n getTitle,\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nlet Title;\nconst CURRENT_FILE = 'current-file';\nconst encodeNBSP = a => a === null || a === void 0 ? void 0 : a.replace('\\xa0', ' ');\nconst decodeNBSP = a => a === null || a === void 0 ? void 0 : a.replace(' ', '\\xa0');\nmodule.exports._CURRENT_FILE = CURRENT_FILE;\n/**\n * set name from current (or param) file\n *\n * @param name\n * @param current\n */\nmodule.exports.setCurrentName = (name, current) => {\n const Info = DOM.CurrentInfo;\n const {\n link\n } = Info;\n const {\n prefix\n } = CloudCmd;\n const dir = prefix + FS + Info.dirPath;\n const encoded = encode(name);\n link.title = encoded;\n link.href = dir + encoded;\n link.innerHTML = encoded;\n current.setAttribute('data-name', createNameAttribute(name));\n CloudCmd.emit('current-file', current);\n return link;\n};\n\n/**\n * get name from current (or param) file\n *\n * @param currentFile\n */\nmodule.exports.getCurrentName = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n if (!current) return '';\n return parseNameAttribute(current.getAttribute('data-name'));\n};\n\n/**\n * Generate a `data-name` attribute for the given filename\n * @param name The string name to encode\n */\nconst createNameAttribute = name => {\n const encoded = btoa(encodeURI(name));\n return `js-file-${encoded}`;\n};\n\n/**\n * Parse a `data-name` attribute string back into the original filename\n * @param attribute The string we wish to decode\n */\nconst parseNameAttribute = attribute => {\n attribute = attribute.replace('js-file-', '');\n return decodeNBSP(decodeURI(atob(attribute)));\n};\nmodule.exports._parseNameAttribute = parseNameAttribute;\nconst parseHrefAttribute = (prefix, attribute) => {\n attribute = attribute.replace(RegExp('^' + prefix + FS), '');\n return decode(decodeNBSP(attribute));\n};\nmodule.exports._parseHrefAttribute = parseHrefAttribute;\n/**\n * get current direcotory path\n */\nmodule.exports.getCurrentDirPath = (panel = DOM.getPanel()) => {\n const path = DOM.getByDataName('js-path', panel);\n return path.textContent;\n};\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nmodule.exports.getCurrentPath = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const [element] = DOM.getByTag('a', current);\n const {\n prefix\n } = CloudCmd;\n return parseHrefAttribute(prefix, element.getAttribute('href'));\n};\n\n/**\n * get current direcotory name\n */\nmodule.exports.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 direcotory path\n */\nmodule.exports.getParentDirPath = panel => {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n const index = path.lastIndexOf(dirName);\n if (path === '/') return path;\n return path.slice(0, index);\n};\n\n/**\n * get not current direcotory path\n */\nmodule.exports.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n};\n\n/**\n * unified way to get current file\n *\n * @currentFile\n */\nmodule.exports.getCurrentFile = () => {\n return DOM.getByClass(CURRENT_FILE);\n};\n\n/**\n * get current file by name\n */\nmodule.exports.getCurrentByName = (name, panel = DOM.CurrentInfo.panel) => {\n const dataName = 'js-file-' + btoa(encodeURI(encodeNBSP(name)));\n return DOM.getByDataName(dataName, panel);\n};\n\n/**\n * private function thet unset currentfile\n *\n * @currentFile\n */\nfunction unsetCurrentFile(currentFile) {\n const is = DOM.isCurrentFile(currentFile);\n if (!is) return;\n currentFile.classList.remove(CURRENT_FILE);\n}\n\n/**\n * unified way to set current file\n */\nmodule.exports.setCurrentFile = (currentFile, options) => {\n const o = options;\n const currentFileWas = DOM.getCurrentFile();\n if (!currentFile) return DOM;\n let pathWas = '';\n if (currentFileWas) {\n pathWas = DOM.getCurrentDirPath();\n unsetCurrentFile(currentFileWas);\n }\n currentFile.classList.add(CURRENT_FILE);\n const path = DOM.getCurrentDirPath();\n const name = CloudCmd.config('name');\n if (path !== pathWas) {\n DOM.setTitle(getTitle({\n name,\n path\n }));\n\n /* history could be present\n * but it should be false\n * to prevent default behavior\n */\n if (!o || o.history) {\n const historyPath = path === '/' ? path : FS + path;\n DOM.setHistory(historyPath, null, historyPath);\n }\n }\n\n /* scrolling to current file */\n const CENTER = true;\n DOM.scrollIntoViewIfNeeded(currentFile, CENTER);\n CloudCmd.emit('current-file', currentFile);\n CloudCmd.emit('current-path', path);\n CloudCmd.emit('current-name', DOM.getCurrentName(currentFile));\n return DOM;\n};\nthis.setCurrentByName = name => {\n const current = DOM.getCurrentByName(name);\n return DOM.setCurrentFile(current);\n};\n\n/*\n * set current file by position\n *\n * @param layer - element\n * @param - position {x, y}\n */\nmodule.exports.getCurrentByPosition = ({\n x,\n y\n}) => {\n const element = document.elementFromPoint(x, y);\n const getEl = el => {\n const {\n tagName\n } = el;\n const isChild = /A|SPAN|LI/.test(tagName);\n if (!isChild) return null;\n if (tagName === 'A') return el.parentElement.parentElement;\n if (tagName === 'SPAN') return el.parentElement;\n return el;\n };\n const el = getEl(element);\n if (el && el.tagName !== 'LI') return null;\n return el;\n};\n\n/**\n * current file check\n *\n * @param currentFile\n */\nmodule.exports.isCurrentFile = currentFile => {\n if (!currentFile) return false;\n return DOM.isContainClass(currentFile, CURRENT_FILE);\n};\n\n/**\n * set title or create title element\n *\n * @param name\n */\nmodule.exports.setTitle = name => {\n if (!Title) Title = DOM.getByTag('title')[0] || createElement('title', {\n innerHTML: name,\n parent: document.head\n });\n Title.textContent = name;\n return DOM;\n};\n\n/**\n * check is current file is a directory\n *\n * @param currentFile\n */\nmodule.exports.isCurrentIsDir = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const fileType = DOM.getCurrentType(current);\n const isZip = path.endsWith('.zip');\n const isDir = /^directory(-link)?/.test(fileType);\n return isDir || isZip;\n};\nmodule.exports.getCurrentType = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const el = DOM.getByDataName('js-type', current);\n const type = el.className.split(' ').pop();\n return type;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/current-file.js\n}");
|
|
52
52
|
|
|
53
|
-
/***/ }
|
|
53
|
+
/***/ },
|
|
54
54
|
|
|
55
|
-
/***/ "./client/dom/dialog.js"
|
|
55
|
+
/***/ "./client/dom/dialog.js"
|
|
56
56
|
/*!******************************!*\
|
|
57
57
|
!*** ./client/dom/dialog.js ***!
|
|
58
58
|
\******************************/
|
|
59
|
-
|
|
59
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
60
60
|
|
|
61
61
|
"use strict";
|
|
62
|
-
eval("{\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
62
|
+
eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n alert,\n prompt,\n confirm,\n progress\n} = __webpack_require__(/*! smalltalk */ \"./node_modules/smalltalk/lib/smalltalk.js\");\nconst title = 'Cloud Commander';\nmodule.exports.alert = (...a) => alert(title, ...a, {\n cancel: false\n});\nmodule.exports.prompt = (...a) => tryToCatch(prompt, title, ...a);\nmodule.exports.confirm = (...a) => tryToCatch(confirm, title, ...a);\nmodule.exports.progress = (...a) => progress(title, ...a);\nmodule.exports.alert.noFiles = () => {\n return alert(title, 'No files selected!', {\n cancel: false\n });\n};\n\n//# sourceURL=file://cloudcmd/client/dom/dialog.js\n}");
|
|
63
63
|
|
|
64
|
-
/***/ }
|
|
64
|
+
/***/ },
|
|
65
65
|
|
|
66
|
-
/***/ "./client/dom/directory.js"
|
|
66
|
+
/***/ "./client/dom/directory.js"
|
|
67
67
|
/*!*********************************!*\
|
|
68
68
|
!*** ./client/dom/directory.js ***!
|
|
69
69
|
\*********************************/
|
|
70
|
-
|
|
70
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
71
71
|
|
|
72
72
|
"use strict";
|
|
73
73
|
eval("{\n\n/* global CloudCmd */\nconst philip = __webpack_require__(/*! philip */ \"./node_modules/philip/lib/philip.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\nconst Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = DOM;\nmodule.exports = items => {\n if (items.length) Images.show('top');\n const entries = Array.from(items).map(item => item.webkitGetAsEntry());\n const dirPath = getPathWhenRootEmpty();\n const path = dirPath.replace(/\\/$/, '');\n const progress = Dialog.progress('Uploading...');\n progress.catch(() => {\n Dialog.alert('Upload aborted');\n uploader.abort();\n });\n const uploader = philip(entries, (type, name, data, i, n, callback) => {\n const {\n prefixURL\n } = CloudCmd;\n const full = prefixURL + FS + path + name;\n let upload;\n switch (type) {\n case 'file':\n upload = uploadFile(full, data);\n break;\n case 'directory':\n upload = uploadDir(full);\n break;\n }\n upload.on('end', callback);\n upload.on('progress', count => {\n const current = percent(i, n);\n const next = percent(i + 1, n);\n const max = next - current;\n const value = current + percent(count, 100, max);\n progress.setProgress(value);\n });\n });\n uploader.on('error', error => {\n Dialog.alert(error);\n uploader.abort();\n });\n uploader.on('end', CloudCmd.refresh);\n};\nconst percent = (i, n, per = 100) => Math.round(i * per / n);\nconst uploadFile = (url, data) => DOM.load.put(url, data);\nconst uploadDir = url => DOM.load.put(`${url}?dir`);\n\n//# sourceURL=file://cloudcmd/client/dom/directory.js\n}");
|
|
74
74
|
|
|
75
|
-
/***/ }
|
|
75
|
+
/***/ },
|
|
76
76
|
|
|
77
|
-
/***/ "./client/dom/dom-tree.js"
|
|
77
|
+
/***/ "./client/dom/dom-tree.js"
|
|
78
78
|
/*!********************************!*\
|
|
79
79
|
!*** ./client/dom/dom-tree.js ***!
|
|
80
80
|
\********************************/
|
|
81
|
-
|
|
81
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
82
82
|
|
|
83
83
|
"use strict";
|
|
84
84
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst DOM = module.exports;\n\n/**\n * check class of element\n *\n * @param element\n * @param className\n */\nconst isContainClass = (element, className) => {\n if (!element) throw Error('element could not be empty!');\n if (!className) throw Error('className could not be empty!');\n if (Array.isArray(className)) return className.some(currify(isContainClass, element));\n const {\n classList\n } = element;\n return classList.contains(className);\n};\nmodule.exports.isContainClass = isContainClass;\n/**\n * Function search element by tag\n * @param tag - className\n * @param element - element\n */\nmodule.exports.getByTag = (tag, element = document) => {\n return element.getElementsByTagName(tag);\n};\n\n/**\n * Function search element by id\n * @param Id - id\n */\nmodule.exports.getById = (id, element = document) => {\n return element.querySelector(`#${id}`);\n};\n\n/**\n * Function search first element by class name\n * @param className - className\n * @param element - element\n */\nmodule.exports.getByClass = (className, element = document) => DOM.getByClassAll(className, element)[0];\nmodule.exports.getByDataName = (attribute, element = document) => {\n const selector = '[' + 'data-name=\"' + attribute + '\"]';\n return element.querySelector(selector);\n};\n\n/**\n * Function search element by class name\n * @param pClass - className\n * @param element - element\n */\nmodule.exports.getByClassAll = (className, element) => {\n return (element || document).getElementsByClassName(className);\n};\n\n/**\n * add class=hidden to element\n *\n * @param element\n */\nmodule.exports.hide = element => {\n element.classList.add('hidden');\n return DOM;\n};\nmodule.exports.show = element => {\n element.classList.remove('hidden');\n return DOM;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/dom-tree.js\n}");
|
|
85
85
|
|
|
86
|
-
/***/ }
|
|
86
|
+
/***/ },
|
|
87
87
|
|
|
88
|
-
/***/ "./client/dom/events/event-store.js"
|
|
88
|
+
/***/ "./client/dom/events/event-store.js"
|
|
89
89
|
/*!******************************************!*\
|
|
90
90
|
!*** ./client/dom/events/event-store.js ***!
|
|
91
91
|
\******************************************/
|
|
92
|
-
|
|
92
|
+
(module) {
|
|
93
93
|
|
|
94
94
|
"use strict";
|
|
95
95
|
eval("{\n\nlet list = [];\nmodule.exports.add = (el, name, fn) => {\n list.push([el, name, fn]);\n};\nmodule.exports.clear = () => {\n list = [];\n};\nmodule.exports.get = () => list;\n\n//# sourceURL=file://cloudcmd/client/dom/events/event-store.js\n}");
|
|
96
96
|
|
|
97
|
-
/***/ }
|
|
97
|
+
/***/ },
|
|
98
98
|
|
|
99
|
-
/***/ "./client/dom/events/index.js"
|
|
99
|
+
/***/ "./client/dom/events/index.js"
|
|
100
100
|
/*!************************************!*\
|
|
101
101
|
!*** ./client/dom/events/index.js ***!
|
|
102
102
|
\************************************/
|
|
103
|
-
|
|
103
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
106
106
|
eval("{\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst EventStore = __webpack_require__(/*! ./event-store */ \"./client/dom/events/event-store.js\");\nmodule.exports = new EventsProto();\nfunction EventsProto() {\n const Events = this;\n const getEventOptions = eventName => {\n if (eventName !== 'touchstart') return false;\n return {\n passive: true\n };\n };\n function parseArgs(eventName, element, listener, callback) {\n let isFunc;\n const args = [eventName, element, listener, callback];\n const EVENT_NAME = 1;\n const ELEMENT = 0;\n const type = itype(eventName);\n switch (type) {\n default:\n if (!type.endsWith('element')) throw Error(`unknown eventName: ${type}`);\n parseArgs(args[EVENT_NAME], args[ELEMENT], listener, callback);\n break;\n case 'string':\n isFunc = itype.function(element);\n if (isFunc) {\n listener = element;\n element = null;\n }\n if (!element) element = window;\n callback(element, [eventName, listener, getEventOptions(eventName)]);\n break;\n case 'array':\n for (const name of eventName) {\n parseArgs(name, element, listener, callback);\n }\n break;\n case 'object':\n for (const name of Object.keys(eventName)) {\n const eventListener = eventName[name];\n parseArgs(name, element, eventListener, callback);\n }\n break;\n }\n }\n\n /**\n * safe add event listener\n *\n * @param type\n * @param element - document by default\n * @param listener\n */\n this.add = (type, element, listener) => {\n checkType(type);\n parseArgs(type, element, listener, (element, args) => {\n const [name, fn, options] = args;\n element.addEventListener(name, fn, options);\n EventStore.add(element, name, fn);\n });\n return Events;\n };\n\n /**\n * safe add event listener\n *\n * @param type\n * @param listener\n * @param element - document by default\n */\n this.addOnce = (type, element, listener) => {\n const once = event => {\n Events.remove(type, element, once);\n listener(event);\n };\n if (!listener) {\n listener = element;\n element = null;\n }\n this.add(type, element, once);\n return Events;\n };\n\n /**\n * safe remove event listener\n *\n * @param type\n * @param listener\n * @param element - document by default\n */\n this.remove = (type, element, listener) => {\n checkType(type);\n parseArgs(type, element, listener, (element, args) => {\n element.removeEventListener(...args);\n });\n return Events;\n };\n\n /**\n * remove all added event listeners\n */\n this.removeAll = () => {\n const events = EventStore.get();\n for (const [el, name, fn] of events) el.removeEventListener(name, fn);\n EventStore.clear();\n };\n\n /**\n * safe add event keydown listener\n *\n * @param args\n */\n this.addKey = function (...args) {\n return Events.add('keydown', ...args);\n };\n\n /**\n * safe remove event click listener\n *\n * @param args\n */\n this.rmKey = function (...args) {\n return Events.remove('keydown', ...args);\n };\n\n /**\n * safe add event click listener\n */\n this.addClick = function (...args) {\n return Events.add('click', ...args);\n };\n\n /**\n * safe remove event click listener\n */\n this.rmClick = function (...args) {\n return Events.remove('click', ...args);\n };\n this.addContextMenu = function (...args) {\n return Events.add('contextmenu', ...args);\n };\n\n /**\n * safe add load listener\n */\n this.addLoad = function (...args) {\n return Events.add('load', ...args);\n };\n function checkType(type) {\n if (!type) throw Error('type could not be empty!');\n }\n}\n\n//# sourceURL=file://cloudcmd/client/dom/events/index.js\n}");
|
|
107
107
|
|
|
108
|
-
/***/ }
|
|
108
|
+
/***/ },
|
|
109
109
|
|
|
110
|
-
/***/ "./client/dom/files.js"
|
|
110
|
+
/***/ "./client/dom/files.js"
|
|
111
111
|
/*!*****************************!*\
|
|
112
112
|
!*** ./client/dom/files.js ***!
|
|
113
113
|
\*****************************/
|
|
114
|
-
|
|
114
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
115
115
|
|
|
116
116
|
"use strict";
|
|
117
117
|
eval("{\n\n/* global CloudCmd */\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\nconst Promises = {};\nconst FILES_JSON = 'config|modules';\nconst FILES_HTML = 'file|path|link|pathLink|media';\nconst FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';\nconst DIR_HTML = '/tmpl/';\nconst DIR_HTML_FS = `${DIR_HTML}fs/`;\nconst DIR_JSON = '/json/';\nconst timeout = getTimeoutOnce(2000);\nmodule.exports.get = getFile;\nfunction getFile(name) {\n const type = itype(name);\n check(name);\n if (type === 'string') return getModule(name);\n if (type === 'array') return Promise.all(name.map(getFile));\n}\nfunction check(name) {\n if (!name) throw Error('name could not be empty!');\n}\nfunction getModule(name) {\n const regExpHTML = RegExp(FILES_HTML + '|' + FILES_HTML_ROOT);\n const regExpJSON = RegExp(FILES_JSON);\n const isHTML = regExpHTML.test(name);\n const isJSON = regExpJSON.test(name);\n if (!isHTML && !isJSON) return showError(name);\n if (name === 'config') return getConfig();\n const path = getPath(name, isHTML, isJSON);\n return getSystemFile(path);\n}\nfunction getPath(name, isHTML, isJSON) {\n let path;\n const regExp = RegExp(FILES_HTML_ROOT);\n const isRoot = regExp.test(name);\n if (isHTML) {\n if (isRoot) path = DIR_HTML + name.replace('-tmpl', '');else path = DIR_HTML_FS + name;\n path += '.hbs';\n } else if (isJSON) {\n path = DIR_JSON + name + '.json';\n }\n return path;\n}\nfunction showError(name) {\n const str = `Wrong file name: ${name}`;\n const error = Error(str);\n throw error;\n}\nconst getSystemFile = promisify((file, callback) => {\n const {\n prefix\n } = CloudCmd;\n if (!Promises[file]) Promises[file] = new Promise((success, error) => {\n const url = prefix + file;\n load.ajax({\n url,\n success,\n error\n });\n });\n Promises[file].then(data => {\n callback(null, data);\n }, error => {\n Promises[file] = null;\n callback(error);\n });\n});\nconst getConfig = async () => {\n let is;\n if (!Promises.config) Promises.config = () => {\n is = true;\n return RESTful.Config.read();\n };\n const [, data] = await Promises.config();\n if (data) is = false;\n timeout(() => {\n if (!is) Promises.config = null;\n });\n return data;\n};\nfunction getTimeoutOnce(time) {\n let is;\n return callback => {\n if (is) return;\n is = true;\n setTimeout(() => {\n is = false;\n callback();\n }, time);\n };\n}\n\n//# sourceURL=file://cloudcmd/client/dom/files.js\n}");
|
|
118
118
|
|
|
119
|
-
/***/ }
|
|
119
|
+
/***/ },
|
|
120
120
|
|
|
121
|
-
/***/ "./client/dom/images.js"
|
|
121
|
+
/***/ "./client/dom/images.js"
|
|
122
122
|
/*!******************************!*\
|
|
123
123
|
!*** ./client/dom/images.js ***!
|
|
124
124
|
\******************************/
|
|
125
|
-
|
|
125
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
126
126
|
|
|
127
127
|
"use strict";
|
|
128
128
|
eval("{/* global DOM */\n\n\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = module.exports;\nconst LOADING = 'loading';\nconst HIDDEN = 'hidden';\nconst ERROR = 'error';\nconst getLoadingType = () => isSVG() ? '-svg' : '-gif';\nmodule.exports.get = getElement;\n/**\n * check SVG SMIL animation support\n */\nfunction isSVG() {\n const createNS = document.createElementNS;\n const SVG_URL = 'http://www.w3.org/2000/svg';\n if (!createNS) return false;\n const create = createNS.bind(document);\n const svgNode = create(SVG_URL, 'animate');\n const name = svgNode.toString();\n return /SVGAnimate/.test(name);\n}\nfunction getElement() {\n return createElement('span', {\n id: 'js-status-image',\n className: 'icon',\n dataName: 'progress',\n notAppend: true\n });\n}\n\n/* Функция создаёт картинку загрузки */\nmodule.exports.loading = () => {\n const element = getElement();\n const {\n classList\n } = element;\n const loadingImage = LOADING + getLoadingType();\n classList.add(LOADING, loadingImage);\n classList.remove(ERROR, HIDDEN);\n return element;\n};\n\n/* Функция создаёт картинку ошибки загрузки */\nmodule.exports.error = () => {\n const element = getElement();\n const {\n classList\n } = element;\n const loadingImage = LOADING + getLoadingType();\n classList.add(ERROR);\n classList.remove(HIDDEN, LOADING, loadingImage);\n return element;\n};\nmodule.exports.show = show;\nmodule.exports.show.load = show;\nmodule.exports.show.error = error;\n/**\n* Function shows loading spinner\n* position = {top: true};\n*/\nfunction show(position, panel) {\n const image = Images.loading();\n const parent = image.parentElement;\n const refreshButton = DOM.getRefreshButton(panel);\n let current;\n if (position === 'top') {\n current = refreshButton.parentElement;\n } else {\n current = DOM.getCurrentFile();\n if (current) current = DOM.getByDataName('js-name', current);else current = refreshButton.parentElement;\n }\n if (!parent || parent && parent !== current) current.appendChild(image);\n DOM.show(image);\n return image;\n}\nfunction error(text) {\n const image = Images.error();\n DOM.show(image);\n image.title = text;\n return image;\n}\n\n/**\n* hide load image\n*/\nmodule.exports.hide = () => {\n const element = Images.get();\n DOM.hide(element);\n return Images;\n};\nmodule.exports.setProgress = (value, title) => {\n const DATA = 'data-progress';\n const element = Images.get();\n if (!element) return Images;\n element.setAttribute(DATA, `${value}%`);\n if (title) element.title = title;\n return Images;\n};\nmodule.exports.clearProgress = () => {\n const DATA = 'data-progress';\n const element = Images.get();\n if (!element) return Images;\n element.setAttribute(DATA, '');\n element.title = '';\n return Images;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/images.js\n}");
|
|
129
129
|
|
|
130
|
-
/***/ }
|
|
130
|
+
/***/ },
|
|
131
131
|
|
|
132
|
-
/***/ "./client/dom/index.js"
|
|
132
|
+
/***/ "./client/dom/index.js"
|
|
133
133
|
/*!*****************************!*\
|
|
134
134
|
!*** ./client/dom/index.js ***!
|
|
135
135
|
\*****************************/
|
|
136
|
-
|
|
136
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
137
137
|
|
|
138
138
|
"use strict";
|
|
139
139
|
eval("{\n\n/* global CloudCmd */\nconst Util = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\nconst renameCurrent = __webpack_require__(/*! ./operations/rename-current */ \"./client/dom/operations/rename-current.js\");\nconst CurrentFile = __webpack_require__(/*! ./current-file */ \"./client/dom/current-file.js\");\nconst DOMTree = __webpack_require__(/*! ./dom-tree */ \"./client/dom/dom-tree.js\");\nconst Cmd = module.exports;\nconst DOM = {\n ...DOMTree,\n ...CurrentFile,\n ...Cmd\n};\nconst CurrentInfo = {};\nDOM.Images = Images;\nDOM.load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nDOM.Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\nDOM.RESTful = RESTful;\nDOM.IO = __webpack_require__(/*! ./io */ \"./client/dom/io/index.js\");\nDOM.Storage = Storage;\nDOM.Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nDOM.CurrentInfo = CurrentInfo;\nmodule.exports = DOM;\nDOM.uploadDirectory = __webpack_require__(/*! ./directory */ \"./client/dom/directory.js\");\nDOM.Buffer = __webpack_require__(/*! ./buffer */ \"./client/dom/buffer.js\");\nDOM.Events = __webpack_require__(/*! ./events */ \"./client/dom/events/index.js\");\nconst loadRemote = __webpack_require__(/*! ./load-remote */ \"./client/dom/load-remote.js\");\nconst selectByPattern = __webpack_require__(/*! ./select-by-pattern */ \"./client/dom/select-by-pattern.js\");\nconst isString = a => typeof a === 'string';\nconst SELECTED_FILE = 'selected-file';\nconst TabPanel = {\n 'js-left': null,\n 'js-right': null\n};\nmodule.exports.loadRemote = (name, options, callback) => {\n loadRemote(name, options, callback);\n return DOM;\n};\nmodule.exports.loadSocket = callback => {\n DOM.loadRemote('socket', {\n name: 'io'\n }, callback);\n return DOM;\n};\n\n/**\n * create new folder\n *\n */\nmodule.exports.promptNewDir = async function () {\n await promptNew('directory');\n};\n\n/**\n * create new file\n *\n * @typeName\n * @type\n */\nmodule.exports.promptNewFile = async () => {\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 RESTful.createDirectory(path);else await RESTful.write(path);\n await CloudCmd.refresh({\n currentName\n });\n}\n\n/**\n * get current direcotory name\n */\nmodule.exports.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 direcotory path\n */\nmodule.exports.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 direcotory path\n */\nmodule.exports.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({\n active: false\n });\n return DOM.getCurrentDirPath(panel);\n};\n\n/**\n * unified way to get selected files\n *\n * @currentFile\n */\nmodule.exports.getSelectedFiles = () => {\n const panel = DOM.getPanel();\n const selected = DOM.getByClassAll(SELECTED_FILE, panel);\n return Array.from(selected);\n};\n\n/*\n * unselect all files\n */\nmodule.exports.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 */\nmodule.exports.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};\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.loadCurrentSize = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n Images.show.load();\n if (name === '..') return;\n const [, size] = await RESTful.read(link + query);\n DOM.setCurrentSize(size, current);\n Images.hide();\n return current;\n};\n\n/**\n * load hash\n * @callback\n * @currentFile\n */\nmodule.exports.loadCurrentHash = async currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n const [, data] = await RESTful.read(link + query);\n return data;\n};\n\n/**\n * set size\n * @currentFile\n */\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.getCurrentData = async 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 RESTful.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 Storage.get(`${path}-data`)];\n const [e, data] = await RESTful.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 */\nmodule.exports.getRefreshButton = (panel = DOM.getPanel()) => {\n return DOM.getByDataName('js-refresh', panel);\n};\n\n/**\n * select current file\n * @param currentFile\n */\nmodule.exports.selectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.add(SELECTED_FILE);\n return Cmd;\n};\nmodule.exports.unselectFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n current.classList.remove(SELECTED_FILE);\n return Cmd;\n};\nmodule.exports.toggleSelectedFile = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const name = DOM.getCurrentName(current);\n if (name === '..') return Cmd;\n current.classList.toggle(SELECTED_FILE);\n return Cmd;\n};\nmodule.exports.toggleAllSelectedFiles = () => {\n DOM.getAllFiles().map(DOM.toggleSelectedFile);\n return Cmd;\n};\nmodule.exports.selectAllFiles = () => {\n DOM.getAllFiles().map(DOM.selectFile);\n return Cmd;\n};\nmodule.exports.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 */\nmodule.exports.expandSelection = () => {\n const msg = 'expand';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n\n/**\n * open dialog with shrink selection\n */\nmodule.exports.shrinkSelection = () => {\n const msg = 'shrink';\n const {\n files\n } = CurrentInfo;\n selectByPattern(msg, files);\n};\n\n/**\n * setting history wrapper\n */\nmodule.exports.setHistory = (data, title, url) => {\n const ret = window.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 * selected file check\n *\n * @param currentFile\n */\nmodule.exports.isSelected = selected => {\n if (!selected) return false;\n return DOM.isContainClass(selected, SELECTED_FILE);\n};\n\n/**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\nmodule.exports.getCurrentLink = currentFile => {\n const current = currentFile || DOM.getCurrentFile();\n const link = DOM.getByTag('a', current);\n return link[0];\n};\nmodule.exports.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 */\nmodule.exports.checkStorageHash = async 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(), Storage.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 * @param callback\n */\nmodule.exports.saveDataToStorage = async (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 Storage.set(nameHash, hash);\n await Storage.set(nameData, data);\n return hash;\n};\nmodule.exports.getFM = () => DOM.getPanel().parentElement;\nmodule.exports.getPanelPosition = panel => {\n panel = panel || DOM.getPanel();\n return panel.dataset.name.replace('js-', '');\n};\nmodule.exports.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 */\nmodule.exports.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 (window.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};\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.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 pChild\n * @param element\n */\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.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 */\nmodule.exports.renameCurrent = renameCurrent;\n/**\n * unified way to scrollIntoViewIfNeeded\n * (native suporte by webkit only)\n * @param element\n * @param center - to scroll as small as possible param should be false\n */\nmodule.exports.scrollIntoViewIfNeeded = (element, center = false) => {\n if (!element || !element.scrollIntoViewIfNeeded) return;\n element.scrollIntoViewIfNeeded(center);\n};\n\n/* scroll on one page */\nmodule.exports.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};\nmodule.exports.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};\nmodule.exports.getPackerExt = type => {\n if (type === 'zip') return '.zip';\n return '.tar.gz';\n};\nmodule.exports.goToDirectory = async () => {\n const msg = 'Go to directory:';\n const {\n Dialog\n } = DOM;\n const {\n dirPath\n } = CurrentInfo;\n const [cancel, path = dirPath] = await Dialog.prompt(msg, dirPath);\n if (cancel) return;\n await CloudCmd.changeDir(path);\n};\nmodule.exports.duplicatePanel = async () => {\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};\nmodule.exports.swapPanels = async () => {\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};\nmodule.exports.CurrentInfo = CurrentInfo;\nmodule.exports.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 = Util.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/client/dom/index.js\n}");
|
|
140
140
|
|
|
141
|
-
/***/ }
|
|
141
|
+
/***/ },
|
|
142
142
|
|
|
143
|
-
/***/ "./client/dom/io/index.js"
|
|
143
|
+
/***/ "./client/dom/io/index.js"
|
|
144
144
|
/*!********************************!*\
|
|
145
145
|
!*** ./client/dom/io/index.js ***!
|
|
146
146
|
\********************************/
|
|
147
|
-
|
|
147
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
148
148
|
|
|
149
149
|
"use strict";
|
|
150
150
|
eval("{\n\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst sendRequest = __webpack_require__(/*! ./send-request */ \"./client/dom/io/send-request.js\");\nconst imgPosition = {\n top: true\n};\nmodule.exports[\"delete\"] = async (url, data) => {\n return await sendRequest({\n method: 'DELETE',\n url: FS + url,\n data,\n imgPosition: {\n top: Boolean(data)\n }\n });\n};\nmodule.exports.patch = async (url, data) => {\n return await sendRequest({\n method: 'PATCH',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.write = async (url, data) => {\n return await sendRequest({\n method: 'PUT',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.createDirectory = async url => {\n return await sendRequest({\n method: 'PUT',\n url: `${FS}${url}?dir`,\n imgPosition\n });\n};\nmodule.exports.read = async (url, dataType = 'text') => {\n const notLog = !url.includes('?');\n return await sendRequest({\n method: 'GET',\n url: FS + url,\n notLog,\n dataType\n });\n};\nmodule.exports.copy = async (from, to, names) => {\n return await sendRequest({\n method: 'PUT',\n url: '/copy',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.pack = async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/pack',\n data\n });\n};\nmodule.exports.extract = async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/extract',\n data\n });\n};\nmodule.exports.move = async (from, to, names) => {\n return await sendRequest({\n method: 'PUT',\n url: '/move',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.rename = async (from, to) => {\n return await sendRequest({\n method: 'PUT',\n url: '/rename',\n data: {\n from,\n to\n },\n imgPosition\n });\n};\nmodule.exports.Config = {\n read: async () => {\n return await sendRequest({\n method: 'GET',\n url: '/config',\n imgPosition,\n notLog: true\n });\n },\n write: async data => {\n return await sendRequest({\n method: 'PATCH',\n url: '/config',\n data,\n imgPosition\n });\n }\n};\nmodule.exports.Markdown = {\n read: async url => {\n return await sendRequest({\n method: 'GET',\n url: `/markdown${url}`,\n imgPosition,\n notLog: true\n });\n },\n render: async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/markdown',\n data,\n imgPosition,\n notLog: true\n });\n }\n};\n\n//# sourceURL=file://cloudcmd/client/dom/io/index.js\n}");
|
|
151
151
|
|
|
152
|
-
/***/ }
|
|
152
|
+
/***/ },
|
|
153
153
|
|
|
154
|
-
/***/ "./client/dom/io/send-request.js"
|
|
154
|
+
/***/ "./client/dom/io/send-request.js"
|
|
155
155
|
/*!***************************************!*\
|
|
156
156
|
!*** ./client/dom/io/send-request.js ***!
|
|
157
157
|
\***************************************/
|
|
158
|
-
|
|
158
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
159
159
|
|
|
160
160
|
"use strict";
|
|
161
161
|
eval("{\n\n/* global CloudCmd */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst Images = __webpack_require__(/*! ../images */ \"./client/dom/images.js\");\nconst load = __webpack_require__(/*! ../load */ \"./client/dom/load.js\");\nmodule.exports = promisify((params, callback) => {\n const p = params;\n const {\n prefixURL\n } = CloudCmd;\n p.url = prefixURL + p.url;\n p.url = encodeURI(p.url);\n p.url = replaceHash(p.url);\n load.ajax({\n method: p.method,\n url: p.url,\n data: p.data,\n dataType: p.dataType,\n error: jqXHR => {\n const response = jqXHR.responseText;\n const {\n statusText,\n status\n } = jqXHR;\n const text = status === 404 ? response : statusText;\n callback(Error(text));\n },\n success: data => {\n Images.hide();\n if (!p.notLog) CloudCmd.log(data);\n callback(null, data);\n }\n });\n});\nmodule.exports._replaceHash = replaceHash;\nfunction replaceHash(url) {\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n */\n return url.replace(/#/g, '%23');\n}\n\n//# sourceURL=file://cloudcmd/client/dom/io/send-request.js\n}");
|
|
162
162
|
|
|
163
|
-
/***/ }
|
|
163
|
+
/***/ },
|
|
164
164
|
|
|
165
|
-
/***/ "./client/dom/load-remote.js"
|
|
165
|
+
/***/ "./client/dom/load-remote.js"
|
|
166
166
|
/*!***********************************!*\
|
|
167
167
|
!*** ./client/dom/load-remote.js ***!
|
|
168
168
|
\***********************************/
|
|
169
|
-
|
|
169
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
170
170
|
|
|
171
171
|
"use strict";
|
|
172
|
-
eval("{\n\n/* global CloudCmd */\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
172
|
+
eval("{\n\n/* global CloudCmd */\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n findObjByNameInArr\n} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\nconst Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\nmodule.exports = (name, options, callback = options) => {\n const {\n prefix,\n config\n } = CloudCmd;\n const o = options;\n if (o.name && window[o.name]) return callback();\n Files.get('modules').then(async modules => {\n const online = config('online') && navigator.onLine;\n const module = findObjByNameInArr(modules.remote, name);\n const isArray = itype.array(module.local);\n const {\n version\n } = module;\n let remoteTmpls;\n let local;\n if (isArray) {\n remoteTmpls = module.remote;\n ({\n local\n } = module);\n } else {\n remoteTmpls = [module.remote];\n local = [module.local];\n }\n const localURL = local.map(url => prefix + url);\n const remoteURL = remoteTmpls.map(tmpl => {\n return rendy(tmpl, {\n version\n });\n });\n if (online) {\n const [e] = await tryToCatch(load.parallel, remoteURL);\n if (!e) return callback();\n }\n const [e] = await tryToCatch(load.parallel, localURL);\n callback(e);\n });\n};\n\n//# sourceURL=file://cloudcmd/client/dom/load-remote.js\n}");
|
|
173
173
|
|
|
174
|
-
/***/ }
|
|
174
|
+
/***/ },
|
|
175
175
|
|
|
176
|
-
/***/ "./client/dom/load.js"
|
|
176
|
+
/***/ "./client/dom/load.js"
|
|
177
177
|
/*!****************************!*\
|
|
178
178
|
!*** ./client/dom/load.js ***!
|
|
179
179
|
\****************************/
|
|
180
|
-
|
|
180
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
181
181
|
|
|
182
182
|
"use strict";
|
|
183
183
|
eval("{\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst jonny = __webpack_require__(/*! jonny */ \"./node_modules/jonny/lib/jonny.js\");\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nmodule.exports.getIdBySrc = getIdBySrc;\n/**\n * Function gets id by src\n * @param src\n *\n * Example: http://domain.com/1.js -> 1_js\n */\nfunction getIdBySrc(src) {\n const isStr = itype.string(src);\n if (!isStr) return;\n if (src.includes(':')) src += '-join';\n const num = src.lastIndexOf('/') + 1;\n const sub = src.substr(src, num);\n const id = src.replace(sub, '').replace(/\\./g, '-');\n return id;\n}\n\n/**\n * load file countent via ajax\n *\n * @param params\n */\nmodule.exports.ajax = params => {\n const p = params;\n const isObject = itype.object(p.data);\n const isArray = itype.array(p.data);\n const isArrayBuf = itype(p.data) === 'arraybuffer';\n const type = p.type || p.method || 'GET';\n const {\n headers = {}\n } = p;\n const xhr = new XMLHttpRequest();\n xhr.open(type, p.url, true);\n for (const name of Object.keys(headers)) {\n const value = headers[name];\n xhr.setRequestHeader(name, value);\n }\n if (p.responseType) xhr.responseType = p.responseType;\n let data;\n if (!isArrayBuf && isObject || isArray) data = jonny.stringify(p.data);else ({\n data\n } = p);\n xhr.onreadystatechange = event => {\n const xhr = event.target;\n const OK = 200;\n if (xhr.readyState !== xhr.DONE) return;\n Images.clearProgress();\n const TYPE_JSON = 'application/json';\n const type = xhr.getResponseHeader('content-type');\n if (xhr.status !== OK) return exec(p.error, xhr);\n const notText = p.dataType !== 'text';\n const isContain = type.includes(TYPE_JSON);\n let data = xhr.response;\n if (type && isContain && notText) data = jonny.parse(xhr.response) || xhr.response;\n exec(p.success, data, xhr.statusText, xhr);\n };\n xhr.send(data);\n};\nmodule.exports.put = (url, body) => {\n const emitter = Emitify();\n const xhr = new XMLHttpRequest();\n url = encodeURI(url).replace(/#/g, '%23');\n xhr.open('put', url, true);\n xhr.upload.onprogress = event => {\n if (!event.lengthComputable) return;\n const percent = event.loaded / event.total * 100;\n const count = Math.round(percent);\n emitter.emit('progress', count);\n };\n xhr.onreadystatechange = () => {\n const over = xhr.readyState === xhr.DONE;\n const OK = 200;\n if (!over) return;\n if (xhr.status === OK) {\n emitter.emit('progress', 100);\n return emitter.emit('end');\n }\n const error = Error(xhr.responseText);\n emitter.emit('error', error);\n };\n xhr.send(body);\n return emitter;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/load.js\n}");
|
|
184
184
|
|
|
185
|
-
/***/ }
|
|
185
|
+
/***/ },
|
|
186
186
|
|
|
187
|
-
/***/ "./client/dom/operations/rename-current.js"
|
|
187
|
+
/***/ "./client/dom/operations/rename-current.js"
|
|
188
188
|
/*!*************************************************!*\
|
|
189
189
|
!*** ./client/dom/operations/rename-current.js ***!
|
|
190
190
|
\*************************************************/
|
|
191
|
-
|
|
191
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
192
192
|
|
|
193
193
|
"use strict";
|
|
194
194
|
eval("{\n\n/* global CloudCmd */\nconst capitalize = __webpack_require__(/*! just-capitalize */ \"./node_modules/just-capitalize/index.cjs\");\nconst Dialog = __webpack_require__(/*! ../dialog */ \"./client/dom/dialog.js\");\nconst Storage = __webpack_require__(/*! ../storage */ \"./client/dom/storage.js\");\nconst RESTful = __webpack_require__(/*! ../rest */ \"./client/dom/rest.js\");\nconst {\n isCurrentFile,\n getCurrentName,\n getCurrentFile,\n getCurrentByName,\n getCurrentType,\n getCurrentDirPath,\n setCurrentName\n} = __webpack_require__(/*! ../current-file */ \"./client/dom/current-file.js\");\nmodule.exports = async current => {\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 CloudCmd.refresh();\n};\n\n//# sourceURL=file://cloudcmd/client/dom/operations/rename-current.js\n}");
|
|
195
195
|
|
|
196
|
-
/***/ }
|
|
196
|
+
/***/ },
|
|
197
197
|
|
|
198
|
-
/***/ "./client/dom/rest.js"
|
|
198
|
+
/***/ "./client/dom/rest.js"
|
|
199
199
|
/*!****************************!*\
|
|
200
200
|
!*** ./client/dom/rest.js ***!
|
|
201
201
|
\****************************/
|
|
202
|
-
|
|
202
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
203
203
|
|
|
204
204
|
"use strict";
|
|
205
|
-
eval("{\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
205
|
+
eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n encode\n} = __webpack_require__(/*! ../../common/entity */ \"./common/entity.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst IO = __webpack_require__(/*! ./io */ \"./client/dom/io/index.js\");\nconst Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nconst handleError = promise => async (...args) => {\n const [e, data] = await tryToCatch(promise, ...args);\n if (!e) return [e, data];\n const encoded = encode(e.message);\n Images.show.error(encoded);\n Dialog.alert(encoded);\n return [e, data];\n};\nmodule.exports[\"delete\"] = handleError(IO.delete);\nmodule.exports.patch = handleError(IO.patch);\nmodule.exports.write = handleError(IO.write);\nmodule.exports.createDirectory = handleError(IO.createDirectory);\nmodule.exports.read = handleError(IO.read);\nmodule.exports.copy = handleError(IO.copy);\nmodule.exports.pack = handleError(IO.pack);\nmodule.exports.extract = handleError(IO.extract);\nmodule.exports.move = handleError(IO.move);\nmodule.exports.rename = handleError(IO.rename);\nmodule.exports.Config = {\n read: handleError(IO.Config.read),\n write: handleError(IO.Config.write)\n};\nmodule.exports.Markdown = {\n read: handleError(IO.Markdown.read),\n render: handleError(IO.Markdown.render)\n};\n\n//# sourceURL=file://cloudcmd/client/dom/rest.js\n}");
|
|
206
206
|
|
|
207
|
-
/***/ }
|
|
207
|
+
/***/ },
|
|
208
208
|
|
|
209
|
-
/***/ "./client/dom/select-by-pattern.js"
|
|
209
|
+
/***/ "./client/dom/select-by-pattern.js"
|
|
210
210
|
/*!*****************************************!*\
|
|
211
211
|
!*** ./client/dom/select-by-pattern.js ***!
|
|
212
212
|
\*****************************************/
|
|
213
|
-
|
|
213
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
214
214
|
|
|
215
215
|
"use strict";
|
|
216
216
|
eval("{\n\nlet SelectType = '*.*';\nconst {\n getRegExp\n} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\nconst {\n alert,\n prompt\n} = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\nmodule.exports = async (msg, files) => {\n if (!files) return;\n const allMsg = `Specify file type for ${msg} selection`;\n const [cancel, type] = await prompt(allMsg, SelectType);\n if (cancel) return;\n SelectType = type;\n const regExp = getRegExp(type);\n let matches = 0;\n for (const current of files) {\n const name = DOM.getCurrentName(current);\n if (name === '..' || !regExp.test(name)) continue;\n ++matches;\n let isSelected = DOM.isSelected(current);\n const shouldSel = msg === 'expand';\n if (shouldSel) isSelected = !isSelected;\n if (isSelected) DOM.toggleSelectedFile(current);\n }\n if (!matches) alert('No matches found!');\n};\n\n//# sourceURL=file://cloudcmd/client/dom/select-by-pattern.js\n}");
|
|
217
217
|
|
|
218
|
-
/***/ }
|
|
218
|
+
/***/ },
|
|
219
219
|
|
|
220
|
-
/***/ "./client/dom/storage.js"
|
|
220
|
+
/***/ "./client/dom/storage.js"
|
|
221
221
|
/*!*******************************!*\
|
|
222
222
|
!*** ./client/dom/storage.js ***!
|
|
223
223
|
\*******************************/
|
|
224
|
-
|
|
224
|
+
(module) {
|
|
225
225
|
|
|
226
226
|
"use strict";
|
|
227
227
|
eval("{\n\nconst {\n parse,\n stringify\n} = JSON;\nmodule.exports.set = async (name, data) => {\n localStorage.setItem(name, data);\n};\nmodule.exports.setJson = async (name, data) => {\n localStorage.setItem(name, stringify(data));\n};\nmodule.exports.get = async name => {\n return localStorage.getItem(name);\n};\nmodule.exports.getJson = async name => {\n const data = localStorage.getItem(name);\n return parse(data);\n};\nmodule.exports.clear = () => {\n localStorage.clear();\n};\nmodule.exports.remove = item => {\n localStorage.removeItem(item);\n};\n\n//# sourceURL=file://cloudcmd/client/dom/storage.js\n}");
|
|
228
228
|
|
|
229
|
-
/***/ }
|
|
229
|
+
/***/ },
|
|
230
230
|
|
|
231
|
-
/***/ "./client/dom/upload-files.js"
|
|
231
|
+
/***/ "./client/dom/upload-files.js"
|
|
232
232
|
/*!************************************!*\
|
|
233
233
|
!*** ./client/dom/upload-files.js ***!
|
|
234
234
|
\************************************/
|
|
235
|
-
|
|
235
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
236
236
|
|
|
237
237
|
"use strict";
|
|
238
238
|
eval("{\n\n/* global CloudCmd */\nconst {\n eachSeries\n} = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst {\n alert\n} = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = __webpack_require__(/*! . */ \"./client/dom/index.js\");\nconst loadFile = wraptile(_loadFile);\nconst onEnd = wraptile(_onEnd);\nmodule.exports = (dir, files) => {\n if (!files) {\n files = dir;\n dir = getPathWhenRootEmpty();\n }\n const n = files.length;\n if (!n) return;\n const array = Array.from(files);\n const {\n name\n } = files[0];\n eachSeries(array, loadFile(dir, n), onEnd(name));\n};\nfunction _onEnd(currentName) {\n CloudCmd.refresh({\n currentName\n });\n}\nfunction _loadFile(dir, n, file, callback) {\n let i = 0;\n const {\n name\n } = file;\n const path = dir + name;\n const {\n prefixURL\n } = CloudCmd;\n const api = prefixURL + FS;\n const percent = (i, n, per = 100) => {\n return Math.round(i * per / n);\n };\n const step = n => 100 / n;\n ++i;\n load.put(api + path, file).on('error', showError).on('end', callback).on('progress', count => {\n const max = step(n);\n const value = (i - 1) * max + percent(count, 100, max);\n Images.show.load('top');\n Images.setProgress(Math.round(value));\n });\n}\nfunction showError({\n message\n}) {\n alert(message);\n}\n\n//# sourceURL=file://cloudcmd/client/dom/upload-files.js\n}");
|
|
239
239
|
|
|
240
|
-
/***/ }
|
|
240
|
+
/***/ },
|
|
241
241
|
|
|
242
|
-
/***/ "./client/get-json-from-file-table.js"
|
|
242
|
+
/***/ "./client/get-json-from-file-table.js"
|
|
243
243
|
/*!********************************************!*\
|
|
244
244
|
!*** ./client/get-json-from-file-table.js ***!
|
|
245
245
|
\********************************************/
|
|
246
|
-
|
|
246
|
+
(module) {
|
|
247
247
|
|
|
248
248
|
"use strict";
|
|
249
249
|
eval("{\n\n/* global DOM */\nconst Info = DOM.CurrentInfo;\n\n/**\n * Функция генерирует JSON из html-таблицы файлов и\n * используеться при первом заходе в корень\n */\nmodule.exports = () => {\n const path = DOM.getCurrentDirPath();\n const infoFiles = Info.files || [];\n const notParent = current => {\n const name = DOM.getCurrentName(current);\n return name !== '..';\n };\n const parse = current => {\n const name = DOM.getCurrentName(current);\n const size = DOM.getCurrentSize(current);\n const owner = DOM.getCurrentOwner(current);\n const mode = DOM.getCurrentMode(current);\n const date = DOM.getCurrentDate(current);\n const type = DOM.getCurrentType(current);\n return {\n name,\n size,\n mode,\n owner,\n date,\n type\n };\n };\n const files = infoFiles.filter(notParent).map(parse);\n const fileTable = {\n path,\n files\n };\n return fileTable;\n};\n\n//# sourceURL=file://cloudcmd/client/get-json-from-file-table.js\n}");
|
|
250
250
|
|
|
251
|
-
/***/ }
|
|
251
|
+
/***/ },
|
|
252
252
|
|
|
253
|
-
/***/ "./client/key/binder.js"
|
|
253
|
+
/***/ "./client/key/binder.js"
|
|
254
254
|
/*!******************************!*\
|
|
255
255
|
!*** ./client/key/binder.js ***!
|
|
256
256
|
\******************************/
|
|
257
|
-
|
|
257
|
+
(module) {
|
|
258
258
|
|
|
259
259
|
"use strict";
|
|
260
260
|
eval("{\n\nmodule.exports.createBinder = () => {\n let binded = false;\n return {\n isBind() {\n return binded;\n },\n setBind() {\n binded = true;\n },\n unsetBind() {\n binded = false;\n }\n };\n};\n\n//# sourceURL=file://cloudcmd/client/key/binder.js\n}");
|
|
261
261
|
|
|
262
|
-
/***/ }
|
|
262
|
+
/***/ },
|
|
263
263
|
|
|
264
|
-
/***/ "./client/key/index.js"
|
|
264
|
+
/***/ "./client/key/index.js"
|
|
265
265
|
/*!*****************************!*\
|
|
266
266
|
!*** ./client/key/index.js ***!
|
|
267
267
|
\*****************************/
|
|
268
|
-
|
|
268
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
269
269
|
|
|
270
270
|
"use strict";
|
|
271
271
|
eval("{\n\n/* global CloudCmd, DOM */\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\nconst Info = DOM.CurrentInfo;\nconst Chars = fullstore();\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n if (keyCode === KEY.ESC) _config('vim', !config('vim'));\n};\nconst isUndefined = a => typeof a === 'undefined';\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\nmodule.exports._listener = listener;\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\nasync function listener(event) {\n const {\n keyCode\n } = event;\n\n // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n return '';\n}\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n return String.fromCharCode(hex);\n}\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n changeDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await changeDir(path);else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n case KEY.ENTER:\n if (Info.isDir) await changeDir(path);else CloudCmd.View.show();\n break;\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n case KEY.BACKSLASH:\n if (ctrlMeta) await changeDir('/');\n break;\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n break;\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n break;\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n break;\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n break;\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n case KEY.COLON:\n CloudCmd.CommandLine.show();\n event.preventDefault();\n break;\n\n /* чистим хранилище */\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n break;\n case KEY.DOT:\n if (meta && shift) {\n const showDotFiles = !CloudCmd.config('showDotFiles');\n CloudCmd._config('showDotFiles', showDotFiles);\n CloudCmd.refresh();\n await DOM.RESTful.Config.write({\n showDotFiles\n });\n }\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js\n}");
|
|
272
272
|
|
|
273
|
-
/***/ }
|
|
273
|
+
/***/ },
|
|
274
274
|
|
|
275
|
-
/***/ "./client/key/key.js"
|
|
275
|
+
/***/ "./client/key/key.js"
|
|
276
276
|
/*!***************************!*\
|
|
277
277
|
!*** ./client/key/key.js ***!
|
|
278
278
|
\***************************/
|
|
279
|
-
|
|
279
|
+
(module) {
|
|
280
280
|
|
|
281
281
|
"use strict";
|
|
282
282
|
eval("{\n\nmodule.exports = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n CAPSLOCK: 20,\n ESC: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n INSERT: 45,\n DELETE: 46,\n ZERO: 48,\n SEMICOLON: 52,\n A: 65,\n C: 67,\n D: 68,\n G: 71,\n J: 74,\n K: 75,\n M: 77,\n O: 79,\n P: 80,\n Q: 81,\n R: 82,\n S: 83,\n T: 84,\n U: 85,\n V: 86,\n X: 88,\n Z: 90,\n INSERT_MAC: 96,\n ASTERISK: 106,\n PLUS: 107,\n MINUS: 109,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n COLON: 186,\n EQUAL: 187,\n HYPHEN: 189,\n DOT: 190,\n SLASH: 191,\n /* Typewritten Reverse Apostrophe (`) */\n TRA: 192,\n BACKSLASH: 220,\n BRACKET_CLOSE: 221\n};\n\n//# sourceURL=file://cloudcmd/client/key/key.js\n}");
|
|
283
283
|
|
|
284
|
-
/***/ }
|
|
284
|
+
/***/ },
|
|
285
285
|
|
|
286
|
-
/***/ "./client/key/set-current-by-char.js"
|
|
286
|
+
/***/ "./client/key/set-current-by-char.js"
|
|
287
287
|
/*!*******************************************!*\
|
|
288
288
|
!*** ./client/key/set-current-by-char.js ***!
|
|
289
289
|
\*******************************************/
|
|
290
|
-
|
|
290
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
291
291
|
|
|
292
292
|
"use strict";
|
|
293
293
|
eval("{/* global DOM */\n\n\n\nconst {\n escapeRegExp\n} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\nconst Info = DOM.CurrentInfo;\nmodule.exports = function setCurrentByChar(char, charStore) {\n let firstByName;\n let skipCount = 0;\n let setted = false;\n let i = 0;\n const escapeChar = escapeRegExp(char);\n const regExp = new RegExp(`^${escapeChar}.*$`, 'i');\n const {\n files\n } = Info;\n const chars = charStore();\n const n = chars.length;\n while (i < n && char === chars[i]) i++;\n if (!i) charStore([]);\n const skipN = skipCount = i;\n charStore(charStore().concat(char));\n const names = DOM.getFilenames(files);\n const isTest = a => regExp.test(a);\n const isRoot = a => a === '..';\n const not = f => a => !f(a);\n const setCurrent = name => {\n const byName = DOM.getCurrentByName(name);\n if (!skipCount) {\n setted = true;\n DOM.setCurrentFile(byName);\n return true;\n }\n if (skipN === skipCount) firstByName = byName;\n --skipCount;\n };\n names.filter(isTest).filter(not(isRoot)).some(setCurrent);\n if (!setted) {\n DOM.setCurrentFile(firstByName);\n charStore([char]);\n }\n};\n\n//# sourceURL=file://cloudcmd/client/key/set-current-by-char.js\n}");
|
|
294
294
|
|
|
295
|
-
/***/ }
|
|
295
|
+
/***/ },
|
|
296
296
|
|
|
297
|
-
/***/ "./client/key/vim/find.js"
|
|
297
|
+
/***/ "./client/key/vim/find.js"
|
|
298
298
|
/*!********************************!*\
|
|
299
299
|
!*** ./client/key/vim/find.js ***!
|
|
300
300
|
\********************************/
|
|
301
|
-
|
|
301
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
302
302
|
|
|
303
303
|
"use strict";
|
|
304
304
|
eval("{\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst limier = __webpack_require__(/*! limier */ \"./node_modules/limier/lib/limier.js\");\nconst searchStore = fullstore([]);\nconst searchIndex = fullstore(0);\nmodule.exports.find = (value, names) => {\n const result = limier(value, names);\n searchStore(result);\n searchIndex(0);\n return result;\n};\nmodule.exports.findNext = () => {\n const names = searchStore();\n const index = next(searchIndex(), names.length);\n searchIndex(index);\n return names[searchIndex()];\n};\nmodule.exports.findPrevious = () => {\n const names = searchStore();\n const index = previous(searchIndex(), names.length);\n searchIndex(index);\n return names[index];\n};\nmodule.exports._next = next;\nmodule.exports._previous = previous;\nfunction next(index, length) {\n if (index === length - 1) return 0;\n return ++index;\n}\nfunction previous(index, length) {\n if (!index) return length - 1;\n return --index;\n}\n\n//# sourceURL=file://cloudcmd/client/key/vim/find.js\n}");
|
|
305
305
|
|
|
306
|
-
/***/ }
|
|
306
|
+
/***/ },
|
|
307
307
|
|
|
308
|
-
/***/ "./client/key/vim/index.js"
|
|
308
|
+
/***/ "./client/key/vim/index.js"
|
|
309
309
|
/*!*********************************!*\
|
|
310
310
|
!*** ./client/key/vim/index.js ***!
|
|
311
311
|
\*********************************/
|
|
312
|
-
|
|
312
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
313
313
|
|
|
314
314
|
"use strict";
|
|
315
315
|
eval("{\n\n/* global CloudCmd */\n/* global DOM */\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/vim.js\");\nconst finder = __webpack_require__(/*! ./find */ \"./client/key/vim/find.js\");\nconst {\n setCurrent,\n selectFileNotParent\n} = __webpack_require__(/*! ./set-current */ \"./client/key/vim/set-current.js\");\nconst {\n Dialog\n} = DOM;\nconst DEPS = {\n ...DOM,\n ...CloudCmd\n};\nmodule.exports = async (key, event, deps = DEPS) => {\n const operations = getOperations(event, deps);\n await vim(key, operations);\n};\nconst getOperations = (event, deps) => {\n const {\n Info = DOM.CurrentInfo,\n Operation,\n unselectFiles,\n setCurrentFile,\n setCurrentByName,\n getCurrentName,\n toggleSelectedFile,\n Buffer = {}\n } = deps;\n return {\n escape: unselectFiles,\n remove: () => {\n Operation.show('delete');\n },\n makeDirectory: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewDir();\n },\n makeFile: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewFile();\n },\n terminal: () => {\n CloudCmd.Terminal.show();\n },\n edit: () => {\n CloudCmd.EditFileVim.show();\n },\n copy: () => {\n Buffer.copy();\n unselectFiles();\n },\n select: () => {\n const current = Info.element;\n toggleSelectedFile(current);\n },\n paste: Buffer.paste,\n moveNext: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('next', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n movePrevious: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('previous', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n find: async () => {\n event.preventDefault();\n const [, value] = await Dialog.prompt('Find', '');\n if (!value) return;\n const names = Info.files.map(getCurrentName);\n const [result] = finder.find(value, names);\n setCurrentByName(result);\n },\n findNext: () => {\n const name = finder.findNext();\n setCurrentByName(name);\n },\n findPrevious: () => {\n const name = finder.findPrevious();\n setCurrentByName(name);\n }\n };\n};\nmodule.exports.selectFile = selectFileNotParent;\n\n//# sourceURL=file://cloudcmd/client/key/vim/index.js\n}");
|
|
316
316
|
|
|
317
|
-
/***/ }
|
|
317
|
+
/***/ },
|
|
318
318
|
|
|
319
|
-
/***/ "./client/key/vim/set-current.js"
|
|
319
|
+
/***/ "./client/key/vim/set-current.js"
|
|
320
320
|
/*!***************************************!*\
|
|
321
321
|
!*** ./client/key/vim/set-current.js ***!
|
|
322
322
|
\***************************************/
|
|
323
|
-
|
|
323
|
+
(module) {
|
|
324
324
|
|
|
325
325
|
"use strict";
|
|
326
326
|
eval("{\n\n/* global DOM */\nmodule.exports.selectFileNotParent = selectFileNotParent;\nfunction selectFileNotParent(current, {\n getCurrentName,\n selectFile\n} = DOM) {\n const name = getCurrentName(current);\n if (name === '..') return;\n selectFile(current);\n}\nmodule.exports.setCurrent = (sibling, {\n count,\n isVisual,\n isDelete\n}, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n}) => {\n let current = Info.element;\n const select = isVisual ? selectFileNotParent : unselectFiles;\n select(current);\n const position = `${sibling}Sibling`;\n for (let i = 0; i < count; i++) {\n const next = current[position];\n if (!next) break;\n current = next;\n select(current);\n }\n setCurrentFile(current);\n if (isDelete) Operation.show('delete');\n};\n\n//# sourceURL=file://cloudcmd/client/key/vim/set-current.js\n}");
|
|
327
327
|
|
|
328
|
-
/***/ }
|
|
328
|
+
/***/ },
|
|
329
329
|
|
|
330
|
-
/***/ "./client/key/vim/vim.js"
|
|
330
|
+
/***/ "./client/key/vim/vim.js"
|
|
331
331
|
/*!*******************************!*\
|
|
332
332
|
!*** ./client/key/vim/vim.js ***!
|
|
333
333
|
\*******************************/
|
|
334
|
-
|
|
334
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
335
335
|
|
|
336
336
|
"use strict";
|
|
337
337
|
eval("{\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst store = fullstore('');\nconst visual = fullstore(false);\nconst stopVisual = () => {\n visual(false);\n};\nconst end = () => {\n store('');\n};\nconst rmFirst = a => {\n return a.split('').slice(1).join('');\n};\nconst noop = () => {};\nmodule.exports = (key, operations = {}) => {\n const prevStore = store();\n const isVisual = visual();\n const value = store(prevStore.concat(key));\n const {\n escape = noop,\n moveNext = noop,\n movePrevious = noop,\n remove = noop,\n copy = noop,\n paste = noop,\n select = noop,\n find = noop,\n findNext = noop,\n findPrevious = noop,\n makeFile = noop,\n makeDirectory = noop,\n terminal = noop,\n edit = noop\n } = operations;\n if (key === 'Enter') return end();\n if (key === 'Escape') {\n visual(false);\n escape();\n return end();\n }\n if (key === 'j' || key === 'w') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && moveNext({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (key === 'k' || key === 'b') {\n const {\n count,\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n !isNaN(count) && movePrevious({\n count,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'gg' || key === '^') {\n const {\n isDelete,\n isVisual\n } = handleDelete(prevStore);\n movePrevious({\n count: Infinity,\n isVisual,\n isDelete\n });\n return end();\n }\n if (value === 'md') {\n makeDirectory();\n return end();\n }\n if (value === 'tt') {\n terminal();\n return end();\n }\n if (value === 'e') {\n edit();\n return end();\n }\n if (value === 'mf') {\n makeFile();\n return end();\n }\n if (key === 'd' && (visual() || prevStore === 'd')) {\n stopVisual();\n remove();\n return end();\n }\n if (key === 'G' || key === '$') {\n moveNext({\n count: Infinity,\n isVisual\n });\n return end();\n }\n if (key === 'y') {\n if (!visual()) return end();\n stopVisual();\n copy();\n return end();\n }\n if (/^p$/i.test(key)) {\n paste();\n return end();\n }\n if (/^v$/i.test(key)) {\n visual(!visual());\n select();\n return end();\n }\n if (key === '/') {\n find();\n return end();\n }\n if (key === 'n') {\n findNext();\n return end();\n }\n if (key === 'N') {\n findPrevious();\n return end();\n }\n if (key === ' ') return end();\n};\nfunction handleDelete(prevStore) {\n const isDelete = prevStore[0] === 'd';\n if (isDelete) {\n visual(true);\n prevStore = rmFirst(prevStore);\n }\n const count = getNumber(prevStore);\n const isVisual = visual();\n return {\n count,\n isDelete,\n isVisual\n };\n}\nfunction getNumber(value) {\n if (!value) return 1;\n if (value === 'g') return 1;\n return parseInt(value);\n}\n\n//# sourceURL=file://cloudcmd/client/key/vim/vim.js\n}");
|
|
338
338
|
|
|
339
|
-
/***/ }
|
|
339
|
+
/***/ },
|
|
340
340
|
|
|
341
|
-
/***/ "./client/listeners/get-index.js"
|
|
341
|
+
/***/ "./client/listeners/get-index.js"
|
|
342
342
|
/*!***************************************!*\
|
|
343
343
|
!*** ./client/listeners/get-index.js ***!
|
|
344
344
|
\***************************************/
|
|
345
|
-
|
|
345
|
+
(module) {
|
|
346
346
|
|
|
347
347
|
"use strict";
|
|
348
348
|
eval("{\n\nmodule.exports = (array, item) => {\n const index = array.indexOf(item);\n if (!~index) return 0;\n return index;\n};\n\n//# sourceURL=file://cloudcmd/client/listeners/get-index.js\n}");
|
|
349
349
|
|
|
350
|
-
/***/ }
|
|
350
|
+
/***/ },
|
|
351
351
|
|
|
352
|
-
/***/ "./client/listeners/get-range.js"
|
|
352
|
+
/***/ "./client/listeners/get-range.js"
|
|
353
353
|
/*!***************************************!*\
|
|
354
354
|
!*** ./client/listeners/get-range.js ***!
|
|
355
355
|
\***************************************/
|
|
356
|
-
|
|
356
|
+
(module) {
|
|
357
357
|
|
|
358
358
|
"use strict";
|
|
359
359
|
eval("{\n\nmodule.exports = (indexFrom, indexTo, files) => {\n if (indexFrom < indexTo) return files.slice(indexFrom, indexTo + 1);\n if (indexFrom > indexTo) return files.slice(indexTo, indexFrom + 1);\n return [files[indexFrom]];\n};\n\n//# sourceURL=file://cloudcmd/client/listeners/get-range.js\n}");
|
|
360
360
|
|
|
361
|
-
/***/ }
|
|
361
|
+
/***/ },
|
|
362
362
|
|
|
363
|
-
/***/ "./client/listeners/index.js"
|
|
363
|
+
/***/ "./client/listeners/index.js"
|
|
364
364
|
/*!***********************************!*\
|
|
365
365
|
!*** ./client/listeners/index.js ***!
|
|
366
366
|
\***********************************/
|
|
367
|
-
|
|
367
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
368
368
|
|
|
369
369
|
"use strict";
|
|
370
|
-
eval("{/* global DOM, CloudCmd */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst getRange = __webpack_require__(/*! ./get-range */ \"./client/listeners/get-range.js\");\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst getIndex = currify(__webpack_require__(/*! ./get-index */ \"./client/listeners/get-index.js\"));\nconst NBSP_REG = RegExp(String.fromCharCode(160), 'g');\nconst SPACE = ' ';\nmodule.exports.init = async () => {\n await Promise.all([contextMenu(), dragndrop(), unload(), pop(), resize(), header(), config()]);\n};\nCloudCmd.Listeners = module.exports;\nconst unselect = event => {\n const isMac = /Mac/.test(window.navigator.platform);\n const {\n shiftKey,\n metaKey,\n ctrlKey\n } = event;\n if (shiftKey || isMac && metaKey || ctrlKey) return;\n DOM.unselectFiles();\n};\nconst execAll = currify((funcs, event) => {\n for (const fn of funcs) fn(event);\n});\nconst Info = DOM.CurrentInfo;\nconst {\n Events\n} = DOM;\nconst EventsFiles = {\n mousedown: exec.with(execIfNotUL, setCurrentFileByEvent),\n click: execAll([onClick, exec.with(execIfNotMobile, unselect)]),\n dragstart: exec.with(execIfNotUL, onDragStart),\n dblclick: exec.with(execIfNotUL, onDblClick),\n touchstart: exec.with(execIfNotUL, onTouch)\n};\nlet EXT;\nfunction header() {\n const fm = DOM.getFM();\n const isDataset = el => el.dataset;\n const isPanel = el => {\n return /^js-(left|right)$/.test(el.dataset.name);\n };\n Events.addClick(fm, event => {\n const el = event.target;\n const parent = el.parentElement;\n if (parent.dataset.name !== 'js-fm-header') return;\n const name = (el.dataset.name || '').replace('js-', '');\n if (!/^(name|size|date)$/.test(name)) return;\n const panel = getPath(el).filter(isDataset).filter(isPanel).pop();\n CloudCmd.sortPanel(name, panel);\n });\n}\nfunction getPath(el, path = []) {\n if (!el) return path;\n return getPath(el.parentElement, path.concat(el));\n}\nasync function config() {\n const [, config] = await tryToCatch(DOM.Files.get, 'config');\n const type = config === null || config === void 0 ? void 0 : config.packer;\n EXT = DOM.getPackerExt(type);\n}\nmodule.exports.initKeysPanel = () => {\n const keysElement = DOM.getById('js-keyspanel');\n if (!keysElement) return;\n Events.addClick(keysElement, event => {\n const {\n target\n } = event;\n const {\n id\n } = target;\n const operation = name => {\n const {\n Operation\n } = CloudCmd;\n return Operation.show.bind(null, name);\n };\n const clickFuncs = {\n 'f1': CloudCmd.Help.show,\n 'f2': CloudCmd.UserMenu.show,\n 'f3': CloudCmd.View.show,\n 'f4': CloudCmd.EditFile.show,\n 'f5': operation('copy'),\n 'f6': operation('move'),\n 'f7': DOM.promptNewDir,\n 'f8': operation('delete'),\n 'f9': () => {\n event.stopPropagation();\n CloudCmd.Menu.show();\n },\n 'f10': CloudCmd.Config.show,\n '~': CloudCmd.Konsole.show,\n 'shift~': CloudCmd.Terminal.show,\n 'contact': CloudCmd.Contact.show\n };\n exec(clickFuncs[id]);\n });\n};\nconst getPanel = side => {\n if (!itype.string(side)) return side;\n return DOM.getByDataName(`js-${side}`);\n};\nmodule.exports.setOnPanel = side => {\n const panel = getPanel(side);\n const filesElement = DOM.getByDataName('js-files', panel);\n const pathElement = DOM.getByDataName('js-path', panel);\n\n /* ставим загрузку гифа на клик*/\n Events.addClick(pathElement, getPathListener(panel));\n Events.add(filesElement, EventsFiles);\n};\nfunction getPathListener(panel) {\n return onPathElementClick.bind(null, panel);\n}\nfunction isNoCurrent(panel) {\n const infoPanel = Info.panel;\n if (!infoPanel) return true;\n const namePanel = panel.getAttribute('data-name');\n const nameInfoPanel = infoPanel.getAttribute('data-name');\n return namePanel !== nameInfoPanel;\n}\nfunction decodePath(path) {\n const url = CloudCmd.HOST;\n const {\n prefix\n } = CloudCmd;\n const prefixReg = RegExp('^' + prefix + FS);\n return decodeURI(path).replace(url, '').replace(prefixReg, '') // browser doesn't replace % -> %25% do it for him\n .replace('%%', '%25%').replace(NBSP_REG, SPACE) || '/';\n}\nasync function onPathElementClick(panel, event) {\n event.preventDefault();\n const element = event.target;\n const attr = element.getAttribute('data-name');\n const noCurrent = isNoCurrent(panel);\n if (attr === 'js-copy-path') return copyPath(element);\n if (attr === 'js-refresh') return CloudCmd.refresh({\n panel,\n noCurrent\n });\n if (attr !== 'js-path-link') return;\n const {\n href\n } = element;\n const path = decodePath(href);\n await CloudCmd.changeDir(path, {\n isRefresh: false,\n panel: noCurrent ? panel : Info.panel\n });\n}\nfunction copyPath(el) {\n clipboard.writeText(el.parentElement.title).then(CloudCmd.log).catch(CloudCmd.log);\n}\nfunction execIfNotMobile(callback, event) {\n const isMobile = DOM.getCSSVar('is-mobile');\n if (!isMobile) callback(event);\n}\nfunction execIfNotUL(callback, event) {\n const {\n target\n } = event;\n const {\n tagName\n } = target;\n if (tagName !== 'UL') callback(event);\n}\nfunction onClick(event) {\n event.preventDefault();\n changePanel(event.target);\n}\nfunction toggleSelect(key, files) {\n const isMac = /Mac/.test(window.navigator.platform);\n if (!key) throw Error('key should not be undefined!');\n const [file] = files;\n if (isMac && key.meta) return DOM.toggleSelectedFile(file);\n if (key.shift) return files.map(DOM.selectFile);\n}\nfunction changePanel(element) {\n const {\n panel\n } = Info;\n const files = DOM.getByDataName('js-files', panel);\n const ul = getULElement(element);\n if (ul !== files) DOM.changePanel();\n}\nasync function onDblClick(event) {\n event.preventDefault();\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n const path = DOM.getCurrentPath(current);\n if (!isDir) return CloudCmd.View.show();\n await CloudCmd.changeDir(path);\n}\nasync function onTouch(event) {\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n if (!isDir) return;\n const isCurrent = DOM.isCurrentFile(current);\n if (!isCurrent) return;\n await CloudCmd.changeDir(DOM.getCurrentPath(current));\n}\n\n/*\n * download file from browser to desktop\n * in Chrome (HTML5)\n */\nfunction onDragStart(event) {\n const {\n prefixURL\n } = CloudCmd;\n const element = getLIElement(event.target);\n const {\n isDir\n } = Info;\n let link = DOM.getCurrentLink(element);\n let name = DOM.getCurrentName(element);\n\n /* if it's directory - adding json extension */\n if (isDir) {\n name += EXT;\n link = document.createElement('a');\n link.textContent = name;\n link.href = prefixURL + '/pack' + Info.path + EXT;\n }\n event.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + name + ':' + link);\n}\nfunction getLIElement(element) {\n if (!element) return element;\n while (element.tagName !== 'LI') element = element.parentElement;\n return element;\n}\nfunction getULElement(element) {\n while (element.tagName !== 'UL') element = element.parentElement;\n return element;\n}\nfunction setCurrentFileByEvent(event) {\n const BUTTON_LEFT = 0;\n const key = {\n alt: event.altKey,\n ctrl: event.ctrlKey,\n meta: event.metaKey,\n shift: event.shiftKey\n };\n const element = getLIElement(event.target);\n const fromName = Info.name;\n DOM.setCurrentFile(element);\n const toName = Info.name;\n let files = [];\n if (key.shift) files = getFilesRange(fromName, toName);else files.push(Info.element);\n if (event.button === BUTTON_LEFT) toggleSelect(key, files);\n}\nfunction getFilesRange(from, to) {\n const files = DOM.getAllFiles();\n const names = DOM.getFilenames(files);\n const getNameIndex = getIndex(names);\n const indexFrom = getNameIndex(from);\n const indexTo = getNameIndex(to);\n return getRange(indexFrom, indexTo, files);\n}\nfunction contextMenu() {\n const fm = DOM.getFM();\n Events.addOnce('contextmenu', fm, event => {\n CloudCmd.Menu.show({\n x: event.clientX,\n y: event.clientY\n });\n });\n Events.addContextMenu(fm, event => {\n CloudCmd.Menu.ENABLED || event.preventDefault();\n });\n}\nfunction dragndrop() {\n const panels = DOM.getByClassAll('panel');\n const select = ({\n target\n }) => {\n target.classList.add('selected-panel');\n };\n const unselect = ({\n target\n }) => {\n target.classList.remove('selected-panel');\n };\n const onDrop = event => {\n const {\n files,\n items\n } = event.dataTransfer;\n const {\n length: filesCount\n } = files;\n event.preventDefault();\n if (filesCount && (!items || !items.length || !items[0].webkitGetAsEntry)) return uploadFiles(files);\n const isFile = item => item.kind === 'file';\n const dirFiles = Array.from(items).filter(isFile);\n if (dirFiles.length) return DOM.uploadDirectory(dirFiles);\n const {\n Operation\n } = CloudCmd;\n const operation = event.shiftKey ? 'move' : 'copy';\n return Operation.show(operation);\n };\n\n /**\n * In macOS Chrome dropEffect = 'none'\n * so drop do not firing up when try\n * to upload file from download bar\n */\n const onDragOver = event => {\n const {\n dataTransfer\n } = event;\n const {\n effectAllowed\n } = dataTransfer;\n if (/move|linkMove/.test(effectAllowed)) dataTransfer.dropEffect = 'move';else dataTransfer.dropEffect = 'copy';\n event.preventDefault();\n };\n for (const panel of panels) Events.add('dragover', panel, onDragOver).add('drop', panel, onDrop).add('dragenter', select).add(['dragleave', 'drop'], unselect);\n}\nfunction unload() {\n DOM.Events.add(['unload', 'beforeunload'], event => {\n const {\n Key\n } = CloudCmd;\n const isBind = Key === null || Key === void 0 ? void 0 : Key.isBind();\n if (isBind) return;\n event.preventDefault();\n return 'Please make sure that you saved all work.';\n });\n}\nfunction pop() {\n Events.add('popstate', async ({\n state\n }) => {\n const path = (state || '').replace(FS, '');\n if (!path) return CloudCmd.route(location.hash);\n const history = false;\n await CloudCmd.changeDir(path, {\n history\n });\n });\n}\nfunction resize() {\n Events.add('resize', () => {\n const is = window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH;\n if (!is) return;\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return;\n const name = panel.getAttribute('data-name');\n const isLeft = name === 'js-left';\n if (isLeft) return;\n DOM.changePanel();\n });\n}\n\n//# sourceURL=file://cloudcmd/client/listeners/index.js\n}");
|
|
370
|
+
eval("{/* global DOM, CloudCmd */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst getRange = __webpack_require__(/*! ./get-range */ \"./client/listeners/get-range.js\");\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst getIndex = currify(__webpack_require__(/*! ./get-index */ \"./client/listeners/get-index.js\"));\nconst NBSP_REG = RegExp(String.fromCharCode(160), 'g');\nconst SPACE = ' ';\nmodule.exports.init = async () => {\n await Promise.all([contextMenu(), dragndrop(), unload(), pop(), resize(), header(), config()]);\n};\nCloudCmd.Listeners = module.exports;\nconst unselect = event => {\n const isMac = /Mac/.test(window.navigator.platform);\n const {\n shiftKey,\n metaKey,\n ctrlKey\n } = event;\n if (shiftKey || isMac && metaKey || ctrlKey) return;\n DOM.unselectFiles();\n};\nconst execAll = currify((funcs, event) => {\n for (const fn of funcs) fn(event);\n});\nconst Info = DOM.CurrentInfo;\nconst {\n Events\n} = DOM;\nconst EventsFiles = {\n mousedown: exec.with(execIfNotUL, setCurrentFileByEvent),\n click: execAll([onClick, exec.with(execIfNotMobile, unselect)]),\n dragstart: exec.with(execIfNotUL, onDragStart),\n dblclick: exec.with(execIfNotUL, onDblClick),\n touchstart: exec.with(execIfNotUL, onTouch)\n};\nlet EXT;\nfunction header() {\n const fm = DOM.getFM();\n const isDataset = el => el.dataset;\n const isPanel = el => {\n return /^js-(left|right)$/.test(el.dataset.name);\n };\n Events.addClick(fm, event => {\n const el = event.target;\n const parent = el.parentElement;\n if (parent.dataset.name !== 'js-fm-header') return;\n const name = (el.dataset.name || '').replace('js-', '');\n if (!/^(name|size|date)$/.test(name)) return;\n const panel = getPath(el).filter(isDataset).filter(isPanel).pop();\n CloudCmd.sortPanel(name, panel);\n });\n}\nfunction getPath(el, path = []) {\n if (!el) return path;\n return getPath(el.parentElement, path.concat(el));\n}\nasync function config() {\n const [, config] = await tryToCatch(DOM.Files.get, 'config');\n const type = config === null || config === void 0 ? void 0 : config.packer;\n EXT = DOM.getPackerExt(type);\n}\nmodule.exports.initKeysPanel = () => {\n const keysElement = DOM.getById('js-keyspanel');\n if (!keysElement) return;\n Events.addClick(keysElement, event => {\n const {\n target\n } = event;\n const {\n id\n } = target;\n const operation = name => {\n const {\n Operation\n } = CloudCmd;\n return Operation.show.bind(null, name);\n };\n const clickFuncs = {\n 'f1': CloudCmd.Help.show,\n 'f2': CloudCmd.UserMenu.show,\n 'f3': CloudCmd.View.show,\n 'f4': CloudCmd.EditFile.show,\n 'f5': operation('copy'),\n 'f6': operation('move'),\n 'f7': DOM.promptNewDir,\n 'f8': operation('delete'),\n 'f9': () => {\n event.stopPropagation();\n CloudCmd.Menu.show();\n },\n 'f10': CloudCmd.Config.show,\n '~': CloudCmd.Konsole.show,\n 'shift~': CloudCmd.Terminal.show,\n 'contact': CloudCmd.Contact.show\n };\n exec(clickFuncs[id]);\n });\n};\nconst getPanel = side => {\n if (!itype.string(side)) return side;\n return DOM.getByDataName(`js-${side}`);\n};\nmodule.exports.setOnPanel = side => {\n const panel = getPanel(side);\n const filesElement = DOM.getByDataName('js-files', panel);\n const pathElement = DOM.getByDataName('js-path', panel);\n\n /* ставим загрузку гифа на клик*/\n Events.addClick(pathElement, getPathListener(panel));\n Events.add(filesElement, EventsFiles);\n};\nfunction getPathListener(panel) {\n return onPathElementClick.bind(null, panel);\n}\nfunction isNoCurrent(panel) {\n const infoPanel = Info.panel;\n if (!infoPanel) return true;\n const namePanel = panel.getAttribute('data-name');\n const nameInfoPanel = infoPanel.getAttribute('data-name');\n return namePanel !== nameInfoPanel;\n}\nfunction decodePath(path) {\n const url = CloudCmd.HOST;\n const {\n prefix\n } = CloudCmd;\n const prefixReg = RegExp('^' + prefix + FS);\n return decodeURI(path).replace(url, '').replace(prefixReg, '') // browser doesn't replace % -> %25% do it for him\n .replace('%%', '%25%').replace(NBSP_REG, SPACE) || '/';\n}\nasync function onPathElementClick(panel, event) {\n event.preventDefault();\n const element = event.target;\n const attr = element.getAttribute('data-name');\n const noCurrent = isNoCurrent(panel);\n if (attr === 'js-copy-path') return copyPath(element);\n if (attr === 'js-refresh') return CloudCmd.refresh({\n panel,\n noCurrent\n });\n if (attr !== 'js-path-link') return;\n const {\n href\n } = element;\n const path = decodePath(href);\n await CloudCmd.changeDir(path, {\n isRefresh: false,\n panel: noCurrent ? panel : Info.panel\n });\n}\nfunction copyPath(el) {\n clipboard.writeText(el.parentElement.title).then(CloudCmd.log).catch(CloudCmd.log);\n}\nfunction execIfNotMobile(callback, event) {\n const isMobile = DOM.getCSSVar('is-mobile');\n if (!isMobile) callback(event);\n}\nfunction execIfNotUL(callback, event) {\n const {\n target\n } = event;\n const {\n tagName\n } = target;\n if (tagName !== 'UL') callback(event);\n}\nfunction onClick(event) {\n event.preventDefault();\n changePanel(event.target);\n}\nfunction toggleSelect(key, files) {\n const isMac = /Mac/.test(window.navigator.platform);\n if (!key) throw Error('key should not be undefined!');\n const [file] = files;\n if (isMac && key.meta) return DOM.toggleSelectedFile(file);\n if (key.shift) return files.map(DOM.selectFile);\n}\nfunction changePanel(element) {\n const {\n panel\n } = Info;\n const files = DOM.getByDataName('js-files', panel);\n const ul = getULElement(element);\n if (ul !== files) DOM.changePanel();\n}\nasync function onDblClick(event) {\n event.preventDefault();\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n const path = DOM.getCurrentPath(current);\n if (!isDir) return CloudCmd.View.show();\n await CloudCmd.changeDir(path);\n}\nasync function onTouch(event) {\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n if (!isDir) return;\n const isCurrent = DOM.isCurrentFile(current);\n if (!isCurrent) return;\n await CloudCmd.changeDir(DOM.getCurrentPath(current));\n}\n\n/*\n * download file from browser to desktop\n * in Chrome (HTML5)\n */\nfunction onDragStart(event) {\n const {\n prefixURL\n } = CloudCmd;\n const element = getLIElement(event.target);\n const {\n isDir\n } = Info;\n let link = DOM.getCurrentLink(element);\n let name = DOM.getCurrentName(element);\n\n /* if it's directory - adding json extension */\n if (isDir) {\n name += EXT;\n link = document.createElement('a');\n link.textContent = name;\n link.href = prefixURL + '/pack' + Info.path + EXT;\n }\n event.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + name + ':' + link);\n}\nfunction getLIElement(element) {\n if (!element) return element;\n while (element.tagName !== 'LI') element = element.parentElement;\n return element;\n}\nfunction getULElement(element) {\n while (element.tagName !== 'UL') element = element.parentElement;\n return element;\n}\nfunction setCurrentFileByEvent(event) {\n const BUTTON_LEFT = 0;\n const key = {\n alt: event.altKey,\n ctrl: event.ctrlKey,\n meta: event.metaKey,\n shift: event.shiftKey\n };\n const element = getLIElement(event.target);\n const fromName = Info.name;\n DOM.setCurrentFile(element);\n const toName = Info.name;\n let files = [];\n if (key.shift) files = getFilesRange(fromName, toName);else files.push(Info.element);\n if (event.button === BUTTON_LEFT) toggleSelect(key, files);\n}\nfunction getFilesRange(from, to) {\n const files = DOM.getAllFiles();\n const names = DOM.getFilenames(files);\n const getNameIndex = getIndex(names);\n const indexFrom = getNameIndex(from);\n const indexTo = getNameIndex(to);\n return getRange(indexFrom, indexTo, files);\n}\nfunction contextMenu() {\n const fm = DOM.getFM();\n Events.addOnce('contextmenu', fm, event => {\n CloudCmd.Menu.show({\n x: event.clientX,\n y: event.clientY\n });\n });\n Events.addContextMenu(fm, event => {\n CloudCmd.Menu.ENABLED || event.preventDefault();\n });\n}\nfunction dragndrop() {\n const panels = DOM.getByClassAll('panel');\n const select = ({\n target\n }) => {\n target.classList.add('selected-panel');\n };\n const unselect = ({\n target\n }) => {\n target.classList.remove('selected-panel');\n };\n const onDrop = event => {\n const {\n files,\n items\n } = event.dataTransfer;\n const {\n length: filesCount\n } = files;\n event.preventDefault();\n if (filesCount && (!items || !items.length || !items[0].webkitGetAsEntry)) return uploadFiles(files);\n const isFile = item => item.kind === 'file';\n const dirFiles = Array.from(items).filter(isFile);\n if (dirFiles.length) return DOM.uploadDirectory(dirFiles);\n const {\n Operation\n } = CloudCmd;\n const operation = event.shiftKey ? 'move' : 'copy';\n return Operation.show(operation);\n };\n\n /**\n * In macOS Chrome dropEffect = 'none'\n * so drop do not firing up when try\n * to upload file from download bar\n */\n const onDragOver = event => {\n const {\n dataTransfer\n } = event;\n const {\n effectAllowed\n } = dataTransfer;\n if (/move|linkMove/.test(effectAllowed)) dataTransfer.dropEffect = 'move';else dataTransfer.dropEffect = 'copy';\n event.preventDefault();\n };\n for (const panel of panels) Events.add('dragover', panel, onDragOver).add('drop', panel, onDrop).add('dragenter', select).add(['dragleave', 'drop'], unselect);\n}\nfunction unload() {\n DOM.Events.add(['unload', 'beforeunload'], event => {\n const {\n Key\n } = CloudCmd;\n const isBind = Key === null || Key === void 0 ? void 0 : Key.isBind();\n if (isBind) return;\n event.preventDefault();\n return 'Please make sure that you saved all work.';\n });\n}\nfunction pop() {\n Events.add('popstate', async ({\n state\n }) => {\n const path = (state || '').replace(FS, '');\n if (!path) return CloudCmd.route(location.hash);\n const history = false;\n await CloudCmd.changeDir(path, {\n history\n });\n });\n}\nfunction resize() {\n Events.add('resize', () => {\n const is = window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH;\n if (!is) return;\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return;\n const name = panel.getAttribute('data-name');\n const isLeft = name === 'js-left';\n if (isLeft) return;\n DOM.changePanel();\n });\n}\n\n//# sourceURL=file://cloudcmd/client/listeners/index.js\n}");
|
|
371
371
|
|
|
372
|
-
/***/ }
|
|
372
|
+
/***/ },
|
|
373
373
|
|
|
374
|
-
/***/ "./client/load-module.js"
|
|
374
|
+
/***/ "./client/load-module.js"
|
|
375
375
|
/*!*******************************!*\
|
|
376
376
|
!*** ./client/load-module.js ***!
|
|
377
377
|
\*******************************/
|
|
378
|
-
|
|
378
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
379
379
|
|
|
380
380
|
"use strict";
|
|
381
|
-
eval("{\n\n/* global CloudCmd */\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
381
|
+
eval("{\n\n/* global CloudCmd */\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst loadJS = (__webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\").js);\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.cjs\");\nconst noJS = a => a.replace(/.js$/, '');\n\n/**\n * function load modules\n * @params = {name, path, func, dobefore, arg}\n */\nmodule.exports = function loadModule(params) {\n if (!params) return;\n const {\n path\n } = params;\n const name = path && noJS(pascalCase(path));\n const doBefore = params.dobefore;\n if (CloudCmd[name]) return;\n CloudCmd[name] = async () => {\n exec(doBefore);\n const {\n DIR_MODULES\n } = CloudCmd;\n const pathFull = `${DIR_MODULES}/${path}.js`;\n await loadJS(pathFull);\n const newModule = async f => f && f();\n const module = CloudCmd[name];\n Object.assign(newModule, module);\n CloudCmd[name] = newModule;\n CloudCmd.log('init', name);\n await module.init();\n return newModule;\n };\n CloudCmd[name].show = async (...args) => {\n CloudCmd.log('show', name, args);\n const m = CloudCmd[name];\n const [e, a] = await tryToCatch(m);\n if (e) return console.error(e);\n return await a.show(...args);\n };\n};\n\n//# sourceURL=file://cloudcmd/client/load-module.js\n}");
|
|
382
382
|
|
|
383
|
-
/***/ }
|
|
383
|
+
/***/ },
|
|
384
384
|
|
|
385
|
-
/***/ "./client/modules/cloud.js"
|
|
385
|
+
/***/ "./client/modules/cloud.js"
|
|
386
386
|
/*!*********************************!*\
|
|
387
387
|
!*** ./client/modules/cloud.js ***!
|
|
388
388
|
\*********************************/
|
|
389
|
-
|
|
389
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
390
390
|
|
|
391
391
|
"use strict";
|
|
392
392
|
eval("{/* global CloudCmd, filepicker */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n ajax\n} = __webpack_require__(/*! ../dom/load */ \"./client/dom/load.js\");\nconst Files = __webpack_require__(/*! ../dom/files */ \"./client/dom/files.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n log\n} = CloudCmd;\nconst upload = currify(_upload);\nconst Name = 'Cloud';\nCloudCmd[Name] = module.exports;\nmodule.exports.init = async () => {\n const [modules] = await loadFiles();\n const {\n key\n } = modules.data.FilePicker;\n filepicker.setKey(key);\n Images.hide();\n};\nmodule.exports.uploadFile = (filename, data) => {\n const mimetype = '';\n filepicker.store(data, {\n mimetype,\n filename\n }, fpFile => {\n filepicker.exportFile(fpFile, log, log);\n });\n};\nmodule.exports.saveFile = callback => {\n filepicker.pick(upload(callback));\n};\nfunction _upload(callback, file) {\n const {\n url,\n filename\n } = file;\n const responseType = 'arraybuffer';\n const success = exec.with(callback, filename);\n ajax({\n url,\n responseType,\n success\n });\n}\nfunction loadFiles() {\n const js = '//api.filepicker.io/v2/filepicker.js';\n return Promise.all([Files.get('modules'), load.js(js)]);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/cloud.js\n}");
|
|
393
393
|
|
|
394
|
-
/***/ }
|
|
394
|
+
/***/ },
|
|
395
395
|
|
|
396
|
-
/***/ "./client/modules/command-line.js"
|
|
396
|
+
/***/ "./client/modules/command-line.js"
|
|
397
397
|
/*!****************************************!*\
|
|
398
398
|
!*** ./client/modules/command-line.js ***!
|
|
399
399
|
\****************************************/
|
|
400
|
-
|
|
400
|
+
(module, exports, __webpack_require__) {
|
|
401
401
|
|
|
402
402
|
"use strict";
|
|
403
403
|
eval("{\n\n/* global CloudCmd */\nCloudCmd.CommandLine = exports;\nconst Dialog = __webpack_require__(/*! ../dom/dialog */ \"./client/dom/dialog.js\");\nconst noop = () => {};\nmodule.exports.init = noop;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nasync function show() {\n const [, cmd] = await Dialog.prompt('Command Line', '');\n const TERMINAL = '^(t|terminal)';\n if (RegExp(`${TERMINAL}$`).test(cmd)) return await CloudCmd.Terminal.show();\n if (RegExp(TERMINAL).test(cmd)) {\n const command = cmd.replace(RegExp(`${TERMINAL} `), '');\n const exitCode = await CloudCmd.TerminalRun.show({\n command: `bash -c '${command}'`\n });\n if (exitCode === -1) await Dialog.alert(`☝️ Looks like Terminal is disabled, start Cloud Coammnder with '--terminal' flag.`);\n return;\n }\n}\nfunction hide() {}\n\n//# sourceURL=file://cloudcmd/client/modules/command-line.js\n}");
|
|
404
404
|
|
|
405
|
-
/***/ }
|
|
405
|
+
/***/ },
|
|
406
406
|
|
|
407
|
-
/***/ "./client/modules/config/index.js"
|
|
407
|
+
/***/ "./client/modules/config/index.js"
|
|
408
408
|
/*!****************************************!*\
|
|
409
409
|
!*** ./client/modules/config/index.js ***!
|
|
410
410
|
\****************************************/
|
|
411
|
-
|
|
411
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
412
412
|
|
|
413
413
|
"use strict";
|
|
414
|
-
eval("{\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
414
|
+
eval("{\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst input = __webpack_require__(/*! ./input */ \"./client/modules/config/input.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst {\n getTitle\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nCloudCmd[Name] = module.exports;\nconst loadSocket = promisify(DOM.loadSocket);\nconst showLoad = () => {\n Images.show.load('top');\n};\nconst addKey = currify((fn, input) => {\n Events.addKey(input, fn);\n return input;\n});\nconst addChange = currify((fn, input) => {\n Events.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load.css;\nmodule.exports.init = async () => {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n DIR_DIST\n } = CloudCmd;\n [Template] = await Promise.all([Files.get('config-tmpl'), loadSocket(), loadCSS(`${DIR_DIST}/config.css`), CloudCmd.View()]);\n initSocket();\n};\nconst {\n config,\n Key\n} = CloudCmd;\nlet Element;\nfunction getHost() {\n const {\n host,\n origin,\n protocol\n } = location;\n return origin || `${protocol}//${host}`;\n}\nfunction initSocket() {\n const href = getHost();\n const {\n prefixSocket,\n prefix\n } = CloudCmd;\n const ONE_MINUTE = 60 * 1000;\n const socket = io.connect(href + prefixSocket + '/config', {\n reconnectionAttempts: Infinity,\n reconnectionDelay: ONE_MINUTE,\n path: `${prefix}/socket.io`\n });\n const save = data => {\n onSave(data);\n socket.send(data);\n };\n authCheck(socket);\n socket.on('connect', () => {\n Config.save = save;\n });\n socket.on('message', onSave);\n socket.on('log', CloudCmd.log);\n socket.on('disconnect', () => {\n Config.save = saveHttp;\n });\n socket.on('err', Dialog.alert);\n}\nfunction authCheck(socket) {\n socket.emit('auth', config('username'), config('password'));\n socket.on('reject', wraptile(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nmodule.exports.show = show;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await tryToCatch(Files.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n menu,\n packer,\n columns,\n theme,\n configAuth,\n ...obj\n } = input.convert(config);\n obj[`${menu}-selected`] = 'selected';\n obj[`${editor}-selected`] = 'selected';\n obj[`${packer}-selected`] = 'selected';\n obj[`${columns}-selected`] = 'selected';\n obj[`${theme}-selected`] = 'selected';\n obj.configAuth = configAuth ? '' : 'hidden';\n const innerHTML = rendy(Template, obj);\n Element = createElement('form', {\n className: 'config',\n innerHTML\n });\n const inputs = document.querySelectorAll('input, select', Element);\n const [inputFirst] = inputs;\n let afterShow;\n if (inputFirst) {\n onAuthChange(inputFirst.checked);\n afterShow = inputFirst.focus.bind(inputFirst);\n }\n const getTarget = ({\n target\n }) => target;\n const handleChange = squad(onChange, getTarget);\n Array.from(inputs).map(addKey(onKey)).map(addChange(handleChange));\n const autoSize = true;\n CloudCmd.View.show(Element, {\n autoSize,\n afterShow\n });\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = input.getName(el);\n const data = input.getValue(name, Element);\n if (name === 'name') onNameChange(data);else if (name === 'auth') onAuthChange(data);\n obj[name] = data;\n await Config.save(obj);\n}\nfunction onSave(obj) {\n for (const name of Object.keys(obj)) {\n const data = obj[name];\n CloudCmd._config(name, data);\n input.setValue(name, data, Element);\n }\n}\nasync function saveHttp(obj) {\n const {\n RESTful\n } = DOM;\n const [e] = await RESTful.Config.write(obj);\n if (e) return;\n onSave(obj);\n}\nfunction onAuthChange(checked) {\n const elUsername = input.getElementByName('username', Element);\n const elPassword = input.getElementByName('password', Element);\n elUsername.disabled = !checked;\n elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle(getTitle({\n name\n }));\n}\nasync function onKey({\n keyCode,\n target\n}) {\n switch (keyCode) {\n case Key.ESC:\n return hide();\n case Key.ENTER:\n return await onChange(target);\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/config/index.js\n}");
|
|
415
415
|
|
|
416
|
-
/***/ }
|
|
416
|
+
/***/ },
|
|
417
417
|
|
|
418
|
-
/***/ "./client/modules/config/input.js"
|
|
418
|
+
/***/ "./client/modules/config/input.js"
|
|
419
419
|
/*!****************************************!*\
|
|
420
420
|
!*** ./client/modules/config/input.js ***!
|
|
421
421
|
\****************************************/
|
|
422
|
-
|
|
422
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
423
423
|
|
|
424
424
|
"use strict";
|
|
425
425
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isType = currify((type, object, name) => type === typeof object[name]);\nconst isBool = isType('boolean');\nmodule.exports.getElementByName = getElementByName;\nfunction getElementByName(selector, element) {\n const str = `[data-name=\"js-${selector}\"]`;\n return element.querySelector(str);\n}\nmodule.exports.getName = element => {\n const name = element.getAttribute('data-name').replace(/^js-/, '');\n return name;\n};\nmodule.exports.convert = config => {\n const result = config;\n const array = Object.keys(config);\n const filtered = array.filter(isBool(config));\n for (const name of filtered) {\n const item = config[name];\n result[name] = setState(item);\n }\n return result;\n};\nfunction setState(state) {\n if (state) return ' checked';\n return '';\n}\nmodule.exports.getValue = (name, element) => {\n const el = getElementByName(name, element);\n const {\n type\n } = el;\n switch (type) {\n case 'checkbox':\n return el.checked;\n case 'number':\n return Number(el.value);\n default:\n return el.value;\n }\n};\nmodule.exports.setValue = (name, value, element) => {\n const el = getElementByName(name, element);\n const {\n type\n } = el;\n switch (type) {\n case 'checkbox':\n el.checked = value;\n break;\n default:\n el.value = value;\n break;\n }\n};\n\n//# sourceURL=file://cloudcmd/client/modules/config/input.js\n}");
|
|
426
426
|
|
|
427
|
-
/***/ }
|
|
427
|
+
/***/ },
|
|
428
428
|
|
|
429
|
-
/***/ "./client/modules/contact.js"
|
|
429
|
+
/***/ "./client/modules/contact.js"
|
|
430
430
|
/*!***********************************!*\
|
|
431
431
|
!*** ./client/modules/contact.js ***!
|
|
432
432
|
\***********************************/
|
|
433
|
-
|
|
433
|
+
(module, exports, __webpack_require__) {
|
|
434
434
|
|
|
435
435
|
"use strict";
|
|
436
436
|
eval("{/* global CloudCmd */\n/* global DOM */\n\n\n\nCloudCmd.Contact = exports;\nconst olark = __webpack_require__(/*! @cloudcmd/olark */ \"./node_modules/@cloudcmd/olark/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Events\n} = DOM;\nconst {\n Key\n} = CloudCmd;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nmodule.exports.init = () => {\n Events.addKey(onKey);\n olark.identify('6216-545-10-4223');\n olark('api.box.onExpand', show);\n olark('api.box.onShow', show);\n olark('api.box.onShrink', hide);\n};\nfunction show() {\n Key.unsetBind();\n Images.hide();\n olark('api.box.expand');\n}\nfunction hide() {\n Key.setBind();\n olark('api.box.hide');\n}\nfunction onKey({\n keyCode\n}) {\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/contact.js\n}");
|
|
437
437
|
|
|
438
|
-
/***/ }
|
|
438
|
+
/***/ },
|
|
439
439
|
|
|
440
|
-
/***/ "./client/modules/edit-file-vim.js"
|
|
440
|
+
/***/ "./client/modules/edit-file-vim.js"
|
|
441
441
|
/*!*****************************************!*\
|
|
442
442
|
!*** ./client/modules/edit-file-vim.js ***!
|
|
443
443
|
\*****************************************/
|
|
444
|
-
|
|
444
|
+
(module, exports, __webpack_require__) {
|
|
445
445
|
|
|
446
446
|
"use strict";
|
|
447
447
|
eval("{\n\n/* global CloudCmd */\nCloudCmd.EditFileVim = exports;\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n Events.rmKey(listener);\n CloudCmd.EditFile.isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.EditFile();\n};\nmodule.exports.show = async () => {\n Events.addKey(listener);\n const editFile = await CloudCmd.EditFile.show(ConfigView);\n editFile.getEditor().setKeyMap('vim');\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-file-vim.js\n}");
|
|
448
448
|
|
|
449
|
-
/***/ }
|
|
449
|
+
/***/ },
|
|
450
450
|
|
|
451
|
-
/***/ "./client/modules/edit-file.js"
|
|
451
|
+
/***/ "./client/modules/edit-file.js"
|
|
452
452
|
/*!*************************************!*\
|
|
453
453
|
!*** ./client/modules/edit-file.js ***!
|
|
454
454
|
\*************************************/
|
|
455
|
-
|
|
455
|
+
(module, exports, __webpack_require__) {
|
|
456
456
|
|
|
457
457
|
"use strict";
|
|
458
458
|
eval("{\n\n/* global CloudCmd, DOM*/\nCloudCmd.EditFile = exports;\nconst Format = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog,\n Images\n} = DOM;\nconst {\n config\n} = CloudCmd;\nlet Menu;\nlet MSG_CHANGED;\nconst isLoading = fullstore();\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n isLoading(true);\n await CloudCmd.Edit();\n const editor = CloudCmd.Edit.getEditor();\n authCheck(editor);\n setListeners(editor);\n isLoading(false);\n};\nfunction getName() {\n const {\n name,\n isDir\n } = Info;\n if (isDir) return `${name}.json`;\n return name;\n}\nmodule.exports.show = async options => {\n if (isLoading()) return;\n const optionsEdit = {\n ...ConfigView,\n ...options\n };\n if (CloudCmd.config('showFileName')) optionsEdit.title = Info.name;\n Images.show.load();\n CloudCmd.Edit.getEditor().setOption('keyMap', 'default');\n const [error, data] = await Info.getData();\n if (error) {\n Images.hide();\n return CloudCmd.Edit;\n }\n const {\n path\n } = Info;\n const name = getName();\n setMsgChanged(name);\n CloudCmd.Edit.getEditor().setValueFirst(path, data).setModeForPath(name).enableKey();\n CloudCmd.Edit.show(optionsEdit);\n return CloudCmd.Edit;\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners(editor) {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n editor.on('save', value => {\n DOM.setCurrentSize(Format.size(value));\n });\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n CloudCmd.Edit.getEditor().focus();\n }\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, getMenuData());\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nfunction getMenuData() {\n const editor = CloudCmd.Edit.getEditor();\n return {\n 'Save Ctrl+S': () => {\n editor.save();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n}\nfunction setMsgChanged(name) {\n MSG_CHANGED = `Do you want to save changes to ${name}?`;\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const is = editor.isChanged();\n if (!is) return;\n const [cancel] = await Dialog.confirm(MSG_CHANGED);\n if (cancel) return;\n editor.save();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-file.js\n}");
|
|
459
459
|
|
|
460
|
-
/***/ }
|
|
460
|
+
/***/ },
|
|
461
461
|
|
|
462
|
-
/***/ "./client/modules/edit-names-vim.js"
|
|
462
|
+
/***/ "./client/modules/edit-names-vim.js"
|
|
463
463
|
/*!******************************************!*\
|
|
464
464
|
!*** ./client/modules/edit-names-vim.js ***!
|
|
465
465
|
\******************************************/
|
|
466
|
-
|
|
466
|
+
(module, exports, __webpack_require__) {
|
|
467
467
|
|
|
468
468
|
"use strict";
|
|
469
469
|
eval("{\n\n/* global CloudCmd */\nCloudCmd.EditNamesVim = exports;\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst {\n Key\n} = CloudCmd;\nconst ConfigView = {\n bindKeys: false,\n beforeClose: () => {\n Events.rmKey(listener);\n CloudCmd.EditNames.isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.EditNames();\n};\nmodule.exports.show = () => {\n Events.addKey(listener);\n CloudCmd.EditNames.show(ConfigView).getEditor().setKeyMap('vim');\n};\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction listener(event) {\n const {\n keyCode,\n shiftKey\n } = event;\n if (shiftKey && keyCode === Key.ESC) {\n event.preventDefault();\n hide();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names-vim.js\n}");
|
|
470
470
|
|
|
471
|
-
/***/ }
|
|
471
|
+
/***/ },
|
|
472
472
|
|
|
473
|
-
/***/ "./client/modules/edit-names.js"
|
|
473
|
+
/***/ "./client/modules/edit-names.js"
|
|
474
474
|
/*!**************************************!*\
|
|
475
475
|
!*** ./client/modules/edit-names.js ***!
|
|
476
476
|
\**************************************/
|
|
477
|
-
|
|
477
|
+
(module, exports, __webpack_require__) {
|
|
478
478
|
|
|
479
479
|
"use strict";
|
|
480
480
|
eval("{\n\n/* global CloudCmd, DOM */\nCloudCmd.EditNames = exports;\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst multiRename = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\nconst reject = Promise.reject.bind(Promise);\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nconst refresh = currify(_refresh);\nconst rename = currify(_rename);\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = {\n ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nfunction applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n Promise.resolve(root).then(rename(dir, from, to)).then(refresh(to, nameIndex)).catch(alert);\n}\nfunction _refresh(to, nameIndex, res) {\n if (res.status === 404) return res.text().then(reject);\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\nfunction _rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': () => {\n applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [, names] = await Dialog.confirm(msg);\n names && applyNames();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names.js\n}");
|
|
481
481
|
|
|
482
|
-
/***/ }
|
|
482
|
+
/***/ },
|
|
483
483
|
|
|
484
|
-
/***/ "./client/modules/edit.js"
|
|
484
|
+
/***/ "./client/modules/edit.js"
|
|
485
485
|
/*!********************************!*\
|
|
486
486
|
!*** ./client/modules/edit.js ***!
|
|
487
487
|
\********************************/
|
|
488
|
-
|
|
488
|
+
(module, exports, __webpack_require__) {
|
|
489
489
|
|
|
490
490
|
"use strict";
|
|
491
|
-
eval("{/* global CloudCmd */\n\n\n\nconst montag = __webpack_require__(/*! montag */ \"./node_modules/montag/lib/montag.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
491
|
+
eval("{/* global CloudCmd */\n\n\n\nconst montag = __webpack_require__(/*! montag */ \"./node_modules/montag/lib/montag.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n MAX_FILE_SIZE: maxSize\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n time,\n timeEnd\n} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\nconst getEditor = () => editor;\nconst isFn = a => typeof a === 'function';\nconst loadJS = load.js;\nconst Name = 'Edit';\nCloudCmd[Name] = exports;\nconst EditorName = CloudCmd.config('editor');\nlet Loading = true;\nlet Element;\nlet editor;\nconst ConfigView = {\n afterShow: () => {\n editor.moveCursorTo(0, 0).focus();\n }\n};\nmodule.exports.init = async () => {\n const element = create();\n await CloudCmd.View();\n await loadFiles(element);\n};\nfunction create() {\n const element = createElement('div', {\n style: montag`\n width: 100%;\n height: 100%;\n font-family: \"Droid Sans Mono\";\n `,\n notAppend: true\n });\n Element = element;\n return element;\n}\nfunction checkFn(name, fn) {\n if (!isFn(fn)) throw Error(`${name} should be a function!`);\n}\nfunction initConfig(options = {}) {\n const config = {\n ...options,\n ...ConfigView\n };\n if (!options.afterShow) return config;\n checkFn('options.afterShow', options.afterShow);\n config.afterShow = () => {\n ConfigView.afterShow();\n options.afterShow();\n };\n return config;\n}\nmodule.exports.show = options => {\n if (Loading) return;\n CloudCmd.View.show(Element, initConfig(options));\n getEditor().setOptions({\n fontSize: 16\n });\n};\nmodule.exports.getEditor = getEditor;\nmodule.exports.getElement = () => Element;\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nconst loadFiles = async element => {\n const prefix = `${CloudCmd.prefix}/${EditorName}`;\n const socketPath = CloudCmd.prefix;\n const prefixSocket = `${CloudCmd.prefixSocket}/${EditorName}`;\n const url = `${prefix}/${EditorName}.js`;\n time(`${Name} load`);\n await loadJS(url);\n const word = promisify(window[EditorName]);\n const [ed] = await tryToCatch(word, element, {\n maxSize,\n prefix,\n prefixSocket,\n socketPath\n });\n timeEnd(`${Name} load`);\n editor = ed;\n Loading = false;\n};\n\n//# sourceURL=file://cloudcmd/client/modules/edit.js\n}");
|
|
492
492
|
|
|
493
|
-
/***/ }
|
|
493
|
+
/***/ },
|
|
494
494
|
|
|
495
|
-
/***/ "./client/modules/help.js"
|
|
495
|
+
/***/ "./client/modules/help.js"
|
|
496
496
|
/*!********************************!*\
|
|
497
497
|
!*** ./client/modules/help.js ***!
|
|
498
498
|
\********************************/
|
|
499
|
-
|
|
499
|
+
(module, exports, __webpack_require__) {
|
|
500
500
|
|
|
501
501
|
"use strict";
|
|
502
502
|
eval("{\n\n/* global CloudCmd */\nCloudCmd.Help = exports;\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nmodule.exports.init = () => {\n Images.show.load('top');\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nfunction show() {\n const positionLoad = 'top';\n const relative = true;\n CloudCmd.Markdown.show('/HELP.md', {\n positionLoad,\n relative\n });\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/help.js\n}");
|
|
503
503
|
|
|
504
|
-
/***/ }
|
|
504
|
+
/***/ },
|
|
505
505
|
|
|
506
|
-
/***/ "./client/modules/konsole.js"
|
|
506
|
+
/***/ "./client/modules/konsole.js"
|
|
507
507
|
/*!***********************************!*\
|
|
508
508
|
!*** ./client/modules/konsole.js ***!
|
|
509
509
|
\***********************************/
|
|
510
|
-
|
|
510
|
+
(module, exports, __webpack_require__) {
|
|
511
511
|
|
|
512
512
|
"use strict";
|
|
513
|
-
eval("{\n\n/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global Console */\nCloudCmd.Konsole = exports;\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
513
|
+
eval("{\n\n/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global Console */\nCloudCmd.Konsole = exports;\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst loadJS = (__webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\").js);\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog,\n CurrentInfo: Info\n} = DOM;\nconst rmLastSlash = a => a.replace(/\\/$/, '') || '/';\nlet konsole;\nconst {\n config\n} = CloudCmd;\nconst cd = currify((fn, dir) => fn(`cd ${rmLastSlash(dir)}`));\nconst Name = 'Konsole';\nlet Element;\nlet Loaded;\nmodule.exports.init = async () => {\n if (!config('console')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await load();\n await create();\n};\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nmodule.exports.clear = () => {\n konsole.clear();\n};\nconst getPrefix = () => CloudCmd.prefix + '/console';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/console';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),\n PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),\n CURRENT_NAME: DOM.getCurrentName.bind(DOM),\n CURRENT_PATH: () => Info.path\n});\nasync function onPath(path) {\n if (Info.dirPath === path) return;\n await CloudCmd.changeDir(path);\n}\nconst getDirPath = () => {\n if (config('syncConsolePath')) return Info.dirPath;\n};\nconst create = async () => {\n const options = {\n cwd: getDirPath(),\n env: getEnv(),\n prefix: getPrefix(),\n prefixSocket: getPrefixSocket(),\n socketPath: CloudCmd.prefix\n };\n Element = createElement('div', {\n className: 'console'\n });\n konsole = await Console(Element, options);\n konsole.on('connect', exec.with(authCheck, konsole));\n konsole.on('path', config.if('syncConsolePath', onPath));\n CloudCmd.on('active-dir', config.if('syncConsolePath', cd(konsole.handler)));\n konsole.addShortCuts({\n P: () => {\n const command = konsole.getPromptText();\n const path = DOM.getCurrentDirPath();\n konsole.setPromptText(command + path);\n }\n });\n};\nfunction authCheck(konsole) {\n konsole.emit('auth', config('username'), config('password'));\n konsole.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nmodule.exports.show = callback => {\n if (!Loaded) return;\n if (!config('console')) return;\n CloudCmd.View.show(Element, {\n afterShow: () => {\n konsole.focus();\n exec(callback);\n }\n });\n};\nconst load = async () => {\n Util.time(`${Name} load`);\n const prefix = getPrefix();\n const url = `${prefix}/console.js`;\n const [error] = await tryToCatch(loadJS, url);\n Loaded = true;\n Util.timeEnd(`${Name} load`);\n if (error) return Dialog.alert(error.message, {\n cancel: false\n });\n};\n\n//# sourceURL=file://cloudcmd/client/modules/konsole.js\n}");
|
|
514
514
|
|
|
515
|
-
/***/ }
|
|
515
|
+
/***/ },
|
|
516
516
|
|
|
517
|
-
/***/ "./client/modules/markdown.js"
|
|
517
|
+
/***/ "./client/modules/markdown.js"
|
|
518
518
|
/*!************************************!*\
|
|
519
519
|
!*** ./client/modules/markdown.js ***!
|
|
520
520
|
\************************************/
|
|
521
|
-
|
|
521
|
+
(module, exports, __webpack_require__) {
|
|
522
522
|
|
|
523
523
|
"use strict";
|
|
524
524
|
eval("{\n\n/* global CloudCmd */\nCloudCmd.Markdown = exports;\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Markdown\n} = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\nconst {\n alert\n} = __webpack_require__(/*! ../dom/dialog */ \"./client/dom/dialog.js\");\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\nmodule.exports.show = show;\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nasync function show(name, options = {}) {\n const {\n positionLoad,\n relative\n } = options;\n Images.show.load(positionLoad);\n if (relative) name += '?relative';\n const [error, innerHTML] = await Markdown.read(name);\n Images.hide();\n if (error) return alert(error.message, {\n cancel: false\n });\n const className = 'help';\n const div = createElement('div', {\n className,\n innerHTML\n });\n CloudCmd.View.show(div);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/markdown.js\n}");
|
|
525
525
|
|
|
526
|
-
/***/ }
|
|
526
|
+
/***/ },
|
|
527
527
|
|
|
528
|
-
/***/ "./client/modules/menu/cloudmenu.mjs"
|
|
528
|
+
/***/ "./client/modules/menu/cloudmenu.mjs"
|
|
529
529
|
/*!*******************************************!*\
|
|
530
530
|
!*** ./client/modules/menu/cloudmenu.mjs ***!
|
|
531
531
|
\*******************************************/
|
|
532
|
-
|
|
532
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
533
533
|
|
|
534
534
|
"use strict";
|
|
535
535
|
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCloudMenu: () => (/* binding */ createCloudMenu)\n/* harmony export */ });\n/* harmony import */ var supermenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\n\nconst noop = () => {};\nconst {CloudCmd} = globalThis;\n\nconst createCloudMenu = async (fm, options, menuData) => {\n const createMenu = await loadMenu();\n const menu = await createMenu(fm, options, menuData);\n \n menu.addContextMenuListener = menu.addContextMenuListener || noop;\n \n return menu;\n};\n\nasync function loadMenu() {\n if (CloudCmd.config('menu') === 'aleman') {\n const {host, protocol} = window.location;\n const url = `${protocol}//${host}/node_modules/aleman/menu/menu.js`;\n const {createMenu} = await import(/* webpackIgnore: true */url);\n \n return createMenu;\n }\n \n return createSupermenu;\n}\n\nfunction createSupermenu(name, options, menuData) {\n const element = document.querySelector('[data-name=\"js-fm\"]');\n return supermenu__WEBPACK_IMPORTED_MODULE_0__(element, options, menuData);\n}\n\n\n//# sourceURL=file://cloudcmd/client/modules/menu/cloudmenu.mjs\n}");
|
|
536
536
|
|
|
537
|
-
/***/ }
|
|
537
|
+
/***/ },
|
|
538
538
|
|
|
539
|
-
/***/ "./client/modules/menu/index.js"
|
|
539
|
+
/***/ "./client/modules/menu/index.js"
|
|
540
540
|
/*!**************************************!*\
|
|
541
541
|
!*** ./client/modules/menu/index.js ***!
|
|
542
542
|
\**************************************/
|
|
543
|
-
|
|
543
|
+
(module, exports, __webpack_require__) {
|
|
544
544
|
|
|
545
545
|
"use strict";
|
|
546
546
|
eval("{/* global CloudCmd, DOM */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wrap = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n getIdBySrc\n} = __webpack_require__(/*! ../../dom/load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ../../dom/rest */ \"./client/dom/rest.js\");\nconst {\n config,\n Key\n} = CloudCmd;\nconst {\n Buffer,\n Events,\n Dialog,\n Images\n} = DOM;\nconst Info = DOM.CurrentInfo;\nconst alertNoFiles = Dialog.alert.noFiles;\nconst uploadTo = wrap(_uploadTo);\nlet MenuShowedName;\nlet MenuContext;\nlet MenuContextFile;\nmodule.exports.ENABLED = false;\nCloudCmd.Menu = exports;\nmodule.exports.init = async () => {\n const {\n isAuth,\n menuDataFile\n } = getFileMenuData();\n const fm = DOM.getFM();\n const menuData = getMenuData(isAuth);\n const options = getOptions({\n type: 'context'\n });\n const optionsFile = getOptions({\n type: 'file'\n });\n const {\n createCloudMenu\n } = await __webpack_require__.e(/*! import() */ \"cloudcmd.common\").then(__webpack_require__.bind(__webpack_require__, /*! ./cloudmenu.mjs */ \"./client/modules/menu/cloudmenu.mjs\"));\n const {\n name\n } = fm.dataset;\n MenuContext = await createCloudMenu(name, options, menuData);\n MenuContextFile = await createCloudMenu(name, optionsFile, menuDataFile);\n MenuContext.addContextMenuListener();\n MenuContextFile.addContextMenuListener();\n Events.addKey(listener);\n};\nmodule.exports.hide = hide;\nfunction hide() {\n MenuContext.hide();\n MenuContextFile.hide();\n}\nmodule.exports.show = position => {\n const {\n x,\n y\n } = getPosition(position);\n MenuContext.show(x, y);\n MenuContextFile.show(x, y);\n Images.hide();\n};\nfunction getPosition(position) {\n if (position) return {\n x: position.x,\n y: position.y\n };\n return getCurrentPosition();\n}\nfunction getMenuNameByEl(el) {\n if (!el) return 'context';\n const name = DOM.getCurrentName(el);\n if (name === '..') return 'context';\n return 'contextFile';\n}\nfunction getOptions({\n type\n}) {\n let name;\n let func;\n if (type === 'context') {\n name = 'context';\n func = Key.unsetBind;\n } else if (type === 'file') {\n name = 'contextFile';\n }\n const options = {\n icon: true,\n infiniteScroll: false,\n beforeClose: Key.setBind,\n beforeHide: Key.setBind,\n beforeShow: exec.with(beforeShow, func),\n beforeClick,\n name\n };\n return options;\n}\nfunction getMenuData(isAuth) {\n const menu = {\n 'Paste': Buffer.paste,\n 'New': {\n File: DOM.promptNewFile,\n Directory: DOM.promptNewDir\n },\n 'Upload': () => {\n CloudCmd.Upload.show();\n },\n 'Upload From Cloud': uploadFromCloud,\n 'Toggle File Selection': DOM.toggleSelectedFile,\n '(Un)Select All': DOM.toggleAllSelectedFiles\n };\n if (isAuth) menu['Log Out'] = CloudCmd.logOut;\n return menu;\n}\nfunction getFileMenuData() {\n const isAuth = CloudCmd.config('auth');\n const menuBottom = getMenuData(isAuth);\n const menuTop = {\n 'View': () => {\n CloudCmd.View.show();\n },\n 'Edit': () => {\n const name = config('vim') ? 'EditFileVim' : 'EditFile';\n CloudCmd[name].show();\n },\n 'Rename': () => {\n setTimeout(DOM.renameCurrent, 100);\n },\n 'Delete': () => {\n CloudCmd.Operation.show('delete');\n },\n 'Pack': () => {\n CloudCmd.Operation.show('pack');\n },\n 'Extract': () => {\n CloudCmd.Operation.show('extract');\n },\n 'Download': preDownload,\n 'Upload To Cloud': uploadTo('Cloud'),\n 'Cut': () => {\n isCurrent(Buffer.cut, alertNoFiles);\n },\n 'Copy': () => {\n isCurrent(Buffer.copy, alertNoFiles);\n }\n };\n const menuDataFile = {\n ...menuTop,\n ...menuBottom\n };\n return {\n isAuth,\n menuDataFile\n };\n}\nfunction isCurrent(yesFn, noFn) {\n if (Info.name !== '..') return yesFn();\n noFn();\n}\nfunction isPath(x, y) {\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return false;\n const el = document.elementFromPoint(x, y);\n const elements = panel.querySelectorAll('[data-name=\"js-path\"] *');\n return !~[].indexOf.call(elements, el);\n}\nfunction beforeShow(callback, params) {\n Key.unsetBind();\n const {\n name,\n position = {\n x: params.x,\n y: params.y\n }\n } = params;\n const {\n x,\n y\n } = position;\n const el = DOM.getCurrentByPosition({\n x,\n y\n });\n const menuName = getMenuNameByEl(el);\n let isShow = menuName !== 'contextFile';\n if (params.name === 'contextFile') isShow = !isShow;\n if (isShow) MenuShowedName = name;\n exec(callback);\n if (isShow) isShow = isPath(x, y);\n return isShow;\n}\nconst beforeClick = name => MenuShowedName !== name;\nasync function _uploadTo(nameModule) {\n const [error, data] = await Info.getData();\n if (error) return;\n const {\n name\n } = Info;\n CloudCmd.execFromModule(nameModule, 'uploadFile', name, data);\n CloudCmd.log(`Uploading to ${name}...`);\n}\nfunction uploadFromCloud() {\n Images.show.load('top');\n CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data) => {\n const path = DOM.getCurrentDirPath() + currentName;\n const [e] = await RESTful.write(path, data);\n if (e) return;\n await CloudCmd.refresh({\n currentName\n });\n });\n}\nfunction preDownload() {\n download(config('packer'));\n}\nfunction download(type) {\n const TIME = 30 * 1000;\n const {\n prefixURL\n } = CloudCmd;\n const PACK = '/pack';\n const date = Date.now();\n const files = DOM.getActiveFiles();\n if (!files.length) return alertNoFiles();\n for (const file of files) {\n const selected = DOM.isSelected(file);\n const isDir = DOM.isCurrentIsDir(file);\n const path = DOM.getCurrentPath(file);\n CloudCmd.log(`downloading file ${path}...`);\n\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n * and all other characters, like \"%\"\n */\n const encodedPath = encodeURI(path).replace(/#/g, '%23');\n const id = getIdBySrc(path);\n let src;\n if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);else src = prefixURL + FS + encodedPath + '?download';\n const element = createElement('iframe', {\n id: id + '-' + date,\n async: false,\n className: 'hidden',\n src\n });\n const {\n body\n } = document;\n const removeChild = body.removeChild.bind(body, element);\n setTimeout(removeChild, TIME);\n if (selected) DOM.toggleSelectedFile(file);\n }\n}\nfunction getCurrentPosition() {\n const current = Info.element;\n const rect = current.getBoundingClientRect();\n const position = {\n x: Math.round(rect.left + rect.width / 3),\n y: Math.round(rect.top)\n };\n return position;\n}\nfunction listener(event) {\n const {\n F9,\n ESC\n } = Key;\n const key = event.keyCode;\n const isBind = Key.isBind();\n if (key === ESC) {\n Key.setBind();\n return hide();\n }\n if (isBind && key === F9) {\n const position = getCurrentPosition();\n MenuContext.show(position.x, position.y);\n event.preventDefault();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/menu/index.js\n}");
|
|
547
547
|
|
|
548
|
-
/***/ }
|
|
548
|
+
/***/ },
|
|
549
549
|
|
|
550
|
-
/***/ "./client/modules/operation/format.js"
|
|
550
|
+
/***/ "./client/modules/operation/format.js"
|
|
551
551
|
/*!********************************************!*\
|
|
552
552
|
!*** ./client/modules/operation/format.js ***!
|
|
553
553
|
\********************************************/
|
|
554
|
-
|
|
554
|
+
(module) {
|
|
555
555
|
|
|
556
556
|
"use strict";
|
|
557
557
|
eval("{\n\nmodule.exports = (operation, from, to) => {\n if (!to) return `${operation} ${from}`;\n return `${operation} ${from} -> ${to}`;\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/format.js\n}");
|
|
558
558
|
|
|
559
|
-
/***/ }
|
|
559
|
+
/***/ },
|
|
560
560
|
|
|
561
|
-
/***/ "./client/modules/operation/get-next-current-name.js"
|
|
561
|
+
/***/ "./client/modules/operation/get-next-current-name.js"
|
|
562
562
|
/*!***********************************************************!*\
|
|
563
563
|
!*** ./client/modules/operation/get-next-current-name.js ***!
|
|
564
564
|
\***********************************************************/
|
|
565
|
-
|
|
565
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
566
566
|
|
|
567
567
|
"use strict";
|
|
568
568
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst not = currify((array, value) => !array.includes(value));\nconst notOneOf = currify((a, b) => a.filter(not(b)));\nmodule.exports = (currentName, names, removedNames) => {\n const i = names.indexOf(currentName);\n const nextNames = notOneOf(names, removedNames);\n const {\n length\n } = nextNames;\n if (nextNames[i]) return nextNames[i];\n return nextNames[length - 1];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/get-next-current-name.js\n}");
|
|
569
569
|
|
|
570
|
-
/***/ }
|
|
570
|
+
/***/ },
|
|
571
571
|
|
|
572
|
-
/***/ "./client/modules/operation/index.js"
|
|
572
|
+
/***/ "./client/modules/operation/index.js"
|
|
573
573
|
/*!*******************************************!*\
|
|
574
574
|
!*** ./client/modules/operation/index.js ***!
|
|
575
575
|
\*******************************************/
|
|
576
|
-
|
|
576
|
+
(module, exports, __webpack_require__) {
|
|
577
577
|
|
|
578
578
|
"use strict";
|
|
579
|
-
eval("{/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global fileop */\n\n\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst removeExtension = __webpack_require__(/*! ./remove-extension */ \"./client/modules/operation/remove-extension.js\");\nconst setListeners = __webpack_require__(/*! ./set-listeners */ \"./client/modules/operation/set-listeners.js\");\nconst getNextCurrentName = __webpack_require__(/*! ./get-next-current-name */ \"./client/modules/operation/get-next-current-name.js\");\nconst removeQuery = a => a.replace(/\\?.*/, '');\nconst Name = 'Operation';\nCloudCmd[Name] = exports;\nconst {\n config\n} = CloudCmd;\nconst {\n Dialog,\n Images\n} = DOM;\nconst authCheck = wraptile(_authCheck);\nconst Operation = {};\nlet Loaded;\nlet copyFn;\nlet moveFn;\nlet deleteFn;\nlet extractFn;\nlet packZipFn;\nlet packTarFn;\nconst Info = DOM.CurrentInfo;\nconst showLoad = Images.show.load.bind(null, 'top');\nconst processFiles = currify(_processFiles);\nconst noFilesCheck = () => {\n const {\n length\n } = DOM.getActiveFiles();\n const is = Boolean(!length);\n if (is) return Dialog.alert.noFiles();\n return is;\n};\nmodule.exports.init = promisify(callback => {\n showLoad();\n exec.series([DOM.loadSocket, async callback => {\n if (config('dropbox')) return callback();\n const {\n prefix,\n prefixSocket\n } = CloudCmd;\n await loadAll();\n await initOperations(prefix, prefixSocket, callback);\n }, callback => {\n Loaded = true;\n Images.hide();\n callback();\n }], callback);\n});\nfunction _authCheck(spawn, ok) {\n const accept = wraptile(ok);\n const alertDialog = wraptile(Dialog.alert);\n spawn.on('accept', accept(spawn));\n spawn.on('reject', alertDialog('Wrong credentials!'));\n spawn.emit('auth', config('username'), config('password'));\n}\nconst onConnect = currify((fn, operator) => {\n setOperations(operator);\n fn();\n});\nasync function initOperations(prefix, socketPrefix, fn) {\n socketPrefix = `${socketPrefix}/fileop`;\n const operator = await fileop({\n prefix,\n socketPrefix\n });\n operator.on('connect', authCheck(operator, onConnect(fn)));\n}\nfunction setOperations(operator) {\n packTarFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Tar';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.tar(from, to, names).then(listen);\n };\n packZipFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Zip';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.zip(from, to, names).then(listen);\n };\n deleteFn = (from, files, callback) => {\n from = removeQuery(from);\n const operation = 'Delete';\n const listen = setListeners({\n operation,\n callback,\n from\n });\n operator.remove(from, files).then(listen);\n };\n copyFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Copy';\n const listen = setListeners({\n operation,\n callback,\n from,\n to,\n names\n });\n operator.copy(from, to, names).then(listen);\n };\n moveFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Move';\n const listen = setListeners({\n operation,\n callback,\n from,\n to\n });\n operator.move(from, to, names).then(listen);\n };\n extractFn = ({\n from,\n to\n }, callback) => {\n const operation = 'Extract';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.extract(from, to).then(listen);\n };\n}\nfunction getPacker(type) {\n if (type === 'zip') return packZipFn;\n return packTarFn;\n}\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nmodule.exports.show = (operation, data) => {\n if (!Loaded) return;\n if (operation === 'copy') return Operation.copy(data);\n if (operation === 'move') return Operation.move(data);\n if (operation === 'delete') return Operation.delete();\n if (operation === 'delete:silent') return Operation.deleteSilent();\n if (operation === 'pack') return Operation.pack();\n if (operation === 'extract') return Operation.extract();\n};\nOperation.copy = processFiles({\n type: 'copy'\n});\nOperation.move = processFiles({\n type: 'move'\n});\nOperation.delete = promptDelete;\nOperation.deleteSilent = deleteSilent;\nOperation.pack = () => {\n const isZip = config('packer') === 'zip';\n twopack('pack', isZip ? 'zip' : 'tar');\n};\nOperation.extract = () => {\n twopack('extract');\n};\n\n/**\n * prompt and delete current file or selected files\n *\n * @currentFile\n */\nasync function promptDelete() {\n if (noFilesCheck()) return;\n const msgAsk = 'Do you really want to delete the ';\n const msgSel = 'selected ';\n const files = DOM.getActiveFiles();\n const names = DOM.getFilenames(files);\n const n = names.length;\n let msg;\n if (n) {\n let name = '';\n for (let i = 0; i < 5 && i < n; i++) name += '\\n' + names[i];\n if (n >= 5) name += '\\n...';\n msg = msgAsk + msgSel + n + ' files/directories?\\n' + encode(name);\n } else {\n const current = DOM.getCurrentFile();\n const isDir = DOM.isCurrentIsDir(current);\n const getType = isDir => isDir ? 'directory' : 'file';\n const type = getType(isDir) + ' ';\n const name = DOM.getCurrentName(current);\n msg = msgAsk + msgSel + type + name + '?';\n }\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n deleteSilent(files);\n}\n\n/**\n * delete current or selected files\n *\n * @files\n */\nfunction deleteSilent(files = DOM.getActiveFiles()) {\n const query = '?files';\n const path = Info.dirPath;\n if (noFilesCheck()) return;\n showLoad();\n const removedNames = DOM.getFilenames(files);\n const names = DOM.CurrentInfo.files.map(DOM.getCurrentName);\n const currentName = DOM.getCurrentName();\n const nextCurrentName = getNextCurrentName(currentName, names, removedNames);\n deleteFn(path + query, removedNames, async () => {\n await CloudCmd.refresh();\n const names = Info.files.map(DOM.getCurrentName);\n const isCurrent = names.includes(currentName);\n const name = isCurrent ? currentName : nextCurrentName;\n DOM.setCurrentByName(name);\n });\n}\n\n/*\n * process files (copy or move)\n * @param data\n * @param operation\n */\nasync function _processFiles(options, data) {\n let selFiles;\n let files;\n let panel;\n let shouldAsk;\n let ok;\n let from = '';\n let to = '';\n let names = [];\n if (data) {\n ({\n from,\n to,\n names\n } = data);\n ({\n panel\n } = Info);\n } else {\n from = Info.dirPath;\n to = DOM.getNotCurrentDirPath();\n selFiles = DOM.getSelectedFiles();\n names = DOM.getFilenames(selFiles);\n data = {};\n shouldAsk = true;\n panel = Info.panelPassive;\n }\n if (!names.length) names.push(DOM.getCurrentName());\n const [name] = names;\n const sameName = DOM.getCurrentByName(name, panel);\n if (!data && noFilesCheck()) return;\n const {\n type\n } = options;\n const isCopy = type === 'copy';\n const option = isCopy ? 'confirmCopy' : 'confirmMove';\n const title = isCopy ? 'Copy' : 'Rename/Move';\n const operation = isCopy ? copyFn : moveFn;\n if (shouldAsk && config(option)) {\n const [cancel, newTo] = await prompt(title, to, names.map(encode));\n if (!cancel) ask(newTo);\n return;\n }\n ask(to);\n function ask(to) {\n ok = from !== to && to;\n if (ok && !shouldAsk || !sameName) return go();\n const str = `\"${name}\" already exist. Overwrite?`;\n const cancel = false;\n Dialog.confirm(str, {\n cancel\n }).then(go);\n function go() {\n showLoad();\n files = {\n from,\n to,\n names\n };\n operation(files, async () => {\n await DOM.Storage.remove(from);\n const {\n panel,\n panelPassive\n } = Info;\n if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n });\n });\n }\n }\n}\nfunction checkEmpty(name, operation) {\n if (!operation) throw Error(`${name} could not be empty!`);\n}\nfunction twopack(operation, type) {\n let op;\n let fileFrom;\n let currentName = Info.name;\n const {\n path,\n dirPath\n } = Info;\n const activeFiles = DOM.getActiveFiles();\n const names = DOM.getFilenames(activeFiles);\n checkEmpty('operation', operation);\n if (!names.length) return Dialog.alert.noFiles();\n switch (operation) {\n case 'extract':\n op = extractFn;\n fileFrom = {\n from: path,\n to: dirPath\n };\n currentName = removeExtension(currentName);\n break;\n case 'pack':\n op = getPacker(type);\n if (names.length > 1) currentName = Info.dir;\n currentName += DOM.getPackerExt(type);\n fileFrom = {\n from: dirPath,\n to: dirPath + currentName,\n names\n };\n break;\n }\n showLoad();\n op(fileFrom, error => {\n !error && CloudCmd.refresh({\n currentName\n });\n });\n}\nasync function prompt(msg, to, names) {\n const n = names.length;\n const [name] = names;\n msg += ' ';\n if (names.length > 1) msg += `${n} file(s)`;else msg += `\"${name}\"`;\n msg += ' to';\n return await Dialog.prompt(msg, to);\n}\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n const file = `${prefix}/fileop/fileop.js`;\n const [error] = await tryToCatch(load.js, file);\n if (error) Dialog.alert(error.message);\n Loaded = true;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/index.js\n}");
|
|
579
|
+
eval("{/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global fileop */\n\n\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst removeExtension = __webpack_require__(/*! ./remove-extension */ \"./client/modules/operation/remove-extension.js\");\nconst setListeners = __webpack_require__(/*! ./set-listeners */ \"./client/modules/operation/set-listeners.js\");\nconst getNextCurrentName = __webpack_require__(/*! ./get-next-current-name */ \"./client/modules/operation/get-next-current-name.js\");\nconst removeQuery = a => a.replace(/\\?.*/, '');\nconst Name = 'Operation';\nCloudCmd[Name] = exports;\nconst {\n config\n} = CloudCmd;\nconst {\n Dialog,\n Images\n} = DOM;\nconst authCheck = wraptile(_authCheck);\nconst Operation = {};\nlet Loaded;\nlet copyFn;\nlet moveFn;\nlet deleteFn;\nlet extractFn;\nlet packZipFn;\nlet packTarFn;\nconst Info = DOM.CurrentInfo;\nconst showLoad = Images.show.load.bind(null, 'top');\nconst processFiles = currify(_processFiles);\nconst noFilesCheck = () => {\n const {\n length\n } = DOM.getActiveFiles();\n const is = Boolean(!length);\n if (is) return Dialog.alert.noFiles();\n return is;\n};\nmodule.exports.init = promisify(callback => {\n showLoad();\n exec.series([DOM.loadSocket, async callback => {\n if (config('dropbox')) return callback();\n const {\n prefix,\n prefixSocket\n } = CloudCmd;\n await loadAll();\n await initOperations(prefix, prefixSocket, callback);\n }, callback => {\n Loaded = true;\n Images.hide();\n callback();\n }], callback);\n});\nfunction _authCheck(spawn, ok) {\n const accept = wraptile(ok);\n const alertDialog = wraptile(Dialog.alert);\n spawn.on('accept', accept(spawn));\n spawn.on('reject', alertDialog('Wrong credentials!'));\n spawn.emit('auth', config('username'), config('password'));\n}\nconst onConnect = currify((fn, operator) => {\n setOperations(operator);\n fn();\n});\nasync function initOperations(prefix, socketPrefix, fn) {\n socketPrefix = `${socketPrefix}/fileop`;\n const operator = await fileop({\n prefix,\n socketPrefix\n });\n operator.on('connect', authCheck(operator, onConnect(fn)));\n}\nfunction setOperations(operator) {\n packTarFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Tar';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.tar(from, to, names).then(listen);\n };\n packZipFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Zip';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.zip(from, to, names).then(listen);\n };\n deleteFn = (from, files, callback) => {\n from = removeQuery(from);\n const operation = 'Delete';\n const listen = setListeners({\n operation,\n callback,\n from\n });\n operator.remove(from, files).then(listen);\n };\n copyFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Copy';\n const listen = setListeners({\n operation,\n callback,\n from,\n to,\n names\n });\n operator.copy(from, to, names).then(listen);\n };\n moveFn = ({\n from,\n to,\n names\n }, callback) => {\n const operation = 'Move';\n const listen = setListeners({\n operation,\n callback,\n from,\n to\n });\n operator.move(from, to, names).then(listen);\n };\n extractFn = ({\n from,\n to\n }, callback) => {\n const operation = 'Extract';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.extract(from, to).then(listen);\n };\n}\nfunction getPacker(type) {\n if (type === 'zip') return packZipFn;\n return packTarFn;\n}\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nmodule.exports.show = (operation, data) => {\n if (!Loaded) return;\n if (operation === 'copy') return Operation.copy(data);\n if (operation === 'move') return Operation.move(data);\n if (operation === 'delete') return Operation.delete();\n if (operation === 'delete:silent') return Operation.deleteSilent();\n if (operation === 'pack') return Operation.pack();\n if (operation === 'extract') return Operation.extract();\n};\nOperation.copy = processFiles({\n type: 'copy'\n});\nOperation.move = processFiles({\n type: 'move'\n});\nOperation.delete = promptDelete;\nOperation.deleteSilent = deleteSilent;\nOperation.pack = () => {\n const isZip = config('packer') === 'zip';\n twopack('pack', isZip ? 'zip' : 'tar');\n};\nOperation.extract = () => {\n twopack('extract');\n};\n\n/**\n * prompt and delete current file or selected files\n *\n * @currentFile\n */\nasync function promptDelete() {\n if (noFilesCheck()) return;\n const msgAsk = 'Do you really want to delete the ';\n const msgSel = 'selected ';\n const files = DOM.getActiveFiles();\n const names = DOM.getFilenames(files);\n const n = names.length;\n let msg;\n if (n) {\n let name = '';\n for (let i = 0; i < 5 && i < n; i++) name += '\\n' + names[i];\n if (n >= 5) name += '\\n...';\n msg = msgAsk + msgSel + n + ' files/directories?\\n' + encode(name);\n } else {\n const current = DOM.getCurrentFile();\n const isDir = DOM.isCurrentIsDir(current);\n const getType = isDir => isDir ? 'directory' : 'file';\n const type = getType(isDir) + ' ';\n const name = DOM.getCurrentName(current);\n msg = msgAsk + msgSel + type + name + '?';\n }\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n deleteSilent(files);\n}\n\n/**\n * delete current or selected files\n *\n * @files\n */\nfunction deleteSilent(files = DOM.getActiveFiles()) {\n const query = '?files';\n const path = Info.dirPath;\n if (noFilesCheck()) return;\n showLoad();\n const removedNames = DOM.getFilenames(files);\n const names = DOM.CurrentInfo.files.map(DOM.getCurrentName);\n const currentName = DOM.getCurrentName();\n const nextCurrentName = getNextCurrentName(currentName, names, removedNames);\n deleteFn(path + query, removedNames, async () => {\n await CloudCmd.refresh();\n const names = Info.files.map(DOM.getCurrentName);\n const isCurrent = names.includes(currentName);\n const name = isCurrent ? currentName : nextCurrentName;\n DOM.setCurrentByName(name);\n });\n}\n\n/*\n * process files (copy or move)\n * @param data\n * @param operation\n */\nasync function _processFiles(options, data) {\n let selFiles;\n let files;\n let panel;\n let shouldAsk;\n let ok;\n let from = '';\n let to = '';\n let names = [];\n if (data) {\n ({\n from,\n to,\n names\n } = data);\n ({\n panel\n } = Info);\n } else {\n from = Info.dirPath;\n to = DOM.getNotCurrentDirPath();\n selFiles = DOM.getSelectedFiles();\n names = DOM.getFilenames(selFiles);\n data = {};\n shouldAsk = true;\n panel = Info.panelPassive;\n }\n if (!names.length) names.push(DOM.getCurrentName());\n const [name] = names;\n const sameName = DOM.getCurrentByName(name, panel);\n if (!data && noFilesCheck()) return;\n const {\n type\n } = options;\n const isCopy = type === 'copy';\n const option = isCopy ? 'confirmCopy' : 'confirmMove';\n const title = isCopy ? 'Copy' : 'Rename/Move';\n const operation = isCopy ? copyFn : moveFn;\n if (shouldAsk && config(option)) {\n const [cancel, newTo] = await prompt(title, to, names.map(encode));\n if (!cancel) ask(newTo);\n return;\n }\n ask(to);\n function ask(to) {\n ok = from !== to && to;\n if (ok && !shouldAsk || !sameName) return go();\n const str = `\"${name}\" already exist. Overwrite?`;\n const cancel = false;\n Dialog.confirm(str, {\n cancel\n }).then(go);\n function go() {\n showLoad();\n files = {\n from,\n to,\n names\n };\n operation(files, async () => {\n await DOM.Storage.remove(from);\n const {\n panel,\n panelPassive\n } = Info;\n if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n });\n });\n }\n }\n}\nfunction checkEmpty(name, operation) {\n if (!operation) throw Error(`${name} could not be empty!`);\n}\nfunction twopack(operation, type) {\n let op;\n let fileFrom;\n let currentName = Info.name;\n const {\n path,\n dirPath\n } = Info;\n const activeFiles = DOM.getActiveFiles();\n const names = DOM.getFilenames(activeFiles);\n checkEmpty('operation', operation);\n if (!names.length) return Dialog.alert.noFiles();\n switch (operation) {\n case 'extract':\n op = extractFn;\n fileFrom = {\n from: path,\n to: dirPath\n };\n currentName = removeExtension(currentName);\n break;\n case 'pack':\n op = getPacker(type);\n if (names.length > 1) currentName = Info.dir;\n currentName += DOM.getPackerExt(type);\n fileFrom = {\n from: dirPath,\n to: dirPath + currentName,\n names\n };\n break;\n }\n showLoad();\n op(fileFrom, error => {\n !error && CloudCmd.refresh({\n currentName\n });\n });\n}\nasync function prompt(msg, to, names) {\n const n = names.length;\n const [name] = names;\n msg += ' ';\n if (names.length > 1) msg += `${n} file(s)`;else msg += `\"${name}\"`;\n msg += ' to';\n return await Dialog.prompt(msg, to);\n}\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n const file = `${prefix}/fileop/fileop.js`;\n const [error] = await tryToCatch(load.js, file);\n if (error) Dialog.alert(error.message);\n Loaded = true;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/index.js\n}");
|
|
580
580
|
|
|
581
|
-
/***/ }
|
|
581
|
+
/***/ },
|
|
582
582
|
|
|
583
|
-
/***/ "./client/modules/operation/remove-extension.js"
|
|
583
|
+
/***/ "./client/modules/operation/remove-extension.js"
|
|
584
584
|
/*!******************************************************!*\
|
|
585
585
|
!*** ./client/modules/operation/remove-extension.js ***!
|
|
586
586
|
\******************************************************/
|
|
587
|
-
|
|
587
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
588
588
|
|
|
589
589
|
"use strict";
|
|
590
|
-
eval("{\n\nconst {\n getExt\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nmodule.exports = name => {\n const ext = getExtension(name);\n return name.replace(ext, '');\n};\nfunction getExtension(name) {\n if (
|
|
590
|
+
eval("{\n\nconst {\n getExt\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nmodule.exports = name => {\n const ext = getExtension(name);\n return name.replace(ext, '');\n};\nfunction getExtension(name) {\n if (name.endsWith('.tar.gz')) return '.tar.gz';\n if (name.endsWith('.tar.bz2')) return '.tar.bz2';\n return getExt(name);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/remove-extension.js\n}");
|
|
591
591
|
|
|
592
|
-
/***/ }
|
|
592
|
+
/***/ },
|
|
593
593
|
|
|
594
|
-
/***/ "./client/modules/operation/set-listeners.js"
|
|
594
|
+
/***/ "./client/modules/operation/set-listeners.js"
|
|
595
595
|
/*!***************************************************!*\
|
|
596
596
|
!*** ./client/modules/operation/set-listeners.js ***!
|
|
597
597
|
\***************************************************/
|
|
598
|
-
|
|
598
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
599
599
|
|
|
600
600
|
"use strict";
|
|
601
601
|
eval("{\n\n/* global DOM */\nconst forEachKey = __webpack_require__(/*! for-each-key */ \"./node_modules/for-each-key/lib/for-each-key.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst format = __webpack_require__(/*! ./format */ \"./client/modules/operation/format.js\");\nconst {\n Dialog,\n Images\n} = DOM;\nmodule.exports = options => emitter => {\n const {\n operation,\n callback,\n noContinue,\n from,\n to\n } = options;\n let done;\n let lastError;\n const onAbort = wraptile(({\n emitter,\n operation\n }) => {\n emitter.abort();\n const msg = `${operation} aborted`;\n lastError = true;\n Dialog.alert(msg, {\n cancel: false\n });\n });\n const removeListener = emitter.removeListener.bind(emitter);\n const on = emitter.on.bind(emitter);\n const message = format(operation, from, to);\n const progress = Dialog.progress(message);\n progress.catch(onAbort({\n emitter,\n operation\n }));\n const listeners = {\n progress: value => {\n done = value === 100;\n progress.setProgress(value);\n },\n end: () => {\n Images.hide();\n forEachKey(removeListener, listeners);\n progress.remove();\n if (lastError || done) callback();\n },\n error: async error => {\n lastError = error;\n if (noContinue) {\n listeners.end(error);\n Dialog.alert(error);\n progress.remove();\n return;\n }\n const [cancel] = await Dialog.confirm(`${error}\n Continue?`);\n if (!done && !cancel) return emitter.continue();\n emitter.abort();\n progress.remove();\n }\n };\n forEachKey(on, listeners);\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/set-listeners.js\n}");
|
|
602
602
|
|
|
603
|
-
/***/ }
|
|
603
|
+
/***/ },
|
|
604
604
|
|
|
605
|
-
/***/ "./client/modules/polyfill.js"
|
|
605
|
+
/***/ "./client/modules/polyfill.js"
|
|
606
606
|
/*!************************************!*\
|
|
607
607
|
!*** ./client/modules/polyfill.js ***!
|
|
608
608
|
\************************************/
|
|
609
|
-
|
|
609
|
+
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
610
610
|
|
|
611
611
|
"use strict";
|
|
612
612
|
eval("{\n\n/* global DOM */\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\nconst scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/dist/index.cjs\");\nDOM.scrollIntoViewIfNeeded = el => scrollIntoViewIfNeeded(el, {\n block: 'nearest'\n});\n\n//# sourceURL=file://cloudcmd/client/modules/polyfill.js\n}");
|
|
613
613
|
|
|
614
|
-
/***/ }
|
|
614
|
+
/***/ },
|
|
615
615
|
|
|
616
|
-
/***/ "./client/modules/terminal-run.js"
|
|
616
|
+
/***/ "./client/modules/terminal-run.js"
|
|
617
617
|
/*!****************************************!*\
|
|
618
618
|
!*** ./client/modules/terminal-run.js ***!
|
|
619
619
|
\****************************************/
|
|
620
|
-
|
|
620
|
+
(module, exports, __webpack_require__) {
|
|
621
621
|
|
|
622
622
|
"use strict";
|
|
623
|
-
eval("{\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
623
|
+
eval("{\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify((options = {}, fn) => {\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: (/* exec.series args */\n ) => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n});\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal-run.js\n}");
|
|
624
624
|
|
|
625
|
-
/***/ }
|
|
625
|
+
/***/ },
|
|
626
626
|
|
|
627
|
-
/***/ "./client/modules/terminal.js"
|
|
627
|
+
/***/ "./client/modules/terminal.js"
|
|
628
628
|
/*!************************************!*\
|
|
629
629
|
!*** ./client/modules/terminal.js ***!
|
|
630
630
|
\************************************/
|
|
631
|
-
|
|
631
|
+
(module, exports, __webpack_require__) {
|
|
632
632
|
|
|
633
633
|
"use strict";
|
|
634
|
-
eval("{\n\n/* global CloudCmd */\n/* global gritty */\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
634
|
+
eval("{\n\n/* global CloudCmd */\n/* global gritty */\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst loadParallel = load.parallel;\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.Terminal = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(loadParallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n create();\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst getPrefix = () => CloudCmd.prefix + '/gritty';\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nconst getEnv = () => ({\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n});\nfunction create() {\n const options = {\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono'\n };\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(({\n domEvent\n }) => {\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (shiftKey && keyCode === Key.ESC) hide();\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction show() {\n if (!Loaded) return;\n if (!config('terminal')) return;\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n }\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal.js\n}");
|
|
635
635
|
|
|
636
|
-
/***/ }
|
|
636
|
+
/***/ },
|
|
637
637
|
|
|
638
|
-
/***/ "./client/modules/upload.js"
|
|
638
|
+
/***/ "./client/modules/upload.js"
|
|
639
639
|
/*!**********************************!*\
|
|
640
640
|
!*** ./client/modules/upload.js ***!
|
|
641
641
|
\**********************************/
|
|
642
|
-
|
|
642
|
+
(module, exports, __webpack_require__) {
|
|
643
643
|
|
|
644
644
|
"use strict";
|
|
645
645
|
eval("{/* global CloudCmd, DOM */\n\n\n\nCloudCmd.Upload = exports;\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Files = __webpack_require__(/*! ../dom/files */ \"./client/dom/files.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nasync function show() {\n Images.show.load('top');\n const innerHTML = await Files.get('upload');\n const autoSize = true;\n const el = createElement('div', {\n innerHTML\n });\n CloudCmd.View.show(el, {\n autoSize,\n afterShow\n });\n const fontFamily = ['\"Droid Sans Mono\"', '\"Ubuntu Mono\"', '\"Consolas\"', 'monospace'].join(', ');\n createElement('style', {\n dataName: 'upload-css',\n innerText: `[data-name=js-upload-file-button] {\n font-family: ${fontFamily};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`\n });\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nfunction afterShow() {\n const button = DOM.getByDataName('js-upload-file-button');\n Images.hide();\n DOM.Events.add('change', button, ({\n target\n }) => {\n const {\n files\n } = target;\n hide();\n uploadFiles(files);\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/upload.js\n}");
|
|
646
646
|
|
|
647
|
-
/***/ }
|
|
647
|
+
/***/ },
|
|
648
648
|
|
|
649
|
-
/***/ "./client/modules/user-menu/get-user-menu.js"
|
|
649
|
+
/***/ "./client/modules/user-menu/get-user-menu.js"
|
|
650
650
|
/*!***************************************************!*\
|
|
651
651
|
!*** ./client/modules/user-menu/get-user-menu.js ***!
|
|
652
652
|
\***************************************************/
|
|
653
|
-
|
|
653
|
+
(module) {
|
|
654
654
|
|
|
655
655
|
"use strict";
|
|
656
656
|
eval("{\n\nmodule.exports = menuFn => {\n const module = {};\n const fn = Function('module', menuFn);\n fn(module);\n return module.exports;\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/get-user-menu.js\n}");
|
|
657
657
|
|
|
658
|
-
/***/ }
|
|
658
|
+
/***/ },
|
|
659
659
|
|
|
660
|
-
/***/ "./client/modules/user-menu/index.js"
|
|
660
|
+
/***/ "./client/modules/user-menu/index.js"
|
|
661
661
|
/*!*******************************************!*\
|
|
662
662
|
!*** ./client/modules/user-menu/index.js ***!
|
|
663
663
|
\*******************************************/
|
|
664
|
-
|
|
664
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
665
665
|
|
|
666
666
|
"use strict";
|
|
667
|
-
eval("{\n\n/* global CloudCmd, DOM */\n__webpack_require__(/*! ../../../css/user-menu.css */ \"./css/user-menu.css\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.
|
|
667
|
+
eval("{\n\n/* global CloudCmd, DOM */\n__webpack_require__(/*! ../../../css/user-menu.css */ \"./css/user-menu.css\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n tryCatch\n} = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.cjs\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst {\n codeFrameColumns\n} = __webpack_require__(/*! @babel/code-frame */ \"./node_modules/@babel/code-frame/lib/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Dialog = __webpack_require__(/*! ../../dom/dialog */ \"./client/dom/dialog.js\");\nconst getUserMenu = __webpack_require__(/*! ./get-user-menu */ \"./client/modules/user-menu/get-user-menu.js\");\nconst navigate = __webpack_require__(/*! ./navigate */ \"./client/modules/user-menu/navigate.js\");\nconst parseError = __webpack_require__(/*! ./parse-error */ \"./client/modules/user-menu/parse-error.js\");\nconst parseUserMenu = __webpack_require__(/*! ./parse-user-menu */ \"./client/modules/user-menu/parse-user-menu.js\");\nconst {\n runSelected\n} = __webpack_require__(/*! ./run */ \"./client/modules/user-menu/run.js\");\nconst loadCSS = load.css;\nconst sourceStore = fullstore();\nconst Name = 'UserMenu';\nCloudCmd[Name] = module.exports;\nconst {\n Key\n} = CloudCmd;\nmodule.exports.init = async () => {\n await Promise.all([loadCSS(`${CloudCmd.prefix}/dist/user-menu.css`), CloudCmd.View()]);\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nconst {\n CurrentInfo\n} = DOM;\nasync function show() {\n Images.show.load('top');\n const {\n dirPath\n } = CurrentInfo;\n const res = await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${dirPath}`);\n const source = await res.text();\n const [error, userMenu] = tryCatch(getUserMenu, source);\n Images.hide();\n if (error) return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n sourceStore(source);\n const {\n names,\n keys,\n items,\n settings\n } = parseUserMenu(userMenu);\n if (settings.run) return runSelected(settings.select, items, runUserMenu);\n const button = createElement('button', {\n className: 'cloudcmd-user-menu-button',\n innerText: 'User Menu',\n notAppend: true\n });\n const select = createElement('select', {\n className: 'cloudcmd-user-menu',\n innerHTML: fillTemplate(names),\n notAppend: true,\n size: 10\n });\n button.addEventListener('click', onButtonClick(userMenu, select));\n select.addEventListener('dblclick', onDblClick(userMenu));\n select.addEventListener('keydown', onKeyDown({\n keys,\n userMenu\n }));\n const afterShow = () => select.focus();\n const autoSize = true;\n CloudCmd.View.show([button, select], {\n autoSize,\n afterShow\n });\n}\nfunction fillTemplate(options) {\n const result = [];\n for (const option of options) result.push(`<option>${option}</option>`);\n return result.join('');\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst onDblClick = currify(async (items, e) => {\n const {\n value\n } = e.target;\n await runUserMenu(items[value]);\n});\nconst onButtonClick = wraptile(async (items, {\n value\n}) => {\n await runUserMenu(items[value]);\n});\nconst onKeyDown = currify(async ({\n keys,\n userMenu\n}, e) => {\n const {\n keyCode,\n target\n } = e;\n const keyName = e.key.toUpperCase();\n e.preventDefault();\n e.stopPropagation();\n let value;\n if (keyCode === Key.ESC) return hide();\n if (keyCode === Key.ENTER) value = userMenu[target.value];else if (keys[keyName]) value = keys[keyName];else return navigate(target, e);\n await runUserMenu(value);\n});\nconst runUserMenu = async fn => {\n hide();\n const [error] = await tryToCatch(fn, {\n DOM,\n CloudCmd,\n tryToCatch\n });\n if (!error) return;\n const source = sourceStore();\n return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n};\nfunction getCodeFrame({\n error,\n source\n}) {\n const {\n code\n } = error;\n if (!code || code === 'frame') return error.message;\n const [line, column] = parseError(error);\n const start = {\n line,\n column\n };\n const location = {\n start\n };\n const frame = codeFrameColumns(source, location, {\n message: error.message,\n highlightCode: false\n });\n return `<pre>${frame}</pre>`;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/index.js\n}");
|
|
668
668
|
|
|
669
|
-
/***/ }
|
|
669
|
+
/***/ },
|
|
670
670
|
|
|
671
|
-
/***/ "./client/modules/user-menu/navigate.js"
|
|
671
|
+
/***/ "./client/modules/user-menu/navigate.js"
|
|
672
672
|
/*!**********************************************!*\
|
|
673
673
|
!*** ./client/modules/user-menu/navigate.js ***!
|
|
674
674
|
\**********************************************/
|
|
675
|
-
|
|
675
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
676
676
|
|
|
677
677
|
"use strict";
|
|
678
678
|
eval("{\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../key/key.js */ \"./client/key/key.js\");\nconst store = fullstore(1);\nconst isDigit = a => /^\\d+$/.test(a);\nmodule.exports = (el, {\n key,\n keyCode\n}) => {\n if (isDigit(key)) store(Number(key));\n if (keyCode === DOWN || keyCode === J) {\n const count = store();\n store(1);\n return down(el, count);\n }\n if (keyCode === UP || keyCode === K) {\n const count = store();\n store(1);\n return up(el, count);\n }\n};\nfunction down(el, count) {\n const {\n length\n } = el;\n if (el.selectedIndex === length - 1) el.selectedIndex = 0;else el.selectedIndex += count;\n if (el.selectedIndex < 0) el.selectedIndex = length - 1;\n}\nfunction up(el, count) {\n const {\n length\n } = el;\n if (!el.selectedIndex) el.selectedIndex = length - 1;else el.selectedIndex -= count;\n if (el.selectedIndex < 0) el.selectedIndex = 0;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/navigate.js\n}");
|
|
679
679
|
|
|
680
|
-
/***/ }
|
|
680
|
+
/***/ },
|
|
681
681
|
|
|
682
|
-
/***/ "./client/modules/user-menu/parse-error.js"
|
|
682
|
+
/***/ "./client/modules/user-menu/parse-error.js"
|
|
683
683
|
/*!*************************************************!*\
|
|
684
684
|
!*** ./client/modules/user-menu/parse-error.js ***!
|
|
685
685
|
\*************************************************/
|
|
686
|
-
|
|
686
|
+
(module) {
|
|
687
687
|
|
|
688
688
|
"use strict";
|
|
689
689
|
eval("{\n\nconst isNumber = a => typeof a === 'number';\nmodule.exports = error => {\n const {\n lineNumber,\n columnNumber\n } = error;\n\n // thank you firefox\n if (isNumber(lineNumber) && isNumber(columnNumber)) return [lineNumber, columnNumber];\n const before = error.stack.indexOf('>');\n const str = error.stack.slice(before + 1);\n const after = str.indexOf(')');\n const newStr = str.slice(1, after);\n const [line, column] = newStr.split(':');\n return [Number(line), Number(column)];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-error.js\n}");
|
|
690
690
|
|
|
691
|
-
/***/ }
|
|
691
|
+
/***/ },
|
|
692
692
|
|
|
693
|
-
/***/ "./client/modules/user-menu/parse-user-menu.js"
|
|
693
|
+
/***/ "./client/modules/user-menu/parse-user-menu.js"
|
|
694
694
|
/*!*****************************************************!*\
|
|
695
695
|
!*** ./client/modules/user-menu/parse-user-menu.js ***!
|
|
696
696
|
\*****************************************************/
|
|
697
|
-
|
|
697
|
+
(module) {
|
|
698
698
|
|
|
699
699
|
"use strict";
|
|
700
700
|
eval("{\n\nconst {\n entries,\n assign\n} = Object;\nmodule.exports = userMenu => {\n const names = [];\n const keys = {};\n const items = {};\n const settings = {};\n for (const [str, fn] of entries(userMenu)) {\n if (str === '__settings') {\n assign(settings, userMenu[str]);\n continue;\n }\n if (str.startsWith('_')) continue;\n names.push(str);\n const [key, name] = str.split(' - ');\n keys[key] = fn;\n items[name] = fn;\n }\n return {\n names,\n keys,\n items,\n settings\n };\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-user-menu.js\n}");
|
|
701
701
|
|
|
702
|
-
/***/ }
|
|
702
|
+
/***/ },
|
|
703
703
|
|
|
704
|
-
/***/ "./client/modules/user-menu/run.js"
|
|
704
|
+
/***/ "./client/modules/user-menu/run.js"
|
|
705
705
|
/*!*****************************************!*\
|
|
706
706
|
!*** ./client/modules/user-menu/run.js ***!
|
|
707
707
|
\*****************************************/
|
|
708
|
-
|
|
708
|
+
(module) {
|
|
709
709
|
|
|
710
710
|
"use strict";
|
|
711
711
|
eval("{\n\nmodule.exports.runSelected = async (selectedItems, items, runUserMenu) => {\n for (const selected of selectedItems) {\n await runUserMenu(items[selected]);\n }\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/run.js\n}");
|
|
712
712
|
|
|
713
|
-
/***/ }
|
|
713
|
+
/***/ },
|
|
714
714
|
|
|
715
|
-
/***/ "./client/modules/view/index.js"
|
|
715
|
+
/***/ "./client/modules/view/index.js"
|
|
716
716
|
/*!**************************************!*\
|
|
717
717
|
!*** ./client/modules/view/index.js ***!
|
|
718
718
|
\**************************************/
|
|
719
|
-
|
|
719
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
720
720
|
|
|
721
721
|
"use strict";
|
|
722
|
-
eval("{/* global CloudCmd, DOM */\n\n\n\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
722
|
+
eval("{/* global CloudCmd, DOM */\n\n\n\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst modal = __webpack_require__(/*! @cloudcmd/modal */ \"./node_modules/@cloudcmd/modal/lib/modal.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n time\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n isImage,\n isAudio,\n getType\n} = __webpack_require__(/*! ./types */ \"./client/modules/view/types.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst isString = a => typeof a === 'string';\nconst {\n assign\n} = Object;\nconst {\n isArray\n} = Array;\nconst lifo = currify((fn, el, cb, name) => fn(name, el, cb));\nconst series = wraptile((...a) => {\n for (const f of a) f();\n});\nconst isFn = a => typeof a === 'function';\nconst noop = () => {};\nconst addEvent = lifo(Events.add);\nconst loadCSS = load.css;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nlet Loading = false;\nconst Name = 'View';\nCloudCmd[Name] = module.exports;\nconst Info = DOM.CurrentInfo;\nconst {\n Key\n} = CloudCmd;\nconst basename = a => a.split('/').pop();\nlet El;\nlet TemplateAudio;\nlet Overlay;\nconst Config = {\n beforeShow: () => {\n Images.hide();\n Key.unsetBind();\n },\n beforeClose: () => {\n Events.rmKey(listener);\n Key.setBind();\n },\n afterShow: () => {\n El.focus();\n },\n onOverlayClick,\n afterClose: noop,\n autoSize: false,\n helpers: {\n title: {}\n }\n};\nmodule.exports._Config = Config;\nmodule.exports.init = async () => {\n await loadAll();\n const events = ['click', 'contextmenu'];\n events.forEach(addEvent(Overlay, onOverlayClick));\n};\nasync function show(data, options = {}) {\n const prefixURL = CloudCmd.prefixURL + FS;\n if (Loading) return;\n if (!options || options.bindKeys !== false) Events.addKey(listener);\n El = createElement('div', {\n className: 'view',\n notAppend: true\n });\n El.tabIndex = 0;\n if (data) {\n if (isArray(data)) El.append(...data);else El.append(data);\n modal.open(El, initConfig(options));\n return;\n }\n Images.show.load();\n const path = prefixURL + Info.path;\n const type = options.raw ? '' : await getType(path);\n switch (type) {\n default:\n return await viewFile();\n case 'markdown':\n return await CloudCmd.Markdown.show(Info.path);\n case 'html':\n return viewHtml(path);\n case 'image':\n return viewImage(Info.path, prefixURL);\n case 'media':\n return await viewMedia(path);\n case 'pdf':\n return viewPDF(path);\n }\n}\nmodule.exports._createIframe = createIframe;\nfunction createIframe(src) {\n const element = createElement('iframe', {\n src,\n width: '100%',\n height: '100%'\n });\n element.addEventListener('load', () => {\n element.contentWindow.addEventListener('keydown', listener);\n });\n return element;\n}\nmodule.exports._viewHtml = viewHtml;\nfunction viewHtml(src) {\n modal.open(createIframe(src), Config);\n}\nfunction viewPDF(src) {\n const element = createIframe(src);\n const options = assign({}, Config);\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n modal.open(element, options);\n}\nasync function viewMedia(path) {\n const [e, element] = await getMediaElement(path);\n if (e) return alert(e);\n const allConfig = {\n ...Config,\n ...{\n autoSize: true,\n afterShow: () => {\n element.querySelector('audio, video').focus();\n }\n }\n };\n modal.open(element, allConfig);\n}\nasync function viewFile() {\n const [error, data] = await Info.getData();\n if (error) return Images.hide();\n const element = document.createTextNode(data);\n const options = Config;\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n El.append(element);\n modal.open(El, options);\n}\nconst copy = a => assign({}, a);\nmodule.exports._initConfig = initConfig;\nfunction initConfig(options) {\n const config = copy(Config);\n if (!options) return config;\n const names = Object.keys(options);\n for (const name of names) {\n const isConfig = Boolean(config[name]);\n const item = options[name];\n if (!isFn(item) || !isConfig) {\n config[name] = options[name];\n continue;\n }\n const fn = config[name];\n config[name] = series(fn, item);\n }\n return config;\n}\nfunction hide() {\n modal.close();\n}\nfunction viewImage(path, prefixURL) {\n const isSupportedImage = a => isImage(a) || a === path;\n const makeTitle = path => ({\n href: `${prefixURL}${path}`,\n title: encode(basename(path))\n });\n const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);\n const titles = names.map(makeTitle);\n const index = names.indexOf(Info.path);\n const imageConfig = {\n index,\n autoSize: true,\n arrows: true,\n keys: true,\n helpers: {\n title: {}\n }\n };\n const config = {\n ...Config,\n ...imageConfig\n };\n modal.open(titles, config);\n}\nasync function getMediaElement(src) {\n check(src);\n const [error, template] = await tryToCatch(Files.get, 'view/media-tmpl');\n if (error) return [error];\n const {\n name\n } = Info;\n if (!TemplateAudio) TemplateAudio = template;\n const is = isAudio(name);\n const type = is ? 'audio' : 'video';\n const innerHTML = rendy(TemplateAudio, {\n src,\n type,\n name\n });\n const element = createElement('div', {\n innerHTML\n });\n return [null, element];\n}\nfunction check(src) {\n if (!isString(src)) throw Error('src should be a string!');\n}\nasync function loadAll() {\n const {\n DIR_DIST\n } = CloudCmd;\n time(`${Name} load`);\n Loading = true;\n await loadCSS(`${DIR_DIST}/view.css`);\n Loading = false;\n}\nfunction onOverlayClick(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n setCurrentByPosition(position);\n}\nfunction setCurrentByPosition(position) {\n const element = DOM.getCurrentByPosition(position);\n if (!element) return;\n const {\n files,\n filesPassive\n } = Info;\n const isFiles = files.includes(element);\n const isFilesPassive = filesPassive.includes(element);\n if (!isFiles && !isFilesPassive) return;\n const isCurrent = DOM.isCurrentFile(element);\n if (isCurrent) return;\n DOM.setCurrentFile(element);\n}\nfunction listener({\n keyCode\n}) {\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/index.js\n}");
|
|
723
723
|
|
|
724
|
-
/***/ }
|
|
724
|
+
/***/ },
|
|
725
725
|
|
|
726
|
-
/***/ "./client/modules/view/types.js"
|
|
726
|
+
/***/ "./client/modules/view/types.js"
|
|
727
727
|
/*!**************************************!*\
|
|
728
728
|
!*** ./client/modules/view/types.js ***!
|
|
729
729
|
\**************************************/
|
|
730
|
-
|
|
730
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
731
731
|
|
|
732
732
|
"use strict";
|
|
733
|
-
eval("{\n\nconst {\n extname\n} = __webpack_require__(/*! node:path */ \"./node_modules/path-browserify/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isAudio = name => /\\.(mp3|ogg|m4a)$/i.test(name);\nconst testRegExp = currify((name, reg) => reg.test(name));\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\nconst isPDF = a => /\\.pdf$/i.test(a);\nconst isHTML = a =>
|
|
733
|
+
eval("{\n\nconst {\n extname\n} = __webpack_require__(/*! node:path */ \"./node_modules/path-browserify/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isAudio = name => /\\.(mp3|ogg|m4a)$/i.test(name);\nconst testRegExp = currify((name, reg) => reg.test(name));\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\nconst isPDF = a => /\\.pdf$/i.test(a);\nconst isHTML = a => a.endsWith('.html');\nconst isMarkdown = a => /.\\.md$/.test(a);\nmodule.exports.getType = async path => {\n const ext = extname(path);\n if (!ext) path = await detectType(path);\n if (isPDF(path)) return 'pdf';\n if (isImage(path)) return 'image';\n if (isMedia(path)) return 'media';\n if (isHTML(path)) return 'html';\n if (isMarkdown(path)) return 'markdown';\n};\nmodule.exports.isImage = isImage;\nfunction isImage(name) {\n const images = ['jp(e|g|eg)', 'gif', 'png', 'bmp', 'webp', 'svg', 'ico'];\n return images.map(getRegExp).some(testRegExp(name));\n}\nfunction isMedia(name) {\n return isAudio(name) || isVideo(name);\n}\nmodule.exports.isAudio = isAudio;\nfunction isVideo(name) {\n return /\\.(mp4|avi|webm)$/i.test(name);\n}\nmodule.exports._detectType = detectType;\nasync function detectType(path) {\n const {\n headers\n } = await fetch(path, {\n method: 'HEAD'\n });\n for (const [name, value] of headers) {\n if (name === 'content-type') return `.${value.split('/').pop()}`;\n }\n return '';\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/types.js\n}");
|
|
734
734
|
|
|
735
|
-
/***/ }
|
|
735
|
+
/***/ },
|
|
736
736
|
|
|
737
|
-
/***/ "./client/sort.js"
|
|
737
|
+
/***/ "./client/sort.js"
|
|
738
738
|
/*!************************!*\
|
|
739
739
|
!*** ./client/sort.js ***!
|
|
740
740
|
\************************/
|
|
741
|
-
|
|
741
|
+
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
742
742
|
|
|
743
743
|
"use strict";
|
|
744
744
|
eval("{\n\n/* global CloudCmd */\nconst DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\nconst Info = DOM.CurrentInfo;\nconst {\n sort,\n order\n} = CloudCmd;\nconst position = DOM.getPanelPosition();\nlet sortPrevious = sort[position];\nconst {\n getPanel\n} = DOM;\nCloudCmd.sortPanel = (name, panel = getPanel()) => {\n const position = panel.dataset.name.replace('js-', '');\n if (name !== sortPrevious) order[position] = 'asc';else if (order[position] === 'asc') order[position] = 'desc';else order[position] = 'asc';\n sortPrevious = name;\n sort[position] = name;\n const noCurrent = position !== Info.panelPosition;\n CloudCmd.refresh({\n panel,\n noCurrent\n });\n};\n\n//# sourceURL=file://cloudcmd/client/sort.js\n}");
|
|
745
745
|
|
|
746
|
-
/***/ }
|
|
746
|
+
/***/ },
|
|
747
747
|
|
|
748
|
-
/***/ "./client/sw/register.js"
|
|
748
|
+
/***/ "./client/sw/register.js"
|
|
749
749
|
/*!*******************************!*\
|
|
750
750
|
!*** ./client/sw/register.js ***!
|
|
751
751
|
\*******************************/
|
|
752
|
-
|
|
752
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
753
753
|
|
|
754
754
|
"use strict";
|
|
755
|
-
eval("{\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
755
|
+
eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nmodule.exports.registerSW = registerSW;\nmodule.exports.unregisterSW = unregisterSW;\nmodule.exports.listenSW = (sw, ...args) => {\n sw === null || sw === void 0 || sw.addEventListener(...args);\n};\nasync function registerSW(prefix) {\n if (!navigator.serviceWorker) return;\n const isHTTPS = location.protocol === 'https:';\n const isLocalhost = location.hostname === 'localhost';\n if (!isHTTPS && !isLocalhost) return;\n const {\n serviceWorker\n } = navigator;\n const register = serviceWorker.register.bind(serviceWorker);\n const [e, sw] = await tryToCatch(register, `${prefix}/sw.js`);\n if (e) return null;\n return sw;\n}\nasync function unregisterSW(prefix) {\n const reg = await registerSW(prefix);\n reg === null || reg === void 0 || reg.unregister(prefix);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/register.js\n}");
|
|
756
756
|
|
|
757
|
-
/***/ }
|
|
757
|
+
/***/ },
|
|
758
758
|
|
|
759
|
-
/***/ "./common/base64.js"
|
|
759
|
+
/***/ "./common/base64.js"
|
|
760
760
|
/*!**************************!*\
|
|
761
761
|
!*** ./common/base64.js ***!
|
|
762
762
|
\**************************/
|
|
763
|
-
|
|
763
|
+
(module) {
|
|
764
764
|
|
|
765
765
|
"use strict";
|
|
766
766
|
eval("{\n\nmodule.exports.btoa = str => {\n if (typeof btoa === 'function') return btoa(str);\n return Buffer.from(str).toString('base64');\n};\nmodule.exports.atob = str => {\n if (typeof atob === 'function') return atob(str);\n return Buffer.from(str, 'base64').toString('binary');\n};\n\n//# sourceURL=file://cloudcmd/common/base64.js\n}");
|
|
767
767
|
|
|
768
|
-
/***/ }
|
|
768
|
+
/***/ },
|
|
769
769
|
|
|
770
|
-
/***/ "./common/cloudfunc.js"
|
|
770
|
+
/***/ "./common/cloudfunc.js"
|
|
771
771
|
/*!*****************************!*\
|
|
772
772
|
!*** ./common/cloudfunc.js ***!
|
|
773
773
|
\*****************************/
|
|
774
|
-
|
|
774
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
775
775
|
|
|
776
776
|
"use strict";
|
|
777
777
|
eval("{\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst store = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst {\n encode\n} = __webpack_require__(/*! ./entity */ \"./common/entity.js\");\nconst {\n btoa\n} = __webpack_require__(/*! ./base64 */ \"./common/base64.js\");\nconst getHeaderField = currify(_getHeaderField);\n\n/* КОНСТАНТЫ (общие для клиента и сервера)*/\n/* название программы */\nconst NAME = 'Cloud Commander';\nconst FS = '/fs';\nconst Path = store();\nPath('/');\nconst filterOutDotFiles = ({\n showDotFiles\n}) => ({\n name\n}) => {\n if (showDotFiles) return true;\n return !name.startsWith('.');\n};\nmodule.exports.FS = FS;\nmodule.exports.apiURL = '/api/v1';\nmodule.exports.MAX_FILE_SIZE = 500 * 1024;\nmodule.exports.getHeaderField = getHeaderField;\nmodule.exports.getPathLink = getPathLink;\nmodule.exports.getDotDot = getDotDot;\nmodule.exports.formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n if (name) name = `(\"${name}\")`;\n return `${msg}: ${status}${name}`;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nmodule.exports.getTitle = options => {\n options = options || {};\n const {\n path = Path(),\n name\n } = options;\n const array = [name || NAME, path];\n return array.filter(Boolean).join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url) throw Error('url could not be empty!');\n if (!template) throw Error('template could not be empty!');\n const names = url.split('/').slice(1, -1);\n const allNames = ['/', ...names];\n const lines = [];\n const n = allNames.length;\n let path = '/';\n for (let i = 0; i < n; i++) {\n const name = allNames[i];\n const isLast = i === n - 1;\n if (i) path += `${name}/`;\n if (i && isLast) {\n lines.push(`${name}/`);\n continue;\n }\n const slash = i ? '/' : '';\n lines.push(rendy(template, {\n path,\n name,\n slash,\n prefix\n }));\n }\n return lines.join('');\n}\nconst getDataName = name => {\n const encoded = btoa(encodeURI(name));\n return `data-name=\"js-file-${encoded}\" `;\n};\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nmodule.exports.buildFromJSON = params => {\n const {\n prefix,\n template,\n sort = 'name',\n order = 'asc',\n showDotFiles\n } = params;\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n const path = encode(json.path);\n const {\n files\n } = json;\n\n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n let fileTable = rendy(template.path, {\n link: prefix + FS + path,\n fullPath: path,\n path: htmlPath\n });\n const owner = 'owner';\n const mode = 'mode';\n const getFieldName = getHeaderField(sort, order);\n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n const header = rendy(templateFile, {\n tag: 'div',\n attribute: 'data-name=\"js-fm-header\" ',\n className: 'fm-header',\n type: '',\n name,\n size,\n date,\n owner,\n mode\n });\n\n /* сохраняем путь */\n Path(path);\n fileTable += `${header}<ul data-name=\"js-files\" class=\"files\">`;\n\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n const linkResult = rendy(template.link, {\n link,\n title: '..',\n name: '..'\n });\n const dataName = getDataName('..');\n const attribute = `draggable=\"true\" ${dataName}`;\n\n /* Сохраняем путь к каталогу верхнего уровня*/\n fileTable += rendy(template.file, {\n tag: 'li',\n attribute,\n className: '',\n type: 'directory',\n name: linkResult,\n size: '<dir>',\n date: '--.--.----',\n owner: '.',\n mode: '--- --- ---'\n });\n }\n fileTable += files.filter(filterOutDotFiles({\n showDotFiles\n })).map(updateField).map(file => {\n const name = encode(file.name);\n const link = prefix + FS + path + name;\n const {\n type,\n mode,\n date,\n owner,\n size\n } = file;\n const linkResult = rendy(templateLink, {\n link,\n title: name,\n name,\n attribute: getAttribute(file.type)\n });\n const dataName = getDataName(file.name);\n const attribute = `draggable=\"true\" ${dataName}`;\n return rendy(templateFile, {\n tag: 'li',\n attribute,\n className: '',\n type,\n name: linkResult,\n size,\n date,\n owner,\n mode\n });\n }).join('');\n fileTable += '</ul>';\n return fileTable;\n};\nconst updateField = file => ({\n ...file,\n date: file.date || '--.--.----',\n owner: file.owner || 'root',\n size: getSize(file)\n});\nfunction getAttribute(type) {\n if (type === 'directory') return '';\n return 'target=\"_blank\" ';\n}\nmodule.exports._getSize = getSize;\nfunction getSize({\n size,\n type\n}) {\n if (type === 'directory') return '<dir>';\n if (/link/.test(type)) return '<link>';\n return size;\n}\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n if (sort !== name) return name;\n if (sort === 'name' && order === 'asc') return name;\n return `${name}${arrow}`;\n}\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n if (!dotDot) return '/';\n return dotDot;\n}\n\n//# sourceURL=file://cloudcmd/common/cloudfunc.js\n}");
|
|
778
778
|
|
|
779
|
-
/***/ }
|
|
779
|
+
/***/ },
|
|
780
780
|
|
|
781
|
-
/***/ "./common/entity.js"
|
|
781
|
+
/***/ "./common/entity.js"
|
|
782
782
|
/*!**************************!*\
|
|
783
783
|
!*** ./common/entity.js ***!
|
|
784
784
|
\**************************/
|
|
785
|
-
|
|
785
|
+
(module) {
|
|
786
786
|
|
|
787
787
|
"use strict";
|
|
788
788
|
eval("{\n\nconst Entities = {\n // ' ': ' ',\n '<': '<',\n '>': '>',\n '"': '\"'\n};\nconst keys = Object.keys(Entities);\nmodule.exports.encode = str => {\n for (const code of keys) {\n const char = Entities[code];\n const reg = RegExp(char, 'g');\n str = str.replace(reg, code);\n }\n return str;\n};\nmodule.exports.decode = str => {\n for (const code of keys) {\n const char = Entities[code];\n const reg = RegExp(code, 'g');\n str = str.replace(reg, char);\n }\n return str;\n};\n\n//# sourceURL=file://cloudcmd/common/entity.js\n}");
|
|
789
789
|
|
|
790
|
-
/***/ }
|
|
790
|
+
/***/ },
|
|
791
791
|
|
|
792
|
-
/***/ "./common/try-to-promise-all.js"
|
|
792
|
+
/***/ "./common/try-to-promise-all.js"
|
|
793
793
|
/*!**************************************!*\
|
|
794
794
|
!*** ./common/try-to-promise-all.js ***!
|
|
795
795
|
\**************************************/
|
|
796
|
-
|
|
796
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
797
797
|
|
|
798
798
|
"use strict";
|
|
799
|
-
eval("{\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.
|
|
799
|
+
eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst all = Promise.all.bind(Promise);\nmodule.exports = async a => {\n const [e, result = []] = await tryToCatch(all, a);\n return [e, ...result];\n};\n\n//# sourceURL=file://cloudcmd/common/try-to-promise-all.js\n}");
|
|
800
800
|
|
|
801
|
-
/***/ }
|
|
801
|
+
/***/ },
|
|
802
802
|
|
|
803
|
-
/***/ "./common/util.js"
|
|
803
|
+
/***/ "./common/util.js"
|
|
804
804
|
/*!************************!*\
|
|
805
805
|
!*** ./common/util.js ***!
|
|
806
806
|
\************************/
|
|
807
|
-
|
|
807
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
808
808
|
|
|
809
809
|
"use strict";
|
|
810
810
|
eval("{\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst isString = a => typeof a === 'string';\nmodule.exports.escapeRegExp = str => {\n const isStr = isString(str);\n if (isStr) str = str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n return str;\n};\n\n/**\n * get regexp from wild card\n */\nmodule.exports.getRegExp = wildcard => {\n const escaped = `^${wildcard // search from start of line\n .replace(/\\./g, '\\\\.').replace(/\\*/g, '.*').replace('?', '.?')}$`;\n\n // search to end of line\n return RegExp(escaped);\n};\nmodule.exports.exec = exec;\n/**\n * function gets file extension\n *\n * @param name\n * @return ext\n */\nmodule.exports.getExt = name => {\n const isStr = isString(name);\n if (!isStr) return '';\n const dot = name.lastIndexOf('.');\n if (~dot) return name.substr(dot);\n return '';\n};\n\n/**\n * find object by name in arrray\n *\n * @param array\n * @param name\n */\nmodule.exports.findObjByNameInArr = (array, name) => {\n let ret;\n if (!Array.isArray(array)) throw Error('array should be array!');\n if (!isString(name)) throw Error('name should be string!');\n array.some(item => {\n const is = item.name === name;\n const isArray = Array.isArray(item);\n if (is) {\n ret = item;\n return is;\n }\n if (!isArray) return is;\n return item.some(item => {\n const is = item.name === name;\n if (is) ret = item.data;\n return is;\n });\n });\n return ret;\n};\n\n/**\n * start timer\n * @param name\n */\nmodule.exports.time = name => {\n exec.ifExist(console, 'time', [name]);\n};\n\n/**\n * stop timer\n * @param name\n */\nmodule.exports.timeEnd = name => {\n exec.ifExist(console, 'timeEnd', [name]);\n};\n\n//# sourceURL=file://cloudcmd/common/util.js\n}");
|
|
811
811
|
|
|
812
|
-
/***/ }
|
|
812
|
+
/***/ },
|
|
813
813
|
|
|
814
|
-
/***/ "./css/config.css"
|
|
814
|
+
/***/ "./css/config.css"
|
|
815
815
|
/*!************************!*\
|
|
816
816
|
!*** ./css/config.css ***!
|
|
817
817
|
\************************/
|
|
818
|
-
|
|
818
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
819
819
|
|
|
820
820
|
"use strict";
|
|
821
821
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/css/config.css\n}");
|
|
822
822
|
|
|
823
|
-
/***/ }
|
|
823
|
+
/***/ },
|
|
824
824
|
|
|
825
|
-
/***/ "./css/main.css"
|
|
825
|
+
/***/ "./css/main.css"
|
|
826
826
|
/*!**********************!*\
|
|
827
827
|
!*** ./css/main.css ***!
|
|
828
828
|
\**********************/
|
|
829
|
-
|
|
829
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
830
830
|
|
|
831
831
|
"use strict";
|
|
832
832
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/css/main.css\n}");
|
|
833
833
|
|
|
834
|
-
/***/ }
|
|
834
|
+
/***/ },
|
|
835
835
|
|
|
836
|
-
/***/ "./css/terminal.css"
|
|
836
|
+
/***/ "./css/terminal.css"
|
|
837
837
|
/*!**************************!*\
|
|
838
838
|
!*** ./css/terminal.css ***!
|
|
839
839
|
\**************************/
|
|
840
|
-
|
|
840
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
841
841
|
|
|
842
842
|
"use strict";
|
|
843
843
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/css/terminal.css\n}");
|
|
844
844
|
|
|
845
|
-
/***/ }
|
|
845
|
+
/***/ },
|
|
846
846
|
|
|
847
|
-
/***/ "./css/user-menu.css"
|
|
847
|
+
/***/ "./css/user-menu.css"
|
|
848
848
|
/*!***************************!*\
|
|
849
849
|
!*** ./css/user-menu.css ***!
|
|
850
850
|
\***************************/
|
|
851
|
-
|
|
851
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
852
852
|
|
|
853
853
|
"use strict";
|
|
854
854
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/css/user-menu.css\n}");
|
|
855
855
|
|
|
856
|
-
/***/ }
|
|
856
|
+
/***/ },
|
|
857
857
|
|
|
858
|
-
/***/ "./css/view.css"
|
|
858
|
+
/***/ "./css/view.css"
|
|
859
859
|
/*!**********************!*\
|
|
860
860
|
!*** ./css/view.css ***!
|
|
861
861
|
\**********************/
|
|
862
|
-
|
|
862
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
863
863
|
|
|
864
864
|
"use strict";
|
|
865
865
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/css/view.css\n}");
|
|
866
866
|
|
|
867
|
-
/***/ }
|
|
867
|
+
/***/ },
|
|
868
868
|
|
|
869
|
-
/***/ "./node_modules/@babel/code-frame/lib/index.js"
|
|
869
|
+
/***/ "./node_modules/@babel/code-frame/lib/index.js"
|
|
870
870
|
/*!*****************************************************!*\
|
|
871
871
|
!*** ./node_modules/@babel/code-frame/lib/index.js ***!
|
|
872
872
|
\*****************************************************/
|
|
873
|
-
|
|
873
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
874
874
|
|
|
875
875
|
"use strict";
|
|
876
876
|
eval("{\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;\n{\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n const getTokenType = function (token, offset, text) {\n if (token.type === \"name\") {\n if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {\n return \"keyword\";\n }\n if (JSX_TAG.test(token.value) && (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")) {\n return \"jsxIdentifier\";\n }\n if (token.value[0] !== token.value[0].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 };\n tokenize = 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 };\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/node_modules/@babel/code-frame/lib/index.js\n}");
|
|
877
877
|
|
|
878
|
-
/***/ }
|
|
878
|
+
/***/ },
|
|
879
879
|
|
|
880
|
-
/***/ "./node_modules/@babel/helper-validator-identifier/lib/identifier.js"
|
|
880
|
+
/***/ "./node_modules/@babel/helper-validator-identifier/lib/identifier.js"
|
|
881
881
|
/*!***************************************************************************!*\
|
|
882
882
|
!*** ./node_modules/@babel/helper-validator-identifier/lib/identifier.js ***!
|
|
883
883
|
\***************************************************************************/
|
|
884
|
-
|
|
884
|
+
(__unused_webpack_module, exports) {
|
|
885
885
|
|
|
886
886
|
"use strict";
|
|
887
887
|
eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nexports.isIdentifierStart = isIdentifierStart;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\nfunction isIdentifierName(name) {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n\n//# sourceMappingURL=identifier.js.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/helper-validator-identifier/lib/identifier.js\n}");
|
|
888
888
|
|
|
889
|
-
/***/ }
|
|
889
|
+
/***/ },
|
|
890
890
|
|
|
891
|
-
/***/ "./node_modules/@babel/helper-validator-identifier/lib/index.js"
|
|
891
|
+
/***/ "./node_modules/@babel/helper-validator-identifier/lib/index.js"
|
|
892
892
|
/*!**********************************************************************!*\
|
|
893
893
|
!*** ./node_modules/@babel/helper-validator-identifier/lib/index.js ***!
|
|
894
894
|
\**********************************************************************/
|
|
895
|
-
|
|
895
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
896
896
|
|
|
897
897
|
"use strict";
|
|
898
898
|
eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"isIdentifierChar\", ({\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n}));\nObject.defineProperty(exports, \"isIdentifierName\", ({\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n}));\nObject.defineProperty(exports, \"isIdentifierStart\", ({\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n}));\nObject.defineProperty(exports, \"isKeyword\", ({\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n}));\nObject.defineProperty(exports, \"isReservedWord\", ({\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n}));\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", ({\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n}));\nObject.defineProperty(exports, \"isStrictBindReservedWord\", ({\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n}));\nObject.defineProperty(exports, \"isStrictReservedWord\", ({\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n}));\nvar _identifier = __webpack_require__(/*! ./identifier.js */ \"./node_modules/@babel/helper-validator-identifier/lib/identifier.js\");\nvar _keyword = __webpack_require__(/*! ./keyword.js */ \"./node_modules/@babel/helper-validator-identifier/lib/keyword.js\");\n\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/helper-validator-identifier/lib/index.js\n}");
|
|
899
899
|
|
|
900
|
-
/***/ }
|
|
900
|
+
/***/ },
|
|
901
901
|
|
|
902
|
-
/***/ "./node_modules/@babel/helper-validator-identifier/lib/keyword.js"
|
|
902
|
+
/***/ "./node_modules/@babel/helper-validator-identifier/lib/keyword.js"
|
|
903
903
|
/*!************************************************************************!*\
|
|
904
904
|
!*** ./node_modules/@babel/helper-validator-identifier/lib/keyword.js ***!
|
|
905
905
|
\************************************************************************/
|
|
906
|
-
|
|
906
|
+
(__unused_webpack_module, exports) {
|
|
907
907
|
|
|
908
908
|
"use strict";
|
|
909
909
|
eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isKeyword = isKeyword;\nexports.isReservedWord = isReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\nfunction isKeyword(word) {\n return keywords.has(word);\n}\n\n//# sourceMappingURL=keyword.js.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/helper-validator-identifier/lib/keyword.js\n}");
|
|
910
910
|
|
|
911
|
-
/***/ }
|
|
911
|
+
/***/ },
|
|
912
912
|
|
|
913
|
-
/***/ "./node_modules/@cloudcmd/clipboard/lib/clipboard.js"
|
|
913
|
+
/***/ "./node_modules/@cloudcmd/clipboard/lib/clipboard.js"
|
|
914
914
|
/*!***********************************************************!*\
|
|
915
915
|
!*** ./node_modules/@cloudcmd/clipboard/lib/clipboard.js ***!
|
|
916
916
|
\***********************************************************/
|
|
917
|
-
|
|
917
|
+
(module) {
|
|
918
918
|
|
|
919
919
|
"use strict";
|
|
920
920
|
eval("{\n\nmodule.exports = navigator.clipboard || {\n readText,\n writeText,\n};\n\nfunction readText() {\n return Promise.reject();\n}\n\nasync function writeText(value) {\n const el = document.createElement('textarea');\n \n el.value = value;\n \n document.body.appendChild(el);\n el.select();\n \n const is = document.execCommand('copy');\n document.body.removeChild(el);\n \n if (is)\n return;\n \n return Promise.reject();\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/clipboard/lib/clipboard.js\n}");
|
|
921
921
|
|
|
922
|
-
/***/ }
|
|
922
|
+
/***/ },
|
|
923
923
|
|
|
924
|
-
/***/ "./node_modules/@cloudcmd/create-element/lib/create-element.js"
|
|
924
|
+
/***/ "./node_modules/@cloudcmd/create-element/lib/create-element.js"
|
|
925
925
|
/*!*********************************************************************!*\
|
|
926
926
|
!*** ./node_modules/@cloudcmd/create-element/lib/create-element.js ***!
|
|
927
927
|
\*********************************************************************/
|
|
928
|
-
|
|
928
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
929
929
|
|
|
930
930
|
"use strict";
|
|
931
931
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst query = (a) => document.querySelector(`[data-name=\"${a}\"]`);\n\nconst setAttribute = currify((el, obj, name) => el.setAttribute(name, obj[name]));\nconst set = currify((el, obj, name) => el[name] = obj[name]);\nconst not = currify((f, a) => !f(a));\nconst isCamelCase = (a) => a != a.toLowerCase();\n\nmodule.exports = (name, options = {}) => {\n const {\n dataName,\n notAppend,\n parent = document.body,\n uniq = true,\n ...restOptions\n } = options;\n \n const elFound = isElementPresent(dataName);\n \n if (uniq && elFound)\n return elFound;\n \n const el = document.createElement(name);\n \n if (dataName)\n el.dataset.name = dataName;\n \n Object.keys(restOptions)\n .filter(isCamelCase)\n .map(set(el, options));\n \n Object.keys(restOptions)\n .filter(not(isCamelCase))\n .map(setAttribute(el, options));\n \n if (!notAppend)\n parent.appendChild(el);\n \n return el;\n};\n\nmodule.exports.isElementPresent = isElementPresent;\n\nfunction isElementPresent(dataName) {\n if (!dataName)\n return;\n \n return query(dataName);\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/create-element/lib/create-element.js\n}");
|
|
932
932
|
|
|
933
|
-
/***/ }
|
|
933
|
+
/***/ },
|
|
934
934
|
|
|
935
|
-
/***/ "./node_modules/@cloudcmd/modal/css/modal.css"
|
|
935
|
+
/***/ "./node_modules/@cloudcmd/modal/css/modal.css"
|
|
936
936
|
/*!****************************************************!*\
|
|
937
937
|
!*** ./node_modules/@cloudcmd/modal/css/modal.css ***!
|
|
938
938
|
\****************************************************/
|
|
939
|
-
|
|
939
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
940
940
|
|
|
941
941
|
"use strict";
|
|
942
942
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/css/modal.css\n}");
|
|
943
943
|
|
|
944
|
-
/***/ }
|
|
944
|
+
/***/ },
|
|
945
945
|
|
|
946
|
-
/***/ "./node_modules/@cloudcmd/modal/lib/get-class-name.js"
|
|
946
|
+
/***/ "./node_modules/@cloudcmd/modal/lib/get-class-name.js"
|
|
947
947
|
/*!************************************************************!*\
|
|
948
948
|
!*** ./node_modules/@cloudcmd/modal/lib/get-class-name.js ***!
|
|
949
949
|
\************************************************************/
|
|
950
|
-
|
|
950
|
+
(module) {
|
|
951
951
|
|
|
952
952
|
"use strict";
|
|
953
953
|
eval("{\n\nmodule.exports = ({autoSize, isTitle}) => {\n const classNames = [\n 'modal-main',\n ];\n \n if (autoSize)\n classNames.push('modal-autosize');\n \n if (isTitle)\n classNames.push('modal-is-title');\n \n return classNames.join(' ');\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/lib/get-class-name.js\n}");
|
|
954
954
|
|
|
955
|
-
/***/ }
|
|
955
|
+
/***/ },
|
|
956
956
|
|
|
957
|
-
/***/ "./node_modules/@cloudcmd/modal/lib/modal.js"
|
|
957
|
+
/***/ "./node_modules/@cloudcmd/modal/lib/modal.js"
|
|
958
958
|
/*!***************************************************!*\
|
|
959
959
|
!*** ./node_modules/@cloudcmd/modal/lib/modal.js ***!
|
|
960
960
|
\***************************************************/
|
|
961
|
-
|
|
961
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
962
962
|
|
|
963
963
|
"use strict";
|
|
964
964
|
eval("{\n\nconst store = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\n__webpack_require__(/*! ../css/modal.css */ \"./node_modules/@cloudcmd/modal/css/modal.css\");\nconst parseImages = __webpack_require__(/*! ./parse-images */ \"./node_modules/@cloudcmd/modal/lib/parse-images.js\");\nconst showTitle = __webpack_require__(/*! ./show-title */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\nconst query = __webpack_require__(/*! ./query */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\nconst getClassName = __webpack_require__(/*! ./get-class-name */ \"./node_modules/@cloudcmd/modal/lib/get-class-name.js\");\n\nconst noop = () => {};\n\nconst optionsStore = store({});\n\nconst innerHTML = `\n <div class=\"modal-child\" data-name=\"modal-child\">\n <div class=\"modal-close\" data-name=\"modal-close\"></div>\n </div>\n`;\n\nconst addEvent = currify((el, fn, name) => query(el).addEventListener(name, fn));\nconst addAllEvents = (el, fn, names) => names.map(addEvent(el, fn));\n\nconst {isArray} = Array;\n\nmodule.exports.open = (inner, options = {}) => {\n check(inner);\n \n if (query('main'))\n return;\n \n const {\n beforeShow = noop,\n beforeClose = noop,\n afterShow = noop,\n afterClose = noop,\n onOverlayClick = noop,\n autoSize = false,\n index = 0,\n helpers = {},\n title = '',\n } = options;\n \n optionsStore({\n beforeClose,\n afterClose,\n });\n \n beforeShow();\n \n const isImage = isArray(inner);\n const isTitle = helpers.title && title || isImage;\n \n const className = getClassName({autoSize, isTitle});\n \n const el = createElement('div', {\n innerHTML,\n className,\n dataName: 'modal-main',\n });\n \n addAllEvents('main', onMainClick(onOverlayClick), [\n 'click',\n 'contextmenu',\n ]);\n \n query('close').addEventListener('click', close);\n \n const child = query('child');\n \n if (isImage)\n return parseImages(child, inner, {\n index,\n afterShow,\n helpers,\n });\n \n child.appendChild(inner);\n \n if (isTitle)\n showTitle(title, child);\n \n afterShow();\n \n return el;\n};\n\nconst onMainClick = currify((overlayClick, event) => {\n if (event.target !== query('main'))\n return;\n \n close(event);\n overlayClick(event);\n});\n\nconst close = (event) => {\n if (event)\n event.stopPropagation();\n \n const el = query('main');\n \n const {\n beforeClose = noop,\n afterClose = noop,\n } = optionsStore();\n \n if (!el)\n return;\n \n beforeClose();\n \n document.body.removeChild(el);\n \n afterClose();\n};\n\nmodule.exports.close = close;\n\nmodule.exports._optionsStore = optionsStore;\nmodule.exports._onMainClick = onMainClick;\n\nfunction check(inner) {\n if (!inner)\n throw Error('inner should be DOM-element!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/lib/modal.js\n}");
|
|
965
965
|
|
|
966
|
-
/***/ }
|
|
966
|
+
/***/ },
|
|
967
967
|
|
|
968
|
-
/***/ "./node_modules/@cloudcmd/modal/lib/parse-images.js"
|
|
968
|
+
/***/ "./node_modules/@cloudcmd/modal/lib/parse-images.js"
|
|
969
969
|
/*!**********************************************************!*\
|
|
970
970
|
!*** ./node_modules/@cloudcmd/modal/lib/parse-images.js ***!
|
|
971
971
|
\**********************************************************/
|
|
972
|
-
|
|
972
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
973
973
|
|
|
974
974
|
"use strict";
|
|
975
975
|
eval("{\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst store = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst showTitle = __webpack_require__(/*! ./show-title */ \"./node_modules/@cloudcmd/modal/lib/show-title.js\");\nconst query = __webpack_require__(/*! ./query */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n\nconst indexStore = store();\nconst helpersStore = store();\n\nconst next = wraptile((img, images) => setImage(indexStore() + 1, img, images));\nconst prev = wraptile((img, images) => setImage(indexStore() - 1, img, images));\n\nconst onload = wraptile((parent, afterShow) => {\n parent.hidden = false;\n afterShow();\n});\n\nconst onKeydown = (img, images) => function keydownListener(e) {\n let i = indexStore();\n \n const ArrowLeft = 37;\n const ArrowRight = 39;\n const Esc = 27;\n \n const {keyCode} = e;\n \n if (keyCode === ArrowLeft)\n --i;\n else if (keyCode === ArrowRight)\n ++i;\n else {\n if (keyCode === Esc)\n return document.body.removeEventListener('keydown', keydownListener);\n \n return;\n }\n \n setImage(i, img, images);\n};\n\nfunction setImage(i, img, images) {\n const n = images.length - 1;\n \n if (i < 0 || i > n)\n return;\n \n indexStore(i);\n \n query('nav-left').hidden = !i;\n query('nav-right').hidden = i === n;\n \n const {\n href,\n title,\n } = images[i];\n \n img.src = href;\n img.title = title;\n img.href = title;\n img.alt = title;\n \n if (helpersStore().title)\n showTitle(title, query('child'));\n}\n\nmodule.exports = parseImages;\n\nfunction parseImages(parent, images, {afterShow, helpers, index}) {\n indexStore(index);\n helpersStore(helpers);\n \n const img = createImage();\n parent.appendChild(img);\n \n parent.hidden = true;\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-left',\n dataName: 'modal-nav-left',\n innerHTML: '<span></span>',\n }));\n \n parent.appendChild(createElement('div', {\n className: 'modal-nav modal-nav-right',\n dataName: 'modal-nav-right',\n innerHTML: '<span data-name=\"modal-next\"></span>',\n }));\n \n setImage(index, img, images);\n addListenerOnce(img, 'load', onload(parent, afterShow));\n \n query('nav-left')\n .addEventListener('click', prev(img, images));\n \n query('nav-right')\n .addEventListener('click', next(img, images));\n \n document.body.addEventListener('keydown', onKeydown(img, images));\n}\n\nfunction createImage() {\n const el = document.createElement('img');\n \n el.className = 'modal-image';\n \n return el;\n}\n\nmodule.exports._rmListener = rmListener;\nfunction rmListener(el, name, fn) {\n return function f(e) {\n fn(e);\n el.removeEventListener(name, f);\n };\n}\n\nmodule.exports._addListenerOnce = addListenerOnce;\nfunction addListenerOnce(el, name, fn) {\n el.addEventListener(name, rmListener(el, name, fn));\n}\n\nmodule.exports._onKeydown = onKeydown;\nmodule.exports._indexStore = indexStore;\nmodule.exports._helpersStore = helpersStore;\nmodule.exports._onload = onload;\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/lib/parse-images.js\n}");
|
|
976
976
|
|
|
977
|
-
/***/ }
|
|
977
|
+
/***/ },
|
|
978
978
|
|
|
979
|
-
/***/ "./node_modules/@cloudcmd/modal/lib/query.js"
|
|
979
|
+
/***/ "./node_modules/@cloudcmd/modal/lib/query.js"
|
|
980
980
|
/*!***************************************************!*\
|
|
981
981
|
!*** ./node_modules/@cloudcmd/modal/lib/query.js ***!
|
|
982
982
|
\***************************************************/
|
|
983
|
-
|
|
983
|
+
(module) {
|
|
984
984
|
|
|
985
985
|
"use strict";
|
|
986
986
|
eval("{\n\nmodule.exports = (a) => document.querySelector(`[data-name=\"modal-${a}\"]`);\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/lib/query.js\n}");
|
|
987
987
|
|
|
988
|
-
/***/ }
|
|
988
|
+
/***/ },
|
|
989
989
|
|
|
990
|
-
/***/ "./node_modules/@cloudcmd/modal/lib/show-title.js"
|
|
990
|
+
/***/ "./node_modules/@cloudcmd/modal/lib/show-title.js"
|
|
991
991
|
/*!********************************************************!*\
|
|
992
992
|
!*** ./node_modules/@cloudcmd/modal/lib/show-title.js ***!
|
|
993
993
|
\********************************************************/
|
|
994
|
-
|
|
994
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
995
995
|
|
|
996
996
|
"use strict";
|
|
997
997
|
eval("{\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst query = __webpack_require__(/*! ./query */ \"./node_modules/@cloudcmd/modal/lib/query.js\");\n\nmodule.exports = (title, parent) => {\n const titleEl = query('title');\n \n if (titleEl) {\n query('title-text').textContent = title;\n return;\n }\n \n const el = createElement('div', {\n className: 'modal-title',\n dataName: 'modal-title',\n parent,\n });\n \n createElement('span', {\n parent: el,\n textContent: title,\n className: 'modal-title-text',\n dataName: 'modal-title-text',\n });\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/modal/lib/show-title.js\n}");
|
|
998
998
|
|
|
999
|
-
/***/ }
|
|
999
|
+
/***/ },
|
|
1000
1000
|
|
|
1001
|
-
/***/ "./node_modules/@cloudcmd/olark/index.js"
|
|
1001
|
+
/***/ "./node_modules/@cloudcmd/olark/index.js"
|
|
1002
1002
|
/*!***********************************************!*\
|
|
1003
1003
|
!*** ./node_modules/@cloudcmd/olark/index.js ***!
|
|
1004
1004
|
\***********************************************/
|
|
1005
|
-
|
|
1005
|
+
(module) {
|
|
1006
1006
|
|
|
1007
1007
|
"use strict";
|
|
1008
1008
|
eval("{\n\nconst identityLoginURL = 'static.olark.com/jsclient/loader.js';\n\nif (!window.olark) {\n const el = document.createElement('script');\n const [script] = document.getElementsByTagName('script');\n el.async = 1;\n el.src = '//' + identityLoginURL;\n script.parentNode.insertBefore(el, script);\n \n const olark = window.olark = (...args) => {\n k.s.push(args);\n k.t.push(Number(new Date));\n };\n /**\n * @param {?} i\n * @param {?} src\n * @return {undefined}\n */\n olark.extend = (i, src) => {\n olark('extend', i, src);\n };\n /**\n * @param {string} o\n * @return {undefined}\n */\n olark.identify = (o) => {\n olark('identify', k.i = o);\n };\n /**\n * @param {?} key\n * @param {?} callback\n * @return {undefined}\n */\n olark.configure = (key, callback) => {\n olark('configure', key, callback);\n k.c[key] = callback;\n };\n const k = olark._ = {\n s: [],\n t: [Number(new Date)],\n c: {},\n l: identityLoginURL,\n };\n}\n\nmodule.exports = window.olark;\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/@cloudcmd/olark/index.js\n}");
|
|
1009
1009
|
|
|
1010
|
-
/***/ }
|
|
1010
|
+
/***/ },
|
|
1011
1011
|
|
|
1012
|
-
/***/ "./node_modules/apart/lib/apart.js"
|
|
1012
|
+
/***/ "./node_modules/apart/lib/apart.js"
|
|
1013
1013
|
/*!*****************************************!*\
|
|
1014
1014
|
!*** ./node_modules/apart/lib/apart.js ***!
|
|
1015
1015
|
\*****************************************/
|
|
1016
|
-
|
|
1016
|
+
(module) {
|
|
1017
1017
|
|
|
1018
1018
|
"use strict";
|
|
1019
1019
|
eval("{\n\nmodule.exports = (fn, ...a) => {\n check(fn);\n \n return (...b) => {\n const args = [\n ...a,\n ...b,\n ];\n \n return fn(...args);\n };\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/apart/lib/apart.js\n}");
|
|
1020
1020
|
|
|
1021
|
-
/***/ }
|
|
1021
|
+
/***/ },
|
|
1022
1022
|
|
|
1023
|
-
/***/ "./node_modules/compute-scroll-into-view/dist/index.cjs"
|
|
1023
|
+
/***/ "./node_modules/compute-scroll-into-view/dist/index.cjs"
|
|
1024
1024
|
/*!**************************************************************!*\
|
|
1025
1025
|
!*** ./node_modules/compute-scroll-into-view/dist/index.cjs ***!
|
|
1026
1026
|
\**************************************************************/
|
|
1027
|
-
|
|
1027
|
+
(__unused_webpack_module, exports) {
|
|
1028
1028
|
|
|
1029
1029
|
"use strict";
|
|
1030
1030
|
eval("{Object.defineProperty(exports, \"__esModule\", ({value:!0}));const t=t=>\"object\"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||\"hidden\"!==t)&&(\"visible\"!==t&&\"clip\"!==t),o=(t,o)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return e(n.overflowY,o)||e(n.overflowX,o)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},n=(t,e,o,n,l,r,i,s)=>r<t&&i>e||r>t&&i<e?0:r<=t&&s<=o||i>=e&&s>=o?r-t-n:i>e&&s<o||r<t&&s>o?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e};exports.compute=(e,r)=>{var i,s,d,c;if(\"undefined\"==typeof document)return[];const{scrollMode:h,block:u,inline:f,boundary:a,skipOverflowHiddenElements:g}=r,p=\"function\"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError(\"Invalid target\");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&o(W)&&!o(document.documentElement)||null!=W&&o(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(c=null==(d=window.visualViewport)?void 0:d.height)?c:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=\"start\"===u||\"nearest\"===u?x-T:\"end\"===u?I+F:x+v/2-T+F,D=\"center\"===f?R+E/2-V+B:\"end\"===f?C+B:R-V;const L=[];for(let t=0;t<w.length;t++){const e=w[t],{height:l,width:r,top:i,right:s,bottom:d,left:c}=e.getBoundingClientRect();if(\"if-needed\"===h&&x>=0&&R>=0&&I<=H&&C<=b&&(e===m&&!o(e)||x>=i&&I<=d&&R>=c&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V=\"offsetWidth\"in e?e.offsetWidth-e.clientWidth-g-W:0,S=\"offsetHeight\"in e?e.offsetHeight-e.clientHeight-p-T:0,j=\"offsetWidth\"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,O=\"offsetHeight\"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B=\"start\"===u?k:\"end\"===u?k-H:\"nearest\"===u?n(M,M+H,H,p,T,M+k,M+k+v,v):k-H/2,F=\"start\"===f?D:\"center\"===f?D-b/2:\"end\"===f?D-b:n(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else{B=\"start\"===u?k-i-p:\"end\"===u?k-d+T+S:\"nearest\"===u?n(i,d,l,p,T+S,k,k+v,v):k-(i+l/2)+S/2,F=\"start\"===f?D-c-g:\"center\"===f?D-(c+r/2)+V/2:\"end\"===f?D-s+W+V:n(c,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:o}=e;B=0===O?0:Math.max(0,Math.min(o+B/O,e.scrollHeight-l/O+S)),F=0===j?0:Math.max(0,Math.min(t+F/j,e.scrollWidth-r/j+V)),k+=o-B,D+=t-F}L.push({el:e,top:B,left:F})}return L};//# sourceMappingURL=index.cjs.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/compute-scroll-into-view/dist/index.cjs\n}");
|
|
1031
1031
|
|
|
1032
|
-
/***/ }
|
|
1032
|
+
/***/ },
|
|
1033
1033
|
|
|
1034
|
-
/***/ "./node_modules/currify/lib/currify.js"
|
|
1034
|
+
/***/ "./node_modules/currify/lib/currify.js"
|
|
1035
1035
|
/*!*********************************************!*\
|
|
1036
1036
|
!*** ./node_modules/currify/lib/currify.js ***!
|
|
1037
1037
|
\*********************************************/
|
|
1038
|
-
|
|
1038
|
+
(module) {
|
|
1039
1039
|
|
|
1040
1040
|
"use strict";
|
|
1041
1041
|
eval("{\n\nconst f = (fn) => [\n /*eslint no-unused-vars: 0*/\n function (a) {return fn(...arguments);},\n function (a, b) {return fn(...arguments);},\n function (a, b, c) {return fn(...arguments);},\n function (a, b, c, d) {return fn(...arguments);},\n function (a, b, c, d, e) {return fn(...arguments);},\n];\n\nconst currify = (fn, ...args) => {\n check(fn);\n \n if (args.length >= fn.length)\n return fn(...args);\n \n const again = (...args2) => {\n return currify(fn, ...[...args, ...args2]);\n };\n \n const count = fn.length - args.length - 1;\n const func = f(again)[count];\n \n return func || again;\n};\n\nmodule.exports = currify;\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/currify/lib/currify.js\n}");
|
|
1042
1042
|
|
|
1043
|
-
/***/ }
|
|
1043
|
+
/***/ },
|
|
1044
1044
|
|
|
1045
|
-
/***/ "./node_modules/domfs-findit/legacy/findit.js"
|
|
1045
|
+
/***/ "./node_modules/domfs-findit/legacy/findit.js"
|
|
1046
1046
|
/*!****************************************************!*\
|
|
1047
1047
|
!*** ./node_modules/domfs-findit/legacy/findit.js ***!
|
|
1048
1048
|
\****************************************************/
|
|
1049
|
-
|
|
1049
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1050
1050
|
|
|
1051
1051
|
"use strict";
|
|
1052
1052
|
eval("{\n\nvar Emitify = __webpack_require__(/*! emitify/legacy */ \"./node_modules/domfs-findit/node_modules/emitify/legacy/index.js\");\n\nmodule.exports = function (entry) {\n var emitter = Emitify();\n\n setTimeout(function () {\n FindIt(emitter, entry);\n }, 0);\n\n return emitter;\n};\n\nfunction FindIt(emitter, entry) {\n if (!(this instanceof FindIt)) return new FindIt(emitter, entry);\n\n this._dirs = 0;\n this._first = true;\n\n this._find(emitter, entry);\n}\n\nFindIt.prototype._find = function (emitter, entry) {\n var _this = this;\n\n if (entry.isFile) {\n emitter.emit('file', entry.fullPath, entry);\n\n if (this._first) emitter.emit('end');\n\n return;\n }\n\n if (this._first) this._first = false;\n\n emitter.emit('directory', entry.fullPath, entry);\n\n ++this._dirs;\n\n entry.createReader().readEntries(function (entries) {\n [].forEach.call(entries, function (entry) {\n _this._find(emitter, entry);\n });\n\n --_this._dirs;\n\n if (!_this._dirs) emitter.emit('end');\n });\n};\n\n//# sourceURL=file://cloudcmd/node_modules/domfs-findit/legacy/findit.js\n}");
|
|
1053
1053
|
|
|
1054
|
-
/***/ }
|
|
1054
|
+
/***/ },
|
|
1055
1055
|
|
|
1056
|
-
/***/ "./node_modules/domfs-findit/node_modules/emitify/legacy/index.js"
|
|
1056
|
+
/***/ "./node_modules/domfs-findit/node_modules/emitify/legacy/index.js"
|
|
1057
1057
|
/*!************************************************************************!*\
|
|
1058
1058
|
!*** ./node_modules/domfs-findit/node_modules/emitify/legacy/index.js ***!
|
|
1059
1059
|
\************************************************************************/
|
|
1060
|
-
|
|
1060
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1061
1061
|
|
|
1062
1062
|
eval("{module.exports = __webpack_require__(/*! ./lib/emitify */ \"./node_modules/domfs-findit/node_modules/emitify/legacy/lib/emitify.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/domfs-findit/node_modules/emitify/legacy/index.js\n}");
|
|
1063
1063
|
|
|
1064
|
-
/***/ }
|
|
1064
|
+
/***/ },
|
|
1065
1065
|
|
|
1066
|
-
/***/ "./node_modules/domfs-findit/node_modules/emitify/legacy/lib/emitify.js"
|
|
1066
|
+
/***/ "./node_modules/domfs-findit/node_modules/emitify/legacy/lib/emitify.js"
|
|
1067
1067
|
/*!******************************************************************************!*\
|
|
1068
1068
|
!*** ./node_modules/domfs-findit/node_modules/emitify/legacy/lib/emitify.js ***!
|
|
1069
1069
|
\******************************************************************************/
|
|
1070
|
-
|
|
1070
|
+
(module) {
|
|
1071
1071
|
|
|
1072
1072
|
"use strict";
|
|
1073
1073
|
eval("{\n\nmodule.exports = Emitify;\n\nfunction Emitify() {\n if (!(this instanceof Emitify)) return new Emitify();\n\n this._all = {};\n}\n\nEmitify.prototype.on = function (event, callback) {\n var funcs = this._all[event];\n\n check(event, callback);\n\n if (funcs) funcs.push(callback);else this._all[event] = [callback];\n\n return this;\n};\n\nEmitify.prototype.addListener = Emitify.prototype.on;\n\nEmitify.prototype.once = function (event, callback) {\n var self = this;\n\n check(event, callback);\n\n self.on(event, function fn() {\n callback.apply(null, arguments);\n self.off(event, fn);\n });\n\n return this;\n};\n\nEmitify.prototype.off = function (event, callback) {\n var events = this._all[event] || [];\n var index = events.indexOf(callback);\n\n check(event, callback);\n\n while (~index) {\n events.splice(index, 1);\n index = events.indexOf(callback);\n }\n\n return this;\n};\n\nEmitify.prototype.removeListener = Emitify.prototype.off;\n\nEmitify.prototype.emit = function (event) {\n var args = [].slice.call(arguments, 1);\n var funcs = this._all[event];\n\n checkEvent(event);\n\n if (!funcs && event === 'error') throw args[0];\n\n if (!funcs) return this;\n\n funcs.forEach(function (fn) {\n fn.apply(null, args);\n });\n\n return this;\n};\n\nEmitify.prototype.removeAllListeners = function (event) {\n checkEvent(event);\n\n this._all[event] = [];\n\n return this;\n};\n\nfunction checkEvent(event) {\n if (typeof event !== 'string') throw Error('event should be string!');\n}\n\nfunction checkFn(callback) {\n if (typeof callback !== 'function') throw Error('callback should be function!');\n}\n\nfunction check(event, callback) {\n checkEvent(event);\n checkFn(callback);\n}\n\n//# sourceURL=file://cloudcmd/node_modules/domfs-findit/node_modules/emitify/legacy/lib/emitify.js\n}");
|
|
1074
1074
|
|
|
1075
|
-
/***/ }
|
|
1075
|
+
/***/ },
|
|
1076
1076
|
|
|
1077
|
-
/***/ "./node_modules/domtokenlist-shim/dist/domtokenlist.js"
|
|
1077
|
+
/***/ "./node_modules/domtokenlist-shim/dist/domtokenlist.js"
|
|
1078
1078
|
/*!*************************************************************!*\
|
|
1079
1079
|
!*** ./node_modules/domtokenlist-shim/dist/domtokenlist.js ***!
|
|
1080
1080
|
\*************************************************************/
|
|
1081
|
-
|
|
1081
|
+
() {
|
|
1082
1082
|
|
|
1083
1083
|
eval("{/*! DOMTokenlist shim | Copyright 2016 Jonathan Wilsson and Bogdan Chadkin. */\n;typeof window !== 'undefined' && (function (window) {\n 'use strict';\n\n if (!window.DOMTokenList) {\n return;\n }\n\n var el = document.createElement('a').classList;\n var dtp = DOMTokenList.prototype;\n var add = dtp.add;\n var remove = dtp.remove;\n var toggle = dtp.toggle;\n\n el.add('c1', 'c2');\n\n // Older versions of the HTMLElement.classList spec didn't allow multiple\n // arguments, easy to test for\n var iterateArg = function (fn) {\n return function () {\n var tokens = arguments;\n var i;\n\n for (i = 0; i < tokens.length; i += 1) {\n fn.call(this, tokens[i]);\n }\n };\n };\n\n if (!el.contains('c2')) {\n dtp.add = iterateArg(add);\n dtp.remove = iterateArg(remove);\n }\n\n // Older versions of the spec didn't have a forcedState argument for\n // `toggle` either, test by checking the return value after forcing\n if (!el.toggle('c1', true)) {\n dtp.toggle = function (cls, force) {\n if (force === undefined) {\n return toggle.call(this, cls);\n }\n\n (force ? add : remove).call(this, cls);\n return !!force;\n };\n }\n}(window));\n\n;typeof window !== 'undefined' && (function (window) {\n 'use strict';\n\n var arr = [];\n\n var inArray = function (array, value) {\n var i;\n\n if (arr.indexOf) {\n return arr.indexOf.call(array, value);\n }\n\n for (i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n\n return -1;\n };\n\n var validateToken = function (token) {\n var whitespace = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/;\n\n if (token === '' || whitespace.test(token)) {\n throw new Error('Token must not be empty or contain whitespace.');\n }\n };\n\n var DOMTokenList = function (element, prop) {\n var inst = this;\n var i;\n var values = [];\n\n if (element && prop) {\n inst.element = element;\n inst.prop = prop;\n\n if (element[prop]) {\n values = element[prop].replace(/^\\s+|\\s+$/g, '').split(/\\s+/);\n\n for (i = 0; i < values.length; i++) {\n inst[i] = values[i];\n }\n }\n }\n\n inst.length = values.length;\n };\n\n DOMTokenList.prototype = {\n add: function () {\n var inst = this;\n var i;\n var tokens = arguments;\n\n for (i = 0; i < tokens.length; i++) {\n validateToken(tokens[i]);\n\n if (!inst.contains(tokens[i])) {\n arr.push.call(inst, tokens[i]);\n }\n }\n\n if (inst.element) {\n inst.element[inst.prop] = inst;\n }\n },\n\n contains: function (token) {\n validateToken(token);\n\n return inArray(this, token) !== -1;\n },\n\n item: function (index) {\n return this[index] || null;\n },\n\n remove: function () {\n var tokens = arguments;\n var inst = this;\n var key;\n var i;\n\n for (i = 0; i < tokens.length; i++) {\n validateToken(tokens[i]);\n\n key = inArray(inst, tokens[i]);\n\n if (key !== -1) {\n arr.splice.call(inst, key, 1);\n }\n }\n\n if (inst.element) {\n inst.element[inst.prop] = inst;\n }\n },\n\n toggle: function (token, force) {\n var inst = this;\n\n if (inst.contains(token)) {\n if (force) {\n return true;\n }\n\n inst.remove(token);\n\n return false;\n } else {\n if (force === false) {\n return false;\n }\n\n inst.add(token);\n\n return true;\n }\n },\n\n toString: function () {\n return arr.join.call(this, ' ');\n }\n };\n\n window.DOMTokenList = DOMTokenList;\n}(window));\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if ('classList' in document.createElement('a')) {\n return;\n }\n\n Object.defineProperty(Element.prototype, 'classList', {\n get: function () {\n return new DOMTokenList(this, 'className');\n }\n });\n}());\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if ('relList' in document.createElement('a')) {\n return;\n }\n\n var i;\n var elements = [HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement];\n var getter = function () {\n return new DOMTokenList(this, 'rel');\n };\n\n for (i = 0; i < elements.length; i++) {\n Object.defineProperty(elements[i].prototype, 'relList', {\n get: getter\n });\n }\n}());\n\n;typeof window !== 'undefined' && (function () {\n 'use strict';\n\n if (typeof SVGElement === 'undefined') {\n // IE8 does not support SVG and would throw\n // \"Object doesn't support this method or property\"\n return;\n }\n\n // https://connect.microsoft.com/IE/feedback/details/1046039/classlist-not-working-on-svg-elements\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n if ('classList' in svg && !window.QUnit) {\n return;\n }\n\n Object.defineProperty(SVGElement.prototype, 'classList', {\n get: function () {\n if (typeof this.className === 'string') {\n return new DOMTokenList(this, 'className');\n }\n // in SVG world className may not be a DOMString, but a SVGAnimatedString\n // https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString\n if (typeof this.className.baseVal === 'string') {\n return new DOMTokenList(this.className, 'baseVal');\n }\n }\n });\n}());\n\n\n//# sourceURL=file://cloudcmd/node_modules/domtokenlist-shim/dist/domtokenlist.js\n}");
|
|
1084
1084
|
|
|
1085
|
-
/***/ }
|
|
1085
|
+
/***/ },
|
|
1086
1086
|
|
|
1087
|
-
/***/ "./node_modules/emitify/lib/emitify.js"
|
|
1087
|
+
/***/ "./node_modules/emitify/lib/emitify.js"
|
|
1088
1088
|
/*!*********************************************!*\
|
|
1089
1089
|
!*** ./node_modules/emitify/lib/emitify.js ***!
|
|
1090
1090
|
\*********************************************/
|
|
1091
|
-
|
|
1091
|
+
(module) {
|
|
1092
1092
|
|
|
1093
1093
|
"use strict";
|
|
1094
1094
|
eval("{\n\nmodule.exports = Emitify;\n\nfunction Emitify() {\n if (!(this instanceof Emitify))\n return new Emitify();\n \n this._all = {};\n}\n\nEmitify.prototype.on = function(event, callback) {\n const funcs = this._all[event];\n \n check(event, callback);\n \n if (funcs)\n funcs.push(callback);\n else\n this._all[event] = [callback];\n \n return this;\n};\n\nEmitify.prototype.addListener =\nEmitify.prototype.on;\n\nEmitify.prototype.once = function(event, callback) {\n const self = this;\n \n check(event, callback);\n \n this.on(event, function fn(...args) {\n callback(...args);\n self.off(event, fn);\n });\n \n return this;\n};\n\nEmitify.prototype.off = function(event, callback) {\n const events = this._all[event] || [];\n let index = events.indexOf(callback);\n \n check(event, callback);\n \n while (~index) {\n events.splice(index, 1);\n index = events.indexOf(callback);\n }\n \n return this;\n};\n\nEmitify.prototype.removeListener =\nEmitify.prototype.off;\n\nEmitify.prototype.emit = function(event, ...args) {\n const funcs = this._all[event];\n \n checkEvent(event);\n \n if (!funcs && event === 'error')\n throw args[0];\n \n if (!funcs)\n return this;\n \n for (const fn of funcs) {\n fn(...args);\n }\n \n return this;\n};\n\nEmitify.prototype.removeAllListeners = function(event) {\n checkEvent(event);\n \n this._all[event] = [];\n \n return this;\n};\n\nfunction checkEvent(event) {\n if (typeof event !== 'string')\n throw Error('event should be string!');\n}\n\nfunction checkFn(callback) {\n if (typeof callback !== 'function')\n throw Error('callback should be function!');\n}\n\nfunction check(event, callback) {\n checkEvent(event);\n checkFn(callback);\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/emitify/lib/emitify.js\n}");
|
|
1095
1095
|
|
|
1096
|
-
/***/ }
|
|
1096
|
+
/***/ },
|
|
1097
1097
|
|
|
1098
|
-
/***/ "./node_modules/es6-promisify/dist/promisify.js"
|
|
1098
|
+
/***/ "./node_modules/es6-promisify/dist/promisify.js"
|
|
1099
1099
|
/*!******************************************************!*\
|
|
1100
1100
|
!*** ./node_modules/es6-promisify/dist/promisify.js ***!
|
|
1101
1101
|
\******************************************************/
|
|
1102
|
-
|
|
1102
|
+
(__unused_webpack_module, exports) {
|
|
1103
1103
|
|
|
1104
1104
|
"use strict";
|
|
1105
1105
|
eval("{Object.defineProperty(exports, \"__esModule\", ({value:!0})),exports.promisify=promisify;var customArgumentsToken=\"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\";function promisify(a){if(\"function\"!=typeof a)throw new TypeError(\"Argument to promisify must be a function\");var b=a[customArgumentsToken],c=promisify.Promise||Promise;if(\"function\"!=typeof c)throw new Error(\"No Promise implementation found; do you need a polyfill?\");return function(){for(var d=this,e=arguments.length,f=Array(e),g=0;g<e;g++)f[g]=arguments[g];return new c(function(c,e){f.push(function(a){if(a)return e(a);for(var d=arguments.length,f=Array(1<d?d-1:0),g=1;g<d;g++)f[g-1]=arguments[g];if(1===f.length||!b)return c(f[0]);var h={};f.forEach(function(a,c){var d=b[c];d&&(h[d]=a)}),c(h)}),a.apply(d,f)})}}promisify.argumentNames=\"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\",promisify.Promise=void 0;\n\n\n//# sourceURL=file://cloudcmd/node_modules/es6-promisify/dist/promisify.js\n}");
|
|
1106
1106
|
|
|
1107
|
-
/***/ }
|
|
1107
|
+
/***/ },
|
|
1108
1108
|
|
|
1109
|
-
/***/ "./node_modules/execon/lib/exec.js"
|
|
1109
|
+
/***/ "./node_modules/execon/lib/exec.js"
|
|
1110
1110
|
/*!*****************************************!*\
|
|
1111
1111
|
!*** ./node_modules/execon/lib/exec.js ***!
|
|
1112
1112
|
\*****************************************/
|
|
1113
|
-
|
|
1113
|
+
(module) {
|
|
1114
1114
|
|
|
1115
1115
|
eval("{(function(global) {\n 'use strict';\n \n if ( true && module.exports)\n module.exports = new ExecProto();\n else\n global.exec = new ExecProto();\n \n function ExecProto() {\n var slice = Array.prototype.slice,\n /**\n * function do save exec of function\n * @param callback\n * @param arg1\n * ...\n * @param argN\n */\n exec = function(callback) {\n var ret,\n isFunc = typeof callback === 'function',\n args = slice.call(arguments, 1);\n \n if (isFunc)\n ret = callback.apply(null, args);\n \n return ret;\n };\n \n /*\n * return function that calls callback with arguments\n */\n exec.with = function(callback) {\n var slice = Array.prototype.slice,\n args = slice.call(arguments, 1);\n \n return function() {\n var array = slice.call(arguments), \n all = args.concat(array);\n \n return callback.apply(null, all);\n };\n };\n \n /**\n * return save exec function\n * @param callback\n */\n exec.ret = function() {\n var result,\n args = slice.call(arguments);\n \n args.unshift(exec);\n result = exec.with.apply(null, args);\n \n return result;\n };\n \n /**\n * function do conditional save exec of function\n * @param condition\n * @param callback\n * @param func\n */\n exec.if = function(condition, callback, func) {\n var ret;\n \n if (condition)\n exec(callback);\n else\n exec(func, callback);\n \n return ret;\n };\n \n /**\n * exec function if it exist in object\n * \n * @param obj\n * @param name\n * @param arg\n */\n exec.ifExist = function(obj, name, arg) {\n var ret,\n func = obj && obj[name];\n \n if (func)\n func = func.apply(obj, arg);\n \n return ret;\n };\n \n exec.parallel = function(funcs, callback) {\n var ERROR = 'could not be empty!',\n keys = [],\n callbackWas = false,\n arr = [],\n obj = {},\n count = 0,\n countFuncs = 0,\n type = getType(funcs);\n \n if (!funcs)\n throw Error('funcs ' + ERROR);\n \n if (!callback)\n throw Error('callback ' + ERROR);\n \n switch(type) {\n case 'array':\n countFuncs = funcs.length;\n \n funcs.forEach(function(func, num) {\n exec(func, function() {\n checkFunc(num, arguments);\n });\n });\n break;\n \n case 'object':\n keys = Object.keys(funcs);\n countFuncs = keys.length;\n \n keys.forEach(function(name) {\n var func = funcs[name];\n \n exec(func, function() {\n checkFunc(name, arguments, obj);\n });\n });\n break;\n }\n \n function checkFunc(num, data) {\n var args = slice.call(data, 1),\n isLast = false,\n error = data[0],\n length = args.length;\n \n ++count;\n \n isLast = count === countFuncs;\n \n if (!error)\n if (length >= 2)\n arr[num] = args;\n else\n arr[num] = args[0];\n \n if (!callbackWas && (error || isLast)) {\n callbackWas = true;\n \n if (type === 'array')\n callback.apply(null, [error].concat(arr));\n else\n callback(error, arr);\n }\n }\n };\n \n /**\n * load functions thrue callbacks one-by-one\n * @param funcs {Array} - array of functions\n */\n exec.series = function(funcs, callback) {\n var fn,\n i = funcs.length,\n check = function(error) {\n var done;\n \n --i;\n \n if (!i || error) {\n done = true;\n exec(callback, error);\n }\n \n return done;\n };\n \n if (!Array.isArray(funcs))\n throw Error('funcs should be array!');\n \n fn = funcs.shift();\n \n exec(fn, function(error) {\n if (!check(error))\n exec.series(funcs, callback);\n });\n };\n \n exec.each = function(array, iterator, callback) {\n var listeners = array.map(function(item) {\n return iterator.bind(null, item);\n });\n \n if (!listeners.length)\n callback();\n else\n exec.parallel(listeners, callback);\n };\n \n exec.eachSeries = function(array, iterator, callback) {\n var listeners = array.map(function(item) {\n return iterator.bind(null, item);\n });\n \n if (typeof callback !== 'function')\n throw Error('callback should be function');\n \n if (!listeners.length)\n callback();\n else\n exec.series(listeners, callback);\n };\n \n /**\n * function execute param function in\n * try...catch block\n * \n * @param callback\n */\n exec.try = function(callback) {\n var ret;\n try {\n ret = callback();\n } catch(error) {\n ret = error;\n }\n \n return ret;\n };\n \n function getType(variable) {\n var regExp = new RegExp('\\\\s([a-zA-Z]+)'),\n str = {}.toString.call(variable),\n typeBig = str.match(regExp)[1],\n result = typeBig.toLowerCase();\n \n return result;\n } \n \n return exec;\n }\n})(this);\n\n\n//# sourceURL=file://cloudcmd/node_modules/execon/lib/exec.js\n}");
|
|
1116
1116
|
|
|
1117
|
-
/***/ }
|
|
1117
|
+
/***/ },
|
|
1118
1118
|
|
|
1119
|
-
/***/ "./node_modules/for-each-key/lib/for-each-key.js"
|
|
1119
|
+
/***/ "./node_modules/for-each-key/lib/for-each-key.js"
|
|
1120
1120
|
/*!*******************************************************!*\
|
|
1121
1121
|
!*** ./node_modules/for-each-key/lib/for-each-key.js ***!
|
|
1122
1122
|
\*******************************************************/
|
|
1123
|
-
|
|
1123
|
+
(module) {
|
|
1124
1124
|
|
|
1125
1125
|
"use strict";
|
|
1126
1126
|
eval("{\n\nconst setValue = (fn, obj) => (key) => fn(key, obj[key]);\n\nmodule.exports = (fn, obj) => {\n Object\n .keys(obj)\n .forEach(setValue(fn, obj));\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/for-each-key/lib/for-each-key.js\n}");
|
|
1127
1127
|
|
|
1128
|
-
/***/ }
|
|
1128
|
+
/***/ },
|
|
1129
1129
|
|
|
1130
|
-
/***/ "./node_modules/format-io/lib/format.js"
|
|
1130
|
+
/***/ "./node_modules/format-io/lib/format.js"
|
|
1131
1131
|
/*!**********************************************!*\
|
|
1132
1132
|
!*** ./node_modules/format-io/lib/format.js ***!
|
|
1133
1133
|
\**********************************************/
|
|
1134
|
-
|
|
1134
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1135
1135
|
|
|
1136
1136
|
"use strict";
|
|
1137
1137
|
eval("{\n\nmodule.exports.addSlashToEnd = (path) => {\n if (!path)\n throw Error('path could not be empty!');\n \n const length = path.length - 1;\n const isSlash = path[length] === '/';\n \n if (isSlash)\n return path;\n \n return `${path}/`;\n};\n\n/** Функция получает короткие размеры\n * конвертируя байт в килобайты, мегабойты,\n * гигайбайты и терабайты\n * @pSize - размер в байтах\n */\nmodule.exports.size = (size) => {\n const isNumber = typeof size === 'number';\n \n const l1KB = 1024;\n const l1MB = l1KB * l1KB;\n const l1GB = l1MB * l1KB;\n const l1TB = l1GB * l1KB;\n const l1PB = l1TB * l1KB;\n \n if (!isNumber)\n return size;\n \n if (size < l1KB)\n return size + 'b';\n \n if (size < l1MB)\n return (size / l1KB).toFixed(2) + 'kb';\n \n if (size < l1GB)\n return (size / l1MB).toFixed(2) + 'mb';\n \n if (size < l1TB)\n return (size / l1GB).toFixed(2) + 'gb';\n \n if (size < l1PB)\n return (size / l1TB).toFixed(2) + 'tb';\n \n return (size / l1PB).toFixed(2) + 'pb';\n};\n\nmodule.exports.permissions = __webpack_require__(/*! ./mode */ \"./node_modules/format-io/lib/mode.js\");\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/format-io/lib/format.js\n}");
|
|
1138
1138
|
|
|
1139
|
-
/***/ }
|
|
1139
|
+
/***/ },
|
|
1140
1140
|
|
|
1141
|
-
/***/ "./node_modules/format-io/lib/mode.js"
|
|
1141
|
+
/***/ "./node_modules/format-io/lib/mode.js"
|
|
1142
1142
|
/*!********************************************!*\
|
|
1143
1143
|
!*** ./node_modules/format-io/lib/mode.js ***!
|
|
1144
1144
|
\********************************************/
|
|
1145
|
-
|
|
1145
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1146
1146
|
|
|
1147
1147
|
"use strict";
|
|
1148
1148
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n/*\n S_IRUSR 0000400 protection: readable by owner\n S_IWUSR 0000200 writable by owner\n S_IXUSR 0000100 executable by owner\n S_IRGRP 0000040 readable by group\n S_IWGRP 0000020 writable by group\n S_IXGRP 0000010 executable by group\n S_IROTH 0000004 readable by all\n S_IWOTH 0000002 writable by all\n S_IXOTH 0000001 executable by all\n*/\n\nconst R = {\n name: 'r',\n value: 4,\n};\n\nconst W = {\n name: 'w',\n value: 2,\n};\n\nconst X = {\n name: 'x',\n value: 1,\n};\n\nconst getModeName = currify((value, m) => {\n if (value & m.value)\n return m.name;\n \n return '-';\n});\n\nconst toStrMode = currify((fn, value) => {\n return [R, W, X]\n .map(fn(value))\n .join('');\n});\n\n\n/**\n * Функция переводит права из цыфрового вида в символьный\n * @param perms - строка с правами доступа\n * к файлу в 8-миричной системе\n */\nmodule.exports.symbolic = (perms) => {\n let permissions = '';\n const is = typeof perms !== 'undefined';\n \n if (!is)\n return permissions;\n \n const permsStr = perms.slice(-3);\n \n /* Переводим в двоичную систему */\n const owner = Number(permsStr[0]).toString(2);\n const group = Number(permsStr[1]).toString(2);\n const all = Number(permsStr[2]).toString(2);\n \n const allPermissions = [\n owner,\n group,\n all,\n ];\n \n return allPermissions\n .map(toStrMode(getModeName))\n .join(' ');\n};\n\n/**\n * Функция конвертирует права доступа к файлам из символьного вида\n * в цыфровой\n */\nmodule.exports.numeric = (perms) => {\n const length = perms && perms.length === 11;\n \n if (!length)\n throw Error('permissions should be in format \"xxx xxx xxx\"');\n \n const R = 4;\n const W = 2;\n const X = 1;\n const N = 0;\n \n const owner =\n (perms[0] === 'r' ? R : N) +\n (perms[1] === 'w' ? W : N) +\n (perms[2] === 'x' ? X : N);\n \n const group =\n (perms[4] === 'r' ? R : N) +\n (perms[5] === 'w' ? W : N) +\n (perms[6] === 'x' ? X : N);\n \n const all =\n (perms[8] === 'r' ? R : N) +\n (perms[9] === 'w' ? W : N) +\n (perms[10] === 'x' ? X : N);\n \n /* добавляем 2 цифры до 5 */\n return '00' + owner + group + all;\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/format-io/lib/mode.js\n}");
|
|
1149
1149
|
|
|
1150
|
-
/***/ }
|
|
1150
|
+
/***/ },
|
|
1151
1151
|
|
|
1152
|
-
/***/ "./node_modules/fullstore/lib/fullstore.js"
|
|
1152
|
+
/***/ "./node_modules/fullstore/lib/fullstore.js"
|
|
1153
1153
|
/*!*************************************************!*\
|
|
1154
1154
|
!*** ./node_modules/fullstore/lib/fullstore.js ***!
|
|
1155
1155
|
\*************************************************/
|
|
1156
|
-
|
|
1156
|
+
(module) {
|
|
1157
1157
|
|
|
1158
1158
|
"use strict";
|
|
1159
1159
|
eval("{\n\nmodule.exports = (value) => {\n const data = {\n value,\n };\n \n return (...args) => {\n const [value] = args;\n \n if (!args.length)\n return data.value;\n \n data.value = value;\n \n return value;\n };\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/fullstore/lib/fullstore.js\n}");
|
|
1160
1160
|
|
|
1161
|
-
/***/ }
|
|
1161
|
+
/***/ },
|
|
1162
1162
|
|
|
1163
|
-
/***/ "./node_modules/inherits/inherits_browser.js"
|
|
1163
|
+
/***/ "./node_modules/inherits/inherits_browser.js"
|
|
1164
1164
|
/*!***************************************************!*\
|
|
1165
1165
|
!*** ./node_modules/inherits/inherits_browser.js ***!
|
|
1166
1166
|
\***************************************************/
|
|
1167
|
-
|
|
1167
|
+
(module) {
|
|
1168
1168
|
|
|
1169
1169
|
eval("{if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/inherits/inherits_browser.js\n}");
|
|
1170
1170
|
|
|
1171
|
-
/***/ }
|
|
1171
|
+
/***/ },
|
|
1172
1172
|
|
|
1173
|
-
/***/ "./node_modules/itchy/lib/itchy.js"
|
|
1173
|
+
/***/ "./node_modules/itchy/lib/itchy.js"
|
|
1174
1174
|
/*!*****************************************!*\
|
|
1175
1175
|
!*** ./node_modules/itchy/lib/itchy.js ***!
|
|
1176
1176
|
\*****************************************/
|
|
1177
|
-
|
|
1177
|
+
(module) {
|
|
1178
1178
|
|
|
1179
1179
|
"use strict";
|
|
1180
1180
|
eval("{\n\nconst isFn = (a) => typeof a === 'function';\n\nmodule.exports = (array, iterator, done) => {\n check(array, iterator, done);\n \n let i = -1;\n const n = array.length;\n \n const loop = (e) => {\n ++i;\n \n if (e || i === n)\n return done(e);\n \n iterator(array[i], loop);\n };\n \n loop();\n};\n\nfunction check(array, iterator, done) {\n if (!Array.isArray(array))\n throw Error('array should be an array!');\n \n if (!isFn(iterator))\n throw Error('iterator should be a function!');\n \n if (!isFn(done))\n throw Error('done should be a function!');\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/itchy/lib/itchy.js\n}");
|
|
1181
1181
|
|
|
1182
|
-
/***/ }
|
|
1182
|
+
/***/ },
|
|
1183
1183
|
|
|
1184
|
-
/***/ "./node_modules/itype/lib/itype.js"
|
|
1184
|
+
/***/ "./node_modules/itype/lib/itype.js"
|
|
1185
1185
|
/*!*****************************************!*\
|
|
1186
1186
|
!*** ./node_modules/itype/lib/itype.js ***!
|
|
1187
1187
|
\*****************************************/
|
|
1188
|
-
|
|
1188
|
+
(module) {
|
|
1189
1189
|
|
|
1190
1190
|
"use strict";
|
|
1191
1191
|
eval("{\n\nmodule.exports = type;\n\nfor (const name of ['null', 'arrayBuffer', 'file', 'array', 'object']) {\n type[name] = typeOf.bind(null, name);\n}\n\nfor (const name of ['string', 'undefined', 'boolean', 'number', 'function']) {\n type[name] = typeOfSimple.bind(null, name);\n}\n\n/**\n * get type of variable\n *\n * @param variable\n */\nfunction type(variable) {\n const regExp = /\\s([a-zA-Z]+)/;\n const str = {}.toString.call(variable);\n const typeBig = str.match(regExp)[1];\n const result = typeBig.toLowerCase();\n \n return result;\n}\n\n/**\n * functions check is variable is type of name\n *\n * @param variable\n */\nfunction typeOf(name, variable) {\n return type(variable) === name;\n}\n\nfunction typeOfSimple(name, variable) {\n return typeof variable === name;\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/itype/lib/itype.js\n}");
|
|
1192
1192
|
|
|
1193
|
-
/***/ }
|
|
1193
|
+
/***/ },
|
|
1194
1194
|
|
|
1195
|
-
/***/ "./node_modules/jonny/lib/jonny.js"
|
|
1195
|
+
/***/ "./node_modules/jonny/lib/jonny.js"
|
|
1196
1196
|
/*!*****************************************!*\
|
|
1197
1197
|
!*** ./node_modules/jonny/lib/jonny.js ***!
|
|
1198
1198
|
\*****************************************/
|
|
1199
|
-
|
|
1199
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1200
1200
|
|
|
1201
1201
|
"use strict";
|
|
1202
|
-
eval("{\n\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.js\");\n\nconst {\n parse,\n stringify,\n} = JSON;\n\nmodule.exports.parse = (...args) => {\n const [, data] = tryCatch(parse, ...args);\n \n return data;\n};\n\nmodule.exports.stringify = (...args) => {\n const [, data] = tryCatch(stringify, ...args);\n \n return data;\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/jonny/lib/jonny.js\n}");
|
|
1202
|
+
eval("{\n\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/jonny/node_modules/try-catch/lib/try-catch.js\");\n\nconst {\n parse,\n stringify,\n} = JSON;\n\nmodule.exports.parse = (...args) => {\n const [, data] = tryCatch(parse, ...args);\n \n return data;\n};\n\nmodule.exports.stringify = (...args) => {\n const [, data] = tryCatch(stringify, ...args);\n \n return data;\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/jonny/lib/jonny.js\n}");
|
|
1203
1203
|
|
|
1204
|
-
/***/ }
|
|
1204
|
+
/***/ },
|
|
1205
1205
|
|
|
1206
|
-
/***/ "./node_modules/
|
|
1206
|
+
/***/ "./node_modules/jonny/node_modules/try-catch/lib/try-catch.js"
|
|
1207
|
+
/*!********************************************************************!*\
|
|
1208
|
+
!*** ./node_modules/jonny/node_modules/try-catch/lib/try-catch.js ***!
|
|
1209
|
+
\********************************************************************/
|
|
1210
|
+
(module) {
|
|
1211
|
+
|
|
1212
|
+
"use strict";
|
|
1213
|
+
eval("{\n\nmodule.exports = (fn, ...args) => {\n try {\n return [null, fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/jonny/node_modules/try-catch/lib/try-catch.js\n}");
|
|
1214
|
+
|
|
1215
|
+
/***/ },
|
|
1216
|
+
|
|
1217
|
+
/***/ "./node_modules/js-tokens/index.js"
|
|
1207
1218
|
/*!*****************************************!*\
|
|
1208
1219
|
!*** ./node_modules/js-tokens/index.js ***!
|
|
1209
1220
|
\*****************************************/
|
|
1210
|
-
|
|
1221
|
+
(__unused_webpack_module, exports) {
|
|
1211
1222
|
|
|
1212
1223
|
eval("{// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell\n// License: MIT. (See LICENSE.)\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}))\n\n// This regex comes from regex.coffee, and is inserted here by generate-index.js\n// (run `npm run build`).\nexports[\"default\"] = /((['\"])(?:(?!\\2|\\\\).|\\\\(?:\\r\\n|[\\s\\S]))*(\\2)?|`(?:[^`\\\\$]|\\\\[\\s\\S]|\\$(?!\\{)|\\$\\{(?:[^{}]|\\{[^}]*\\}?)*\\}?)*(`)?)|(\\/\\/.*)|(\\/\\*(?:[^*]|\\*(?!\\/))*(\\*\\/)?)|(\\/(?!\\*)(?:\\[(?:(?![\\]\\\\]).|\\\\.)*\\]|(?![\\/\\]\\\\]).|\\\\.)+\\/(?:(?!\\s*(?:\\b|[\\u0080-\\uFFFF$\\\\'\"~({]|[+\\-!](?!=)|\\.?\\d))|[gmiyus]{1,6}\\b(?![\\u0080-\\uFFFF$\\\\]|\\s*(?:[+\\-*%&|^<>!=?({]|\\/(?![\\/*])))))|(0[xX][\\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][+-]?\\d+)?)|((?!\\d)(?:(?!\\s)[$\\w\\u0080-\\uFFFF]|\\\\u[\\da-fA-F]{4}|\\\\u\\{[\\da-fA-F]+\\})+)|(--|\\+\\+|&&|\\|\\||=>|\\.{3}|(?:[+\\-\\/%&|^]|\\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\\](){}])|(\\s+)|(^$|[\\s\\S])/g\n\nexports.matchToToken = function(match) {\n var token = {type: \"invalid\", value: match[0], closed: undefined}\n if (match[ 1]) token.type = \"string\" , token.closed = !!(match[3] || match[4])\n else if (match[ 5]) token.type = \"comment\"\n else if (match[ 6]) token.type = \"comment\", token.closed = !!match[7]\n else if (match[ 8]) token.type = \"regex\"\n else if (match[ 9]) token.type = \"number\"\n else if (match[10]) token.type = \"name\"\n else if (match[11]) token.type = \"punctuator\"\n else if (match[12]) token.type = \"whitespace\"\n return token\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/js-tokens/index.js\n}");
|
|
1213
1224
|
|
|
1214
|
-
/***/ }
|
|
1225
|
+
/***/ },
|
|
1215
1226
|
|
|
1216
|
-
/***/ "./node_modules/just-capitalize/index.cjs"
|
|
1227
|
+
/***/ "./node_modules/just-capitalize/index.cjs"
|
|
1217
1228
|
/*!************************************************!*\
|
|
1218
1229
|
!*** ./node_modules/just-capitalize/index.cjs ***!
|
|
1219
1230
|
\************************************************/
|
|
1220
|
-
|
|
1231
|
+
(module) {
|
|
1221
1232
|
|
|
1222
1233
|
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/node_modules/just-capitalize/index.cjs\n}");
|
|
1223
1234
|
|
|
1224
|
-
/***/ }
|
|
1235
|
+
/***/ },
|
|
1225
1236
|
|
|
1226
|
-
/***/ "./node_modules/just-pascal-case/index.cjs"
|
|
1237
|
+
/***/ "./node_modules/just-pascal-case/index.cjs"
|
|
1227
1238
|
/*!*************************************************!*\
|
|
1228
1239
|
!*** ./node_modules/just-pascal-case/index.cjs ***!
|
|
1229
1240
|
\*************************************************/
|
|
1230
|
-
|
|
1241
|
+
(module) {
|
|
1231
1242
|
|
|
1232
1243
|
eval("{module.exports = pascalCase;\n\n/*\n pascalCase('the quick brown fox'); // 'TheQuickBrownFox'\n pascalCase('the_quick_brown_fox'); // 'TheQuickBrownFox'\n pascalCase('the-quick-brown-fox'); // 'TheQuickBrownFox'\n pascalCase('theQuickBrownFox'); // 'TheQuickBrownFox'\n pascalCase('thequickbrownfox'); // 'Thequickbrownfox'\n pascalCase('the - quick * brown# fox'); // 'TheQuickBrownFox'\n pascalCase('theQUICKBrownFox'); // 'TheQUICKBrownFox'\n*/\n\n// any combination of spaces and punctuation characters\n// thanks to http://stackoverflow.com/a/25575009\nvar wordSeparators = /[\\s\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,\\-.\\/:;<=>?@\\[\\]^_`{|}~]+/;\n\nfunction pascalCase(str) {\n var words = str.split(wordSeparators);\n var len = words.length;\n var mappedWords = new Array(len);\n for (var i = 0; i < len; i++) {\n var word = words[i];\n if (word === '') {\n continue;\n }\n mappedWords[i] = word[0].toUpperCase() + word.slice(1);\n }\n return mappedWords.join('');\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/just-pascal-case/index.cjs\n}");
|
|
1233
1244
|
|
|
1234
|
-
/***/ }
|
|
1245
|
+
/***/ },
|
|
1235
1246
|
|
|
1236
|
-
/***/ "./node_modules/limier/lib/limier.js"
|
|
1247
|
+
/***/ "./node_modules/limier/lib/limier.js"
|
|
1237
1248
|
/*!*******************************************!*\
|
|
1238
1249
|
!*** ./node_modules/limier/lib/limier.js ***!
|
|
1239
1250
|
\*******************************************/
|
|
1240
|
-
|
|
1251
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1241
1252
|
|
|
1242
1253
|
"use strict";
|
|
1243
1254
|
eval("{\n\nconst somefilter = __webpack_require__(/*! somefilter */ \"./node_modules/somefilter/lib/somefilter.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isIncludes = currify((str, name) => name.includes(str));\nconst isEqual = (a) => a && a.length;\nconst limier = somefilter(isEqual, [\n findByAbr,\n findByName,\n]);\n\nmodule.exports = (pattern, list) => {\n check(pattern, list);\n \n return limier(pattern, list) || [];\n};\n\nfunction findByName(str, names) {\n return names.filter(isIncludes(str));\n}\n\nfunction findByAbr(str, names) {\n const regstr = str\n .split('')\n .join('.*') + '.*';\n \n const regexp = RegExp(`^${ regstr }$`, 'i');\n const test = regexp.test.bind(regexp);\n \n return names.filter(test);\n}\n\nfunction check(pattern, list) {\n if (typeof pattern !== 'string')\n throw Error('pattern should be string!');\n \n if (!Array.isArray(list))\n throw Error('list should be an array!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/limier/lib/limier.js\n}");
|
|
1244
1255
|
|
|
1245
|
-
/***/ }
|
|
1256
|
+
/***/ },
|
|
1246
1257
|
|
|
1247
|
-
/***/ "./node_modules/load.js/lib/load.js"
|
|
1258
|
+
/***/ "./node_modules/load.js/lib/load.js"
|
|
1248
1259
|
/*!******************************************!*\
|
|
1249
1260
|
!*** ./node_modules/load.js/lib/load.js ***!
|
|
1250
1261
|
\******************************************/
|
|
1251
|
-
|
|
1262
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1252
1263
|
|
|
1253
1264
|
"use strict";
|
|
1254
1265
|
eval("{\n\nconst {promisify} = __webpack_require__(/*! es6-promisify */ \"./node_modules/load.js/node_modules/es6-promisify/dist/promisify.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst noop = () => {};\n\nconst addListenerOnce = (el, name, fn) => {\n const listener = (e) => {\n fn(e);\n el.removeEventListener(name, fn);\n };\n \n el.addEventListener(name, listener);\n};\n\nconst load = async (src) => {\n const ext = getExt(src);\n \n switch(ext) {\n case '.js':\n return await load.js(src);\n \n case '.css':\n return await load.css(src);\n \n case '.json':\n return await load.json(src);\n \n default:\n return await load.ajax(src);\n }\n};\n\nload.onerror = noop;\nload.onload = noop;\n\nload.addLoadListener = (onload) => {\n load.onload = onload;\n};\n\nload.addErrorListener = (onerror) => {\n load.onerror = onerror;\n};\n\nmodule.exports = load;\n\nload.js = promisify((src, callback) => {\n const id = getIdBySrc(src);\n let el = document.getElementById(id);\n \n if (el)\n return callback();\n \n el = createElement('script', {\n id,\n src,\n });\n \n addListenerOnce(el, 'load', (event) => {\n callback(null, event);\n load.onload();\n });\n \n addListenerOnce(el, 'error', (e) => {\n callback(e);\n document.body.removeChild(el);\n load.onerror(e, src);\n });\n});\n\nload.css = promisify((src, callback) => {\n const id = getIdBySrc(src);\n let el = document.getElementById(id);\n \n if (el)\n return callback();\n \n el = createElement('link', {\n id: getIdBySrc(src),\n rel: 'stylesheet',\n href: src,\n parent: document.head,\n });\n \n el.addEventListener('load', (event) => {\n callback(null, event);\n load.onload();\n });\n \n el.addEventListener('error', (e) => {\n callback(e);\n document.head.removeChild(el);\n load.onerror(e, src);\n });\n});\n\nload.ajax = promisify((url, callback) => {\n const request = new XMLHttpRequest();\n \n request.open('GET', url, true);\n \n request.addEventListener('load', () => {\n if (request.status >= 200 && request.status < 400){\n const data = request.responseText;\n callback(null, data);\n load.onload();\n }\n });\n \n request.addEventListener('error', (e) => {\n load.onerror(e);\n callback(e);\n });\n \n request.send();\n});\n\nload.json = promisify((url ,callback) => {\n load.ajax(url, (error, data) => {\n let json;\n \n if (!error)\n json = JSON.parse(data);\n \n callback(error, json);\n });\n});\n\nload.series = async (urls) => {\n const url = urls.shift();\n \n if (!url)\n return;\n \n await load(url);\n await load.series(urls);\n};\n\nload.parallel = async (urls) => {\n const promises = urls.map(load);\n return await Promise.all(promises);\n};\n\nfunction getExt(name) {\n const isStr = typeof name === 'string';\n let ret = '';\n let dot;\n \n if (isStr) {\n dot = name.lastIndexOf('.');\n \n if (~dot)\n ret = name.substr(dot);\n }\n \n return ret;\n}\n\nload.getIdBySrc = getIdBySrc;\n\nfunction getIdBySrc(src) {\n const isStr = typeof src === 'string';\n \n if (!isStr)\n return '';\n \n if (~src.indexOf(':'))\n src += '-join';\n \n const num = src.lastIndexOf('/') + 1;\n const sub = src.substr(src, num);\n const id = src.replace(sub, '')\n .replace(/\\./g, '-');\n \n return id;\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/load.js/lib/load.js\n}");
|
|
1255
1266
|
|
|
1256
|
-
/***/ }
|
|
1267
|
+
/***/ },
|
|
1257
1268
|
|
|
1258
|
-
/***/ "./node_modules/load.js/node_modules/es6-promisify/dist/promisify.js"
|
|
1269
|
+
/***/ "./node_modules/load.js/node_modules/es6-promisify/dist/promisify.js"
|
|
1259
1270
|
/*!***************************************************************************!*\
|
|
1260
1271
|
!*** ./node_modules/load.js/node_modules/es6-promisify/dist/promisify.js ***!
|
|
1261
1272
|
\***************************************************************************/
|
|
1262
|
-
|
|
1273
|
+
(__unused_webpack_module, exports) {
|
|
1263
1274
|
|
|
1264
1275
|
"use strict";
|
|
1265
1276
|
eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.promisify = promisify;\n// Symbols is a better way to do this, but not all browsers have good support,\n// so instead we'll just make do with a very unlikely string.\nvar customArgumentsToken = \"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\";\n/**\n * promisify()\n * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) --\n * into an ES6-compatible Promise. Promisify provides a default callback of the\n * form (error, result) and rejects when `error` is truthy.\n *\n * @param {function} original - The function to promisify\n * @return {function} A promisified version of `original`\n */\n\nfunction promisify(original) {\n // Ensure the argument is a function\n if (typeof original !== \"function\") {\n throw new TypeError(\"Argument to promisify must be a function\");\n } // If the user has asked us to decode argument names for them, honour that\n\n\n var argumentNames = original[customArgumentsToken]; // If the user has supplied a custom Promise implementation, use it.\n // Otherwise fall back to whatever we can find on the global object.\n\n var ES6Promise = promisify.Promise || Promise; // If we can find no Promise implemention, then fail now.\n\n if (typeof ES6Promise !== \"function\") {\n throw new Error(\"No Promise implementation found; do you need a polyfill?\");\n }\n\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new ES6Promise(function (resolve, reject) {\n // Append the callback bound to the context\n args.push(function callback(err) {\n if (err) {\n return reject(err);\n }\n\n for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n values[_key2 - 1] = arguments[_key2];\n }\n\n if (values.length === 1 || !argumentNames) {\n return resolve(values[0]);\n }\n\n var o = {};\n values.forEach(function (value, index) {\n var name = argumentNames[index];\n\n if (name) {\n o[name] = value;\n }\n });\n resolve(o);\n }); // Call the function.\n\n original.apply(_this, args);\n });\n };\n} // Attach this symbol to the exported function, so users can use it\n\n\npromisify.argumentNames = customArgumentsToken;\npromisify.Promise = undefined; // Export the public API\n\n//# sourceURL=file://cloudcmd/node_modules/load.js/node_modules/es6-promisify/dist/promisify.js\n}");
|
|
1266
1277
|
|
|
1267
|
-
/***/ }
|
|
1278
|
+
/***/ },
|
|
1268
1279
|
|
|
1269
|
-
/***/ "./node_modules/montag/lib/montag.js"
|
|
1280
|
+
/***/ "./node_modules/montag/lib/montag.js"
|
|
1270
1281
|
/*!*******************************************!*\
|
|
1271
1282
|
!*** ./node_modules/montag/lib/montag.js ***!
|
|
1272
1283
|
\*******************************************/
|
|
1273
|
-
|
|
1284
|
+
(module) {
|
|
1274
1285
|
|
|
1275
1286
|
"use strict";
|
|
1276
1287
|
eval("{\n\nconst START = 1;\nconst END = -1;\n\nmodule.exports = (strs, ...args) => {\n const str = build(strs, args);\n const lines = str\n .split('\\n')\n .slice(START, END);\n \n if (!lines.length)\n return '';\n \n const [first] = lines;\n \n const count = getSpaceCount(first);\n \n const result = [];\n \n for (const line of lines) {\n const currentCount = getSpaceCount(line);\n \n if (currentCount < count) {\n result.push(line.slice(currentCount));\n continue;\n }\n \n result.push(line.slice(count));\n }\n \n return result.join('\\n');\n};\n\nfunction getSpaceCount(a) {\n let i = 0;\n const {length} = a;\n \n while (i < length && a[i] === ' ') {\n ++i;\n }\n \n return i;\n}\n\nfunction build(strs, args) {\n const result = [];\n const n = strs.length + args.length;\n \n let j = 0;\n for (let i = 0; i < n; i++) {\n const current = i % 2 ? args.shift() : strs[j++];\n result.push(current);\n }\n \n return result.join('');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/montag/lib/montag.js\n}");
|
|
1277
1288
|
|
|
1278
|
-
/***/ }
|
|
1289
|
+
/***/ },
|
|
1279
1290
|
|
|
1280
|
-
/***/ "./node_modules/multi-rename/lib/multi-rename.js"
|
|
1291
|
+
/***/ "./node_modules/multi-rename/lib/multi-rename.js"
|
|
1281
1292
|
/*!*******************************************************!*\
|
|
1282
1293
|
!*** ./node_modules/multi-rename/lib/multi-rename.js ***!
|
|
1283
1294
|
\*******************************************************/
|
|
1284
|
-
|
|
1295
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1285
1296
|
|
|
1286
1297
|
"use strict";
|
|
1287
1298
|
eval("{\n\nconst shortdate = __webpack_require__(/*! shortdate */ \"./node_modules/shortdate/lib/shortdate.js\");\n\nmodule.exports = (pattern, names) => {\n check(pattern, names);\n \n return names.map(parse(pattern));\n};\n\nconst parse = (pattern) => (full, i) => {\n const [name, ext] = splitName(full);\n const date = shortdate(new Date(), {\n sep: '-',\n });\n \n return pattern\n .replace('[n]', name)\n .replace('[e]', ext)\n .replace('[c]', i + 1)\n .replace('[ymd]', date);\n};\n\nfunction splitName(str) {\n const index = str.lastIndexOf('.');\n \n if (!~index)\n return [\n str,\n '',\n ];\n \n return [\n str.substr(0, index),\n str.substr(index),\n ];\n}\n\nfunction check(pattern, names) {\n if (!pattern)\n throw Error('pattern could not be empty!');\n \n if (!Array.isArray(names))\n throw Error('names should be an array!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/multi-rename/lib/multi-rename.js\n}");
|
|
1288
1299
|
|
|
1289
|
-
/***/ }
|
|
1300
|
+
/***/ },
|
|
1290
1301
|
|
|
1291
|
-
/***/ "./node_modules/path-browserify/index.js"
|
|
1302
|
+
/***/ "./node_modules/path-browserify/index.js"
|
|
1292
1303
|
/*!***********************************************!*\
|
|
1293
1304
|
!*** ./node_modules/path-browserify/index.js ***!
|
|
1294
1305
|
\***********************************************/
|
|
1295
|
-
|
|
1306
|
+
(module) {
|
|
1296
1307
|
|
|
1297
1308
|
"use strict";
|
|
1298
1309
|
eval("{// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n\n\n//# sourceURL=file://cloudcmd/node_modules/path-browserify/index.js\n}");
|
|
1299
1310
|
|
|
1300
|
-
/***/ }
|
|
1311
|
+
/***/ },
|
|
1301
1312
|
|
|
1302
|
-
/***/ "./node_modules/philip/lib/philip.js"
|
|
1313
|
+
/***/ "./node_modules/philip/lib/philip.js"
|
|
1303
1314
|
/*!*******************************************!*\
|
|
1304
1315
|
!*** ./node_modules/philip/lib/philip.js ***!
|
|
1305
1316
|
\*******************************************/
|
|
1306
|
-
|
|
1317
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1307
1318
|
|
|
1308
1319
|
"use strict";
|
|
1309
1320
|
eval("{\n\nconst findit = __webpack_require__(/*! domfs-findit */ \"./node_modules/domfs-findit/legacy/findit.js\");\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst itchy = __webpack_require__(/*! itchy */ \"./node_modules/itchy/lib/itchy.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst {isArray} = Array;\nconst maybeArray = (a) => isArray(a) ? a : [a];\nconst isFn = (a) => typeof a === 'function';\n\nmodule.exports = Philip;\n\ninherits(Philip, Emitify);\n\nfunction Philip(entries, processingFn) {\n if (!(this instanceof Philip))\n return new Philip(entries, processingFn);\n \n if (!isFn(processingFn))\n throw Error('processingFn should be function!');\n \n Emitify.call(this);\n \n const array = maybeArray(entries);\n \n this._i = 0;\n this._n = 0;\n this._processingFn = processingFn;\n this._pause = false;\n this._prev = 0;\n \n this._find(array, (files, dirs) => {\n this._files = files;\n this._dirs = dirs;\n this._n = files.length + dirs.length;\n this._data = {};\n \n this._getFiles(files, this._data, () => {\n this._process();\n });\n });\n}\n\nPhilip.prototype._process = function() {\n const argsLength = this._processingFn.length;\n const fn = (error) => {\n ++this._i;\n \n if (error) {\n this.emit('error', error);\n this.pause();\n }\n \n this._process();\n this._progress();\n };\n \n let data;\n let name = this._dirs.shift();\n let type = 'directory';\n \n if (!name) {\n type = 'file';\n const el = this._files.shift();\n \n if (el) {\n name = el.fullPath;\n data = this._data[name];\n }\n }\n \n if (!name)\n return this.emit('end');\n \n let args;\n \n if (!this._pause) {\n switch(argsLength) {\n default:\n args = [\n type,\n name,\n data,\n ];\n break;\n \n case 6:\n args = [\n type,\n name,\n data,\n this._i,\n this._n,\n ];\n break;\n }\n \n args.push(fn);\n \n this._processingFn(...args);\n }\n};\n\nPhilip.prototype.pause = function() {\n this._pause = true;\n};\n\nPhilip.prototype.continue = function() {\n if (this._pause) {\n this._pause = false;\n this._process();\n }\n};\n\nPhilip.prototype.abort = function() {\n this._files = [];\n this._dirs = [];\n \n this._process();\n};\n\nPhilip.prototype._progress = function() {\n const value = Math.round(this._i * 100 / this._n);\n \n if (value !== this._prev) {\n this._prev = value;\n this.emit('progress', value);\n }\n};\n\nPhilip.prototype._getFiles = function(files, obj, callback) {\n const filesList = files.slice();\n const current = filesList.shift();\n \n if (!current)\n return callback(null, obj);\n \n current.file((file) => {\n const name = current.fullPath;\n \n obj[name] = file;\n \n this._getFiles(filesList, obj, callback);\n });\n};\n\nPhilip.prototype._find = function(entries, fn) {\n const files = [];\n const dirs = [];\n \n itchy(entries, (entry, callback) => {\n const finder = findit(entry);\n \n finder.on('directory', (name) => {\n dirs.push(name);\n });\n \n finder.on('file', (name, current) => {\n files.push(current);\n });\n \n finder.on('end', () => {\n callback();\n });\n }, () => {\n fn(files, dirs);\n });\n};\n\n\n//# sourceURL=file://cloudcmd/node_modules/philip/lib/philip.js\n}");
|
|
1310
1321
|
|
|
1311
|
-
/***/ }
|
|
1322
|
+
/***/ },
|
|
1312
1323
|
|
|
1313
|
-
/***/ "./node_modules/picocolors/picocolors.browser.js"
|
|
1324
|
+
/***/ "./node_modules/picocolors/picocolors.browser.js"
|
|
1314
1325
|
/*!*******************************************************!*\
|
|
1315
1326
|
!*** ./node_modules/picocolors/picocolors.browser.js ***!
|
|
1316
1327
|
\*******************************************************/
|
|
1317
|
-
|
|
1328
|
+
(module) {
|
|
1318
1329
|
|
|
1319
1330
|
eval("{var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n\n\n//# sourceURL=file://cloudcmd/node_modules/picocolors/picocolors.browser.js\n}");
|
|
1320
1331
|
|
|
1321
|
-
/***/ }
|
|
1332
|
+
/***/ },
|
|
1322
1333
|
|
|
1323
|
-
/***/ "./node_modules/process/browser.js"
|
|
1334
|
+
/***/ "./node_modules/process/browser.js"
|
|
1324
1335
|
/*!*****************************************!*\
|
|
1325
1336
|
!*** ./node_modules/process/browser.js ***!
|
|
1326
1337
|
\*****************************************/
|
|
1327
|
-
|
|
1338
|
+
(module) {
|
|
1328
1339
|
|
|
1329
1340
|
eval("{// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=file://cloudcmd/node_modules/process/browser.js\n}");
|
|
1330
1341
|
|
|
1331
|
-
/***/ }
|
|
1342
|
+
/***/ },
|
|
1332
1343
|
|
|
1333
|
-
/***/ "./node_modules/rendy/lib/rendy.js"
|
|
1344
|
+
/***/ "./node_modules/rendy/lib/rendy.js"
|
|
1334
1345
|
/*!*****************************************!*\
|
|
1335
1346
|
!*** ./node_modules/rendy/lib/rendy.js ***!
|
|
1336
1347
|
\*****************************************/
|
|
1337
|
-
|
|
1348
|
+
(module) {
|
|
1338
1349
|
|
|
1339
1350
|
"use strict";
|
|
1340
1351
|
eval("{\n\nconst isString = (a) => typeof a === 'string';\nconst constant = (a) => () => a;\nconst {keys} = Object;\n\nmodule.exports = (template, values, modifiers) => {\n check(template, values);\n \n let result = template;\n \n const names = !modifiers ? keys(values) : template.match(/{{(.*?)}}/g);\n \n for (const key of names) {\n const [parsedKey, value] = parseValue(key, values, modifiers);\n const str = constant(value);\n \n while (result.includes(parsedKey))\n result = result.replace(parsedKey, str);\n }\n \n if (result.includes('{{'))\n result = result.replace(/{{.*?}}/g, '');\n \n return result;\n};\n\nfunction check(template, values) {\n if (!isString(template))\n throw Error('template should be a string!');\n \n if (typeof values !== 'object')\n throw Error('values should be an object!');\n}\n\nfunction parseValue(key, values, modifiers) {\n if (!modifiers)\n return [\n `{{ ${key} }}`,\n values[key],\n ];\n \n const preparedKey = key\n .replaceAll('{{', '')\n .replaceAll('}}', '')\n .replaceAll(' ', '');\n \n const value = values[preparedKey] || '';\n \n if (!preparedKey.includes('|'))\n return [key, value];\n \n const [name, modifierName] = preparedKey.split('|');\n const fn = modifiers[modifierName];\n const currentValue = values[name];\n \n if (!fn)\n return [key, currentValue];\n \n return [key, fn(currentValue)];\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/rendy/lib/rendy.js\n}");
|
|
1341
1352
|
|
|
1342
|
-
/***/ }
|
|
1353
|
+
/***/ },
|
|
1343
1354
|
|
|
1344
|
-
/***/ "./node_modules/scroll-into-view-if-needed/dist/index.cjs"
|
|
1355
|
+
/***/ "./node_modules/scroll-into-view-if-needed/dist/index.cjs"
|
|
1345
1356
|
/*!****************************************************************!*\
|
|
1346
1357
|
!*** ./node_modules/scroll-into-view-if-needed/dist/index.cjs ***!
|
|
1347
1358
|
\****************************************************************/
|
|
1348
|
-
|
|
1359
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1349
1360
|
|
|
1350
1361
|
"use strict";
|
|
1351
1362
|
eval("{var t=__webpack_require__(/*! compute-scroll-into-view */ \"./node_modules/compute-scroll-into-view/dist/index.cjs\");const o=t=>!1===t?{block:\"end\",inline:\"nearest\"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:\"start\",inline:\"nearest\"};module.exports=function(e,r){if(!e.isConnected||!(t=>{let o=t;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(e))return;const n=(t=>{const o=window.getComputedStyle(t);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(e);if((t=>\"object\"==typeof t&&\"function\"==typeof t.behavior)(r))return r.behavior(t.compute(e,r));const l=\"boolean\"==typeof r||null==r?void 0:r.behavior;for(const{el:a,top:i,left:c}of t.compute(e,o(r))){const t=i-n.top+n.bottom,o=c-n.left+n.right;a.scroll({top:t,left:o,behavior:l})}};//# sourceMappingURL=index.cjs.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/scroll-into-view-if-needed/dist/index.cjs\n}");
|
|
1352
1363
|
|
|
1353
|
-
/***/ }
|
|
1364
|
+
/***/ },
|
|
1354
1365
|
|
|
1355
|
-
/***/ "./node_modules/shortdate/lib/shortdate.js"
|
|
1366
|
+
/***/ "./node_modules/shortdate/lib/shortdate.js"
|
|
1356
1367
|
/*!*************************************************!*\
|
|
1357
1368
|
!*** ./node_modules/shortdate/lib/shortdate.js ***!
|
|
1358
1369
|
\*************************************************/
|
|
1359
|
-
|
|
1370
|
+
(module) {
|
|
1360
1371
|
|
|
1361
1372
|
"use strict";
|
|
1362
1373
|
eval("{\n\nmodule.exports = (date, options) => {\n date = date || new Date();\n \n check(date, options);\n \n if (!options) {\n options = {};\n }\n \n const {\n sep = '.',\n order = 'big',\n } = options;\n \n let day = date.getDate();\n let month = date.getMonth() + 1;\n const year = date.getFullYear();\n \n if (month <= 9)\n month = '0' + month;\n \n if (day <= 9)\n day = '0' + day;\n \n switch(order) {\n case 'big':\n return [year, month, day].join(sep);\n \n case 'middle':\n return [month, day, year].join(sep);\n \n case 'little':\n return [day, month, year].join(sep);\n \n default:\n throw Error('order could be \"big\", \"middle\" and \"little\" only!');\n }\n};\n\nfunction check(date, options) {\n const type = {}.toString.call(date);\n \n if (date && type !== '[object Date]')\n throw Error('date should be Date!');\n \n if (options && typeof options !== 'object')\n throw Error('options should be object!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/shortdate/lib/shortdate.js\n}");
|
|
1363
1374
|
|
|
1364
|
-
/***/ }
|
|
1375
|
+
/***/ },
|
|
1365
1376
|
|
|
1366
|
-
/***/ "./node_modules/smalltalk/css/smalltalk.css"
|
|
1377
|
+
/***/ "./node_modules/smalltalk/css/smalltalk.css"
|
|
1367
1378
|
/*!**************************************************!*\
|
|
1368
1379
|
!*** ./node_modules/smalltalk/css/smalltalk.css ***!
|
|
1369
1380
|
\**************************************************/
|
|
1370
|
-
|
|
1381
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1371
1382
|
|
|
1372
1383
|
"use strict";
|
|
1373
1384
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/node_modules/smalltalk/css/smalltalk.css\n}");
|
|
1374
1385
|
|
|
1375
|
-
/***/ }
|
|
1386
|
+
/***/ },
|
|
1376
1387
|
|
|
1377
|
-
/***/ "./node_modules/smalltalk/lib/smalltalk.js"
|
|
1388
|
+
/***/ "./node_modules/smalltalk/lib/smalltalk.js"
|
|
1378
1389
|
/*!*************************************************!*\
|
|
1379
1390
|
!*** ./node_modules/smalltalk/lib/smalltalk.js ***!
|
|
1380
1391
|
\*************************************************/
|
|
1381
|
-
|
|
1392
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1382
1393
|
|
|
1383
1394
|
"use strict";
|
|
1384
1395
|
eval("{\n\n__webpack_require__(/*! ../css/smalltalk.css */ \"./node_modules/smalltalk/css/smalltalk.css\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst store = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst isBool = (a) => typeof a === 'boolean';\n\nconst keyDown = currify(keyDown_);\n\nconst BUTTON_OK = {\n ok: 'OK',\n};\n\nconst BUTTON_OK_CANCEL = {\n ok: 'OK',\n cancel: 'Cancel',\n};\n\nconst zIndex = store(100);\n\nmodule.exports.alert = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK;\n return showDialog(title, msg, '', buttons, options);\n};\n\nmodule.exports.prompt = (title, msg, value = '', options) => {\n const type = getType(options);\n const val = String(value).replace(/\"/g, '"');\n \n const valueStr = `<input type=\"${type}\" value=\"${val}\" data-name=\"js-input\">`;\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, valueStr, buttons, options);\n};\n\nmodule.exports.confirm = (title, msg, options) => {\n const buttons = getButtons(options) || BUTTON_OK_CANCEL;\n \n return showDialog(title, msg, '', buttons, options);\n};\n\nmodule.exports.progress = (title, message, options) => {\n const valueStr = `\n <progress value=\"0\" data-name=\"js-progress\" class=\"progress\" max=\"100\"></progress>\n <span data-name=\"js-counter\">0%</span>\n `;\n \n const buttons = {\n cancel: 'Abort',\n };\n \n const promise = showDialog(title, message, valueStr, buttons, options);\n const {ok, dialog} = promise;\n const resolve = ok();\n \n for (const el of find(dialog, ['cancel'])) {\n el.focus();\n }\n \n Object.assign(promise, {\n setProgress(count) {\n const [elProgress] = find(dialog, ['progress']);\n const [elCounter] = find(dialog, ['counter']);\n \n elProgress.value = count;\n elCounter.textContent = `${count}%`;\n \n if (count === 100) {\n remove(dialog);\n resolve();\n }\n },\n \n remove() {\n remove(dialog);\n },\n });\n \n return promise;\n};\n\nfunction getButtons(options = {}) {\n const {buttons} = options;\n \n if (!buttons)\n return null;\n \n return buttons;\n}\n\nfunction getType(options = {}) {\n const {type} = options;\n \n if (type === 'password')\n return 'password';\n \n return 'text';\n}\n\nfunction getTemplate(title, msg, value, buttons) {\n const encodedMsg = msg.replace(/\\n/g, '<br>');\n \n return `<div class=\"page\">\n <div data-name=\"js-close\" class=\"close-button\"></div>\n <header>${title}</header>\n <div class=\"content-area\">${encodedMsg}${value}</div>\n <div class=\"action-area\">\n <div class=\"button-strip\">\n ${parseButtons(buttons)}\n </div>\n </div>\n </div>`;\n}\n\nfunction parseButtons(buttons) {\n const names = Object.keys(buttons);\n const parse = currify((buttons, name, i) => `<button\n tabindex=${i}\n data-name=\"js-${name.toLowerCase()}\">\n ${buttons[name]}\n </button>`);\n \n return names\n .map(parse(buttons))\n .join('');\n}\n\nfunction showDialog(title, msg, value, buttons, options) {\n const ok = store();\n const cancel = store();\n \n const closeButtons = [\n 'cancel',\n 'close',\n 'ok',\n ];\n \n const promise = new Promise((resolve, reject) => {\n const noCancel = options && isBool(options.cancel) && !options.cancel;\n const empty = () => {};\n const rejectError = () => reject(Error());\n \n ok(resolve);\n cancel(noCancel ? empty : rejectError);\n });\n \n const innerHTML = getTemplate(title, msg, value, buttons);\n \n const dialog = createElement('div', {\n innerHTML,\n className: 'smalltalk',\n style: `z-index: ${zIndex(zIndex() + 1)}`,\n });\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n \n for (const el of find(dialog, ['input'])) {\n el.setSelectionRange(0, value.length);\n }\n \n addListenerAll('click', dialog, closeButtons, (event) => {\n closeDialog(event.target, dialog, ok(), cancel());\n });\n \n for (const event of ['click', 'contextmenu'])\n dialog.addEventListener(event, (e) => {\n e.stopPropagation();\n \n for (const el of find(dialog, ['ok', 'input']))\n el.focus();\n });\n \n dialog.addEventListener('keydown', keyDown(dialog, ok(), cancel()));\n \n return Object.assign(promise, {\n dialog,\n ok,\n });\n}\n\nfunction keyDown_(dialog, ok, cancel, event) {\n const KEY = {\n ENTER: 13,\n ESC: 27,\n TAB: 9,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n };\n \n const {keyCode} = event;\n const el = event.target;\n \n const namesAll = [\n 'ok',\n 'cancel',\n 'input',\n ];\n const names = find(dialog, namesAll).map(getDataName);\n \n switch(keyCode) {\n case KEY.ENTER:\n closeDialog(el, dialog, ok, cancel);\n event.preventDefault();\n break;\n \n case KEY.ESC:\n remove(dialog);\n cancel();\n break;\n \n case KEY.TAB:\n if (event.shiftKey)\n tab(dialog, names);\n \n tab(dialog, names);\n event.preventDefault();\n break;\n \n default:\n [\n 'left',\n 'right',\n 'up',\n 'down',\n ]\n .filter((name) => keyCode === KEY[name.toUpperCase()])\n .forEach(() => {\n changeButtonFocus(dialog, names);\n });\n \n break;\n }\n \n event.stopPropagation();\n}\n\nfunction getDataName(el) {\n return el\n .getAttribute('data-name')\n .replace('js-', '');\n}\n\nconst getName = (activeName) => {\n if (activeName === 'cancel')\n return 'ok';\n \n return 'cancel';\n};\n\nfunction changeButtonFocus(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const isButton = /ok|cancel/.test(activeName);\n const count = names.length - 1;\n \n if (activeName === 'input' || !count || !isButton)\n return;\n \n const name = getName(activeName);\n \n for (const el of find(dialog, [name])) {\n el.focus();\n }\n}\n\nconst getIndex = (count, index) => {\n if (index === count)\n return 0;\n \n return index + 1;\n};\n\nfunction tab(dialog, names) {\n const active = document.activeElement;\n const activeName = getDataName(active);\n const count = names.length - 1;\n \n const activeIndex = names.indexOf(activeName);\n const index = getIndex(count, activeIndex);\n \n const name = names[index];\n \n for (const el of find(dialog, [name]))\n el.focus();\n}\n\nfunction closeDialog(el, dialog, ok, cancel) {\n const name = el\n .getAttribute('data-name')\n .replace('js-', '');\n \n if (/close|cancel/.test(name)) {\n cancel();\n remove(dialog);\n \n return;\n }\n \n let value = null;\n \n for (const el of find(dialog, ['input'])) {\n value = el.value;\n }\n \n ok(value);\n remove(dialog);\n}\n\nconst query = currify((element, name) => element.querySelector(`[data-name=\"js-${name}\"]`));\n\nfunction find(element, names) {\n const elements = names\n .map(query(element))\n .filter(Boolean);\n \n return elements;\n}\n\nfunction addListenerAll(event, parent, elements, fn) {\n for (const el of find(parent, elements)) {\n el.addEventListener(event, fn);\n }\n}\n\nfunction remove(dialog) {\n const {parentElement} = dialog;\n \n if (parentElement)\n parentElement.removeChild(dialog);\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/smalltalk/lib/smalltalk.js\n}");
|
|
1385
1396
|
|
|
1386
|
-
/***/ }
|
|
1397
|
+
/***/ },
|
|
1387
1398
|
|
|
1388
|
-
/***/ "./node_modules/somefilter/lib/somefilter.js"
|
|
1399
|
+
/***/ "./node_modules/somefilter/lib/somefilter.js"
|
|
1389
1400
|
/*!***************************************************!*\
|
|
1390
1401
|
!*** ./node_modules/somefilter/lib/somefilter.js ***!
|
|
1391
1402
|
\***************************************************/
|
|
1392
|
-
|
|
1403
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1393
1404
|
|
|
1394
1405
|
"use strict";
|
|
1395
1406
|
eval("{\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst apart = __webpack_require__(/*! apart */ \"./node_modules/apart/lib/apart.js\");\n\nconst unary = currify((fn, value) => fn(value));\nconst notEmpty = (value) => value;\nconst apply = currify((args, fn) => fn(...args));\n\nmodule.exports = somefilter;\n\nfunction somefilter(condition, filters) {\n if (!filters) {\n filters = condition;\n condition = notEmpty;\n }\n \n checkAll(condition, filters);\n \n const storify = store(condition);\n const process = apart(squad, condition, storify);\n \n const processingFilters = filters\n .map(unary(process))\n .reverse();\n \n return (...args) => {\n processingFilters.some(apply(args));\n \n return storify();\n };\n}\n\nfunction store(condition) {\n let cache;\n \n return (value) => {\n let result;\n \n if (condition(value)) {\n cache =\n result = value;\n } else {\n result = cache;\n cache = null;\n }\n \n return result;\n };\n}\n\nfunction checkAll(condition, filters) {\n if (typeof condition !== 'function')\n throw Error('condition should be function!');\n \n if (!Array.isArray(filters))\n throw Error('filters should be an array!');\n \n check('function', filters);\n}\n\nfunction check(type, array) {\n const getType = (item) => typeof item;\n const notEqual = (a, b) => a !== b;\n const wrong = (type) => {\n throw Error(`fn should be ${ type }!`);\n };\n \n const wrongType = apart(wrong, type);\n const notType = apart(notEqual, type);\n \n if (!array.length)\n return wrongType(type);\n \n array\n .map(getType)\n .filter(notType)\n .forEach(wrongType);\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/somefilter/lib/somefilter.js\n}");
|
|
1396
1407
|
|
|
1397
|
-
/***/ }
|
|
1408
|
+
/***/ },
|
|
1398
1409
|
|
|
1399
|
-
/***/ "./node_modules/squad/lib/squad.js"
|
|
1410
|
+
/***/ "./node_modules/squad/lib/squad.js"
|
|
1400
1411
|
/*!*****************************************!*\
|
|
1401
1412
|
!*** ./node_modules/squad/lib/squad.js ***!
|
|
1402
1413
|
\*****************************************/
|
|
1403
|
-
|
|
1414
|
+
(module) {
|
|
1404
1415
|
|
|
1405
1416
|
"use strict";
|
|
1406
1417
|
eval("{\n\nconst compose = [\n () => () => {},\n (f) => (...a) => f(...a),\n (f1, f2) => (...a) => f1(f2(...a)),\n (f1, f2, f3) => (...a) => f1(f2(f3(...a))),\n (f1, f2, f3, f4) => (...a) => f1(f2(f3(f4(...a)))),\n (f1, f2, f3, f4, f5) => (...a) => f1(f2(f3(f4(f5(...a))))),\n (f1, f2, f3, f4, f5, f6) => (...a) => f1(f2(f3(f4(f5(f6(...a)))))),\n (f1, f2, f3, f4, f5, f6, f7) => (...a) => f1(f2(f3(f4(f5(f6(f7(...a))))))),\n];\n\nmodule.exports = (...fns) => {\n if (fns.length < compose.length)\n return compose[fns.length](...fns);\n \n return bigCompose(fns);\n}\n\nfunction bigCompose(fns) {\n return (...args) => {\n let i = fns.length - 1;\n let value = fns[i](...args);\n \n while (--i)\n value = fns[i](value);\n \n return value;\n }\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/squad/lib/squad.js\n}");
|
|
1407
1418
|
|
|
1408
|
-
/***/ }
|
|
1419
|
+
/***/ },
|
|
1409
1420
|
|
|
1410
|
-
/***/ "./node_modules/supermenu/css/supermenu.css"
|
|
1421
|
+
/***/ "./node_modules/supermenu/css/supermenu.css"
|
|
1411
1422
|
/*!**************************************************!*\
|
|
1412
1423
|
!*** ./node_modules/supermenu/css/supermenu.css ***!
|
|
1413
1424
|
\**************************************************/
|
|
1414
|
-
|
|
1425
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1415
1426
|
|
|
1416
1427
|
"use strict";
|
|
1417
1428
|
eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=file://cloudcmd/node_modules/supermenu/css/supermenu.css\n}");
|
|
1418
1429
|
|
|
1419
|
-
/***/ }
|
|
1430
|
+
/***/ },
|
|
1420
1431
|
|
|
1421
|
-
/***/ "./node_modules/supermenu/lib/build-items.js"
|
|
1432
|
+
/***/ "./node_modules/supermenu/lib/build-items.js"
|
|
1422
1433
|
/*!***************************************************!*\
|
|
1423
1434
|
!*** ./node_modules/supermenu/lib/build-items.js ***!
|
|
1424
1435
|
\***************************************************/
|
|
1425
|
-
|
|
1436
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1426
1437
|
|
|
1427
1438
|
"use strict";
|
|
1428
1439
|
eval("{\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst TEMPLATE = __webpack_require__(/*! ./template */ \"./node_modules/supermenu/lib/template.js\");\n\nconst isObj = (a) => typeof a === 'object';\nconst DATA_MENU = 'data-menu=\"js-submenu\"';\n\nconst {entries} = Object;\n\nmodule.exports = function buildItems(menuData, menuFuncs, options, path = '') {\n let items = '';\n \n if (path)\n path += '.';\n \n for (const [name, data] of entries(menuData)) {\n let nameIcon;\n let subitems = '';\n let className = '';\n let attribute = '';\n \n const pathName = path + name;\n \n if (!isObj(data)) {\n menuFuncs[pathName] = data;\n } else {\n subitems = rendy(TEMPLATE.MAIN, {\n items: buildItems(data, menuFuncs, options, pathName),\n });\n \n className = ' menu-submenu';\n attribute = ` ${DATA_MENU}`;\n }\n \n if (options.icon) {\n nameIcon = name\n .replace(/\\(|\\)/g, '')\n .replace(/\\s/g, '-')\n .toLowerCase();\n \n className += ` icon icon-${nameIcon}`;\n }\n \n items += rendy(TEMPLATE.ITEM, {\n name,\n subitems,\n className,\n attribute,\n path: pathName,\n });\n }\n \n return items;\n};\n\n\n//# sourceURL=file://cloudcmd/node_modules/supermenu/lib/build-items.js\n}");
|
|
1429
1440
|
|
|
1430
|
-
/***/ }
|
|
1441
|
+
/***/ },
|
|
1431
1442
|
|
|
1432
|
-
/***/ "./node_modules/supermenu/lib/element-funcs.js"
|
|
1443
|
+
/***/ "./node_modules/supermenu/lib/element-funcs.js"
|
|
1433
1444
|
/*!*****************************************************!*\
|
|
1434
1445
|
!*** ./node_modules/supermenu/lib/element-funcs.js ***!
|
|
1435
1446
|
\*****************************************************/
|
|
1436
|
-
|
|
1447
|
+
(module) {
|
|
1437
1448
|
|
|
1438
1449
|
"use strict";
|
|
1439
1450
|
eval("{\n\nmodule.exports = class ElementFuncsProto {\n getItem(element) {\n if (this.isName(element))\n return element.parentElement;\n \n return element;\n }\n \n getName(element) {\n if (!element)\n return null;\n \n if (this.isName(element))\n return element;\n \n return element.querySelector('[data-menu-path]');\n }\n \n isName(element) {\n if (!element)\n return false;\n \n return element.hasAttribute('data-menu-path');\n }\n \n isItem(element) {\n return this.checkElementsName(element, 'js-menu-item');\n }\n \n isMenu(element) {\n return this.checkElementsName(element, 'js-menu');\n }\n \n checkElementsName(element, nameElement, attribute) {\n if (!attribute)\n attribute = 'data-name';\n \n if (element) {\n const name = element.getAttribute(attribute);\n \n if (name === nameElement)\n return true;\n }\n \n return false;\n }\n \n isSubMenu(element) {\n const attribute = 'data-menu';\n const value = 'js-submenu';\n const item = this.getItem(element);\n \n return this.checkElementsName(item, value, attribute);\n }\n};\n\n\n//# sourceURL=file://cloudcmd/node_modules/supermenu/lib/element-funcs.js\n}");
|
|
1440
1451
|
|
|
1441
|
-
/***/ }
|
|
1452
|
+
/***/ },
|
|
1442
1453
|
|
|
1443
|
-
/***/ "./node_modules/supermenu/lib/supermenu.js"
|
|
1454
|
+
/***/ "./node_modules/supermenu/lib/supermenu.js"
|
|
1444
1455
|
/*!*************************************************!*\
|
|
1445
1456
|
!*** ./node_modules/supermenu/lib/supermenu.js ***!
|
|
1446
1457
|
\*************************************************/
|
|
1447
|
-
|
|
1458
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1448
1459
|
|
|
1449
1460
|
"use strict";
|
|
1450
1461
|
eval("{\n\n__webpack_require__(/*! ../css/supermenu.css */ \"./node_modules/supermenu/css/supermenu.css\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst buildItems = __webpack_require__(/*! ./build-items */ \"./node_modules/supermenu/lib/build-items.js\");\nconst ElementFuncsProto = __webpack_require__(/*! ./element-funcs */ \"./node_modules/supermenu/lib/element-funcs.js\");\nconst isFn = (a) => typeof a === 'function';\nconst isNumber = (a) => typeof a === 'number';\nconst exec = (f, ...a) => isFn(f) && f(...a);\n\nmodule.exports = Supermenu;\n\nfunction Supermenu(element, options, menuData) {\n if (!(this instanceof Supermenu))\n return new Supermenu(element, options, menuData);\n \n const ElementFuncs = new ElementFuncsProto();\n \n let Options = {};\n let Element;\n let ElementHeight;\n let ElementWidth;\n let ElementEvent;\n \n if (menuData) {\n Element = ElementEvent = element;\n Options = options;\n } else if (options) {\n Element = ElementEvent = element;\n menuData = options;\n } else {\n Element = document.body;\n ElementEvent = window;\n menuData = element;\n }\n \n const MenuFuncs = {};\n const ElementMenu = createMenu(menuData);\n \n ElementEvent.addEventListener('click', onClick);\n \n function createMenu(menuData) {\n const items = buildItems(menuData, MenuFuncs, Options);\n \n const menu = createElement('ul', {\n dataName: 'js-menu',\n className: 'menu menu-hidden',\n innerHTML: items,\n parent: Element,\n uniq: false,\n });\n \n return menu;\n }\n \n this.show = showMenuElement;\n this.hide = hideMenuElement;\n \n this.addContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.removeContextMenuListener = () => {\n ElementEvent.addEventListener('contextmenu', onContextMenu);\n };\n \n this.remove = removeElement;\n \n function removeElement() {\n ElementEvent.removeEventListener('click', onClick);\n ElementEvent.removeEventListener('contextmenu', onContextMenu);\n \n Element.removeChild(ElementMenu);\n }\n \n function checkElement(target, position) {\n let element = ElementFuncs.getItem(target);\n let isName = ElementFuncs.isName(element);\n let isItem = ElementFuncs.isItem(element);\n let isSub = ElementFuncs.isSubMenu(element);\n \n if (!isName || !isItem) {\n element = document.elementFromPoint(position.x, position.y);\n isSub = ElementFuncs.isSubMenu(element);\n isName = ElementFuncs.isName(element);\n isItem = ElementFuncs.isItem(element);\n }\n \n return {\n name: isName,\n item: isItem,\n sub: isSub,\n };\n }\n \n function onClick(event, checkResult) {\n event.stopPropagation();\n \n const {\n afterClick,\n beforeClick,\n beforeHide,\n afterHide,\n name,\n } = Options;\n \n const element = event.target;\n \n const is = checkResult || checkElement(element, {\n x: event.clientX,\n y: event.clientY,\n });\n \n const notClick = exec(beforeClick, name);\n \n if (is.sub)\n return event.preventDefault();\n \n exec(beforeHide);\n hideMenuElement();\n exec(afterHide);\n \n if (!notClick && (is.name || is.item)) {\n const itemData = getMenuItemData(element);\n \n exec(itemData);\n exec(afterClick);\n }\n }\n \n function onContextMenu(event) {\n event.preventDefault();\n \n const element = event.target;\n const x = event.clientX;\n const y = event.clientY;\n \n const is = checkElement(element, {\n x,\n y,\n });\n \n if (is.name || is.item || is.sub)\n return onClick(event, is);\n \n hideMenuElement();\n showMenuElement(x, y);\n }\n \n function setMenuPosition(x, y) {\n const isNumberX = isNumber(x);\n const isNumberY = isNumber(y);\n const heightMenu = getMenuHeight();\n const widthMenu = getMenuWidth();\n const heightInner = window.innerHeight;\n const widthInner = window.innerWidth;\n \n if (widthInner < widthMenu + x) {\n x -= widthMenu;\n \n if (x < 0)\n x = 0;\n }\n \n if (heightInner < heightMenu + y) {\n y -= heightMenu;\n \n if (y < 0)\n y = 0;\n }\n \n if (isNumberX)\n ElementMenu.style.left = `${x}px`;\n \n if (isNumberY)\n ElementMenu.style.top = y - 14 + 'px';\n }\n \n function showMenuElement(x, y) {\n const {\n name,\n beforeShow,\n afterShow,\n } = Options;\n \n const params = {\n x,\n y,\n name,\n };\n \n const isShow = exec(beforeShow, params);\n \n if (isShow || isShow !== false) {\n ElementMenu.classList.remove('menu-hidden');\n setMenuPosition(params.x, params.y);\n exec(afterShow, params);\n }\n }\n \n function hideMenuElement() {\n const notHide = exec(Options.beforeClose);\n \n if (!notHide)\n ElementMenu.classList.add('menu-hidden');\n }\n \n function getMenuItemData(element) {\n const nameElement = ElementFuncs.getName(element);\n \n if (!nameElement)\n return null;\n \n const path = nameElement.getAttribute('data-menu-path');\n \n return MenuFuncs[path];\n }\n \n function getMenuHeight() {\n if (!ElementHeight) {\n const {height} = getComputedStyle(ElementMenu);\n \n ElementHeight = parseInt(height, 10);\n }\n \n return ElementHeight;\n }\n \n function getMenuWidth() {\n if (!ElementWidth) {\n const {width} = getComputedStyle(ElementMenu);\n \n ElementWidth = parseInt(width, 10);\n }\n \n return ElementWidth;\n }\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/supermenu/lib/supermenu.js\n}");
|
|
1451
1462
|
|
|
1452
|
-
/***/ }
|
|
1463
|
+
/***/ },
|
|
1453
1464
|
|
|
1454
|
-
/***/ "./node_modules/supermenu/lib/template.js"
|
|
1465
|
+
/***/ "./node_modules/supermenu/lib/template.js"
|
|
1455
1466
|
/*!************************************************!*\
|
|
1456
1467
|
!*** ./node_modules/supermenu/lib/template.js ***!
|
|
1457
1468
|
\************************************************/
|
|
1458
|
-
|
|
1469
|
+
(module) {
|
|
1459
1470
|
|
|
1460
1471
|
"use strict";
|
|
1461
1472
|
eval("{\n\nmodule.exports.MAIN = '<ul data-name=\"js-menu\" class=\"menu menu-hidden\">{{ items }}</ul>';\nmodule.exports.ITEM = '<li data-name=\"js-menu-item\" class=\"menu-item{{ className }}\"{{ attribute }}>' +\n '<label data-menu-path=\"{{ path }}\">{{ name }}</label>' +\n '{{ subitems }}' +\n '</li>';\n\n\n//# sourceURL=file://cloudcmd/node_modules/supermenu/lib/template.js\n}");
|
|
1462
1473
|
|
|
1463
|
-
/***/ }
|
|
1474
|
+
/***/ },
|
|
1475
|
+
|
|
1476
|
+
/***/ "./node_modules/try-catch/lib/try-catch.cjs"
|
|
1477
|
+
/*!**************************************************!*\
|
|
1478
|
+
!*** ./node_modules/try-catch/lib/try-catch.cjs ***!
|
|
1479
|
+
\**************************************************/
|
|
1480
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1481
|
+
|
|
1482
|
+
"use strict";
|
|
1483
|
+
eval("{\n\nconst {tryCatch} = __webpack_require__(/*! ./try-catch.js */ \"./node_modules/try-catch/lib/try-catch.js\");\n\nmodule.exports = tryCatch;\nmodule.exports.tryCatch = tryCatch;\n\n\n//# sourceURL=file://cloudcmd/node_modules/try-catch/lib/try-catch.cjs\n}");
|
|
1484
|
+
|
|
1485
|
+
/***/ },
|
|
1464
1486
|
|
|
1465
|
-
/***/ "./node_modules/try-catch/lib/try-catch.js"
|
|
1487
|
+
/***/ "./node_modules/try-catch/lib/try-catch.js"
|
|
1466
1488
|
/*!*************************************************!*\
|
|
1467
1489
|
!*** ./node_modules/try-catch/lib/try-catch.js ***!
|
|
1468
1490
|
\*************************************************/
|
|
1469
|
-
|
|
1491
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1492
|
+
|
|
1493
|
+
"use strict";
|
|
1494
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ tryCatch: () => (/* binding */ tryCatch)\n/* harmony export */ });\nconst tryCatch = (fn, ...args) => {\n try {\n return [null, fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (tryCatch);\n\n\n//# sourceURL=file://cloudcmd/node_modules/try-catch/lib/try-catch.js\n}");
|
|
1495
|
+
|
|
1496
|
+
/***/ },
|
|
1497
|
+
|
|
1498
|
+
/***/ "./node_modules/try-to-catch/lib/try-to-catch.cjs"
|
|
1499
|
+
/*!********************************************************!*\
|
|
1500
|
+
!*** ./node_modules/try-to-catch/lib/try-to-catch.cjs ***!
|
|
1501
|
+
\********************************************************/
|
|
1502
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1470
1503
|
|
|
1471
1504
|
"use strict";
|
|
1472
|
-
eval("{\n\
|
|
1505
|
+
eval("{\n\nconst {tryToCatch} = __webpack_require__(/*! ./try-to-catch.js */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nmodule.exports = tryToCatch;\nmodule.exports.tryToCatch = tryToCatch;\n\n\n//# sourceURL=file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.cjs\n}");
|
|
1473
1506
|
|
|
1474
|
-
/***/ }
|
|
1507
|
+
/***/ },
|
|
1475
1508
|
|
|
1476
|
-
/***/ "./node_modules/try-to-catch/lib/try-to-catch.js"
|
|
1509
|
+
/***/ "./node_modules/try-to-catch/lib/try-to-catch.js"
|
|
1477
1510
|
/*!*******************************************************!*\
|
|
1478
1511
|
!*** ./node_modules/try-to-catch/lib/try-to-catch.js ***!
|
|
1479
1512
|
\*******************************************************/
|
|
1480
|
-
|
|
1513
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1481
1514
|
|
|
1482
1515
|
"use strict";
|
|
1483
|
-
eval("{\n\
|
|
1516
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ tryToCatch: () => (/* binding */ tryToCatch)\n/* harmony export */ });\nconst isFn = (a) => typeof a === 'function';\n\nconst tryToCatch = async (fn, ...args) => {\n check(fn);\n \n try {\n return [null, await fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (tryToCatch);\n\nfunction check(fn) {\n if (!isFn(fn))\n throw Error('fn should be a function!');\n}\n\n\n//# sourceURL=file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.js\n}");
|
|
1484
1517
|
|
|
1485
|
-
/***/ }
|
|
1518
|
+
/***/ },
|
|
1486
1519
|
|
|
1487
|
-
/***/ "./node_modules/wraptile/lib/wraptile.js"
|
|
1520
|
+
/***/ "./node_modules/wraptile/lib/wraptile.js"
|
|
1488
1521
|
/*!***********************************************!*\
|
|
1489
1522
|
!*** ./node_modules/wraptile/lib/wraptile.js ***!
|
|
1490
1523
|
\***********************************************/
|
|
1491
|
-
|
|
1524
|
+
(module) {
|
|
1492
1525
|
|
|
1493
1526
|
"use strict";
|
|
1494
1527
|
eval("{\n\nconst wrap = (fn) => (...a) => (...b) => fn(...a, ...b);\n\nmodule.exports = (fn, ...a) => {\n check(fn);\n \n if (a.length)\n return wrap(fn)(...a);\n \n return wrap(fn);\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be a function!');\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/wraptile/lib/wraptile.js\n}");
|
|
1495
1528
|
|
|
1496
|
-
/***/ }
|
|
1529
|
+
/***/ }
|
|
1497
1530
|
|
|
1498
1531
|
}]);
|