cloudcmd/cloudcmd.js
2018-03-01 17:47:54 +02:00

530 lines
No EOL
238 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{
/***/ "./client/dom/buffer.js":
/*!******************************!*\
!*** ./client/dom/buffer.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\n/* global CloudCmd */\n\nconst jonny = __webpack_require__(/*! jonny/legacy */ \"./node_modules/jonny/legacy/index.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\nconst DOM = __webpack_require__(/*! ./ */ \"./client/dom/index.js\");\n\nmodule.exports = new BufferProto();\n\nfunction BufferProto() {\n const Info = DOM.CurrentInfo;\n const CLASS = 'cut-file';\n const COPY = 'copy';\n const CUT = 'cut';\n const TITLE = 'Buffer';\n \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 \n function showMessage(msg) {\n DOM.Dialog.alert(TITLE, msg);\n }\n \n function getNames() {\n const files = DOM.getActiveFiles();\n const names = DOM.getFilenames(files);\n \n return names;\n }\n \n function addCutClass() {\n const files = DOM.getActiveFiles();\n \n files.forEach((element) => {\n element.classList.add(CLASS);\n });\n }\n \n function rmCutClass() {\n const files = DOM.getByClassAll(CLASS);\n \n [...files].forEach((element) => {\n element.classList.remove(CLASS);\n });\n }\n \n function callIfEnabled(callback) {\n const is = CloudCmd.config('buffer');\n \n if (is)\n return callback();\n \n showMessage('Buffer disabled in config!');\n }\n \n function copy() {\n const names = getNames();\n const from = Info.dirPath;\n \n clear();\n \n if (!names.length)\n return;\n \n Storage.remove(CUT)\n .set(COPY, {\n from,\n names,\n });\n }\n \n function cut() {\n const names = getNames();\n const from = Info.dirPath;\n \n clear();\n \n if (!names.length)\n return;\n \n addCutClass();\n \n Storage\n .set(CUT, {\n from,\n names,\n });\n }\n \n function clear() {\n Storage.remove(COPY)\n .remove(CUT);\n \n rmCutClass();\n }\n \n function paste() {\n const copy = Storage.get.bind(Storage, COPY);\n const cut = Storage.get.bind(Storage, CUT);\n \n exec.parallel([copy, cut], (error, cp, ct) => {\n const opStr = cp ? 'copy' : 'move';\n const opData = cp || ct;\n const Operation = CloudCmd.Operation;\n const msg = 'Path is same!';\n const path = Info.dirPath;\n \n if (!error && !cp && !ct)\n error = 'Buffer is empty!';\n \n if (error)\n return showMessage(error);\n \n const data = jonny.parse(opData);\n data.to = path;\n \n if (data.from === path)\n return showMessage(msg);\n \n Operation.show(opStr, data);\n clear();\n });\n }\n \n return Buffer;\n}\n\n\n//# sourceURL=file://cloudcmd/client/dom/buffer.js");
/***/ }),
/***/ "./client/dom/directory.js":
/*!*********************************!*\
!*** ./client/dom/directory.js ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/* global CloudCmd */\n\n\n\nconst philip = __webpack_require__(/*! philip */ \"./node_modules/philip/legacy/philip.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst {FS} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty,\n} = DOM;\n\nmodule.exports = (items) => {\n const Dialog = DOM.Dialog;\n \n if (items.length)\n Images.show('top');\n \n const entries = [...items].map((item) => {\n return item.webkitGetAsEntry();\n });\n \n const dirPath = getPathWhenRootEmpty();\n const path = dirPath\n .replace(/\\/$/, '');\n \n const uploader = philip(entries, (type, name, data, i, n, callback) => {\n const prefixURL = CloudCmd.PREFIX_URL;\n const full = prefixURL + FS + path + name;\n \n let upload;\n switch(type) {\n case 'file':\n upload = uploadFile(full, data);\n break;\n \n case 'directory':\n upload = uploadDir(full);\n break;\n }\n \n upload.on('end', callback);\n \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 \n setProgress(value);\n });\n });\n \n uploader.on('error', (error) => {\n Dialog.alert(error);\n uploader.abort();\n });\n \n uploader.on('progress', setProgress);\n uploader.on('end', CloudCmd.refresh);\n};\n\nfunction percent(i, n, per = 100) {\n return Math.round(i * per / n);\n}\n\nfunction setProgress(count) {\n DOM.Images\n .setProgress(count)\n .show('top');\n}\n\nfunction uploadFile(url, data) {\n return DOM.load.put(url, data);\n}\n\nfunction uploadDir(url) {\n return DOM.load.put(url + '?dir');\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/directory.js");
/***/ }),
/***/ "./client/dom/dom-tree.js":
/*!********************************!*\
!*** ./client/dom/dom-tree.js ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst DOM = module.exports;\n\n/**\n * check class of element\n *\n * @param element\n * @param className\n */\nmodule.exports.isContainClass = (element, className) => {\n if (!element)\n throw Error('element could not be empty!');\n \n if (!className)\n throw Error('className could not be empty!');\n \n const classList = element.classList;\n const ret = classList.contains(className);\n \n return ret;\n};\n\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) => {\n return DOM.getByClassAll(className, element)[0];\n};\n\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};\n\nmodule.exports.show = (element) => {\n element.classList.remove('hidden');\n return DOM;\n};\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/dom-tree.js");
/***/ }),
/***/ "./client/dom/events.js":
/*!******************************!*\
!*** ./client/dom/events.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\n\nmodule.exports = new EventsProto();\n\nfunction EventsProto() {\n const Events = this;\n \n function parseArgs(eventName, element, listener, callback) {\n let isFunc;\n const args = [\n eventName,\n element,\n listener,\n callback,\n ];\n \n const EVENT_NAME = 1;\n const ELEMENT = 0;\n const type = itype(eventName);\n \n switch(type) {\n default:\n if (!/element$/.test(type))\n throw Error('unknown eventName: ' + type);\n \n parseArgs(\n args[EVENT_NAME],\n args[ELEMENT],\n listener,\n callback\n );\n break;\n \n case 'string':\n isFunc = itype.function(element);\n \n if (isFunc) {\n listener = element;\n element = null;\n }\n \n if (!element)\n element = window;\n \n callback(element, [\n eventName,\n listener,\n false\n ]);\n break;\n \n case 'array':\n eventName.forEach((eventName) => {\n parseArgs(\n eventName,\n element,\n listener,\n callback\n );\n });\n break;\n \n case 'object':\n Object.keys(eventName).forEach((name) => {\n const eventListener = eventName[name];\n \n parseArgs(\n name,\n element,\n eventListener,\n callback\n );\n });\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 \n parseArgs(type, element, listener, (element, args) => {\n element.addEventListener.apply(element, args);\n });\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 \n if (!listener) {\n listener = element;\n element = null;\n }\n \n this.add(type, element, once);\n \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 \n parseArgs(type, element, listener, (element, args) => {\n element.removeEventListener.apply(element, args);\n });\n \n return Events;\n };\n \n /**\n * safe add event keydown listener\n *\n * @param listener\n */\n this.addKey = function(...argsArr) {\n const name = 'keydown';\n const args = [name, ...argsArr];\n \n return Events.add(...args);\n };\n \n /**\n * safe remove event click listener\n *\n * @param listener\n */\n this.rmKey = function(...argsArr) {\n const name = 'keydown';\n const args = [name, ...argsArr];\n \n return Events.remove(...args);\n };\n \n /**\n * safe add event click listener\n *\n * @param listener\n */\n this.addClick = function(...argsArr) {\n const name = 'click';\n const args = [name, ...argsArr];\n \n return Events.add(...args);\n };\n \n /**\n * safe remove event click listener\n *\n * @param listener\n */\n this.rmClick = function(...argsArr) {\n const name = 'click';\n const args = [name, ...argsArr];\n \n return Events.remove(...args);\n };\n \n this.addContextMenu = function(...argsArr) {\n const name = 'contextmenu';\n const args = [name, ...argsArr];\n \n return Events.add(...args);\n };\n \n /**\n * safe add event click listener\n *\n * @param listener\n */\n this.addError = function(...argsArr) {\n const name = 'error';\n const args = [name, ...argsArr];\n \n return Events.add(...args);\n };\n \n /**\n * safe add load click listener\n *\n * @param listener\n */\n this.addLoad = function(...argsArr) {\n const name = 'load';\n const args = [name, ...argsArr];\n \n return Events.add(...args);\n };\n \n function checkType(type) {\n if (!type)\n throw Error('type could not be empty!');\n }\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/events.js");
/***/ }),
/***/ "./client/dom/files.js":
/*!*****************************!*\
!*** ./client/dom/files.js ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/* global CloudCmd */\n\n\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\nconst currify = __webpack_require__(/*! currify/legacy */ \"./node_modules/currify/legacy/index.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\n\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);\n\nconst get = currify(getFile);\nconst unaryMap = (array, fn) => array.map((a) => fn(a));\n\nmodule.exports.get = get;\n\nfunction getFile(name, callback) {\n const type = itype(name);\n let array;\n \n check(name, callback);\n \n switch(type) {\n case 'string':\n getModule(name, callback);\n break;\n \n case 'array':\n array = unaryMap(name, get);\n \n exec.parallel(array, callback);\n break;\n }\n}\n\nfunction check(name, callback) {\n if (!name)\n throw Error('name could not be empty!');\n \n if (typeof callback !== 'function')\n throw Error('callback should be a function');\n}\n\nfunction getModule(name, callback) {\n let path;\n \n const regExpHTML = new RegExp(FILES_HTML + '|' + FILES_HTML_ROOT);\n const regExpJSON = new RegExp(FILES_JSON);\n \n const isHTML = regExpHTML.test(name);\n const isJSON = regExpJSON.test(name);\n \n if (!isHTML && !isJSON) {\n showError(name);\n } else if (name === 'config') {\n getConfig(callback);\n } else {\n path = getPath(name, isHTML, isJSON);\n \n getSystemFile(path, callback);\n }\n \n}\n\nfunction getPath(name, isHTML, isJSON) {\n let path;\n const regExp = new RegExp(FILES_HTML_ROOT);\n const isRoot = regExp.test(name);\n \n if (isHTML) {\n if (isRoot)\n path = DIR_HTML + name.replace('-tmpl', '');\n else\n path = DIR_HTML_FS + name;\n \n path += '.hbs';\n } else if (isJSON) {\n path = DIR_JSON + name + '.json';\n }\n \n return path;\n}\n\nfunction showError(name) {\n const str = 'Wrong file name: ' + name;\n const error = new Error(str);\n \n throw(error);\n}\n\nfunction getSystemFile(file, callback) {\n const prefix = CloudCmd.PREFIX;\n \n if (!Promises[file])\n Promises[file] = new Promise((success, error) => {\n const url = prefix + file;\n \n load.ajax({\n url,\n success,\n error\n });\n });\n \n Promises[file].then((data) => {\n callback(null, data);\n }, (error) => {\n Promises[file] = null;\n callback(error);\n });\n}\n\nfunction getConfig(callback) {\n let is;\n \n if (!Promises.config)\n Promises.config = new Promise((resolve, reject) => {\n is = true;\n RESTful.Config.read((error, data) => {\n if (error)\n return reject(error);\n \n resolve(data);\n });\n });\n \n Promises.config.then(function(data) {\n is = false;\n Storage.setAllowed(data.localStorage);\n \n callback(null, data);\n \n timeout(() => {\n if (!is)\n Promises.config = null;\n });\n }, function() {\n if (!is)\n Promises.config = null;\n });\n}\n\nfunction getTimeoutOnce(time) {\n let is;\n \n return (callback) => {\n if (is)\n return;\n \n is = true;\n \n setTimeout(() => {\n is = false;\n callback();\n }, time);\n };\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/files.js");
/***/ }),
/***/ "./client/dom/images.js":
/*!******************************!*\
!*** ./client/dom/images.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/* global CloudCmd */\n/* global DOM */\n\n\n\nconst Images = module.exports;\n\nconst LOADING = 'loading';\nconst HIDDEN = 'hidden';\nconst ERROR = 'error';\n\nconst LoadingImage = LOADING + getLoadingType();\n\nfunction getLoadingType() {\n return isSVG() ? '-svg' : '-gif';\n}\n\nmodule.exports.get = getElement;\n\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 \n if (!createNS)\n return false;\n \n const create = createNS.bind(document);\n const svgNode = create(SVG_URL, 'animate');\n const name = svgNode.toString();\n \n return /SVGAnimate/.test(name);\n}\n\n\nfunction getElement() {\n return DOM.load({\n name : 'span',\n id : 'js-status-image',\n className : 'icon',\n attribute : 'data-progress',\n notAppend : true\n });\n}\n\n/* Функция создаёт картинку загрузки */\nmodule.exports.loading = () => {\n const element = getElement();\n const classList = element.classList;\n \n classList.add(LOADING, LoadingImage);\n classList.remove(ERROR, HIDDEN);\n \n return element;\n};\n\n/* Функция создаёт картинку ошибки загрузки */\nmodule.exports.error = () => {\n const element = getElement();\n const classList = element.classList;\n \n classList.add(ERROR);\n classList.remove(HIDDEN, LOADING, LoadingImage);\n \n return element;\n};\n\nmodule.exports.show = show;\nmodule.exports.show.load = show;\nmodule.exports.show.error = error;\n\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 \n let current;\n\n if (position === 'top') {\n current = refreshButton.parentElement;\n } else {\n current = DOM.getCurrentFile();\n \n if (current)\n current = DOM.getByDataName('js-name', current);\n else\n current = refreshButton.parentElement;\n }\n \n if (!parent || (parent && parent !== current))\n current.appendChild(image);\n \n DOM.show(image);\n \n return image;\n}\n\nfunction error(text) {\n const image = Images.error();\n \n DOM.show(image);\n image.title = text;\n \n CloudCmd.log(text);\n \n return image;\n}\n\n/**\n* hide load image\n*/\nmodule.exports.hide = () => {\n const element = Images.get();\n \n DOM.hide(element);\n \n return Images;\n};\n\nmodule.exports.setProgress = (value, title) => {\n const DATA = 'data-progress';\n const element = Images.get();\n \n if (!element)\n return Images;\n \n element.setAttribute(DATA, value + '%');\n \n if (title)\n element.title = title;\n \n return Images;\n};\n\nmodule.exports.clearProgress = () => {\n const DATA = 'data-progress';\n const element = Images.get();\n \n if (!element)\n return Images;\n \n element.setAttribute(DATA, '');\n element.title = '';\n \n return Images;\n};\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/images.js");
/***/ }),
/***/ "./client/dom/index.js":
/*!*****************************!*\
!*** ./client/dom/index.js ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/* global CloudCmd */\n\n\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst jonny = __webpack_require__(/*! jonny/legacy */ \"./node_modules/jonny/legacy/index.js\");\nconst Util = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nconst {\n getTitle,\n FS,\n Entity,\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst DOMTree = __webpack_require__(/*! ./dom-tree */ \"./client/dom/dom-tree.js\");\n\nconst DOM = Object.assign({}, DOMTree, new CmdProto());\n\nmodule.exports = DOM;\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\nconst RESTful = __webpack_require__(/*! ./rest */ \"./client/dom/rest.js\");\nconst Storage = __webpack_require__(/*! ./storage */ \"./client/dom/storage.js\");\n\nDOM.Images = Images;\nDOM.load = load;\nDOM.Files = Files;\nDOM.RESTful = RESTful;\nDOM.Storage = Storage;\n\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.js\");\n\nconst loadRemote = __webpack_require__(/*! ./load-remote */ \"./client/dom/load-remote.js\");\nconst selectByPattern = __webpack_require__(/*! ./select-by-pattern */ \"./client/dom/select-by-pattern.js\");\n\nfunction CmdProto() {\n let Title;\n let CurrentInfo = {};\n \n const Cmd = this;\n const CURRENT_FILE = 'current-file';\n const SELECTED_FILE = 'selected-file';\n const TITLE = 'Cloud Commander';\n const TabPanel = {\n 'js-left' : null,\n 'js-right' : null\n };\n \n this.loadRemote = (name, options, callback) => {\n loadRemote(name, options, callback);\n return DOM;\n };\n /**\n * load jquery from google cdn or local copy\n * @param callback\n */\n this.loadJquery = function(callback) {\n DOM.loadRemote('jquery', {\n name : '$'\n }, callback);\n \n return DOM;\n };\n \n this.loadSocket = function(callback) {\n DOM.loadRemote('socket', {\n name : 'io'\n }, callback);\n \n return DOM;\n };\n \n /** function loads css and js of Menu\n * @param callback\n */\n this.loadMenu = function(callback) {\n return DOM.loadRemote('menu', callback);\n };\n \n /**\n * create new folder\n *\n */\n this.promptNewDir = function() {\n promptNew('directory', '?dir');\n };\n \n /**\n * create new file\n *\n * @typeName\n * @type\n */\n this.promptNewFile = () => {\n promptNew('file');\n };\n \n function promptNew(typeName, type) {\n const {Dialog} = DOM;\n const dir = Cmd.getCurrentDirPath();\n const msg = 'New ' + typeName || 'File';\n const getName = () => {\n const name = Cmd.getCurrentName();\n \n if (name === '..')\n return '';\n \n return name;\n };\n \n const name = getName();\n const cancel = false;\n \n Dialog.prompt(TITLE, msg, name, {cancel}).then((name) => {\n if (!name)\n return;\n \n const path = (type) => {\n const result = dir + name;\n \n if (!type)\n return result;\n \n return result + type;\n };\n \n RESTful.write(path(type), (error) => {\n if (error)\n return;\n \n const currentName = name;\n \n CloudCmd.refresh({\n currentName\n });\n });\n });\n }\n \n /**\n * get current direcotory name\n */\n this.getCurrentDirName = () => {\n const href = DOM.getCurrentDirPath()\n .replace(/\\/$/, '');\n \n const substr = href.substr(href, href.lastIndexOf('/'));\n const ret = href.replace(substr + '/', '') || '/';\n \n return ret;\n };\n \n /**\n * get current direcotory path\n */\n this.getCurrentDirPath = (panel = DOM.getPanel()) => {\n const path = DOM.getByDataName('js-path', panel);\n const ret = path && path.textContent;\n \n return ret;\n };\n \n /**\n * get current direcotory path\n */\n this.getParentDirPath = (panel) => {\n const path = DOM.getCurrentDirPath(panel);\n const dirName = DOM.getCurrentDirName() + '/';\n \n if (path !== '/')\n return path.replace(RegExp(dirName + '$'), '');\n \n return path;\n };\n \n /**\n * get not current direcotory path\n */\n this.getNotCurrentDirPath = () => {\n const panel = DOM.getPanel({active: false});\n const path = DOM.getCurrentDirPath(panel);\n \n return path;\n };\n \n /**\n * unified way to get current file\n *\n * @currentFile\n */\n this.getCurrentFile = () => {\n return DOM.getByClass(CURRENT_FILE);\n };\n \n /**\n * get current file by name\n */\n this.getCurrentByName = (name, panel = CurrentInfo.panel) => {\n const dataName = 'js-file-' + name;\n const element = DOM.getByDataName(dataName, panel);\n \n return element;\n };\n \n /**\n * unified way to get current file\n *\n * @currentFile\n */\n this.getSelectedFiles = () => {\n const panel = DOM.getPanel();\n const selected = DOM.getByClassAll(SELECTED_FILE, panel);\n \n return [...selected];\n };\n \n /*\n * unselect all files\n */\n this.unselectFiles = (files) => {\n files = files || DOM.getSelectedFiles();\n \n [...files].forEach(DOM.toggleSelectedFile);\n };\n \n /**\n * get all selected files or current when none selected\n *\n * @currentFile\n */\n this.getActiveFiles = () => {\n const current = DOM.getCurrentFile();\n const files = DOM.getSelectedFiles();\n const name = DOM.getCurrentName(current);\n \n if (!files.length && name !== '..')\n return [current];\n \n return files;\n };\n \n this.getCurrentDate = (currentFile) => {\n const current = currentFile || Cmd.getCurrentFile();\n const date = DOM\n .getByDataName('js-date', current)\n .textContent;\n \n return date;\n };\n \n /**\n * get size\n * @currentFile\n */\n this.getCurrentSize = (currentFile) => {\n const current = currentFile || Cmd.getCurrentFile();\n /* если это папка - возвращаем слово dir вместо размера*/\n const size = DOM.getByDataName('js-size', current)\n .textContent\n .replace(/^<|>$/g, '');\n \n return size;\n };\n \n /**\n * get size\n * @currentFile\n */\n this.loadCurrentSize = (callback, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?size';\n const link = DOM.getCurrentPath(current);\n \n Images.show.load();\n \n if (name === '..')\n return;\n \n RESTful.read(link + query, (error, size) => {\n if (error)\n return;\n \n DOM.setCurrentSize(size, current);\n exec(callback, current);\n Images.hide();\n });\n };\n \n /**\n * load hash\n * @callback\n * @currentFile\n */\n this.loadCurrentHash = (callback, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?hash';\n const link = DOM.getCurrentPath(current);\n \n RESTful.read(link + query, callback);\n };\n \n /**\n * load current modification time of file\n * @callback\n * @currentFile\n */\n this.loadCurrentTime = (callback, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const query = '?time';\n const link = DOM.getCurrentPath(current);\n \n RESTful.read(link + query, callback);\n };\n \n /**\n * set size\n * @currentFile\n */\n this.setCurrentSize = (size, currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const sizeElement = DOM.getByDataName('js-size', current);\n \n sizeElement.textContent = size;\n };\n \n /**\n * @currentFile\n */\n this.getCurrentMode = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const mode = DOM.getByDataName('js-mode', current);\n \n return mode.textContent;\n };\n \n /**\n * @currentFile\n */\n this.getCurrentOwner = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const owner = DOM.getByDataName('js-owner', current);\n \n return owner.textContent;\n };\n \n /**\n * unified way to get current file content\n *\n * @param callback\n * @param currentFile\n */\n this.getCurrentData = (callback, currentFile) => {\n let hash;\n const Dialog = DOM.Dialog;\n const Info = DOM.CurrentInfo;\n const current = currentFile || DOM.getCurrentFile();\n const path = DOM.getCurrentPath(current);\n const isDir = DOM.isCurrentIsDir(current);\n \n const func = (error, data) => {\n const ONE_MEGABYTE = 1024 * 1024 * 1024;\n \n if (!error) {\n if (itype.object(data))\n data = jonny.stringify(data);\n \n const length = data.length;\n \n if (hash && length < ONE_MEGABYTE)\n DOM.saveDataToStorage(path, data, hash);\n }\n \n callback(error, data);\n };\n \n if (Info.name === '..') {\n Dialog.alert.noFiles(TITLE);\n return callback(Error('No files selected!'));\n }\n \n if (isDir)\n return RESTful.read(path, func);\n \n DOM.checkStorageHash(path, (error, equal, hashNew) => {\n if (error)\n return callback(error);\n \n if (equal)\n return DOM.getDataFromStorage(path, callback);\n \n hash = hashNew;\n RESTful.read(path, func);\n });\n };\n \n /**\n * unified way to save current file content\n *\n * @callback - function({data, name}) {}\n * @currentFile\n */\n this.saveCurrentData = (url, data, callback, query = '') => {\n DOM.RESTful.write(url + query, data, (error) => {\n !error && DOM.saveDataToStorage(url, data);\n });\n };\n \n /**\n * unified way to get RefreshButton\n */\n this.getRefreshButton = (panel) => {\n const currentPanel = panel || DOM.getPanel();\n const refresh = DOM.getByDataName('js-refresh', currentPanel);\n \n return refresh;\n };\n \n this.setCurrentByName = (name) => {\n const current = DOM.getCurrentByName(name);\n return DOM.setCurrentFile(current);\n };\n \n /**\n * private function thet unset currentfile\n *\n * @currentFile\n */\n function unsetCurrentFile(currentFile) {\n const is = DOM.isCurrentFile(currentFile);\n \n if (!is)\n return;\n \n currentFile.classList.remove(CURRENT_FILE);\n }\n \n /**\n * unified way to set current file\n */\n this.setCurrentFile = (currentFile, options) => {\n const o = options;\n const CENTER = true;\n const currentFileWas = DOM.getCurrentFile();\n \n if (!currentFile)\n return DOM;\n \n let pathWas = '';\n \n if (currentFileWas) {\n pathWas = DOM.getCurrentDirPath();\n unsetCurrentFile(currentFileWas);\n }\n \n currentFile.classList.add(CURRENT_FILE);\n \n let path = DOM.getCurrentDirPath();\n \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 !== false) {\n if (path !== '/')\n path = FS + path;\n \n DOM.setHistory(path, null, path);\n }\n }\n \n /* scrolling to current file */\n DOM.scrollIntoViewIfNeeded(currentFile, CENTER);\n \n Cmd.updateCurrentInfo(currentFile);\n \n return DOM;\n };\n \n /*\n * set current file by position\n *\n * @param layer - element\n * @param - position {x, y}\n */\n this.getCurrentByPosition = ({x, y}) => {\n const element = document.elementFromPoint(x, y);\n \n const getEl = (el) => {\n const {tagName} = el;\n const isChild = /A|SPAN|LI/.test(tagName);\n \n if (!isChild)\n return null;\n \n if (tagName === 'A')\n return el.parentElement.parentElement;\n \n if (tagName === 'SPAN')\n return el.parentElement;\n \n return el;\n };\n \n const el = getEl(element);\n \n if (el && el.tagName !== 'LI')\n return null;\n \n return el;\n };\n \n /**\n * select current file\n * @param currentFile\n */\n this.selectFile = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n \n current.classList.add(SELECTED_FILE);\n \n return Cmd;\n };\n \n this.unselectFile = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n \n current.classList.remove(SELECTED_FILE);\n \n return Cmd;\n };\n \n this.toggleSelectedFile = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const name = DOM.getCurrentName(current);\n \n if (name === '..')\n return Cmd;\n \n current.classList.toggle(SELECTED_FILE);\n \n return Cmd;\n };\n \n this.toggleAllSelectedFiles = () => {\n DOM.getAllFiles().map(DOM.toggleSelectedFile);\n \n return Cmd;\n };\n \n this.selectAllFiles = () => {\n DOM.getAllFiles().map(DOM.selectFile);\n \n return Cmd;\n };\n \n this.getAllFiles = () => {\n const panel = DOM.getPanel();\n const files = DOM.getFiles(panel);\n const name = DOM.getCurrentName(files[0]);\n \n const from = (a) => a === '..' ? 1 : 0;\n const i = from(name);\n \n return [...files].slice(i);\n };\n \n /**\n * open dialog with expand selection\n */\n this.expandSelection = () => {\n const msg = 'expand';\n const files = CurrentInfo.files;\n \n selectByPattern(msg, files);\n };\n \n /**\n * open dialog with shrink selection\n */\n this.shrinkSelection = () => {\n const msg = 'shrink';\n const files = CurrentInfo.files;\n \n selectByPattern(msg, files);\n };\n \n /**\n * setting history wrapper\n */\n this.setHistory = (data, title, url) => {\n const ret = window.history;\n \n url = CloudCmd.PREFIX + url;\n \n if (ret)\n history.pushState(data, title, url);\n \n return ret;\n };\n \n /**\n * set title or create title element\n *\n * @param name\n */\n \n this.setTitle = (name) => {\n if (!Title)\n Title = DOM.getByTag('title')[0] ||\n DOM.load({\n name : 'title',\n innerHTML : name,\n parentElement : document.head\n });\n \n Title.textContent = name;\n \n return DOM;\n };\n \n /**\n * current file check\n *\n * @param currentFile\n */\n this.isCurrentFile = (currentFile) => {\n if (!currentFile)\n return false;\n \n return DOM.isContainClass(currentFile, CURRENT_FILE);\n };\n \n /**\n * selected file check\n *\n * @param currentFile\n */\n this.isSelected = (selected) => {\n if (!selected)\n return false;\n \n return DOM.isContainClass(selected, SELECTED_FILE);\n };\n \n /**\n * check is current file is a directory\n *\n * @param currentFile\n */\n this.isCurrentIsDir = (currentFile) => {\n const current = currentFile || this.getCurrentFile();\n const fileType = DOM.getByDataName('js-type', current);\n const ret = DOM.isContainClass(fileType, 'directory');\n \n return ret;\n };\n \n /**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\n this.getCurrentLink = (currentFile) => {\n const current = currentFile || this.getCurrentFile();\n const link = DOM.getByTag('a', current);\n \n return link[0];\n };\n \n /**\n * get link from current (or param) file\n *\n * @param currentFile - current file by default\n */\n this.getCurrentPath = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n const element = DOM.getByTag('a', current)[0];\n const prefix = CloudCmd.PREFIX;\n const path = element.getAttribute('href')\n .replace(RegExp('^' + prefix + FS), '');\n \n return path;\n };\n \n /**\n * get name from current (or param) file\n *\n * @param currentFile\n */\n this.getCurrentName = (currentFile) => {\n const current = currentFile || DOM.getCurrentFile();\n \n if (!current)\n return '';\n \n const link = DOM.getCurrentLink(current);\n \n if (!link)\n return '';\n \n const name = link.title;\n \n return name;\n };\n \n this.getFilenames = (files) => {\n if (!files)\n throw Error('AllFiles could not be empty');\n \n const first = files[0] || DOM.getCurrentFile();\n const name = DOM.getCurrentName(first);\n \n const allFiles = [...files];\n \n if (name === '..')\n allFiles.shift();\n \n const names = allFiles.map((current) => {\n return DOM.getCurrentName(current);\n });\n \n return names;\n };\n \n /**\n * set name from current (or param) file\n *\n * @param name\n * @param current\n */\n this.setCurrentName = (name, current) => {\n const Info = CurrentInfo;\n const link = Info.link;\n const PREFIX = CloudCmd.PREFIX;\n const dir = PREFIX + FS + Info.dirPath;\n \n link.title = name;\n link.innerHTML = Entity.encode(name);\n link.href = dir + name;\n \n current.setAttribute('data-name', 'js-file-' + name);\n \n return link;\n };\n \n /**\n * check storage hash\n */\n this.checkStorageHash = (name, callback) => {\n const parallel = exec.parallel;\n const loadHash = DOM.loadCurrentHash;\n const nameHash = name + '-hash';\n const getStoreHash = exec.with(Storage.get, nameHash);\n \n if (typeof name !== 'string')\n throw Error('name should be a string!');\n \n if (typeof callback !== 'function')\n throw Error('callback should be a function!');\n \n parallel([loadHash, getStoreHash], (error, loadHash, storeHash) => {\n let equal;\n const isContain = /error/.test(loadHash);\n \n if (isContain)\n error = loadHash;\n else if (loadHash === storeHash)\n equal = true;\n \n callback(error, equal, loadHash);\n });\n };\n \n /**\n * save data to storage\n *\n * @param name\n * @param data\n * @param hash\n * @param callback\n */\n this.saveDataToStorage = function(name, data, hash, callback) {\n const allowed = CloudCmd.config('localStorage');\n const isDir = DOM.isCurrentIsDir();\n const nameHash = name + '-hash';\n const nameData = name + '-data';\n \n if (!allowed || isDir)\n return exec(callback);\n \n exec.if(hash, () => {\n Storage.set(nameHash, hash);\n Storage.set(nameData, data);\n \n exec(callback, hash);\n }, (callback) => {\n DOM.loadCurrentHash((error, loadHash) => {\n hash = loadHash;\n callback();\n });\n });\n };\n \n /**\n * save data to storage\n *\n * @param name\n * @param data\n * @param callback\n */\n this.getDataFromStorage = (name, callback) => {\n const nameHash = name + '-hash';\n const nameData = name + '-data';\n const allowed = CloudCmd.config('localStorage');\n const isDir = DOM.isCurrentIsDir();\n \n if (!allowed || isDir)\n return exec(callback);\n \n exec.parallel([\n exec.with(Storage.get, nameData),\n exec.with(Storage.get, nameHash),\n ], callback);\n };\n \n this.getFM = () => {\n return DOM.getPanel().parentElement;\n };\n \n this.getPanelPosition = (panel) => {\n panel = panel || DOM.getPanel();\n \n return panel.dataset.name.replace('js-', '');\n };\n \n /** function getting panel active, or passive\n * @param options = {active: true}\n */\n this.getPanel = (options) => {\n let files, panel, isLeft;\n let dataName = 'js-';\n \n const current = DOM.getCurrentFile();\n \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)\n panel = DOM.getByDataName('js-left');\n \n if (!panel)\n throw Error('can not find Active Panel!');\n \n return panel;\n };\n \n this.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 */\n this.showPanel = (active) => {\n const panel = DOM.getPanel({active: active});\n \n if (!panel)\n return false;\n \n DOM.show(panel);\n \n return true;\n };\n \n /**\n * hides panel right or left (or active)\n */\n this.hidePanel = (active) => {\n const panel = DOM.getPanel({\n active\n });\n \n if (!panel)\n return false;\n \n return DOM.hide(panel);\n };\n \n /**\n * remove child of element\n * @param pChild\n * @param element\n */\n this.remove = (child, element) => {\n const parent = element || document.body;\n \n parent.removeChild(child);\n \n return DOM;\n };\n \n /**\n * remove current file from file table\n * @param current\n *\n */\n this.deleteCurrent = (current) => {\n if (!current)\n Cmd.getCurrentFile();\n \n const parent = current && current.parentElement;\n const name = Cmd.getCurrentName(current);\n \n if (current && name !== '..') {\n const next = current.nextSibling;\n const prev = current.previousSibling;\n \n DOM.setCurrentFile(next || prev);\n parent.removeChild(current);\n }\n };\n \n /**\n * remove selected files from file table\n * @Selected\n */\n this.deleteSelected = (selected) => {\n selected = selected || DOM.getSelectedFiles();\n \n if (!selected)\n return;\n \n selected.map(DOM.deleteCurrent);\n };\n \n /**\n * rename current file\n *\n * @currentFile\n */\n this.renameCurrent = (current) => {\n const Dialog = DOM.Dialog;\n \n if (!Cmd.isCurrentFile(current))\n current = Cmd.getCurrentFile();\n \n const from = Cmd.getCurrentName(current);\n \n if (from === '..')\n return Dialog.alert.noFiles(TITLE);\n \n const cancel = false;\n \n Dialog.prompt(TITLE, 'Rename', from, {cancel}).then((to) => {\n const isExist = !!DOM.getCurrentByName(to);\n const dirPath = Cmd.getCurrentDirPath();\n \n if (from === to)\n return;\n \n const files = {\n from : dirPath + from,\n to : dirPath + to\n };\n \n RESTful.mv(files, (error) => {\n if (error)\n return;\n \n DOM.setCurrentName(to, current);\n Cmd.updateCurrentInfo(current);\n Storage.remove(dirPath);\n \n if (isExist)\n CloudCmd.refresh();\n });\n });\n };\n \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 */\n this.scrollIntoViewIfNeeded = function(element, center = false) {\n if (!element || !element.scrollIntoViewIfNeeded)\n return;\n \n element.scrollIntoViewIfNeeded(center);\n };\n \n /* scroll on one page */\n this.scrollByPages = (element, pPages) => {\n const ret = element && element.scrollByPages && pPages;\n \n if (ret)\n element.scrollByPages(pPages);\n \n return ret;\n };\n \n this.changePanel = () => {\n let panel = DOM.getPanel();\n const panelPassive = DOM.getPanel({\n active: false\n });\n \n let name = DOM.getCurrentName();\n const filesPassive = DOM.getFiles(panelPassive);\n \n let dataName = panel.getAttribute('data-name');\n \n TabPanel[dataName] = name;\n \n panel = panelPassive;\n dataName = panel.getAttribute('data-name');\n \n name = TabPanel[dataName];\n \n let files;\n let current;\n \n if (name) {\n current = DOM.getCurrentByName(name, panel);\n \n if (current)\n files = current.parentElement;\n }\n \n if (!files || !files.parentElement) {\n current = DOM.getCurrentByName(name, panel);\n \n if (!current)\n current = filesPassive[0];\n }\n \n DOM.setCurrentFile(current, {\n history: true\n });\n \n return DOM;\n };\n \n this.getPackerExt = (type) => {\n if (type === 'zip')\n return '.zip';\n \n return '.tar.gz';\n };\n \n this.goToDirectory = () => {\n const msg = 'Go to directory:';\n const path = CurrentInfo.dirPath;\n const Dialog = DOM.Dialog;\n const cancel = false;\n const setPath = (path) => ({\n path\n });\n \n Dialog.prompt(TITLE, msg, path, {cancel})\n .then(setPath)\n .then(CloudCmd.loadDir);\n },\n \n this.duplicatePanel = () => {\n const Info = CurrentInfo;\n const isDir = Info.isDir;\n const panel = Info.panelPassive;\n const noCurrent = !Info.isOnePanel;\n \n const getPath = (isDir) => {\n if (isDir)\n return Info.path;\n \n return Info.dirPath;\n };\n \n const path = getPath(isDir);\n \n CloudCmd.loadDir({\n path,\n panel,\n noCurrent,\n });\n };\n \n this.swapPanels = () => {\n const Info = CurrentInfo;\n const {panel} = Info;\n const {files} = Info;\n const {element} = Info;\n \n const panelPassive = Info.panelPassive;\n \n const dirPath = DOM.getCurrentDirPath();\n const dirPathPassive = DOM.getNotCurrentDirPath();\n \n let currentIndex = files.indexOf(element);\n \n CloudCmd.loadDir({\n path: dirPath,\n panel: panelPassive,\n noCurrent: true\n });\n \n CloudCmd.loadDir({\n path: dirPathPassive,\n panel: panel\n }, () => {\n const files = Info.files;\n const length = files.length - 1;\n \n if (currentIndex > length)\n currentIndex = length;\n \n const el = files[currentIndex];\n \n DOM.setCurrentFile(el);\n });\n };\n \n this.CurrentInfo = CurrentInfo,\n \n this.updateCurrentInfo = (currentFile) => {\n const info = Cmd.CurrentInfo;\n const current = currentFile || Cmd.getCurrentFile();\n const files = current.parentElement;\n const panel = files.parentElement;\n \n const panelPassive = Cmd.getPanel({\n active: false\n });\n \n const filesPassive = DOM.getFiles(panelPassive);\n const name = Cmd.getCurrentName(current);\n \n info.dir = Cmd.getCurrentDirName();\n info.dirPath = Cmd.getCurrentDirPath();\n info.parentDirPath = Cmd.getParentDirPath();\n info.element = current;\n info.ext = Util.getExt(name);\n info.files = [...files.children];\n info.filesPassive = [...filesPassive];\n info.first = files.firstChild;\n info.getData = Cmd.getCurrentData;\n info.last = files.lastChild;\n info.link = Cmd.getCurrentLink(current);\n info.mode = Cmd.getCurrentMode(current);\n info.name = name;\n info.path = Cmd.getCurrentPath(current);\n info.panel = panel;\n info.panelPassive = panelPassive;\n info.size = Cmd.getCurrentSize(current);\n info.isDir = Cmd.isCurrentIsDir();\n info.isSelected = Cmd.isSelected(current);\n info.panelPosition = Cmd.getPanel().dataset.name.replace('js-', '');\n info.isOnePanel =\n info.panel.getAttribute('data-name') ===\n info.panelPassive.getAttribute('data-name');\n };\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/index.js");
/***/ }),
/***/ "./client/dom/load-remote.js":
/*!***********************************!*\
!*** ./client/dom/load-remote.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\n/* global CloudCmd */\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\nconst {findObjByNameInArr} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst Files = __webpack_require__(/*! ./files */ \"./client/dom/files.js\");\n\nmodule.exports = (name, options, callback = options) => {\n const {PREFIX, config} = CloudCmd;\n const o = options;\n \n if (o.name && window[o.name])\n return callback();\n \n Files.get('modules', (error, modules) => {\n const online = config('online') && navigator.onLine;\n const module = findObjByNameInArr(modules.remote, name);\n \n const isArray = itype.array(module.local);\n const version = module.version;\n \n let remoteTmpls, local;\n if (isArray) {\n remoteTmpls = module.remote;\n local = module.local;\n } else {\n remoteTmpls = [module.remote];\n local = [module.local];\n }\n \n const localURL = local.map((url) => {\n return PREFIX + url;\n });\n \n const remoteURL = remoteTmpls.map((tmpl) => {\n return rendy(tmpl, {\n version: version\n });\n });\n \n const on = funcON(localURL, remoteURL, callback);\n const off = funcOFF(localURL, callback);\n \n exec.if(online, on, off);\n });\n};\n\nfunction funcOFF(local, callback) {\n return () => {\n load.parallel(local, callback);\n };\n}\n\nfunction funcON (local, remote,callback) {\n return () => {\n load.parallel(remote, (error) => {\n if (error)\n return funcOFF();\n \n callback();\n });\n };\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/load-remote.js");
/***/ }),
/***/ "./client/dom/load.js":
/*!****************************!*\
!*** ./client/dom/load.js ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\nconst jonny = __webpack_require__(/*! jonny/legacy */ \"./node_modules/jonny/legacy/index.js\");\nconst Emitify = __webpack_require__(/*! emitify/legacy */ \"./node_modules/emitify/legacy/index.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ./events */ \"./client/dom/events.js\");\n\nconst {getExt} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nmodule.exports = load;\nmodule.exports.getIdBySrc = getIdBySrc;\nmodule.exports.ext = ext;\n\n/**\n * Функция создаёт элемент и загружает файл с src.\n *\n * @param params = {\n * name, - название тэга\n * src', - путь к файлу\n * func, - обьект, содержаий одну из функций\n * или сразу две onload и onerror\n * {onload: function() {}, onerror: function();}\n * style,\n * id,\n * element,\n * async, - true by default\n * inner: 'id{color:red, },\n * class,\n * notAppend - false by default\n *\n */\nfunction load(params) {\n const {\n src,\n id = getIdBySrc(params.src),\n func,\n name,\n async,\n inner,\n style,\n parent = document.body,\n className,\n attribute,\n notAppend,\n } = params;\n \n let element = document.getElementById(id);\n \n if (element) {\n exec(func);\n return element;\n }\n \n element = document.createElement(name);\n \n const funcError = () => {\n const msg = `file ${src} could not be loaded`;\n const error = new Error(msg);\n \n parent.removeChild(element);\n \n Images.show.error(msg);\n \n const callback = func && func.onerror || func.onload || func;\n \n exec(callback, error);\n };\n \n const funcLoad = () => {\n const callback = func && func.onload || func;\n \n Events.remove('error', element, funcError);\n \n exec(callback);\n };\n \n if (/^(script|link)$/.test(name))\n Events.addOnce('load', element, funcLoad)\n .addError(element, funcError);\n \n if (id)\n element.id = id;\n \n if (className)\n element.className = className;\n \n if (src) {\n if (name !== 'link') {\n element.src = src;\n } else {\n element.href = src;\n element.rel = 'stylesheet';\n }\n }\n \n if (attribute) {\n const type = itype(attribute);\n \n switch(type) {\n case 'string':\n element.setAttribute(attribute, '');\n break;\n \n case 'object':\n Object.keys(attribute).forEach((name) => {\n element.setAttribute(name, attribute[name]);\n });\n break;\n }\n }\n \n if (style)\n element.style.cssText = style;\n \n if (async && name === 'script' || async === undefined)\n element.async = true;\n \n if (!notAppend)\n parent.appendChild(element);\n \n if (inner)\n element.innerHTML = inner;\n \n return element;\n}\n\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 \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\n .replace(sub, '')\n .replace(/\\./g, '-');\n \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 headers = p.headers || {};\n const xhr = new XMLHttpRequest();\n \n xhr.open(type, p.url, true);\n \n Object.keys(headers).forEach((name) => {\n const value = headers[name];\n xhr.setRequestHeader(name, value);\n });\n \n if (p.responseType)\n xhr.responseType = p.responseType;\n \n let data;\n if (!isArrayBuf && isObject || isArray)\n data = jonny.stringify(p.data);\n else\n data = p.data;\n \n xhr.onreadystatechange = (event) => {\n const xhr = event.target;\n const OK = 200;\n \n if (xhr.readyState !== xhr.DONE)\n return;\n \n Images.clearProgress();\n \n const TYPE_JSON = 'application/json';\n const type = xhr.getResponseHeader('content-type');\n \n if (xhr.status !== OK)\n return exec(p.error, xhr);\n \n const notText = p.dataType !== 'text';\n const isContain = ~type.indexOf(TYPE_JSON);\n \n let data = xhr.response;\n if (type && isContain && notText)\n data = jonny.parse(xhr.response) || xhr.response;\n \n exec(p.success, data, xhr.statusText, xhr);\n };\n \n xhr.send(data);\n};\n\nmodule.exports.put = (url, body) => {\n const emitter = Emitify();\n const xhr = new XMLHttpRequest();\n \n url = encodeURI(url)\n .replace('#', '%23');\n \n xhr.open('put', url, true);\n \n xhr.upload.onprogress = (event) => {\n if (!event.lengthComputable)\n return;\n \n const percent = (event.loaded / event.total) * 100;\n const count = Math.round(percent);\n \n emitter.emit('progress', count);\n };\n \n xhr.onreadystatechange = () => {\n const over = xhr.readyState === xhr.DONE;\n const OK = 200;\n \n if (!over)\n return;\n \n if (xhr.status === OK)\n return emitter.emit('end');\n \n const error = Error(xhr.responseText);\n emitter.emit('error', error);\n };\n \n xhr.send(body);\n \n return emitter;\n};\n\nfunction ext(src, func) {\n switch (getExt(src)) {\n case '.js':\n return load.js(src, func);\n \n case '.css':\n return load.css(src, func);\n \n default:\n return load({\n src,\n func,\n });\n }\n}\n\n/**\n * create elements and load them to DOM-tree\n * one-by-one\n *\n * @param params\n * @param callback\n */\nload.series = (params, callback) => {\n if (!params)\n return load;\n \n const funcs = params\n .map((url) => ext.bind(null, url))\n .concat(callback);\n \n exec.series(funcs);\n \n return load;\n};\n\n/**\n * improve callback of funcs so\n * we pop number of function and\n * if it's last we call pCallBack\n *\n * @param params\n * @param callback - onload function\n */\nload.parallel = (params, callback) => {\n if (!params)\n return load;\n \n const funcs = params.map((url) => {\n return ext.bind(null, url);\n });\n \n exec.parallel(funcs, callback);\n \n return load;\n};\n\n/**\n * Функция загружает js-файл\n *\n * @param src\n * @param func\n */\nload.js = (src, func) => {\n const name = 'script';\n \n return load({\n name,\n src,\n func,\n });\n},\n\nload.css = (src, func) => {\n const name = 'link';\n const {head:parent} = document;\n \n return load({\n name,\n src,\n parent,\n func\n });\n};\n\n/**\n * Функция создаёт елемент style и записывает туда стили\n * @param params - структура параметров, заполняеться таким\n * образом: {src: ' ',func: '', id: '', element: '', inner: ''}\n * все параметры опциональны\n */\nload.style = (params) => {\n const {\n id,\n src,\n name = 'style',\n func,\n inner,\n parent = document.head,\n element,\n } = params;\n \n return load({\n id,\n src,\n func,\n name,\n inner,\n parent,\n element,\n });\n};\n\n\n//# sourceURL=file://cloudcmd/client/dom/load.js");
/***/ }),
/***/ "./client/dom/rest.js":
/*!****************************!*\
!*** ./client/dom/rest.js ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\n/* global CloudCmd, DOM */\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\n\nconst {FS} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nmodule.exports = new RESTful();\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\n\nfunction RESTful() {\n this.delete = (url, data, callback) => {\n const isFunc = itype.function(data);\n \n if (!callback && isFunc) {\n callback = data;\n data = null;\n }\n \n sendRequest({\n method : 'DELETE',\n url : FS + url,\n data,\n callback,\n imgPosition : { top: !!data }\n });\n };\n \n this.patch = (url, data, callback) => {\n const isFunc = itype.function(data);\n \n if (!callback && isFunc) {\n callback = data;\n data = null;\n }\n \n const imgPosition = {\n top: true\n };\n \n sendRequest({\n method: 'PATCH',\n url: FS + url,\n data,\n callback,\n imgPosition,\n });\n };\n \n this.write = (url, data, callback) => {\n const isFunc = itype.function(data);\n \n if (!callback && isFunc) {\n callback = data;\n data = null;\n }\n \n sendRequest({\n method: 'PUT',\n url: FS + url,\n data,\n callback,\n imgPosition : { top: true }\n });\n };\n \n this.read = (url, dataType, callback) => {\n const isQuery = /\\?/.test(url);\n const isBeautify = /\\?beautify$/.test(url);\n const isMinify = /\\?minify$/.test(url);\n const notLog = !isQuery || isBeautify || isMinify;\n const isFunc = itype.function(dataType);\n \n if (!callback && isFunc) {\n callback = dataType;\n dataType = 'text';\n }\n \n sendRequest({\n method: 'GET',\n url: FS + url,\n callback,\n notLog,\n dataType,\n });\n };\n \n this.cp = (data, callback) => {\n sendRequest({\n method: 'PUT',\n url: '/cp',\n data,\n callback,\n imgPosition : { top: true }\n });\n };\n \n this.pack = (data, callback) => {\n sendRequest({\n method : 'PUT',\n url : '/pack',\n data,\n callback,\n });\n };\n \n this.extract = function(data, callback) {\n sendRequest({\n method : 'PUT',\n url : '/extract',\n data : data,\n callback : callback\n });\n };\n \n this.mv = function(data, callback) {\n sendRequest({\n method : 'PUT',\n url : '/mv',\n data : data,\n callback : callback,\n imgPosition : { top: true }\n });\n };\n \n this.Config = {\n read: function(callback) {\n sendRequest({\n method : 'GET',\n url : '/config',\n callback : callback,\n imgPosition : { top: true },\n notLog : true\n });\n },\n \n write: function(data, callback) {\n sendRequest({\n method : 'PATCH',\n url : '/config',\n data : data,\n callback : callback,\n imgPosition : { top: true }\n });\n }\n };\n \n this.Markdown = {\n read : function(url, callback) {\n sendRequest({\n method : 'GET',\n url : '/markdown' + url,\n callback : callback,\n imgPosition : { top: true },\n notLog : true\n });\n },\n \n render : function(data, callback) {\n sendRequest({\n method : 'PUT',\n url : '/markdown',\n data : data,\n callback : callback,\n imgPosition : { top: true },\n notLog : true\n });\n }\n };\n \n function sendRequest(params) {\n const p = params;\n const prefixUrl = CloudCmd.PREFIX_URL;\n \n p.url = prefixUrl + p.url;\n p.url = encodeURI(p.url);\n \n /*\n * if we send ajax request -\n * no need in hash so we escape #\n */\n p.url = p.url.replace('#', '%23');\n \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 statusText = jqXHR.statusText;\n const status = jqXHR.status;\n const text = status === 404 ? response : statusText;\n \n Images.show.error(text);\n setTimeout(() => {\n DOM.Dialog.alert(CloudCmd.TITLE, text);\n }, 100);\n \n p.callback(Error(text));\n },\n success: (data) => {\n Images.hide();\n \n if (!p.notLog)\n CloudCmd.log(data);\n \n p.callback(null, data);\n }\n });\n }\n}\n\n\n//# sourceURL=file://cloudcmd/client/dom/rest.js");
/***/ }),
/***/ "./client/dom/select-by-pattern.js":
/*!*****************************************!*\
!*** ./client/dom/select-by-pattern.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\n/* global DOM */\n\nlet SelectType = '*.*';\nconst TITLE = 'Cloud Commander';\n\nconst {getRegExp} = __webpack_require__(/*! ../../common/util */ \"./common/util.js\");\n\nmodule.exports = (msg, files) => {\n const allMsg = `Specify file type for ${msg} selection`;\n const cancel = false;\n const {Dialog} = DOM;\n \n Dialog.prompt(TITLE, allMsg, SelectType, {cancel}).then((type) => {\n SelectType = type;\n \n const regExp = getRegExp(type);\n \n if (!files)\n return;\n \n let matches = 0;\n \n files.forEach((current) => {\n const name = DOM.getCurrentName(current);\n \n if (name === '..')\n return;\n \n const isMatch = regExp.test(name);\n \n if (!isMatch)\n return;\n \n ++matches;\n \n let isSelected = DOM.isSelected(current);\n const shouldSel = msg === 'expand';\n \n if (shouldSel)\n isSelected = !isSelected;\n \n if (isSelected)\n DOM.toggleSelectedFile(current);\n });\n \n if (!matches)\n Dialog.alert('Select Files', 'No matches found!');\n });\n};\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/select-by-pattern.js");
/***/ }),
/***/ "./client/dom/storage.js":
/*!*******************************!*\
!*** ./client/dom/storage.js ***!
\*******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst itype = __webpack_require__(/*! itype/legacy */ \"./node_modules/itype/legacy/index.js\");\nconst jonny = __webpack_require__(/*! jonny/legacy */ \"./node_modules/jonny/legacy/index.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.js\");\nconst setItem = localStorage.setItem.bind(localStorage);\n\n/* приватный переключатель возможности работы с кэшем */\nlet Allowed;\n\n/**\n * allow Storage usage\n */\nmodule.exports.setAllowed = (isAllowed) => {\n Allowed = isAllowed;\n};\n\n/** remove element */\nmodule.exports.remove = (item, callback) => {\n if (Allowed)\n localStorage.removeItem(item);\n \n exec(callback, null, Allowed);\n \n return module.exports;\n};\n\nmodule.exports.removeMatch = (string, callback) => {\n const reg = RegExp('^' + string + '.*$');\n const test = (a) => reg.test(a);\n const remove = (a) => localStorage.removeItem(a);\n \n Object.keys(localStorage)\n .filter(test)\n .forEach(remove);\n \n exec(callback);\n \n return module.exports;\n};\n\n/** если доступен localStorage и\n * в нём есть нужная нам директория -\n * записываем данные в него\n */\nmodule.exports.set = (name, data, callback) => {\n let str, error;\n \n if (itype.object(data))\n str = jonny.stringify(data);\n \n if (Allowed && name)\n [error] = tryCatch(setItem, name, str || data);\n \n exec(callback, error);\n \n return module.exports;\n},\n\n/** Если доступен Storage принимаем из него данные*/\nmodule.exports.get = (name, callback) => {\n let ret;\n \n if (Allowed)\n ret = localStorage.getItem(name);\n \n exec(callback, null, ret);\n \n return module.exports;\n},\n\n/** функция чистит весь кэш для всех каталогов*/\nmodule.exports.clear = (callback) => {\n const ret = Allowed;\n \n if (ret)\n localStorage.clear();\n \n exec(callback, null, ret);\n \n return module.exports;\n};\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/storage.js");
/***/ }),
/***/ "./client/dom/upload-files.js":
/*!************************************!*\
!*** ./client/dom/upload-files.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\n/* global CloudCmd */\n\nconst {eachSeries} = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wraptile = __webpack_require__(/*! wraptile/legacy */ \"./node_modules/wraptile/legacy/index.js\");\n\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\nconst load = __webpack_require__(/*! ./load */ \"./client/dom/load.js\");\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst {FS} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst onEnd = wraptile(_onEnd);\nconst loadFile = wraptile(_loadFile);\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = DOM;\n\nmodule.exports = (dir, files) => {\n if (!files) {\n files = dir;\n dir = getPathWhenRootEmpty();\n }\n \n const n = files.length;\n \n if (!n)\n return;\n \n const array = [...files];\n const {name} = files[0];\n \n eachSeries(array, loadFile(dir, n), onEnd(name));\n};\n\nfunction _onEnd(currentName) {\n CloudCmd.refresh({\n currentName\n });\n}\n\nfunction _loadFile(dir, n, file, callback) {\n let i = 0;\n \n const name = file.name;\n const path = dir + name;\n const {PREFIX_URL} = CloudCmd;\n const api = PREFIX_URL + FS;\n \n const percent = (i, n, per = 100) => {\n return Math.round(i * per / n);\n };\n \n const step = (n) => 100 / n;\n \n ++i;\n \n load.put(api + path, file)\n .on('end', callback)\n .on('progress', (count) => {\n const max = step(n);\n const value = (i - 1) * max + percent(count, 100, max);\n \n Images.show.load('top');\n Images.setProgress(Math.round(value));\n });\n}\n\n\n\n//# sourceURL=file://cloudcmd/client/dom/upload-files.js");
/***/ }),
/***/ "./common/cloudfunc.js":
/*!*****************************!*\
!*** ./common/cloudfunc.js ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify/legacy */ \"./node_modules/currify/legacy/index.js\");\nconst store = __webpack_require__(/*! fullstore/legacy */ \"./node_modules/fullstore/legacy/index.js\");\nconst Entity = __webpack_require__(/*! ./entity */ \"./common/entity.js\");\n\nconst getHeaderField = currify(_getHeaderField);\n\n/* КОНСТАНТЫ (общие для клиента и сервера)*/\n\n/* название программы */\nconst NAME = 'Cloud Commander';\nconst FS = '/fs';\n\nconst Path = store();\n\nPath('/');\n\nmodule.exports.FS = FS;\nmodule.exports.apiURL = '/api/v1';\nmodule.exports.MAX_FILE_SIZE = 500 * 1024;\nmodule.exports.Entity = Entity;\nmodule.exports.getHeaderField = getHeaderField;\nmodule.exports.getPathLink = getPathLink;\nmodule.exports.getDotDot = getDotDot;\n\nmodule.exports.formatMsg = (msg, name, status) => {\n status = status || 'ok';\n name = name || '';\n \n if (name)\n name = '(\"' + name + '\")';\n \n return msg + ': ' + status + name;\n};\n\n/**\n * Функция возвращает заголовок веб страницы\n * @path\n */\nmodule.exports.getTitle = (options) => {\n options = options || {};\n \n const path = options.path || Path();\n const name = options.name;\n \n const array = [\n name || NAME,\n path,\n ];\n \n return array\n .filter(Boolean)\n .join(' - ');\n};\n\n/** Функция получает адреса каждого каталога в пути\n * возвращаеться массив каталогов\n * @param url - адрес каталога\n */\nfunction getPathLink(url, prefix, template) {\n if (!url)\n throw Error('url could not be empty!');\n \n if (!template)\n throw Error('template could not be empty!');\n \n const names = url\n .split('/')\n .slice(1, -1);\n \n const allNames = ['/'].concat(names);\n const length = allNames.length - 1;\n \n let path = '/';\n \n const pathHTML = allNames.map((name, index) => {\n const isLast = index === length;\n \n if (index)\n path += name + '/';\n \n if (index && isLast)\n return name + '/';\n \n const slash = index ? '/' : '';\n \n return rendy(template, {\n path,\n name,\n slash,\n prefix,\n });\n }).join('');\n \n return pathHTML;\n}\n\n/**\n * Функция строит таблицу файлв из JSON-информации о файлах\n * @param params - информация о файлах\n *\n */\nmodule.exports.buildFromJSON = (params) => {\n const prefix = params.prefix;\n const template = params.template;\n const templateFile = template.file;\n const templateLink = template.link;\n const json = params.data;\n \n const path = json.path;\n const files = json.files;\n \n const sort = params.sort || 'name';\n const order = params.order || 'asc';\n \n /*\n * Строим путь каталога в котором мы находимся\n * со всеми подкаталогами\n */\n const htmlPath = getPathLink(path, prefix, template.pathLink);\n \n let fileTable = rendy(template.path, {\n link : prefix + FS + path,\n fullPath : path,\n path : htmlPath\n });\n \n const owner = 'owner';\n const mode = 'mode';\n \n const getFieldName = getHeaderField(sort, order);\n \n const name = getFieldName('name');\n const size = getFieldName('size');\n const date = getFieldName('date');\n \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 \n fileTable += header + '<ul data-name=\"js-files\" class=\"files\">';\n /* Если мы не в корне */\n if (path !== '/') {\n const dotDot = getDotDot(path);\n const link = prefix + FS + dotDot;\n \n const linkResult = rendy(template.link, {\n link,\n title : '..',\n name : '..'\n });\n \n const dataName = 'data-name=\"js-file-..\" ';\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 : '&lt;dir&gt;',\n date : '--.--.----',\n owner : '.',\n mode : '--- --- ---'\n });\n }\n \n fileTable += files.map((file) => {\n const link = prefix + FS + path + file.name;\n \n const type = getType(file.size);\n const size = getSize(file.size);\n \n const date = file.date || '--.--.----';\n const owner = file.owner || 'root';\n const mode = file.mode;\n \n const linkResult = rendy(templateLink, {\n link,\n title: file.name,\n name: Entity.encode(file.name),\n attribute: getAttribute(file.size)\n });\n \n const dataName = 'data-name=\"js-file-' + file.name + '\" ';\n const attribute = 'draggable=\"true\" ' + dataName;\n \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 \n fileTable += '</ul>';\n \n return fileTable;\n};\n\nfunction getType(size) {\n if (size === 'dir')\n return 'directory';\n \n return 'text-file';\n}\n\nfunction getAttribute(size) {\n if (size === 'dir')\n return '';\n \n return 'target=\"_blank\" ';\n}\n\nfunction getSize(size) {\n if (size === 'dir')\n return '&lt;dir&gt;';\n \n return size;\n}\n\nfunction _getHeaderField(sort, order, name) {\n const arrow = order === 'asc' ? '↑' : '↓';\n \n if (sort !== name)\n return name;\n \n if (sort === 'name' && order === 'asc')\n return name;\n \n return `${name}${arrow}`;\n}\n\nfunction getDotDot(path) {\n // убираем последний слеш и каталог в котором мы сейчас находимся\n const lastSlash = path.substr(path, path.lastIndexOf('/'));\n const dotDot = lastSlash.substr(lastSlash, lastSlash.lastIndexOf('/'));\n \n if (!dotDot)\n return '/';\n \n return dotDot;\n}\n\n\n\n//# sourceURL=file://cloudcmd/common/cloudfunc.js");
/***/ }),
/***/ "./common/entity.js":
/*!**************************!*\
!*** ./common/entity.js ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst Entities = {\n '&nbsp;': ' ',\n '&lt;': '<',\n '&gt;': '>',\n};\n\nconst keys = Object.keys(Entities);\n\nmodule.exports.encode = (str) => {\n keys.forEach((code) => {\n const char = Entities[code];\n const reg = RegExp(char, 'g');\n \n str = str.replace(reg, code);\n });\n \n return str;\n};\n\nmodule.exports.decode = (str) => {\n keys.forEach((code) => {\n const char = Entities[code];\n const reg = RegExp(code, 'g');\n \n str = str.replace(reg, char);\n });\n \n return str;\n};\n\n\n\n//# sourceURL=file://cloudcmd/common/entity.js");
/***/ }),
/***/ "./common/util.js":
/*!************************!*\
!*** ./common/util.js ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nmodule.exports.getStrBigFirst = getStrBigFirst;\nmodule.exports.kebabToCamelCase = kebabToCamelCase;\n\nmodule.exports.escapeRegExp = (str) => {\n const isStr = typeof str === 'string';\n \n if (isStr)\n str = str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n \n return str;\n};\n\n/**\n * get regexp from wild card\n */\nmodule.exports.getRegExp = (wildcard) => {\n wildcard = wildcard || '*';\n \n const escaped = '^' + wildcard // search from start of line\n .replace('.', '\\\\.')\n .replace('*', '.*')\n .replace('?', '.?') + '$'; // search to end of line\n \n return RegExp(escaped);\n};\n\nmodule.exports.exec = exec;\n\n/**\n * function gets file extension\n *\n * @param name\n * @return ext\n */\nmodule.exports.getExt = (name) => {\n const isStr = typeof name === 'string';\n \n if (!isStr)\n return '';\n \n const dot = name.lastIndexOf('.');\n \n if (~dot)\n return name.substr(dot);\n \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 \n if (!Array.isArray(array))\n throw Error('array should be array!');\n \n if (typeof name !== 'string')\n throw Error('name should be string!');\n \n array.some((item) => {\n let is = item.name === name;\n const isArray = Array.isArray(item);\n \n if (is) {\n ret = item;\n return is;\n }\n \n if (!isArray)\n return is;\n \n return item.some((item) => {\n const is = item.name === name;\n \n if (is)\n ret = item.data;\n \n return is;\n });\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\nfunction getStrBigFirst(str) {\n if (!str)\n throw Error('str could not be empty!');\n \n const first = str[0].toUpperCase();\n \n return first + str.slice(1);\n}\n\nfunction kebabToCamelCase(str) {\n if (!str)\n throw Error('str could not be empty!');\n \n return str\n .split('-')\n .map(getStrBigFirst)\n .join('')\n .replace(/.js$/, '');\n}\n\n\n\n//# sourceURL=file://cloudcmd/common/util.js");
/***/ }),
/***/ "./node_modules/apart/lib/apart.js":
/*!*****************************************!*\
!*** ./node_modules/apart/lib/apart.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }\n\nvar tail = function tail(list) {\n return slice(list, 1);\n};\n\nmodule.exports = apart;\n\nfunction apart(fn) {\n check(fn);\n\n var first = tail(arguments);\n\n return function () {\n var args = [].concat(_toConsumableArray(first), Array.prototype.slice.call(arguments));\n\n return fn.apply(undefined, _toConsumableArray(args));\n };\n}\n\nfunction slice(list, from, to) {\n return [].slice.call(list, from, to);\n}\n\nfunction check(fn) {\n if (typeof fn !== 'function') throw Error('fn should be function!');\n}\n\n//# sourceURL=file://cloudcmd/node_modules/apart/lib/apart.js");
/***/ }),
/***/ "./node_modules/currify/legacy/index.js":
/*!**********************************************!*\
!*** ./node_modules/currify/legacy/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/currify */ \"./node_modules/currify/legacy/lib/currify.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/currify/legacy/index.js");
/***/ }),
/***/ "./node_modules/currify/legacy/lib/currify.js":
/*!****************************************************!*\
!*** ./node_modules/currify/legacy/lib/currify.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar f = function f(fn) {\n return [\n /*eslint no-unused-vars: 0*/\n function (a) {\n return fn.apply(undefined, arguments);\n }, function (a, b) {\n return fn.apply(undefined, arguments);\n }, function (a, b, c) {\n return fn.apply(undefined, arguments);\n }, function (a, b, c, d) {\n return fn.apply(undefined, arguments);\n }, function (a, b, c, d, e) {\n return fn.apply(undefined, arguments);\n }];\n};\n\nmodule.exports = function currify(fn) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n check(fn);\n\n if (args.length >= fn.length) return fn.apply(undefined, args);\n\n var again = function again() {\n return currify.apply(undefined, [fn].concat(args, Array.prototype.slice.call(arguments)));\n };\n\n var count = fn.length - args.length - 1;\n var func = f(again)[count];\n\n return func || again;\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function') throw Error('fn should be function!');\n}\n\n//# sourceURL=file://cloudcmd/node_modules/currify/legacy/lib/currify.js");
/***/ }),
/***/ "./node_modules/domfs-findit/legacy/findit.js":
/*!****************************************************!*\
!*** ./node_modules/domfs-findit/legacy/findit.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar Emitify = __webpack_require__(/*! emitify/legacy */ \"./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");
/***/ }),
/***/ "./node_modules/emitify/legacy/index.js":
/*!**********************************************!*\
!*** ./node_modules/emitify/legacy/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/emitify */ \"./node_modules/emitify/legacy/lib/emitify.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/emitify/legacy/index.js");
/***/ }),
/***/ "./node_modules/emitify/legacy/lib/emitify.js":
/*!****************************************************!*\
!*** ./node_modules/emitify/legacy/lib/emitify.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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/emitify/legacy/lib/emitify.js");
/***/ }),
/***/ "./node_modules/execon/lib/exec.js":
/*!*****************************************!*\
!*** ./node_modules/execon/lib/exec.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("(function(global) {\n 'use strict';\n \n if (typeof module === 'object' && 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");
/***/ }),
/***/ "./node_modules/format-io/lib/format.js":
/*!**********************************************!*\
!*** ./node_modules/format-io/lib/format.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("(function(global) {\n 'use strict';\n \n if (typeof module === 'object' && module.exports)\n module.exports = new FormatProto();\n else\n global.Format = new FormatProto();\n \n function FormatProto() {\n this.addSlashToEnd = function(path) {\n var length, isSlash;\n \n if (path) {\n length = path.length - 1;\n isSlash = path[length] === '/';\n \n if (!isSlash)\n path += '/';\n }\n \n return path;\n };\n \n /** Функция получает короткие размеры\n * конвертируя байт в килобайты, мегабойты,\n * гигайбайты и терабайты\n * @pSize - размер в байтах\n */\n this.size = function(size) {\n var isNumber = typeof size === 'number',\n l1KB = 1024,\n l1MB = l1KB * l1KB,\n l1GB = l1MB * l1KB,\n l1TB = l1GB * l1KB,\n l1PB = l1TB * l1KB;\n \n if (isNumber) {\n if (size < l1KB) size = size + 'b';\n else if (size < l1MB) size = (size / l1KB).toFixed(2) + 'kb';\n else if (size < l1GB) size = (size / l1MB).toFixed(2) + 'mb';\n else if (size < l1TB) size = (size / l1GB).toFixed(2) + 'gb';\n else if (size < l1PB) size = (size / l1TB).toFixed(2) + 'tb';\n else size = (size / l1PB).toFixed(2) + 'pb';\n }\n \n return size;\n };\n \n /**\n * Функция переводит права из цыфрового вида в символьный\n * @param perms - строка с правами доступа\n * к файлу в 8-миричной системе\n */\n this.permissions = {\n symbolic: function(perms) {\n var type, owner, group, all,\n is = typeof perms !== undefined,\n permsStr = '',\n permissions = '';\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 \n if (is) {\n permsStr = perms.toString();\n /* тип файла */\n type = permsStr.charAt(0);\n \n switch (type - 0) {\n case 1: /* обычный файл */\n type = '-';\n break;\n case 2: /* байт-ориентированное (символьное) устройство*/\n type = 'c';\n break;\n case 4: /* каталог */\n type = 'd';\n break;\n default:\n type = '-';\n }\n \n /* оставляем последние 3 символа*/\n if (permsStr.length > 5)\n permsStr = permsStr.substr(3);\n else\n permsStr = permsStr.substr(2);\n \n /* Рекомендации гугла советуют вместо string[3]\n * использовать string.charAt(3)\n */\n /*\n http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml?showone=Standards_features#Standards_features\n \n Always preferred over non-standards featuresFor\n maximum portability and compatibility, always\n prefer standards features over non-standards\n features (e.g., string.charAt(3) over string[3]\n and element access with DOM functions instead\n of using an application-specific shorthand).\n */\n /* Переводим в двоичную систему */\n owner = (permsStr[0] - 0).toString(2),\n group = (permsStr[1] - 0).toString(2),\n all = (permsStr[2] - 0).toString(2),\n \n /* переводим в символьную систему*/\n permissions =\n (owner[0] - 0 > 0 ? 'r' : '-') +\n (owner[1] - 0 > 0 ? 'w' : '-') +\n (owner[2] - 0 > 0 ? 'x' : '-') +\n ' ' +\n (group[0] - 0 > 0 ? 'r' : '-') +\n (group[1] - 0 > 0 ? 'w' : '-') +\n (group[2] - 0 > 0 ? 'x' : '-') +\n ' ' +\n (all[0] - 0 > 0 ? 'r' : '-') +\n (all[1] - 0 > 0 ? 'w' : '-') +\n (all[2] - 0 > 0 ? 'x' : '-');\n }\n \n return permissions;\n },\n \n /**\n * Функция конвертирует права доступа к файлам из символьного вида\n * в цыфровой\n */\n numeric: function(perms) {\n var owner, group, all,\n length = perms && perms.length === 11;\n \n if (length) {\n owner = (perms[0] === 'r' ? 4 : 0) +\n (perms[1] === 'w' ? 2 : 0) +\n (perms[2] === 'x' ? 1 : 0),\n \n group = (perms[4] === 'r' ? 4 : 0) +\n (perms[5] === 'w' ? 2 : 0) +\n (perms[6] === 'x' ? 1 : 0),\n \n all = (perms[8] === 'r' ? 4 : 0) +\n (perms[9] === 'w' ? 2 : 0) +\n (perms[10] === 'x' ? 1 : 0);\n \n /* добавляем 2 цифры до 5 */\n perms = '00' + owner + group + all;\n }\n \n return perms;\n }\n };\n }\n \n})(this);\n\n\n//# sourceURL=file://cloudcmd/node_modules/format-io/lib/format.js");
/***/ }),
/***/ "./node_modules/fullstore/legacy/index.js":
/*!************************************************!*\
!*** ./node_modules/fullstore/legacy/index.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/fullstore */ \"./node_modules/fullstore/legacy/lib/fullstore.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/fullstore/legacy/index.js");
/***/ }),
/***/ "./node_modules/fullstore/legacy/lib/fullstore.js":
/*!********************************************************!*\
!*** ./node_modules/fullstore/legacy/lib/fullstore.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nmodule.exports = function (value) {\n var data = {\n value: value\n };\n\n return function (value) {\n if (!arguments.length) return data.value;\n\n data.value = value;\n\n return value;\n };\n};\n\n//# sourceURL=file://cloudcmd/node_modules/fullstore/legacy/lib/fullstore.js");
/***/ }),
/***/ "./node_modules/inherits/inherits_browser.js":
/*!***************************************************!*\
!*** ./node_modules/inherits/inherits_browser.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, 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} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, 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//# sourceURL=file://cloudcmd/node_modules/inherits/inherits_browser.js");
/***/ }),
/***/ "./node_modules/itchy/legacy/index.js":
/*!********************************************!*\
!*** ./node_modules/itchy/legacy/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/itchy */ \"./node_modules/itchy/legacy/lib/itchy.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/itchy/legacy/index.js");
/***/ }),
/***/ "./node_modules/itchy/legacy/lib/itchy.js":
/*!************************************************!*\
!*** ./node_modules/itchy/legacy/lib/itchy.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nmodule.exports = function (array, iterator, done) {\n check(array, iterator, done);\n \n var i = -1;\n var n = array.length;\n \n var loop = function (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 (typeof iterator !== 'function')\n { throw Error('iterator should be a function!'); }\n \n if (typeof done !== 'function')\n { throw Error('done should be a function!'); }\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/itchy/legacy/lib/itchy.js");
/***/ }),
/***/ "./node_modules/itype/legacy/index.js":
/*!********************************************!*\
!*** ./node_modules/itype/legacy/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/itype */ \"./node_modules/itype/legacy/lib/itype.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/itype/legacy/index.js");
/***/ }),
/***/ "./node_modules/itype/legacy/lib/itype.js":
/*!************************************************!*\
!*** ./node_modules/itype/legacy/lib/itype.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nmodule.exports = new TypeProto();\n\nfunction TypeProto() {\n /**\n * get type of variable\n *\n * @param variable\n */\n function type(variable) {\n var regExp = /\\s([a-zA-Z]+)/;\n var str = {}.toString.call(variable);\n var typeBig = str.match(regExp)[1];\n var result = typeBig.toLowerCase();\n \n return result;\n }\n \n /**\n * functions check is variable is type of name\n *\n * @param variable\n */\n function typeOf(name, variable) {\n return type(variable) === name;\n }\n \n function typeOfSimple(name, variable) {\n return typeof variable === name;\n }\n \n ['arrayBuffer', 'file', 'array', 'object']\n .forEach(function (name) {\n type[name] = typeOf.bind(null, name);\n });\n \n ['null', 'string', 'undefined', 'boolean', 'number', 'function']\n .forEach(function (name) {\n type[name] = typeOfSimple.bind(null, name);\n });\n \n return type;\n}\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/itype/legacy/lib/itype.js");
/***/ }),
/***/ "./node_modules/join-io/www/join.js":
/*!******************************************!*\
!*** ./node_modules/join-io/www/join.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/* WEBPACK VAR INJECTION */(function(global) {(function(scope) {\n 'use strict';\n \n var Scope = scope.window ? window : global,\n \n PREFIX = '/join';\n \n if (typeof module === 'object' && module.exports)\n module.exports = join;\n else\n Scope.join = join;\n \n function join (prefix, names) {\n var url;\n \n if (!names) {\n names = prefix;\n prefix = PREFIX;\n }\n \n if (!names)\n throw(Error('names must be array!'));\n \n url = prefix + ':' + names.join(':');\n \n return url;\n }\n \n})(this);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=file://cloudcmd/node_modules/join-io/www/join.js");
/***/ }),
/***/ "./node_modules/jonny/legacy/index.js":
/*!********************************************!*\
!*** ./node_modules/jonny/legacy/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./jonny */ \"./node_modules/jonny/legacy/jonny.js\")\n\n\n//# sourceURL=file://cloudcmd/node_modules/jonny/legacy/index.js");
/***/ }),
/***/ "./node_modules/jonny/legacy/jonny.js":
/*!********************************************!*\
!*** ./node_modules/jonny/legacy/jonny.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.js\");\n\nvar parse = JSON.parse,\n stringify = JSON.stringify;\n\n\nmodule.exports.parse = function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _tryCatch = tryCatch.apply(undefined, [parse].concat(args)),\n _tryCatch2 = _slicedToArray(_tryCatch, 2),\n data = _tryCatch2[1];\n\n return data;\n};\n\nmodule.exports.stringify = function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var _tryCatch3 = tryCatch.apply(undefined, [stringify].concat(args)),\n _tryCatch4 = _slicedToArray(_tryCatch3, 2),\n data = _tryCatch4[1];\n\n return data;\n};\n\n//# sourceURL=file://cloudcmd/node_modules/jonny/legacy/jonny.js");
/***/ }),
/***/ "./node_modules/limier/lib/limier.js":
/*!*******************************************!*\
!*** ./node_modules/limier/lib/limier.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar somefilter = __webpack_require__(/*! somefilter/legacy */ \"./node_modules/somefilter/legacy/index.js\");\nvar limier = somefilter([findByAbr, findByName]);\n\nmodule.exports = function (pattern, list) {\n check(pattern, list);\n\n return limier(pattern, list) || [];\n};\n\nfunction findByName(str, names) {\n return names.filter(function (name) {\n return name.includes(str);\n });\n}\n\nfunction findByAbr(str, names) {\n var regstr = str.split('').join('.*') + '.*';\n var regexp = RegExp('^' + regstr + '$', 'i');\n\n return names.filter(function (name) {\n return regexp.test(name);\n });\n}\n\nfunction check(pattern, list) {\n if (typeof pattern !== 'string') throw Error('pattern should be string!');\n\n if (!Array.isArray(list)) throw Error('list should be an array!');\n}\n\n//# sourceURL=file://cloudcmd/node_modules/limier/lib/limier.js");
/***/ }),
/***/ "./node_modules/philip/legacy/philip.js":
/*!**********************************************!*\
!*** ./node_modules/philip/legacy/philip.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar findit = __webpack_require__(/*! domfs-findit */ \"./node_modules/domfs-findit/legacy/findit.js\");\nvar Emitify = __webpack_require__(/*! emitify/legacy */ \"./node_modules/emitify/legacy/index.js\");\nvar itchy = __webpack_require__(/*! itchy/legacy */ \"./node_modules/itchy/legacy/index.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nmodule.exports = Philip;\n\ninherits(Philip, Emitify);\n\nfunction Philip(entries, processingFn) {\n var _this = this;\n\n if (!(this instanceof Philip)) return new Philip(entries, processingFn);\n\n if (typeof processingFn !== 'function') throw Error('processingFn should be function!');\n\n Emitify.call(this);\n\n var array = Array.isArray(entries) ? entries : [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, function (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, function () {\n _this._process();\n });\n });\n}\n\nPhilip.prototype._process = function () {\n var _this2 = this;\n\n var argsLength = this._processingFn.length;\n var fn = function fn(error) {\n ++_this2._i;\n\n if (error) {\n _this2.emit('error', error);\n _this2.pause();\n }\n\n _this2._process();\n _this2._progress();\n };\n\n var data = void 0;\n var name = this._dirs.shift();\n var type = 'directory';\n\n if (!name) {\n type = 'file';\n var el = this._files.shift();\n\n if (el) {\n name = el.fullPath;\n data = this._data[name];\n }\n }\n\n if (!name) return this.emit('end');\n\n var args = void 0;\n if (!this._pause) {\n switch (argsLength) {\n default:\n args = [type, name, data];\n break;\n\n case 6:\n args = [type, name, data, this._i, this._n];\n break;\n }\n\n args.push(fn);\n\n this._processingFn.apply(this, _toConsumableArray(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 var 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 var _this3 = this;\n\n var filesList = files.slice();\n var current = filesList.shift();\n\n if (!current) return callback(null, obj);\n\n current.file(function (file) {\n var name = current.fullPath;\n\n obj[name] = file;\n\n _this3._getFiles(filesList, obj, callback);\n });\n};\n\nPhilip.prototype._find = function (entries, fn) {\n var files = [];\n var dirs = [];\n\n itchy(entries, function (entry, callback) {\n var finder = findit(entry);\n\n finder.on('directory', function (name) {\n dirs.push(name);\n });\n\n finder.on('file', function (name, current) {\n files.push(current);\n });\n\n finder.on('end', function () {\n callback();\n });\n }, function () {\n fn(files, dirs);\n });\n};\n\n//# sourceURL=file://cloudcmd/node_modules/philip/legacy/philip.js");
/***/ }),
/***/ "./node_modules/rendy/lib/rendy.js":
/*!*****************************************!*\
!*** ./node_modules/rendy/lib/rendy.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("(function(global) {\n 'use strict';\n \n if (typeof module === 'object' && module.exports)\n module.exports = rendy;\n else\n global.rendy = rendy;\n \n /**\n * render template with data\n *\n * @param templ\n * @param data\n */\n function rendy(templ, data) {\n var result = templ;\n \n check(templ, data);\n \n Object\n .keys(data)\n .forEach(function(param) {\n var name = '{{ ' + param + ' }}',\n str = data[param];\n \n while(~result.indexOf(name))\n result = result.replace(name, str);\n });\n \n if (~result.indexOf('{{'))\n result = result.replace(/{{.*?}}/g, '');\n \n return result;\n }\n \n function check(templ, data) {\n if (typeof templ !== 'string')\n throw(Error('template should be string!'));\n \n if (typeof data !== 'object')\n throw(Error('data should be object!'));\n }\n})(this);\n\n\n//# sourceURL=file://cloudcmd/node_modules/rendy/lib/rendy.js");
/***/ }),
/***/ "./node_modules/somefilter/legacy/index.js":
/*!*************************************************!*\
!*** ./node_modules/somefilter/legacy/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./somefilter */ \"./node_modules/somefilter/legacy/somefilter.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/somefilter/legacy/index.js");
/***/ }),
/***/ "./node_modules/somefilter/legacy/somefilter.js":
/*!******************************************************!*\
!*** ./node_modules/somefilter/legacy/somefilter.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar currify = __webpack_require__(/*! currify/legacy */ \"./node_modules/currify/legacy/index.js\");\nvar squad = __webpack_require__(/*! squad/legacy */ \"./node_modules/squad/legacy/index.js\");\nvar apart = __webpack_require__(/*! apart */ \"./node_modules/apart/lib/apart.js\");\n\nvar unary = currify(function (fn, value) {\n return fn(value);\n});\nvar notEmpty = function notEmpty(value) {\n return value;\n};\nvar apply = currify(function (args, fn) {\n return fn.apply(undefined, _toConsumableArray(args));\n});\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 var storify = store(condition);\n var process = apart(squad, condition, storify);\n\n var processingFilters = filters.map(unary(process)).reverse();\n\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n processingFilters.some(apply(args));\n\n return storify();\n };\n}\n\nfunction store(condition) {\n var cache = void 0;\n\n return function (value) {\n var result = void 0;\n\n if (condition(value)) {\n cache = 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') throw Error('condition should be function!');\n\n if (!Array.isArray(filters)) throw Error('filters should be an array!');\n\n check('function', filters);\n}\n\nfunction check(type, array) {\n var getType = function getType(item) {\n return typeof item === 'undefined' ? 'undefined' : _typeof(item);\n };\n var notEqual = function notEqual(a, b) {\n return a !== b;\n };\n var wrong = function wrong(type) {\n throw Error('fn should be ' + type + '!');\n };\n\n var wrongType = apart(wrong, type);\n var notType = apart(notEqual, type);\n\n if (!array.length) return wrongType(type);\n\n array.map(getType).filter(notType).forEach(wrongType);\n}\n\n//# sourceURL=file://cloudcmd/node_modules/somefilter/legacy/somefilter.js");
/***/ }),
/***/ "./node_modules/squad/legacy/index.js":
/*!********************************************!*\
!*** ./node_modules/squad/legacy/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./squad */ \"./node_modules/squad/legacy/squad.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/squad/legacy/index.js");
/***/ }),
/***/ "./node_modules/squad/legacy/squad.js":
/*!********************************************!*\
!*** ./node_modules/squad/legacy/squad.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nmodule.exports = function () {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n check('function', funcs);\n\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return funcs.reduceRight(apply, args).pop();\n };\n};\n\nfunction apply(value, fn) {\n return [fn.apply(undefined, _toConsumableArray(value))];\n}\n\nfunction check(type, array) {\n var wrongType = partial(wrong, type);\n var notType = partial(notEqual, type);\n\n if (!array.length) return wrongType(type);\n\n array.map(getType).filter(notType).forEach(wrongType);\n}\n\nfunction partial(fn, value) {\n return fn.bind(null, value);\n}\n\nfunction getType(item) {\n return typeof item === 'undefined' ? 'undefined' : _typeof(item);\n}\n\nfunction notEqual(a, b) {\n return a !== b;\n}\n\nfunction wrong(type) {\n throw Error('fn should be ' + type + '!');\n}\n\n//# sourceURL=file://cloudcmd/node_modules/squad/legacy/squad.js");
/***/ }),
/***/ "./node_modules/try-catch/lib/try-catch.js":
/*!*************************************************!*\
!*** ./node_modules/try-catch/lib/try-catch.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nmodule.exports = function tryCatch(fn) {\n var args = [].slice.call(arguments, 1);\n \n try {\n return [null, fn.apply(null, args)];\n } catch(e) {\n return [e];\n }\n};\n\n\n\n//# sourceURL=file://cloudcmd/node_modules/try-catch/lib/try-catch.js");
/***/ }),
/***/ "./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n//# sourceURL=file://cloudcmd/node_modules/webpack/buildin/global.js");
/***/ }),
/***/ "./node_modules/wraptile/legacy/index.js":
/*!***********************************************!*\
!*** ./node_modules/wraptile/legacy/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./lib/wraptile */ \"./node_modules/wraptile/legacy/lib/wraptile.js\");\n\n\n//# sourceURL=file://cloudcmd/node_modules/wraptile/legacy/index.js");
/***/ }),
/***/ "./node_modules/wraptile/legacy/lib/wraptile.js":
/*!******************************************************!*\
!*** ./node_modules/wraptile/legacy/lib/wraptile.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar wrap = function wrap(fn) {\n for (var _len = arguments.length, a = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n a[_key - 1] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, b = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n b[_key2] = arguments[_key2];\n }\n\n return function () {\n for (var _len3 = arguments.length, c = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n c[_key3] = arguments[_key3];\n }\n\n return fn.apply(undefined, a.concat(b, c));\n };\n };\n};\n\nmodule.exports = function (fn) {\n for (var _len4 = arguments.length, a = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n a[_key4 - 1] = arguments[_key4];\n }\n\n check(fn);\n\n return wrap.apply(undefined, [fn].concat(a));\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function') throw Error('fn should be function!');\n}\n\n//# sourceURL=file://cloudcmd/node_modules/wraptile/legacy/lib/wraptile.js");
/***/ })
}]);(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e){!function(e){"use strict";function r(){var t=Array.prototype.slice,e=function(e){var r,n="function"==typeof e,o=t.call(arguments,1);return n&&(r=e.apply(null,o)),r};return e.with=function(t){var e=Array.prototype.slice,r=e.call(arguments,1);return function(){var n=e.call(arguments),o=r.concat(n);return t.apply(null,o)}},e.ret=function(){var r=t.call(arguments);return r.unshift(e),e.with.apply(null,r)},e.if=function(t,r,n){t?e(r):e(n,r)},e.ifExist=function(t,e,r){var n=t&&t[e];n&&(n=n.apply(t,r))},e.parallel=function(r,n){var o,i,a="could not be empty!",u=[],s=!1,c=[],l=0,f=0,h=(o=r,i=new RegExp("\\s([a-zA-Z]+)"),{}.toString.call(o).match(i)[1].toLowerCase());if(!r)throw Error("funcs "+a);if(!n)throw Error("callback "+a);switch(h){case"array":f=r.length,r.forEach(function(t,r){e(t,function(){d(r,arguments)})});break;case"object":u=Object.keys(r),f=u.length,u.forEach(function(t){var n=r[t];e(n,function(){d(t,arguments)})})}function d(e,r){var o,i=t.call(r,1),a=r[0],u=i.length;o=++l===f,a||(c[e]=u>=2?i:i[0]),s||!a&&!o||(s=!0,"array"===h?n.apply(null,[a].concat(c)):n(a,c))}},e.series=function(t,r){var n,o=t.length;if(!Array.isArray(t))throw Error("funcs should be array!");n=t.shift(),e(n,function(n){(function(t){var n;return--o&&!t||(n=!0,e(r,t)),n})(n)||e.series(t,r)})},e.each=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});o.length?e.parallel(o,n):n()},e.eachSeries=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});if("function"!=typeof n)throw Error("callback should be function");o.length?e.series(o,n):n()},e.try=function(t){var e;try{e=t()}catch(t){e=t}return e},e}"object"==typeof t&&t.exports?t.exports=new r:e.exec=new r}(this)},function(t,e,r){"use strict";var n=t.exports,o="loading"+(function(){var t=document.createElementNS;if(!t)return!1;var e=t.bind(document)("http://www.w3.org/2000/svg","animate").toString();return/SVGAnimate/.test(e)}()?"-svg":"-gif");function i(){return DOM.load({name:"span",id:"js-status-image",className:"icon",attribute:"data-progress",notAppend:!0})}function a(t,e){var r=n.loading(),o=r.parentElement,i=DOM.getRefreshButton(e),a=void 0;return a="top"===t?i.parentElement:(a=DOM.getCurrentFile())?DOM.getByDataName("js-name",a):i.parentElement,(!o||o&&o!==a)&&a.appendChild(r),DOM.show(r),r}t.exports.get=i,t.exports.loading=function(){var t=i(),e=t.classList;return e.add("loading",o),e.remove("error","hidden"),t},t.exports.error=function(){var t=i(),e=t.classList;return e.add("error"),e.remove("hidden","loading",o),t},t.exports.show=a,t.exports.show.load=a,t.exports.show.error=function(t){var e=n.error();return DOM.show(e),e.title=t,CloudCmd.log(t),e},t.exports.hide=function(){var t=n.get();return DOM.hide(t),n},t.exports.setProgress=function(t,e){var r=n.get();return r?(r.setAttribute("data-progress",t+"%"),e&&(r.title=e),n):n},t.exports.clearProgress=function(){var t=n.get();return t?(t.setAttribute("data-progress",""),t.title="",n):n}},function(t,e,r){t.exports=r(72)},function(t,e,r){"use strict";var n=r(4),o=r(11),i=r(14),a=r(0),u=r(1),s=r(8),c=r(6).getExt;function l(t){var e=t.src,r=t.id,o=void 0===r?f(t.src):r,i=t.func,c=t.name,l=t.async,h=t.inner,d=t.style,p=t.parent,v=void 0===p?document.body:p,g=t.className,m=t.attribute,y=t.notAppend,b=document.getElementById(o);if(b)return a(i),b;b=document.createElement(c);var C=function(){var t="file "+e+" could not be loaded",r=new Error(t);v.removeChild(b),u.show.error(t);var n=i&&i.onerror||i.onload||i;a(n,r)};if(/^(script|link)$/.test(c)&&s.addOnce("load",b,function(){var t=i&&i.onload||i;s.remove("error",b,C),a(t)}).addError(b,C),o&&(b.id=o),g&&(b.className=g),e&&("link"!==c?b.src=e:(b.href=e,b.rel="stylesheet")),m)switch(n(m)){case"string":b.setAttribute(m,"");break;case"object":Object.keys(m).forEach(function(t){b.setAttribute(t,m[t])})}return d&&(b.style.cssText=d),(l&&"script"===c||void 0===l)&&(b.async=!0),y||v.appendChild(b),h&&(b.innerHTML=h),b}function f(t){if(n.string(t)){~t.indexOf(":")&&(t+="-join");var e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")}}function h(t,e){switch(c(t)){case".js":return l.js(t,e);case".css":return l.css(t,e);default:return l({src:t,func:e})}}t.exports=l,t.exports.getIdBySrc=f,t.exports.ext=h,t.exports.ajax=function(t){var e=t,r=n.object(e.data),i=n.array(e.data),s="arraybuffer"===n(e.data),c=e.type||e.method||"GET",l=e.headers||{},f=new XMLHttpRequest;f.open(c,e.url,!0),Object.keys(l).forEach(function(t){var e=l[t];f.setRequestHeader(t,e)}),e.responseType&&(f.responseType=e.responseType);var h=void 0;h=!s&&r||i?o.stringify(e.data):e.data,f.onreadystatechange=function(t){var r=t.target;if(r.readyState===r.DONE){u.clearProgress();var n=r.getResponseHeader("content-type");if(200!==r.status)return a(e.error,r);var i="text"!==e.dataType,s=~n.indexOf("application/json"),c=r.response;n&&s&&i&&(c=o.parse(r.response)||r.response),a(e.success,c,r.statusText,r)}},f.send(h)},t.exports.put=function(t,e){var r=i(),n=new XMLHttpRequest;return t=encodeURI(t).replace("#","%23"),n.open("put",t,!0),n.upload.onprogress=function(t){if(t.lengthComputable){var e=t.loaded/t.total*100,n=Math.round(e);r.emit("progress",n)}},n.onreadystatechange=function(){if(n.readyState===n.DONE){if(200===n.status)return r.emit("end");var t=Error(n.responseText);r.emit("error",t)}},n.send(e),r},l.series=function(t,e){if(!t)return l;var r=t.map(function(t){return h.bind(null,t)}).concat(e);return a.series(r),l},l.parallel=function(t,e){if(!t)return l;var r=t.map(function(t){return h.bind(null,t)});return a.parallel(r,e),l},l.js=function(t,e){return l({name:"script",src:t,func:e})},l.css=function(t,e){return l({name:"link",src:t,parent:document.head,func:e})},l.style=function(t){var e=t.id,r=t.src,n=t.name,o=void 0===n?"style":n,i=t.func,a=t.inner,u=t.parent;return l({id:e,src:r,func:i,name:o,inner:a,parent:void 0===u?document.head:u,element:t.element})}},function(t,e,r){t.exports=r(69)},function(t,e,r){"use strict";var n=r(13),o=r(2),i=r(12),a=r(70),u=o(function(t,e,r){return t!==r?r:"name"===t&&"asc"===e?r:r+("asc"===e?"↑":"↓")}),s="/fs",c=i();function l(t,e,r){if(!t)throw Error("url could not be empty!");if(!r)throw Error("template could not be empty!");var o=t.split("/").slice(1,-1),i=["/"].concat(o),a=i.length-1,u="/";return i.map(function(t,o){return o&&(u+=t+"/"),o&&o===a?t+"/":n(r,{path:u,name:t,slash:o?"/":"",prefix:e})}).join("")}function f(t){var e=t.substr(t,t.lastIndexOf("/")),r=e.substr(e,e.lastIndexOf("/"));return r||"/"}c("/"),t.exports.FS=s,t.exports.apiURL="/api/v1",t.exports.MAX_FILE_SIZE=512e3,t.exports.Entity=a,t.exports.getHeaderField=u,t.exports.getPathLink=l,t.exports.getDotDot=f,t.exports.formatMsg=function(t,e,r){return r=r||"ok",(e=e||"")&&(e='("'+e+'")'),t+": "+r+e},t.exports.getTitle=function(t){var e=(t=t||{}).path||c();return[t.name||"Cloud Commander",e].filter(Boolean).join(" - ")},t.exports.buildFromJSON=function(t){var e=t.prefix,r=t.template,o=r.file,i=r.link,h=t.data,d=h.path,p=h.files,v=t.sort||"name",g=t.order||"asc",m=l(d,e,r.pathLink),y=n(r.path,{link:e+s+d,fullPath:d,path:m}),b=u(v,g),C=b("name"),w=b("size"),x=b("date"),E=n(o,{tag:"div",attribute:'data-name="js-fm-header" ',className:"fm-header",type:"",name:C,size:w,date:x,owner:"owner",mode:"mode"});if(c(d),y+=E+'<ul data-name="js-files" class="files">',"/"!==d){var A=f(d),_=e+s+A,P=n(r.link,{link:_,title:"..",name:".."});y+=n(r.file,{tag:"li",attribute:'draggable="true" data-name="js-file-.." ',className:"",type:"directory",name:P,size:"&lt;dir&gt;",date:"--.--.----",owner:".",mode:"--- --- ---"})}return y+=p.map(function(t){var r=e+s+d+t.name,u=function(t){return"dir"===t?"directory":"text-file"}(t.size),c=function(t){return"dir"===t?"&lt;dir&gt;":t}(t.size),l=t.date||"--.--.----",f=t.owner||"root",h=t.mode,p=n(i,{link:r,title:t.name,name:a.encode(t.name),attribute:function(t){return"dir"===t?"":'target="_blank" '}(t.size)}),v='data-name="js-file-'+t.name+'" ';return n(o,{tag:"li",attribute:'draggable="true" '+v,className:"",type:u,name:p,size:c,date:l,owner:f,mode:h})}).join(""),y+="</ul>"}},function(t,e,r){"use strict";var n=r(0);function o(t){if(!t)throw Error("str could not be empty!");return t[0].toUpperCase()+t.slice(1)}t.exports.getStrBigFirst=o,t.exports.kebabToCamelCase=function(t){if(!t)throw Error("str could not be empty!");return t.split("-").map(o).join("").replace(/.js$/,"")},t.exports.escapeRegExp=function(t){return"string"==typeof t&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),t},t.exports.getRegExp=function(t){var e="^"+(t=t||"*").replace(".","\\.").replace("*",".*").replace("?",".?")+"$";return RegExp(e)},t.exports.exec=n,t.exports.getExt=function(t){if(!("string"==typeof t))return"";var e=t.lastIndexOf(".");return~e?t.substr(e):""},t.exports.findObjByNameInArr=function(t,e){var r=void 0;if(!Array.isArray(t))throw Error("array should be array!");if("string"!=typeof e)throw Error("name should be string!");return t.some(function(t){var n=t.name===e,o=Array.isArray(t);return n?(r=t,n):o?t.some(function(t){var n=t.name===e;return n&&(r=t.data),n}):n}),r},t.exports.time=function(t){n.ifExist(console,"time",[t])},t.exports.timeEnd=function(t){n.ifExist(console,"timeEnd",[t])}},function(t,e,r){"use strict";var n,o,i=r(4),a=r(2),u=r(0),s=r(17),c=r(3),l=r(10),f={},h="config|modules",d="file|path|link|pathLink|media",p="view/media-tmpl|config-tmpl|upload",v="/tmpl/",g=v+"fs/",m="/json/",y=(n=2e3,o=void 0,function(t){o||(o=!0,setTimeout(function(){o=!1,t()},n))}),b=a(function(t,e){var r=i(t),n=void 0;switch(function(t,e){if(!t)throw Error("name could not be empty!");if("function"!=typeof e)throw Error("callback should be a function")}(t,e),r){case"string":!function(t,e){var r=new RegExp(d+"|"+p),n=new RegExp(h),o=r.test(t),i=n.test(t);o||i?"config"===t?function(t){var e=void 0;f.config||(f.config=new Promise(function(t,r){e=!0,l.Config.read(function(e,n){if(e)return r(e);t(n)})}));f.config.then(function(r){e=!1,s.setAllowed(r.localStorage),t(null,r),y(function(){e||(f.config=null)})},function(){e||(f.config=null)})}(e):function(t,e){var r=CloudCmd.PREFIX;f[t]||(f[t]=new Promise(function(e,n){var o=r+t;c.ajax({url:o,success:e,error:n})}));f[t].then(function(t){e(null,t)},function(r){f[t]=null,e(r)})}(function(t,e,r){var n=void 0,o=new RegExp(p).test(t);e?(n=o?v+t.replace("-tmpl",""):g+t,n+=".hbs"):r&&(n=m+t+".json");return n}(t,o,i),e):function(t){throw new Error("Wrong file name: "+t)}(t)}(t,e);break;case"array":n=C(t,b),u.parallel(n,e)}}),C=function(t,e){return t.map(function(t){return e(t)})};t.exports.get=b},function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var o=r(4);t.exports=new function(){var t=this,e=this;function r(t,e,n,i){var a=[t,e,n,i],u=o(t);switch(u){default:if(!/element$/.test(u))throw Error("unknown eventName: "+u);r(a[1],a[0],n,i);break;case"string":o.function(e)&&(n=e,e=null),e||(e=window),i(e,[t,n,!1]);break;case"array":t.forEach(function(t){r(t,e,n,i)});break;case"object":Object.keys(t).forEach(function(n){var o=t[n];r(n,e,o,i)})}}function i(t){if(!t)throw Error("type could not be empty!")}this.add=function(t,n,o){return i(t),r(t,n,o,function(t,e){t.addEventListener.apply(t,e)}),e},this.addOnce=function(r,n,o){return o||(o=n,n=null),t.add(r,n,function t(i){e.remove(r,n,t),o(i)}),e},this.remove=function(t,n,o){return i(t),r(t,n,o,function(t,e){t.removeEventListener.apply(t,e)}),e},this.addKey=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.add.apply(e,n(i))},this.rmKey=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.remove.apply(e,n(i))},this.addClick=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.add.apply(e,n(i))},this.rmClick=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.remove.apply(e,n(i))},this.addContextMenu=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["contextmenu"].concat(r);return e.add.apply(e,n(i))},this.addError=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["error"].concat(r);return e.add.apply(e,n(i))},this.addLoad=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["load"].concat(r);return e.add.apply(e,n(i))}}},function(t,e,r){"use strict";var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var i=r(4),a=r(0),u=r(11),s=r(6),c=r(5),l=c.getTitle,f=c.FS,h=c.Entity,d=n({},r(67),new function(){var t=this,e=void 0,r={},n=this,c="current-file",v="Cloud Commander",g={"js-left":null,"js-right":null};function w(t,e){var r=d.Dialog,o=n.getCurrentDirPath(),i="New "+t||"File",a=function(){var t=n.getCurrentName();return".."===t?"":t}();r.prompt(v,i,a,{cancel:!1}).then(function(t){if(t){m.write(function(e){var r=o+t;return e?r+e:r}(e),function(e){if(!e){var r=t;CloudCmd.refresh({currentName:r})}})}})}this.loadRemote=function(t,e,r){return b(t,e,r),d},this.loadJquery=function(t){return d.loadRemote("jquery",{name:"$"},t),d},this.loadSocket=function(t){return d.loadRemote("socket",{name:"io"},t),d},this.loadMenu=function(t){return d.loadRemote("menu",t)},this.promptNewDir=function(){w("directory","?dir")},this.promptNewFile=function(){w("file")},this.getCurrentDirName=function(){var t=d.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/")),r=t.replace(e+"/","")||"/";return r},this.getCurrentDirPath=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d.getPanel(),e=d.getByDataName("js-path",t),r=e&&e.textContent;return r},this.getParentDirPath=function(t){var e=d.getCurrentDirPath(t),r=d.getCurrentDirName()+"/";return"/"!==e?e.replace(RegExp(r+"$"),""):e},this.getNotCurrentDirPath=function(){var t=d.getPanel({active:!1}),e=d.getCurrentDirPath(t);return e},this.getCurrentFile=function(){return d.getByClass(c)},this.getCurrentByName=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.panel,n="js-file-"+t,o=d.getByDataName(n,e);return o},this.getSelectedFiles=function(){var t=d.getPanel(),e=d.getByClassAll("selected-file",t);return[].concat(o(e))},this.unselectFiles=function(t){t=t||d.getSelectedFiles(),[].concat(o(t)).forEach(d.toggleSelectedFile)},this.getActiveFiles=function(){var t=d.getCurrentFile(),e=d.getSelectedFiles(),r=d.getCurrentName(t);return e.length||".."===r?e:[t]},this.getCurrentDate=function(t){var e=t||n.getCurrentFile(),r=d.getByDataName("js-date",e).textContent;return r},this.getCurrentSize=function(t){var e=t||n.getCurrentFile(),r=d.getByDataName("js-size",e).textContent.replace(/^<|>$/g,"");return r},this.loadCurrentSize=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);p.show.load(),".."!==name&&m.read(n+"?size",function(e,n){e||(d.setCurrentSize(n,r),a(t,r),p.hide())})},this.loadCurrentHash=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);m.read(n+"?hash",t)},this.loadCurrentTime=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);m.read(n+"?time",t)},this.setCurrentSize=function(t,e){var r=e||d.getCurrentFile(),n=d.getByDataName("js-size",r);n.textContent=t},this.getCurrentMode=function(t){var e=t||d.getCurrentFile(),r=d.getByDataName("js-mode",e);return r.textContent},this.getCurrentOwner=function(t){var e=t||d.getCurrentFile(),r=d.getByDataName("js-owner",e);return r.textContent},this.getCurrentData=function(t,e){var r=void 0,n=d.Dialog,o=d.CurrentInfo,a=e||d.getCurrentFile(),s=d.getCurrentPath(a),c=d.isCurrentIsDir(a),l=function(e,n){if(!e){i.object(n)&&(n=u.stringify(n));var o=n.length;r&&o<1073741824&&d.saveDataToStorage(s,n,r)}t(e,n)};return".."===o.name?(n.alert.noFiles(v),t(Error("No files selected!"))):c?m.read(s,l):void d.checkStorageHash(s,function(e,n,o){return e?t(e):n?d.getDataFromStorage(s,t):(r=o,void m.read(s,l))})},this.saveCurrentData=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";d.RESTful.write(t+n,e,function(r){!r&&d.saveDataToStorage(t,e)})},this.getRefreshButton=function(t){var e=t||d.getPanel(),r=d.getByDataName("js-refresh",e);return r},this.setCurrentByName=function(t){var e=d.getCurrentByName(t);return d.setCurrentFile(e)},this.setCurrentFile=function(t,e){var r=e,o=d.getCurrentFile();if(!t)return d;var i="";o&&(i=d.getCurrentDirPath(),function(t){if(!d.isCurrentFile(t))return;t.classList.remove(c)}(o)),t.classList.add(c);var a=d.getCurrentDirPath(),u=CloudCmd.config("name");return a!==i&&(d.setTitle(l({name:u,path:a})),r&&!1===r.history||("/"!==a&&(a=f+a),d.setHistory(a,null,a))),d.scrollIntoViewIfNeeded(t,!0),n.updateCurrentInfo(t),d},this.getCurrentByPosition=function(t){var e=t.x,r=t.y,n=document.elementFromPoint(e,r),o=function(t){var e=t.tagName;return/A|SPAN|LI/.test(e)?"A"===e?t.parentElement.parentElement:"SPAN"===e?t.parentElement:t:null}(n);return o&&"LI"!==o.tagName?null:o},this.selectFile=function(t){var e=t||d.getCurrentFile();return e.classList.add("selected-file"),n},this.unselectFile=function(t){var e=t||d.getCurrentFile();return e.classList.remove("selected-file"),n},this.toggleSelectedFile=function(t){var e=t||d.getCurrentFile(),r=d.getCurrentName(e);return".."===r?n:(e.classList.toggle("selected-file"),n)},this.toggleAllSelectedFiles=function(){return d.getAllFiles().map(d.toggleSelectedFile),n},this.selectAllFiles=function(){return d.getAllFiles().map(d.selectFile),n},this.getAllFiles=function(){var t=d.getPanel(),e=d.getFiles(t),r=d.getCurrentName(e[0]),n=".."===r?1:0;return[].concat(o(e)).slice(n)},this.expandSelection=function(){var t=r.files;C("expand",t)},this.shrinkSelection=function(){var t=r.files;C("shrink",t)},this.setHistory=function(t,e,r){var n=window.history;return r=CloudCmd.PREFIX+r,n&&history.pushState(t,e,r),n},this.setTitle=function(t){return e||(e=d.getByTag("title")[0]||d.load({name:"title",innerHTML:t,parentElement:document.head})),e.textContent=t,d},this.isCurrentFile=function(t){return!!t&&d.isContainClass(t,c)},this.isSelected=function(t){return!!t&&d.isContainClass(t,"selected-file")},this.isCurrentIsDir=function(e){var r=e||t.getCurrentFile(),n=d.getByDataName("js-type",r),o=d.isContainClass(n,"directory");return o},this.getCurrentLink=function(e){var r=e||t.getCurrentFile(),n=d.getByTag("a",r);return n[0]},this.getCurrentPath=function(t){var e=t||d.getCurrentFile(),r=d.getByTag("a",e)[0],n=CloudCmd.PREFIX,o=r.getAttribute("href").replace(RegExp("^"+n+f),"");return o},this.getCurrentName=function(t){var e=t||d.getCurrentFile();if(!e)return"";var r=d.getCurrentLink(e);if(!r)return"";var n=r.title;return n},this.getFilenames=function(t){if(!t)throw Error("AllFiles could not be empty");var e=t[0]||d.getCurrentFile(),r=d.getCurrentName(e),n=[].concat(o(t));".."===r&&n.shift();var i=n.map(function(t){return d.getCurrentName(t)});return i},this.setCurrentName=function(t,e){var n=r,o=n.link,i=CloudCmd.PREFIX,a=i+f+n.dirPath;return o.title=t,o.innerHTML=h.encode(t),o.href=a+t,e.setAttribute("data-name","js-file-"+t),o},this.checkStorageHash=function(t,e){var r=a.parallel,n=d.loadCurrentHash,o=t+"-hash",i=a.with(y.get,o);if("string"!=typeof t)throw Error("name should be a string!");if("function"!=typeof e)throw Error("callback should be a function!");r([n,i],function(t,r,n){var o=void 0,i=/error/.test(r);i?t=r:r===n&&(o=!0),e(t,o,r)})},this.saveDataToStorage=function(t,e,r,n){var o=CloudCmd.config("localStorage"),i=d.isCurrentIsDir(),u=t+"-hash",s=t+"-data";if(!o||i)return a(n);a.if(r,function(){y.set(u,r),y.set(s,e),a(n,r)},function(t){d.loadCurrentHash(function(e,n){r=n,t()})})},this.getDataFromStorage=function(t,e){var r=t+"-hash",n=t+"-data",o=CloudCmd.config("localStorage"),i=d.isCurrentIsDir();if(!o||i)return a(e);a.parallel([a.with(y.get,n),a.with(y.get,r)],e)},this.getFM=function(){return d.getPanel().parentElement},this.getPanelPosition=function(t){return(t=t||d.getPanel()).dataset.name.replace("js-","")},this.getPanel=function(t){var e=void 0,r=void 0,n=void 0,o="js-",i=d.getCurrentFile();if(i?(e=i.parentElement,r=e.parentElement,n="js-left"===r.getAttribute("data-name")):r=d.getByDataName("js-left"),t&&!t.active&&(o+=n?"right":"left",r=d.getByDataName(o)),window.innerWidth<CloudCmd.MIN_ONE_PANEL_WIDTH&&(r=d.getByDataName("js-left")),!r)throw Error("can not find Active Panel!");return r},this.getFiles=function(t){var e=d.getByDataName("js-files",t);return e.children||[]},this.showPanel=function(t){var e=d.getPanel({active:t});return!!e&&(d.show(e),!0)},this.hidePanel=function(t){var e=d.getPanel({active:t});return!!e&&d.hide(e)},this.remove=function(t,e){var r=e||document.body;return r.removeChild(t),d},this.deleteCurrent=function(t){t||n.getCurrentFile();var e=t&&t.parentElement,r=n.getCurrentName(t);if(t&&".."!==r){var o=t.nextSibling,i=t.previousSibling;d.setCurrentFile(o||i),e.removeChild(t)}},this.deleteSelected=function(t){(t=t||d.getSelectedFiles())&&t.map(d.deleteCurrent)},this.renameCurrent=function(t){var e=d.Dialog;n.isCurrentFile(t)||(t=n.getCurrentFile());var r=n.getCurrentName(t);if(".."===r)return e.alert.noFiles(v);e.prompt(v,"Rename",r,{cancel:!1}).then(function(e){var o=!!d.getCurrentByName(e),i=n.getCurrentDirPath();if(r!==e){var a={from:i+r,to:i+e};m.mv(a,function(r){r||(d.setCurrentName(e,t),n.updateCurrentInfo(t),y.remove(i),o&&CloudCmd.refresh())})}})},this.scrollIntoViewIfNeeded=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.scrollIntoViewIfNeeded&&t.scrollIntoViewIfNeeded(e)},this.scrollByPages=function(t,e){var r=t&&t.scrollByPages&&e;return r&&t.scrollByPages(e),r},this.changePanel=function(){var t=d.getPanel(),e=d.getPanel({active:!1}),r=d.getCurrentName(),n=d.getFiles(e),o=t.getAttribute("data-name");g[o]=r,o=(t=e).getAttribute("data-name");var i=void 0,a=void 0;return(r=g[o])&&(a=d.getCurrentByName(r,t))&&(i=a.parentElement),i&&i.parentElement||(a=d.getCurrentByName(r,t))||(a=n[0]),d.setCurrentFile(a,{history:!0}),d},this.getPackerExt=function(t){return"zip"===t?".zip":".tar.gz"},this.goToDirectory=function(){var t=r.dirPath,e=d.Dialog;e.prompt(v,"Go to directory:",t,{cancel:!1}).then(function(t){return{path:t}}).then(CloudCmd.loadDir)},this.duplicatePanel=function(){var t=r,e=t.isDir,n=t.panelPassive,o=!t.isOnePanel,i=function(e){return e?t.path:t.dirPath}(e);CloudCmd.loadDir({path:i,panel:n,noCurrent:o})},this.swapPanels=function(){var t=r,e=t.panel,n=t.files,o=t.element,i=t.panelPassive,a=d.getCurrentDirPath(),u=d.getNotCurrentDirPath(),s=n.indexOf(o);CloudCmd.loadDir({path:a,panel:i,noCurrent:!0}),CloudCmd.loadDir({path:u,panel:e},function(){var e=t.files,r=e.length-1;s>r&&(s=r);var n=e[s];d.setCurrentFile(n)})},this.CurrentInfo=r,this.updateCurrentInfo=function(t){var e=n.CurrentInfo,r=t||n.getCurrentFile(),i=r.parentElement,a=i.parentElement,u=n.getPanel({active:!1}),c=d.getFiles(u),l=n.getCurrentName(r);e.dir=n.getCurrentDirName(),e.dirPath=n.getCurrentDirPath(),e.parentDirPath=n.getParentDirPath(),e.element=r,e.ext=s.getExt(l),e.files=[].concat(o(i.children)),e.filesPassive=[].concat(o(c)),e.first=i.firstChild,e.getData=n.getCurrentData,e.last=i.lastChild,e.link=n.getCurrentLink(r),e.mode=n.getCurrentMode(r),e.name=l,e.path=n.getCurrentPath(r),e.panel=a,e.panelPassive=u,e.size=n.getCurrentSize(r),e.isDir=n.isCurrentIsDir(),e.isSelected=n.isSelected(r),e.panelPosition=n.getPanel().dataset.name.replace("js-",""),e.isOnePanel=e.panel.getAttribute("data-name")===e.panelPassive.getAttribute("data-name")}});t.exports=d;var p=r(1),v=r(3),g=r(7),m=r(10),y=r(17);d.Images=p,d.load=v,d.Files=g,d.RESTful=m,d.Storage=y,d.uploadDirectory=r(66),d.Buffer=r(20),d.Events=r(8);var b=r(60),C=r(59)},function(t,e,r){"use strict";var n=r(4),o=r(5).FS;t.exports=new function(){function t(t){var e=t,r=CloudCmd.PREFIX_URL;e.url=r+e.url,e.url=encodeURI(e.url),e.url=e.url.replace("#","%23"),a.ajax({method:e.method,url:e.url,data:e.data,dataType:e.dataType,error:function(t){var r=t.responseText,n=t.statusText,o=t.status,a=404===o?r:n;i.show.error(a),setTimeout(function(){DOM.Dialog.alert(CloudCmd.TITLE,a)},100),e.callback(Error(a))},success:function(t){i.hide(),e.notLog||CloudCmd.log(t),e.callback(null,t)}})}this.delete=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"DELETE",url:o+e,data:r,callback:i,imgPosition:{top:!!r}})},this.patch=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null);t({method:"PATCH",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.write=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"PUT",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.read=function(e,r,i){var a=/\?/.test(e),u=/\?beautify$/.test(e),s=/\?minify$/.test(e),c=!a||u||s,l=n.function(r);!i&&l&&(i=r,r="text"),t({method:"GET",url:o+e,callback:i,notLog:c,dataType:r})},this.cp=function(e,r){t({method:"PUT",url:"/cp",data:e,callback:r,imgPosition:{top:!0}})},this.pack=function(e,r){t({method:"PUT",url:"/pack",data:e,callback:r})},this.extract=function(e,r){t({method:"PUT",url:"/extract",data:e,callback:r})},this.mv=function(e,r){t({method:"PUT",url:"/mv",data:e,callback:r,imgPosition:{top:!0}})},this.Config={read:function(e){t({method:"GET",url:"/config",callback:e,imgPosition:{top:!0},notLog:!0})},write:function(e,r){t({method:"PATCH",url:"/config",data:e,callback:r,imgPosition:{top:!0}})}},this.Markdown={read:function(e,r){t({method:"GET",url:"/markdown"+e,callback:r,imgPosition:{top:!0},notLog:!0})},render:function(e,r){t({method:"PUT",url:"/markdown",data:e,callback:r,imgPosition:{top:!0},notLog:!0})}}};var i=r(1),a=r(3)},function(t,e,r){t.exports=r(68)},function(t,e,r){t.exports=r(71)},function(t,e){!function(e){"use strict";function r(t,e){var r=t;return function(t,e){if("string"!=typeof t)throw Error("template should be string!");if("object"!=typeof e)throw Error("data should be object!")}(t,e),Object.keys(e).forEach(function(t){for(var n="{{ "+t+" }}",o=e[t];~r.indexOf(n);)r=r.replace(n,o)}),~r.indexOf("{{")&&(r=r.replace(/{{.*?}}/g,"")),r}"object"==typeof t&&t.exports?t.exports=r:e.rendy=r}(this)},function(t,e,r){t.exports=r(75)},function(t,e,r){t.exports=r(45)},function(t,e,r){t.exports=r(52)},function(t,e,r){"use strict";var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=r(4),i=r(11),a=r(0),u=r(21),s=localStorage.setItem.bind(localStorage),c=void 0;t.exports.setAllowed=function(t){c=t},t.exports.remove=function(e,r){return c&&localStorage.removeItem(e),a(r,null,c),t.exports},t.exports.removeMatch=function(e,r){var n=RegExp("^"+e+".*$");return Object.keys(localStorage).filter(function(t){return n.test(t)}).forEach(function(t){return localStorage.removeItem(t)}),a(r),t.exports},t.exports.set=function(e,r,l){var f=void 0,h=void 0;if(o.object(r)&&(f=i.stringify(r)),c&&e){var d=u(s,e,f||r);h=n(d,1)[0]}return a(l,h),t.exports},t.exports.get=function(e,r){var n=void 0;return c&&(n=localStorage.getItem(e)),a(r,null,n),t.exports},t.exports.clear=function(e){var r=c;return r&&localStorage.clear(),a(e,null,r),t.exports}},,function(t,e,r){"use strict";var n=r(0).eachSeries,o=r(16),i=r(9),a=r(3),u=r(1),s=r(5).FS,c=o(function(t){CloudCmd.refresh({currentName:t})}),l=o(function(t,e,r,n){var o=0,i=r.name,c=t+i,l=CloudCmd.PREFIX_URL+s;++o,a.put(l+c,r).on("end",n).on("progress",function(t){var r=function(t){return 100/t}(e),n=(o-1)*r+function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}(t,100,r);u.show.load("top"),u.setProgress(Math.round(n))})}),f=i.getCurrentDirPath;t.exports=function(t,e){e||(e=t,t=f());var r=e.length;if(r){var o=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(e)),i=e[0].name;n(o,l(t,r),c(i))}}},function(t,e,r){"use strict";var n=r(11),o=r(0),i=r(17),a=r(9);t.exports=new function(){var t=a.CurrentInfo,e="cut-file",r="copy",u="cut",s="Buffer";function c(t){a.Dialog.alert(s,t)}function l(){var t=a.getActiveFiles(),e=a.getFilenames(t);return e}function f(){var t=a.getByClassAll(e);[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t)).forEach(function(t){t.classList.remove(e)})}function h(t){var e=CloudCmd.config("buffer");if(e)return t();c("Buffer disabled in config!")}function d(){i.remove(r).remove(u),f()}return{cut:h.bind(null,function(){var r=l(),n=t.dirPath;if(d(),!r.length)return;a.getActiveFiles().forEach(function(t){t.classList.add(e)}),i.set(u,{from:n,names:r})}),copy:h.bind(null,function(){var e=l(),n=t.dirPath;if(d(),!e.length)return;i.remove(u).set(r,{from:n,names:e})}),clear:h.bind(null,d),paste:h.bind(null,function(){var e=i.get.bind(i,r),a=i.get.bind(i,u);o.parallel([e,a],function(e,r,o){var i=r?"copy":"move",a=r||o,u=CloudCmd.Operation,s=t.dirPath;if(e||r||o||(e="Buffer is empty!"),e)return c(e);var l=n.parse(a);if(l.to=s,l.from===s)return c("Path is same!");u.show(i,l),d()})})}}},function(t,e,r){"use strict";t.exports=function(t){var e=[].slice.call(arguments,1);try{return[null,t.apply(null,e)]}catch(t){return[t]}}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,,,,,,,,,,,,,,,,function(t,e){!function(e){"use strict";function r(){this.addSlashToEnd=function(t){return t&&("/"===t[t.length-1]||(t+="/")),t},this.size=function(t){var e=1073741824,r=1024*e,n=1024*r;return"number"==typeof t&&(t<1024?t+="b":t=t<1048576?(t/1024).toFixed(2)+"kb":t<e?(t/1048576).toFixed(2)+"mb":t<r?(t/e).toFixed(2)+"gb":t<n?(t/r).toFixed(2)+"tb":(t/n).toFixed(2)+"pb"),t},this.permissions={symbolic:function(t){var e,r,n,o="",i="";if(void 0!==typeof t){switch((o=t.toString()).charAt(0)-0){case 1:"-";break;case 2:"c";break;case 4:"d";break;default:"-"}e=((o=o.length>5?o.substr(3):o.substr(2))[0]-0).toString(2),r=(o[1]-0).toString(2),n=(o[2]-0).toString(2),i=(e[0]-0>0?"r":"-")+(e[1]-0>0?"w":"-")+(e[2]-0>0?"x":"-")+" "+(r[0]-0>0?"r":"-")+(r[1]-0>0?"w":"-")+(r[2]-0>0?"x":"-")+" "+(n[0]-0>0?"r":"-")+(n[1]-0>0?"w":"-")+(n[2]-0>0?"x":"-")}return i},numeric:function(t){return t&&11===t.length&&(t="00"+(("r"===t[0]?4:0)+("w"===t[1]?2:0)+("x"===t[2]?1:0))+(("r"===t[4]?4:0)+("w"===t[5]?2:0)+("x"===t[6]?1:0))+(("r"===t[8]?4:0)+("w"===t[9]?2:0)+("x"===t[10]?1:0))),t}}}"object"==typeof t&&t.exports?t.exports=new r:e.Format=new r}(this)},,,,,function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var o=function(t){return function(t,e,r){return[].slice.call(t,e,r)}(t,1)};t.exports=function(t){!function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t);var e=o(arguments);return function(){var r=[].concat(n(e),Array.prototype.slice.call(arguments));return t.apply(void 0,n(r))}}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){return[e.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t))]}function i(t,e){return t.bind(null,e)}function a(t){return void 0===t?"undefined":n(t)}function u(t,e){return t!==e}function s(t){throw Error("fn should be "+t+"!")}t.exports=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t,e){var r=i(s,t),n=i(u,t);if(!e.length)return r(t);e.map(a).filter(n).forEach(r)}("function",e),function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.reduceRight(o,r).pop()}}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=r(2),i=r(15),a=r(44),u=o(function(t,e){return t(e)}),s=function(t){return t},c=o(function(t,e){return e.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t))});t.exports=function(t,e){e||(e=t,t=s);!function(t,e){if("function"!=typeof t)throw Error("condition should be function!");if(!Array.isArray(e))throw Error("filters should be an array!");!function(t,e){var r=a(function(t){throw Error("fn should be "+t+"!")},t),o=a(function(t,e){return t!==e},t);if(!e.length)return r(t);e.map(function(t){return void 0===t?"undefined":n(t)}).filter(o).forEach(r)}("function",e)}(t,e);var r=function(t){var e=void 0;return function(r){var n=void 0;return t(r)?e=n=r:(n=e,e=null),n}}(t),o=a(i,t,r),l=e.map(u(o)).reverse();return function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return l.some(c(e)),r()}}},function(t,e,r){t.exports=r(46)},function(t,e,r){"use strict";var n=r(47)([function(t,e){var r=t.split("").join(".*")+".*",n=RegExp("^"+r+"$","i");return e.filter(function(t){return n.test(t)})},function(t,e){return e.filter(function(e){return e.includes(t)})}]);t.exports=function(t,e){return function(t,e){if("string"!=typeof t)throw Error("pattern should be string!");if(!Array.isArray(e))throw Error("list should be an array!")}(t,e),n(t,e)||[]}},,,,function(t,e,r){"use strict";t.exports=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return function(){for(var e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];return t.apply(void 0,r.concat(n,o))}}}.apply(void 0,[t].concat(r))}},,,,,function(t,e,r){(function(e){!function(r){"use strict";var n=r.window?window:e,o="/join";function i(t,e){if(e||(e=t,t=o),!e)throw Error("names must be array!");return t+":"+e.join(":")}"object"==typeof t&&t.exports?t.exports=i:n.join=i}(this)}).call(this,r(22))},,function(t,e,r){"use strict";var n="*.*",o=r(6).getRegExp;t.exports=function(t,e){var r="Specify file type for "+t+" selection",i=DOM.Dialog;i.prompt("Cloud Commander",r,n,{cancel:!1}).then(function(r){n=r;var a=o(r);if(e){var u=0;e.forEach(function(e){var r=DOM.getCurrentName(e);if(".."!==r&&a.test(r)){++u;var n=DOM.isSelected(e);"expand"===t&&(n=!n),n&&DOM.toggleSelectedFile(e)}}),u||i.alert("Select Files","No matches found!")}})}},function(t,e,r){"use strict";var n=r(0),o=r(13),i=r(4),a=r(6).findObjByNameInArr,u=r(3),s=r(7);function c(t,e){return function(){u.parallel(t,e)}}t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,l=CloudCmd,f=l.PREFIX,h=l.config,d=e;if(d.name&&window[d.name])return r();s.get("modules",function(e,s){var l=h("online")&&navigator.onLine,d=a(s.remote,t),p=i.array(d.local),v=d.version,g=void 0,m=void 0;p?(g=d.remote,m=d.local):(g=[d.remote],m=[d.local]);var y=m.map(function(t){return f+t}),b=function(t,e,r){return function(){u.parallel(e,function(t){if(t)return c();r()})}}(0,g.map(function(t){return o(t,{version:v})}),r),C=c(y,r);n.if(l,b,C)})}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";t.exports=function(t,e,r){!function(t,e,r){if(!Array.isArray(t))throw Error("array should be an array!");if("function"!=typeof e)throw Error("iterator should be a function!");if("function"!=typeof r)throw Error("done should be a function!")}(t,e,r);var n=-1,o=t.length,i=function(a){if(++n,a||n===o)return r(a);e(t[n],i)};i()}},function(t,e,r){t.exports=r(62)},function(t,e,r){"use strict";var n=r(14);function o(t,e){if(!(this instanceof o))return new o(t,e);this._dirs=0,this._first=!0,this._find(t,e)}t.exports=function(t){var e=n();return setTimeout(function(){o(e,t)},0),e},o.prototype._find=function(t,e){var r=this;if(e.isFile)return t.emit("file",e.fullPath,e),void(this._first&&t.emit("end"));this._first&&(this._first=!1),t.emit("directory",e.fullPath,e),++this._dirs,e.createReader().readEntries(function(e){[].forEach.call(e,function(e){r._find(t,e)}),--r._dirs,r._dirs||t.emit("end")})}},function(t,e,r){"use strict";var n=r(64),o=r(14),i=r(63),a=r(61);function u(t,e){var r=this;if(!(this instanceof u))return new u(t,e);if("function"!=typeof e)throw Error("processingFn should be function!");o.call(this);var n=Array.isArray(t)?t:[t];this._i=0,this._n=0,this._processingFn=e,this._pause=!1,this._prev=0,this._find(n,function(t,e){r._files=t,r._dirs=e,r._n=t.length+e.length,r._data={},r._getFiles(t,r._data,function(){r._process()})})}t.exports=u,a(u,o),u.prototype._process=function(){var t=this,e=this._processingFn.length,r=void 0,n=this._dirs.shift(),o="directory";if(!n){o="file";var i=this._files.shift();i&&(n=i.fullPath,r=this._data[n])}if(!n)return this.emit("end");var a=void 0;if(!this._pause){switch(e){default:a=[o,n,r];break;case 6:a=[o,n,r,this._i,this._n]}a.push(function(e){++t._i,e&&(t.emit("error",e),t.pause()),t._process(),t._progress()}),this._processingFn.apply(this,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(a))}},u.prototype.pause=function(){this._pause=!0},u.prototype.continue=function(){this._pause&&(this._pause=!1,this._process())},u.prototype.abort=function(){this._files=[],this._dirs=[],this._process()},u.prototype._progress=function(){var t=Math.round(100*this._i/this._n);t!==this._prev&&(this._prev=t,this.emit("progress",t))},u.prototype._getFiles=function(t,e,r){var n=this,o=t.slice(),i=o.shift();if(!i)return r(null,e);i.file(function(t){var a=i.fullPath;e[a]=t,n._getFiles(o,e,r)})},u.prototype._find=function(t,e){var r=[],o=[];i(t,function(t,e){var i=n(t);i.on("directory",function(t){o.push(t)}),i.on("file",function(t,e){r.push(e)}),i.on("end",function(){e()})},function(){e(r,o)})}},function(t,e,r){"use strict";var n=r(65),o=r(1),i=r(5).FS,a=r(9),u=a.getCurrentDirPath;function s(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}function c(t){a.Images.setProgress(t).show("top")}t.exports=function(t){var e=a.Dialog;t.length&&o.show("top");var r=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t)).map(function(t){return t.webkitGetAsEntry()}),l=u().replace(/\/$/,""),f=n(r,function(t,e,r,n,o,u){var f,h=CloudCmd.PREFIX_URL+i+l+e,d=void 0;switch(t){case"file":d=function(t,e){return a.load.put(t,e)}(h,r);break;case"directory":f=h,d=a.load.put(f+"?dir")}d.on("end",u),d.on("progress",function(t){var e=s(n,o);c(e+s(t,100,s(n+1,o)-e))})});f.on("error",function(t){e.alert(t),f.abort()}),f.on("progress",c),f.on("end",CloudCmd.refresh)}},function(t,e,r){"use strict";var n=t.exports;t.exports.isContainClass=function(t,e){if(!t)throw Error("element could not be empty!");if(!e)throw Error("className could not be empty!");return t.classList.contains(e)},t.exports.getByTag=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).getElementsByTagName(t)},t.exports.getById=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("#"+t)},t.exports.getByClass=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return n.getByClassAll(t,e)[0]},t.exports.getByDataName=function(t){var e='[data-name="'+t+'"]';return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector(e)},t.exports.getByClassAll=function(t,e){return(e||document).getElementsByClassName(t)},t.exports.hide=function(t){return t.classList.add("hidden"),n},t.exports.show=function(t){return t.classList.remove("hidden"),n}},function(t,e,r){"use strict";var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=r(21),i=JSON.parse,a=JSON.stringify;t.exports.parse=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var a=o.apply(void 0,[i].concat(e));return n(a,2)[1]},t.exports.stringify=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=o.apply(void 0,[a].concat(e));return n(i,2)[1]}},function(t,e,r){"use strict";t.exports=new function(){function t(t){var e={}.toString.call(t),r=e.match(/\s([a-zA-Z]+)/)[1],n=r.toLowerCase();return n}return["arrayBuffer","file","array","object"].forEach(function(e){t[e]=function(e,r){return t(r)===e}.bind(null,e)}),["null","string","undefined","boolean","number","function"].forEach(function(e){t[e]=function(t,e){return typeof e===t}.bind(null,e)}),t}},function(t,e,r){"use strict";var n={"&nbsp;":" ","&lt;":"<","&gt;":">"},o=Object.keys(n);t.exports.encode=function(t){return o.forEach(function(e){var r=RegExp(n[e],"g");t=t.replace(r,e)}),t},t.exports.decode=function(t){return o.forEach(function(e){var r=n[e],o=RegExp(e,"g");t=t.replace(o,r)}),t}},function(t,e,r){"use strict";t.exports=function(t){var e={value:t};return function(t){return arguments.length?(e.value=t,t):e.value}}},function(t,e,r){"use strict";t.exports=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(e),n.length>=e.length)return e.apply(void 0,n);var i=function(){return t.apply(void 0,[e].concat(n,Array.prototype.slice.call(arguments)))},a=e.length-n.length-1;return function(t){return[function(e){return t.apply(void 0,arguments)},function(e,r){return t.apply(void 0,arguments)},function(e,r,n){return t.apply(void 0,arguments)},function(e,r,n,o){return t.apply(void 0,arguments)},function(e,r,n,o,i){return t.apply(void 0,arguments)}]}(i)[a]||i}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||l||u(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){(function(e,r){var n;n=function(){"use strict";function t(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,a=void 0,u=function(t,e){p[o]=t,p[o+1]=e,2===(o+=2)&&(a?a(v):C())};var s="undefined"!=typeof window?window:void 0,c=s||{},l=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(v,1)}}var p=new Array(1e3);function v(){for(var t=0;t<o;t+=2){(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0}o=0}var g,m,y,b,C=void 0;function w(t,e){var r=this,n=new this.constructor(A);void 0===n[E]&&M(n);var o=r._state;if(o){var i=arguments[o-1];u(function(){return B(o,n,i,r._result)})}else I(r,n,t,e);return n}function x(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return k(e,t),e}f?C=function(){return e.nextTick(v)}:l?(m=0,y=new l(v),b=document.createTextNode(""),y.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((g=new MessageChannel).port1.onmessage=v,C=function(){return g.port2.postMessage(0)}):C=void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(i=t.runOnLoop||t.runOnContext)?function(){i(v)}:d()}catch(t){return d()}}():d();var E=Math.random().toString(36).substring(2);function A(){}var _=void 0,P=1,F=2,S={error:null};function D(t){try{return t.then}catch(t){return S.error=t,S}}function j(e,r,n){r.constructor===e.constructor&&n===w&&r.constructor.resolve===x?function(t,e){e._state===P?N(t,e._result):e._state===F?O(t,e._result):I(e,void 0,function(e){return k(t,e)},function(e){return O(t,e)})}(e,r):n===S?(O(e,S.error),S.error=null):void 0===n?N(e,r):t(n)?function(t,e,r){u(function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?k(t,r):N(t,r))},function(e){n||(n=!0,O(t,e))},t._label);!n&&o&&(n=!0,O(t,o))},t)}(e,r,n):N(e,r)}function k(t,e){var r,n;t===e?O(t,new TypeError("You cannot resolve a promise with itself")):(n=typeof(r=e),null===r||"object"!==n&&"function"!==n?N(t,e):j(t,e,D(e)))}function T(t){t._onerror&&t._onerror(t._result),L(t)}function N(t,e){t._state===_&&(t._result=e,t._state=P,0!==t._subscribers.length&&u(L,t))}function O(t,e){t._state===_&&(t._state=F,t._result=e,u(T,t))}function I(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+P]=r,o[i+F]=n,0===i&&t._state&&u(L,t)}function L(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+r],n?B(r,n,o,i):o(i);t._subscribers.length=0}}function B(e,r,n,o){var i=t(n),a=void 0,u=void 0,s=void 0,c=void 0;if(i){if((a=function(t,e){try{return t(e)}catch(t){return S.error=t,S}}(n,o))===S?(c=!0,u=a.error,a.error=null):s=!0,r===a)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else a=o,s=!0;r._state!==_||(i&&s?k(r,a):c?O(r,u):e===P?N(r,a):e===F&&O(r,a))}var R=0;function M(t){t[E]=R++,t._state=void 0,t._result=void 0,t._subscribers=[]}var z=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[E]||M(this.promise),n(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&N(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===_&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===x){var o=D(t);if(o===w&&t._state!==_)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===H){var i=new r(A);j(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===_&&(this._remaining--,t===F?O(n,r):this._result[e]=r),0===this._remaining&&N(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){return r._settledAt(P,e,t)},function(t){return r._settledAt(F,e,t)})},t}();var H=function(){function t(e){this[E]=R++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e(function(e){k(t,e)},function(e){O(t,e)})}catch(e){O(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},t}();return H.prototype.then=w,H.all=function(t){return new z(this,t).promise},H.race=function(t){var e=this;return n(t)?new e(function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},H.resolve=x,H.reject=function(t){var e=new this(A);return O(e,t),e},H._setScheduler=function(t){a=t},H._setAsap=function(t){u=t},H._asap=u,H.polyfill=function(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=H},H.Promise=H,H},t.exports=n()}).call(this,r(73),r(22))},function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;this._all={}}function o(t){if("string"!=typeof t)throw Error("event should be string!")}function i(t,e){o(t),function(t){if("function"!=typeof t)throw Error("callback should be function!")}(e)}t.exports=n,n.prototype.on=function(t,e){var r=this._all[t];return i(t,e),r?r.push(e):this._all[t]=[e],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){var r=this;return i(t,e),r.on(t,function n(){e.apply(null,arguments),r.off(t,n)}),this},n.prototype.off=function(t,e){var r=this._all[t]||[],n=r.indexOf(e);for(i(t,e);~n;)r.splice(n,1),n=r.indexOf(e);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(t){var e=[].slice.call(arguments,1),r=this._all[t];if(o(t),!r&&"error"===t)throw e[0];return r?(r.forEach(function(t){t.apply(null,e)}),this):this},n.prototype.removeAllListeners=function(t){return o(t),this._all[t]=[],this}}]]);
//# sourceMappingURL=common.js.map(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e){!function(e){"use strict";function r(){var t=Array.prototype.slice,e=function(e){var r,n="function"==typeof e,o=t.call(arguments,1);return n&&(r=e.apply(null,o)),r};return e.with=function(t){var e=Array.prototype.slice,r=e.call(arguments,1);return function(){var n=e.call(arguments),o=r.concat(n);return t.apply(null,o)}},e.ret=function(){var r=t.call(arguments);return r.unshift(e),e.with.apply(null,r)},e.if=function(t,r,n){t?e(r):e(n,r)},e.ifExist=function(t,e,r){var n=t&&t[e];n&&(n=n.apply(t,r))},e.parallel=function(r,n){var o,i,a="could not be empty!",u=[],s=!1,c=[],l=0,f=0,h=(o=r,i=new RegExp("\\s([a-zA-Z]+)"),{}.toString.call(o).match(i)[1].toLowerCase());if(!r)throw Error("funcs "+a);if(!n)throw Error("callback "+a);switch(h){case"array":f=r.length,r.forEach(function(t,r){e(t,function(){d(r,arguments)})});break;case"object":u=Object.keys(r),f=u.length,u.forEach(function(t){var n=r[t];e(n,function(){d(t,arguments)})})}function d(e,r){var o,i=t.call(r,1),a=r[0],u=i.length;o=++l===f,a||(c[e]=u>=2?i:i[0]),s||!a&&!o||(s=!0,"array"===h?n.apply(null,[a].concat(c)):n(a,c))}},e.series=function(t,r){var n,o=t.length;if(!Array.isArray(t))throw Error("funcs should be array!");n=t.shift(),e(n,function(n){(function(t){var n;return--o&&!t||(n=!0,e(r,t)),n})(n)||e.series(t,r)})},e.each=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});o.length?e.parallel(o,n):n()},e.eachSeries=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});if("function"!=typeof n)throw Error("callback should be function");o.length?e.series(o,n):n()},e.try=function(t){var e;try{e=t()}catch(t){e=t}return e},e}"object"==typeof t&&t.exports?t.exports=new r:e.exec=new r}(this)},function(t,e,r){"use strict";var n=t.exports,o="loading"+(function(){var t=document.createElementNS;if(!t)return!1;var e=t.bind(document)("http://www.w3.org/2000/svg","animate").toString();return/SVGAnimate/.test(e)}()?"-svg":"-gif");function i(){return DOM.load({name:"span",id:"js-status-image",className:"icon",attribute:"data-progress",notAppend:!0})}function a(t,e){var r=n.loading(),o=r.parentElement,i=DOM.getRefreshButton(e),a=void 0;return a="top"===t?i.parentElement:(a=DOM.getCurrentFile())?DOM.getByDataName("js-name",a):i.parentElement,(!o||o&&o!==a)&&a.appendChild(r),DOM.show(r),r}t.exports.get=i,t.exports.loading=function(){var t=i(),e=t.classList;return e.add("loading",o),e.remove("error","hidden"),t},t.exports.error=function(){var t=i(),e=t.classList;return e.add("error"),e.remove("hidden","loading",o),t},t.exports.show=a,t.exports.show.load=a,t.exports.show.error=function(t){var e=n.error();return DOM.show(e),e.title=t,CloudCmd.log(t),e},t.exports.hide=function(){var t=n.get();return DOM.hide(t),n},t.exports.setProgress=function(t,e){var r=n.get();return r?(r.setAttribute("data-progress",t+"%"),e&&(r.title=e),n):n},t.exports.clearProgress=function(){var t=n.get();return t?(t.setAttribute("data-progress",""),t.title="",n):n}},function(t,e,r){t.exports=r(72)},function(t,e,r){"use strict";var n=r(4),o=r(11),i=r(14),a=r(0),u=r(1),s=r(8),c=r(6).getExt;function l(t){var e=t.src,r=t.id,o=void 0===r?f(t.src):r,i=t.func,c=t.name,l=t.async,h=t.inner,d=t.style,p=t.parent,v=void 0===p?document.body:p,g=t.className,m=t.attribute,y=t.notAppend,b=document.getElementById(o);if(b)return a(i),b;b=document.createElement(c);var C=function(){var t="file "+e+" could not be loaded",r=new Error(t);v.removeChild(b),u.show.error(t);var n=i&&i.onerror||i.onload||i;a(n,r)};if(/^(script|link)$/.test(c)&&s.addOnce("load",b,function(){var t=i&&i.onload||i;s.remove("error",b,C),a(t)}).addError(b,C),o&&(b.id=o),g&&(b.className=g),e&&("link"!==c?b.src=e:(b.href=e,b.rel="stylesheet")),m)switch(n(m)){case"string":b.setAttribute(m,"");break;case"object":Object.keys(m).forEach(function(t){b.setAttribute(t,m[t])})}return d&&(b.style.cssText=d),(l&&"script"===c||void 0===l)&&(b.async=!0),y||v.appendChild(b),h&&(b.innerHTML=h),b}function f(t){if(n.string(t)){~t.indexOf(":")&&(t+="-join");var e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")}}function h(t,e){switch(c(t)){case".js":return l.js(t,e);case".css":return l.css(t,e);default:return l({src:t,func:e})}}t.exports=l,t.exports.getIdBySrc=f,t.exports.ext=h,t.exports.ajax=function(t){var e=t,r=n.object(e.data),i=n.array(e.data),s="arraybuffer"===n(e.data),c=e.type||e.method||"GET",l=e.headers||{},f=new XMLHttpRequest;f.open(c,e.url,!0),Object.keys(l).forEach(function(t){var e=l[t];f.setRequestHeader(t,e)}),e.responseType&&(f.responseType=e.responseType);var h=void 0;h=!s&&r||i?o.stringify(e.data):e.data,f.onreadystatechange=function(t){var r=t.target;if(r.readyState===r.DONE){u.clearProgress();var n=r.getResponseHeader("content-type");if(200!==r.status)return a(e.error,r);var i="text"!==e.dataType,s=~n.indexOf("application/json"),c=r.response;n&&s&&i&&(c=o.parse(r.response)||r.response),a(e.success,c,r.statusText,r)}},f.send(h)},t.exports.put=function(t,e){var r=i(),n=new XMLHttpRequest;return t=encodeURI(t).replace("#","%23"),n.open("put",t,!0),n.upload.onprogress=function(t){if(t.lengthComputable){var e=t.loaded/t.total*100,n=Math.round(e);r.emit("progress",n)}},n.onreadystatechange=function(){if(n.readyState===n.DONE){if(200===n.status)return r.emit("end");var t=Error(n.responseText);r.emit("error",t)}},n.send(e),r},l.series=function(t,e){if(!t)return l;var r=t.map(function(t){return h.bind(null,t)}).concat(e);return a.series(r),l},l.parallel=function(t,e){if(!t)return l;var r=t.map(function(t){return h.bind(null,t)});return a.parallel(r,e),l},l.js=function(t,e){return l({name:"script",src:t,func:e})},l.css=function(t,e){return l({name:"link",src:t,parent:document.head,func:e})},l.style=function(t){var e=t.id,r=t.src,n=t.name,o=void 0===n?"style":n,i=t.func,a=t.inner,u=t.parent;return l({id:e,src:r,func:i,name:o,inner:a,parent:void 0===u?document.head:u,element:t.element})}},function(t,e,r){t.exports=r(69)},function(t,e,r){"use strict";var n=r(13),o=r(2),i=r(12),a=r(70),u=o(function(t,e,r){return t!==r?r:"name"===t&&"asc"===e?r:r+("asc"===e?"↑":"↓")}),s="/fs",c=i();function l(t,e,r){if(!t)throw Error("url could not be empty!");if(!r)throw Error("template could not be empty!");var o=t.split("/").slice(1,-1),i=["/"].concat(o),a=i.length-1,u="/";return i.map(function(t,o){return o&&(u+=t+"/"),o&&o===a?t+"/":n(r,{path:u,name:t,slash:o?"/":"",prefix:e})}).join("")}function f(t){var e=t.substr(t,t.lastIndexOf("/")),r=e.substr(e,e.lastIndexOf("/"));return r||"/"}c("/"),t.exports.FS=s,t.exports.apiURL="/api/v1",t.exports.MAX_FILE_SIZE=512e3,t.exports.Entity=a,t.exports.getHeaderField=u,t.exports.getPathLink=l,t.exports.getDotDot=f,t.exports.formatMsg=function(t,e,r){return r=r||"ok",(e=e||"")&&(e='("'+e+'")'),t+": "+r+e},t.exports.getTitle=function(t){var e=(t=t||{}).path||c();return[t.name||"Cloud Commander",e].filter(Boolean).join(" - ")},t.exports.buildFromJSON=function(t){var e=t.prefix,r=t.template,o=r.file,i=r.link,h=t.data,d=h.path,p=h.files,v=t.sort||"name",g=t.order||"asc",m=l(d,e,r.pathLink),y=n(r.path,{link:e+s+d,fullPath:d,path:m}),b=u(v,g),C=b("name"),w=b("size"),x=b("date"),E=n(o,{tag:"div",attribute:'data-name="js-fm-header" ',className:"fm-header",type:"",name:C,size:w,date:x,owner:"owner",mode:"mode"});if(c(d),y+=E+'<ul data-name="js-files" class="files">',"/"!==d){var A=f(d),_=e+s+A,P=n(r.link,{link:_,title:"..",name:".."});y+=n(r.file,{tag:"li",attribute:'draggable="true" data-name="js-file-.." ',className:"",type:"directory",name:P,size:"&lt;dir&gt;",date:"--.--.----",owner:".",mode:"--- --- ---"})}return y+=p.map(function(t){var r=e+s+d+t.name,u=function(t){return"dir"===t?"directory":"text-file"}(t.size),c=function(t){return"dir"===t?"&lt;dir&gt;":t}(t.size),l=t.date||"--.--.----",f=t.owner||"root",h=t.mode,p=n(i,{link:r,title:t.name,name:a.encode(t.name),attribute:function(t){return"dir"===t?"":'target="_blank" '}(t.size)}),v='data-name="js-file-'+t.name+'" ';return n(o,{tag:"li",attribute:'draggable="true" '+v,className:"",type:u,name:p,size:c,date:l,owner:f,mode:h})}).join(""),y+="</ul>"}},function(t,e,r){"use strict";var n=r(0);function o(t){if(!t)throw Error("str could not be empty!");return t[0].toUpperCase()+t.slice(1)}t.exports.getStrBigFirst=o,t.exports.kebabToCamelCase=function(t){if(!t)throw Error("str could not be empty!");return t.split("-").map(o).join("").replace(/.js$/,"")},t.exports.escapeRegExp=function(t){return"string"==typeof t&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),t},t.exports.getRegExp=function(t){var e="^"+(t=t||"*").replace(".","\\.").replace("*",".*").replace("?",".?")+"$";return RegExp(e)},t.exports.exec=n,t.exports.getExt=function(t){if(!("string"==typeof t))return"";var e=t.lastIndexOf(".");return~e?t.substr(e):""},t.exports.findObjByNameInArr=function(t,e){var r=void 0;if(!Array.isArray(t))throw Error("array should be array!");if("string"!=typeof e)throw Error("name should be string!");return t.some(function(t){var n=t.name===e,o=Array.isArray(t);return n?(r=t,n):o?t.some(function(t){var n=t.name===e;return n&&(r=t.data),n}):n}),r},t.exports.time=function(t){n.ifExist(console,"time",[t])},t.exports.timeEnd=function(t){n.ifExist(console,"timeEnd",[t])}},function(t,e,r){"use strict";var n,o,i=r(4),a=r(2),u=r(0),s=r(17),c=r(3),l=r(10),f={},h="config|modules",d="file|path|link|pathLink|media",p="view/media-tmpl|config-tmpl|upload",v="/tmpl/",g=v+"fs/",m="/json/",y=(n=2e3,o=void 0,function(t){o||(o=!0,setTimeout(function(){o=!1,t()},n))}),b=a(function(t,e){var r=i(t),n=void 0;switch(function(t,e){if(!t)throw Error("name could not be empty!");if("function"!=typeof e)throw Error("callback should be a function")}(t,e),r){case"string":!function(t,e){var r=new RegExp(d+"|"+p),n=new RegExp(h),o=r.test(t),i=n.test(t);o||i?"config"===t?function(t){var e=void 0;f.config||(f.config=new Promise(function(t,r){e=!0,l.Config.read(function(e,n){if(e)return r(e);t(n)})}));f.config.then(function(r){e=!1,s.setAllowed(r.localStorage),t(null,r),y(function(){e||(f.config=null)})},function(){e||(f.config=null)})}(e):function(t,e){var r=CloudCmd.PREFIX;f[t]||(f[t]=new Promise(function(e,n){var o=r+t;c.ajax({url:o,success:e,error:n})}));f[t].then(function(t){e(null,t)},function(r){f[t]=null,e(r)})}(function(t,e,r){var n=void 0,o=new RegExp(p).test(t);e?(n=o?v+t.replace("-tmpl",""):g+t,n+=".hbs"):r&&(n=m+t+".json");return n}(t,o,i),e):function(t){throw new Error("Wrong file name: "+t)}(t)}(t,e);break;case"array":n=C(t,b),u.parallel(n,e)}}),C=function(t,e){return t.map(function(t){return e(t)})};t.exports.get=b},function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var o=r(4);t.exports=new function(){var t=this,e=this;function r(t,e,n,i){var a=[t,e,n,i],u=o(t);switch(u){default:if(!/element$/.test(u))throw Error("unknown eventName: "+u);r(a[1],a[0],n,i);break;case"string":o.function(e)&&(n=e,e=null),e||(e=window),i(e,[t,n,!1]);break;case"array":t.forEach(function(t){r(t,e,n,i)});break;case"object":Object.keys(t).forEach(function(n){var o=t[n];r(n,e,o,i)})}}function i(t){if(!t)throw Error("type could not be empty!")}this.add=function(t,n,o){return i(t),r(t,n,o,function(t,e){t.addEventListener.apply(t,e)}),e},this.addOnce=function(r,n,o){return o||(o=n,n=null),t.add(r,n,function t(i){e.remove(r,n,t),o(i)}),e},this.remove=function(t,n,o){return i(t),r(t,n,o,function(t,e){t.removeEventListener.apply(t,e)}),e},this.addKey=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.add.apply(e,n(i))},this.rmKey=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.remove.apply(e,n(i))},this.addClick=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.add.apply(e,n(i))},this.rmClick=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.remove.apply(e,n(i))},this.addContextMenu=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["contextmenu"].concat(r);return e.add.apply(e,n(i))},this.addError=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["error"].concat(r);return e.add.apply(e,n(i))},this.addLoad=function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["load"].concat(r);return e.add.apply(e,n(i))}}},function(t,e,r){"use strict";var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var i=r(4),a=r(0),u=r(11),s=r(6),c=r(5),l=c.getTitle,f=c.FS,h=c.Entity,d=n({},r(67),new function(){var t=this,e=void 0,r={},n=this,c="current-file",v="Cloud Commander",g={"js-left":null,"js-right":null};function w(t,e){var r=d.Dialog,o=n.getCurrentDirPath(),i="New "+t||"File",a=function(){var t=n.getCurrentName();return".."===t?"":t}();r.prompt(v,i,a,{cancel:!1}).then(function(t){if(t){m.write(function(e){var r=o+t;return e?r+e:r}(e),function(e){if(!e){var r=t;CloudCmd.refresh({currentName:r})}})}})}this.loadRemote=function(t,e,r){return b(t,e,r),d},this.loadJquery=function(t){return d.loadRemote("jquery",{name:"$"},t),d},this.loadSocket=function(t){return d.loadRemote("socket",{name:"io"},t),d},this.loadMenu=function(t){return d.loadRemote("menu",t)},this.promptNewDir=function(){w("directory","?dir")},this.promptNewFile=function(){w("file")},this.getCurrentDirName=function(){var t=d.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/")),r=t.replace(e+"/","")||"/";return r},this.getCurrentDirPath=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d.getPanel(),e=d.getByDataName("js-path",t),r=e&&e.textContent;return r},this.getParentDirPath=function(t){var e=d.getCurrentDirPath(t),r=d.getCurrentDirName()+"/";return"/"!==e?e.replace(RegExp(r+"$"),""):e},this.getNotCurrentDirPath=function(){var t=d.getPanel({active:!1}),e=d.getCurrentDirPath(t);return e},this.getCurrentFile=function(){return d.getByClass(c)},this.getCurrentByName=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.panel,n="js-file-"+t,o=d.getByDataName(n,e);return o},this.getSelectedFiles=function(){var t=d.getPanel(),e=d.getByClassAll("selected-file",t);return[].concat(o(e))},this.unselectFiles=function(t){t=t||d.getSelectedFiles(),[].concat(o(t)).forEach(d.toggleSelectedFile)},this.getActiveFiles=function(){var t=d.getCurrentFile(),e=d.getSelectedFiles(),r=d.getCurrentName(t);return e.length||".."===r?e:[t]},this.getCurrentDate=function(t){var e=t||n.getCurrentFile(),r=d.getByDataName("js-date",e).textContent;return r},this.getCurrentSize=function(t){var e=t||n.getCurrentFile(),r=d.getByDataName("js-size",e).textContent.replace(/^<|>$/g,"");return r},this.loadCurrentSize=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);p.show.load(),".."!==name&&m.read(n+"?size",function(e,n){e||(d.setCurrentSize(n,r),a(t,r),p.hide())})},this.loadCurrentHash=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);m.read(n+"?hash",t)},this.loadCurrentTime=function(t,e){var r=e||d.getCurrentFile(),n=d.getCurrentPath(r);m.read(n+"?time",t)},this.setCurrentSize=function(t,e){var r=e||d.getCurrentFile(),n=d.getByDataName("js-size",r);n.textContent=t},this.getCurrentMode=function(t){var e=t||d.getCurrentFile(),r=d.getByDataName("js-mode",e);return r.textContent},this.getCurrentOwner=function(t){var e=t||d.getCurrentFile(),r=d.getByDataName("js-owner",e);return r.textContent},this.getCurrentData=function(t,e){var r=void 0,n=d.Dialog,o=d.CurrentInfo,a=e||d.getCurrentFile(),s=d.getCurrentPath(a),c=d.isCurrentIsDir(a),l=function(e,n){if(!e){i.object(n)&&(n=u.stringify(n));var o=n.length;r&&o<1073741824&&d.saveDataToStorage(s,n,r)}t(e,n)};return".."===o.name?(n.alert.noFiles(v),t(Error("No files selected!"))):c?m.read(s,l):void d.checkStorageHash(s,function(e,n,o){return e?t(e):n?d.getDataFromStorage(s,t):(r=o,void m.read(s,l))})},this.saveCurrentData=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";d.RESTful.write(t+n,e,function(r){!r&&d.saveDataToStorage(t,e)})},this.getRefreshButton=function(t){var e=t||d.getPanel(),r=d.getByDataName("js-refresh",e);return r},this.setCurrentByName=function(t){var e=d.getCurrentByName(t);return d.setCurrentFile(e)},this.setCurrentFile=function(t,e){var r=e,o=d.getCurrentFile();if(!t)return d;var i="";o&&(i=d.getCurrentDirPath(),function(t){if(!d.isCurrentFile(t))return;t.classList.remove(c)}(o)),t.classList.add(c);var a=d.getCurrentDirPath(),u=CloudCmd.config("name");return a!==i&&(d.setTitle(l({name:u,path:a})),r&&!1===r.history||("/"!==a&&(a=f+a),d.setHistory(a,null,a))),d.scrollIntoViewIfNeeded(t,!0),n.updateCurrentInfo(t),d},this.getCurrentByPosition=function(t){var e=t.x,r=t.y,n=document.elementFromPoint(e,r),o=function(t){var e=t.tagName;return/A|SPAN|LI/.test(e)?"A"===e?t.parentElement.parentElement:"SPAN"===e?t.parentElement:t:null}(n);return o&&"LI"!==o.tagName?null:o},this.selectFile=function(t){var e=t||d.getCurrentFile();return e.classList.add("selected-file"),n},this.unselectFile=function(t){var e=t||d.getCurrentFile();return e.classList.remove("selected-file"),n},this.toggleSelectedFile=function(t){var e=t||d.getCurrentFile(),r=d.getCurrentName(e);return".."===r?n:(e.classList.toggle("selected-file"),n)},this.toggleAllSelectedFiles=function(){return d.getAllFiles().map(d.toggleSelectedFile),n},this.selectAllFiles=function(){return d.getAllFiles().map(d.selectFile),n},this.getAllFiles=function(){var t=d.getPanel(),e=d.getFiles(t),r=d.getCurrentName(e[0]),n=".."===r?1:0;return[].concat(o(e)).slice(n)},this.expandSelection=function(){var t=r.files;C("expand",t)},this.shrinkSelection=function(){var t=r.files;C("shrink",t)},this.setHistory=function(t,e,r){var n=window.history;return r=CloudCmd.PREFIX+r,n&&history.pushState(t,e,r),n},this.setTitle=function(t){return e||(e=d.getByTag("title")[0]||d.load({name:"title",innerHTML:t,parentElement:document.head})),e.textContent=t,d},this.isCurrentFile=function(t){return!!t&&d.isContainClass(t,c)},this.isSelected=function(t){return!!t&&d.isContainClass(t,"selected-file")},this.isCurrentIsDir=function(e){var r=e||t.getCurrentFile(),n=d.getByDataName("js-type",r),o=d.isContainClass(n,"directory");return o},this.getCurrentLink=function(e){var r=e||t.getCurrentFile(),n=d.getByTag("a",r);return n[0]},this.getCurrentPath=function(t){var e=t||d.getCurrentFile(),r=d.getByTag("a",e)[0],n=CloudCmd.PREFIX,o=r.getAttribute("href").replace(RegExp("^"+n+f),"");return o},this.getCurrentName=function(t){var e=t||d.getCurrentFile();if(!e)return"";var r=d.getCurrentLink(e);if(!r)return"";var n=r.title;return n},this.getFilenames=function(t){if(!t)throw Error("AllFiles could not be empty");var e=t[0]||d.getCurrentFile(),r=d.getCurrentName(e),n=[].concat(o(t));".."===r&&n.shift();var i=n.map(function(t){return d.getCurrentName(t)});return i},this.setCurrentName=function(t,e){var n=r,o=n.link,i=CloudCmd.PREFIX,a=i+f+n.dirPath;return o.title=t,o.innerHTML=h.encode(t),o.href=a+t,e.setAttribute("data-name","js-file-"+t),o},this.checkStorageHash=function(t,e){var r=a.parallel,n=d.loadCurrentHash,o=t+"-hash",i=a.with(y.get,o);if("string"!=typeof t)throw Error("name should be a string!");if("function"!=typeof e)throw Error("callback should be a function!");r([n,i],function(t,r,n){var o=void 0,i=/error/.test(r);i?t=r:r===n&&(o=!0),e(t,o,r)})},this.saveDataToStorage=function(t,e,r,n){var o=CloudCmd.config("localStorage"),i=d.isCurrentIsDir(),u=t+"-hash",s=t+"-data";if(!o||i)return a(n);a.if(r,function(){y.set(u,r),y.set(s,e),a(n,r)},function(t){d.loadCurrentHash(function(e,n){r=n,t()})})},this.getDataFromStorage=function(t,e){var r=t+"-hash",n=t+"-data",o=CloudCmd.config("localStorage"),i=d.isCurrentIsDir();if(!o||i)return a(e);a.parallel([a.with(y.get,n),a.with(y.get,r)],e)},this.getFM=function(){return d.getPanel().parentElement},this.getPanelPosition=function(t){return(t=t||d.getPanel()).dataset.name.replace("js-","")},this.getPanel=function(t){var e=void 0,r=void 0,n=void 0,o="js-",i=d.getCurrentFile();if(i?(e=i.parentElement,r=e.parentElement,n="js-left"===r.getAttribute("data-name")):r=d.getByDataName("js-left"),t&&!t.active&&(o+=n?"right":"left",r=d.getByDataName(o)),window.innerWidth<CloudCmd.MIN_ONE_PANEL_WIDTH&&(r=d.getByDataName("js-left")),!r)throw Error("can not find Active Panel!");return r},this.getFiles=function(t){var e=d.getByDataName("js-files",t);return e.children||[]},this.showPanel=function(t){var e=d.getPanel({active:t});return!!e&&(d.show(e),!0)},this.hidePanel=function(t){var e=d.getPanel({active:t});return!!e&&d.hide(e)},this.remove=function(t,e){var r=e||document.body;return r.removeChild(t),d},this.deleteCurrent=function(t){t||n.getCurrentFile();var e=t&&t.parentElement,r=n.getCurrentName(t);if(t&&".."!==r){var o=t.nextSibling,i=t.previousSibling;d.setCurrentFile(o||i),e.removeChild(t)}},this.deleteSelected=function(t){(t=t||d.getSelectedFiles())&&t.map(d.deleteCurrent)},this.renameCurrent=function(t){var e=d.Dialog;n.isCurrentFile(t)||(t=n.getCurrentFile());var r=n.getCurrentName(t);if(".."===r)return e.alert.noFiles(v);e.prompt(v,"Rename",r,{cancel:!1}).then(function(e){var o=!!d.getCurrentByName(e),i=n.getCurrentDirPath();if(r!==e){var a={from:i+r,to:i+e};m.mv(a,function(r){r||(d.setCurrentName(e,t),n.updateCurrentInfo(t),y.remove(i),o&&CloudCmd.refresh())})}})},this.scrollIntoViewIfNeeded=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.scrollIntoViewIfNeeded&&t.scrollIntoViewIfNeeded(e)},this.scrollByPages=function(t,e){var r=t&&t.scrollByPages&&e;return r&&t.scrollByPages(e),r},this.changePanel=function(){var t=d.getPanel(),e=d.getPanel({active:!1}),r=d.getCurrentName(),n=d.getFiles(e),o=t.getAttribute("data-name");g[o]=r,o=(t=e).getAttribute("data-name");var i=void 0,a=void 0;return(r=g[o])&&(a=d.getCurrentByName(r,t))&&(i=a.parentElement),i&&i.parentElement||(a=d.getCurrentByName(r,t))||(a=n[0]),d.setCurrentFile(a,{history:!0}),d},this.getPackerExt=function(t){return"zip"===t?".zip":".tar.gz"},this.goToDirectory=function(){var t=r.dirPath,e=d.Dialog;e.prompt(v,"Go to directory:",t,{cancel:!1}).then(function(t){return{path:t}}).then(CloudCmd.loadDir)},this.duplicatePanel=function(){var t=r,e=t.isDir,n=t.panelPassive,o=!t.isOnePanel,i=function(e){return e?t.path:t.dirPath}(e);CloudCmd.loadDir({path:i,panel:n,noCurrent:o})},this.swapPanels=function(){var t=r,e=t.panel,n=t.files,o=t.element,i=t.panelPassive,a=d.getCurrentDirPath(),u=d.getNotCurrentDirPath(),s=n.indexOf(o);CloudCmd.loadDir({path:a,panel:i,noCurrent:!0}),CloudCmd.loadDir({path:u,panel:e},function(){var e=t.files,r=e.length-1;s>r&&(s=r);var n=e[s];d.setCurrentFile(n)})},this.CurrentInfo=r,this.updateCurrentInfo=function(t){var e=n.CurrentInfo,r=t||n.getCurrentFile(),i=r.parentElement,a=i.parentElement,u=n.getPanel({active:!1}),c=d.getFiles(u),l=n.getCurrentName(r);e.dir=n.getCurrentDirName(),e.dirPath=n.getCurrentDirPath(),e.parentDirPath=n.getParentDirPath(),e.element=r,e.ext=s.getExt(l),e.files=[].concat(o(i.children)),e.filesPassive=[].concat(o(c)),e.first=i.firstChild,e.getData=n.getCurrentData,e.last=i.lastChild,e.link=n.getCurrentLink(r),e.mode=n.getCurrentMode(r),e.name=l,e.path=n.getCurrentPath(r),e.panel=a,e.panelPassive=u,e.size=n.getCurrentSize(r),e.isDir=n.isCurrentIsDir(),e.isSelected=n.isSelected(r),e.panelPosition=n.getPanel().dataset.name.replace("js-",""),e.isOnePanel=e.panel.getAttribute("data-name")===e.panelPassive.getAttribute("data-name")}});t.exports=d;var p=r(1),v=r(3),g=r(7),m=r(10),y=r(17);d.Images=p,d.load=v,d.Files=g,d.RESTful=m,d.Storage=y,d.uploadDirectory=r(66),d.Buffer=r(20),d.Events=r(8);var b=r(60),C=r(59)},function(t,e,r){"use strict";var n=r(4),o=r(5).FS;t.exports=new function(){function t(t){var e=t,r=CloudCmd.PREFIX_URL;e.url=r+e.url,e.url=encodeURI(e.url),e.url=e.url.replace("#","%23"),a.ajax({method:e.method,url:e.url,data:e.data,dataType:e.dataType,error:function(t){var r=t.responseText,n=t.statusText,o=t.status,a=404===o?r:n;i.show.error(a),setTimeout(function(){DOM.Dialog.alert(CloudCmd.TITLE,a)},100),e.callback(Error(a))},success:function(t){i.hide(),e.notLog||CloudCmd.log(t),e.callback(null,t)}})}this.delete=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"DELETE",url:o+e,data:r,callback:i,imgPosition:{top:!!r}})},this.patch=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null);t({method:"PATCH",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.write=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"PUT",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.read=function(e,r,i){var a=/\?/.test(e),u=/\?beautify$/.test(e),s=/\?minify$/.test(e),c=!a||u||s,l=n.function(r);!i&&l&&(i=r,r="text"),t({method:"GET",url:o+e,callback:i,notLog:c,dataType:r})},this.cp=function(e,r){t({method:"PUT",url:"/cp",data:e,callback:r,imgPosition:{top:!0}})},this.pack=function(e,r){t({method:"PUT",url:"/pack",data:e,callback:r})},this.extract=function(e,r){t({method:"PUT",url:"/extract",data:e,callback:r})},this.mv=function(e,r){t({method:"PUT",url:"/mv",data:e,callback:r,imgPosition:{top:!0}})},this.Config={read:function(e){t({method:"GET",url:"/config",callback:e,imgPosition:{top:!0},notLog:!0})},write:function(e,r){t({method:"PATCH",url:"/config",data:e,callback:r,imgPosition:{top:!0}})}},this.Markdown={read:function(e,r){t({method:"GET",url:"/markdown"+e,callback:r,imgPosition:{top:!0},notLog:!0})},render:function(e,r){t({method:"PUT",url:"/markdown",data:e,callback:r,imgPosition:{top:!0},notLog:!0})}}};var i=r(1),a=r(3)},function(t,e,r){t.exports=r(68)},function(t,e,r){t.exports=r(71)},function(t,e){!function(e){"use strict";function r(t,e){var r=t;return function(t,e){if("string"!=typeof t)throw Error("template should be string!");if("object"!=typeof e)throw Error("data should be object!")}(t,e),Object.keys(e).forEach(function(t){for(var n="{{ "+t+" }}",o=e[t];~r.indexOf(n);)r=r.replace(n,o)}),~r.indexOf("{{")&&(r=r.replace(/{{.*?}}/g,"")),r}"object"==typeof t&&t.exports?t.exports=r:e.rendy=r}(this)},function(t,e,r){t.exports=r(75)},function(t,e,r){t.exports=r(45)},function(t,e,r){t.exports=r(52)},function(t,e,r){"use strict";var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=r(4),i=r(11),a=r(0),u=r(21),s=localStorage.setItem.bind(localStorage),c=void 0;t.exports.setAllowed=function(t){c=t},t.exports.remove=function(e,r){return c&&localStorage.removeItem(e),a(r,null,c),t.exports},t.exports.removeMatch=function(e,r){var n=RegExp("^"+e+".*$");return Object.keys(localStorage).filter(function(t){return n.test(t)}).forEach(function(t){return localStorage.removeItem(t)}),a(r),t.exports},t.exports.set=function(e,r,l){var f=void 0,h=void 0;if(o.object(r)&&(f=i.stringify(r)),c&&e){var d=u(s,e,f||r);h=n(d,1)[0]}return a(l,h),t.exports},t.exports.get=function(e,r){var n=void 0;return c&&(n=localStorage.getItem(e)),a(r,null,n),t.exports},t.exports.clear=function(e){var r=c;return r&&localStorage.clear(),a(e,null,r),t.exports}},,function(t,e,r){"use strict";var n=r(0).eachSeries,o=r(16),i=r(9),a=r(3),u=r(1),s=r(5).FS,c=o(function(t){CloudCmd.refresh({currentName:t})}),l=o(function(t,e,r,n){var o=0,i=r.name,c=t+i,l=CloudCmd.PREFIX_URL+s;++o,a.put(l+c,r).on("end",n).on("progress",function(t){var r=function(t){return 100/t}(e),n=(o-1)*r+function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}(t,100,r);u.show.load("top"),u.setProgress(Math.round(n))})}),f=i.getCurrentDirPath;t.exports=function(t,e){e||(e=t,t=f());var r=e.length;if(r){var o=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(e)),i=e[0].name;n(o,l(t,r),c(i))}}},function(t,e,r){"use strict";var n=r(11),o=r(0),i=r(17),a=r(9);t.exports=new function(){var t=a.CurrentInfo,e="cut-file",r="copy",u="cut",s="Buffer";function c(t){a.Dialog.alert(s,t)}function l(){var t=a.getActiveFiles(),e=a.getFilenames(t);return e}function f(){var t=a.getByClassAll(e);[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t)).forEach(function(t){t.classList.remove(e)})}function h(t){var e=CloudCmd.config("buffer");if(e)return t();c("Buffer disabled in config!")}function d(){i.remove(r).remove(u),f()}return{cut:h.bind(null,function(){var r=l(),n=t.dirPath;if(d(),!r.length)return;a.getActiveFiles().forEach(function(t){t.classList.add(e)}),i.set(u,{from:n,names:r})}),copy:h.bind(null,function(){var e=l(),n=t.dirPath;if(d(),!e.length)return;i.remove(u).set(r,{from:n,names:e})}),clear:h.bind(null,d),paste:h.bind(null,function(){var e=i.get.bind(i,r),a=i.get.bind(i,u);o.parallel([e,a],function(e,r,o){var i=r?"copy":"move",a=r||o,u=CloudCmd.Operation,s=t.dirPath;if(e||r||o||(e="Buffer is empty!"),e)return c(e);var l=n.parse(a);if(l.to=s,l.from===s)return c("Path is same!");u.show(i,l),d()})})}}},function(t,e,r){"use strict";t.exports=function(t){var e=[].slice.call(arguments,1);try{return[null,t.apply(null,e)]}catch(t){return[t]}}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,,,,,,,,,,,,,,,,function(t,e){!function(e){"use strict";function r(){this.addSlashToEnd=function(t){return t&&("/"===t[t.length-1]||(t+="/")),t},this.size=function(t){var e=1073741824,r=1024*e,n=1024*r;return"number"==typeof t&&(t<1024?t+="b":t=t<1048576?(t/1024).toFixed(2)+"kb":t<e?(t/1048576).toFixed(2)+"mb":t<r?(t/e).toFixed(2)+"gb":t<n?(t/r).toFixed(2)+"tb":(t/n).toFixed(2)+"pb"),t},this.permissions={symbolic:function(t){var e,r,n,o="",i="";if(void 0!==typeof t){switch((o=t.toString()).charAt(0)-0){case 1:"-";break;case 2:"c";break;case 4:"d";break;default:"-"}e=((o=o.length>5?o.substr(3):o.substr(2))[0]-0).toString(2),r=(o[1]-0).toString(2),n=(o[2]-0).toString(2),i=(e[0]-0>0?"r":"-")+(e[1]-0>0?"w":"-")+(e[2]-0>0?"x":"-")+" "+(r[0]-0>0?"r":"-")+(r[1]-0>0?"w":"-")+(r[2]-0>0?"x":"-")+" "+(n[0]-0>0?"r":"-")+(n[1]-0>0?"w":"-")+(n[2]-0>0?"x":"-")}return i},numeric:function(t){return t&&11===t.length&&(t="00"+(("r"===t[0]?4:0)+("w"===t[1]?2:0)+("x"===t[2]?1:0))+(("r"===t[4]?4:0)+("w"===t[5]?2:0)+("x"===t[6]?1:0))+(("r"===t[8]?4:0)+("w"===t[9]?2:0)+("x"===t[10]?1:0))),t}}}"object"==typeof t&&t.exports?t.exports=new r:e.Format=new r}(this)},,,,,function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var o=function(t){return function(t,e,r){return[].slice.call(t,e,r)}(t,1)};t.exports=function(t){!function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t);var e=o(arguments);return function(){var r=[].concat(n(e),Array.prototype.slice.call(arguments));return t.apply(void 0,n(r))}}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t,e){return[e.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t))]}function i(t,e){return t.bind(null,e)}function a(t){return void 0===t?"undefined":n(t)}function u(t,e){return t!==e}function s(t){throw Error("fn should be "+t+"!")}t.exports=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t,e){var r=i(s,t),n=i(u,t);if(!e.length)return r(t);e.map(a).filter(n).forEach(r)}("function",e),function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.reduceRight(o,r).pop()}}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=r(2),i=r(15),a=r(44),u=o(function(t,e){return t(e)}),s=function(t){return t},c=o(function(t,e){return e.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t))});t.exports=function(t,e){e||(e=t,t=s);!function(t,e){if("function"!=typeof t)throw Error("condition should be function!");if(!Array.isArray(e))throw Error("filters should be an array!");!function(t,e){var r=a(function(t){throw Error("fn should be "+t+"!")},t),o=a(function(t,e){return t!==e},t);if(!e.length)return r(t);e.map(function(t){return void 0===t?"undefined":n(t)}).filter(o).forEach(r)}("function",e)}(t,e);var r=function(t){var e=void 0;return function(r){var n=void 0;return t(r)?e=n=r:(n=e,e=null),n}}(t),o=a(i,t,r),l=e.map(u(o)).reverse();return function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return l.some(c(e)),r()}}},function(t,e,r){t.exports=r(46)},function(t,e,r){"use strict";var n=r(47)([function(t,e){var r=t.split("").join(".*")+".*",n=RegExp("^"+r+"$","i");return e.filter(function(t){return n.test(t)})},function(t,e){return e.filter(function(e){return e.includes(t)})}]);t.exports=function(t,e){return function(t,e){if("string"!=typeof t)throw Error("pattern should be string!");if(!Array.isArray(e))throw Error("list should be an array!")}(t,e),n(t,e)||[]}},,,,function(t,e,r){"use strict";t.exports=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return function(){for(var e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];return t.apply(void 0,r.concat(n,o))}}}.apply(void 0,[t].concat(r))}},,,,,function(t,e,r){(function(e){!function(r){"use strict";var n=r.window?window:e,o="/join";function i(t,e){if(e||(e=t,t=o),!e)throw Error("names must be array!");return t+":"+e.join(":")}"object"==typeof t&&t.exports?t.exports=i:n.join=i}(this)}).call(this,r(22))},,function(t,e,r){"use strict";var n="*.*",o=r(6).getRegExp;t.exports=function(t,e){var r="Specify file type for "+t+" selection",i=DOM.Dialog;i.prompt("Cloud Commander",r,n,{cancel:!1}).then(function(r){n=r;var a=o(r);if(e){var u=0;e.forEach(function(e){var r=DOM.getCurrentName(e);if(".."!==r&&a.test(r)){++u;var n=DOM.isSelected(e);"expand"===t&&(n=!n),n&&DOM.toggleSelectedFile(e)}}),u||i.alert("Select Files","No matches found!")}})}},function(t,e,r){"use strict";var n=r(0),o=r(13),i=r(4),a=r(6).findObjByNameInArr,u=r(3),s=r(7);function c(t,e){return function(){u.parallel(t,e)}}t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,l=CloudCmd,f=l.PREFIX,h=l.config,d=e;if(d.name&&window[d.name])return r();s.get("modules",function(e,s){var l=h("online")&&navigator.onLine,d=a(s.remote,t),p=i.array(d.local),v=d.version,g=void 0,m=void 0;p?(g=d.remote,m=d.local):(g=[d.remote],m=[d.local]);var y=m.map(function(t){return f+t}),b=function(t,e,r){return function(){u.parallel(e,function(t){if(t)return c();r()})}}(0,g.map(function(t){return o(t,{version:v})}),r),C=c(y,r);n.if(l,b,C)})}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";t.exports=function(t,e,r){!function(t,e,r){if(!Array.isArray(t))throw Error("array should be an array!");if("function"!=typeof e)throw Error("iterator should be a function!");if("function"!=typeof r)throw Error("done should be a function!")}(t,e,r);var n=-1,o=t.length,i=function(a){if(++n,a||n===o)return r(a);e(t[n],i)};i()}},function(t,e,r){t.exports=r(62)},function(t,e,r){"use strict";var n=r(14);function o(t,e){if(!(this instanceof o))return new o(t,e);this._dirs=0,this._first=!0,this._find(t,e)}t.exports=function(t){var e=n();return setTimeout(function(){o(e,t)},0),e},o.prototype._find=function(t,e){var r=this;if(e.isFile)return t.emit("file",e.fullPath,e),void(this._first&&t.emit("end"));this._first&&(this._first=!1),t.emit("directory",e.fullPath,e),++this._dirs,e.createReader().readEntries(function(e){[].forEach.call(e,function(e){r._find(t,e)}),--r._dirs,r._dirs||t.emit("end")})}},function(t,e,r){"use strict";var n=r(64),o=r(14),i=r(63),a=r(61);function u(t,e){var r=this;if(!(this instanceof u))return new u(t,e);if("function"!=typeof e)throw Error("processingFn should be function!");o.call(this);var n=Array.isArray(t)?t:[t];this._i=0,this._n=0,this._processingFn=e,this._pause=!1,this._prev=0,this._find(n,function(t,e){r._files=t,r._dirs=e,r._n=t.length+e.length,r._data={},r._getFiles(t,r._data,function(){r._process()})})}t.exports=u,a(u,o),u.prototype._process=function(){var t=this,e=this._processingFn.length,r=void 0,n=this._dirs.shift(),o="directory";if(!n){o="file";var i=this._files.shift();i&&(n=i.fullPath,r=this._data[n])}if(!n)return this.emit("end");var a=void 0;if(!this._pause){switch(e){default:a=[o,n,r];break;case 6:a=[o,n,r,this._i,this._n]}a.push(function(e){++t._i,e&&(t.emit("error",e),t.pause()),t._process(),t._progress()}),this._processingFn.apply(this,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(a))}},u.prototype.pause=function(){this._pause=!0},u.prototype.continue=function(){this._pause&&(this._pause=!1,this._process())},u.prototype.abort=function(){this._files=[],this._dirs=[],this._process()},u.prototype._progress=function(){var t=Math.round(100*this._i/this._n);t!==this._prev&&(this._prev=t,this.emit("progress",t))},u.prototype._getFiles=function(t,e,r){var n=this,o=t.slice(),i=o.shift();if(!i)return r(null,e);i.file(function(t){var a=i.fullPath;e[a]=t,n._getFiles(o,e,r)})},u.prototype._find=function(t,e){var r=[],o=[];i(t,function(t,e){var i=n(t);i.on("directory",function(t){o.push(t)}),i.on("file",function(t,e){r.push(e)}),i.on("end",function(){e()})},function(){e(r,o)})}},function(t,e,r){"use strict";var n=r(65),o=r(1),i=r(5).FS,a=r(9),u=a.getCurrentDirPath;function s(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}function c(t){a.Images.setProgress(t).show("top")}t.exports=function(t){var e=a.Dialog;t.length&&o.show("top");var r=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t)).map(function(t){return t.webkitGetAsEntry()}),l=u().replace(/\/$/,""),f=n(r,function(t,e,r,n,o,u){var f,h=CloudCmd.PREFIX_URL+i+l+e,d=void 0;switch(t){case"file":d=function(t,e){return a.load.put(t,e)}(h,r);break;case"directory":f=h,d=a.load.put(f+"?dir")}d.on("end",u),d.on("progress",function(t){var e=s(n,o);c(e+s(t,100,s(n+1,o)-e))})});f.on("error",function(t){e.alert(t),f.abort()}),f.on("progress",c),f.on("end",CloudCmd.refresh)}},function(t,e,r){"use strict";var n=t.exports;t.exports.isContainClass=function(t,e){if(!t)throw Error("element could not be empty!");if(!e)throw Error("className could not be empty!");return t.classList.contains(e)},t.exports.getByTag=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).getElementsByTagName(t)},t.exports.getById=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("#"+t)},t.exports.getByClass=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return n.getByClassAll(t,e)[0]},t.exports.getByDataName=function(t){var e='[data-name="'+t+'"]';return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector(e)},t.exports.getByClassAll=function(t,e){return(e||document).getElementsByClassName(t)},t.exports.hide=function(t){return t.classList.add("hidden"),n},t.exports.show=function(t){return t.classList.remove("hidden"),n}},function(t,e,r){"use strict";var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=r(21),i=JSON.parse,a=JSON.stringify;t.exports.parse=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var a=o.apply(void 0,[i].concat(e));return n(a,2)[1]},t.exports.stringify=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=o.apply(void 0,[a].concat(e));return n(i,2)[1]}},function(t,e,r){"use strict";t.exports=new function(){function t(t){var e={}.toString.call(t),r=e.match(/\s([a-zA-Z]+)/)[1],n=r.toLowerCase();return n}return["arrayBuffer","file","array","object"].forEach(function(e){t[e]=function(e,r){return t(r)===e}.bind(null,e)}),["null","string","undefined","boolean","number","function"].forEach(function(e){t[e]=function(t,e){return typeof e===t}.bind(null,e)}),t}},function(t,e,r){"use strict";var n={"&nbsp;":" ","&lt;":"<","&gt;":">"},o=Object.keys(n);t.exports.encode=function(t){return o.forEach(function(e){var r=RegExp(n[e],"g");t=t.replace(r,e)}),t},t.exports.decode=function(t){return o.forEach(function(e){var r=n[e],o=RegExp(e,"g");t=t.replace(o,r)}),t}},function(t,e,r){"use strict";t.exports=function(t){var e={value:t};return function(t){return arguments.length?(e.value=t,t):e.value}}},function(t,e,r){"use strict";t.exports=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(e),n.length>=e.length)return e.apply(void 0,n);var i=function(){return t.apply(void 0,[e].concat(n,Array.prototype.slice.call(arguments)))},a=e.length-n.length-1;return function(t){return[function(e){return t.apply(void 0,arguments)},function(e,r){return t.apply(void 0,arguments)},function(e,r,n){return t.apply(void 0,arguments)},function(e,r,n,o){return t.apply(void 0,arguments)},function(e,r,n,o,i){return t.apply(void 0,arguments)}]}(i)[a]||i}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||l||u(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){(function(e,r){var n;n=function(){"use strict";function t(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,a=void 0,u=function(t,e){p[o]=t,p[o+1]=e,2===(o+=2)&&(a?a(v):C())};var s="undefined"!=typeof window?window:void 0,c=s||{},l=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(v,1)}}var p=new Array(1e3);function v(){for(var t=0;t<o;t+=2){(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0}o=0}var g,m,y,b,C=void 0;function w(t,e){var r=this,n=new this.constructor(A);void 0===n[E]&&M(n);var o=r._state;if(o){var i=arguments[o-1];u(function(){return B(o,n,i,r._result)})}else I(r,n,t,e);return n}function x(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return k(e,t),e}f?C=function(){return e.nextTick(v)}:l?(m=0,y=new l(v),b=document.createTextNode(""),y.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((g=new MessageChannel).port1.onmessage=v,C=function(){return g.port2.postMessage(0)}):C=void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(i=t.runOnLoop||t.runOnContext)?function(){i(v)}:d()}catch(t){return d()}}():d();var E=Math.random().toString(36).substring(2);function A(){}var _=void 0,P=1,F=2,S={error:null};function D(t){try{return t.then}catch(t){return S.error=t,S}}function j(e,r,n){r.constructor===e.constructor&&n===w&&r.constructor.resolve===x?function(t,e){e._state===P?N(t,e._result):e._state===F?O(t,e._result):I(e,void 0,function(e){return k(t,e)},function(e){return O(t,e)})}(e,r):n===S?(O(e,S.error),S.error=null):void 0===n?N(e,r):t(n)?function(t,e,r){u(function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?k(t,r):N(t,r))},function(e){n||(n=!0,O(t,e))},t._label);!n&&o&&(n=!0,O(t,o))},t)}(e,r,n):N(e,r)}function k(t,e){var r,n;t===e?O(t,new TypeError("You cannot resolve a promise with itself")):(n=typeof(r=e),null===r||"object"!==n&&"function"!==n?N(t,e):j(t,e,D(e)))}function T(t){t._onerror&&t._onerror(t._result),L(t)}function N(t,e){t._state===_&&(t._result=e,t._state=P,0!==t._subscribers.length&&u(L,t))}function O(t,e){t._state===_&&(t._state=F,t._result=e,u(T,t))}function I(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+P]=r,o[i+F]=n,0===i&&t._state&&u(L,t)}function L(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+r],n?B(r,n,o,i):o(i);t._subscribers.length=0}}function B(e,r,n,o){var i=t(n),a=void 0,u=void 0,s=void 0,c=void 0;if(i){if((a=function(t,e){try{return t(e)}catch(t){return S.error=t,S}}(n,o))===S?(c=!0,u=a.error,a.error=null):s=!0,r===a)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else a=o,s=!0;r._state!==_||(i&&s?k(r,a):c?O(r,u):e===P?N(r,a):e===F&&O(r,a))}var R=0;function M(t){t[E]=R++,t._state=void 0,t._result=void 0,t._subscribers=[]}var z=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[E]||M(this.promise),n(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&N(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===_&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===x){var o=D(t);if(o===w&&t._state!==_)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===H){var i=new r(A);j(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===_&&(this._remaining--,t===F?O(n,r):this._result[e]=r),0===this._remaining&&N(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){return r._settledAt(P,e,t)},function(t){return r._settledAt(F,e,t)})},t}();var H=function(){function t(e){this[E]=R++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e(function(e){k(t,e)},function(e){O(t,e)})}catch(e){O(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},t}();return H.prototype.then=w,H.all=function(t){return new z(this,t).promise},H.race=function(t){var e=this;return n(t)?new e(function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},H.resolve=x,H.reject=function(t){var e=new this(A);return O(e,t),e},H._setScheduler=function(t){a=t},H._setAsap=function(t){u=t},H._asap=u,H.polyfill=function(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=H},H.Promise=H,H},t.exports=n()}).call(this,r(73),r(22))},function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;this._all={}}function o(t){if("string"!=typeof t)throw Error("event should be string!")}function i(t,e){o(t),function(t){if("function"!=typeof t)throw Error("callback should be function!")}(e)}t.exports=n,n.prototype.on=function(t,e){var r=this._all[t];return i(t,e),r?r.push(e):this._all[t]=[e],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){var r=this;return i(t,e),r.on(t,function n(){e.apply(null,arguments),r.off(t,n)}),this},n.prototype.off=function(t,e){var r=this._all[t]||[],n=r.indexOf(e);for(i(t,e);~n;)r.splice(n,1),n=r.indexOf(e);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(t){var e=[].slice.call(arguments,1),r=this._all[t];if(o(t),!r&&"error"===t)throw e[0];return r?(r.forEach(function(t){t.apply(null,e)}),this):this},n.prototype.removeAllListeners=function(t){return o(t),this._all[t]=[],this}}]]);
//# sourceMappingURL=common.js.map