zmp-sdk 2.18.5-rc.0 → 2.18.6

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.
@@ -2081,949 +2081,17 @@
2081
2081
  set: set_1
2082
2082
  };
2083
2083
 
2084
- var global$1 = (typeof global !== "undefined" ? global :
2085
- typeof self !== "undefined" ? self :
2086
- typeof window !== "undefined" ? window : {});
2087
-
2088
- // shim for using process in browser
2089
- // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
2090
-
2091
- function defaultSetTimout() {
2092
- throw new Error('setTimeout has not been defined');
2093
- }
2094
- function defaultClearTimeout () {
2095
- throw new Error('clearTimeout has not been defined');
2096
- }
2097
- var cachedSetTimeout = defaultSetTimout;
2098
- var cachedClearTimeout = defaultClearTimeout;
2099
- if (typeof global$1.setTimeout === 'function') {
2100
- cachedSetTimeout = setTimeout;
2101
- }
2102
- if (typeof global$1.clearTimeout === 'function') {
2103
- cachedClearTimeout = clearTimeout;
2104
- }
2105
-
2106
- function runTimeout(fun) {
2107
- if (cachedSetTimeout === setTimeout) {
2108
- //normal enviroments in sane situations
2109
- return setTimeout(fun, 0);
2110
- }
2111
- // if setTimeout wasn't available but was latter defined
2112
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
2113
- cachedSetTimeout = setTimeout;
2114
- return setTimeout(fun, 0);
2115
- }
2116
- try {
2117
- // when when somebody has screwed with setTimeout but no I.E. maddness
2118
- return cachedSetTimeout(fun, 0);
2119
- } catch(e){
2120
- try {
2121
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2122
- return cachedSetTimeout.call(null, fun, 0);
2123
- } catch(e){
2124
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
2125
- return cachedSetTimeout.call(this, fun, 0);
2126
- }
2127
- }
2128
-
2129
-
2130
- }
2131
- function runClearTimeout(marker) {
2132
- if (cachedClearTimeout === clearTimeout) {
2133
- //normal enviroments in sane situations
2134
- return clearTimeout(marker);
2135
- }
2136
- // if clearTimeout wasn't available but was latter defined
2137
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
2138
- cachedClearTimeout = clearTimeout;
2139
- return clearTimeout(marker);
2140
- }
2141
- try {
2142
- // when when somebody has screwed with setTimeout but no I.E. maddness
2143
- return cachedClearTimeout(marker);
2144
- } catch (e){
2145
- try {
2146
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2147
- return cachedClearTimeout.call(null, marker);
2148
- } catch (e){
2149
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
2150
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
2151
- return cachedClearTimeout.call(this, marker);
2152
- }
2153
- }
2154
-
2155
-
2156
-
2157
- }
2158
- var queue = [];
2159
- var draining = false;
2160
- var currentQueue;
2161
- var queueIndex = -1;
2162
-
2163
- function cleanUpNextTick() {
2164
- if (!draining || !currentQueue) {
2165
- return;
2166
- }
2167
- draining = false;
2168
- if (currentQueue.length) {
2169
- queue = currentQueue.concat(queue);
2170
- } else {
2171
- queueIndex = -1;
2172
- }
2173
- if (queue.length) {
2174
- drainQueue();
2175
- }
2176
- }
2177
-
2178
- function drainQueue() {
2179
- if (draining) {
2180
- return;
2181
- }
2182
- var timeout = runTimeout(cleanUpNextTick);
2183
- draining = true;
2184
-
2185
- var len = queue.length;
2186
- while(len) {
2187
- currentQueue = queue;
2188
- queue = [];
2189
- while (++queueIndex < len) {
2190
- if (currentQueue) {
2191
- currentQueue[queueIndex].run();
2192
- }
2193
- }
2194
- queueIndex = -1;
2195
- len = queue.length;
2196
- }
2197
- currentQueue = null;
2198
- draining = false;
2199
- runClearTimeout(timeout);
2200
- }
2201
- function nextTick(fun) {
2202
- var args = new Array(arguments.length - 1);
2203
- if (arguments.length > 1) {
2204
- for (var i = 1; i < arguments.length; i++) {
2205
- args[i - 1] = arguments[i];
2206
- }
2207
- }
2208
- queue.push(new Item(fun, args));
2209
- if (queue.length === 1 && !draining) {
2210
- runTimeout(drainQueue);
2211
- }
2212
- }
2213
- // v8 likes predictible objects
2214
- function Item(fun, array) {
2215
- this.fun = fun;
2216
- this.array = array;
2217
- }
2218
- Item.prototype.run = function () {
2219
- this.fun.apply(null, this.array);
2220
- };
2221
- var title = 'browser';
2222
- var platform$1 = 'browser';
2223
- var browser$1 = true;
2224
- var env = {};
2225
- var argv = [];
2226
- var version$1 = ''; // empty string to avoid regexp issues
2227
- var versions = {};
2228
- var release = {};
2229
- var config = {};
2230
-
2231
- function noop() {}
2232
-
2233
- var on = noop;
2234
- var addListener = noop;
2235
- var once = noop;
2236
- var off = noop;
2237
- var removeListener = noop;
2238
- var removeAllListeners = noop;
2239
- var emit = noop;
2240
-
2241
- function binding(name) {
2242
- throw new Error('process.binding is not supported');
2243
- }
2244
-
2245
- function cwd () { return '/' }
2246
- function chdir (dir) {
2247
- throw new Error('process.chdir is not supported');
2248
- }function umask() { return 0; }
2249
-
2250
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
2251
- var performance = global$1.performance || {};
2252
- var performanceNow =
2253
- performance.now ||
2254
- performance.mozNow ||
2255
- performance.msNow ||
2256
- performance.oNow ||
2257
- performance.webkitNow ||
2258
- function(){ return (new Date()).getTime() };
2259
-
2260
- // generate timestamp or delta
2261
- // see http://nodejs.org/api/process.html#process_process_hrtime
2262
- function hrtime(previousTimestamp){
2263
- var clocktime = performanceNow.call(performance)*1e-3;
2264
- var seconds = Math.floor(clocktime);
2265
- var nanoseconds = Math.floor((clocktime%1)*1e9);
2266
- if (previousTimestamp) {
2267
- seconds = seconds - previousTimestamp[0];
2268
- nanoseconds = nanoseconds - previousTimestamp[1];
2269
- if (nanoseconds<0) {
2270
- seconds--;
2271
- nanoseconds += 1e9;
2272
- }
2273
- }
2274
- return [seconds,nanoseconds]
2275
- }
2276
-
2277
- var startTime = new Date();
2278
- function uptime() {
2279
- var currentTime = new Date();
2280
- var dif = currentTime - startTime;
2281
- return dif / 1000;
2282
- }
2283
-
2284
- var browser$1$1 = {
2285
- nextTick: nextTick,
2286
- title: title,
2287
- browser: browser$1,
2288
- env: env,
2289
- argv: argv,
2290
- version: version$1,
2291
- versions: versions,
2292
- on: on,
2293
- addListener: addListener,
2294
- once: once,
2295
- off: off,
2296
- removeListener: removeListener,
2297
- removeAllListeners: removeAllListeners,
2298
- emit: emit,
2299
- binding: binding,
2300
- cwd: cwd,
2301
- chdir: chdir,
2302
- umask: umask,
2303
- hrtime: hrtime,
2304
- platform: platform$1,
2305
- release: release,
2306
- config: config,
2307
- uptime: uptime
2308
- };
2309
-
2310
- /**
2311
- * Helpers.
2312
- */
2313
-
2314
- var s = 1000;
2315
- var m = s * 60;
2316
- var h = m * 60;
2317
- var d = h * 24;
2318
- var w = d * 7;
2319
- var y = d * 365.25;
2320
-
2321
- /**
2322
- * Parse or format the given `val`.
2323
- *
2324
- * Options:
2325
- *
2326
- * - `long` verbose formatting [false]
2327
- *
2328
- * @param {String|Number} val
2329
- * @param {Object} [options]
2330
- * @throws {Error} throw an error if val is not a non-empty string or a number
2331
- * @return {String|Number}
2332
- * @api public
2333
- */
2334
-
2335
- var ms = function(val, options) {
2336
- options = options || {};
2337
- var type = typeof val;
2338
- if (type === 'string' && val.length > 0) {
2339
- return parse(val);
2340
- } else if (type === 'number' && isFinite(val)) {
2341
- return options.long ? fmtLong(val) : fmtShort(val);
2342
- }
2343
- throw new Error(
2344
- 'val is not a non-empty string or a valid number. val=' +
2345
- JSON.stringify(val)
2346
- );
2347
- };
2348
-
2349
- /**
2350
- * Parse the given `str` and return milliseconds.
2351
- *
2352
- * @param {String} str
2353
- * @return {Number}
2354
- * @api private
2355
- */
2356
-
2357
- function parse(str) {
2358
- str = String(str);
2359
- if (str.length > 100) {
2360
- return;
2361
- }
2362
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
2363
- str
2364
- );
2365
- if (!match) {
2366
- return;
2367
- }
2368
- var n = parseFloat(match[1]);
2369
- var type = (match[2] || 'ms').toLowerCase();
2370
- switch (type) {
2371
- case 'years':
2372
- case 'year':
2373
- case 'yrs':
2374
- case 'yr':
2375
- case 'y':
2376
- return n * y;
2377
- case 'weeks':
2378
- case 'week':
2379
- case 'w':
2380
- return n * w;
2381
- case 'days':
2382
- case 'day':
2383
- case 'd':
2384
- return n * d;
2385
- case 'hours':
2386
- case 'hour':
2387
- case 'hrs':
2388
- case 'hr':
2389
- case 'h':
2390
- return n * h;
2391
- case 'minutes':
2392
- case 'minute':
2393
- case 'mins':
2394
- case 'min':
2395
- case 'm':
2396
- return n * m;
2397
- case 'seconds':
2398
- case 'second':
2399
- case 'secs':
2400
- case 'sec':
2401
- case 's':
2402
- return n * s;
2403
- case 'milliseconds':
2404
- case 'millisecond':
2405
- case 'msecs':
2406
- case 'msec':
2407
- case 'ms':
2408
- return n;
2409
- default:
2410
- return undefined;
2411
- }
2412
- }
2413
-
2414
- /**
2415
- * Short format for `ms`.
2416
- *
2417
- * @param {Number} ms
2418
- * @return {String}
2419
- * @api private
2420
- */
2421
-
2422
- function fmtShort(ms) {
2423
- var msAbs = Math.abs(ms);
2424
- if (msAbs >= d) {
2425
- return Math.round(ms / d) + 'd';
2426
- }
2427
- if (msAbs >= h) {
2428
- return Math.round(ms / h) + 'h';
2429
- }
2430
- if (msAbs >= m) {
2431
- return Math.round(ms / m) + 'm';
2432
- }
2433
- if (msAbs >= s) {
2434
- return Math.round(ms / s) + 's';
2435
- }
2436
- return ms + 'ms';
2437
- }
2438
-
2439
- /**
2440
- * Long format for `ms`.
2441
- *
2442
- * @param {Number} ms
2443
- * @return {String}
2444
- * @api private
2445
- */
2446
-
2447
- function fmtLong(ms) {
2448
- var msAbs = Math.abs(ms);
2449
- if (msAbs >= d) {
2450
- return plural(ms, msAbs, d, 'day');
2451
- }
2452
- if (msAbs >= h) {
2453
- return plural(ms, msAbs, h, 'hour');
2454
- }
2455
- if (msAbs >= m) {
2456
- return plural(ms, msAbs, m, 'minute');
2457
- }
2458
- if (msAbs >= s) {
2459
- return plural(ms, msAbs, s, 'second');
2460
- }
2461
- return ms + ' ms';
2462
- }
2463
-
2464
- /**
2465
- * Pluralization helper.
2466
- */
2467
-
2468
- function plural(ms, msAbs, n, name) {
2469
- var isPlural = msAbs >= n * 1.5;
2470
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
2471
- }
2472
-
2473
- /**
2474
- * This is the common logic for both the Node.js and web browser
2475
- * implementations of `debug()`.
2476
- */
2477
-
2478
- function setup(env) {
2479
- createDebug.debug = createDebug;
2480
- createDebug.default = createDebug;
2481
- createDebug.coerce = coerce;
2482
- createDebug.disable = disable;
2483
- createDebug.enable = enable;
2484
- createDebug.enabled = enabled;
2485
- createDebug.humanize = ms;
2486
- createDebug.destroy = destroy;
2487
-
2488
- Object.keys(env).forEach(key => {
2489
- createDebug[key] = env[key];
2490
- });
2491
-
2492
- /**
2493
- * The currently active debug mode names, and names to skip.
2494
- */
2495
-
2496
- createDebug.names = [];
2497
- createDebug.skips = [];
2498
-
2499
- /**
2500
- * Map of special "%n" handling functions, for the debug "format" argument.
2501
- *
2502
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
2503
- */
2504
- createDebug.formatters = {};
2505
-
2506
- /**
2507
- * Selects a color for a debug namespace
2508
- * @param {String} namespace The namespace string for the debug instance to be colored
2509
- * @return {Number|String} An ANSI color code for the given namespace
2510
- * @api private
2511
- */
2512
- function selectColor(namespace) {
2513
- let hash = 0;
2514
-
2515
- for (let i = 0; i < namespace.length; i++) {
2516
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
2517
- hash |= 0; // Convert to 32bit integer
2518
- }
2519
-
2520
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
2521
- }
2522
- createDebug.selectColor = selectColor;
2523
-
2524
- /**
2525
- * Create a debugger with the given `namespace`.
2526
- *
2527
- * @param {String} namespace
2528
- * @return {Function}
2529
- * @api public
2530
- */
2531
- function createDebug(namespace) {
2532
- let prevTime;
2533
- let enableOverride = null;
2534
- let namespacesCache;
2535
- let enabledCache;
2536
-
2537
- function debug(...args) {
2538
- // Disabled?
2539
- if (!debug.enabled) {
2540
- return;
2541
- }
2542
-
2543
- const self = debug;
2544
-
2545
- // Set `diff` timestamp
2546
- const curr = Number(new Date());
2547
- const ms = curr - (prevTime || curr);
2548
- self.diff = ms;
2549
- self.prev = prevTime;
2550
- self.curr = curr;
2551
- prevTime = curr;
2552
-
2553
- args[0] = createDebug.coerce(args[0]);
2554
-
2555
- if (typeof args[0] !== 'string') {
2556
- // Anything else let's inspect with %O
2557
- args.unshift('%O');
2558
- }
2559
-
2560
- // Apply any `formatters` transformations
2561
- let index = 0;
2562
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
2563
- // If we encounter an escaped % then don't increase the array index
2564
- if (match === '%%') {
2565
- return '%';
2566
- }
2567
- index++;
2568
- const formatter = createDebug.formatters[format];
2569
- if (typeof formatter === 'function') {
2570
- const val = args[index];
2571
- match = formatter.call(self, val);
2572
-
2573
- // Now we need to remove `args[index]` since it's inlined in the `format`
2574
- args.splice(index, 1);
2575
- index--;
2576
- }
2577
- return match;
2578
- });
2579
-
2580
- // Apply env-specific formatting (colors, etc.)
2581
- createDebug.formatArgs.call(self, args);
2582
-
2583
- const logFn = self.log || createDebug.log;
2584
- logFn.apply(self, args);
2585
- }
2586
-
2587
- debug.namespace = namespace;
2588
- debug.useColors = createDebug.useColors();
2589
- debug.color = createDebug.selectColor(namespace);
2590
- debug.extend = extend;
2591
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
2592
-
2593
- Object.defineProperty(debug, 'enabled', {
2594
- enumerable: true,
2595
- configurable: false,
2596
- get: () => {
2597
- if (enableOverride !== null) {
2598
- return enableOverride;
2599
- }
2600
- if (namespacesCache !== createDebug.namespaces) {
2601
- namespacesCache = createDebug.namespaces;
2602
- enabledCache = createDebug.enabled(namespace);
2603
- }
2604
-
2605
- return enabledCache;
2606
- },
2607
- set: v => {
2608
- enableOverride = v;
2609
- }
2610
- });
2611
-
2612
- // Env-specific initialization logic for debug instances
2613
- if (typeof createDebug.init === 'function') {
2614
- createDebug.init(debug);
2615
- }
2616
-
2617
- return debug;
2618
- }
2619
-
2620
- function extend(namespace, delimiter) {
2621
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
2622
- newDebug.log = this.log;
2623
- return newDebug;
2624
- }
2625
-
2626
- /**
2627
- * Enables a debug mode by namespaces. This can include modes
2628
- * separated by a colon and wildcards.
2629
- *
2630
- * @param {String} namespaces
2631
- * @api public
2632
- */
2633
- function enable(namespaces) {
2634
- createDebug.save(namespaces);
2635
- createDebug.namespaces = namespaces;
2636
-
2637
- createDebug.names = [];
2638
- createDebug.skips = [];
2639
-
2640
- let i;
2641
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
2642
- const len = split.length;
2643
-
2644
- for (i = 0; i < len; i++) {
2645
- if (!split[i]) {
2646
- // ignore empty strings
2647
- continue;
2648
- }
2649
-
2650
- namespaces = split[i].replace(/\*/g, '.*?');
2651
-
2652
- if (namespaces[0] === '-') {
2653
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
2654
- } else {
2655
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
2656
- }
2657
- }
2658
- }
2659
-
2660
- /**
2661
- * Disable debug output.
2662
- *
2663
- * @return {String} namespaces
2664
- * @api public
2665
- */
2666
- function disable() {
2667
- const namespaces = [
2668
- ...createDebug.names.map(toNamespace),
2669
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
2670
- ].join(',');
2671
- createDebug.enable('');
2672
- return namespaces;
2673
- }
2674
-
2675
- /**
2676
- * Returns true if the given mode name is enabled, false otherwise.
2677
- *
2678
- * @param {String} name
2679
- * @return {Boolean}
2680
- * @api public
2681
- */
2682
- function enabled(name) {
2683
- if (name[name.length - 1] === '*') {
2684
- return true;
2685
- }
2686
-
2687
- let i;
2688
- let len;
2689
-
2690
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
2691
- if (createDebug.skips[i].test(name)) {
2692
- return false;
2693
- }
2694
- }
2695
-
2696
- for (i = 0, len = createDebug.names.length; i < len; i++) {
2697
- if (createDebug.names[i].test(name)) {
2698
- return true;
2699
- }
2700
- }
2701
-
2702
- return false;
2703
- }
2704
-
2705
- /**
2706
- * Convert regexp to namespace
2707
- *
2708
- * @param {RegExp} regxep
2709
- * @return {String} namespace
2710
- * @api private
2711
- */
2712
- function toNamespace(regexp) {
2713
- return regexp.toString()
2714
- .substring(2, regexp.toString().length - 2)
2715
- .replace(/\.\*\?$/, '*');
2716
- }
2717
-
2718
- /**
2719
- * Coerce `val`.
2720
- *
2721
- * @param {Mixed} val
2722
- * @return {Mixed}
2723
- * @api private
2724
- */
2725
- function coerce(val) {
2726
- if (val instanceof Error) {
2727
- return val.stack || val.message;
2728
- }
2729
- return val;
2730
- }
2731
-
2732
- /**
2733
- * XXX DO NOT USE. This is a temporary stub function.
2734
- * XXX It WILL be removed in the next major release.
2735
- */
2736
- function destroy() {
2737
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
2738
- }
2739
-
2740
- createDebug.enable(createDebug.load());
2741
-
2742
- return createDebug;
2743
- }
2744
-
2745
- var common = setup;
2746
-
2747
- var browser = createCommonjsModule(function (module, exports) {
2748
- /* eslint-env browser */
2749
-
2750
- /**
2751
- * This is the web browser implementation of `debug()`.
2752
- */
2753
-
2754
- exports.formatArgs = formatArgs;
2755
- exports.save = save;
2756
- exports.load = load;
2757
- exports.useColors = useColors;
2758
- exports.storage = localstorage();
2759
- exports.destroy = (() => {
2760
- let warned = false;
2761
-
2762
- return () => {
2763
- if (!warned) {
2764
- warned = true;
2765
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
2766
- }
2767
- };
2768
- })();
2769
-
2770
- /**
2771
- * Colors.
2772
- */
2773
-
2774
- exports.colors = [
2775
- '#0000CC',
2776
- '#0000FF',
2777
- '#0033CC',
2778
- '#0033FF',
2779
- '#0066CC',
2780
- '#0066FF',
2781
- '#0099CC',
2782
- '#0099FF',
2783
- '#00CC00',
2784
- '#00CC33',
2785
- '#00CC66',
2786
- '#00CC99',
2787
- '#00CCCC',
2788
- '#00CCFF',
2789
- '#3300CC',
2790
- '#3300FF',
2791
- '#3333CC',
2792
- '#3333FF',
2793
- '#3366CC',
2794
- '#3366FF',
2795
- '#3399CC',
2796
- '#3399FF',
2797
- '#33CC00',
2798
- '#33CC33',
2799
- '#33CC66',
2800
- '#33CC99',
2801
- '#33CCCC',
2802
- '#33CCFF',
2803
- '#6600CC',
2804
- '#6600FF',
2805
- '#6633CC',
2806
- '#6633FF',
2807
- '#66CC00',
2808
- '#66CC33',
2809
- '#9900CC',
2810
- '#9900FF',
2811
- '#9933CC',
2812
- '#9933FF',
2813
- '#99CC00',
2814
- '#99CC33',
2815
- '#CC0000',
2816
- '#CC0033',
2817
- '#CC0066',
2818
- '#CC0099',
2819
- '#CC00CC',
2820
- '#CC00FF',
2821
- '#CC3300',
2822
- '#CC3333',
2823
- '#CC3366',
2824
- '#CC3399',
2825
- '#CC33CC',
2826
- '#CC33FF',
2827
- '#CC6600',
2828
- '#CC6633',
2829
- '#CC9900',
2830
- '#CC9933',
2831
- '#CCCC00',
2832
- '#CCCC33',
2833
- '#FF0000',
2834
- '#FF0033',
2835
- '#FF0066',
2836
- '#FF0099',
2837
- '#FF00CC',
2838
- '#FF00FF',
2839
- '#FF3300',
2840
- '#FF3333',
2841
- '#FF3366',
2842
- '#FF3399',
2843
- '#FF33CC',
2844
- '#FF33FF',
2845
- '#FF6600',
2846
- '#FF6633',
2847
- '#FF9900',
2848
- '#FF9933',
2849
- '#FFCC00',
2850
- '#FFCC33'
2851
- ];
2852
-
2853
- /**
2854
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2855
- * and the Firebug extension (any Firefox version) are known
2856
- * to support "%c" CSS customizations.
2857
- *
2858
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
2859
- */
2860
-
2861
- // eslint-disable-next-line complexity
2862
- function useColors() {
2863
- // NB: In an Electron preload script, document will be defined but not fully
2864
- // initialized. Since we know we're in Chrome, we'll just detect this case
2865
- // explicitly
2866
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
2867
- return true;
2868
- }
2869
-
2870
- // Internet Explorer and Edge do not support colors.
2871
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2872
- return false;
2873
- }
2874
-
2875
- // Is webkit? http://stackoverflow.com/a/16459606/376773
2876
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
2877
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
2878
- // Is firebug? http://stackoverflow.com/a/398120/376773
2879
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
2880
- // Is firefox >= v31?
2881
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2882
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
2883
- // Double check webkit in userAgent just in case we are in a worker
2884
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
2885
- }
2886
-
2887
- /**
2888
- * Colorize log arguments if enabled.
2889
- *
2890
- * @api public
2891
- */
2892
-
2893
- function formatArgs(args) {
2894
- args[0] = (this.useColors ? '%c' : '') +
2895
- this.namespace +
2896
- (this.useColors ? ' %c' : ' ') +
2897
- args[0] +
2898
- (this.useColors ? '%c ' : ' ') +
2899
- '+' + module.exports.humanize(this.diff);
2900
-
2901
- if (!this.useColors) {
2902
- return;
2903
- }
2904
-
2905
- const c = 'color: ' + this.color;
2906
- args.splice(1, 0, c, 'color: inherit');
2907
-
2908
- // The final "%c" is somewhat tricky, because there could be other
2909
- // arguments passed either before or after the %c, so we need to
2910
- // figure out the correct index to insert the CSS into
2911
- let index = 0;
2912
- let lastC = 0;
2913
- args[0].replace(/%[a-zA-Z%]/g, match => {
2914
- if (match === '%%') {
2915
- return;
2916
- }
2917
- index++;
2918
- if (match === '%c') {
2919
- // We only are interested in the *last* %c
2920
- // (the user may have provided their own)
2921
- lastC = index;
2922
- }
2923
- });
2924
-
2925
- args.splice(lastC, 0, c);
2926
- }
2927
-
2928
- /**
2929
- * Invokes `console.debug()` when available.
2930
- * No-op when `console.debug` is not a "function".
2931
- * If `console.debug` is not available, falls back
2932
- * to `console.log`.
2933
- *
2934
- * @api public
2935
- */
2936
- exports.log = console.debug || console.log || (() => {});
2937
-
2938
- /**
2939
- * Save `namespaces`.
2940
- *
2941
- * @param {String} namespaces
2942
- * @api private
2943
- */
2944
- function save(namespaces) {
2945
- try {
2946
- if (namespaces) {
2947
- exports.storage.setItem('debug', namespaces);
2948
- } else {
2949
- exports.storage.removeItem('debug');
2950
- }
2951
- } catch (error) {
2952
- // Swallow
2953
- // XXX (@Qix-) should we be logging these?
2954
- }
2955
- }
2956
-
2957
- /**
2958
- * Load `namespaces`.
2959
- *
2960
- * @return {String} returns the previously persisted debug modes
2961
- * @api private
2962
- */
2963
- function load() {
2964
- let r;
2965
- try {
2966
- r = exports.storage.getItem('debug');
2967
- } catch (error) {
2968
- // Swallow
2969
- // XXX (@Qix-) should we be logging these?
2970
- }
2971
-
2972
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
2973
- if (!r && typeof browser$1$1 !== 'undefined' && 'env' in browser$1$1) {
2974
- r = browser$1$1.env.DEBUG;
2975
- }
2976
-
2977
- return r;
2978
- }
2979
-
2980
- /**
2981
- * Localstorage attempts to return the localstorage.
2982
- *
2983
- * This is necessary because safari throws
2984
- * when a user disables cookies/localstorage
2985
- * and you attempt to access it.
2986
- *
2987
- * @return {LocalStorage}
2988
- * @api private
2989
- */
2990
-
2991
- function localstorage() {
2992
- try {
2993
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
2994
- // The Browser also has localStorage in the global context.
2995
- return localStorage;
2996
- } catch (error) {
2997
- // Swallow
2998
- // XXX (@Qix-) should we be logging these?
2999
- }
2084
+ function Debug(name) {
2085
+ if (typeof window.Debug === 'function') {
2086
+ return window.Debug(name);
2087
+ }
2088
+ return function (...args) {
2089
+ if (process.env.NODE_ENV === 'development') {
2090
+ console.log(name, ...args);
2091
+ }
2092
+ };
3000
2093
  }
3001
2094
 
3002
- module.exports = common(exports);
3003
-
3004
- const {formatters} = module.exports;
3005
-
3006
- /**
3007
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
3008
- */
3009
-
3010
- formatters.j = function (v) {
3011
- try {
3012
- return JSON.stringify(v);
3013
- } catch (error) {
3014
- return '[UnexpectedJSONParseError]: ' + error.message;
3015
- }
3016
- };
3017
- });
3018
- browser.formatArgs;
3019
- browser.save;
3020
- browser.load;
3021
- browser.useColors;
3022
- browser.storage;
3023
- browser.destroy;
3024
- browser.colors;
3025
- browser.log;
3026
-
3027
2095
  /**
3028
2096
  * @typedef {"none" | "wifi" | "cellular" | "unknown"} NetworkType
3029
2097
  */
@@ -3878,7 +2946,7 @@
3878
2946
  const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
3879
2947
  const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
3880
2948
  const REGEXP_SPACES = new RegExp('\\s', 'g');
3881
- const debug = browser('zmp:utils:common');
2949
+ const debug = Debug('zmp:utils:common');
3882
2950
  /**
3883
2951
  * Checks if a url is valid
3884
2952
  * @param {string} string URL
@@ -4558,7 +3626,7 @@
4558
3626
  class ZMPEEmitter extends eventemitter3 {
4559
3627
  constructor() {
4560
3628
  super();
4561
- this.debug = browser("zmp:event-emitter");
3629
+ this.debug = Debug("zmp:event-emitter");
4562
3630
  }
4563
3631
  static getInstance() {
4564
3632
  if (!ZMPEEmitter.instance) {
@@ -4705,7 +3773,7 @@
4705
3773
  class ZaloJSBridge extends eventemitter3 {
4706
3774
  constructor() {
4707
3775
  super();
4708
- this.debug = browser('zmp:ZaloJSBridge');
3776
+ this.debug = Debug('zmp:ZaloJSBridge');
4709
3777
  this.events = ZMPEEmitter.getInstance();
4710
3778
  this._accessTk = getToken('zacc_session') || 'DEFAULT_ACCESS_TOKEN';
4711
3779
  this._jsAccessTk = getToken('zlink3rd') || 'DEFAULT_JS_TOKEN';
@@ -4932,7 +4000,7 @@
4932
4000
  class ZJSBridgeProvider {
4933
4001
  /** @ignore */
4934
4002
  constructor() {
4935
- this.debug = browser('zmp:ZJSBridgeProvider');
4003
+ this.debug = Debug('zmp:ZJSBridgeProvider');
4936
4004
  _ZJSBridgeProvider_bridge.set(this, void 0);
4937
4005
  __classPrivateFieldSet(this, _ZJSBridgeProvider_bridge, ZaloJSBridge.getInstance(), "f");
4938
4006
  }
@@ -4994,7 +4062,7 @@
4994
4062
  }
4995
4063
  _ZJSBridgeProvider_bridge = new WeakMap();
4996
4064
 
4997
- var version = "2.18.5-rc.0";
4065
+ var version = "2.18.6";
4998
4066
 
4999
4067
  class Basics {
5000
4068
  /**
@@ -8149,17 +7217,17 @@
8149
7217
  const resData = yield response.json();
8150
7218
  if (resData.error === 0 && resData.data) {
8151
7219
  users = uIds.map((item) => {
8152
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7220
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8153
7221
  return {
8154
- id: item,
7222
+ id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || "",
8155
7223
  profile: {
8156
- name: (_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.name,
8157
- avatar: (_f = (_e = (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.picture) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.url
7224
+ name: (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.name,
7225
+ avatar: (_h = (_g = (_f = (_e = resData.data[item]) === null || _e === void 0 ? void 0 : _e.user_info) === null || _f === void 0 ? void 0 : _f.picture) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.url
8158
7226
  },
8159
- code: ((_g = resData.data[item]) === null || _g === void 0 ? void 0 : _g.error) !== 0 ? -1 : 0,
8160
- message: `Get profile: ${_.isUndefined((_h = resData.data[item]) === null || _h === void 0 ? void 0 : _h.message)
7227
+ code: ((_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.error) !== 0 ? -1 : 0,
7228
+ message: `Get profile: ${_.isUndefined((_k = resData.data[item]) === null || _k === void 0 ? void 0 : _k.message)
8161
7229
  ? 'Unknown error'
8162
- : (_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.message}`
7230
+ : (_l = resData.data[item]) === null || _l === void 0 ? void 0 : _l.message}`
8163
7231
  };
8164
7232
  });
8165
7233
  }