@player-ui/async-node-plugin 0.14.0-next.0 → 0.14.0-next.1
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/AsyncNodePlugin.native.js +143 -154
- package/dist/AsyncNodePlugin.native.js.map +1 -1
- package/dist/cjs/index.cjs +34 -16
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +29 -11
- package/dist/index.mjs +29 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/createAsyncTransform.test.ts +192 -2
- package/src/createAsyncTransform.ts +14 -4
- package/src/utils/__tests__/requiresAssetWrapper.test.ts +63 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/requiresAssetWrapper.ts +14 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/requiresAssetWrapper.d.ts +3 -0
|
@@ -45,6 +45,10 @@ function _async_to_generator(fn) {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
+
function _call_super(_this, derived, args) {
|
|
49
|
+
derived = _get_prototype_of(derived);
|
|
50
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
51
|
+
}
|
|
48
52
|
function _class_call_check(instance, Constructor) {
|
|
49
53
|
if (!(instance instanceof Constructor)) {
|
|
50
54
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -283,31 +287,15 @@ function _wrap_native_super(Class) {
|
|
|
283
287
|
return _wrap_native_super(Class);
|
|
284
288
|
}
|
|
285
289
|
function _is_native_reflect_construct() {
|
|
286
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
287
|
-
if (Reflect.construct.sham) return false;
|
|
288
|
-
if (typeof Proxy === "function") return true;
|
|
289
290
|
try {
|
|
290
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function _create_super(Derived) {
|
|
297
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
298
|
-
return function _createSuperInternal() {
|
|
299
|
-
var Super = _get_prototype_of(Derived), result;
|
|
300
|
-
if (hasNativeReflectConstruct) {
|
|
301
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
302
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
303
|
-
} else {
|
|
304
|
-
result = Super.apply(this, arguments);
|
|
305
|
-
}
|
|
306
|
-
return _possible_constructor_return(this, result);
|
|
307
|
-
};
|
|
291
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
292
|
+
} catch (_) {}
|
|
293
|
+
return (_is_native_reflect_construct = function() {
|
|
294
|
+
return !!result;
|
|
295
|
+
})();
|
|
308
296
|
}
|
|
309
297
|
function _ts_generator(thisArg, body) {
|
|
310
|
-
var f, y, t,
|
|
298
|
+
var f, y, t, _ = {
|
|
311
299
|
label: 0,
|
|
312
300
|
sent: function() {
|
|
313
301
|
if (t[0] & 1) throw t[1];
|
|
@@ -315,12 +303,8 @@ function _ts_generator(thisArg, body) {
|
|
|
315
303
|
},
|
|
316
304
|
trys: [],
|
|
317
305
|
ops: []
|
|
318
|
-
};
|
|
319
|
-
return g = {
|
|
320
|
-
next: verb(0),
|
|
321
|
-
"throw": verb(1),
|
|
322
|
-
"return": verb(2)
|
|
323
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
306
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
307
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
324
308
|
return this;
|
|
325
309
|
}), g;
|
|
326
310
|
function verb(n) {
|
|
@@ -333,7 +317,7 @@ function _ts_generator(thisArg, body) {
|
|
|
333
317
|
}
|
|
334
318
|
function step(op) {
|
|
335
319
|
if (f) throw new TypeError("Generator is already executing.");
|
|
336
|
-
while(_)try {
|
|
320
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
337
321
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
338
322
|
if (y = 0, t) op = [
|
|
339
323
|
op[0] & 2,
|
|
@@ -505,7 +489,7 @@ var AsyncNodePlugin = function() {
|
|
|
505
489
|
};
|
|
506
490
|
var findInArray = function findInArray(array, key, value) {
|
|
507
491
|
return array.findIndex(function(obj) {
|
|
508
|
-
if (obj && typeof obj === "object") {
|
|
492
|
+
if (obj && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
509
493
|
return obj[key] == value;
|
|
510
494
|
}
|
|
511
495
|
return false;
|
|
@@ -599,7 +583,7 @@ var AsyncNodePlugin = function() {
|
|
|
599
583
|
};
|
|
600
584
|
};
|
|
601
585
|
var isExpressionNode = function isExpressionNode(x) {
|
|
602
|
-
return typeof x === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
|
|
586
|
+
return (typeof x === "undefined" ? "undefined" : _type_of(x)) === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
|
|
603
587
|
};
|
|
604
588
|
var throwError = function throwError(message, index) {
|
|
605
589
|
var err = new Error("".concat(message, " at character ").concat(index));
|
|
@@ -1187,7 +1171,7 @@ var AsyncNodePlugin = function() {
|
|
|
1187
1171
|
var isPromiseLike = function isPromiseLike(value) {
|
|
1188
1172
|
var // Check for standard Promise constructor name
|
|
1189
1173
|
_value_constructor;
|
|
1190
|
-
return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
|
|
1174
|
+
return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && typeof value.then === "function" && // Additional safeguards against false positives
|
|
1191
1175
|
(_instanceof(value, Promise) || ((_value_constructor = value.constructor) === null || _value_constructor === void 0 ? void 0 : _value_constructor.name) === "Promise" || // Verify it has other Promise-like methods to reduce false positives
|
|
1192
1176
|
typeof value.catch === "function" && typeof value.finally === "function");
|
|
1193
1177
|
};
|
|
@@ -1202,7 +1186,7 @@ var AsyncNodePlugin = function() {
|
|
|
1202
1186
|
if (isExpressionNode(expr)) {
|
|
1203
1187
|
return false;
|
|
1204
1188
|
}
|
|
1205
|
-
return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
|
|
1189
|
+
return (typeof expr === "undefined" ? "undefined" : _type_of(expr)) === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
|
|
1206
1190
|
};
|
|
1207
1191
|
var makePromiseAwareBinaryOp = function makePromiseAwareBinaryOp(operation) {
|
|
1208
1192
|
return function(a, b, async) {
|
|
@@ -1419,7 +1403,7 @@ var AsyncNodePlugin = function() {
|
|
|
1419
1403
|
if (!node) {
|
|
1420
1404
|
return;
|
|
1421
1405
|
}
|
|
1422
|
-
if ("value" in node &&
|
|
1406
|
+
if ("value" in node && _type_of(node.value) === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
|
|
1423
1407
|
return node.value.id;
|
|
1424
1408
|
}
|
|
1425
1409
|
};
|
|
@@ -1531,7 +1515,7 @@ var AsyncNodePlugin = function() {
|
|
|
1531
1515
|
});
|
|
1532
1516
|
};
|
|
1533
1517
|
var __copyProps = function(to, from, except, desc) {
|
|
1534
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1518
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1535
1519
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1536
1520
|
try {
|
|
1537
1521
|
var _loop = function() {
|
|
@@ -1586,15 +1570,16 @@ var AsyncNodePlugin = function() {
|
|
|
1586
1570
|
exports.toError = exports.NestedError = void 0;
|
|
1587
1571
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1588
1572
|
_inherits(_NestedError, Error1);
|
|
1589
|
-
var _super = _create_super(_NestedError);
|
|
1590
1573
|
function _NestedError(message) {
|
|
1591
1574
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1592
1575
|
innerErrors[_key - 1] = arguments[_key];
|
|
1593
1576
|
}
|
|
1594
1577
|
_class_call_check(this, _NestedError);
|
|
1595
1578
|
var _this;
|
|
1596
|
-
_this =
|
|
1597
|
-
|
|
1579
|
+
_this = _call_super(this, _NestedError, [
|
|
1580
|
+
message
|
|
1581
|
+
]);
|
|
1582
|
+
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1598
1583
|
if (innerErrors.length === 1) {
|
|
1599
1584
|
var innerError = toError(innerErrors[0]);
|
|
1600
1585
|
_this.innerErrors = [
|
|
@@ -1730,7 +1715,7 @@ var AsyncNodePlugin = function() {
|
|
|
1730
1715
|
return out;
|
|
1731
1716
|
}
|
|
1732
1717
|
function isObject(o) {
|
|
1733
|
-
return o != null && typeof o === "object";
|
|
1718
|
+
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1734
1719
|
}
|
|
1735
1720
|
function addLast2(array, val) {
|
|
1736
1721
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2073,7 +2058,7 @@ var AsyncNodePlugin = function() {
|
|
|
2073
2058
|
else return 0;
|
|
2074
2059
|
}
|
|
2075
2060
|
}();
|
|
2076
|
-
if (typeof module === "object") module.exports = SortedArray2;
|
|
2061
|
+
if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
|
|
2077
2062
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2078
2063
|
return SortedArray2;
|
|
2079
2064
|
});
|
|
@@ -2282,10 +2267,9 @@ var AsyncNodePlugin = function() {
|
|
|
2282
2267
|
}();
|
|
2283
2268
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2284
2269
|
_inherits(SyncHook, Hook);
|
|
2285
|
-
var _super = _create_super(SyncHook);
|
|
2286
2270
|
function SyncHook() {
|
|
2287
2271
|
_class_call_check(this, SyncHook);
|
|
2288
|
-
return
|
|
2272
|
+
return _call_super(this, SyncHook, arguments);
|
|
2289
2273
|
}
|
|
2290
2274
|
_create_class(SyncHook, [
|
|
2291
2275
|
{
|
|
@@ -2318,10 +2302,9 @@ var AsyncNodePlugin = function() {
|
|
|
2318
2302
|
}(Hook);
|
|
2319
2303
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2320
2304
|
_inherits(SyncBailHook, Hook);
|
|
2321
|
-
var _super = _create_super(SyncBailHook);
|
|
2322
2305
|
function SyncBailHook() {
|
|
2323
2306
|
_class_call_check(this, SyncBailHook);
|
|
2324
|
-
return
|
|
2307
|
+
return _call_super(this, SyncBailHook, arguments);
|
|
2325
2308
|
}
|
|
2326
2309
|
_create_class(SyncBailHook, [
|
|
2327
2310
|
{
|
|
@@ -2353,10 +2336,9 @@ var AsyncNodePlugin = function() {
|
|
|
2353
2336
|
}(Hook);
|
|
2354
2337
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2355
2338
|
_inherits(SyncWaterfallHook, Hook);
|
|
2356
|
-
var _super = _create_super(SyncWaterfallHook);
|
|
2357
2339
|
function SyncWaterfallHook() {
|
|
2358
2340
|
_class_call_check(this, SyncWaterfallHook);
|
|
2359
|
-
return
|
|
2341
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
2360
2342
|
}
|
|
2361
2343
|
_create_class(SyncWaterfallHook, [
|
|
2362
2344
|
{
|
|
@@ -2388,10 +2370,9 @@ var AsyncNodePlugin = function() {
|
|
|
2388
2370
|
}(Hook);
|
|
2389
2371
|
var AsyncParallelBailHook = /*#__PURE__*/ function(Hook) {
|
|
2390
2372
|
_inherits(AsyncParallelBailHook, Hook);
|
|
2391
|
-
var _super = _create_super(AsyncParallelBailHook);
|
|
2392
2373
|
function AsyncParallelBailHook() {
|
|
2393
2374
|
_class_call_check(this, AsyncParallelBailHook);
|
|
2394
|
-
return
|
|
2375
|
+
return _call_super(this, AsyncParallelBailHook, arguments);
|
|
2395
2376
|
}
|
|
2396
2377
|
_create_class(AsyncParallelBailHook, [
|
|
2397
2378
|
{
|
|
@@ -2400,14 +2381,13 @@ var AsyncNodePlugin = function() {
|
|
|
2400
2381
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
2401
2382
|
args[_key] = arguments[_key];
|
|
2402
2383
|
}
|
|
2403
|
-
var _this = this;
|
|
2404
2384
|
return _async_to_generator(function() {
|
|
2405
2385
|
var _this_interceptions, ctx, rtn, e;
|
|
2406
2386
|
return _ts_generator(this, function(_state) {
|
|
2407
2387
|
switch(_state.label){
|
|
2408
2388
|
case 0:
|
|
2409
2389
|
ctx = {};
|
|
2410
|
-
(_this_interceptions =
|
|
2390
|
+
(_this_interceptions = this.interceptions).call.apply(_this_interceptions, [
|
|
2411
2391
|
ctx
|
|
2412
2392
|
].concat(_to_consumable_array(args)));
|
|
2413
2393
|
_state.label = 1;
|
|
@@ -2420,20 +2400,20 @@ var AsyncNodePlugin = function() {
|
|
|
2420
2400
|
]);
|
|
2421
2401
|
return [
|
|
2422
2402
|
4,
|
|
2423
|
-
Promise.race(
|
|
2403
|
+
Promise.race(this.taps.map(function(tap) {
|
|
2424
2404
|
return callTap(tap, args, ctx);
|
|
2425
2405
|
}))
|
|
2426
2406
|
];
|
|
2427
2407
|
case 2:
|
|
2428
2408
|
rtn = _state.sent();
|
|
2429
|
-
|
|
2409
|
+
this.interceptions.result(rtn);
|
|
2430
2410
|
return [
|
|
2431
2411
|
2,
|
|
2432
2412
|
rtn
|
|
2433
2413
|
];
|
|
2434
2414
|
case 3:
|
|
2435
2415
|
e = _state.sent();
|
|
2436
|
-
|
|
2416
|
+
this.interceptions.error(e);
|
|
2437
2417
|
throw e;
|
|
2438
2418
|
case 4:
|
|
2439
2419
|
return [
|
|
@@ -2441,7 +2421,7 @@ var AsyncNodePlugin = function() {
|
|
|
2441
2421
|
];
|
|
2442
2422
|
}
|
|
2443
2423
|
});
|
|
2444
|
-
})();
|
|
2424
|
+
}).call(this);
|
|
2445
2425
|
}
|
|
2446
2426
|
}
|
|
2447
2427
|
]);
|
|
@@ -2479,7 +2459,7 @@ var AsyncNodePlugin = function() {
|
|
|
2479
2459
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2480
2460
|
len = _step.value;
|
|
2481
2461
|
tmp = len;
|
|
2482
|
-
if (tmp && typeof tmp === "object") {
|
|
2462
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2483
2463
|
tmp = find(bar, tmp);
|
|
2484
2464
|
if (!tmp) return false;
|
|
2485
2465
|
}
|
|
@@ -2510,7 +2490,7 @@ var AsyncNodePlugin = function() {
|
|
|
2510
2490
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2511
2491
|
len = _step1.value;
|
|
2512
2492
|
tmp = len[0];
|
|
2513
|
-
if (tmp && typeof tmp === "object") {
|
|
2493
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2514
2494
|
tmp = find(bar, tmp);
|
|
2515
2495
|
if (!tmp) return false;
|
|
2516
2496
|
}
|
|
@@ -2549,7 +2529,7 @@ var AsyncNodePlugin = function() {
|
|
|
2549
2529
|
}
|
|
2550
2530
|
return len === -1;
|
|
2551
2531
|
}
|
|
2552
|
-
if (!ctor || typeof foo === "object") {
|
|
2532
|
+
if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
|
|
2553
2533
|
len = 0;
|
|
2554
2534
|
for(ctor in foo){
|
|
2555
2535
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -2582,7 +2562,7 @@ var AsyncNodePlugin = function() {
|
|
|
2582
2562
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2583
2563
|
key
|
|
2584
2564
|
]);
|
|
2585
|
-
if (typeof val === "object") {
|
|
2565
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
2586
2566
|
traverseObj(val, nestedPath, pairs);
|
|
2587
2567
|
} else {
|
|
2588
2568
|
pairs.set(nestedPath, val);
|
|
@@ -2623,7 +2603,7 @@ var AsyncNodePlugin = function() {
|
|
|
2623
2603
|
{
|
|
2624
2604
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
2625
2605
|
value: function set(match, value) {
|
|
2626
|
-
var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2606
|
+
var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2627
2607
|
this.store.insert({
|
|
2628
2608
|
key: match,
|
|
2629
2609
|
value: value,
|
|
@@ -3163,7 +3143,7 @@ var AsyncNodePlugin = function() {
|
|
|
3163
3143
|
var _this_parseCache_path;
|
|
3164
3144
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3165
3145
|
this.parseCache[path] = ast;
|
|
3166
|
-
if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3146
|
+
if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3167
3147
|
var _ast_error;
|
|
3168
3148
|
throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((_ast_error = ast === null || ast === void 0 ? void 0 : ast.error) !== null && _ast_error !== void 0 ? _ast_error : "Unknown Error."));
|
|
3169
3149
|
}
|
|
@@ -3363,14 +3343,13 @@ var AsyncNodePlugin = function() {
|
|
|
3363
3343
|
}();
|
|
3364
3344
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3365
3345
|
_inherits(DependencyModel, DependencyTracker);
|
|
3366
|
-
var _super = _create_super(DependencyModel);
|
|
3367
3346
|
function DependencyModel(rootModel) {
|
|
3368
3347
|
_class_call_check(this, DependencyModel);
|
|
3369
3348
|
var _this;
|
|
3370
|
-
_this =
|
|
3349
|
+
_this = _call_super(this, DependencyModel);
|
|
3371
3350
|
_this.rootModel = rootModel;
|
|
3372
|
-
_this.set = _this.set.bind(
|
|
3373
|
-
_this.get = _this.get.bind(
|
|
3351
|
+
_this.set = _this.set.bind(_this);
|
|
3352
|
+
_this.get = _this.get.bind(_this);
|
|
3374
3353
|
return _this;
|
|
3375
3354
|
}
|
|
3376
3355
|
_create_class(DependencyModel, [
|
|
@@ -3914,23 +3893,20 @@ var AsyncNodePlugin = function() {
|
|
|
3914
3893
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3915
3894
|
*/ key: "evaluateAsync",
|
|
3916
3895
|
value: function evaluateAsync(expr, options) {
|
|
3896
|
+
var _this = this;
|
|
3917
3897
|
if (Array.isArray(expr)) {
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
var _ref = _async_to_generator(function(exp) {
|
|
3898
|
+
return collateAwaitable(expr.map(function(exp) {
|
|
3899
|
+
return _async_to_generator(function() {
|
|
3921
3900
|
return _ts_generator(this, function(_state) {
|
|
3922
3901
|
return [
|
|
3923
3902
|
2,
|
|
3924
|
-
|
|
3903
|
+
this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3925
3904
|
async: true
|
|
3926
3905
|
}))
|
|
3927
3906
|
];
|
|
3928
3907
|
});
|
|
3929
|
-
});
|
|
3930
|
-
|
|
3931
|
-
return _ref.apply(this, arguments);
|
|
3932
|
-
};
|
|
3933
|
-
}())).awaitableThen(function(values) {
|
|
3908
|
+
}).call(_this);
|
|
3909
|
+
})).awaitableThen(function(values) {
|
|
3934
3910
|
return values.pop();
|
|
3935
3911
|
});
|
|
3936
3912
|
} else {
|
|
@@ -4706,7 +4682,7 @@ var AsyncNodePlugin = function() {
|
|
|
4706
4682
|
}
|
|
4707
4683
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4708
4684
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4709
|
-
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4685
|
+
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4710
4686
|
return {
|
|
4711
4687
|
value: objToParse,
|
|
4712
4688
|
children: []
|
|
@@ -4743,7 +4719,7 @@ var AsyncNodePlugin = function() {
|
|
|
4743
4719
|
if (newChildren) {
|
|
4744
4720
|
var _children2;
|
|
4745
4721
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4746
|
-
} else if (localValue && typeof localValue === "object") {
|
|
4722
|
+
} else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
|
|
4747
4723
|
var _children21;
|
|
4748
4724
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4749
4725
|
localKey
|
|
@@ -4901,7 +4877,7 @@ var AsyncNodePlugin = function() {
|
|
|
4901
4877
|
Object.keys(clonedNode).forEach(function(key) {
|
|
4902
4878
|
if (key === "parent") return;
|
|
4903
4879
|
var value = clonedNode[key];
|
|
4904
|
-
if (typeof value === "object" && value !== null) {
|
|
4880
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
4905
4881
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
4906
4882
|
}
|
|
4907
4883
|
});
|
|
@@ -5381,7 +5357,7 @@ var AsyncNodePlugin = function() {
|
|
|
5381
5357
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5382
5358
|
var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
|
|
5383
5359
|
var flags = "g";
|
|
5384
|
-
if (typeof expression === "object") {
|
|
5360
|
+
if ((typeof expression === "undefined" ? "undefined" : _type_of(expression)) === "object") {
|
|
5385
5361
|
flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
|
|
5386
5362
|
}
|
|
5387
5363
|
templateStr = templateStr.replace(new RegExp(expression, flags), value);
|
|
@@ -5530,7 +5506,7 @@ var AsyncNodePlugin = function() {
|
|
|
5530
5506
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5531
5507
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5532
5508
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5533
|
-
if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
|
|
5509
|
+
if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
|
|
5534
5510
|
return node;
|
|
5535
5511
|
}
|
|
5536
5512
|
if (typeof node === "string") {
|
|
@@ -5543,7 +5519,7 @@ var AsyncNodePlugin = function() {
|
|
|
5543
5519
|
}
|
|
5544
5520
|
var val = node[key];
|
|
5545
5521
|
var newVal = val;
|
|
5546
|
-
if (typeof val === "object") {
|
|
5522
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
5547
5523
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5548
5524
|
} else if (typeof val === "string") {
|
|
5549
5525
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -5884,7 +5860,7 @@ var AsyncNodePlugin = function() {
|
|
|
5884
5860
|
key: "applyParser",
|
|
5885
5861
|
value: function applyParser(parser) {
|
|
5886
5862
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
5887
|
-
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
|
|
5863
|
+
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
5888
5864
|
var assetAST = parser.parseObject(obj, "asset", options);
|
|
5889
5865
|
if (!assetAST) {
|
|
5890
5866
|
return [];
|
|
@@ -6084,6 +6060,7 @@ var AsyncNodePlugin = function() {
|
|
|
6084
6060
|
}();
|
|
6085
6061
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
6086
6062
|
function FlowInstance(id, flow, options) {
|
|
6063
|
+
var _this = this;
|
|
6087
6064
|
_class_call_check(this, FlowInstance);
|
|
6088
6065
|
this.isTransitioning = false;
|
|
6089
6066
|
this.hooks = {
|
|
@@ -6100,60 +6077,55 @@ var AsyncNodePlugin = function() {
|
|
|
6100
6077
|
this.flow = flow;
|
|
6101
6078
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
6102
6079
|
this.history = [];
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
6080
|
+
this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
|
|
6081
|
+
return _async_to_generator(function() {
|
|
6106
6082
|
var newState;
|
|
6107
6083
|
return _ts_generator(this, function(_state) {
|
|
6108
6084
|
newState = nextState.value;
|
|
6109
|
-
if (
|
|
6110
|
-
|
|
6085
|
+
if (this.flowPromise && newState.state_type === "END") {
|
|
6086
|
+
this.flowPromise.resolve(newState);
|
|
6111
6087
|
}
|
|
6112
6088
|
return [
|
|
6113
6089
|
2
|
|
6114
6090
|
];
|
|
6115
6091
|
});
|
|
6116
|
-
});
|
|
6117
|
-
|
|
6118
|
-
return _ref.apply(this, arguments);
|
|
6119
|
-
};
|
|
6120
|
-
}());
|
|
6092
|
+
}).call(_this);
|
|
6093
|
+
});
|
|
6121
6094
|
}
|
|
6122
6095
|
_create_class(FlowInstance, [
|
|
6123
6096
|
{
|
|
6124
6097
|
key: "start",
|
|
6125
6098
|
value: /** Start the state machine */ function start() {
|
|
6126
|
-
var _this = this;
|
|
6127
6099
|
return _async_to_generator(function() {
|
|
6128
6100
|
var _this_log, initialState;
|
|
6129
6101
|
return _ts_generator(this, function(_state) {
|
|
6130
|
-
if (
|
|
6102
|
+
if (this.flowPromise) {
|
|
6131
6103
|
;
|
|
6132
|
-
(_this_log =
|
|
6104
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
6133
6105
|
return [
|
|
6134
6106
|
2,
|
|
6135
|
-
|
|
6107
|
+
this.flowPromise.promise
|
|
6136
6108
|
];
|
|
6137
6109
|
}
|
|
6138
|
-
|
|
6139
|
-
if (
|
|
6140
|
-
|
|
6110
|
+
this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
|
|
6111
|
+
if (this.flow.onStart) {
|
|
6112
|
+
this.hooks.onStart.call(this.flow.onStart);
|
|
6141
6113
|
}
|
|
6142
|
-
initialState =
|
|
6114
|
+
initialState = this.flow.startState;
|
|
6143
6115
|
if (!initialState) {
|
|
6144
6116
|
return [
|
|
6145
6117
|
2,
|
|
6146
6118
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
6147
6119
|
];
|
|
6148
6120
|
}
|
|
6149
|
-
|
|
6150
|
-
|
|
6121
|
+
this.flowPromise = (0, import_p_defer2.default)();
|
|
6122
|
+
this.pushHistory(initialState);
|
|
6151
6123
|
return [
|
|
6152
6124
|
2,
|
|
6153
|
-
|
|
6125
|
+
this.flowPromise.promise
|
|
6154
6126
|
];
|
|
6155
6127
|
});
|
|
6156
|
-
})();
|
|
6128
|
+
}).call(this);
|
|
6157
6129
|
}
|
|
6158
6130
|
},
|
|
6159
6131
|
{
|
|
@@ -6205,7 +6177,7 @@ var AsyncNodePlugin = function() {
|
|
|
6205
6177
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6206
6178
|
}
|
|
6207
6179
|
var nextState = this.flow[stateName];
|
|
6208
|
-
if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
|
|
6180
|
+
if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
|
|
6209
6181
|
var _this_log;
|
|
6210
6182
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6211
6183
|
return;
|
|
@@ -6265,30 +6237,30 @@ var AsyncNodePlugin = function() {
|
|
|
6265
6237
|
{
|
|
6266
6238
|
key: "run",
|
|
6267
6239
|
value: function run(startState) {
|
|
6268
|
-
var _this = this;
|
|
6269
6240
|
return _async_to_generator(function() {
|
|
6270
|
-
var _this_log, startFlow, flow, end, firstItem;
|
|
6241
|
+
var _this, _this_log, startFlow, flow, end, firstItem;
|
|
6271
6242
|
return _ts_generator(this, function(_state) {
|
|
6272
6243
|
switch(_state.label){
|
|
6273
6244
|
case 0:
|
|
6274
|
-
|
|
6245
|
+
_this = this;
|
|
6246
|
+
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6275
6247
|
return [
|
|
6276
6248
|
2,
|
|
6277
6249
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6278
6250
|
];
|
|
6279
6251
|
}
|
|
6280
|
-
startFlow =
|
|
6281
|
-
if (startFlow === null || typeof startFlow !== "object") {
|
|
6252
|
+
startFlow = this.navigation[startState];
|
|
6253
|
+
if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
|
|
6282
6254
|
return [
|
|
6283
6255
|
2,
|
|
6284
6256
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6285
6257
|
];
|
|
6286
6258
|
}
|
|
6287
|
-
(_this_log =
|
|
6259
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6288
6260
|
flow = new FlowInstance(startState, startFlow, {
|
|
6289
|
-
logger:
|
|
6261
|
+
logger: this.log
|
|
6290
6262
|
});
|
|
6291
|
-
|
|
6263
|
+
this.addNewFlow(flow);
|
|
6292
6264
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6293
6265
|
var _flowInstance_currentState;
|
|
6294
6266
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6308,10 +6280,10 @@ var AsyncNodePlugin = function() {
|
|
|
6308
6280
|
];
|
|
6309
6281
|
case 1:
|
|
6310
6282
|
end = _state.sent();
|
|
6311
|
-
|
|
6312
|
-
if (
|
|
6283
|
+
this.navStack.pop();
|
|
6284
|
+
if (this.navStack.length > 0) {
|
|
6313
6285
|
firstItem = 0;
|
|
6314
|
-
|
|
6286
|
+
this.current = this.navStack[firstItem];
|
|
6315
6287
|
}
|
|
6316
6288
|
return [
|
|
6317
6289
|
2,
|
|
@@ -6319,16 +6291,15 @@ var AsyncNodePlugin = function() {
|
|
|
6319
6291
|
];
|
|
6320
6292
|
}
|
|
6321
6293
|
});
|
|
6322
|
-
})();
|
|
6294
|
+
}).call(this);
|
|
6323
6295
|
}
|
|
6324
6296
|
},
|
|
6325
6297
|
{
|
|
6326
6298
|
key: "start",
|
|
6327
6299
|
value: function start() {
|
|
6328
|
-
var _this = this;
|
|
6329
6300
|
return _async_to_generator(function() {
|
|
6330
6301
|
return _ts_generator(this, function(_state) {
|
|
6331
|
-
if (!
|
|
6302
|
+
if (!this.navigation.BEGIN) {
|
|
6332
6303
|
return [
|
|
6333
6304
|
2,
|
|
6334
6305
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6336,10 +6307,10 @@ var AsyncNodePlugin = function() {
|
|
|
6336
6307
|
}
|
|
6337
6308
|
return [
|
|
6338
6309
|
2,
|
|
6339
|
-
|
|
6310
|
+
this.run(this.navigation.BEGIN)
|
|
6340
6311
|
];
|
|
6341
6312
|
});
|
|
6342
|
-
})();
|
|
6313
|
+
}).call(this);
|
|
6343
6314
|
}
|
|
6344
6315
|
}
|
|
6345
6316
|
]);
|
|
@@ -7446,7 +7417,7 @@ var AsyncNodePlugin = function() {
|
|
|
7446
7417
|
var parentBinding = resolved.parent();
|
|
7447
7418
|
var property = resolved.key();
|
|
7448
7419
|
var parentValue = this.get(parentBinding);
|
|
7449
|
-
var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7420
|
+
var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7450
7421
|
this.getModel().delete(resolved, options);
|
|
7451
7422
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7452
7423
|
this.trash.add(resolved);
|
|
@@ -7547,7 +7518,7 @@ var AsyncNodePlugin = function() {
|
|
|
7547
7518
|
var expressionEvaluator;
|
|
7548
7519
|
var handleEval = function(exp) {
|
|
7549
7520
|
if (exp) {
|
|
7550
|
-
if (typeof exp === "object" && "exp" in exp) {
|
|
7521
|
+
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7551
7522
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7552
7523
|
} else {
|
|
7553
7524
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -7808,7 +7779,7 @@ var AsyncNodePlugin = function() {
|
|
|
7808
7779
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
7809
7780
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
7810
7781
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
7811
|
-
if (
|
|
7782
|
+
if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
|
|
7812
7783
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
7813
7784
|
} else {
|
|
7814
7785
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -7967,12 +7938,12 @@ var AsyncNodePlugin = function() {
|
|
|
7967
7938
|
{
|
|
7968
7939
|
key: "start",
|
|
7969
7940
|
value: function start(payload) {
|
|
7970
|
-
var _this = this;
|
|
7971
7941
|
return _async_to_generator(function() {
|
|
7972
|
-
var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7942
|
+
var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7973
7943
|
return _ts_generator(this, function(_state) {
|
|
7974
7944
|
switch(_state.label){
|
|
7975
7945
|
case 0:
|
|
7946
|
+
_this = this;
|
|
7976
7947
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
7977
7948
|
maybeUpdateState = function(newState) {
|
|
7978
7949
|
if (_this.state.ref !== ref) {
|
|
@@ -7982,7 +7953,7 @@ var AsyncNodePlugin = function() {
|
|
|
7982
7953
|
_this.setState(newState);
|
|
7983
7954
|
return newState;
|
|
7984
7955
|
};
|
|
7985
|
-
|
|
7956
|
+
this.setState({
|
|
7986
7957
|
status: "not-started",
|
|
7987
7958
|
ref: ref
|
|
7988
7959
|
});
|
|
@@ -7994,8 +7965,8 @@ var AsyncNodePlugin = function() {
|
|
|
7994
7965
|
,
|
|
7995
7966
|
4
|
|
7996
7967
|
]);
|
|
7997
|
-
_this_setupFlow =
|
|
7998
|
-
|
|
7968
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7969
|
+
this.setState(_object_spread({
|
|
7999
7970
|
ref: ref
|
|
8000
7971
|
}, state));
|
|
8001
7972
|
start();
|
|
@@ -8040,7 +8011,7 @@ var AsyncNodePlugin = function() {
|
|
|
8040
8011
|
];
|
|
8041
8012
|
}
|
|
8042
8013
|
});
|
|
8043
|
-
})();
|
|
8014
|
+
}).call(this);
|
|
8044
8015
|
}
|
|
8045
8016
|
}
|
|
8046
8017
|
]);
|
|
@@ -8166,6 +8137,16 @@ var AsyncNodePlugin = function() {
|
|
|
8166
8137
|
}
|
|
8167
8138
|
return child.value;
|
|
8168
8139
|
};
|
|
8140
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/requiresAssetWrapper.ts
|
|
8141
|
+
var requiresAssetWrapper = function(node) {
|
|
8142
|
+
if (node.type === NodeType.Asset) {
|
|
8143
|
+
return true;
|
|
8144
|
+
}
|
|
8145
|
+
if (node.type !== NodeType.Applicability) {
|
|
8146
|
+
return false;
|
|
8147
|
+
}
|
|
8148
|
+
return node.value.type === NodeType.Asset;
|
|
8149
|
+
};
|
|
8169
8150
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/createAsyncTransform.ts
|
|
8170
8151
|
var defaultGetNodeId = function(node) {
|
|
8171
8152
|
return "async-".concat(node.value.id);
|
|
@@ -8193,8 +8174,17 @@ var AsyncNodePlugin = function() {
|
|
|
8193
8174
|
var asyncNode = Builder.asyncNode(id, flatten2, replaceFunction);
|
|
8194
8175
|
var multiNode;
|
|
8195
8176
|
if (asset) {
|
|
8196
|
-
|
|
8197
|
-
|
|
8177
|
+
if (requiresAssetWrapper(asset)) {
|
|
8178
|
+
var assetWrappedNode = Builder.assetWrapper(asset);
|
|
8179
|
+
multiNode = Builder.multiNode(assetWrappedNode, asyncNode);
|
|
8180
|
+
} else if (asset.type === NodeType.MultiNode) {
|
|
8181
|
+
var _Builder;
|
|
8182
|
+
multiNode = (_Builder = Builder).multiNode.apply(_Builder, _to_consumable_array(asset.values).concat([
|
|
8183
|
+
asyncNode
|
|
8184
|
+
]));
|
|
8185
|
+
} else {
|
|
8186
|
+
multiNode = Builder.multiNode(asset, asyncNode);
|
|
8187
|
+
}
|
|
8198
8188
|
} else {
|
|
8199
8189
|
multiNode = Builder.multiNode(asyncNode);
|
|
8200
8190
|
}
|
|
@@ -8226,8 +8216,8 @@ var AsyncNodePlugin = function() {
|
|
|
8226
8216
|
});
|
|
8227
8217
|
}
|
|
8228
8218
|
if (asyncHandler) {
|
|
8229
|
-
this.hooks.onAsyncNode.tap("async", function() {
|
|
8230
|
-
|
|
8219
|
+
this.hooks.onAsyncNode.tap("async", function(node, callback) {
|
|
8220
|
+
return _async_to_generator(function() {
|
|
8231
8221
|
return _ts_generator(this, function(_state) {
|
|
8232
8222
|
switch(_state.label){
|
|
8233
8223
|
case 0:
|
|
@@ -8242,11 +8232,8 @@ var AsyncNodePlugin = function() {
|
|
|
8242
8232
|
];
|
|
8243
8233
|
}
|
|
8244
8234
|
});
|
|
8245
|
-
});
|
|
8246
|
-
|
|
8247
|
-
return _ref.apply(this, arguments);
|
|
8248
|
-
};
|
|
8249
|
-
}());
|
|
8235
|
+
})();
|
|
8236
|
+
});
|
|
8250
8237
|
}
|
|
8251
8238
|
}
|
|
8252
8239
|
_create_class(_AsyncNodePlugin, [
|
|
@@ -8401,39 +8388,41 @@ var AsyncNodePlugin = function() {
|
|
|
8401
8388
|
{
|
|
8402
8389
|
key: "runAsyncNode",
|
|
8403
8390
|
value: function runAsyncNode(node, context, options) {
|
|
8404
|
-
var _this = this;
|
|
8405
8391
|
return _async_to_generator(function() {
|
|
8406
|
-
var _this_basePlugin, result, e, _this_basePlugin1, _options_logger, error, result1, _this_basePlugin_getPlayerInstance, _this_basePlugin2, playerState;
|
|
8392
|
+
var _this, _this_basePlugin, result, e, _this_basePlugin1, _options_logger, error, result1, _this_basePlugin_getPlayerInstance, _this_basePlugin2, playerState;
|
|
8407
8393
|
return _ts_generator(this, function(_state) {
|
|
8408
8394
|
switch(_state.label){
|
|
8409
8395
|
case 0:
|
|
8396
|
+
_this = this;
|
|
8397
|
+
_state.label = 1;
|
|
8398
|
+
case 1:
|
|
8410
8399
|
_state.trys.push([
|
|
8411
|
-
|
|
8412
|
-
|
|
8400
|
+
1,
|
|
8401
|
+
3,
|
|
8413
8402
|
,
|
|
8414
|
-
|
|
8403
|
+
4
|
|
8415
8404
|
]);
|
|
8416
8405
|
return [
|
|
8417
8406
|
4,
|
|
8418
|
-
(_this_basePlugin =
|
|
8407
|
+
(_this_basePlugin = this.basePlugin) === null || _this_basePlugin === void 0 ? void 0 : _this_basePlugin.hooks.onAsyncNode.call(node, function(result2) {
|
|
8419
8408
|
_this.parseNodeAndUpdate(node, context, result2, options);
|
|
8420
8409
|
})
|
|
8421
8410
|
];
|
|
8422
|
-
case
|
|
8411
|
+
case 2:
|
|
8423
8412
|
result = _state.sent();
|
|
8424
8413
|
context.inProgressNodes.delete(node.id);
|
|
8425
|
-
|
|
8414
|
+
this.parseNodeAndUpdate(node, context, result, options);
|
|
8426
8415
|
return [
|
|
8427
8416
|
3,
|
|
8428
|
-
|
|
8417
|
+
4
|
|
8429
8418
|
];
|
|
8430
|
-
case
|
|
8419
|
+
case 3:
|
|
8431
8420
|
e = _state.sent();
|
|
8432
8421
|
error = _instanceof(e, Error) ? e : new Error(String(e));
|
|
8433
|
-
result1 = (_this_basePlugin1 =
|
|
8422
|
+
result1 = (_this_basePlugin1 = this.basePlugin) === null || _this_basePlugin1 === void 0 ? void 0 : _this_basePlugin1.hooks.onAsyncNodeError.call(error, node);
|
|
8434
8423
|
if (result1 === void 0) {
|
|
8435
8424
|
;
|
|
8436
|
-
playerState = (_this_basePlugin2 =
|
|
8425
|
+
playerState = (_this_basePlugin2 = this.basePlugin) === null || _this_basePlugin2 === void 0 ? void 0 : (_this_basePlugin_getPlayerInstance = _this_basePlugin2.getPlayerInstance()) === null || _this_basePlugin_getPlayerInstance === void 0 ? void 0 : _this_basePlugin_getPlayerInstance.getState();
|
|
8437
8426
|
if ((playerState === null || playerState === void 0 ? void 0 : playerState.status) === "in-progress") {
|
|
8438
8427
|
playerState.fail(error);
|
|
8439
8428
|
}
|
|
@@ -8443,18 +8432,18 @@ var AsyncNodePlugin = function() {
|
|
|
8443
8432
|
}
|
|
8444
8433
|
(_options_logger = options.logger) === null || _options_logger === void 0 ? void 0 : _options_logger.error("Async node handling failed and resolved with a fallback. Error:", error);
|
|
8445
8434
|
context.inProgressNodes.delete(node.id);
|
|
8446
|
-
|
|
8435
|
+
this.parseNodeAndUpdate(node, context, result1, options);
|
|
8447
8436
|
return [
|
|
8448
8437
|
3,
|
|
8449
|
-
|
|
8438
|
+
4
|
|
8450
8439
|
];
|
|
8451
|
-
case
|
|
8440
|
+
case 4:
|
|
8452
8441
|
return [
|
|
8453
8442
|
2
|
|
8454
8443
|
];
|
|
8455
8444
|
}
|
|
8456
8445
|
});
|
|
8457
|
-
})();
|
|
8446
|
+
}).call(this);
|
|
8458
8447
|
}
|
|
8459
8448
|
},
|
|
8460
8449
|
{
|
|
@@ -8466,7 +8455,7 @@ var AsyncNodePlugin = function() {
|
|
|
8466
8455
|
{
|
|
8467
8456
|
key: "isDeterminedAsync",
|
|
8468
8457
|
value: function isDeterminedAsync(obj) {
|
|
8469
|
-
return typeof obj === "object" && obj !== null && Object.prototype.hasOwnProperty.call(obj, "async");
|
|
8458
|
+
return (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object" && obj !== null && Object.prototype.hasOwnProperty.call(obj, "async");
|
|
8470
8459
|
}
|
|
8471
8460
|
},
|
|
8472
8461
|
{
|