decord/source/modules/applications/installApplicationOnDemandIfNeeded.native.tsx

190 lines
6.8 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10703
// Function ID: 10704
2026-07-20 16:05:17 +00:00
// Name: _installApplicationOnDemandIfNeeded
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 4406, 4421, 676, 10704, 5835, 9691, 4588, 4242, 10705, 2]
2026-07-20 16:05:17 +00:00
// Exports: installApplicationOnDemandIfNeeded
2026-08-25 06:04:03 +00:00
// Module 10703 (_installApplicationOnDemandIfNeeded)
2026-08-24 06:08:38 +00:00
import closure_2 from "asyncGeneratorStep" /* 5 */;
2026-08-25 06:04:03 +00:00
import closure_3 from "createExecutable" /* 4406 */;
import closure_4 from "addApplication" /* 4421 */;
2026-08-24 06:08:38 +00:00
import { AnalyticEvents } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _installApplicationOnDemandIfNeeded() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
2026-08-12 06:57:52 +00:00
if (application === 2) {
application = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-12 06:57:52 +00:00
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-29 08:29:29 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-08-04 21:03:28 +00:00
}
} else {
2026-08-12 06:57:52 +00:00
try {
application = 2;
if (0 === c3) {
if (arg0 === 1) {
application = 3;
throw arg1;
} else if (arg0 === 2) {
application = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c2 = tmp5;
2026-08-24 06:08:38 +00:00
dependencyMap = tmp2;
2026-08-12 06:57:52 +00:00
let callback;
dependencyMap = undefined;
c2 = undefined;
c3 = undefined;
({ applicationId: c0, channel: c1, commandIntegrationTypes: c2, appLauncherContext: c3 } = callback);
application = undefined;
obj = undefined;
let USER_INSTALL;
let scopes;
c3 = 1;
application = 1;
return { value: "ct", done: true };
2026-08-04 21:03:28 +00:00
}
2026-08-12 06:57:52 +00:00
} else {
if (1 === tmp5) {
if (arg0 === 1) {
application = 3;
throw arg1;
} else if (arg0 === 2) {
application = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
let obj2 = { applicationId: null, channel: null, commandIntegrationTypes: null };
obj2[0] = callback;
obj2[1] = dependencyMap;
obj2[2] = c2;
if (obj11.shouldInstallApplicationOnDemand(obj2)) {
application = application.getApplication(callback);
if (null == application) {
2026-08-25 06:04:03 +00:00
let obj5 = callback(5835);
2026-08-12 06:57:52 +00:00
c3 = 2;
application = 1;
const obj3 = { value: null, done: false };
obj3[0] = obj5.fetchApplication(callback);
return obj3;
}
} else {
application = 3;
const obj4 = { value: null, done: true };
obj4[0] = Promise.resolve({ isAuthorized: true });
return obj4;
}
2026-08-25 06:04:03 +00:00
obj11 = callback(10704);
2026-08-04 21:03:28 +00:00
}
2026-08-12 06:57:52 +00:00
} else if (arg0 === 1) {
application = 3;
throw arg1;
} else if (arg0 === 2) {
application = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-08-04 21:03:28 +00:00
} else {
2026-08-12 06:57:52 +00:00
obj = arg1;
application = c3.createFromServer(obj);
2026-08-04 21:03:28 +00:00
}
2026-08-25 06:04:03 +00:00
USER_INSTALL = callback(9691).ApplicationIntegrationType.USER_INSTALL;
2026-08-12 06:57:52 +00:00
scopes = undefined;
if (application != null) {
const integrationTypesConfig = application.integrationTypesConfig;
if (integrationTypesConfig != null) {
if (integrationTypesConfig[USER_INSTALL] != null) {
const oauth2InstallParams = tmp25.oauth2InstallParams;
if (oauth2InstallParams != null) {
scopes = oauth2InstallParams.scopes;
}
}
}
}
if (null != c3) {
2026-08-25 06:04:03 +00:00
obj2 = callback(4588);
2026-08-12 06:57:52 +00:00
obj5 = { application_id: null, location: null, section_name: null, source: null };
obj5[0] = callback;
obj5[1] = c3.location;
obj5[2] = c3.sectionName;
obj5[3] = c3.entrypoint;
obj2.trackWithMetadata(obj.APP_LAUNCHER_OAUTH2_AUTHORIZE_OPENED, obj5);
}
const promise = new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-08-12 06:57:52 +00:00
let obj = _undefined(_undefined2[8]);
obj.dismissKeyboard();
obj = {
clientId: closure_0,
integrationType: USER_INSTALL,
scopes,
callback(location) {
if (null != location.location) {
2026-08-24 06:08:38 +00:00
if (null != closure_1_3) {
2026-08-12 06:57:52 +00:00
let obj = callback(table[7]);
obj = { application_id: null, location: null, section_name: null, source: null };
obj[0] = callback;
({ location: obj2[1], sectionName: obj2[2], entrypoint: obj2[3] } = tmp3);
obj.trackWithMetadata(obj.APP_LAUNCHER_OAUTH2_AUTHORIZE_SUCCEEDED, obj);
}
callback({ isAuthorized: true });
2026-08-24 06:08:38 +00:00
tmp3 = closure_1_3;
2026-08-12 06:57:52 +00:00
} else {
callback({ isAuthorized: false });
}
}
};
_undefined(_undefined2[9]).openOAuth2Modal(obj);
});
application = 3;
const obj6 = { value: null, done: true };
obj6[0] = promise;
return obj6;
2026-08-04 21:03:28 +00:00
}
2026-08-12 06:57:52 +00:00
} catch (tmp50) {
application = tmp;
throw tmp50;
}
}
2026-07-29 08:29:29 +00:00
})();
iter.next();
return iter;
});
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);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/applications/installApplicationOnDemandIfNeeded.native.tsx");
2026-07-20 16:05:17 +00:00
export const installApplicationOnDemandIfNeeded = function installApplicationOnDemandIfNeeded(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _installApplicationOnDemandIfNeeded.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
};