cloudcmd 19.20.5 → 19.20.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2790,6 +2790,541 @@ module.exports = function sign(number) {
2790
2790
  };
2791
2791
 
2792
2792
 
2793
+ },
2794
+ 7975(module, __unused_rspack_exports, __webpack_require__) {
2795
+ "use strict";
2796
+ /* provided dependency */ var process = __webpack_require__(5606);
2797
+ // 'path' module extracted from Node.js v8.11.1 (only the posix part)
2798
+ // transplited with Babel
2799
+
2800
+ // Copyright Joyent, Inc. and other Node contributors.
2801
+ //
2802
+ // Permission is hereby granted, free of charge, to any person obtaining a
2803
+ // copy of this software and associated documentation files (the
2804
+ // "Software"), to deal in the Software without restriction, including
2805
+ // without limitation the rights to use, copy, modify, merge, publish,
2806
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
2807
+ // persons to whom the Software is furnished to do so, subject to the
2808
+ // following conditions:
2809
+ //
2810
+ // The above copyright notice and this permission notice shall be included
2811
+ // in all copies or substantial portions of the Software.
2812
+ //
2813
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2814
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2815
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2816
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2817
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2818
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2819
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
2820
+
2821
+
2822
+
2823
+ function assertPath(path) {
2824
+ if (typeof path !== 'string') {
2825
+ throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
2826
+ }
2827
+ }
2828
+
2829
+ // Resolves . and .. elements in a path with directory names
2830
+ function normalizeStringPosix(path, allowAboveRoot) {
2831
+ var res = '';
2832
+ var lastSegmentLength = 0;
2833
+ var lastSlash = -1;
2834
+ var dots = 0;
2835
+ var code;
2836
+ for (var i = 0; i <= path.length; ++i) {
2837
+ if (i < path.length)
2838
+ code = path.charCodeAt(i);
2839
+ else if (code === 47 /*/*/)
2840
+ break;
2841
+ else
2842
+ code = 47 /*/*/;
2843
+ if (code === 47 /*/*/) {
2844
+ if (lastSlash === i - 1 || dots === 1) {
2845
+ // NOOP
2846
+ } else if (lastSlash !== i - 1 && dots === 2) {
2847
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
2848
+ if (res.length > 2) {
2849
+ var lastSlashIndex = res.lastIndexOf('/');
2850
+ if (lastSlashIndex !== res.length - 1) {
2851
+ if (lastSlashIndex === -1) {
2852
+ res = '';
2853
+ lastSegmentLength = 0;
2854
+ } else {
2855
+ res = res.slice(0, lastSlashIndex);
2856
+ lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
2857
+ }
2858
+ lastSlash = i;
2859
+ dots = 0;
2860
+ continue;
2861
+ }
2862
+ } else if (res.length === 2 || res.length === 1) {
2863
+ res = '';
2864
+ lastSegmentLength = 0;
2865
+ lastSlash = i;
2866
+ dots = 0;
2867
+ continue;
2868
+ }
2869
+ }
2870
+ if (allowAboveRoot) {
2871
+ if (res.length > 0)
2872
+ res += '/..';
2873
+ else
2874
+ res = '..';
2875
+ lastSegmentLength = 2;
2876
+ }
2877
+ } else {
2878
+ if (res.length > 0)
2879
+ res += '/' + path.slice(lastSlash + 1, i);
2880
+ else
2881
+ res = path.slice(lastSlash + 1, i);
2882
+ lastSegmentLength = i - lastSlash - 1;
2883
+ }
2884
+ lastSlash = i;
2885
+ dots = 0;
2886
+ } else if (code === 46 /*.*/ && dots !== -1) {
2887
+ ++dots;
2888
+ } else {
2889
+ dots = -1;
2890
+ }
2891
+ }
2892
+ return res;
2893
+ }
2894
+
2895
+ function _format(sep, pathObject) {
2896
+ var dir = pathObject.dir || pathObject.root;
2897
+ var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
2898
+ if (!dir) {
2899
+ return base;
2900
+ }
2901
+ if (dir === pathObject.root) {
2902
+ return dir + base;
2903
+ }
2904
+ return dir + sep + base;
2905
+ }
2906
+
2907
+ var posix = {
2908
+ // path.resolve([from ...], to)
2909
+ resolve: function resolve() {
2910
+ var resolvedPath = '';
2911
+ var resolvedAbsolute = false;
2912
+ var cwd;
2913
+
2914
+ for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
2915
+ var path;
2916
+ if (i >= 0)
2917
+ path = arguments[i];
2918
+ else {
2919
+ if (cwd === undefined)
2920
+ cwd = process.cwd();
2921
+ path = cwd;
2922
+ }
2923
+
2924
+ assertPath(path);
2925
+
2926
+ // Skip empty entries
2927
+ if (path.length === 0) {
2928
+ continue;
2929
+ }
2930
+
2931
+ resolvedPath = path + '/' + resolvedPath;
2932
+ resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
2933
+ }
2934
+
2935
+ // At this point the path should be resolved to a full absolute path, but
2936
+ // handle relative paths to be safe (might happen when process.cwd() fails)
2937
+
2938
+ // Normalize the path
2939
+ resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
2940
+
2941
+ if (resolvedAbsolute) {
2942
+ if (resolvedPath.length > 0)
2943
+ return '/' + resolvedPath;
2944
+ else
2945
+ return '/';
2946
+ } else if (resolvedPath.length > 0) {
2947
+ return resolvedPath;
2948
+ } else {
2949
+ return '.';
2950
+ }
2951
+ },
2952
+
2953
+ normalize: function normalize(path) {
2954
+ assertPath(path);
2955
+
2956
+ if (path.length === 0) return '.';
2957
+
2958
+ var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
2959
+ var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
2960
+
2961
+ // Normalize the path
2962
+ path = normalizeStringPosix(path, !isAbsolute);
2963
+
2964
+ if (path.length === 0 && !isAbsolute) path = '.';
2965
+ if (path.length > 0 && trailingSeparator) path += '/';
2966
+
2967
+ if (isAbsolute) return '/' + path;
2968
+ return path;
2969
+ },
2970
+
2971
+ isAbsolute: function isAbsolute(path) {
2972
+ assertPath(path);
2973
+ return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
2974
+ },
2975
+
2976
+ join: function join() {
2977
+ if (arguments.length === 0)
2978
+ return '.';
2979
+ var joined;
2980
+ for (var i = 0; i < arguments.length; ++i) {
2981
+ var arg = arguments[i];
2982
+ assertPath(arg);
2983
+ if (arg.length > 0) {
2984
+ if (joined === undefined)
2985
+ joined = arg;
2986
+ else
2987
+ joined += '/' + arg;
2988
+ }
2989
+ }
2990
+ if (joined === undefined)
2991
+ return '.';
2992
+ return posix.normalize(joined);
2993
+ },
2994
+
2995
+ relative: function relative(from, to) {
2996
+ assertPath(from);
2997
+ assertPath(to);
2998
+
2999
+ if (from === to) return '';
3000
+
3001
+ from = posix.resolve(from);
3002
+ to = posix.resolve(to);
3003
+
3004
+ if (from === to) return '';
3005
+
3006
+ // Trim any leading backslashes
3007
+ var fromStart = 1;
3008
+ for (; fromStart < from.length; ++fromStart) {
3009
+ if (from.charCodeAt(fromStart) !== 47 /*/*/)
3010
+ break;
3011
+ }
3012
+ var fromEnd = from.length;
3013
+ var fromLen = fromEnd - fromStart;
3014
+
3015
+ // Trim any leading backslashes
3016
+ var toStart = 1;
3017
+ for (; toStart < to.length; ++toStart) {
3018
+ if (to.charCodeAt(toStart) !== 47 /*/*/)
3019
+ break;
3020
+ }
3021
+ var toEnd = to.length;
3022
+ var toLen = toEnd - toStart;
3023
+
3024
+ // Compare paths to find the longest common path from root
3025
+ var length = fromLen < toLen ? fromLen : toLen;
3026
+ var lastCommonSep = -1;
3027
+ var i = 0;
3028
+ for (; i <= length; ++i) {
3029
+ if (i === length) {
3030
+ if (toLen > length) {
3031
+ if (to.charCodeAt(toStart + i) === 47 /*/*/) {
3032
+ // We get here if `from` is the exact base path for `to`.
3033
+ // For example: from='/foo/bar'; to='/foo/bar/baz'
3034
+ return to.slice(toStart + i + 1);
3035
+ } else if (i === 0) {
3036
+ // We get here if `from` is the root
3037
+ // For example: from='/'; to='/foo'
3038
+ return to.slice(toStart + i);
3039
+ }
3040
+ } else if (fromLen > length) {
3041
+ if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
3042
+ // We get here if `to` is the exact base path for `from`.
3043
+ // For example: from='/foo/bar/baz'; to='/foo/bar'
3044
+ lastCommonSep = i;
3045
+ } else if (i === 0) {
3046
+ // We get here if `to` is the root.
3047
+ // For example: from='/foo'; to='/'
3048
+ lastCommonSep = 0;
3049
+ }
3050
+ }
3051
+ break;
3052
+ }
3053
+ var fromCode = from.charCodeAt(fromStart + i);
3054
+ var toCode = to.charCodeAt(toStart + i);
3055
+ if (fromCode !== toCode)
3056
+ break;
3057
+ else if (fromCode === 47 /*/*/)
3058
+ lastCommonSep = i;
3059
+ }
3060
+
3061
+ var out = '';
3062
+ // Generate the relative path based on the path difference between `to`
3063
+ // and `from`
3064
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
3065
+ if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
3066
+ if (out.length === 0)
3067
+ out += '..';
3068
+ else
3069
+ out += '/..';
3070
+ }
3071
+ }
3072
+
3073
+ // Lastly, append the rest of the destination (`to`) path that comes after
3074
+ // the common path parts
3075
+ if (out.length > 0)
3076
+ return out + to.slice(toStart + lastCommonSep);
3077
+ else {
3078
+ toStart += lastCommonSep;
3079
+ if (to.charCodeAt(toStart) === 47 /*/*/)
3080
+ ++toStart;
3081
+ return to.slice(toStart);
3082
+ }
3083
+ },
3084
+
3085
+ _makeLong: function _makeLong(path) {
3086
+ return path;
3087
+ },
3088
+
3089
+ dirname: function dirname(path) {
3090
+ assertPath(path);
3091
+ if (path.length === 0) return '.';
3092
+ var code = path.charCodeAt(0);
3093
+ var hasRoot = code === 47 /*/*/;
3094
+ var end = -1;
3095
+ var matchedSlash = true;
3096
+ for (var i = path.length - 1; i >= 1; --i) {
3097
+ code = path.charCodeAt(i);
3098
+ if (code === 47 /*/*/) {
3099
+ if (!matchedSlash) {
3100
+ end = i;
3101
+ break;
3102
+ }
3103
+ } else {
3104
+ // We saw the first non-path separator
3105
+ matchedSlash = false;
3106
+ }
3107
+ }
3108
+
3109
+ if (end === -1) return hasRoot ? '/' : '.';
3110
+ if (hasRoot && end === 1) return '//';
3111
+ return path.slice(0, end);
3112
+ },
3113
+
3114
+ basename: function basename(path, ext) {
3115
+ if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
3116
+ assertPath(path);
3117
+
3118
+ var start = 0;
3119
+ var end = -1;
3120
+ var matchedSlash = true;
3121
+ var i;
3122
+
3123
+ if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
3124
+ if (ext.length === path.length && ext === path) return '';
3125
+ var extIdx = ext.length - 1;
3126
+ var firstNonSlashEnd = -1;
3127
+ for (i = path.length - 1; i >= 0; --i) {
3128
+ var code = path.charCodeAt(i);
3129
+ if (code === 47 /*/*/) {
3130
+ // If we reached a path separator that was not part of a set of path
3131
+ // separators at the end of the string, stop now
3132
+ if (!matchedSlash) {
3133
+ start = i + 1;
3134
+ break;
3135
+ }
3136
+ } else {
3137
+ if (firstNonSlashEnd === -1) {
3138
+ // We saw the first non-path separator, remember this index in case
3139
+ // we need it if the extension ends up not matching
3140
+ matchedSlash = false;
3141
+ firstNonSlashEnd = i + 1;
3142
+ }
3143
+ if (extIdx >= 0) {
3144
+ // Try to match the explicit extension
3145
+ if (code === ext.charCodeAt(extIdx)) {
3146
+ if (--extIdx === -1) {
3147
+ // We matched the extension, so mark this as the end of our path
3148
+ // component
3149
+ end = i;
3150
+ }
3151
+ } else {
3152
+ // Extension does not match, so our result is the entire path
3153
+ // component
3154
+ extIdx = -1;
3155
+ end = firstNonSlashEnd;
3156
+ }
3157
+ }
3158
+ }
3159
+ }
3160
+
3161
+ if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
3162
+ return path.slice(start, end);
3163
+ } else {
3164
+ for (i = path.length - 1; i >= 0; --i) {
3165
+ if (path.charCodeAt(i) === 47 /*/*/) {
3166
+ // If we reached a path separator that was not part of a set of path
3167
+ // separators at the end of the string, stop now
3168
+ if (!matchedSlash) {
3169
+ start = i + 1;
3170
+ break;
3171
+ }
3172
+ } else if (end === -1) {
3173
+ // We saw the first non-path separator, mark this as the end of our
3174
+ // path component
3175
+ matchedSlash = false;
3176
+ end = i + 1;
3177
+ }
3178
+ }
3179
+
3180
+ if (end === -1) return '';
3181
+ return path.slice(start, end);
3182
+ }
3183
+ },
3184
+
3185
+ extname: function extname(path) {
3186
+ assertPath(path);
3187
+ var startDot = -1;
3188
+ var startPart = 0;
3189
+ var end = -1;
3190
+ var matchedSlash = true;
3191
+ // Track the state of characters (if any) we see before our first dot and
3192
+ // after any path separator we find
3193
+ var preDotState = 0;
3194
+ for (var i = path.length - 1; i >= 0; --i) {
3195
+ var code = path.charCodeAt(i);
3196
+ if (code === 47 /*/*/) {
3197
+ // If we reached a path separator that was not part of a set of path
3198
+ // separators at the end of the string, stop now
3199
+ if (!matchedSlash) {
3200
+ startPart = i + 1;
3201
+ break;
3202
+ }
3203
+ continue;
3204
+ }
3205
+ if (end === -1) {
3206
+ // We saw the first non-path separator, mark this as the end of our
3207
+ // extension
3208
+ matchedSlash = false;
3209
+ end = i + 1;
3210
+ }
3211
+ if (code === 46 /*.*/) {
3212
+ // If this is our first dot, mark it as the start of our extension
3213
+ if (startDot === -1)
3214
+ startDot = i;
3215
+ else if (preDotState !== 1)
3216
+ preDotState = 1;
3217
+ } else if (startDot !== -1) {
3218
+ // We saw a non-dot and non-path separator before our dot, so we should
3219
+ // have a good chance at having a non-empty extension
3220
+ preDotState = -1;
3221
+ }
3222
+ }
3223
+
3224
+ if (startDot === -1 || end === -1 ||
3225
+ // We saw a non-dot character immediately before the dot
3226
+ preDotState === 0 ||
3227
+ // The (right-most) trimmed path component is exactly '..'
3228
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
3229
+ return '';
3230
+ }
3231
+ return path.slice(startDot, end);
3232
+ },
3233
+
3234
+ format: function format(pathObject) {
3235
+ if (pathObject === null || typeof pathObject !== 'object') {
3236
+ throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
3237
+ }
3238
+ return _format('/', pathObject);
3239
+ },
3240
+
3241
+ parse: function parse(path) {
3242
+ assertPath(path);
3243
+
3244
+ var ret = { root: '', dir: '', base: '', ext: '', name: '' };
3245
+ if (path.length === 0) return ret;
3246
+ var code = path.charCodeAt(0);
3247
+ var isAbsolute = code === 47 /*/*/;
3248
+ var start;
3249
+ if (isAbsolute) {
3250
+ ret.root = '/';
3251
+ start = 1;
3252
+ } else {
3253
+ start = 0;
3254
+ }
3255
+ var startDot = -1;
3256
+ var startPart = 0;
3257
+ var end = -1;
3258
+ var matchedSlash = true;
3259
+ var i = path.length - 1;
3260
+
3261
+ // Track the state of characters (if any) we see before our first dot and
3262
+ // after any path separator we find
3263
+ var preDotState = 0;
3264
+
3265
+ // Get non-dir info
3266
+ for (; i >= start; --i) {
3267
+ code = path.charCodeAt(i);
3268
+ if (code === 47 /*/*/) {
3269
+ // If we reached a path separator that was not part of a set of path
3270
+ // separators at the end of the string, stop now
3271
+ if (!matchedSlash) {
3272
+ startPart = i + 1;
3273
+ break;
3274
+ }
3275
+ continue;
3276
+ }
3277
+ if (end === -1) {
3278
+ // We saw the first non-path separator, mark this as the end of our
3279
+ // extension
3280
+ matchedSlash = false;
3281
+ end = i + 1;
3282
+ }
3283
+ if (code === 46 /*.*/) {
3284
+ // If this is our first dot, mark it as the start of our extension
3285
+ if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
3286
+ } else if (startDot !== -1) {
3287
+ // We saw a non-dot and non-path separator before our dot, so we should
3288
+ // have a good chance at having a non-empty extension
3289
+ preDotState = -1;
3290
+ }
3291
+ }
3292
+
3293
+ if (startDot === -1 || end === -1 ||
3294
+ // We saw a non-dot character immediately before the dot
3295
+ preDotState === 0 ||
3296
+ // The (right-most) trimmed path component is exactly '..'
3297
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
3298
+ if (end !== -1) {
3299
+ if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
3300
+ }
3301
+ } else {
3302
+ if (startPart === 0 && isAbsolute) {
3303
+ ret.name = path.slice(1, startDot);
3304
+ ret.base = path.slice(1, end);
3305
+ } else {
3306
+ ret.name = path.slice(startPart, startDot);
3307
+ ret.base = path.slice(startPart, end);
3308
+ }
3309
+ ret.ext = path.slice(startDot, end);
3310
+ }
3311
+
3312
+ if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
3313
+
3314
+ return ret;
3315
+ },
3316
+
3317
+ sep: '/',
3318
+ delimiter: ':',
3319
+ win32: null,
3320
+ posix: null
3321
+ };
3322
+
3323
+ posix.posix = posix;
3324
+
3325
+ module.exports = posix;
3326
+
3327
+
2793
3328
  },
2794
3329
  6578(module) {
2795
3330
  "use strict";
@@ -7001,16 +7536,8 @@ const paste = checkEnabled(async ()=>{
7001
7536
  2186(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
7002
7537
  "use strict";
7003
7538
  __webpack_require__.r(__webpack_exports__);
7004
- /* global DOM */ const SELECTED_FILE = 'selected-file';
7005
- const Cmd = (/* runtime-dependent pure expression or super */ /^(145|791|985)$/.test(__webpack_require__.j) ? ({
7006
- getSelectedFiles,
7007
- isSelected,
7008
- unselectFile,
7009
- selectFile,
7010
- selectAllFiles,
7011
- toggleSelectedFile,
7012
- toggleAllSelectedFiles
7013
- }) : null);
7539
+ const SELECTED_FILE = 'selected-file';
7540
+ const { DOM } = globalThis;
7014
7541
  /**
7015
7542
  * selected file check
7016
7543
  *
@@ -7025,27 +7552,27 @@ const Cmd = (/* runtime-dependent pure expression or super */ /^(145|791|985)$/.
7025
7552
  */ function selectFile(currentFile) {
7026
7553
  const current = currentFile || DOM.getCurrentFile();
7027
7554
  current.classList.add(SELECTED_FILE);
7028
- return Cmd;
7555
+ return DOM;
7029
7556
  }
7030
7557
  function unselectFile(currentFile) {
7031
7558
  const current = currentFile || DOM.getCurrentFile();
7032
7559
  current.classList.remove(SELECTED_FILE);
7033
- return Cmd;
7560
+ return DOM;
7034
7561
  }
7035
7562
  function toggleSelectedFile(currentFile) {
7036
7563
  const current = currentFile || DOM.getCurrentFile();
7037
7564
  const name = DOM.getCurrentName(current);
7038
- if (name === '..') return Cmd;
7565
+ if (name === '..') return DOM;
7039
7566
  current.classList.toggle(SELECTED_FILE);
7040
- return Cmd;
7567
+ return DOM;
7041
7568
  }
7042
7569
  function toggleAllSelectedFiles() {
7043
7570
  DOM.getAllFiles().map(DOM.toggleSelectedFile);
7044
- return Cmd;
7571
+ return DOM;
7045
7572
  }
7046
7573
  function selectAllFiles() {
7047
7574
  DOM.getAllFiles().map(DOM.selectFile);
7048
- return Cmd;
7575
+ return DOM;
7049
7576
  }
7050
7577
  /**
7051
7578
  * unified way to get selected files
@@ -7904,10 +8431,10 @@ const FILES_JSON = 'config|modules';
7904
8431
  const FILES_HTML = 'file|path|link|pathLink|media';
7905
8432
  const FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload';
7906
8433
  const DIR_HTML = '/tmpl/';
7907
- const DIR_HTML_FS = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (`${DIR_HTML}fs/`) : null);
8434
+ const DIR_HTML_FS = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (`${DIR_HTML}fs/`) : null);
7908
8435
  const DIR_JSON = '/json/';
7909
- const timeout = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (getTimeoutOnce(2000)) : null);
7910
- const get = (/* runtime-dependent pure expression or super */ /^(127|145|791|816|968|985)$/.test(__webpack_require__.j) ? (getFile) : null);
8436
+ const timeout = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (getTimeoutOnce(2000)) : null);
8437
+ const get = (/* runtime-dependent pure expression or super */ /^(127|145|392|791|816|968|985)$/.test(__webpack_require__.j) ? (getFile) : null);
7911
8438
  function getFile(name) {
7912
8439
  const type = itype__rspack_import_0(name);
7913
8440
  check(name);
@@ -9378,12 +9905,12 @@ __webpack_require__.d(__webpack_exports__, {
9378
9905
  691(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
9379
9906
  "use strict";
9380
9907
  /* import */ var execon__rspack_import_0 = __webpack_require__(9168);
9381
- /* import */ var wraptile__rspack_import_1 = __webpack_require__(9317);
9382
- /* import */ var _dom_load__rspack_import_2 = __webpack_require__(8576);
9383
- /* import */ var _dom_dialog__rspack_import_3 = __webpack_require__(6462);
9384
- /* import */ var _common_cloudfunc__rspack_import_4 = __webpack_require__(5700);
9385
- /* import */ var _dom_images__rspack_import_5 = __webpack_require__(6226);
9386
- /* import */ var _current_file_js__rspack_import_6 = __webpack_require__(4958);
9908
+ /* import */ var wraptile__rspack_import_6 = __webpack_require__(9317);
9909
+ /* import */ var _dom_load__rspack_import_1 = __webpack_require__(8576);
9910
+ /* import */ var _dom_dialog__rspack_import_2 = __webpack_require__(6462);
9911
+ /* import */ var _common_cloudfunc__rspack_import_3 = __webpack_require__(5700);
9912
+ /* import */ var _dom_images__rspack_import_4 = __webpack_require__(6226);
9913
+ /* import */ var _current_file_js__rspack_import_5 = __webpack_require__(4958);
9387
9914
  /* global CloudCmd */
9388
9915
 
9389
9916
 
@@ -9391,12 +9918,12 @@ __webpack_require__.d(__webpack_exports__, {
9391
9918
 
9392
9919
 
9393
9920
 
9394
- const loadFile = wraptile__rspack_import_1(_loadFile);
9395
- const onEnd = wraptile__rspack_import_1(_onEnd);
9921
+ const loadFile = wraptile__rspack_import_6(_loadFile);
9922
+ const onEnd = wraptile__rspack_import_6(_onEnd);
9396
9923
  const uploadFiles = (dir, files)=>{
9397
9924
  if (!files) {
9398
9925
  files = dir;
9399
- dir = (0,_current_file_js__rspack_import_6.getCurrentDirPath)();
9926
+ dir = (0,_current_file_js__rspack_import_5.getCurrentDirPath)();
9400
9927
  }
9401
9928
  const n = files.length;
9402
9929
  if (!n) return;
@@ -9414,21 +9941,21 @@ function _loadFile(dir, n, file, callback) {
9414
9941
  const { name } = file;
9415
9942
  const path = dir + name;
9416
9943
  const { prefixURL } = CloudCmd;
9417
- const api = prefixURL + _common_cloudfunc__rspack_import_4.FS;
9944
+ const api = prefixURL + _common_cloudfunc__rspack_import_3.FS;
9418
9945
  const percent = (i, n, per = 100)=>{
9419
9946
  return Math.round(i * per / n);
9420
9947
  };
9421
9948
  const step = (n)=>100 / n;
9422
9949
  ++i;
9423
- _dom_load__rspack_import_2.put(api + path, file).on('error', showError).on('end', callback).on('progress', (count)=>{
9950
+ _dom_load__rspack_import_1.put(api + path, file).on('error', showError).on('end', callback).on('progress', (count)=>{
9424
9951
  const max = step(n);
9425
9952
  const value = (i - 1) * max + percent(count, 100, max);
9426
- _dom_images__rspack_import_5.show.load('top');
9427
- _dom_images__rspack_import_5.setProgress(Math.round(value));
9953
+ _dom_images__rspack_import_4.show.load('top');
9954
+ _dom_images__rspack_import_4.setProgress(Math.round(value));
9428
9955
  });
9429
9956
  }
9430
9957
  function showError({ message }) {
9431
- (0,_dom_dialog__rspack_import_3.alert)(message);
9958
+ (0,_dom_dialog__rspack_import_2.alert)(message);
9432
9959
  }
9433
9960
 
9434
9961
  __webpack_require__.d(__webpack_exports__, {
@@ -9748,11 +10275,11 @@ __webpack_require__.d(__webpack_exports__, {
9748
10275
  2690(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
9749
10276
  "use strict";
9750
10277
  /* import */ var execon__rspack_import_0 = __webpack_require__(9168);
9751
- /* import */ var currify__rspack_import_1 = __webpack_require__(4299);
9752
- /* import */ var load_js__rspack_import_2 = __webpack_require__(1256);
9753
- /* import */ var _dom_load__rspack_import_3 = __webpack_require__(8576);
9754
- /* import */ var _dom_files__rspack_import_4 = __webpack_require__(4701);
9755
- /* import */ var _dom_images__rspack_import_5 = __webpack_require__(6226);
10278
+ /* import */ var currify__rspack_import_5 = __webpack_require__(4299);
10279
+ /* import */ var load_js__rspack_import_1 = __webpack_require__(1256);
10280
+ /* import */ var _dom_load__rspack_import_2 = __webpack_require__(8576);
10281
+ /* import */ var _dom_files__rspack_import_3 = __webpack_require__(4701);
10282
+ /* import */ var _dom_images__rspack_import_4 = __webpack_require__(6226);
9756
10283
  /* global CloudCmd, filepicker */
9757
10284
 
9758
10285
 
@@ -9760,7 +10287,7 @@ __webpack_require__.d(__webpack_exports__, {
9760
10287
 
9761
10288
 
9762
10289
  const { log } = CloudCmd;
9763
- const upload = currify__rspack_import_1(_upload);
10290
+ const upload = currify__rspack_import_5(_upload);
9764
10291
  const Name = 'Cloud';
9765
10292
  CloudCmd[Name] = {
9766
10293
  init,
@@ -9771,7 +10298,7 @@ async function init() {
9771
10298
  const [modules] = await loadFiles();
9772
10299
  const { key } = modules.data.FilePicker;
9773
10300
  filepicker.setKey(key);
9774
- _dom_images__rspack_import_5.hide();
10301
+ _dom_images__rspack_import_4.hide();
9775
10302
  }
9776
10303
  function uploadFile(filename, data) {
9777
10304
  const mimetype = '';
@@ -9789,7 +10316,7 @@ function _upload(callback, file) {
9789
10316
  const { url, filename } = file;
9790
10317
  const responseType = 'arraybuffer';
9791
10318
  const success = execon__rspack_import_0["with"](callback, filename);
9792
- (0,_dom_load__rspack_import_3.ajax)({
10319
+ (0,_dom_load__rspack_import_2.ajax)({
9793
10320
  url,
9794
10321
  responseType,
9795
10322
  success
@@ -9798,8 +10325,8 @@ function _upload(callback, file) {
9798
10325
  function loadFiles() {
9799
10326
  const js = '//api.filepicker.io/v2/filepicker.js';
9800
10327
  return Promise.all([
9801
- _dom_files__rspack_import_4.get('modules'),
9802
- load_js__rspack_import_2.js(js)
10328
+ _dom_files__rspack_import_3.get('modules'),
10329
+ load_js__rspack_import_1.js(js)
9803
10330
  ]);
9804
10331
  }
9805
10332
 
@@ -10754,11 +11281,11 @@ function hide() {
10754
11281
  634(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
10755
11282
  "use strict";
10756
11283
  /* import */ var execon__rspack_import_0 = __webpack_require__(9168);
10757
- /* import */ var currify__rspack_import_1 = __webpack_require__(4299);
11284
+ /* import */ var currify__rspack_import_4 = __webpack_require__(4299);
10758
11285
  /* import */ var try_to_catch__rspack_import_5 = __webpack_require__(980);
10759
- /* import */ var load_js__rspack_import_2 = __webpack_require__(1256);
10760
- /* import */ var _cloudcmd_create_element__rspack_import_3 = __webpack_require__(407);
10761
- /* import */ var _dom_images__rspack_import_4 = __webpack_require__(6226);
11286
+ /* import */ var load_js__rspack_import_1 = __webpack_require__(1256);
11287
+ /* import */ var _cloudcmd_create_element__rspack_import_2 = __webpack_require__(407);
11288
+ /* import */ var _dom_images__rspack_import_3 = __webpack_require__(6226);
10762
11289
  /* global CloudCmd */ /* global Util */ /* global DOM */ /* global Console */
10763
11290
 
10764
11291
 
@@ -10774,13 +11301,13 @@ const { Dialog, CurrentInfo: Info } = DOM;
10774
11301
  const rmLastSlash = (a)=>a.replace(/\/$/, '') || '/';
10775
11302
  let konsole;
10776
11303
  const { config } = CloudCmd;
10777
- const cd = currify__rspack_import_1((fn, dir)=>fn(`cd ${rmLastSlash(dir)}`));
11304
+ const cd = currify__rspack_import_4((fn, dir)=>fn(`cd ${rmLastSlash(dir)}`));
10778
11305
  const Name = 'Konsole';
10779
11306
  let Element;
10780
11307
  let Loaded;
10781
11308
  async function init() {
10782
11309
  if (!config('console')) return;
10783
- _dom_images__rspack_import_4.show.load('top');
11310
+ _dom_images__rspack_import_3.show.load('top');
10784
11311
  await CloudCmd.View();
10785
11312
  await load();
10786
11313
  await create();
@@ -10816,7 +11343,7 @@ const create = async ()=>{
10816
11343
  prefixSocket: getPrefixSocket(),
10817
11344
  socketPath: CloudCmd.prefix
10818
11345
  };
10819
- Element = _cloudcmd_create_element__rspack_import_3('div', {
11346
+ Element = _cloudcmd_create_element__rspack_import_2('div', {
10820
11347
  className: 'console'
10821
11348
  });
10822
11349
  konsole = await Console(Element, options);
@@ -10851,7 +11378,7 @@ const load = async ()=>{
10851
11378
  Util.time(`${Name} load`);
10852
11379
  const prefix = getPrefix();
10853
11380
  const url = `${prefix}/console.js`;
10854
- const [error] = await (0,try_to_catch__rspack_import_5/* .tryToCatch */.Y)(load_js__rspack_import_2.js, url);
11381
+ const [error] = await (0,try_to_catch__rspack_import_5/* .tryToCatch */.Y)(load_js__rspack_import_1.js, url);
10855
11382
  Loaded = true;
10856
11383
  Util.timeEnd(`${Name} load`);
10857
11384
  if (error) return Dialog.alert(error.message, {
@@ -10940,11 +11467,11 @@ __webpack_require__.d(__webpack_exports__, {
10940
11467
  347(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
10941
11468
  "use strict";
10942
11469
  /* import */ var execon__rspack_import_0 = __webpack_require__(9168);
10943
- /* import */ var wraptile__rspack_import_1 = __webpack_require__(9317);
10944
- /* import */ var _cloudcmd_create_element__rspack_import_2 = __webpack_require__(407);
10945
- /* import */ var _dom_load__rspack_import_3 = __webpack_require__(8576);
10946
- /* import */ var _dom_rest__rspack_import_4 = __webpack_require__(6550);
10947
- /* import */ var _common_cloudfunc__rspack_import_5 = __webpack_require__(5700);
11470
+ /* import */ var wraptile__rspack_import_5 = __webpack_require__(9317);
11471
+ /* import */ var _cloudcmd_create_element__rspack_import_1 = __webpack_require__(407);
11472
+ /* import */ var _dom_load__rspack_import_2 = __webpack_require__(8576);
11473
+ /* import */ var _dom_rest__rspack_import_3 = __webpack_require__(6550);
11474
+ /* import */ var _common_cloudfunc__rspack_import_4 = __webpack_require__(5700);
10948
11475
 
10949
11476
 
10950
11477
 
@@ -10956,7 +11483,7 @@ const { config, Key } = CloudCmd;
10956
11483
  const { Buffer, Events, Dialog, Images } = DOM;
10957
11484
  const Info = DOM.CurrentInfo;
10958
11485
  const alertNoFiles = Dialog.alert.noFiles;
10959
- const uploadTo = wraptile__rspack_import_1(_uploadTo);
11486
+ const uploadTo = wraptile__rspack_import_5(_uploadTo);
10960
11487
  let MenuShowedName;
10961
11488
  let MenuContext;
10962
11489
  let MenuContextFile;
@@ -11128,7 +11655,7 @@ function uploadFromCloud() {
11128
11655
  Images.show.load('top');
11129
11656
  CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data)=>{
11130
11657
  const path = DOM.getCurrentDirPath() + currentName;
11131
- const [e] = await _dom_rest__rspack_import_4.write(path, data);
11658
+ const [e] = await _dom_rest__rspack_import_3.write(path, data);
11132
11659
  if (e) return;
11133
11660
  await CloudCmd.refresh({
11134
11661
  currentName
@@ -11155,11 +11682,11 @@ function download(type) {
11155
11682
  * no need in hash so we escape #
11156
11683
  * and all other characters, like "%"
11157
11684
  */ const encodedPath = encodeURI(path).replace(/#/g, '#');
11158
- const id = (0,_dom_load__rspack_import_3.getIdBySrc)(path);
11685
+ const id = (0,_dom_load__rspack_import_2.getIdBySrc)(path);
11159
11686
  let src;
11160
11687
  if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);
11161
- else src = prefixURL + _common_cloudfunc__rspack_import_5.FS + encodedPath + '?download';
11162
- const element = _cloudcmd_create_element__rspack_import_2('iframe', {
11688
+ else src = prefixURL + _common_cloudfunc__rspack_import_4.FS + encodedPath + '?download';
11689
+ const element = _cloudcmd_create_element__rspack_import_1('iframe', {
11163
11690
  id: id + '-' + date,
11164
11691
  async: false,
11165
11692
  className: 'hidden',
@@ -12229,15 +12756,28 @@ function getCodeFrame({ error, source }) {
12229
12756
 
12230
12757
 
12231
12758
  },
12232
- 1613(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
12759
+ 2418(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
12233
12760
  "use strict";
12234
12761
 
12235
- // UNUSED EXPORTS: _Config, _createIframe, _initConfig, _viewHtml, hide, init, show
12762
+ // UNUSED EXPORTS: _Config, _createIframe, _initConfig, _show, _viewHtml, hide, init, show
12763
+ // NAMESPACE OBJECT: ./node_modules/@cloudcmd/modal/lib/modal.js
12764
+ var modal_namespaceObject = {};
12765
+ __webpack_require__.r(modal_namespaceObject);
12766
+ __webpack_require__.d(modal_namespaceObject, {
12767
+ _onMainClick: () => (_onMainClick),
12768
+ _optionsStore: () => (_optionsStore),
12769
+ close: () => (modal_close),
12770
+ open: () => (modal_open) });
12236
12771
 
12772
+
12773
+ // EXTERNAL MODULE: ./node_modules/rendy/lib/rendy.js
12774
+ var rendy = __webpack_require__(4492);
12237
12775
  // EXTERNAL MODULE: ./node_modules/currify/lib/currify.js
12238
12776
  var currify = __webpack_require__(4299);
12239
12777
  // EXTERNAL MODULE: ./node_modules/wraptile/lib/wraptile.js
12240
12778
  var wraptile = __webpack_require__(9317);
12779
+ // EXTERNAL MODULE: ./node_modules/try-to-catch/lib/try-to-catch.js
12780
+ var try_to_catch = __webpack_require__(980);
12241
12781
  // EXTERNAL MODULE: ./node_modules/load.js/lib/load.js
12242
12782
  var load = __webpack_require__(1256);
12243
12783
  // EXTERNAL MODULE: ./node_modules/fullstore/lib/fullstore.js
@@ -12431,7 +12971,7 @@ const noop = () => {};
12431
12971
 
12432
12972
  const optionsStore = (0,fullstore/* .fullstore */.p)({});
12433
12973
 
12434
- const innerHTML = `
12974
+ const modal_innerHTML = `
12435
12975
  <div class="modal-child" data-name="modal-child">
12436
12976
  <div class="modal-close" data-name="modal-close"></div>
12437
12977
  </div>
@@ -12480,7 +13020,7 @@ const modal_open = (inner, options = {}) => {
12480
13020
  });
12481
13021
 
12482
13022
  const el = create_element('div', {
12483
- innerHTML,
13023
+ innerHTML: modal_innerHTML,
12484
13024
  className,
12485
13025
  dataName: 'modal-main',
12486
13026
  });
@@ -12541,8 +13081,8 @@ const modal_close = (event, overrides = {}) => {
12541
13081
  afterClose();
12542
13082
  };
12543
13083
 
12544
- const _optionsStore = (/* unused pure expression or super */ null && (optionsStore));
12545
- const _onMainClick = (/* unused pure expression or super */ null && (onMainClick));
13084
+ const _optionsStore = optionsStore;
13085
+ const _onMainClick = onMainClick;
12546
13086
 
12547
13087
  function check(inner) {
12548
13088
  if (!inner)
@@ -12551,10 +13091,65 @@ function check(inner) {
12551
13091
 
12552
13092
  // EXTERNAL MODULE: ./common/util.js
12553
13093
  var util = __webpack_require__(2007);
13094
+ // EXTERNAL MODULE: ./client/dom/files.js
13095
+ var dom_files = __webpack_require__(4701);
12554
13096
  // EXTERNAL MODULE: ./client/dom/events/index.js
12555
13097
  var dom_events = __webpack_require__(3410);
13098
+ // EXTERNAL MODULE: ./common/cloudfunc.js
13099
+ var cloudfunc = __webpack_require__(5700);
12556
13100
  // EXTERNAL MODULE: ./client/dom/images.js
12557
13101
  var dom_images = __webpack_require__(6226);
13102
+ // EXTERNAL MODULE: ./common/entity.js
13103
+ var entity = __webpack_require__(9460);
13104
+ // EXTERNAL MODULE: ./node_modules/path-browserify/index.js
13105
+ var path_browserify = __webpack_require__(7975);
13106
+ ;// CONCATENATED MODULE: ./client/modules/view/types.js
13107
+
13108
+
13109
+ const isAudio = (name)=>/\.(mp3|ogg|m4a|flac)$/i.test(name);
13110
+ const testRegExp = currify((name, reg)=>reg.test(name));
13111
+ const getRegExp = (ext)=>RegExp(`\\.${ext}$`, 'i');
13112
+ const isPDF = (a)=>/\.pdf$/i.test(a);
13113
+ const isHTML = (a)=>a.endsWith('.html');
13114
+ const isMarkdown = (a)=>/.\.md$/.test(a);
13115
+ const getType = async (path)=>{
13116
+ const ext = (0,path_browserify.extname)(path);
13117
+ if (!ext) path = await detectType(path);
13118
+ if (isPDF(path)) return 'pdf';
13119
+ if (types_isImage(path)) return 'image';
13120
+ if (isMedia(path)) return 'media';
13121
+ if (isHTML(path)) return 'html';
13122
+ if (isMarkdown(path)) return 'markdown';
13123
+ };
13124
+ function types_isImage(name) {
13125
+ const images = [
13126
+ 'jp(e|g|eg)',
13127
+ 'gif',
13128
+ 'png',
13129
+ 'bmp',
13130
+ 'webp',
13131
+ 'svg',
13132
+ 'ico'
13133
+ ];
13134
+ return images.map(getRegExp).some(testRegExp(name));
13135
+ }
13136
+ function isMedia(name) {
13137
+ return isAudio(name) || isVideo(name);
13138
+ }
13139
+ function isVideo(name) {
13140
+ return /\.(mp4|avi|webm)$/i.test(name);
13141
+ }
13142
+ const _detectType = (/* unused pure expression or super */ null && (detectType));
13143
+ async function detectType(path) {
13144
+ const { headers } = await fetch(path, {
13145
+ method: 'HEAD'
13146
+ });
13147
+ for (const [name, value] of headers){
13148
+ if (name === 'content-type') return `.${value.split('/').pop()}`;
13149
+ }
13150
+ return '';
13151
+ }
13152
+
12558
13153
  ;// CONCATENATED MODULE: ./client/modules/view/index.js
12559
13154
 
12560
13155
 
@@ -12565,8 +13160,15 @@ var dom_images = __webpack_require__(6226);
12565
13160
 
12566
13161
 
12567
13162
 
13163
+
13164
+
13165
+
13166
+
13167
+
13168
+
12568
13169
  const CloudCmd = globalThis.CloudCmd || {};
12569
13170
  const DOM = globalThis.DOM || {};
13171
+ const isString = (a)=>typeof a === 'string';
12570
13172
  const { assign: view_assign } = Object;
12571
13173
  const { isArray: view_isArray } = Array;
12572
13174
  const lifo = currify((fn, el, cb, name)=>fn(name, el, cb));
@@ -12586,7 +13188,9 @@ CloudCmd[Name] = {
12586
13188
  };
12587
13189
  const Info = DOM.CurrentInfo;
12588
13190
  const { Key } = CloudCmd;
13191
+ const basename = (a)=>a.split('/').pop();
12589
13192
  let El;
13193
+ let TemplateAudio;
12590
13194
  let Overlay;
12591
13195
  const Config = {
12592
13196
  beforeShow: ()=>{
@@ -12617,6 +13221,7 @@ async function init() {
12617
13221
  events.forEach(view_addEvent(Overlay, view_onOverlayClick));
12618
13222
  }
12619
13223
  async function show(data, options = {}) {
13224
+ const prefixURL = CloudCmd.prefixURL + cloudfunc.FS;
12620
13225
  if (Loading) return;
12621
13226
  if (!options || options.bindKeys !== false) dom_events.addKey(listener);
12622
13227
  El = create_element('div', {
@@ -12631,11 +13236,19 @@ async function show(data, options = {}) {
12631
13236
  return;
12632
13237
  }
12633
13238
  dom_images.show.load();
13239
+ const path = prefixURL + Info.path;
13240
+ const type = options.raw ? '' : await getType(path);
13241
+ if (type === 'markdown') return await CloudCmd.Markdown.show(Info.path);
13242
+ if (type === 'html') return viewHtml(path);
13243
+ if (type === 'image') return viewImage(Info.path, prefixURL);
13244
+ if (type === 'media') return await viewMedia(path);
13245
+ if (type === 'pdf') return viewPDF(path);
12634
13246
  return await viewFile();
12635
13247
  }
13248
+
12636
13249
  const _createIframe = (/* unused pure expression or super */ null && (createIframe));
12637
13250
  function createIframe(src, overrides = {}) {
12638
- const { createElement = _createElement } = overrides;
13251
+ const { createElement = create_element } = overrides;
12639
13252
  const element = createElement('iframe', {
12640
13253
  src,
12641
13254
  width: '100%',
@@ -12648,9 +13261,29 @@ function createIframe(src, overrides = {}) {
12648
13261
  }
12649
13262
  const _viewHtml = (/* unused pure expression or super */ null && (viewHtml));
12650
13263
  function viewHtml(src, overrides = {}) {
12651
- const { modal = _modal } = overrides;
13264
+ const { modal = modal_namespaceObject } = overrides;
12652
13265
  modal.open(createIframe(src), Config);
12653
13266
  }
13267
+ function viewPDF(src) {
13268
+ const element = createIframe(src);
13269
+ const options = view_assign({}, Config);
13270
+ if (CloudCmd.config('showFileName')) options.title = Info.name;
13271
+ modal_open(element, options);
13272
+ }
13273
+ async function viewMedia(path) {
13274
+ const [e, element] = await getMediaElement(path);
13275
+ if (e) return alert(e);
13276
+ const allConfig = {
13277
+ ...Config,
13278
+ ...{
13279
+ autoSize: true,
13280
+ afterShow: ()=>{
13281
+ element.querySelector('audio, video').focus();
13282
+ }
13283
+ }
13284
+ };
13285
+ modal_open(element, allConfig);
13286
+ }
12654
13287
  async function viewFile() {
12655
13288
  const [error, data] = await Info.getData();
12656
13289
  if (error) return dom_images.hide();
@@ -12681,6 +13314,56 @@ function initConfig(options) {
12681
13314
  function hide() {
12682
13315
  modal_close();
12683
13316
  }
13317
+ function viewImage(path, prefixURL) {
13318
+ const isSupportedImage = (a)=>types_isImage(a) || a === path;
13319
+ const makeTitle = (path)=>({
13320
+ href: `${prefixURL}${path}`,
13321
+ title: (0,entity/* .encode */.l)(basename(path))
13322
+ });
13323
+ const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);
13324
+ const titles = names.map(makeTitle);
13325
+ const index = names.indexOf(Info.path);
13326
+ const imageConfig = {
13327
+ index,
13328
+ autoSize: true,
13329
+ arrows: true,
13330
+ keys: true,
13331
+ helpers: {
13332
+ title: {}
13333
+ }
13334
+ };
13335
+ const config = {
13336
+ ...Config,
13337
+ ...imageConfig
13338
+ };
13339
+ modal_open(titles, config);
13340
+ }
13341
+ async function getMediaElement(src) {
13342
+ view_check(src);
13343
+ const [error, template] = await (0,try_to_catch/* .tryToCatch */.Y)(dom_files.get, 'view/media-tmpl');
13344
+ if (error) return [
13345
+ error
13346
+ ];
13347
+ const { name } = Info;
13348
+ if (!TemplateAudio) TemplateAudio = template;
13349
+ const is = isAudio(name);
13350
+ const type = is ? 'audio' : 'video';
13351
+ const innerHTML = (0,rendy/* .rendy */.n)(TemplateAudio, {
13352
+ src,
13353
+ type,
13354
+ name
13355
+ });
13356
+ const element = create_element('div', {
13357
+ innerHTML
13358
+ });
13359
+ return [
13360
+ null,
13361
+ element
13362
+ ];
13363
+ }
13364
+ function view_check(src) {
13365
+ if (!isString(src)) throw Error('src should be a string!');
13366
+ }
12684
13367
  async function loadAll() {
12685
13368
  const { DIR_DIST } = CloudCmd;
12686
13369
  (0,util.time)(`${Name} load`);
@@ -12718,19 +13401,19 @@ __webpack_require__.r(__webpack_exports__);
12718
13401
  if (791 == __webpack_require__.j) {
12719
13402
  /* import */ var rendy__rspack_import_3 = __webpack_require__(4492);
12720
13403
 
12721
- }/* import */ var currify__rspack_import_0 = __webpack_require__(4299);
12722
- /* import */ var fullstore__rspack_import_2 = __webpack_require__(8328);
12723
- /* import */ var _common_entity__rspack_import_1 = __webpack_require__(9460);
13404
+ }/* import */ var currify__rspack_import_2 = __webpack_require__(4299);
13405
+ /* import */ var fullstore__rspack_import_1 = __webpack_require__(8328);
13406
+ /* import */ var _common_entity__rspack_import_0 = __webpack_require__(9460);
12724
13407
 
12725
13408
 
12726
13409
 
12727
13410
 
12728
13411
  const id = (a)=>a;
12729
13412
  const NAME = 'Cloud Commander';
12730
- const dateFormatter = (/* runtime-dependent pure expression or super */ 791 == __webpack_require__.j ? ((0,fullstore__rspack_import_2/* .fullstore */.p)(id)) : null);
12731
- const getHeaderField = currify__rspack_import_0(_getHeaderField);
13413
+ const dateFormatter = (/* runtime-dependent pure expression or super */ 791 == __webpack_require__.j ? ((0,fullstore__rspack_import_1/* .fullstore */.p)(id)) : null);
13414
+ const getHeaderField = currify__rspack_import_2(_getHeaderField);
12732
13415
  const FS = '/fs';
12733
- const Path = (0,fullstore__rspack_import_2/* .fullstore */.p)();
13416
+ const Path = (0,fullstore__rspack_import_1/* .fullstore */.p)();
12734
13417
  Path('/');
12735
13418
  const filterOutDotFiles = ({ showDotFiles })=>({ name })=>{
12736
13419
  if (showDotFiles) return true;
@@ -12802,7 +13485,7 @@ function _getDataName(name) {
12802
13485
  const templateFile = template.file;
12803
13486
  const templateLink = template.link;
12804
13487
  const json = params.data;
12805
- const path = (0,_common_entity__rspack_import_1/* .encode */.l)(json.path);
13488
+ const path = (0,_common_entity__rspack_import_0/* .encode */.l)(json.path);
12806
13489
  const { files } = json;
12807
13490
  /*
12808
13491
  * Строим путь каталога в котором мы находимся
@@ -12860,7 +13543,7 @@ function _getDataName(name) {
12860
13543
  fileTable += files.filter(filterOutDotFiles({
12861
13544
  showDotFiles
12862
13545
  })).map(updateField).map((file)=>{
12863
- const name = (0,_common_entity__rspack_import_1/* .encode */.l)(file.name);
13546
+ const name = (0,_common_entity__rspack_import_0/* .encode */.l)(file.name);
12864
13547
  const link = prefix + FS + path + name;
12865
13548
  const { type, mode, date, time, owner, size } = file;
12866
13549
  const linkResult = (0,rendy__rspack_import_3/* .rendy */.n)(templateLink, {