decord/beta/source/modules/multi_account/setUserStatus.tsx
2026-10-07 22:43:51 +00:00

189 lines
7.1 KiB
TypeScript

// Module ID: 12474
// Function ID: 12475
// Name: setUserStatus
// Dependencies: [5, 6610, 5438, 1085, 4722, 1126, 12475, 2033, 1228, 4730, 1252, 2]
// Exports: default
// Module 12474 (setUserStatus)
import Constants from "Constants" /* 1085 */;
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
import LastMentionTimestampStore from "LastMentionTimestampStore" /* 6610 */;
import SelfPresenceStore from "SelfPresenceStore" /* 5438 */;
import size from "module_2" /* 2 */;
let closure_2, next_status, prev_status, statusCreatedAtMs;
let obj = function _setUserStatus() {
obj = _asyncToGenerator(async (next_status) => {
let c3 = 0;
let c4 = 0;
const iter = (async (arg0, value) => {
let c0;
let c2;
let closure_1;
let disableTracking;
let result;
let statusExpiresAtMs;
function getStatusUpdateAnnouncement(c0, arg1) {
obj = value(closure_1_2[4]);
const humanizeStatusResult = obj.humanizeStatus(c0);
if ("0" === arg1) {
const intl3 = tmp(tmp2[5]).intl;
const obj2 = { statusLabel: humanizeStatusResult };
return intl3.formatToPlainString(value(closure_1_2[5]).t.dO2aLi, obj2);
} else {
let formatToPlainStringResult;
const tmpResult = value(closure_1_2[6]);
const statusExpiryParts = tmpResult.getStatusExpiryParts(arg1);
const timeString = statusExpiryParts.timeString;
if ("today" === statusExpiryParts.kind) {
const intl2 = tmp(tmp2[5]).intl;
const obj3 = { statusLabel: humanizeStatusResult, timeString };
formatToPlainStringResult = intl2.formatToPlainString(tmp(tmp2[5]).t["r50t/S"], obj3);
} else {
const intl = tmp(tmp2[5]).intl;
const obj4 = { statusLabel: humanizeStatusResult, dateString: tmp6, timeString };
formatToPlainStringResult = intl.formatToPlainString(tmp(tmp2[5]).t["J+GJHv"], obj4);
}
return formatToPlainStringResult;
}
}
if (c4 === 2) {
c4 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
let obj2 = { value, done: true };
return obj2;
} else {
return { value: "IconComponent", done: null };
}
} else {
try {
let str;
let closure_6;
let obj9;
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
let obj3 = { value, done: true };
return obj3;
} else {
closure_2 = tmp4;
next_status = undefined;
prev_status = undefined;
c2 = undefined;
c3 = undefined;
disableTracking = undefined;
({ nextStatus: c0, prevStatus: closure_1, analyticsContext: c2, durationMillis: c3, disableTracking } = value);
if (disableTracking === undefined) {
disableTracking = false;
}
str = undefined;
closure_6 = undefined;
obj9 = undefined;
c3 = 1;
c4 = 1;
return { value: "Reflect", done: null };
}
} else if (1 === c3) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
return { value, done: true };
} else {
if (null == prev_status) {
prev_status = closure_130_5.getStatus();
}
str = "0";
if (null != c3) {
const _Date = Date;
const _HermesInternal = HermesInternal;
str = "" + Date.now() + c3;
}
const PreloadedUserSettingsActionCreators = closure_130_0(closure_130_2[7]).PreloadedUserSettingsActionCreators;
c3 = 2;
c4 = 1;
const obj6 = {
value: PreloadedUserSettingsActionCreators.updateAsync("status", async (statusCreatedAtMs) => {
const StringValue = value(closure_2[8]).StringValue;
obj = { value };
statusCreatedAtMs.status = StringValue.create(obj);
statusCreatedAtMs.statusExpiresAtMs = statusExpiresAtMs;
const tmp = value;
const tmp2 = closure_2;
if (prev_status === value) {
if (null != statusCreatedAtMs.statusCreatedAtMs) {
statusCreatedAtMs = statusCreatedAtMs.statusCreatedAtMs;
}
statusCreatedAtMs.statusCreatedAtMs = statusCreatedAtMs;
}
const UInt64Value = tmp(tmp2[8]).UInt64Value;
const obj2 = { value: "" + Date.now() };
statusCreatedAtMs = UInt64Value.create(obj2);
}, closure_130_0(closure_130_2[7]).UserSettingsDelay.INFREQUENT_USER_ACTION),
done: false
};
return obj6;
}
} else if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
return { value, done: true };
} else {
closure_6 = getStatusUpdateAnnouncement(next_status, str);
const AccessibilityAnnouncer = closure_130_0(closure_130_2[9]).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(closure_6);
const tmp65 = disableTracking;
if (!tmp65) {
const tmp6 = closure_2;
obj = { next_status, prev_status };
const merged = Object.assign(closure_130_4.getGlobalStats());
obj9 = obj;
if (null != c3) {
const obj8 = { expire_duration_minutes: result };
const merged1 = Object.assign(obj9);
result = null;
if (null != c3) {
result = c3 / 60000;
}
obj9 = obj8;
}
if (null != c2) {
obj9 = {};
const merged2 = Object.assign(obj9);
const merged3 = Object.assign(c2);
}
let obj4 = closure_130_1(closure_130_2[10]);
obj4.track(closure_130_6.USER_STATUS_UPDATED, obj9);
}
c4 = 3;
return { value: "IconComponent", done: null };
}
} catch (tmp53) {
c4 = 3;
throw tmp53;
}
}
})();
iter.next();
return iter;
});
return obj(...arguments);
};
const AnalyticEvents = Constants.AnalyticEvents;
let result = size.fileFinishedImporting("modules/multi_account/setUserStatus.tsx");
export default function setUserStatus() {
return obj(...arguments);
};