@x-edu/service 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/service.mjs CHANGED
@@ -459,7 +459,7 @@ function commonjsRequire(path) {
459
459
  var cryptoJs = { exports: {} };
460
460
  var core = { exports: {} };
461
461
  (function(module, exports) {
462
- (function(root, factory) {
462
+ (function(root2, factory) {
463
463
  {
464
464
  module.exports = factory();
465
465
  }
@@ -707,7 +707,7 @@ var core = { exports: {} };
707
707
  })(core);
708
708
  var x64Core = { exports: {} };
709
709
  (function(module, exports) {
710
- (function(root, factory) {
710
+ (function(root2, factory) {
711
711
  {
712
712
  module.exports = factory(core.exports);
713
713
  }
@@ -754,7 +754,7 @@ var x64Core = { exports: {} };
754
754
  })(x64Core);
755
755
  var libTypedarrays = { exports: {} };
756
756
  (function(module, exports) {
757
- (function(root, factory) {
757
+ (function(root2, factory) {
758
758
  {
759
759
  module.exports = factory(core.exports);
760
760
  }
@@ -792,7 +792,7 @@ var libTypedarrays = { exports: {} };
792
792
  })(libTypedarrays);
793
793
  var encUtf16 = { exports: {} };
794
794
  (function(module, exports) {
795
- (function(root, factory) {
795
+ (function(root2, factory) {
796
796
  {
797
797
  module.exports = factory(core.exports);
798
798
  }
@@ -845,7 +845,7 @@ var encUtf16 = { exports: {} };
845
845
  })(encUtf16);
846
846
  var encBase64 = { exports: {} };
847
847
  (function(module, exports) {
848
- (function(root, factory) {
848
+ (function(root2, factory) {
849
849
  {
850
850
  module.exports = factory(core.exports);
851
851
  }
@@ -917,7 +917,7 @@ var encBase64 = { exports: {} };
917
917
  var Base64$1 = encBase64.exports;
918
918
  var encBase64url = { exports: {} };
919
919
  (function(module, exports) {
920
- (function(root, factory) {
920
+ (function(root2, factory) {
921
921
  {
922
922
  module.exports = factory(core.exports);
923
923
  }
@@ -988,7 +988,7 @@ var encBase64url = { exports: {} };
988
988
  })(encBase64url);
989
989
  var md5 = { exports: {} };
990
990
  (function(module, exports) {
991
- (function(root, factory) {
991
+ (function(root2, factory) {
992
992
  {
993
993
  module.exports = factory(core.exports);
994
994
  }
@@ -1150,7 +1150,7 @@ var md5 = { exports: {} };
1150
1150
  })(md5);
1151
1151
  var sha1 = { exports: {} };
1152
1152
  (function(module, exports) {
1153
- (function(root, factory) {
1153
+ (function(root2, factory) {
1154
1154
  {
1155
1155
  module.exports = factory(core.exports);
1156
1156
  }
@@ -1221,9 +1221,9 @@ var sha1 = { exports: {} };
1221
1221
  return CryptoJS2.SHA1;
1222
1222
  });
1223
1223
  })(sha1);
1224
- var sha256 = { exports: {} };
1224
+ var sha256$1 = { exports: {} };
1225
1225
  (function(module, exports) {
1226
- (function(root, factory) {
1226
+ (function(root2, factory) {
1227
1227
  {
1228
1228
  module.exports = factory(core.exports);
1229
1229
  }
@@ -1329,12 +1329,12 @@ var sha256 = { exports: {} };
1329
1329
  })(Math);
1330
1330
  return CryptoJS2.SHA256;
1331
1331
  });
1332
- })(sha256);
1332
+ })(sha256$1);
1333
1333
  var sha224 = { exports: {} };
1334
1334
  (function(module, exports) {
1335
- (function(root, factory, undef) {
1335
+ (function(root2, factory, undef) {
1336
1336
  {
1337
- module.exports = factory(core.exports, sha256.exports);
1337
+ module.exports = factory(core.exports, sha256$1.exports);
1338
1338
  }
1339
1339
  })(commonjsGlobal$1, function(CryptoJS2) {
1340
1340
  (function() {
@@ -1358,7 +1358,7 @@ var sha224 = { exports: {} };
1358
1358
  })(sha224);
1359
1359
  var sha512 = { exports: {} };
1360
1360
  (function(module, exports) {
1361
- (function(root, factory, undef) {
1361
+ (function(root2, factory, undef) {
1362
1362
  {
1363
1363
  module.exports = factory(core.exports, x64Core.exports);
1364
1364
  }
@@ -1537,7 +1537,7 @@ var sha512 = { exports: {} };
1537
1537
  })(sha512);
1538
1538
  var sha384 = { exports: {} };
1539
1539
  (function(module, exports) {
1540
- (function(root, factory, undef) {
1540
+ (function(root2, factory, undef) {
1541
1541
  {
1542
1542
  module.exports = factory(core.exports, x64Core.exports, sha512.exports);
1543
1543
  }
@@ -1564,7 +1564,7 @@ var sha384 = { exports: {} };
1564
1564
  })(sha384);
1565
1565
  var sha3 = { exports: {} };
1566
1566
  (function(module, exports) {
1567
- (function(root, factory, undef) {
1567
+ (function(root2, factory, undef) {
1568
1568
  {
1569
1569
  module.exports = factory(core.exports, x64Core.exports);
1570
1570
  }
@@ -1743,7 +1743,7 @@ var sha3 = { exports: {} };
1743
1743
  })(sha3);
1744
1744
  var ripemd160 = { exports: {} };
1745
1745
  (function(module, exports) {
1746
- (function(root, factory) {
1746
+ (function(root2, factory) {
1747
1747
  {
1748
1748
  module.exports = factory(core.exports);
1749
1749
  }
@@ -1888,7 +1888,7 @@ var ripemd160 = { exports: {} };
1888
1888
  })(ripemd160);
1889
1889
  var hmac = { exports: {} };
1890
1890
  (function(module, exports) {
1891
- (function(root, factory) {
1891
+ (function(root2, factory) {
1892
1892
  {
1893
1893
  module.exports = factory(core.exports);
1894
1894
  }
@@ -1940,7 +1940,7 @@ var hmac = { exports: {} };
1940
1940
  })(hmac);
1941
1941
  var pbkdf2 = { exports: {} };
1942
1942
  (function(module, exports) {
1943
- (function(root, factory, undef) {
1943
+ (function(root2, factory, undef) {
1944
1944
  {
1945
1945
  module.exports = factory(core.exports, sha1.exports, hmac.exports);
1946
1946
  }
@@ -1993,7 +1993,7 @@ var pbkdf2 = { exports: {} };
1993
1993
  })(pbkdf2);
1994
1994
  var evpkdf = { exports: {} };
1995
1995
  (function(module, exports) {
1996
- (function(root, factory, undef) {
1996
+ (function(root2, factory, undef) {
1997
1997
  {
1998
1998
  module.exports = factory(core.exports, sha1.exports, hmac.exports);
1999
1999
  }
@@ -2039,7 +2039,7 @@ var evpkdf = { exports: {} };
2039
2039
  })(evpkdf);
2040
2040
  var cipherCore = { exports: {} };
2041
2041
  (function(module, exports) {
2042
- (function(root, factory, undef) {
2042
+ (function(root2, factory, undef) {
2043
2043
  {
2044
2044
  module.exports = factory(core.exports, evpkdf.exports);
2045
2045
  }
@@ -2259,7 +2259,7 @@ var cipherCore = { exports: {} };
2259
2259
  })(cipherCore);
2260
2260
  var modeCfb = { exports: {} };
2261
2261
  (function(module, exports) {
2262
- (function(root, factory, undef) {
2262
+ (function(root2, factory, undef) {
2263
2263
  {
2264
2264
  module.exports = factory(core.exports, cipherCore.exports);
2265
2265
  }
@@ -2300,7 +2300,7 @@ var modeCfb = { exports: {} };
2300
2300
  })(modeCfb);
2301
2301
  var modeCtr = { exports: {} };
2302
2302
  (function(module, exports) {
2303
- (function(root, factory, undef) {
2303
+ (function(root2, factory, undef) {
2304
2304
  {
2305
2305
  module.exports = factory(core.exports, cipherCore.exports);
2306
2306
  }
@@ -2331,7 +2331,7 @@ var modeCtr = { exports: {} };
2331
2331
  })(modeCtr);
2332
2332
  var modeCtrGladman = { exports: {} };
2333
2333
  (function(module, exports) {
2334
- (function(root, factory, undef) {
2334
+ (function(root2, factory, undef) {
2335
2335
  {
2336
2336
  module.exports = factory(core.exports, cipherCore.exports);
2337
2337
  }
@@ -2402,7 +2402,7 @@ var modeCtrGladman = { exports: {} };
2402
2402
  })(modeCtrGladman);
2403
2403
  var modeOfb = { exports: {} };
2404
2404
  (function(module, exports) {
2405
- (function(root, factory, undef) {
2405
+ (function(root2, factory, undef) {
2406
2406
  {
2407
2407
  module.exports = factory(core.exports, cipherCore.exports);
2408
2408
  }
@@ -2431,7 +2431,7 @@ var modeOfb = { exports: {} };
2431
2431
  })(modeOfb);
2432
2432
  var modeEcb = { exports: {} };
2433
2433
  (function(module, exports) {
2434
- (function(root, factory, undef) {
2434
+ (function(root2, factory, undef) {
2435
2435
  {
2436
2436
  module.exports = factory(core.exports, cipherCore.exports);
2437
2437
  }
@@ -2451,7 +2451,7 @@ var modeEcb = { exports: {} };
2451
2451
  })(modeEcb);
2452
2452
  var padAnsix923 = { exports: {} };
2453
2453
  (function(module, exports) {
2454
- (function(root, factory, undef) {
2454
+ (function(root2, factory, undef) {
2455
2455
  {
2456
2456
  module.exports = factory(core.exports, cipherCore.exports);
2457
2457
  }
@@ -2473,7 +2473,7 @@ var padAnsix923 = { exports: {} };
2473
2473
  })(padAnsix923);
2474
2474
  var padIso10126 = { exports: {} };
2475
2475
  (function(module, exports) {
2476
- (function(root, factory, undef) {
2476
+ (function(root2, factory, undef) {
2477
2477
  {
2478
2478
  module.exports = factory(core.exports, cipherCore.exports);
2479
2479
  }
@@ -2491,7 +2491,7 @@ var padIso10126 = { exports: {} };
2491
2491
  })(padIso10126);
2492
2492
  var padIso97971 = { exports: {} };
2493
2493
  (function(module, exports) {
2494
- (function(root, factory, undef) {
2494
+ (function(root2, factory, undef) {
2495
2495
  {
2496
2496
  module.exports = factory(core.exports, cipherCore.exports);
2497
2497
  }
@@ -2508,7 +2508,7 @@ var padIso97971 = { exports: {} };
2508
2508
  })(padIso97971);
2509
2509
  var padZeropadding = { exports: {} };
2510
2510
  (function(module, exports) {
2511
- (function(root, factory, undef) {
2511
+ (function(root2, factory, undef) {
2512
2512
  {
2513
2513
  module.exports = factory(core.exports, cipherCore.exports);
2514
2514
  }
@@ -2532,7 +2532,7 @@ var padZeropadding = { exports: {} };
2532
2532
  })(padZeropadding);
2533
2533
  var padNopadding = { exports: {} };
2534
2534
  (function(module, exports) {
2535
- (function(root, factory, undef) {
2535
+ (function(root2, factory, undef) {
2536
2536
  {
2537
2537
  module.exports = factory(core.exports, cipherCore.exports);
2538
2538
  }
@@ -2545,7 +2545,7 @@ var padNopadding = { exports: {} };
2545
2545
  })(padNopadding);
2546
2546
  var formatHex = { exports: {} };
2547
2547
  (function(module, exports) {
2548
- (function(root, factory, undef) {
2548
+ (function(root2, factory, undef) {
2549
2549
  {
2550
2550
  module.exports = factory(core.exports, cipherCore.exports);
2551
2551
  }
@@ -2569,7 +2569,7 @@ var formatHex = { exports: {} };
2569
2569
  })(formatHex);
2570
2570
  var aes = { exports: {} };
2571
2571
  (function(module, exports) {
2572
- (function(root, factory, undef) {
2572
+ (function(root2, factory, undef) {
2573
2573
  {
2574
2574
  module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2575
2575
  }
@@ -2711,7 +2711,7 @@ var aes = { exports: {} };
2711
2711
  var AES = aes.exports;
2712
2712
  var tripledes = { exports: {} };
2713
2713
  (function(module, exports) {
2714
- (function(root, factory, undef) {
2714
+ (function(root2, factory, undef) {
2715
2715
  {
2716
2716
  module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2717
2717
  }
@@ -2826,7 +2826,7 @@ var tripledes = { exports: {} };
2826
2826
  })(tripledes);
2827
2827
  var rc4 = { exports: {} };
2828
2828
  (function(module, exports) {
2829
- (function(root, factory, undef) {
2829
+ (function(root2, factory, undef) {
2830
2830
  {
2831
2831
  module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2832
2832
  }
@@ -2887,7 +2887,7 @@ var rc4 = { exports: {} };
2887
2887
  })(rc4);
2888
2888
  var rabbit = { exports: {} };
2889
2889
  (function(module, exports) {
2890
- (function(root, factory, undef) {
2890
+ (function(root2, factory, undef) {
2891
2891
  {
2892
2892
  module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2893
2893
  }
@@ -2986,7 +2986,7 @@ var rabbit = { exports: {} };
2986
2986
  })(rabbit);
2987
2987
  var rabbitLegacy = { exports: {} };
2988
2988
  (function(module, exports) {
2989
- (function(root, factory, undef) {
2989
+ (function(root2, factory, undef) {
2990
2990
  {
2991
2991
  module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2992
2992
  }
@@ -3081,9 +3081,9 @@ var rabbitLegacy = { exports: {} };
3081
3081
  });
3082
3082
  })(rabbitLegacy);
3083
3083
  (function(module, exports) {
3084
- (function(root, factory, undef) {
3084
+ (function(root2, factory, undef) {
3085
3085
  {
3086
- module.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
3086
+ module.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256$1.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
3087
3087
  }
3088
3088
  })(commonjsGlobal$1, function(CryptoJS2) {
3089
3089
  return CryptoJS2;
@@ -5545,15 +5545,15 @@ var decoder$1;
5545
5545
  var Hex = { decode: function(a2) {
5546
5546
  var i;
5547
5547
  if (decoder$1 === void 0) {
5548
- var hex = "0123456789ABCDEF";
5548
+ var hex2 = "0123456789ABCDEF";
5549
5549
  var ignore = " \f\n\r  \u2028\u2029";
5550
5550
  decoder$1 = {};
5551
5551
  for (i = 0; i < 16; ++i) {
5552
- decoder$1[hex.charAt(i)] = i;
5552
+ decoder$1[hex2.charAt(i)] = i;
5553
5553
  }
5554
- hex = hex.toLowerCase();
5554
+ hex2 = hex2.toLowerCase();
5555
5555
  for (i = 10; i < 16; ++i) {
5556
- decoder$1[hex.charAt(i)] = i;
5556
+ decoder$1[hex2.charAt(i)] = i;
5557
5557
  }
5558
5558
  for (i = 0; i < ignore.length; ++i) {
5559
5559
  decoder$1[ignore.charAt(i)] = -1;
@@ -8260,15 +8260,15 @@ KJUR.asn1.ASN1Util = new function() {
8260
8260
  return asn1Obj.getEncodedHex();
8261
8261
  };
8262
8262
  }();
8263
- KJUR.asn1.ASN1Util.oidHexToInt = function(hex) {
8263
+ KJUR.asn1.ASN1Util.oidHexToInt = function(hex2) {
8264
8264
  var s = "";
8265
- var i01 = parseInt(hex.substr(0, 2), 16);
8265
+ var i01 = parseInt(hex2.substr(0, 2), 16);
8266
8266
  var i0 = Math.floor(i01 / 40);
8267
8267
  var i1 = i01 % 40;
8268
8268
  var s = i0 + "." + i1;
8269
8269
  var binbuf = "";
8270
- for (var i = 2; i < hex.length; i += 2) {
8271
- var value = parseInt(hex.substr(i, 2), 16);
8270
+ for (var i = 2; i < hex2.length; i += 2) {
8271
+ var value = parseInt(hex2.substr(i, 2), 16);
8272
8272
  var bin = ("00000000" + value.toString(2)).slice(-8);
8273
8273
  binbuf = binbuf + bin.substr(1, 7);
8274
8274
  if (bin.substr(0, 1) == "0") {
@@ -11483,7 +11483,7 @@ const typeOfTest$1 = (type) => (thing) => typeof thing === type;
11483
11483
  const { isArray: isArray$1 } = Array;
11484
11484
  const isUndefined$1 = typeOfTest$1("undefined");
11485
11485
  function isBuffer$1(val) {
11486
- return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11486
+ return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$4(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11487
11487
  }
11488
11488
  const isArrayBuffer$1 = kindOfTest$1("ArrayBuffer");
11489
11489
  function isArrayBufferView$1(val) {
@@ -11496,9 +11496,9 @@ function isArrayBufferView$1(val) {
11496
11496
  return result;
11497
11497
  }
11498
11498
  const isString$1 = typeOfTest$1("string");
11499
- const isFunction$2 = typeOfTest$1("function");
11499
+ const isFunction$4 = typeOfTest$1("function");
11500
11500
  const isNumber$1 = typeOfTest$1("number");
11501
- const isObject$1 = (thing) => thing !== null && typeof thing === "object";
11501
+ const isObject$4 = (thing) => thing !== null && typeof thing === "object";
11502
11502
  const isBoolean$1 = (thing) => thing === true || thing === false;
11503
11503
  const isPlainObject$1 = (val) => {
11504
11504
  if (kindOf$1(val) !== "object") {
@@ -11511,10 +11511,10 @@ const isDate$1 = kindOfTest$1("Date");
11511
11511
  const isFile$1 = kindOfTest$1("File");
11512
11512
  const isBlob$1 = kindOfTest$1("Blob");
11513
11513
  const isFileList$1 = kindOfTest$1("FileList");
11514
- const isStream$1 = (val) => isObject$1(val) && isFunction$2(val.pipe);
11514
+ const isStream$1 = (val) => isObject$4(val) && isFunction$4(val.pipe);
11515
11515
  const isFormData$1 = (thing) => {
11516
11516
  let kind;
11517
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$2(thing.append) && ((kind = kindOf$1(thing)) === "formdata" || kind === "object" && isFunction$2(thing.toString) && thing.toString() === "[object FormData]"));
11517
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$4(thing.append) && ((kind = kindOf$1(thing)) === "formdata" || kind === "object" && isFunction$4(thing.toString) && thing.toString() === "[object FormData]"));
11518
11518
  };
11519
11519
  const isURLSearchParams$1 = kindOfTest$1("URLSearchParams");
11520
11520
  const trim$1 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
@@ -11582,7 +11582,7 @@ function merge$1() {
11582
11582
  }
11583
11583
  const extend$1 = (a2, b, thisArg, { allOwnKeys } = {}) => {
11584
11584
  forEach$1(b, (val, key) => {
11585
- if (thisArg && isFunction$2(val)) {
11585
+ if (thisArg && isFunction$4(val)) {
11586
11586
  a2[key] = bind$1(val, thisArg);
11587
11587
  } else {
11588
11588
  a2[key] = val;
@@ -11669,7 +11669,7 @@ const isHTMLForm$1 = kindOfTest$1("HTMLFormElement");
11669
11669
  const toCamelCase$1 = (str) => str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
11670
11670
  return p1.toUpperCase() + p2;
11671
11671
  });
11672
- const hasOwnProperty$1 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11672
+ const hasOwnProperty$5 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11673
11673
  const isRegExp$1 = kindOfTest$1("RegExp");
11674
11674
  const reduceDescriptors$1 = (obj, reducer) => {
11675
11675
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
@@ -11683,11 +11683,11 @@ const reduceDescriptors$1 = (obj, reducer) => {
11683
11683
  };
11684
11684
  const freezeMethods$1 = (obj) => {
11685
11685
  reduceDescriptors$1(obj, (descriptor, name) => {
11686
- if (isFunction$2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11686
+ if (isFunction$4(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11687
11687
  return false;
11688
11688
  }
11689
11689
  const value = obj[name];
11690
- if (!isFunction$2(value))
11690
+ if (!isFunction$4(value))
11691
11691
  return;
11692
11692
  descriptor.enumerable = false;
11693
11693
  if ("writable" in descriptor) {
@@ -11729,12 +11729,12 @@ const generateString$1 = (size = 16, alphabet = ALPHABET$1.ALPHA_DIGIT) => {
11729
11729
  return str;
11730
11730
  };
11731
11731
  function isSpecCompliantForm$1(thing) {
11732
- return !!(thing && isFunction$2(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
11732
+ return !!(thing && isFunction$4(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
11733
11733
  }
11734
11734
  const toJSONObject$1 = (obj) => {
11735
11735
  const stack = new Array(10);
11736
11736
  const visit = (source, i) => {
11737
- if (isObject$1(source)) {
11737
+ if (isObject$4(source)) {
11738
11738
  if (stack.indexOf(source) >= 0) {
11739
11739
  return;
11740
11740
  }
@@ -11754,8 +11754,8 @@ const toJSONObject$1 = (obj) => {
11754
11754
  return visit(obj, 0);
11755
11755
  };
11756
11756
  const isAsyncFn$1 = kindOfTest$1("AsyncFunction");
11757
- const isThenable$1 = (thing) => thing && (isObject$1(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch);
11758
- var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$1, isPlainObject: isPlainObject$1, isUndefined: isUndefined$1, isDate: isDate$1, isFile: isFile$1, isBlob: isBlob$1, isRegExp: isRegExp$1, isFunction: isFunction$2, isStream: isStream$1, isURLSearchParams: isURLSearchParams$1, isTypedArray: isTypedArray$1, isFileList: isFileList$1, forEach: forEach$1, merge: merge$1, extend: extend$1, trim: trim$1, stripBOM: stripBOM$1, inherits: inherits$1, toFlatObject: toFlatObject$1, kindOf: kindOf$1, kindOfTest: kindOfTest$1, endsWith: endsWith$1, toArray: toArray$1, forEachEntry: forEachEntry$1, matchAll: matchAll$1, isHTMLForm: isHTMLForm$1, hasOwnProperty: hasOwnProperty$1, hasOwnProp: hasOwnProperty$1, reduceDescriptors: reduceDescriptors$1, freezeMethods: freezeMethods$1, toObjectSet: toObjectSet$1, toCamelCase: toCamelCase$1, noop: noop$1, toFiniteNumber: toFiniteNumber$1, findKey: findKey$1, global: _global$1, isContextDefined: isContextDefined$1, ALPHABET: ALPHABET$1, generateString: generateString$1, isSpecCompliantForm: isSpecCompliantForm$1, toJSONObject: toJSONObject$1, isAsyncFn: isAsyncFn$1, isThenable: isThenable$1 };
11757
+ const isThenable$1 = (thing) => thing && (isObject$4(thing) || isFunction$4(thing)) && isFunction$4(thing.then) && isFunction$4(thing.catch);
11758
+ var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$4, isPlainObject: isPlainObject$1, isUndefined: isUndefined$1, isDate: isDate$1, isFile: isFile$1, isBlob: isBlob$1, isRegExp: isRegExp$1, isFunction: isFunction$4, isStream: isStream$1, isURLSearchParams: isURLSearchParams$1, isTypedArray: isTypedArray$1, isFileList: isFileList$1, forEach: forEach$1, merge: merge$1, extend: extend$1, trim: trim$1, stripBOM: stripBOM$1, inherits: inherits$1, toFlatObject: toFlatObject$1, kindOf: kindOf$1, kindOfTest: kindOfTest$1, endsWith: endsWith$1, toArray: toArray$1, forEachEntry: forEachEntry$1, matchAll: matchAll$1, isHTMLForm: isHTMLForm$1, hasOwnProperty: hasOwnProperty$5, hasOwnProp: hasOwnProperty$5, reduceDescriptors: reduceDescriptors$1, freezeMethods: freezeMethods$1, toObjectSet: toObjectSet$1, toCamelCase: toCamelCase$1, noop: noop$1, toFiniteNumber: toFiniteNumber$1, findKey: findKey$1, global: _global$1, isContextDefined: isContextDefined$1, ALPHABET: ALPHABET$1, generateString: generateString$1, isSpecCompliantForm: isSpecCompliantForm$1, toJSONObject: toJSONObject$1, isAsyncFn: isAsyncFn$1, isThenable: isThenable$1 };
11759
11759
  function AxiosError$1(message, code, config2, request, response) {
11760
11760
  Error.call(this);
11761
11761
  if (Error.captureStackTrace) {
@@ -13227,7 +13227,7 @@ const typeOfTest = (type) => (thing) => typeof thing === type;
13227
13227
  const { isArray } = Array;
13228
13228
  const isUndefined = typeOfTest("undefined");
13229
13229
  function isBuffer(val) {
13230
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
13230
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$3(val.constructor.isBuffer) && val.constructor.isBuffer(val);
13231
13231
  }
13232
13232
  const isArrayBuffer = kindOfTest("ArrayBuffer");
13233
13233
  function isArrayBufferView(val) {
@@ -13240,9 +13240,9 @@ function isArrayBufferView(val) {
13240
13240
  return result;
13241
13241
  }
13242
13242
  const isString = typeOfTest("string");
13243
- const isFunction$1 = typeOfTest("function");
13243
+ const isFunction$3 = typeOfTest("function");
13244
13244
  const isNumber = typeOfTest("number");
13245
- const isObject = (thing) => thing !== null && typeof thing === "object";
13245
+ const isObject$3 = (thing) => thing !== null && typeof thing === "object";
13246
13246
  const isBoolean = (thing) => thing === true || thing === false;
13247
13247
  const isPlainObject = (val) => {
13248
13248
  if (kindOf(val) !== "object") {
@@ -13255,11 +13255,11 @@ const isDate = kindOfTest("Date");
13255
13255
  const isFile = kindOfTest("File");
13256
13256
  const isBlob = kindOfTest("Blob");
13257
13257
  const isFileList = kindOfTest("FileList");
13258
- const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
13258
+ const isStream = (val) => isObject$3(val) && isFunction$3(val.pipe);
13259
13259
  const isFormData = (thing) => {
13260
13260
  let kind;
13261
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
13262
- kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
13261
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$3(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
13262
+ kind === "object" && isFunction$3(thing.toString) && thing.toString() === "[object FormData]"));
13263
13263
  };
13264
13264
  const isURLSearchParams = kindOfTest("URLSearchParams");
13265
13265
  const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
@@ -13328,7 +13328,7 @@ function merge() {
13328
13328
  }
13329
13329
  const extend = (a2, b, thisArg, { allOwnKeys } = {}) => {
13330
13330
  forEach(b, (val, key) => {
13331
- if (thisArg && isFunction$1(val)) {
13331
+ if (thisArg && isFunction$3(val)) {
13332
13332
  a2[key] = bind(val, thisArg);
13333
13333
  } else {
13334
13334
  a2[key] = val;
@@ -13426,7 +13426,7 @@ const toCamelCase = (str) => {
13426
13426
  }
13427
13427
  );
13428
13428
  };
13429
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
13429
+ const hasOwnProperty$4 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
13430
13430
  const isRegExp = kindOfTest("RegExp");
13431
13431
  const reduceDescriptors = (obj, reducer) => {
13432
13432
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
@@ -13441,11 +13441,11 @@ const reduceDescriptors = (obj, reducer) => {
13441
13441
  };
13442
13442
  const freezeMethods = (obj) => {
13443
13443
  reduceDescriptors(obj, (descriptor, name) => {
13444
- if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
13444
+ if (isFunction$3(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
13445
13445
  return false;
13446
13446
  }
13447
13447
  const value = obj[name];
13448
- if (!isFunction$1(value))
13448
+ if (!isFunction$3(value))
13449
13449
  return;
13450
13450
  descriptor.enumerable = false;
13451
13451
  if ("writable" in descriptor) {
@@ -13490,12 +13490,12 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
13490
13490
  return str;
13491
13491
  };
13492
13492
  function isSpecCompliantForm(thing) {
13493
- return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
13493
+ return !!(thing && isFunction$3(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
13494
13494
  }
13495
13495
  const toJSONObject = (obj) => {
13496
13496
  const stack = new Array(10);
13497
13497
  const visit = (source, i) => {
13498
- if (isObject(source)) {
13498
+ if (isObject$3(source)) {
13499
13499
  if (stack.indexOf(source) >= 0) {
13500
13500
  return;
13501
13501
  }
@@ -13515,7 +13515,7 @@ const toJSONObject = (obj) => {
13515
13515
  return visit(obj, 0);
13516
13516
  };
13517
13517
  const isAsyncFn = kindOfTest("AsyncFunction");
13518
- const isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
13518
+ const isThenable = (thing) => thing && (isObject$3(thing) || isFunction$3(thing)) && isFunction$3(thing.then) && isFunction$3(thing.catch);
13519
13519
  var utils$1 = {
13520
13520
  isArray,
13521
13521
  isArrayBuffer,
@@ -13525,7 +13525,7 @@ var utils$1 = {
13525
13525
  isString,
13526
13526
  isNumber,
13527
13527
  isBoolean,
13528
- isObject,
13528
+ isObject: isObject$3,
13529
13529
  isPlainObject,
13530
13530
  isReadableStream,
13531
13531
  isRequest,
@@ -13536,7 +13536,7 @@ var utils$1 = {
13536
13536
  isFile,
13537
13537
  isBlob,
13538
13538
  isRegExp,
13539
- isFunction: isFunction$1,
13539
+ isFunction: isFunction$3,
13540
13540
  isStream,
13541
13541
  isURLSearchParams,
13542
13542
  isTypedArray,
@@ -13555,8 +13555,8 @@ var utils$1 = {
13555
13555
  forEachEntry,
13556
13556
  matchAll,
13557
13557
  isHTMLForm,
13558
- hasOwnProperty,
13559
- hasOwnProp: hasOwnProperty,
13558
+ hasOwnProperty: hasOwnProperty$4,
13559
+ hasOwnProp: hasOwnProperty$4,
13560
13560
  // an alias to avoid ESLint no-prototype-builtins detection
13561
13561
  reduceDescriptors,
13562
13562
  freezeMethods,
@@ -17122,7 +17122,7 @@ axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new For
17122
17122
  axios.getAdapter = adapters.getAdapter;
17123
17123
  axios.HttpStatusCode = HttpStatusCode;
17124
17124
  axios.default = axios;
17125
- var isFunction = function isFunction2(variable) {
17125
+ var isFunction$2 = function isFunction2(variable) {
17126
17126
  return typeof variable === "function";
17127
17127
  };
17128
17128
  var STATUS;
@@ -17161,7 +17161,7 @@ var Request$1 = /* @__PURE__ */ function() {
17161
17161
  var blockRequest = false;
17162
17162
  var blockError = null;
17163
17163
  var handleError = function handleError2(error, c2) {
17164
- if (isFunction(c2.failover)) {
17164
+ if (isFunction$2(c2.failover)) {
17165
17165
  var newConfig = c2.failover(error, c2);
17166
17166
  if (typeof newConfig === "object") {
17167
17167
  return instance.request(_objectSpread2(_objectSpread2({}, newConfig), {}, {
@@ -17169,7 +17169,7 @@ var Request$1 = /* @__PURE__ */ function() {
17169
17169
  }));
17170
17170
  }
17171
17171
  }
17172
- if (isFunction(c2.shouldBlock)) {
17172
+ if (isFunction$2(c2.shouldBlock)) {
17173
17173
  blockRequest = c2.shouldBlock(error);
17174
17174
  blockError = error;
17175
17175
  setTimeout(function() {
@@ -17183,7 +17183,7 @@ var Request$1 = /* @__PURE__ */ function() {
17183
17183
  return instance.request(c2);
17184
17184
  }
17185
17185
  }
17186
- if (isFunction(c2.error)) {
17186
+ if (isFunction$2(c2.error)) {
17187
17187
  c2.error(error, c2);
17188
17188
  }
17189
17189
  return Promise.reject(error);
@@ -17226,7 +17226,7 @@ var Request$1 = /* @__PURE__ */ function() {
17226
17226
  cache[key] = {
17227
17227
  status: STATUS.pending,
17228
17228
  timer: setTimeout(function() {
17229
- if (isFunction(loading)) {
17229
+ if (isFunction$2(loading)) {
17230
17230
  loading(_objectSpread2(_objectSpread2({}, c2), {}, {
17231
17231
  key
17232
17232
  }));
@@ -17297,7 +17297,7 @@ var Request$1 = /* @__PURE__ */ function() {
17297
17297
  }
17298
17298
  }
17299
17299
  }
17300
- if (isFunction(_config.complete)) {
17300
+ if (isFunction$2(_config.complete)) {
17301
17301
  _config.complete(c2);
17302
17302
  }
17303
17303
  return response;
@@ -17310,7 +17310,7 @@ var Request$1 = /* @__PURE__ */ function() {
17310
17310
  delete cache[key];
17311
17311
  }
17312
17312
  }
17313
- if (isFunction(_config.complete)) {
17313
+ if (isFunction$2(_config.complete)) {
17314
17314
  _config.complete(error.config);
17315
17315
  }
17316
17316
  return handleError(error, error.config);
@@ -17528,9 +17528,9 @@ function _generatePublicKey() {
17528
17528
  }
17529
17529
  const parseParams = (params) => {
17530
17530
  var _a2;
17531
- const { prefix = "", host, sdpAppId, uc, ...reset } = params;
17531
+ const { prefix = "", host, sdpAppId, uc, noSdpAppId, ...reset } = params;
17532
17532
  const headers = {
17533
- sdpAppId: sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
17533
+ sdpAppId: noSdpAppId ? null : sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
17534
17534
  ...reset || {}
17535
17535
  };
17536
17536
  params.originBaseURL = `${host}${prefix}`;
@@ -17546,7 +17546,8 @@ function getApi({
17546
17546
  prefix,
17547
17547
  params,
17548
17548
  throwError,
17549
- sdpAppId
17549
+ sdpAppId,
17550
+ noSdpAppId
17550
17551
  }) {
17551
17552
  var _a2;
17552
17553
  const _params = parseParams({
@@ -17554,7 +17555,8 @@ function getApi({
17554
17555
  prefix,
17555
17556
  host,
17556
17557
  uc,
17557
- sdpAppId
17558
+ sdpAppId,
17559
+ noSdpAppId
17558
17560
  });
17559
17561
  if (!uc) {
17560
17562
  return rawAPI(_params);
@@ -17566,6 +17568,38 @@ function getApi({
17566
17568
  }, throwError);
17567
17569
  }
17568
17570
  const api = getApi({});
17571
+ function isTestHost() {
17572
+ const testHosts = [
17573
+ "localhost",
17574
+ "x-edu-web.beta.101.com",
17575
+ "test3.ykt.eduyun.cn",
17576
+ "test5.ykt.eduyun.cn",
17577
+ "test6.ykt.eduyun.cn",
17578
+ "test-x-edu-portal4.ykt.eduyun.cn",
17579
+ "web-bd.ykt.eduyun.cn",
17580
+ "xue-test.ykt.eduyun.cn",
17581
+ "teach-test.ykt.eduyun.cn",
17582
+ "teach-test2.ykt.eduyun.cn",
17583
+ "teach-test3.ykt.eduyun.cn",
17584
+ "h5-teach-test.ykt.eduyun.cn",
17585
+ "h5-teach-test2.ykt.eduyun.cn",
17586
+ "test-x-edu-portal3.ykt.eduyun.cn",
17587
+ "museum-test4.ykt.eduyun.cn",
17588
+ "sun.ykt.eduyun.cn",
17589
+ "computer.ykt.eduyun.cn",
17590
+ "zxx-preview.ykt.eduyun.cn"
17591
+ ];
17592
+ if (testHosts.indexOf(window.location.host) > -1 || window.location.host.indexOf("localhost") > -1 || window.location.host.indexOf("192.") > -1) {
17593
+ return true;
17594
+ }
17595
+ return false;
17596
+ }
17597
+ function getValueByHost({ value, defaultValue }) {
17598
+ if (isTestHost()) {
17599
+ return value;
17600
+ }
17601
+ return defaultValue;
17602
+ }
17569
17603
  const config = {
17570
17604
  "ncet-xedu": {
17571
17605
  // 代理
@@ -17582,7 +17616,28 @@ const config = {
17582
17616
  // 收藏
17583
17617
  "e-favorite-api": "//e-favorite-api.ykt.eduyun.cn",
17584
17618
  // 学习记录
17585
- "x-study-record": "//x-study-record-api.ykt.eduyun.cn"
17619
+ "x-study-record": "//x-study-record-api.ykt.eduyun.cn",
17620
+ cdn: getValueByHost({
17621
+ value: "//pretest-s-file-1.ykt.cbern.com.cn",
17622
+ defaultValue: "//s-file-1.ykt.cbern.com.cn"
17623
+ }),
17624
+ "cdn-s-file": getValueByHost({
17625
+ value: "//pretest-s-file-1.ykt.cbern.com.cn",
17626
+ defaultValue: "//s-file-1.ykt.cbern.com.cn"
17627
+ }),
17628
+ "cdn-bdcs-file": "//bdcs-file-1.ykt.cbern.com.cn",
17629
+ // 站点配置(存在灰度能力)
17630
+ "site-config": "//grey-config-web.ykt.cbern.com.cn",
17631
+ serviceName: {
17632
+ site: "bdxcloud",
17633
+ zxxRegion: "zxx_region",
17634
+ train: "teach",
17635
+ "t-course": "teach",
17636
+ eLabour: "ldjy"
17637
+ },
17638
+ defaultAreaSite: "hn",
17639
+ // 内容库
17640
+ "elearning-library": "//elearning-library-gateway.ykt.eduyun.cn"
17586
17641
  },
17587
17642
  preproduction: {
17588
17643
  // 代理
@@ -17595,7 +17650,20 @@ const config = {
17595
17650
  "cs-feedback": "//betacs.101.com",
17596
17651
  "e-favorite-api": "//e-favorite-api.beta.101.com",
17597
17652
  // 学习记录
17598
- "x-study-record": "//x-study-record-api.beta.101.com"
17653
+ "x-study-record": "//x-study-record-api.beta.101.com",
17654
+ cdn: "//ndcs-pre.101.com",
17655
+ // 站点配置(存在灰度能力)
17656
+ "site-config": "//grey-config-web.ykt.cbern.com.cn",
17657
+ serviceName: {
17658
+ site: "preproduction_content_x_cloud",
17659
+ zxxRegion: "preproduction_content_zxx_region",
17660
+ train: "preproduction_content_staticize",
17661
+ "t-course": "preproduction_content_x_course",
17662
+ eLabour: "preproduction_content_zxx"
17663
+ },
17664
+ defaultAreaSite: "hn",
17665
+ // 内容库
17666
+ "elearning-library": "//elearning-library-gateway.beta.101.com"
17599
17667
  }
17600
17668
  };
17601
17669
  const recommendAPIV2 = ({
@@ -17714,6 +17782,46 @@ const xStudyRecordAPI = ({
17714
17782
  uc
17715
17783
  });
17716
17784
  };
17785
+ const cdnAPI = ({
17786
+ env
17787
+ }) => getApi({
17788
+ host: config[env]["cdn"],
17789
+ prefix: "",
17790
+ noSdpAppId: true
17791
+ });
17792
+ const cdnSFileAPI = ({
17793
+ env
17794
+ }) => getApi({
17795
+ host: config[env]["cdn-s-file"],
17796
+ prefix: "",
17797
+ noSdpAppId: true
17798
+ });
17799
+ const cdnBdcsFileAPI = ({
17800
+ env
17801
+ }) => getApi({
17802
+ host: config[env]["cdn-bdcs-file"],
17803
+ prefix: "",
17804
+ noSdpAppId: true
17805
+ });
17806
+ const siteConfigAPI = ({
17807
+ uc,
17808
+ env
17809
+ }) => {
17810
+ var _a2;
17811
+ return getApi({
17812
+ host: config[env]["site-config"],
17813
+ prefix: "",
17814
+ sdpAppId: (_a2 = uc.options) == null ? void 0 : _a2.sdpAppId
17815
+ });
17816
+ };
17817
+ const eLearningLibraryAPI = ({
17818
+ uc,
17819
+ env
17820
+ }) => getApi({
17821
+ host: config[env]["elearning-library"],
17822
+ prefix: "",
17823
+ uc
17824
+ });
17717
17825
  async function getStatByChunk(resIds, requestFn, ...args) {
17718
17826
  try {
17719
17827
  const chunkSize = 100;
@@ -18434,6 +18542,740 @@ class StudyRecord {
18434
18542
  this.request = request;
18435
18543
  }
18436
18544
  }
18545
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
18546
+ var _freeGlobal = freeGlobal$1;
18547
+ var freeGlobal = _freeGlobal;
18548
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
18549
+ var root$3 = freeGlobal || freeSelf || Function("return this")();
18550
+ var _root = root$3;
18551
+ var root$2 = _root;
18552
+ var Symbol$3 = root$2.Symbol;
18553
+ var _Symbol = Symbol$3;
18554
+ var Symbol$2 = _Symbol;
18555
+ var objectProto$4 = Object.prototype;
18556
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
18557
+ var nativeObjectToString$1 = objectProto$4.toString;
18558
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
18559
+ function getRawTag$1(value) {
18560
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
18561
+ try {
18562
+ value[symToStringTag$1] = void 0;
18563
+ var unmasked = true;
18564
+ } catch (e2) {
18565
+ }
18566
+ var result = nativeObjectToString$1.call(value);
18567
+ if (unmasked) {
18568
+ if (isOwn) {
18569
+ value[symToStringTag$1] = tag;
18570
+ } else {
18571
+ delete value[symToStringTag$1];
18572
+ }
18573
+ }
18574
+ return result;
18575
+ }
18576
+ var _getRawTag = getRawTag$1;
18577
+ var objectProto$3 = Object.prototype;
18578
+ var nativeObjectToString = objectProto$3.toString;
18579
+ function objectToString$1(value) {
18580
+ return nativeObjectToString.call(value);
18581
+ }
18582
+ var _objectToString = objectToString$1;
18583
+ var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
18584
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
18585
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
18586
+ function baseGetTag$1(value) {
18587
+ if (value == null) {
18588
+ return value === void 0 ? undefinedTag : nullTag;
18589
+ }
18590
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
18591
+ }
18592
+ var _baseGetTag = baseGetTag$1;
18593
+ function isObject$2(value) {
18594
+ var type = typeof value;
18595
+ return value != null && (type == "object" || type == "function");
18596
+ }
18597
+ var isObject_1 = isObject$2;
18598
+ var baseGetTag = _baseGetTag, isObject$1 = isObject_1;
18599
+ var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
18600
+ function isFunction$1(value) {
18601
+ if (!isObject$1(value)) {
18602
+ return false;
18603
+ }
18604
+ var tag = baseGetTag(value);
18605
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
18606
+ }
18607
+ var isFunction_1 = isFunction$1;
18608
+ var root$1 = _root;
18609
+ var coreJsData$1 = root$1["__core-js_shared__"];
18610
+ var _coreJsData = coreJsData$1;
18611
+ var coreJsData = _coreJsData;
18612
+ var maskSrcKey = function() {
18613
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
18614
+ return uid ? "Symbol(src)_1." + uid : "";
18615
+ }();
18616
+ function isMasked$1(func) {
18617
+ return !!maskSrcKey && maskSrcKey in func;
18618
+ }
18619
+ var _isMasked = isMasked$1;
18620
+ var funcProto$1 = Function.prototype;
18621
+ var funcToString$1 = funcProto$1.toString;
18622
+ function toSource$1(func) {
18623
+ if (func != null) {
18624
+ try {
18625
+ return funcToString$1.call(func);
18626
+ } catch (e2) {
18627
+ }
18628
+ try {
18629
+ return func + "";
18630
+ } catch (e2) {
18631
+ }
18632
+ }
18633
+ return "";
18634
+ }
18635
+ var _toSource = toSource$1;
18636
+ var isFunction = isFunction_1, isMasked = _isMasked, isObject = isObject_1, toSource = _toSource;
18637
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
18638
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
18639
+ var funcProto = Function.prototype, objectProto$2 = Object.prototype;
18640
+ var funcToString = funcProto.toString;
18641
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
18642
+ var reIsNative = RegExp(
18643
+ "^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
18644
+ );
18645
+ function baseIsNative$1(value) {
18646
+ if (!isObject(value) || isMasked(value)) {
18647
+ return false;
18648
+ }
18649
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
18650
+ return pattern.test(toSource(value));
18651
+ }
18652
+ var _baseIsNative = baseIsNative$1;
18653
+ function getValue$1(object, key) {
18654
+ return object == null ? void 0 : object[key];
18655
+ }
18656
+ var _getValue = getValue$1;
18657
+ var baseIsNative = _baseIsNative, getValue = _getValue;
18658
+ function getNative$2(object, key) {
18659
+ var value = getValue(object, key);
18660
+ return baseIsNative(value) ? value : void 0;
18661
+ }
18662
+ var _getNative = getNative$2;
18663
+ var getNative$1 = _getNative;
18664
+ var nativeCreate$4 = getNative$1(Object, "create");
18665
+ var _nativeCreate = nativeCreate$4;
18666
+ var nativeCreate$3 = _nativeCreate;
18667
+ function hashClear$1() {
18668
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
18669
+ this.size = 0;
18670
+ }
18671
+ var _hashClear = hashClear$1;
18672
+ function hashDelete$1(key) {
18673
+ var result = this.has(key) && delete this.__data__[key];
18674
+ this.size -= result ? 1 : 0;
18675
+ return result;
18676
+ }
18677
+ var _hashDelete = hashDelete$1;
18678
+ var nativeCreate$2 = _nativeCreate;
18679
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
18680
+ var objectProto$1 = Object.prototype;
18681
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
18682
+ function hashGet$1(key) {
18683
+ var data = this.__data__;
18684
+ if (nativeCreate$2) {
18685
+ var result = data[key];
18686
+ return result === HASH_UNDEFINED$1 ? void 0 : result;
18687
+ }
18688
+ return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
18689
+ }
18690
+ var _hashGet = hashGet$1;
18691
+ var nativeCreate$1 = _nativeCreate;
18692
+ var objectProto = Object.prototype;
18693
+ var hasOwnProperty = objectProto.hasOwnProperty;
18694
+ function hashHas$1(key) {
18695
+ var data = this.__data__;
18696
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key);
18697
+ }
18698
+ var _hashHas = hashHas$1;
18699
+ var nativeCreate = _nativeCreate;
18700
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
18701
+ function hashSet$1(key, value) {
18702
+ var data = this.__data__;
18703
+ this.size += this.has(key) ? 0 : 1;
18704
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
18705
+ return this;
18706
+ }
18707
+ var _hashSet = hashSet$1;
18708
+ var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
18709
+ function Hash$1(entries) {
18710
+ var index = -1, length = entries == null ? 0 : entries.length;
18711
+ this.clear();
18712
+ while (++index < length) {
18713
+ var entry = entries[index];
18714
+ this.set(entry[0], entry[1]);
18715
+ }
18716
+ }
18717
+ Hash$1.prototype.clear = hashClear;
18718
+ Hash$1.prototype["delete"] = hashDelete;
18719
+ Hash$1.prototype.get = hashGet;
18720
+ Hash$1.prototype.has = hashHas;
18721
+ Hash$1.prototype.set = hashSet;
18722
+ var _Hash = Hash$1;
18723
+ function listCacheClear$1() {
18724
+ this.__data__ = [];
18725
+ this.size = 0;
18726
+ }
18727
+ var _listCacheClear = listCacheClear$1;
18728
+ function eq$1(value, other) {
18729
+ return value === other || value !== value && other !== other;
18730
+ }
18731
+ var eq_1 = eq$1;
18732
+ var eq = eq_1;
18733
+ function assocIndexOf$4(array, key) {
18734
+ var length = array.length;
18735
+ while (length--) {
18736
+ if (eq(array[length][0], key)) {
18737
+ return length;
18738
+ }
18739
+ }
18740
+ return -1;
18741
+ }
18742
+ var _assocIndexOf = assocIndexOf$4;
18743
+ var assocIndexOf$3 = _assocIndexOf;
18744
+ var arrayProto = Array.prototype;
18745
+ var splice = arrayProto.splice;
18746
+ function listCacheDelete$1(key) {
18747
+ var data = this.__data__, index = assocIndexOf$3(data, key);
18748
+ if (index < 0) {
18749
+ return false;
18750
+ }
18751
+ var lastIndex = data.length - 1;
18752
+ if (index == lastIndex) {
18753
+ data.pop();
18754
+ } else {
18755
+ splice.call(data, index, 1);
18756
+ }
18757
+ --this.size;
18758
+ return true;
18759
+ }
18760
+ var _listCacheDelete = listCacheDelete$1;
18761
+ var assocIndexOf$2 = _assocIndexOf;
18762
+ function listCacheGet$1(key) {
18763
+ var data = this.__data__, index = assocIndexOf$2(data, key);
18764
+ return index < 0 ? void 0 : data[index][1];
18765
+ }
18766
+ var _listCacheGet = listCacheGet$1;
18767
+ var assocIndexOf$1 = _assocIndexOf;
18768
+ function listCacheHas$1(key) {
18769
+ return assocIndexOf$1(this.__data__, key) > -1;
18770
+ }
18771
+ var _listCacheHas = listCacheHas$1;
18772
+ var assocIndexOf = _assocIndexOf;
18773
+ function listCacheSet$1(key, value) {
18774
+ var data = this.__data__, index = assocIndexOf(data, key);
18775
+ if (index < 0) {
18776
+ ++this.size;
18777
+ data.push([key, value]);
18778
+ } else {
18779
+ data[index][1] = value;
18780
+ }
18781
+ return this;
18782
+ }
18783
+ var _listCacheSet = listCacheSet$1;
18784
+ var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
18785
+ function ListCache$1(entries) {
18786
+ var index = -1, length = entries == null ? 0 : entries.length;
18787
+ this.clear();
18788
+ while (++index < length) {
18789
+ var entry = entries[index];
18790
+ this.set(entry[0], entry[1]);
18791
+ }
18792
+ }
18793
+ ListCache$1.prototype.clear = listCacheClear;
18794
+ ListCache$1.prototype["delete"] = listCacheDelete;
18795
+ ListCache$1.prototype.get = listCacheGet;
18796
+ ListCache$1.prototype.has = listCacheHas;
18797
+ ListCache$1.prototype.set = listCacheSet;
18798
+ var _ListCache = ListCache$1;
18799
+ var getNative = _getNative, root = _root;
18800
+ var Map$1 = getNative(root, "Map");
18801
+ var _Map = Map$1;
18802
+ var Hash = _Hash, ListCache = _ListCache, Map = _Map;
18803
+ function mapCacheClear$1() {
18804
+ this.size = 0;
18805
+ this.__data__ = {
18806
+ "hash": new Hash(),
18807
+ "map": new (Map || ListCache)(),
18808
+ "string": new Hash()
18809
+ };
18810
+ }
18811
+ var _mapCacheClear = mapCacheClear$1;
18812
+ function isKeyable$1(value) {
18813
+ var type = typeof value;
18814
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
18815
+ }
18816
+ var _isKeyable = isKeyable$1;
18817
+ var isKeyable = _isKeyable;
18818
+ function getMapData$4(map, key) {
18819
+ var data = map.__data__;
18820
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
18821
+ }
18822
+ var _getMapData = getMapData$4;
18823
+ var getMapData$3 = _getMapData;
18824
+ function mapCacheDelete$1(key) {
18825
+ var result = getMapData$3(this, key)["delete"](key);
18826
+ this.size -= result ? 1 : 0;
18827
+ return result;
18828
+ }
18829
+ var _mapCacheDelete = mapCacheDelete$1;
18830
+ var getMapData$2 = _getMapData;
18831
+ function mapCacheGet$1(key) {
18832
+ return getMapData$2(this, key).get(key);
18833
+ }
18834
+ var _mapCacheGet = mapCacheGet$1;
18835
+ var getMapData$1 = _getMapData;
18836
+ function mapCacheHas$1(key) {
18837
+ return getMapData$1(this, key).has(key);
18838
+ }
18839
+ var _mapCacheHas = mapCacheHas$1;
18840
+ var getMapData = _getMapData;
18841
+ function mapCacheSet$1(key, value) {
18842
+ var data = getMapData(this, key), size = data.size;
18843
+ data.set(key, value);
18844
+ this.size += data.size == size ? 0 : 1;
18845
+ return this;
18846
+ }
18847
+ var _mapCacheSet = mapCacheSet$1;
18848
+ var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
18849
+ function MapCache$1(entries) {
18850
+ var index = -1, length = entries == null ? 0 : entries.length;
18851
+ this.clear();
18852
+ while (++index < length) {
18853
+ var entry = entries[index];
18854
+ this.set(entry[0], entry[1]);
18855
+ }
18856
+ }
18857
+ MapCache$1.prototype.clear = mapCacheClear;
18858
+ MapCache$1.prototype["delete"] = mapCacheDelete;
18859
+ MapCache$1.prototype.get = mapCacheGet;
18860
+ MapCache$1.prototype.has = mapCacheHas;
18861
+ MapCache$1.prototype.set = mapCacheSet;
18862
+ var _MapCache = MapCache$1;
18863
+ var MapCache = _MapCache;
18864
+ var FUNC_ERROR_TEXT = "Expected a function";
18865
+ function memoize(func, resolver) {
18866
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
18867
+ throw new TypeError(FUNC_ERROR_TEXT);
18868
+ }
18869
+ var memoized = function() {
18870
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
18871
+ if (cache.has(key)) {
18872
+ return cache.get(key);
18873
+ }
18874
+ var result = func.apply(this, args);
18875
+ memoized.cache = cache.set(key, result) || cache;
18876
+ return result;
18877
+ };
18878
+ memoized.cache = new (memoize.Cache || MapCache)();
18879
+ return memoized;
18880
+ }
18881
+ memoize.Cache = MapCache;
18882
+ var memoize_1 = memoize;
18883
+ const memoize$1 = /* @__PURE__ */ getDefaultExportFromCjs(memoize_1);
18884
+ const serviceName = "teach";
18885
+ class TCourse {
18886
+ constructor(props) {
18887
+ __publicField(this, "request");
18888
+ __publicField(this, "config");
18889
+ __publicField(this, "getCourseRelativeInfo1", memoize$1(
18890
+ async (courseId) => {
18891
+ const { data } = await this.request.cdn.cdnAPI.get(
18892
+ `/${this.config.serviceName["t-course"]}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
18893
+ );
18894
+ const { data: provider } = await this.request.cdn.cdnAPI.get(
18895
+ `/${serviceName}/s_course/v2/business_courses/${courseId}/course_providers.json`
18896
+ );
18897
+ if (data.course_detail && (provider == null ? void 0 : provider.length)) {
18898
+ data.course_detail.ext_info = {
18899
+ ...data.course_detail.ext_info,
18900
+ source: provider.map((item) => item.name).join("/")
18901
+ };
18902
+ }
18903
+ return data;
18904
+ },
18905
+ (courseId) => `CourseRelativeInfo_${courseId}`
18906
+ ));
18907
+ __publicField(this, "getCourseRelativeInfo", async ({
18908
+ courseId,
18909
+ tenantCode
18910
+ }) => {
18911
+ const { data } = await this.request.cdn.cdnAPI.get(`/${tenantCode}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`);
18912
+ return data;
18913
+ });
18914
+ __publicField(this, "getAreaCourseRelativeInfo", memoize$1(
18915
+ async ({ courseId, siteRelaId }) => {
18916
+ const { data } = await this.request.cdn.cdnAPI.get(
18917
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
18918
+ );
18919
+ const { data: provider } = await this.request.cdn.cdnAPI.get(
18920
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_providers.json`
18921
+ );
18922
+ if (data.course_detail && (provider == null ? void 0 : provider.length)) {
18923
+ data.course_detail.ext_info = {
18924
+ ...data.course_detail.ext_info,
18925
+ source: provider.map((item) => item.name).join("/")
18926
+ };
18927
+ }
18928
+ return data;
18929
+ },
18930
+ ({ courseId }) => `Area-CourseRelativeInfo_${courseId}`
18931
+ ));
18932
+ /**
18933
+ * 获取活动集信息, 包括了章节目录信息
18934
+ *
18935
+ * @export
18936
+ * @param {string} activitySetId
18937
+ * @returns 课程的活动集信息, nodes字段中包含活动节点信息
18938
+ */
18939
+ __publicField(this, "getActiveSet", async ({
18940
+ activitySetId,
18941
+ tenantCode
18942
+ }) => {
18943
+ const { data } = await this.request.cdn.cdnAPI.get(
18944
+ `/${tenantCode}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
18945
+ );
18946
+ if (data) {
18947
+ data.activity_set_id = activitySetId;
18948
+ }
18949
+ return data;
18950
+ });
18951
+ __publicField(this, "getAreaActiveSet", async ({ activitySetId, siteRelaId }) => {
18952
+ const { data } = await this.request.cdn.cdnAPI.get(
18953
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
18954
+ );
18955
+ if (data) {
18956
+ data.activity_set_id = activitySetId;
18957
+ }
18958
+ return data;
18959
+ });
18960
+ // 获取视频活动课时
18961
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18962
+ const { data } = await this.request.cdn.cdnAPI.get(
18963
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18964
+ );
18965
+ return data;
18966
+ });
18967
+ // 获取文档活动课时
18968
+ __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
18969
+ const { data } = await this.request.cdn.cdnAPI.get(
18970
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/document_activity/${activityId}.json`
18971
+ );
18972
+ return data;
18973
+ });
18974
+ const { request, config: config2 } = props;
18975
+ this.request = request;
18976
+ this.config = config2;
18977
+ }
18978
+ }
18979
+ function sha256(_x) {
18980
+ return _sha.apply(this, arguments);
18981
+ }
18982
+ function _sha() {
18983
+ _sha = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(str) {
18984
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18985
+ while (1)
18986
+ switch (_context.prev = _context.next) {
18987
+ case 0:
18988
+ return _context.abrupt("return", window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(str)).then(hex));
18989
+ case 1:
18990
+ case "end":
18991
+ return _context.stop();
18992
+ }
18993
+ }, _callee);
18994
+ }));
18995
+ return _sha.apply(this, arguments);
18996
+ }
18997
+ function hex(buffer) {
18998
+ return Array.prototype.map.call(new Uint8Array(buffer), function(b) {
18999
+ return `00${b.toString(16)}`.slice(-2);
19000
+ }).join("");
19001
+ }
19002
+ async function getRequestURL(params) {
19003
+ const { apiURL, language = "zh-CN", serviceName: serviceName2, sdpAppId, sdpOrgId } = params;
19004
+ const component = "auxo_channel_api";
19005
+ const [urlPath, qs] = apiURL.split("?");
19006
+ const hashCode = await sha256(`${urlPath}?${qs}`);
19007
+ const hashPath = `${urlPath}/${hashCode}.json`;
19008
+ return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
19009
+ }
19010
+ class Channel {
19011
+ constructor(props) {
19012
+ __publicField(this, "request");
19013
+ /* 获取频道列表
19014
+ scope: 'default' 默认频道
19015
+ scope: 'teach_training' 学习强师的频道
19016
+ */
19017
+ __publicField(this, "getChannelList", async ({
19018
+ scope,
19019
+ language = "zh-CN",
19020
+ sdpAppId,
19021
+ sdpOrgId,
19022
+ serviceName: serviceName2,
19023
+ api: api2 = this.request.cdn.cdnAPI
19024
+ }) => {
19025
+ const requestURL = await getRequestURL({
19026
+ apiURL: `/v1/app/channels?language=zh-CN&scope=${scope}`,
19027
+ language,
19028
+ serviceName: serviceName2,
19029
+ sdpAppId,
19030
+ sdpOrgId
19031
+ });
19032
+ const { data } = await api2.get(requestURL);
19033
+ return data;
19034
+ });
19035
+ /* 获取频道板块信息 */
19036
+ __publicField(this, "getChannelSectionList", async ({ channelId, serviceName: serviceName2, sdpAppId, sdpOrgId, api: api2 = this.request.cdn.cdnBdcsFileAPI }) => {
19037
+ const requestURL = await getRequestURL({
19038
+ apiURL: `/v2/channels/${channelId}/sections?query_type=0`,
19039
+ serviceName: serviceName2,
19040
+ sdpAppId,
19041
+ sdpOrgId
19042
+ });
19043
+ const { data } = await api2.get(requestURL);
19044
+ return data;
19045
+ });
19046
+ const { request } = props;
19047
+ this.request = request;
19048
+ }
19049
+ }
19050
+ class ElearningTrain {
19051
+ constructor(props) {
19052
+ __publicField(this, "request");
19053
+ __publicField(this, "getTrainDetailStatic", async (trainId) => {
19054
+ try {
19055
+ const requestURL = `/teach/api_static/trains/${trainId}.json`;
19056
+ const { data } = await this.request.cdn.cdnAPI.get(requestURL);
19057
+ return data;
19058
+ } catch (_2) {
19059
+ return {};
19060
+ }
19061
+ });
19062
+ const { request } = props;
19063
+ this.request = request;
19064
+ }
19065
+ }
19066
+ class SiteConfig {
19067
+ constructor(props) {
19068
+ __publicField(this, "request");
19069
+ __publicField(this, "config");
19070
+ __publicField(this, "getSiteConfig", memoize$1(
19071
+ async () => {
19072
+ try {
19073
+ const { data } = await this.request.siteConfig.siteConfigAPI.get("/web_config.json");
19074
+ return data;
19075
+ } catch {
19076
+ return {};
19077
+ }
19078
+ },
19079
+ () => "web_config"
19080
+ ));
19081
+ __publicField(this, "getAreaSites", memoize$1(
19082
+ async () => {
19083
+ const requestURL = `/${this.config.serviceName.site}/sites/sitelist.json`;
19084
+ const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
19085
+ return data;
19086
+ },
19087
+ () => "AreaSites"
19088
+ ));
19089
+ __publicField(this, "getSiteCode", async () => {
19090
+ let siteCode = window.location.pathname.split("/")[1];
19091
+ const skipAreaSiteList = window.location.search.includes("_skip_area_sitelist=1") || window.isPreview;
19092
+ if (skipAreaSiteList) {
19093
+ return siteCode;
19094
+ }
19095
+ const areaSites = await this.getAreaSites();
19096
+ let areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
19097
+ if (areaSite) {
19098
+ return areaSite.code;
19099
+ }
19100
+ siteCode = window.location.hostname.split(".")[0];
19101
+ areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
19102
+ if (areaSite) {
19103
+ return areaSite.code;
19104
+ }
19105
+ return this.config.defaultAreaSite;
19106
+ });
19107
+ __publicField(this, "getSiteInfo", async (siteCode) => {
19108
+ const _siteCode = siteCode || await this.getSiteCode();
19109
+ const requestURL = `/${this.config.serviceName.site}/sites/${_siteCode}/site.json`;
19110
+ const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
19111
+ data.isHn = data.code === "hn";
19112
+ return data;
19113
+ });
19114
+ const { request, config: config2 } = props;
19115
+ this.request = request;
19116
+ this.config = config2;
19117
+ }
19118
+ }
19119
+ function converToTag(node) {
19120
+ return {
19121
+ tag_group_code: node.code,
19122
+ tag_group_name: node.next_level_name,
19123
+ tags: node.children.length === 0 ? [] : node.children.map((n2) => ({
19124
+ tag_name: n2.title,
19125
+ tag_id: n2.id,
19126
+ tag_code: n2.code,
19127
+ children: [converToTag(n2)]
19128
+ }))
19129
+ };
19130
+ }
19131
+ class Library {
19132
+ constructor(props) {
19133
+ __publicField(this, "request");
19134
+ __publicField(this, "config");
19135
+ __publicField(this, "getLibraryDynamicData", async ({ libraryId, sdpOrgId }) => {
19136
+ const getData = async ({ pageNo: pageNo2, pageSize: pageSize2 }) => {
19137
+ const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
19138
+ `/v1/libraries/${libraryId}/contents/actions/search/adapter`,
19139
+ {
19140
+ params: {
19141
+ page_no: pageNo2,
19142
+ page_size: pageSize2,
19143
+ sort_type: 3
19144
+ },
19145
+ headers: {
19146
+ "sdp-org-id": sdpOrgId
19147
+ }
19148
+ }
19149
+ );
19150
+ return data;
19151
+ };
19152
+ let pageNo = 0;
19153
+ const pageSize = 20;
19154
+ const libraryData = await getData({ pageNo, pageSize });
19155
+ const { total = 0 } = libraryData || {};
19156
+ const pageCount = Math.ceil(total / pageSize);
19157
+ let allData = libraryData.items;
19158
+ for (let i = 1; i < pageCount; i++) {
19159
+ pageNo = i;
19160
+ const data = await getData({ pageNo, pageSize });
19161
+ allData = allData.concat(data.items);
19162
+ }
19163
+ return allData;
19164
+ });
19165
+ __publicField(this, "getRequestURL", async ({ apiURL, language = "zh-CN", serviceName: serviceName2, sdpOrgId, sdpAppId }) => {
19166
+ const component = "elearning_library";
19167
+ const [urlPath, qs] = apiURL.split("?");
19168
+ const hashCode = await sha256(`${urlPath}?${qs}`);
19169
+ const hashPath = `${urlPath}/${hashCode}.json`;
19170
+ return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
19171
+ });
19172
+ /* 获取所有内容库*/
19173
+ __publicField(this, "getLibraryContentListAll", memoize$1(
19174
+ async ({ libraryId, sdpOrgId, sdpAppId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
19175
+ if (!libraryId) {
19176
+ return [];
19177
+ }
19178
+ if (window.isPreview) {
19179
+ try {
19180
+ const dynamicData = await this.getLibraryDynamicData({ libraryId, sdpOrgId });
19181
+ return dynamicData;
19182
+ } catch (e2) {
19183
+ }
19184
+ }
19185
+ const requestURL = await this.getRequestURL({
19186
+ apiURL: `/v1/libraries/${libraryId}/contents/actions/full/adapter?sort_type=3`,
19187
+ serviceName: serviceName2,
19188
+ sdpAppId,
19189
+ sdpOrgId
19190
+ });
19191
+ const { data } = await api2.get(requestURL);
19192
+ if (data.files.length) {
19193
+ const pageDataArray = await Promise.all(
19194
+ data.files.map(async (fileUrl) => {
19195
+ const { data: result } = await api2.get(fileUrl);
19196
+ return result;
19197
+ })
19198
+ );
19199
+ let allData = [];
19200
+ pageDataArray.forEach((pageData) => {
19201
+ allData = allData.concat(pageData);
19202
+ });
19203
+ return allData;
19204
+ } else {
19205
+ return [];
19206
+ }
19207
+ },
19208
+ ({ libraryId, extraParams }) => `LibraryContentListAll_${libraryId}_${extraParams}`
19209
+ ));
19210
+ /* 获取内容库所有资源 */
19211
+ __publicField(this, "getLibraryContentByUnitId", async ({ libraryId, unitId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 }) => {
19212
+ if (!libraryId || !unitId) {
19213
+ return {};
19214
+ }
19215
+ const data = await this.getLibraryContentListAll({
19216
+ libraryId,
19217
+ sdpAppId,
19218
+ sdpOrgId,
19219
+ serviceName: serviceName2,
19220
+ api: api2
19221
+ });
19222
+ return data.find((item) => item.unit_id === unitId) || {};
19223
+ });
19224
+ __publicField(this, "getDynamicCatalogs", async ({ libraryId, sdpOrgId }) => {
19225
+ const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
19226
+ `/v1/catalogs/libraries/${libraryId}`,
19227
+ {
19228
+ params: {
19229
+ all: true
19230
+ },
19231
+ headers: {
19232
+ "sdp-org-id": sdpOrgId ? sdpOrgId ?? "" : ""
19233
+ }
19234
+ }
19235
+ );
19236
+ return data;
19237
+ });
19238
+ /* 获取内容库所有标签 */
19239
+ __publicField(this, "getLibraryCatalogs", memoize$1(
19240
+ async ({ libraryId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
19241
+ if (!libraryId) {
19242
+ return [];
19243
+ }
19244
+ const requestURL = await this.getRequestURL({
19245
+ apiURL: `/v1/catalogs/libraries/${libraryId}?all=true`,
19246
+ serviceName: serviceName2,
19247
+ sdpAppId,
19248
+ sdpOrgId
19249
+ });
19250
+ try {
19251
+ let data;
19252
+ if (window.isPreview) {
19253
+ try {
19254
+ data = await this.getDynamicCatalogs(libraryId);
19255
+ } catch (e2) {
19256
+ }
19257
+ }
19258
+ if (!data) {
19259
+ const response = await api2.get(requestURL);
19260
+ data = response.data;
19261
+ }
19262
+ if (data) {
19263
+ const root2 = converToTag(data);
19264
+ return root2;
19265
+ }
19266
+ return {};
19267
+ } catch (e2) {
19268
+ console.error(e2);
19269
+ return {};
19270
+ }
19271
+ },
19272
+ ({ libraryId }) => `LibraryCatalogs_${libraryId}`
19273
+ ));
19274
+ const { request, config: config2 } = props;
19275
+ this.request = request;
19276
+ this.config = config2;
19277
+ }
19278
+ }
18437
19279
  const _Service = class _Service {
18438
19280
  constructor(props) {
18439
19281
  __publicField(this, "env");
@@ -18447,10 +19289,12 @@ const _Service = class _Service {
18447
19289
  __publicField(this, "recommend");
18448
19290
  // 推荐相关接口
18449
19291
  __publicField(this, "sdpAppId");
19292
+ __publicField(this, "config");
18450
19293
  var _a2, _b2;
18451
19294
  const { uc } = props;
18452
19295
  this.uc = uc;
18453
19296
  this.env = (_a2 = uc.options) == null ? void 0 : _a2.env;
19297
+ this.config = config[this.env];
18454
19298
  this.sdpAppId = (_b2 = uc.options) == null ? void 0 : _b2.sdpAppId;
18455
19299
  this.rawAPI = api;
18456
19300
  this.init();
@@ -18467,43 +19311,73 @@ const _Service = class _Service {
18467
19311
  this.uc = ucInstance;
18468
19312
  this.init();
18469
19313
  }
19314
+ initSingleRequest(requestFn) {
19315
+ return requestFn({ uc: this.uc, env: this.env });
19316
+ }
18470
19317
  init() {
18471
- this.request = {
19318
+ const requests = {
18472
19319
  recommend: {
18473
- recommendAPIV2: recommendAPIV2({ uc: this.uc, env: this.env })
19320
+ recommendAPIV2
18474
19321
  },
18475
19322
  xProxy: {
18476
- xProxyCloudAPI: xProxyCloudAPI({ env: this.env, uc: this.uc }),
18477
- xProxyAssessmentAPI: xProxyAssessmentAPI({ env: this.env, uc: this.uc }),
18478
- xProxyRecommendAPI: xProxyRecommendAPI({ env: this.env, uc: this.uc })
19323
+ xProxyCloudAPI,
19324
+ xProxyAssessmentAPI,
19325
+ xProxyRecommendAPI
18479
19326
  },
18480
19327
  assessment: {
18481
- assessmentAPI: assessmentAPI({ env: this.env, uc: this.uc })
19328
+ assessmentAPI
18482
19329
  },
18483
19330
  xCloudWeb: {
18484
- xCloudWebAPI: xCloudWebAPI({ uc: this.uc, env: this.env })
19331
+ xCloudWebAPI
18485
19332
  },
18486
19333
  xFeedback: {
18487
- xFeddbackCommonAPI: xFeddbackCommonAPI({ uc: this.uc, env: this.env }),
18488
- xFeddbackAuthAPI: xFeddbackAuthAPI({ uc: this.uc, env: this.env })
19334
+ xFeddbackCommonAPI,
19335
+ xFeddbackAuthAPI
18489
19336
  },
18490
19337
  favorite: {
18491
- favoriteCommonAPI: favoriteCommonAPI({ uc: this.uc, env: this.env }),
18492
- favoriteAuthAPI: favoriteAuthAPI({ uc: this.uc, env: this.env }),
18493
- favoriteAuthAPIWithError: favoriteAuthAPIWithError({ uc: this.uc, env: this.env })
19338
+ favoriteCommonAPI,
19339
+ favoriteAuthAPI,
19340
+ favoriteAuthAPIWithError
18494
19341
  },
18495
19342
  xStudyRecord: {
18496
- xStudyRecordAPI: xStudyRecordAPI({ uc: this.uc, env: this.env })
19343
+ xStudyRecordAPI
19344
+ },
19345
+ cdn: {
19346
+ cdnAPI,
19347
+ cdnBdcsFileAPI,
19348
+ cdnSFileAPI
19349
+ },
19350
+ siteConfig: {
19351
+ siteConfigAPI
19352
+ },
19353
+ elearningLibrary: {
19354
+ eLearningLibraryAPI
18497
19355
  }
18498
19356
  };
18499
- this.service = {
18500
- stat: new Stat({ request: this.request }),
18501
- assessment: new Assessment({ request: this.request }),
18502
- like: new Like({ request: this.request }),
18503
- feedback: new Feedback({ request: this.request }),
18504
- favorite: new Favorite({ request: this.request }),
18505
- studyRecord: new StudyRecord({ request: this.request })
19357
+ this.request = {};
19358
+ Object.keys(requests).forEach((key) => {
19359
+ this.request[key] = {};
19360
+ Object.keys(requests[key]).forEach((subKey) => {
19361
+ this.request[key][subKey] = this.initSingleRequest(requests[key][subKey]);
19362
+ });
19363
+ });
19364
+ const services = {
19365
+ stat: Stat,
19366
+ assessment: Assessment,
19367
+ like: Like,
19368
+ feedback: Feedback,
19369
+ favorite: Favorite,
19370
+ studyRecord: StudyRecord,
19371
+ tCourse: TCourse,
19372
+ channel: Channel,
19373
+ elearningTrain: ElearningTrain,
19374
+ siteConfig: SiteConfig,
19375
+ library: Library
18506
19376
  };
19377
+ this.service = {};
19378
+ Object.keys(services).forEach((key) => {
19379
+ this.service[key] = new services[key]({ request: this.request, config: this.config });
19380
+ });
18507
19381
  }
18508
19382
  };
18509
19383
  __publicField(_Service, "instance");