@freelog/tools-lib 0.1.101 → 0.1.106

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.
@@ -5,423 +5,835 @@ import axios from 'axios';
5
5
  import NProgress from 'nprogress';
6
6
  import 'nprogress/nprogress.css';
7
7
  import { lib, SHA1 } from 'crypto-js';
8
+ import i18next from 'i18next';
9
+ import Cookies from 'js-cookie';
8
10
 
9
- function _regeneratorRuntime() {
10
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
12
+ try {
13
+ var info = gen[key](arg);
14
+ var value = info.value;
15
+ } catch (error) {
16
+ reject(error);
17
+ return;
18
+ }
19
+
20
+ if (info.done) {
21
+ resolve(value);
22
+ } else {
23
+ Promise.resolve(value).then(_next, _throw);
24
+ }
25
+ }
26
+
27
+ function _asyncToGenerator(fn) {
28
+ return function () {
29
+ var self = this,
30
+ args = arguments;
31
+ return new Promise(function (resolve, reject) {
32
+ var gen = fn.apply(self, args);
11
33
 
12
- _regeneratorRuntime = function () {
13
- return exports;
34
+ function _next(value) {
35
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
36
+ }
37
+
38
+ function _throw(err) {
39
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
40
+ }
41
+
42
+ _next(undefined);
43
+ });
44
+ };
45
+ }
46
+
47
+ function _extends() {
48
+ _extends = Object.assign || function (target) {
49
+ for (var i = 1; i < arguments.length; i++) {
50
+ var source = arguments[i];
51
+
52
+ for (var key in source) {
53
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
54
+ target[key] = source[key];
55
+ }
56
+ }
57
+ }
58
+
59
+ return target;
14
60
  };
15
61
 
16
- var exports = {},
17
- Op = Object.prototype,
18
- hasOwn = Op.hasOwnProperty,
19
- $Symbol = "function" == typeof Symbol ? Symbol : {},
20
- iteratorSymbol = $Symbol.iterator || "@@iterator",
21
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
22
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
62
+ return _extends.apply(this, arguments);
63
+ }
64
+
65
+ function _objectDestructuringEmpty(obj) {
66
+ if (obj == null) throw new TypeError("Cannot destructure undefined");
67
+ }
68
+
69
+ function _objectWithoutPropertiesLoose(source, excluded) {
70
+ if (source == null) return {};
71
+ var target = {};
72
+ var sourceKeys = Object.keys(source);
73
+ var key, i;
74
+
75
+ for (i = 0; i < sourceKeys.length; i++) {
76
+ key = sourceKeys[i];
77
+ if (excluded.indexOf(key) >= 0) continue;
78
+ target[key] = source[key];
79
+ }
80
+
81
+ return target;
82
+ }
83
+
84
+ function createCommonjsModule(fn, module) {
85
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
86
+ }
87
+
88
+ var runtime_1 = createCommonjsModule(function (module) {
89
+ /**
90
+ * Copyright (c) 2014-present, Facebook, Inc.
91
+ *
92
+ * This source code is licensed under the MIT license found in the
93
+ * LICENSE file in the root directory of this source tree.
94
+ */
95
+
96
+ var runtime = (function (exports) {
97
+
98
+ var Op = Object.prototype;
99
+ var hasOwn = Op.hasOwnProperty;
100
+ var undefined$1; // More compressible than void 0.
101
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
102
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
103
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
104
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
23
105
 
24
106
  function define(obj, key, value) {
25
- return Object.defineProperty(obj, key, {
107
+ Object.defineProperty(obj, key, {
26
108
  value: value,
27
- enumerable: !0,
28
- configurable: !0,
29
- writable: !0
30
- }), obj[key];
109
+ enumerable: true,
110
+ configurable: true,
111
+ writable: true
112
+ });
113
+ return obj[key];
31
114
  }
32
-
33
115
  try {
116
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
34
117
  define({}, "");
35
118
  } catch (err) {
36
- define = function (obj, key, value) {
119
+ define = function(obj, key, value) {
37
120
  return obj[key] = value;
38
121
  };
39
122
  }
40
123
 
41
124
  function wrap(innerFn, outerFn, self, tryLocsList) {
42
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
43
- generator = Object.create(protoGenerator.prototype),
44
- context = new Context(tryLocsList || []);
45
- return generator._invoke = function (innerFn, self, context) {
46
- var state = "suspendedStart";
47
- return function (method, arg) {
48
- if ("executing" === state) throw new Error("Generator is already running");
49
-
50
- if ("completed" === state) {
51
- if ("throw" === method) throw arg;
52
- return doneResult();
53
- }
125
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
126
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
127
+ var generator = Object.create(protoGenerator.prototype);
128
+ var context = new Context(tryLocsList || []);
54
129
 
55
- for (context.method = method, context.arg = arg;;) {
56
- var delegate = context.delegate;
130
+ // The ._invoke method unifies the implementations of the .next,
131
+ // .throw, and .return methods.
132
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
57
133
 
58
- if (delegate) {
59
- var delegateResult = maybeInvokeDelegate(delegate, context);
60
-
61
- if (delegateResult) {
62
- if (delegateResult === ContinueSentinel) continue;
63
- return delegateResult;
64
- }
65
- }
66
-
67
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
68
- if ("suspendedStart" === state) throw state = "completed", context.arg;
69
- context.dispatchException(context.arg);
70
- } else "return" === context.method && context.abrupt("return", context.arg);
71
- state = "executing";
72
- var record = tryCatch(innerFn, self, context);
73
-
74
- if ("normal" === record.type) {
75
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
76
- return {
77
- value: record.arg,
78
- done: context.done
79
- };
80
- }
81
-
82
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
83
- }
84
- };
85
- }(innerFn, self, context), generator;
134
+ return generator;
86
135
  }
136
+ exports.wrap = wrap;
87
137
 
138
+ // Try/catch helper to minimize deoptimizations. Returns a completion
139
+ // record like context.tryEntries[i].completion. This interface could
140
+ // have been (and was previously) designed to take a closure to be
141
+ // invoked without arguments, but in all the cases we care about we
142
+ // already have an existing method we want to call, so there's no need
143
+ // to create a new function object. We can even get away with assuming
144
+ // the method takes exactly one argument, since that happens to be true
145
+ // in every case, so we don't have to touch the arguments object. The
146
+ // only additional allocation required is the completion record, which
147
+ // has a stable shape and so hopefully should be cheap to allocate.
88
148
  function tryCatch(fn, obj, arg) {
89
149
  try {
90
- return {
91
- type: "normal",
92
- arg: fn.call(obj, arg)
93
- };
150
+ return { type: "normal", arg: fn.call(obj, arg) };
94
151
  } catch (err) {
95
- return {
96
- type: "throw",
97
- arg: err
98
- };
152
+ return { type: "throw", arg: err };
99
153
  }
100
154
  }
101
155
 
102
- exports.wrap = wrap;
156
+ var GenStateSuspendedStart = "suspendedStart";
157
+ var GenStateSuspendedYield = "suspendedYield";
158
+ var GenStateExecuting = "executing";
159
+ var GenStateCompleted = "completed";
160
+
161
+ // Returning this object from the innerFn has the same effect as
162
+ // breaking out of the dispatch switch statement.
103
163
  var ContinueSentinel = {};
104
164
 
165
+ // Dummy constructor functions that we use as the .constructor and
166
+ // .constructor.prototype properties for functions that return Generator
167
+ // objects. For full spec compliance, you may wish to configure your
168
+ // minifier not to mangle the names of these two functions.
105
169
  function Generator() {}
106
-
107
170
  function GeneratorFunction() {}
108
-
109
171
  function GeneratorFunctionPrototype() {}
110
172
 
173
+ // This is a polyfill for %IteratorPrototype% for environments that
174
+ // don't natively support it.
111
175
  var IteratorPrototype = {};
112
- define(IteratorPrototype, iteratorSymbol, function () {
176
+ IteratorPrototype[iteratorSymbol] = function () {
113
177
  return this;
114
- });
115
- var getProto = Object.getPrototypeOf,
116
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
117
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
118
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
178
+ };
179
+
180
+ var getProto = Object.getPrototypeOf;
181
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
182
+ if (NativeIteratorPrototype &&
183
+ NativeIteratorPrototype !== Op &&
184
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
185
+ // This environment has a native %IteratorPrototype%; use it instead
186
+ // of the polyfill.
187
+ IteratorPrototype = NativeIteratorPrototype;
188
+ }
119
189
 
190
+ var Gp = GeneratorFunctionPrototype.prototype =
191
+ Generator.prototype = Object.create(IteratorPrototype);
192
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
193
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
194
+ GeneratorFunction.displayName = define(
195
+ GeneratorFunctionPrototype,
196
+ toStringTagSymbol,
197
+ "GeneratorFunction"
198
+ );
199
+
200
+ // Helper for defining the .next, .throw, and .return methods of the
201
+ // Iterator interface in terms of a single ._invoke method.
120
202
  function defineIteratorMethods(prototype) {
121
- ["next", "throw", "return"].forEach(function (method) {
122
- define(prototype, method, function (arg) {
203
+ ["next", "throw", "return"].forEach(function(method) {
204
+ define(prototype, method, function(arg) {
123
205
  return this._invoke(method, arg);
124
206
  });
125
207
  });
126
208
  }
127
209
 
210
+ exports.isGeneratorFunction = function(genFun) {
211
+ var ctor = typeof genFun === "function" && genFun.constructor;
212
+ return ctor
213
+ ? ctor === GeneratorFunction ||
214
+ // For the native GeneratorFunction constructor, the best we can
215
+ // do is to check its .name property.
216
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
217
+ : false;
218
+ };
219
+
220
+ exports.mark = function(genFun) {
221
+ if (Object.setPrototypeOf) {
222
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
223
+ } else {
224
+ genFun.__proto__ = GeneratorFunctionPrototype;
225
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
226
+ }
227
+ genFun.prototype = Object.create(Gp);
228
+ return genFun;
229
+ };
230
+
231
+ // Within the body of any async function, `await x` is transformed to
232
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
233
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
234
+ // meant to be awaited.
235
+ exports.awrap = function(arg) {
236
+ return { __await: arg };
237
+ };
238
+
128
239
  function AsyncIterator(generator, PromiseImpl) {
129
240
  function invoke(method, arg, resolve, reject) {
130
241
  var record = tryCatch(generator[method], generator, arg);
242
+ if (record.type === "throw") {
243
+ reject(record.arg);
244
+ } else {
245
+ var result = record.arg;
246
+ var value = result.value;
247
+ if (value &&
248
+ typeof value === "object" &&
249
+ hasOwn.call(value, "__await")) {
250
+ return PromiseImpl.resolve(value.__await).then(function(value) {
251
+ invoke("next", value, resolve, reject);
252
+ }, function(err) {
253
+ invoke("throw", err, resolve, reject);
254
+ });
255
+ }
131
256
 
132
- if ("throw" !== record.type) {
133
- var result = record.arg,
134
- value = result.value;
135
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
136
- invoke("next", value, resolve, reject);
137
- }, function (err) {
138
- invoke("throw", err, resolve, reject);
139
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
140
- result.value = unwrapped, resolve(result);
141
- }, function (error) {
257
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
258
+ // When a yielded Promise is resolved, its final value becomes
259
+ // the .value of the Promise<{value,done}> result for the
260
+ // current iteration.
261
+ result.value = unwrapped;
262
+ resolve(result);
263
+ }, function(error) {
264
+ // If a rejected Promise was yielded, throw the rejection back
265
+ // into the async generator function so it can be handled there.
142
266
  return invoke("throw", error, resolve, reject);
143
267
  });
144
268
  }
145
-
146
- reject(record.arg);
147
269
  }
148
270
 
149
271
  var previousPromise;
150
272
 
151
- this._invoke = function (method, arg) {
273
+ function enqueue(method, arg) {
152
274
  function callInvokeWithMethodAndArg() {
153
- return new PromiseImpl(function (resolve, reject) {
275
+ return new PromiseImpl(function(resolve, reject) {
154
276
  invoke(method, arg, resolve, reject);
155
277
  });
156
278
  }
157
279
 
158
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
280
+ return previousPromise =
281
+ // If enqueue has been called before, then we want to wait until
282
+ // all previous Promises have been resolved before calling invoke,
283
+ // so that results are always delivered in the correct order. If
284
+ // enqueue has not been called before, then it is important to
285
+ // call invoke immediately, without waiting on a callback to fire,
286
+ // so that the async generator function has the opportunity to do
287
+ // any necessary setup in a predictable way. This predictability
288
+ // is why the Promise constructor synchronously invokes its
289
+ // executor callback, and why async functions synchronously
290
+ // execute code before the first await. Since we implement simple
291
+ // async functions in terms of async generators, it is especially
292
+ // important to get this right, even though it requires care.
293
+ previousPromise ? previousPromise.then(
294
+ callInvokeWithMethodAndArg,
295
+ // Avoid propagating failures to Promises returned by later
296
+ // invocations of the iterator.
297
+ callInvokeWithMethodAndArg
298
+ ) : callInvokeWithMethodAndArg();
299
+ }
300
+
301
+ // Define the unified helper method that is used to implement .next,
302
+ // .throw, and .return (see defineIteratorMethods).
303
+ this._invoke = enqueue;
304
+ }
305
+
306
+ defineIteratorMethods(AsyncIterator.prototype);
307
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
308
+ return this;
309
+ };
310
+ exports.AsyncIterator = AsyncIterator;
311
+
312
+ // Note that simple async functions are implemented on top of
313
+ // AsyncIterator objects; they just return a Promise for the value of
314
+ // the final result produced by the iterator.
315
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
316
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
317
+
318
+ var iter = new AsyncIterator(
319
+ wrap(innerFn, outerFn, self, tryLocsList),
320
+ PromiseImpl
321
+ );
322
+
323
+ return exports.isGeneratorFunction(outerFn)
324
+ ? iter // If outerFn is a generator, return the full iterator.
325
+ : iter.next().then(function(result) {
326
+ return result.done ? result.value : iter.next();
327
+ });
328
+ };
329
+
330
+ function makeInvokeMethod(innerFn, self, context) {
331
+ var state = GenStateSuspendedStart;
332
+
333
+ return function invoke(method, arg) {
334
+ if (state === GenStateExecuting) {
335
+ throw new Error("Generator is already running");
336
+ }
337
+
338
+ if (state === GenStateCompleted) {
339
+ if (method === "throw") {
340
+ throw arg;
341
+ }
342
+
343
+ // Be forgiving, per 25.3.3.3.3 of the spec:
344
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
345
+ return doneResult();
346
+ }
347
+
348
+ context.method = method;
349
+ context.arg = arg;
350
+
351
+ while (true) {
352
+ var delegate = context.delegate;
353
+ if (delegate) {
354
+ var delegateResult = maybeInvokeDelegate(delegate, context);
355
+ if (delegateResult) {
356
+ if (delegateResult === ContinueSentinel) continue;
357
+ return delegateResult;
358
+ }
359
+ }
360
+
361
+ if (context.method === "next") {
362
+ // Setting context._sent for legacy support of Babel's
363
+ // function.sent implementation.
364
+ context.sent = context._sent = context.arg;
365
+
366
+ } else if (context.method === "throw") {
367
+ if (state === GenStateSuspendedStart) {
368
+ state = GenStateCompleted;
369
+ throw context.arg;
370
+ }
371
+
372
+ context.dispatchException(context.arg);
373
+
374
+ } else if (context.method === "return") {
375
+ context.abrupt("return", context.arg);
376
+ }
377
+
378
+ state = GenStateExecuting;
379
+
380
+ var record = tryCatch(innerFn, self, context);
381
+ if (record.type === "normal") {
382
+ // If an exception is thrown from innerFn, we leave state ===
383
+ // GenStateExecuting and loop back for another invocation.
384
+ state = context.done
385
+ ? GenStateCompleted
386
+ : GenStateSuspendedYield;
387
+
388
+ if (record.arg === ContinueSentinel) {
389
+ continue;
390
+ }
391
+
392
+ return {
393
+ value: record.arg,
394
+ done: context.done
395
+ };
396
+
397
+ } else if (record.type === "throw") {
398
+ state = GenStateCompleted;
399
+ // Dispatch the exception by looping back around to the
400
+ // context.dispatchException(context.arg) call above.
401
+ context.method = "throw";
402
+ context.arg = record.arg;
403
+ }
404
+ }
159
405
  };
160
406
  }
161
407
 
408
+ // Call delegate.iterator[context.method](context.arg) and handle the
409
+ // result, either by returning a { value, done } result from the
410
+ // delegate iterator, or by modifying context.method and context.arg,
411
+ // setting context.delegate to null, and returning the ContinueSentinel.
162
412
  function maybeInvokeDelegate(delegate, context) {
163
413
  var method = delegate.iterator[context.method];
414
+ if (method === undefined$1) {
415
+ // A .throw or .return when the delegate iterator has no .throw
416
+ // method always terminates the yield* loop.
417
+ context.delegate = null;
418
+
419
+ if (context.method === "throw") {
420
+ // Note: ["return"] must be used for ES3 parsing compatibility.
421
+ if (delegate.iterator["return"]) {
422
+ // If the delegate iterator has a return method, give it a
423
+ // chance to clean up.
424
+ context.method = "return";
425
+ context.arg = undefined$1;
426
+ maybeInvokeDelegate(delegate, context);
427
+
428
+ if (context.method === "throw") {
429
+ // If maybeInvokeDelegate(context) changed context.method from
430
+ // "return" to "throw", let that override the TypeError below.
431
+ return ContinueSentinel;
432
+ }
433
+ }
164
434
 
165
- if (undefined === method) {
166
- if (context.delegate = null, "throw" === context.method) {
167
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
168
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
435
+ context.method = "throw";
436
+ context.arg = new TypeError(
437
+ "The iterator does not provide a 'throw' method");
169
438
  }
170
439
 
171
440
  return ContinueSentinel;
172
441
  }
173
442
 
174
443
  var record = tryCatch(method, delegate.iterator, context.arg);
175
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
444
+
445
+ if (record.type === "throw") {
446
+ context.method = "throw";
447
+ context.arg = record.arg;
448
+ context.delegate = null;
449
+ return ContinueSentinel;
450
+ }
451
+
176
452
  var info = record.arg;
177
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
453
+
454
+ if (! info) {
455
+ context.method = "throw";
456
+ context.arg = new TypeError("iterator result is not an object");
457
+ context.delegate = null;
458
+ return ContinueSentinel;
459
+ }
460
+
461
+ if (info.done) {
462
+ // Assign the result of the finished delegate to the temporary
463
+ // variable specified by delegate.resultName (see delegateYield).
464
+ context[delegate.resultName] = info.value;
465
+
466
+ // Resume execution at the desired location (see delegateYield).
467
+ context.next = delegate.nextLoc;
468
+
469
+ // If context.method was "throw" but the delegate handled the
470
+ // exception, let the outer generator proceed normally. If
471
+ // context.method was "next", forget context.arg since it has been
472
+ // "consumed" by the delegate iterator. If context.method was
473
+ // "return", allow the original .return call to continue in the
474
+ // outer generator.
475
+ if (context.method !== "return") {
476
+ context.method = "next";
477
+ context.arg = undefined$1;
478
+ }
479
+
480
+ } else {
481
+ // Re-yield the result returned by the delegate method.
482
+ return info;
483
+ }
484
+
485
+ // The delegate iterator is finished, so forget it and continue with
486
+ // the outer generator.
487
+ context.delegate = null;
488
+ return ContinueSentinel;
178
489
  }
179
490
 
491
+ // Define Generator.prototype.{next,throw,return} in terms of the
492
+ // unified ._invoke helper method.
493
+ defineIteratorMethods(Gp);
494
+
495
+ define(Gp, toStringTagSymbol, "Generator");
496
+
497
+ // A Generator should always return itself as the iterator object when the
498
+ // @@iterator function is called on it. Some browsers' implementations of the
499
+ // iterator prototype chain incorrectly implement this, causing the Generator
500
+ // object to not be returned from this call. This ensures that doesn't happen.
501
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
502
+ Gp[iteratorSymbol] = function() {
503
+ return this;
504
+ };
505
+
506
+ Gp.toString = function() {
507
+ return "[object Generator]";
508
+ };
509
+
180
510
  function pushTryEntry(locs) {
181
- var entry = {
182
- tryLoc: locs[0]
183
- };
184
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
511
+ var entry = { tryLoc: locs[0] };
512
+
513
+ if (1 in locs) {
514
+ entry.catchLoc = locs[1];
515
+ }
516
+
517
+ if (2 in locs) {
518
+ entry.finallyLoc = locs[2];
519
+ entry.afterLoc = locs[3];
520
+ }
521
+
522
+ this.tryEntries.push(entry);
185
523
  }
186
524
 
187
525
  function resetTryEntry(entry) {
188
526
  var record = entry.completion || {};
189
- record.type = "normal", delete record.arg, entry.completion = record;
527
+ record.type = "normal";
528
+ delete record.arg;
529
+ entry.completion = record;
190
530
  }
191
531
 
192
532
  function Context(tryLocsList) {
193
- this.tryEntries = [{
194
- tryLoc: "root"
195
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
533
+ // The root entry object (effectively a try statement without a catch
534
+ // or a finally block) gives us a place to store values thrown from
535
+ // locations where there is no enclosing try statement.
536
+ this.tryEntries = [{ tryLoc: "root" }];
537
+ tryLocsList.forEach(pushTryEntry, this);
538
+ this.reset(true);
196
539
  }
197
540
 
541
+ exports.keys = function(object) {
542
+ var keys = [];
543
+ for (var key in object) {
544
+ keys.push(key);
545
+ }
546
+ keys.reverse();
547
+
548
+ // Rather than returning an object with a next method, we keep
549
+ // things simple and return the next function itself.
550
+ return function next() {
551
+ while (keys.length) {
552
+ var key = keys.pop();
553
+ if (key in object) {
554
+ next.value = key;
555
+ next.done = false;
556
+ return next;
557
+ }
558
+ }
559
+
560
+ // To avoid creating an additional object, we just hang the .value
561
+ // and .done properties off the next function object itself. This
562
+ // also ensures that the minifier will not anonymize the function.
563
+ next.done = true;
564
+ return next;
565
+ };
566
+ };
567
+
198
568
  function values(iterable) {
199
569
  if (iterable) {
200
570
  var iteratorMethod = iterable[iteratorSymbol];
201
- if (iteratorMethod) return iteratorMethod.call(iterable);
202
- if ("function" == typeof iterable.next) return iterable;
571
+ if (iteratorMethod) {
572
+ return iteratorMethod.call(iterable);
573
+ }
574
+
575
+ if (typeof iterable.next === "function") {
576
+ return iterable;
577
+ }
203
578
 
204
579
  if (!isNaN(iterable.length)) {
205
- var i = -1,
206
- next = function next() {
207
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
580
+ var i = -1, next = function next() {
581
+ while (++i < iterable.length) {
582
+ if (hasOwn.call(iterable, i)) {
583
+ next.value = iterable[i];
584
+ next.done = false;
585
+ return next;
586
+ }
587
+ }
588
+
589
+ next.value = undefined$1;
590
+ next.done = true;
208
591
 
209
- return next.value = undefined, next.done = !0, next;
592
+ return next;
210
593
  };
211
594
 
212
595
  return next.next = next;
213
596
  }
214
597
  }
215
598
 
216
- return {
217
- next: doneResult
218
- };
599
+ // Return an iterator with no values.
600
+ return { next: doneResult };
219
601
  }
602
+ exports.values = values;
220
603
 
221
604
  function doneResult() {
222
- return {
223
- value: undefined,
224
- done: !0
225
- };
605
+ return { value: undefined$1, done: true };
226
606
  }
227
607
 
228
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
229
- var ctor = "function" == typeof genFun && genFun.constructor;
230
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
231
- }, exports.mark = function (genFun) {
232
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
233
- }, exports.awrap = function (arg) {
234
- return {
235
- __await: arg
236
- };
237
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
238
- return this;
239
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
240
- void 0 === PromiseImpl && (PromiseImpl = Promise);
241
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
242
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
243
- return result.done ? result.value : iter.next();
244
- });
245
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
246
- return this;
247
- }), define(Gp, "toString", function () {
248
- return "[object Generator]";
249
- }), exports.keys = function (object) {
250
- var keys = [];
608
+ Context.prototype = {
609
+ constructor: Context,
610
+
611
+ reset: function(skipTempReset) {
612
+ this.prev = 0;
613
+ this.next = 0;
614
+ // Resetting context._sent for legacy support of Babel's
615
+ // function.sent implementation.
616
+ this.sent = this._sent = undefined$1;
617
+ this.done = false;
618
+ this.delegate = null;
619
+
620
+ this.method = "next";
621
+ this.arg = undefined$1;
622
+
623
+ this.tryEntries.forEach(resetTryEntry);
624
+
625
+ if (!skipTempReset) {
626
+ for (var name in this) {
627
+ // Not sure about the optimal order of these conditions:
628
+ if (name.charAt(0) === "t" &&
629
+ hasOwn.call(this, name) &&
630
+ !isNaN(+name.slice(1))) {
631
+ this[name] = undefined$1;
632
+ }
633
+ }
634
+ }
635
+ },
251
636
 
252
- for (var key in object) keys.push(key);
637
+ stop: function() {
638
+ this.done = true;
253
639
 
254
- return keys.reverse(), function next() {
255
- for (; keys.length;) {
256
- var key = keys.pop();
257
- if (key in object) return next.value = key, next.done = !1, next;
640
+ var rootEntry = this.tryEntries[0];
641
+ var rootRecord = rootEntry.completion;
642
+ if (rootRecord.type === "throw") {
643
+ throw rootRecord.arg;
258
644
  }
259
645
 
260
- return next.done = !0, next;
261
- };
262
- }, exports.values = values, Context.prototype = {
263
- constructor: Context,
264
- reset: function (skipTempReset) {
265
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
266
- },
267
- stop: function () {
268
- this.done = !0;
269
- var rootRecord = this.tryEntries[0].completion;
270
- if ("throw" === rootRecord.type) throw rootRecord.arg;
271
646
  return this.rval;
272
647
  },
273
- dispatchException: function (exception) {
274
- if (this.done) throw exception;
275
- var context = this;
276
648
 
649
+ dispatchException: function(exception) {
650
+ if (this.done) {
651
+ throw exception;
652
+ }
653
+
654
+ var context = this;
277
655
  function handle(loc, caught) {
278
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
656
+ record.type = "throw";
657
+ record.arg = exception;
658
+ context.next = loc;
659
+
660
+ if (caught) {
661
+ // If the dispatched exception was caught by a catch block,
662
+ // then let that catch block handle the exception normally.
663
+ context.method = "next";
664
+ context.arg = undefined$1;
665
+ }
666
+
667
+ return !! caught;
279
668
  }
280
669
 
281
670
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
282
- var entry = this.tryEntries[i],
283
- record = entry.completion;
284
- if ("root" === entry.tryLoc) return handle("end");
671
+ var entry = this.tryEntries[i];
672
+ var record = entry.completion;
673
+
674
+ if (entry.tryLoc === "root") {
675
+ // Exception thrown outside of any try block that could handle
676
+ // it, so set the completion value of the entire function to
677
+ // throw the exception.
678
+ return handle("end");
679
+ }
285
680
 
286
681
  if (entry.tryLoc <= this.prev) {
287
- var hasCatch = hasOwn.call(entry, "catchLoc"),
288
- hasFinally = hasOwn.call(entry, "finallyLoc");
682
+ var hasCatch = hasOwn.call(entry, "catchLoc");
683
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
289
684
 
290
685
  if (hasCatch && hasFinally) {
291
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
292
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
686
+ if (this.prev < entry.catchLoc) {
687
+ return handle(entry.catchLoc, true);
688
+ } else if (this.prev < entry.finallyLoc) {
689
+ return handle(entry.finallyLoc);
690
+ }
691
+
293
692
  } else if (hasCatch) {
294
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
693
+ if (this.prev < entry.catchLoc) {
694
+ return handle(entry.catchLoc, true);
695
+ }
696
+
697
+ } else if (hasFinally) {
698
+ if (this.prev < entry.finallyLoc) {
699
+ return handle(entry.finallyLoc);
700
+ }
701
+
295
702
  } else {
296
- if (!hasFinally) throw new Error("try statement without catch or finally");
297
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
703
+ throw new Error("try statement without catch or finally");
298
704
  }
299
705
  }
300
706
  }
301
707
  },
302
- abrupt: function (type, arg) {
708
+
709
+ abrupt: function(type, arg) {
303
710
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
304
711
  var entry = this.tryEntries[i];
305
-
306
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
712
+ if (entry.tryLoc <= this.prev &&
713
+ hasOwn.call(entry, "finallyLoc") &&
714
+ this.prev < entry.finallyLoc) {
307
715
  var finallyEntry = entry;
308
716
  break;
309
717
  }
310
718
  }
311
719
 
312
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
720
+ if (finallyEntry &&
721
+ (type === "break" ||
722
+ type === "continue") &&
723
+ finallyEntry.tryLoc <= arg &&
724
+ arg <= finallyEntry.finallyLoc) {
725
+ // Ignore the finally entry if control is not jumping to a
726
+ // location outside the try/catch block.
727
+ finallyEntry = null;
728
+ }
729
+
313
730
  var record = finallyEntry ? finallyEntry.completion : {};
314
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
731
+ record.type = type;
732
+ record.arg = arg;
733
+
734
+ if (finallyEntry) {
735
+ this.method = "next";
736
+ this.next = finallyEntry.finallyLoc;
737
+ return ContinueSentinel;
738
+ }
739
+
740
+ return this.complete(record);
315
741
  },
316
- complete: function (record, afterLoc) {
317
- if ("throw" === record.type) throw record.arg;
318
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
742
+
743
+ complete: function(record, afterLoc) {
744
+ if (record.type === "throw") {
745
+ throw record.arg;
746
+ }
747
+
748
+ if (record.type === "break" ||
749
+ record.type === "continue") {
750
+ this.next = record.arg;
751
+ } else if (record.type === "return") {
752
+ this.rval = this.arg = record.arg;
753
+ this.method = "return";
754
+ this.next = "end";
755
+ } else if (record.type === "normal" && afterLoc) {
756
+ this.next = afterLoc;
757
+ }
758
+
759
+ return ContinueSentinel;
319
760
  },
320
- finish: function (finallyLoc) {
761
+
762
+ finish: function(finallyLoc) {
321
763
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
322
764
  var entry = this.tryEntries[i];
323
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
765
+ if (entry.finallyLoc === finallyLoc) {
766
+ this.complete(entry.completion, entry.afterLoc);
767
+ resetTryEntry(entry);
768
+ return ContinueSentinel;
769
+ }
324
770
  }
325
771
  },
326
- catch: function (tryLoc) {
772
+
773
+ "catch": function(tryLoc) {
327
774
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
328
775
  var entry = this.tryEntries[i];
329
-
330
776
  if (entry.tryLoc === tryLoc) {
331
777
  var record = entry.completion;
332
-
333
- if ("throw" === record.type) {
778
+ if (record.type === "throw") {
334
779
  var thrown = record.arg;
335
780
  resetTryEntry(entry);
336
781
  }
337
-
338
782
  return thrown;
339
783
  }
340
784
  }
341
785
 
786
+ // The context.catch method must only be called with a location
787
+ // argument that corresponds to a known catch block.
342
788
  throw new Error("illegal catch attempt");
343
789
  },
344
- delegateYield: function (iterable, resultName, nextLoc) {
345
- return this.delegate = {
790
+
791
+ delegateYield: function(iterable, resultName, nextLoc) {
792
+ this.delegate = {
346
793
  iterator: values(iterable),
347
794
  resultName: resultName,
348
795
  nextLoc: nextLoc
349
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
350
- }
351
- }, exports;
352
- }
353
-
354
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
355
- try {
356
- var info = gen[key](arg);
357
- var value = info.value;
358
- } catch (error) {
359
- reject(error);
360
- return;
361
- }
362
-
363
- if (info.done) {
364
- resolve(value);
365
- } else {
366
- Promise.resolve(value).then(_next, _throw);
367
- }
368
- }
369
-
370
- function _asyncToGenerator(fn) {
371
- return function () {
372
- var self = this,
373
- args = arguments;
374
- return new Promise(function (resolve, reject) {
375
- var gen = fn.apply(self, args);
376
-
377
- function _next(value) {
378
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
379
- }
796
+ };
380
797
 
381
- function _throw(err) {
382
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
798
+ if (this.method === "next") {
799
+ // Deliberately forget the last sent value so that we don't
800
+ // accidentally pass it on to the delegate.
801
+ this.arg = undefined$1;
383
802
  }
384
803
 
385
- _next(undefined);
386
- });
387
- };
388
- }
389
-
390
- function _extends() {
391
- _extends = Object.assign ? Object.assign.bind() : function (target) {
392
- for (var i = 1; i < arguments.length; i++) {
393
- var source = arguments[i];
394
-
395
- for (var key in source) {
396
- if (Object.prototype.hasOwnProperty.call(source, key)) {
397
- target[key] = source[key];
398
- }
399
- }
804
+ return ContinueSentinel;
400
805
  }
401
-
402
- return target;
403
806
  };
404
- return _extends.apply(this, arguments);
405
- }
406
-
407
- function _objectDestructuringEmpty(obj) {
408
- if (obj == null) throw new TypeError("Cannot destructure undefined");
409
- }
410
-
411
- function _objectWithoutPropertiesLoose(source, excluded) {
412
- if (source == null) return {};
413
- var target = {};
414
- var sourceKeys = Object.keys(source);
415
- var key, i;
416
-
417
- for (i = 0; i < sourceKeys.length; i++) {
418
- key = sourceKeys[i];
419
- if (excluded.indexOf(key) >= 0) continue;
420
- target[key] = source[key];
421
- }
422
807
 
423
- return target;
808
+ // Regardless of whether this script is executing as a CommonJS module
809
+ // or not, return the runtime object so that we can declare the variable
810
+ // regeneratorRuntime in the outer scope, which allows this module to be
811
+ // injected easily by `bin/regenerator --include-runtime script.js`.
812
+ return exports;
813
+
814
+ }(
815
+ // If this script is executing as a CommonJS module, use module.exports
816
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
817
+ // object. Either way, the resulting object will be used to initialize
818
+ // the regeneratorRuntime variable at the top of this file.
819
+ module.exports
820
+ ));
821
+
822
+ try {
823
+ regeneratorRuntime = runtime;
824
+ } catch (accidentalStrictMode) {
825
+ // This module should not be running in strict mode, so the above
826
+ // assignment should always work unless something is misconfigured. Just
827
+ // in case runtime.js accidentally runs in strict mode, we can escape
828
+ // strict mode using a global Function call. This could conceivably fail
829
+ // if a Content Security Policy forbids using Function, but in that case
830
+ // the proper solution is to fix the accidental strict mode problem. If
831
+ // you've misconfigured your bundler to force strict mode and applied a
832
+ // CSP to forbid Function, and you're not willing to fix either of those
833
+ // problems, please detail your unique predicament in a GitHub issue.
834
+ Function("r", "regeneratorRuntime = r")(runtime);
424
835
  }
836
+ });
425
837
 
426
838
  var _require = /*#__PURE__*/require('@freelog/resource-policy-lang'),
427
839
  compile = _require.compile;
@@ -480,9 +892,9 @@ function policyCodeTranslationToText(_x, _x2) {
480
892
  }
481
893
 
482
894
  function _policyCodeTranslationToText() {
483
- _policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, targetType) {
895
+ _policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(code, targetType) {
484
896
  var result, contract, rrr;
485
- return _regeneratorRuntime().wrap(function _callee$(_context) {
897
+ return runtime_1.wrap(function _callee$(_context) {
486
898
  while (1) {
487
899
  switch (_context.prev = _context.next) {
488
900
  case 0:
@@ -736,10 +1148,19 @@ function nodeCreateSuccess(_ref24) {
736
1148
  var nodeID = _ref24.nodeID;
737
1149
  return "/result/node/create/success/" + nodeID;
738
1150
  }
739
- function exception403(_temp11) {
1151
+ function invitation(_temp11) {
740
1152
  var _ref25 = _temp11 === void 0 ? {} : _temp11,
741
1153
  params = _extends({}, _ref25);
742
1154
 
1155
+ // console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
1156
+ return "/invitation" + handleQuery({
1157
+ returnUrl: params.goTo ? encodeURIComponent(params.goTo) : undefined
1158
+ });
1159
+ }
1160
+ function exception403(_temp12) {
1161
+ var _ref26 = _temp12 === void 0 ? {} : _temp12,
1162
+ params = _extends({}, _ref26);
1163
+
743
1164
  var fromUrl = params.from || '';
744
1165
 
745
1166
  if (!fromUrl) {
@@ -753,56 +1174,56 @@ function exception403(_temp11) {
753
1174
  from: fromUrl
754
1175
  });
755
1176
  }
756
- function login(_temp12) {
757
- var _ref26 = _temp12 === void 0 ? {} : _temp12,
758
- goTo = _ref26.goTo;
1177
+ function login(_temp13) {
1178
+ var _ref27 = _temp13 === void 0 ? {} : _temp13,
1179
+ goTo = _ref27.goTo;
759
1180
 
760
1181
  return "/login" + handleQuery({
761
1182
  goTo: goTo ? encodeURIComponent(goTo) : undefined
762
1183
  });
763
1184
  }
764
- function logon(_temp13) {
765
- var _ref27 = _temp13 === void 0 ? {} : _temp13,
766
- goTo = _ref27.goTo;
1185
+ function logon(_temp14) {
1186
+ var _ref28 = _temp14 === void 0 ? {} : _temp14,
1187
+ goTo = _ref28.goTo;
767
1188
 
768
1189
  return "/logon" + handleQuery({
769
1190
  goTo: goTo ? encodeURIComponent(goTo) : undefined
770
1191
  });
771
1192
  }
772
- function retrieveUserPassword(_temp14) {
773
- var _ref28 = _temp14 === void 0 ? {} : _temp14,
774
- goTo = _ref28.goTo;
1193
+ function retrieveUserPassword(_temp15) {
1194
+ var _ref29 = _temp15 === void 0 ? {} : _temp15,
1195
+ goTo = _ref29.goTo;
775
1196
 
776
1197
  return "/retrieve" + handleQuery({
777
1198
  goTo: goTo ? encodeURIComponent(goTo) : undefined
778
1199
  });
779
1200
  }
780
- function retrievePayPassword(_temp15) {
781
- var _ref29 = _temp15 === void 0 ? {} : _temp15;
782
-
783
- _objectDestructuringEmpty(_ref29);
784
-
785
- return "/retrievePayPassword";
786
- }
787
- function wallet(_temp16) {
1201
+ function retrievePayPassword(_temp16) {
788
1202
  var _ref30 = _temp16 === void 0 ? {} : _temp16;
789
1203
 
790
1204
  _objectDestructuringEmpty(_ref30);
791
1205
 
792
- return "/logged/wallet";
1206
+ return "/retrievePayPassword";
793
1207
  }
794
- function contract(_temp17) {
1208
+ function wallet(_temp17) {
795
1209
  var _ref31 = _temp17 === void 0 ? {} : _temp17;
796
1210
 
797
1211
  _objectDestructuringEmpty(_ref31);
798
1212
 
799
- return "/logged/contract";
1213
+ return "/logged/wallet";
800
1214
  }
801
- function setting(_temp18) {
1215
+ function contract(_temp18) {
802
1216
  var _ref32 = _temp18 === void 0 ? {} : _temp18;
803
1217
 
804
1218
  _objectDestructuringEmpty(_ref32);
805
1219
 
1220
+ return "/logged/contract";
1221
+ }
1222
+ function setting(_temp19) {
1223
+ var _ref33 = _temp19 === void 0 ? {} : _temp19;
1224
+
1225
+ _objectDestructuringEmpty(_ref33);
1226
+
806
1227
  return "/logged/setting";
807
1228
  }
808
1229
  /************** user End ******************************************************/
@@ -850,6 +1271,7 @@ var LinkTo = {
850
1271
  resourceCreateSuccess: resourceCreateSuccess,
851
1272
  resourceVersionCreateSuccess: resourceVersionCreateSuccess,
852
1273
  nodeCreateSuccess: nodeCreateSuccess,
1274
+ invitation: invitation,
853
1275
  exception403: exception403,
854
1276
  login: login,
855
1277
  logon: logon,
@@ -2265,6 +2687,35 @@ var Statistic = {
2265
2687
  transactionsCommon: transactionsCommon
2266
2688
  };
2267
2689
 
2690
+ function configsList(params) {
2691
+ // console.log('####@30984i2o3jdsjflfkjsdl')
2692
+ return FUtil.Request({
2693
+ method: 'POST',
2694
+ url: "/v2/i18n/configs/list",
2695
+ data: params
2696
+ });
2697
+ } // oss保存的翻译
2698
+ // interface ConfigsListParamsType {
2699
+ // key: string;
2700
+ // content: string;
2701
+ // tagIds: string[];
2702
+ // status: 0 | 1 | 2 | 3; // 0:全部 1:待翻译 2:待发布 3:已发布
2703
+ // }
2704
+ //
2705
+ // export function configsList(params: ConfigsListParamsType) {
2706
+ // // console.log('####@30984i2o3jdsjflfkjsdl')
2707
+ // return FUtil.Request({
2708
+ // method: 'POST',
2709
+ // url: `/v2/i18n/configs/list`,
2710
+ // data: params,
2711
+ // });
2712
+ // }
2713
+
2714
+ var I18n = {
2715
+ __proto__: null,
2716
+ configsList: configsList
2717
+ };
2718
+
2268
2719
  var FServiceAPI = {
2269
2720
  Node: Node,
2270
2721
  Exhibit: Exhibit,
@@ -2279,7 +2730,8 @@ var FServiceAPI = {
2279
2730
  Event: Event,
2280
2731
  Activity: Activity,
2281
2732
  TestQualification: TestQualification,
2282
- Statistic: Statistic
2733
+ Statistic: Statistic,
2734
+ I18n: I18n
2283
2735
  };
2284
2736
 
2285
2737
  var codeMessage = {
@@ -2396,10 +2848,10 @@ function request(_x, _x2) {
2396
2848
  // }
2397
2849
 
2398
2850
  function _request() {
2399
- _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
2851
+ _request = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(config, _temp) {
2400
2852
  var _ref, _ref$noRedirect, noRedirect, _ref$noErrorAlert, noErrorAlert, result;
2401
2853
 
2402
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2854
+ return runtime_1.wrap(function _callee$(_context) {
2403
2855
  while (1) {
2404
2856
  switch (_context.prev = _context.next) {
2405
2857
  case 0:
@@ -2532,5 +2984,252 @@ var FUtil = {
2532
2984
  Tool: Tool
2533
2985
  };
2534
2986
 
2535
- export { FServiceAPI, FUtil };
2987
+ var ossJsonUrl = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json';
2988
+ var localStorage_i18nextLng_key = 'locale';
2989
+ var localStorage_i18nextResources_key = 'i18nextResources';
2990
+ var allLanguage = [{
2991
+ value: 'en_US',
2992
+ label: 'English'
2993
+ }, {
2994
+ value: 'zh_CN',
2995
+ label: '简体中文'
2996
+ }];
2997
+ var self;
2998
+
2999
+ var I18nNext = /*#__PURE__*/function () {
3000
+ function I18nNext() {
3001
+ this._loadingData = 'NotStart';
3002
+ this._taskQueue = []; // private _currentLanguage: LanguageKeyType = window.localStorage.getItem(localStorage_i18nextLng_key) as null || 'zh_CN';
3003
+
3004
+ this._currentLanguage = Cookies.get(localStorage_i18nextLng_key) || 'zh_CN';
3005
+ self = this;
3006
+ self.ready();
3007
+ }
3008
+
3009
+ var _proto = I18nNext.prototype;
3010
+
3011
+ _proto.ready = /*#__PURE__*/function () {
3012
+ var _ready = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
3013
+ var exc, handleTasks, promise;
3014
+ return runtime_1.wrap(function _callee2$(_context2) {
3015
+ while (1) {
3016
+ switch (_context2.prev = _context2.next) {
3017
+ case 0:
3018
+ exc = function exc() {
3019
+ while (self._taskQueue.length > 0) {
3020
+ var task = self._taskQueue.shift();
3021
+
3022
+ task && task();
3023
+ }
3024
+ };
3025
+
3026
+ handleTasks = /*#__PURE__*/function () {
3027
+ var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3028
+ return runtime_1.wrap(function _callee$(_context) {
3029
+ while (1) {
3030
+ switch (_context.prev = _context.next) {
3031
+ case 0:
3032
+ if (!(self._loadingData === 'End')) {
3033
+ _context.next = 3;
3034
+ break;
3035
+ }
3036
+
3037
+ exc();
3038
+ return _context.abrupt("return");
3039
+
3040
+ case 3:
3041
+ if (!(self._loadingData === 'Start')) {
3042
+ _context.next = 5;
3043
+ break;
3044
+ }
3045
+
3046
+ return _context.abrupt("return");
3047
+
3048
+ case 5:
3049
+ // NO_START
3050
+ self._loadingData = 'Start';
3051
+ _context.next = 8;
3052
+ return self._handleData();
3053
+
3054
+ case 8:
3055
+ // console.log('######');
3056
+ exc();
3057
+
3058
+ case 9:
3059
+ case "end":
3060
+ return _context.stop();
3061
+ }
3062
+ }
3063
+ }, _callee);
3064
+ }));
3065
+
3066
+ return function handleTasks() {
3067
+ return _ref.apply(this, arguments);
3068
+ };
3069
+ }();
3070
+
3071
+ promise = new Promise(function (resolve) {
3072
+ self._taskQueue.push(resolve);
3073
+ });
3074
+ handleTasks();
3075
+ return _context2.abrupt("return", promise);
3076
+
3077
+ case 5:
3078
+ case "end":
3079
+ return _context2.stop();
3080
+ }
3081
+ }
3082
+ }, _callee2);
3083
+ }));
3084
+
3085
+ function ready() {
3086
+ return _ready.apply(this, arguments);
3087
+ }
3088
+
3089
+ return ready;
3090
+ }();
3091
+
3092
+ _proto.t = function t(key, options) {
3093
+ return i18next.t(key, options);
3094
+ };
3095
+
3096
+ _proto.changeLanguage = function changeLanguage(lng) {
3097
+ // return i18next.changeLanguage(lng);
3098
+ // window.localStorage.setItem(localStorage_i18nextLng_key, lng)
3099
+ Cookies.set(localStorage_i18nextLng_key, lng, {
3100
+ expires: 36525,
3101
+ domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, '')
3102
+ });
3103
+ };
3104
+
3105
+ _proto.getAllLanguage = function getAllLanguage() {
3106
+ return allLanguage;
3107
+ };
3108
+
3109
+ _proto.getCurrentLanguage = function getCurrentLanguage() {
3110
+ return self._currentLanguage;
3111
+ };
3112
+
3113
+ _proto._handleData = /*#__PURE__*/function () {
3114
+ var _handleData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
3115
+ var lng, resource, i18nextResources;
3116
+ return runtime_1.wrap(function _callee3$(_context3) {
3117
+ while (1) {
3118
+ switch (_context3.prev = _context3.next) {
3119
+ case 0:
3120
+ lng = self._currentLanguage;
3121
+ resource = window.localStorage.getItem(localStorage_i18nextResources_key); // const resource: string | undefined = Cookies.get(decodeURIComponent(localStorage_i18nextResources_key));
3122
+
3123
+ i18nextResources = resource ? JSON.parse(resource) : null;
3124
+
3125
+ if (i18nextResources) {
3126
+ _context3.next = 9;
3127
+ break;
3128
+ }
3129
+
3130
+ _context3.next = 6;
3131
+ return self._fetchData();
3132
+
3133
+ case 6:
3134
+ i18nextResources = _context3.sent;
3135
+ _context3.next = 10;
3136
+ break;
3137
+
3138
+ case 9:
3139
+ self._fetchData();
3140
+
3141
+ case 10:
3142
+ _context3.next = 12;
3143
+ return i18next.init({
3144
+ // the translations
3145
+ // (tip move them in a JSON file and import them,
3146
+ // or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)
3147
+ resources: i18nextResources,
3148
+ lng: lng,
3149
+ fallbackLng: 'zh_CN',
3150
+ interpolation: {
3151
+ escapeValue: false
3152
+ }
3153
+ });
3154
+
3155
+ case 12:
3156
+ case "end":
3157
+ return _context3.stop();
3158
+ }
3159
+ }
3160
+ }, _callee3);
3161
+ }));
3162
+
3163
+ function _handleData() {
3164
+ return _handleData2.apply(this, arguments);
3165
+ }
3166
+
3167
+ return _handleData;
3168
+ }();
3169
+
3170
+ _proto._fetchData = /*#__PURE__*/function () {
3171
+ var _fetchData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
3172
+ var res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3173
+
3174
+ return runtime_1.wrap(function _callee4$(_context4) {
3175
+ while (1) {
3176
+ switch (_context4.prev = _context4.next) {
3177
+ case 0:
3178
+ _context4.next = 2;
3179
+ return axios.get(ossJsonUrl, {
3180
+ withCredentials: false
3181
+ });
3182
+
3183
+ case 2:
3184
+ res = _context4.sent;
3185
+ // console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
3186
+ en_US = {};
3187
+ zh_CN = {};
3188
+
3189
+ for (_i = 0, _Object$entries = Object.entries(res); _i < _Object$entries.length; _i++) {
3190
+ _Object$entries$_i = _Object$entries[_i], key = _Object$entries$_i[0], value = _Object$entries$_i[1];
3191
+ // console.log(key, value, 'key, value90iowsldfjlsdkj');
3192
+ en_US[key] = value['en_US'];
3193
+ zh_CN[key] = value['zh_CN'];
3194
+ }
3195
+
3196
+ result = {
3197
+ en_US: {
3198
+ translation: en_US
3199
+ },
3200
+ zh_CN: {
3201
+ translation: zh_CN
3202
+ }
3203
+ }; // console.log(result, 'result093sdolkfjlsdkjl');
3204
+
3205
+ window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result)); // Cookies.set(localStorage_i18nextResources_key, encodeURIComponent(JSON.stringify(result)), {
3206
+ // expires: 36525,
3207
+ // domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, ''),
3208
+ // });
3209
+
3210
+ return _context4.abrupt("return", result);
3211
+
3212
+ case 9:
3213
+ case "end":
3214
+ return _context4.stop();
3215
+ }
3216
+ }
3217
+ }, _callee4);
3218
+ }));
3219
+
3220
+ function _fetchData() {
3221
+ return _fetchData2.apply(this, arguments);
3222
+ }
3223
+
3224
+ return _fetchData;
3225
+ }();
3226
+
3227
+ return I18nNext;
3228
+ }();
3229
+
3230
+ var FI18n = {
3231
+ i18nNext: /*#__PURE__*/new I18nNext()
3232
+ };
3233
+
3234
+ export { FI18n, FServiceAPI, FUtil };
2536
3235
  //# sourceMappingURL=tools-lib.esm.js.map