decord/source/modules/games/autocomplete/GameAutocompleteActionCreators.tsx

147 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7460
// Function ID: 7461
2026-07-20 16:05:17 +00:00
// Name: _fetchGameAutocomplete
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 4935, 676, 4936, 709, 530, 2]
2026-07-20 16:05:17 +00:00
// Exports: fetchGameAutocomplete
2026-08-25 06:04:03 +00:00
// Module 7460 (_fetchGameAutocomplete)
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "set" /* 4935 */;
2026-08-24 06:08:38 +00:00
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function _fetchGameAutocomplete() {
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c6 = 0;
c7 = 0;
c5 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
if (c7 === 2) {
c7 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw body;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = body;
return obj;
} else {
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c7 = 2;
if (0 === c6) {
if (arg0 === 1) {
c7 = 3;
throw body;
} else if (arg0 === 2) {
c7 = 3;
obj = { value: null, done: true };
obj[0] = body;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_3 = tmp3;
dependencyMap = tmp7;
c0 = undefined;
2026-07-29 08:29:29 +00:00
let lib;
2026-08-24 06:08:38 +00:00
const result = callback(closure_1_2[3]).normalizeGameAutocompleteQuery(c0);
2026-07-29 08:29:29 +00:00
c0 = result;
if (null != result) {
2026-08-24 06:08:38 +00:00
const shouldSuppressFetchResult = closure_1_4.shouldSuppressFetch(result);
const dispatch = closure_1_1(closure_1_2[4]).dispatch;
2026-07-29 08:29:29 +00:00
if (shouldSuppressFetchResult) {
2026-08-24 06:08:38 +00:00
obj1 = { type: "GAME_AUTOCOMPLETE_FETCH_SUCCESS", query: null, results: null };
2026-07-29 08:29:29 +00:00
obj1[1] = result;
obj1[2] = [];
dispatch(obj1);
} else {
const obj2 = { type: "GAME_AUTOCOMPLETE_FETCH", query: null };
obj2[1] = result;
dispatch(obj2);
let constants = 1;
2026-08-24 06:08:38 +00:00
const HTTP = tmp39(closure_1_2[5]).HTTP;
2026-07-29 08:29:29 +00:00
let obj3 = { url: null, query: null, rejectWithError: false };
obj3[0] = constants.GAMES_AUTOCOMPLETE;
const obj4 = { q: null };
obj4[0] = result;
obj3[1] = obj4;
c6 = 2;
c7 = 1;
const obj5 = { value: null, done: false };
obj5[0] = HTTP.get(obj3);
return obj5;
}
2026-08-24 06:08:38 +00:00
const tmp46 = closure_1_1(closure_1_2[4]);
2026-07-29 08:29:29 +00:00
}
c7 = 3;
2026-08-24 06:08:38 +00:00
const obj13 = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
tmp39 = callback;
}
} else if (1 === tmp7) {
constants = 0;
2026-08-24 06:08:38 +00:00
dependencyMap = closure_4;
2026-07-29 08:29:29 +00:00
obj3 = lib(709);
const obj6 = { type: "GAME_AUTOCOMPLETE_FETCH_FAILURE", query: null };
obj6[1] = c0;
obj3.dispatch(obj6);
throw dependencyMap;
} else if (arg0 === 1) {
c7 = 3;
throw body;
} else if (arg0 !== 2) {
body = body.body;
lib = body;
if (body == null) {
lib = [];
}
lib = lib.map((id) => ({ id: String(id.id), name: id.name, icon: id.icon }));
obj = lib(709);
const obj7 = { type: "GAME_AUTOCOMPLETE_FETCH_SUCCESS", query: null, results: null };
obj7[1] = c0;
obj7[2] = lib;
obj.dispatch(obj7);
constants = 0;
}
constants = 0;
c7 = 3;
const obj8 = { value: null, done: true };
obj8[0] = body;
return obj8;
} catch (tmp29) {
2026-08-24 06:08:38 +00:00
closure_4 = tmp29;
2026-07-29 08:29:29 +00:00
if (tmp4 === constants) {
c7 = tmp2;
throw tmp29;
} else {
c6 = tmp;
}
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/games/autocomplete/GameAutocompleteActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const fetchGameAutocomplete = function fetchGameAutocomplete(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchGameAutocomplete.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};