This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

+55 -53
View File
@@ -1,10 +1,12 @@
/* Metro module 11740; source: modules/polls/PollAttachmentUtils.tsx; dependencies: [5, 7217, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PollsConstantsModule from './PollsConstants.tsx'; /* Metro dependency 7217 */
function _fun89994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:6, offset: 0x020264fa, size: 165 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(5) /* metro dependency 5 */;
const env0_1 = (require(7217) /* metro dependency 7217: PollsConstants */).POLL_ATTACHMENT_FOLDER;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollAttachmentUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollAttachmentUtils.tsx');
exports.getFileNameFromGifUrl = function(a0, a1) {
var value = (0, global.decodeURIComponent)(a1);
value = value.split('/');
@@ -17,59 +19,59 @@ function _fun89994(global, require, importDefault, importAll, module, exports, d
exports.downloadPollGif = function() {
return _downloadPollGif.apply(this, arguments);
};
}
function _downloadPollGif() { // fn#89995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:139, offset: 0x0202659f, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun89997).apply(this, arguments);
function* _fun89997(a0) { // fn#89997, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:194, offset: 0x020265dc, size: 81 bytes, params: 2, frame: 13
if (false) {
return undefined;
}
yield global.fetch(a0);
value = undefined;
if (false) {
return value;
}
yield value.blob();
value = undefined;
if (false) {
return value;
}
return ((a0) => {
var env0_0 = a0;
var property = global.FileReader;
var env0_1 = new property();
property = global.Promise;
value2 = Object.create(property.prototype, {constructor: {value: property}});
var value3 = new property(_fun89999);
return value3 instanceof Object ? value3 : value2;
})(value);
function convertBlobToBase64(a0) { // fn#89998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:235, offset: 0x0202662d, size: 76 bytes, params: 2, frame: 12
const env0_0 = a0;
const FileReader = global.FileReader;
let fileReader = new FileReader();
const Promise = global.Promise;
fileReader = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun89999);
return promise instanceof Object ? promise : fileReader;
function _fun89999(a0, a1) { // fn#89999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:308, offset: 0x02026679, size: 57 bytes, params: 3, frame: 11
const env0_0 = a0;
PollsConstantsModule.POLL_ATTACHMENT_FOLDER.onload = onload_90000;
PollsConstantsModule.POLL_ATTACHMENT_FOLDER.onerror = a1;
PollsConstantsModule.POLL_ATTACHMENT_FOLDER.readAsDataURL(env0_0);
function onload_90000() { // fn#90000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:325, offset: 0x020266b2, size: 53 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = env1_1.result.split(',');
value = value.pop();
env0_0(value);
}
function _downloadPollGif() { // fn#89995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:139, offset: 0x0202659f, size: 50 bytes, params: 1, frame: 14
return env0_0(_fun89997).apply(this, arguments);
}
}
}
}
function* _fun89997(a0) { // fn#89997, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:194, offset: 0x020265dc, size: 81 bytes, params: 2, frame: 13
if (false) {
return undefined;
}
yield global.fetch(a0);
value = undefined;
if (false) {
return value;
}
yield value.blob();
value = undefined;
if (false) {
return value;
}
return ((a0) => {
var env0_0 = a0;
var property = global.FileReader;
var env0_1 = new property();
property = global.Promise;
value2 = Object.create(property.prototype, {constructor: {value: property}});
var value3 = new property(_fun89999);
return value3 instanceof Object ? value3 : value2;
})(value);
}
function convertBlobToBase64(a0) { // fn#89998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:235, offset: 0x0202662d, size: 76 bytes, params: 2, frame: 12
const env0_0 = a0;
const FileReader = global.FileReader;
let fileReader = new FileReader();
const Promise = global.Promise;
fileReader = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun89999);
return promise instanceof Object ? promise : fileReader;
}
function _fun89999(a0, a1) { // fn#89999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:308, offset: 0x02026679, size: 57 bytes, params: 3, frame: 11
const env0_0 = a0;
const binding = env0_1;
binding.onload = onload_90000;
binding.onerror = a1;
binding.readAsDataURL(env0_0);
}
function onload_90000() { // fn#90000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:325, offset: 0x020266b2, size: 53 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = env1_1.result.split(',');
value = value.pop();
env0_0(value);
}
global.__d(_fun89994, 11740, [5, 7217, 2]) /* metro module 11740, dependencies: [5, 7217, 2] */;
@@ -1,18 +1,21 @@
/* Metro module 11198; source: modules/polls/PollInteractionUtils.native.tsx; dependencies: [4080, 11199, 1962, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun85566(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11384:6, offset: 0x01f739f6, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollInteractionUtils.native.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollInteractionUtils.native.tsx');
exports.showVotesForAnswer = showVotesForAnswer;
function showVotesForAnswer({message, initialAnswerId}) { // fn#85567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11384:192, offset: 0x01f73a5d, size: 118 bytes, params: 2, frame: 18
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'PollVotesActionSheet', {channelId: message.channel_id,
messageId: message.id, initialAnswerId: initialAnswerId}]);
}
}
function showVotesForAnswer({message, initialAnswerId}) { // fn#85567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11384:192, offset: 0x01f73a5d, size: 118 bytes, params: 2, frame: 18
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'PollVotesActionSheet', {channelId: message.channel_id,
messageId: message.id, initialAnswerId: initialAnswerId}]);
}
global.__d(_fun85566, 11198, [4080, 11199, 1962, 2]) /* metro module 11198, dependencies: [4080, 11199, 1962, 2] */;
+4 -1
View File
@@ -1,9 +1,12 @@
/* Metro module 11741; source: modules/polls/PollTypes.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun90004(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11927:6, offset: 0x0202675a, size: 110 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollTypes.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollTypes.tsx');
exports.PollMediaUploadAttachmentStatus = {PREPARING: 'PREPARING', READY_TO_UPLOAD: 'READY_TO_UPLOAD',
ERROR: 'ERROR'};
}
global.__d(_fun90004, 11741, [2]) /* metro module 11741, dependencies: [2] */;
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+21 -18
View File
@@ -1,28 +1,30 @@
/* Metro module 7217; source: modules/polls/PollsConstants.tsx; dependencies: [1346, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ExpressionPickerConstantsModule from '../expression_picker/ExpressionPickerConstants.tsx'; /* Metro dependency 1346 */
function _fun57716(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7395:6, offset: 0x016b4384, size: 380 bytes, params: 8, frame: 20
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const ExpressionPickerViewType = (require(1346) /* metro dependency 1346: ExpressionPickerConstants */).ExpressionPickerViewType;
object2 = {ONE_HOUR: 1};
object2[1] = 'ONE_HOUR';
object2.FOUR_HOURS = 4;
object2[4] = 'FOUR_HOURS';
object2.EIGHT_HOURS = 8;
object2[8] = 'EIGHT_HOURS';
object2.ONE_DAY = 24;
object2[24] = 'ONE_DAY';
object2.THREE_DAYS = 72;
object2[72] = 'THREE_DAYS';
object2.SEVEN_DAYS = 168;
object2[168] = 'SEVEN_DAYS';
object2.FOURTEEN_DAYS = 336;
object2[336] = 'FOURTEEN_DAYS';
const ExpressionPickerViewType = (ExpressionPickerConstantsModule).ExpressionPickerViewType;
object = {ONE_HOUR: 1};
object[1] = 'ONE_HOUR';
object.FOUR_HOURS = 4;
object[4] = 'FOUR_HOURS';
object.EIGHT_HOURS = 8;
object[8] = 'EIGHT_HOURS';
object.ONE_DAY = 24;
object[24] = 'ONE_DAY';
object.THREE_DAYS = 72;
object[72] = 'THREE_DAYS';
object.SEVEN_DAYS = 168;
object[168] = 'SEVEN_DAYS';
object.FOURTEEN_DAYS = 336;
object[336] = 'FOURTEEN_DAYS';
const Set = global.Set;
const GIF = ExpressionPickerViewType.GIF;
const EMOJI = ExpressionPickerViewType.EMOJI;
const set = new Set([GIF, EMOJI]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollsConstants.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollsConstants.tsx');
exports.POLL_ATTACHMENT_FOLDER = 'polls';
exports.POLL_CREATION_MODAL_KEY = 'POLL_CREATION_MODAL_KEY';
exports.POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY = 'PollsImageInputActionSheet';
@@ -33,7 +35,8 @@ function _fun57716(global, require, importDefault, importAll, module, exports, d
exports.MAX_POLL_ANSWER_LENGTH = 55;
exports.VOTES_TOOLTIP_MAX_USERS = 3;
exports.POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS = 50;
exports.PollDurations = object2;
exports.PollDurations = object;
exports.POLLS_SUPPORTED_EXPRESSION_PICKER_VIEW_TYPES = set;
}
global.__d(_fun57716, 7217, [1346, 2]) /* metro module 7217, dependencies: [1346, 2] */;
+416 -413
View File
@@ -1,426 +1,429 @@
/* Metro module 11203; source: modules/polls/PollsHttpApi.tsx; dependencies: [5, 661, 507, 4131, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun85603(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:6, offset: 0x01f75456, size: 171 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).Endpoints;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollsHttpApi.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollsHttpApi.tsx');
exports.submitPollVote = function() {
return _submitPollVote.apply(this, arguments);
};
exports.endPollEarly = function() {
return _endPollEarly_85607.apply(this, arguments);
};
function _submitPollVote() { // fn#85604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:128, offset: 0x01f75501, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun85606).apply(this, arguments);
async function _fun85606({channelId, messageId, answerIds}) { // fn#85606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:181, offset: 0x01f75547, size: 202 bytes, params: 2, frame: 20
var binding;
var binding2;
var property;
var value4;
var HTTP;
var put;
var object;
var POLL_ANSWERS;
var value5;
var object2;
var value6;
var value7;
var value8;
var error;
var APIError;
var prototype;
var aPIError;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
property = binding2[2];
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
put = HTTP.put;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding = env2_3;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
POLL_ANSWERS = binding.POLL_ANSWERS;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value5 = Reflect.apply(POLL_ANSWERS, binding, [channelId, messageId]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object.url = value5;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object2 = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object2.answer_ids = answerIds;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object.body = object2;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value6 = Reflect.apply(put, HTTP, [object]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
await value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
return value8 ? value7 : undefined;
}
}
function _endPollEarly_85607() { // fn#85607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:390, offset: 0x01f75611, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun85609).apply(this, arguments);
async function _fun85609({channelId, messageId}) { // fn#85609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:439, offset: 0x01f75657, size: 183 bytes, params: 2, frame: 19
var binding;
var binding2;
var property;
var value4;
var HTTP;
var post;
var object;
var POLL_EXPIRE;
var value5;
var value6;
var value7;
var value8;
var error;
var APIError;
var prototype;
var aPIError;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
property = binding2[2];
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
post = HTTP.post;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding = env2_3;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
POLL_EXPIRE = binding.POLL_EXPIRE;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value5 = Reflect.apply(POLL_EXPIRE, binding, [channelId, messageId]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object.url = value5;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value6 = Reflect.apply(post, HTTP, [object]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
await value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
return value8 ? value7 : undefined;
}
}
}
function _submitPollVote() { // fn#85604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:128, offset: 0x01f75501, size: 50 bytes, params: 1, frame: 14
return env0_2(_fun85606).apply(this, arguments);
}
function _endPollEarly_85607() { // fn#85607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:390, offset: 0x01f75611, size: 50 bytes, params: 1, frame: 14
return env0_2(_fun85609).apply(this, arguments);
}
async function _fun85606({channelId, messageId, answerIds}) { // fn#85606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:181, offset: 0x01f75547, size: 202 bytes, params: 2, frame: 20
var binding;
var binding2;
var property;
var value4;
var HTTP;
var put;
var object3;
var POLL_ANSWERS;
var value5;
var object4;
var value6;
var value7;
var value8;
var error;
var APIError;
var prototype;
var aPIError;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
property = binding2[2];
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
put = HTTP.put;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding = env2_3;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
POLL_ANSWERS = binding.POLL_ANSWERS;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value5 = Reflect.apply(POLL_ANSWERS, binding, [channelId, messageId]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object3.url = value5;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object4 = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object4.answer_ids = answerIds;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object3.body = object4;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object3.rejectWithError = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value6 = Reflect.apply(put, HTTP, [object3]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
await value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
return value8 ? value7 : undefined;
}
async function _fun85609({channelId, messageId}) { // fn#85609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11389:439, offset: 0x01f75657, size: 183 bytes, params: 2, frame: 19
var binding;
var binding2;
var property;
var value4;
var HTTP;
var post;
var object2;
var POLL_EXPIRE;
var value5;
var value6;
var value7;
var value8;
var error;
var APIError;
var prototype;
var aPIError;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
property = binding2[2];
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
post = HTTP.post;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object2 = {};
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
binding = env2_3;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
POLL_EXPIRE = binding.POLL_EXPIRE;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value5 = Reflect.apply(POLL_EXPIRE, binding, [channelId, messageId]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object2.url = value5;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
object2.rejectWithError = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
try {
value6 = Reflect.apply(post, HTTP, [object2]);
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
await value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
APIError = binding(env2_1[3]).APIError;
prototype = APIError.prototype;
value = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value = aPIError instanceof Object ? aPIError : value;
throw value;
}
return value8 ? value7 : undefined;
}
global.__d(_fun85603, 11203, [5, 661, 507, 4131, 2]) /* metro module 11203, dependencies: [5, 661, 507, 4131, 2] */;
+126 -117
View File
@@ -1,4 +1,8 @@
/* Metro module 8432; source: modules/polls/PollsInteractionStore.tsx; dependencies: [685, 690, 628, 21, 2] */
import ShallowEqual from '../../external/discord_common/js/packages/shallow-equal/shallowEqual.tsx'; /* Metro dependency 628 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactBatchUpdatesNativeModule from '../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
function _fun66957(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:6, offset: 0x01c10ea9, size: 211 bytes, params: 8, frame: 18
let env0_0 = require;
const Object = global.Object;
@@ -8,132 +12,137 @@ function _fun66957(global, require, importDefault, importAll, module, exports, d
var env0_0 = a0;
return {pollsByChannelId: {}, pollsByMessageId: {}, updatePollState: _fun66959};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollsInteractionStore.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollsInteractionStore.tsx');
exports.useMessagePollInteractions = useMessagePollInteractions;
exports.useChannelPollInteractions = useChannelPollInteractions;
exports.clearChannelPollState = clearChannelPollState;
exports.clearPollState = clearPollState;
exports.updatePollState = updatePollState;
exports.getPollState = getPollState;
}
function _fun66958(a0) { // fn#66958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:133, offset: 0x01c10f7c, size: 39 bytes, params: 2, frame: 3
const env0_0 = a0;
return {pollsByChannelId: {}, pollsByMessageId: {}, updatePollState: updatePollState_66959};
function updatePollState_66959(a0, a1, a2) { // fn#66959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:178, offset: 0x01c10fa3, size: 68 bytes, params: 4, frame: 12
var environment;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value = environment.__proto__;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun66960);
function _fun66960() { // fn#66960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:223, offset: 0x01c10fe7, size: 25 bytes, params: 1, frame: 11
env1_0(_fun66961);
function _fun66961(a0) { // fn#66961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:231, offset: 0x01c11000, size: 136 bytes, params: 2, frame: 17
let pollsByChannelId = a0.pollsByChannelId;
const defaultImport = importDefault(pollsByChannelId[env1_0]?.[require]);
const object = {};
const object2 = {};
copyDataProperties(object2, a0.pollsByChannelId, undefined);
const binding = env1_0;
const object3 = {};
pollsByChannelId = a0.pollsByChannelId;
const value3 = copyDataProperties(object3, pollsByChannelId[binding], pollsByChannelId);
object3[require] = defaultImport;
object2[binding] = object3;
object.pollsByChannelId = object2;
const object4 = {};
copyDataProperties(object4, a0.pollsByMessageId, value3);
object4[require] = defaultImport;
object.pollsByMessageId = object4;
return object;
}
function _fun66958(a0) { // fn#66958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:133, offset: 0x01c10f7c, size: 39 bytes, params: 2, frame: 3
const env0_0 = a0;
return {pollsByChannelId: {}, pollsByMessageId: {}, updatePollState: updatePollState_66959};
}
}
function useMessagePollInteractions(a0) { // fn#66962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:536, offset: 0x01c11088, size: 53 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_4(function(a0) {
a0.forEach(_fun66964);
return {};
}, importDefault(628) /* metro dependency 628: shallowEqual */);
}
}
function useChannelPollInteractions(a0) { // fn#66965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:712, offset: 0x01c1110c, size: 53 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_4(_fun66966, importDefault(628) /* metro dependency 628: shallowEqual */);
}
function clearChannelPollState(a0) { // fn#66967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:850, offset: 0x01c11164, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun66968);
}
function clearPollState(a0, a1) { // fn#66971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1147, offset: 0x01c1124c, size: 61 bytes, params: 3, frame: 12
const env0_0 = a0;
const env0_1 = a1;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun66972);
}
function updatePollState(a0, a1, a2) { // fn#66974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1412, offset: 0x01c11311, size: 43 bytes, params: 4, frame: 15
env0_4.getState().updatePollState(a0, a1, a2);
}
function getPollState(a0, a1) { // fn#66975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1496, offset: 0x01c1133c, size: 50 bytes, params: 3, frame: 10
const binding = env0_4;
const getState = binding.getState;
return Reflect.apply(getState, binding, []).pollsByChannelId[a0]?.[a1];
}
function updatePollState_66959(a0, a1, a2) { // fn#66959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:178, offset: 0x01c10fa3, size: 68 bytes, params: 4, frame: 12
var environment;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun66960);
}
function _fun66963(a0) { // fn#66963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:585, offset: 0x01c110bd, size: 41 bytes, params: 2, frame: 12
a0.forEach(_fun66964);
return {};
}
function _fun66966({pollsByChannelId}) { // fn#66966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:761, offset: 0x01c11141, size: 35 bytes, params: 2, frame: 2
return pollsByChannelId[env0_0] ?? env1_3;
}
function _fun66968() { // fn#66968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:906, offset: 0x01c1119a, size: 31 bytes, params: 1, frame: 11
env1_4.setState(_fun66969);
}
function _fun66972() { // fn#66972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1198, offset: 0x01c11289, size: 31 bytes, params: 1, frame: 11
env1_4.setState(_fun66973);
}
function _fun66960() { // fn#66960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:223, offset: 0x01c10fe7, size: 25 bytes, params: 1, frame: 11
env1_0(_fun66961);
}
function _fun66964(a0) { // fn#66964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:616, offset: 0x01c110e6, size: 38 bytes, params: 2, frame: 4
const property = env0_0.pollsByMessageId[a0];
if (property != null) {
env0_1[a0] = property;
}
function useMessagePollInteractions(a0) { // fn#66962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:536, offset: 0x01c11088, size: 53 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_4(function(a0) {
a0.forEach(_fun66964);
return {};
}, importDefault(628) /* metro dependency 628: shallowEqual */);
function _fun66963(a0) { // fn#66963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:585, offset: 0x01c110bd, size: 41 bytes, params: 2, frame: 12
a0.forEach(_fun66964);
return {};
function _fun66964(a0) { // fn#66964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:616, offset: 0x01c110e6, size: 38 bytes, params: 2, frame: 4
const property = env0_0.pollsByMessageId[a0];
if (property != null) {
env0_1[a0] = property;
}
}
}
}
function useChannelPollInteractions(a0) { // fn#66965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:712, offset: 0x01c1110c, size: 53 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_4(_fun66966, ShallowEqual);
function _fun66966({pollsByChannelId}) { // fn#66966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:761, offset: 0x01c11141, size: 35 bytes, params: 2, frame: 2
return pollsByChannelId[env0_0] ?? env1_3;
}
}
function clearChannelPollState(a0) { // fn#66967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:850, offset: 0x01c11164, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun66968);
function _fun66968() { // fn#66968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:906, offset: 0x01c1119a, size: 31 bytes, params: 1, frame: 11
env1_4.setState(_fun66969);
function _fun66969({pollsByChannelId, pollsByMessageId}) { // fn#66969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:923, offset: 0x01c111b9, size: 147 bytes, params: 2, frame: 18
const value4 = importDefault(dependencyMap[3]).keys(pollsByChannelId[env1_0] ?? env2_3);
const object = {};
copyDataProperties(object, pollsByMessageId, dependencyMap);
value4.forEach(_fun66970);
const object2 = {};
copyDataProperties(object2, pollsByChannelId, dependencyMap);
delete object2[env1_0];
return {pollsByChannelId: object2, pollsByMessageId: object};
function _fun66970(a0) { // fn#66970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1032, offset: 0x00d74aa8, size: 18 bytes, params: 2, frame: 2
delete env0_0[a0];
}
}
}
}
function clearPollState(a0, a1) { // fn#66971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1147, offset: 0x01c1124c, size: 61 bytes, params: 3, frame: 12
const env0_0 = a0;
const env0_1 = a1;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun66972);
function _fun66972() { // fn#66972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1198, offset: 0x01c11289, size: 31 bytes, params: 1, frame: 11
env1_4.setState(_fun66973);
function _fun66973({pollsByChannelId, pollsByMessageId}) { // fn#66973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1215, offset: 0x01c112a8, size: 105 bytes, params: 2, frame: 15
const object = {};
copyDataProperties(object, pollsByChannelId[env1_0] ?? ({}), pollsByChannelId);
delete object[require];
const object3 = {};
copyDataProperties(object3, pollsByMessageId, pollsByChannelId);
delete object3[require];
const object5 = {};
copyDataProperties(object5, pollsByChannelId, pollsByChannelId);
object5[env1_0] = object;
return {pollsByChannelId: object5, pollsByMessageId: object3};
}
}
}
function updatePollState(a0, a1, a2) { // fn#66974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1412, offset: 0x01c11311, size: 43 bytes, params: 4, frame: 15
env0_4.getState().updatePollState(a0, a1, a2);
}
function getPollState(a0, a1) { // fn#66975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1496, offset: 0x01c1133c, size: 50 bytes, params: 3, frame: 10
const binding = env0_4;
const getState = binding.getState;
return Reflect.apply(getState, binding, []).pollsByChannelId[a0]?.[a1];
}
}
function _fun66969({pollsByChannelId, pollsByMessageId}) { // fn#66969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:923, offset: 0x01c111b9, size: 147 bytes, params: 2, frame: 18
const value4 = importDefault(dependencyMap[3]).keys(pollsByChannelId[env1_0] ?? env2_3);
const object3 = {};
copyDataProperties(object3, pollsByMessageId, dependencyMap);
value4.forEach(_fun66970);
const object4 = {};
copyDataProperties(object4, pollsByChannelId, dependencyMap);
delete object4[env1_0];
return {pollsByChannelId: object4, pollsByMessageId: object3};
}
function _fun66973({pollsByChannelId, pollsByMessageId}) { // fn#66973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:1215, offset: 0x01c112a8, size: 105 bytes, params: 2, frame: 15
const object2 = {};
copyDataProperties(object2, pollsByChannelId[env1_0] ?? ({}), pollsByChannelId);
delete object2[require];
const object4 = {};
copyDataProperties(object4, pollsByMessageId, pollsByChannelId);
delete object4[require];
const object6 = {};
copyDataProperties(object6, pollsByChannelId, pollsByChannelId);
object6[env1_0] = object2;
return {pollsByChannelId: object6, pollsByMessageId: object4};
}
function _fun66961(a0) { // fn#66961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8617:231, offset: 0x01c11000, size: 136 bytes, params: 2, frame: 17
let pollsByChannelId = a0.pollsByChannelId;
const defaultImport = importDefault(pollsByChannelId[env1_0]?.[require]);
const object5 = {};
const object6 = {};
copyDataProperties(object6, a0.pollsByChannelId, undefined);
const binding = env1_0;
const object7 = {};
pollsByChannelId = a0.pollsByChannelId;
const value3 = copyDataProperties(object7, pollsByChannelId[binding], pollsByChannelId);
object7[require] = defaultImport;
object6[binding] = object7;
object5.pollsByChannelId = object6;
const object8 = {};
copyDataProperties(object8, a0.pollsByMessageId, value3);
object8[require] = defaultImport;
object5.pollsByMessageId = object8;
return object5;
}
global.__d(_fun66957, 8432, [685, 690, 628, 21, 2]) /* metro module 8432, dependencies: [685, 690, 628, 21, 2] */;
+324 -299
View File
@@ -1,4 +1,17 @@
/* Metro module 7149; source: modules/polls/PollsUtils.tsx; dependencies: [1379, 7150, 4814, 3784, 3793, 7217, 661, 491, 566, 5225, 672, 1862, 4634, 1244, 7152, 22, 4617, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import MessageStore from '../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import MessageReactionsStore from '../../stores/MessageReactionsStore.tsx'; /* Metro dependency 7150 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00491Module from '../../by-id/module-00491.js'; /* Metro dependency 491 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseMessageAuthorModule from '../messages/useMessageAuthor.tsx'; /* Metro dependency 4634 */
import * as MessageReactionsTypesModule from '../messages/MessageReactionsTypes.tsx'; /* Metro dependency 7152 */
import * as PollsConstantsModule from './PollsConstants.tsx'; /* Metro dependency 7217 */
function _fun57179(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:6, offset: 0x013de7bf, size: 490 bytes, params: 8, frame: 24
let env0_0 = require;
const _arrayLikeToArray_57182 = function(a0, a1) {
@@ -44,7 +57,7 @@ function _fun57179(global, require, importDefault, importAll, module, exports, d
}
return value;
};
const closure = generateLocalCreationAnswerId;
const generateLocalCreationAnswerId2 = generateLocalCreationAnswerId;
const closure2 = function({text}) {
var r1;
r1 = text?.trim();
@@ -59,28 +72,23 @@ function _fun57179(global, require, importDefault, importAll, module, exports, d
value = new Date(value);
return value.toISOString();
};
const closure4 = getSampleOfVoterUsernamesForAnswer;
const closure5 = formatVoterTooltipText;
const getSampleOfVoterUsernamesForAnswer2 = getSampleOfVoterUsernamesForAnswer;
const formatVoterTooltipText2 = formatVoterTooltipText;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageReactionsStore = importDefault(7150) /* metro dependency 7150: MessageReactionsStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
let value = require(7217) /* metro dependency 7217: PollsConstants */;
let value = PollsConstantsModule;
const env0_8 = value.POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS;
const env0_9 = value.VOTES_TOOLTIP_MAX_USERS;
value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.ChannelTypesSets;
const env0_11 = value.Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollsUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/PollsUtils.tsx');
exports.generateEmptyPollAnswer = function() {
var object = {text: undefined, image: undefined};
object.localCreationAnswerId = generateLocalCreationAnswerId();
return object;
};
exports.generateLocalCreationAnswerId = closure;
exports.generateLocalCreationAnswerId = generateLocalCreationAnswerId2;
exports.filterOutUUID = function(a0) {
return a0.replace(RegExp('\\b[a-f\\d]{8}-(?:[a-f\\d]{4}-){3}[a-f\\d]{12}-\\b', 'i'), '');
};
@@ -117,320 +125,330 @@ function _fun57179(global, require, importDefault, importAll, module, exports, d
exports.getTotalVotes = function(a0) {
return a0.reduce(_fun57206, 0);
};
exports.getSampleOfVoterUsernamesForAnswer = closure4;
exports.formatVoterTooltipText = closure5;
exports.getSampleOfVoterUsernamesForAnswer = getSampleOfVoterUsernamesForAnswer2;
exports.formatVoterTooltipText = formatVoterTooltipText2;
exports.getPollAnswerVotesTooltipText = getPollAnswerVotesTooltipText;
exports.formatPollResultNotificationCenterText = formatPollResultNotificationCenterText;
}
function _createForOfIteratorHelperLoose_57180(a0, a1) { // fn#57180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:290, offset: 0x013de9a9, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
function _createForOfIteratorHelperLoose_57180(a0, a1) { // fn#57180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:290, offset: 0x013de9a9, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
return _fun57181;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_57182(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun57181;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_57182(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_57182(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_57182(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
if (r5) {
}
return _fun57181;
}
return _fun57181;
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun57181() { // fn#57181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:861, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function generateLocalCreationAnswerId() { // fn#57183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1200, offset: 0x013deb1b, size: 37 bytes, params: 1, frame: 11
return (require(491) /* metro dependency 491 */).v4();
}
function generateLocalCreationAnswerId() { // fn#57183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1200, offset: 0x013deb1b, size: 37 bytes, params: 1, frame: 11
return (Module00491Module).v4();
}
function getPollResultsPollName({embeds}, a1) { // fn#57186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1460, offset: 0x013debd8, size: 137 bytes, params: 3, frame: 16
var rawValue;
var r0;
var fields;
var value2;
const property = embeds[0];
let value = undefined;
if (property == null) {
rawValue = value;
} else {
fields = property.fields;
if (fields == null) {
function getPollResultsPollName({embeds}, a1) { // fn#57186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1460, offset: 0x013debd8, size: 137 bytes, params: 3, frame: 16
var rawValue;
var r0;
var fields;
var value2;
const property = embeds[0];
let value = undefined;
if (property == null) {
rawValue = value;
} else {
value2 = fields.find(function(a0) {
return a0.rawName === 'poll_question_text';
});
rawValue = value2 == null ? value : value2.rawValue;
fields = property.fields;
if (fields == null) {
rawValue = value;
} else {
value2 = fields.find(function(a0) {
return a0.rawName === 'poll_question_text';
});
rawValue = value2 == null ? value : value2.rawValue;
}
}
}
const r3 = rawValue ?? '';
if (a1 == null) {
r0 = r3;
} else {
value = require(1862) /* metro dependency 1862: StringUtils */;
value = value.truncateText(r3, a1);
r0 = value;
}
return r0;
}
function getSampleOfVoterUsernamesForAnswer(a0, a1) { // fn#57188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1684, offset: 0x013dec76, size: 291 bytes, params: 3, frame: 23
var r2;
let value = a0.getChannelId();
const getReactions = MessageReactionsStore.getReactions;
const id = a0.id;
const value3 = undefined;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const VOTE = ReactionTypes.VOTE;
const value4 = Reflect.apply(getReactions, MessageReactionsStore, [value, id, {'id': null, 'name': '',
'animated': false, id: a1}, VOTES_TOOLTIP_MAX_USERS, VOTE]);
value = ChannelStore.getChannel(value);
const value5 = null;
if (value5 == value) {
r2 = value5;
} else if (value.isPrivate()) {
r2 = value5;
} else {
value = value.getGuildId();
r2 = value;
}
value = importDefault(22) /* metro dependency 22 */;
const Array = global.Array;
const from = Array.from;
r2 = value5 == value4 ? value3 : value4.values();
r2 = value5 == r2 ? [] : r2;
value = value(Reflect.apply(from, Array, [r2]));
value = value.reject(function(a0) {
return RelationshipStore.isBlockedOrIgnored(a0.id);
});
value = value.take(VOTES_TOOLTIP_MAX_USERS);
value = value.map(_fun57190);
return value.value();
}
function formatVoterTooltipText(a0, a1) { // fn#57191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:2082, offset: 0x013dedfd, size: 625 bytes, params: 3, frame: 22
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const Math = global.Math;
const value = Math.max(0, a1 - a0.length);
return a0.length === 1 ? value > 0 ? intl.formatToPlainString(t['SV/iZn'], {a: a0[0],
n: value}) : a0[0] : a0.length === 2 ? value > 0 ? intl.formatToPlainString(t.YBnZK0, {a: a0[0], b: a0[1],
n: value}) : intl.formatToPlainString(t['O5+f5c'], {a: a0[0],
b: a0[1]}) : a0.length === 3 ? value > 0 ? intl.formatToPlainString(t['ThXp+N'], {a: a0[0], b: a0[1], c: a0[2],
n: value}) : intl.formatToPlainString(t['0UzBM3'], {a: a0[0], b: a0[1],
c: a0[2]}) : intl.formatToPlainString(t.yVX6kE, {n: value});
}
function hasNonVoteReactions({reactions}) { // fn#57194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3072, offset: 0x013df0af, size: 77 bytes, params: 2, frame: 14
var value3;
var me_vote;
var value4;
const value = _createForOfIteratorHelperLoose_57180(reactions);
const value2 = value();
let done = value2.done;
if (done) {
return false;
}
let r1 = value2;
loopExit1: while (true) {
value3 = r1.value;
me_vote = value3.me_vote;
if (me_vote == null) {
break loopExit1;
const r3 = rawValue ?? '';
if (a1 == null) {
r0 = r3;
} else {
value = require(1862) /* metro dependency 1862: StringUtils */;
value = value.truncateText(r3, a1);
r0 = value;
}
value4 = value();
done = value4.done;
return r0;
}
function getSampleOfVoterUsernamesForAnswer(a0, a1) { // fn#57188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:1684, offset: 0x013dec76, size: 291 bytes, params: 3, frame: 23
var r2;
let value = a0.getChannelId();
const messageReactionsStoreBinding = MessageReactionsStore;
const getReactions = messageReactionsStoreBinding.getReactions;
const id = a0.id;
const value3 = undefined;
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
const VOTE = ReactionTypes.VOTE;
const value4 = Reflect.apply(getReactions, messageReactionsStoreBinding, [value, id, {'id': null, 'name': '',
'animated': false, id: a1}, VOTES_TOOLTIP_MAX_USERS, VOTE]);
value = ChannelStore.getChannel(value);
const value5 = null;
if (value5 == value) {
r2 = value5;
} else if (value.isPrivate()) {
r2 = value5;
} else {
value = value.getGuildId();
r2 = value;
}
value = importDefault(22) /* metro dependency 22 */;
const Array = global.Array;
const from = Array.from;
r2 = value5 == value4 ? value3 : value4.values();
r2 = value5 == r2 ? [] : r2;
value = value(Reflect.apply(from, Array, [r2]));
value = value.reject(function(a0) {
return RelationshipStore.isBlockedOrIgnored(a0.id);
});
value = value.take(VOTES_TOOLTIP_MAX_USERS);
value = value.map(_fun57190);
return value.value();
function _fun57190(a0) { // fn#57190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:2027, offset: 0x013dedb5, size: 72 bytes, params: 2, frame: 17
const value = environment.__proto__;
return (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getName(env0_1, env0_0?.id, a0);
}
}
function formatVoterTooltipText(a0, a1) { // fn#57191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:2082, offset: 0x013dedfd, size: 625 bytes, params: 3, frame: 22
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const Math = global.Math;
const value = Math.max(0, a1 - a0.length);
return a0.length === 1 ? value > 0 ? intl.formatToPlainString(t['SV/iZn'], {a: a0[0],
n: value}) : a0[0] : a0.length === 2 ? value > 0 ? intl.formatToPlainString(t.YBnZK0, {a: a0[0], b: a0[1],
n: value}) : intl.formatToPlainString(t['O5+f5c'], {a: a0[0],
b: a0[1]}) : a0.length === 3 ? value > 0 ? intl.formatToPlainString(t['ThXp+N'], {a: a0[0], b: a0[1], c: a0[2],
n: value}) : intl.formatToPlainString(t['0UzBM3'], {a: a0[0], b: a0[1],
c: a0[2]}) : intl.formatToPlainString(t.yVX6kE, {n: value});
}
function hasNonVoteReactions({reactions}) { // fn#57194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3072, offset: 0x013df0af, size: 77 bytes, params: 2, frame: 14
var value3;
var me_vote;
var value4;
const value = _createForOfIteratorHelperLoose_57180(reactions);
const value2 = value();
let done = value2.done;
if (done) {
return false;
}
r1 = value4;
continue;
}
return true;
}
function useCanPostPollsInChannel(a0) { // fn#57195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3249, offset: 0x013df0fc, size: 64 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun57196);
}
function isPollCreationEmpty({length}, a1) { // fn#57197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3510, offset: 0x013df208, size: 46 bytes, params: 3, frame: 12
var r0;
let value = length === 0;
if (value) {
value = a1.find(function(a0) {
return isAnswerFilled(a0);
});
value = value == null;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function createPollServerDataFromCreateRequest(a0) { // fn#57200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3873, offset: 0x013df277, size: 132 bytes, params: 2, frame: 16
var r6;
var r2;
var r3;
var value;
var answers;
var object2;
if (a0 != null) {
value = undefined;
if (a0 == null) {
r2 = value;
} else {
answers = a0.answers;
if (answers == null) {
r2 = value;
r6 = answers;
} else {
r2 = answers.map(_fun57201);
r6 = answers;
let r1 = value2;
loopExit1: while (true) {
value3 = r1.value;
me_vote = value3.me_vote;
if (me_vote == null) {
break loopExit1;
}
value4 = value();
done = value4.done;
if (done) {
return false;
}
r1 = value4;
continue;
}
r3 = (a0 == null ? value : a0.duration) != null ? createPollExpiryTimestamp(a0.duration) : '0';
object2 = {};
copyDataProperties(object2, a0, r6);
object2['expiry'] = r3;
object2['answers'] = r2;
return object2;
return true;
}
}
function getPollResultsReplyPreview(a0) { // fn#57203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4448, offset: 0x013df3bd, size: 120 bytes, params: 2, frame: 17
const messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(a0);
const pollResultsPollName = getPollResultsPollName(a0, POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const Vn97Ka = (require(1244) /* metro dependency 1244: indexNative */).t.Vn97Ka;
return Reflect.apply(format, intl, [Vn97Ka, {username: messageAuthor.nick, title: pollResultsPollName}]);
}
function useCanPostPollsInChannel(a0) { // fn#57195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3249, offset: 0x013df0fc, size: 64 bytes, params: 2, frame: 14
const env0_0 = a0;
return (FluxModule).useStateFromStores([PermissionStore], _fun57196);
function _fun57196() { // fn#57196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3326, offset: 0x013df13c, size: 204 bytes, params: 1, frame: 18
var r1;
var value5;
var POLLS;
var value6;
var isPrivate2;
let r0 = env0_0 != null && env0_0.id !== (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
if (r0) {
value5 = environment.__proto__;
POLLS = ChannelTypesSets.POLLS;
value6 = POLLS.has(env0_0.type);
if (value6) {
isPrivate2 = env0_0.isPrivate();
r1 = isPrivate2 ? !!isPrivate2 : PermissionStore.can(Permissions.SEND_MESSAGES,
env0_0) && PermissionStore.can(Permissions.SEND_POLLS, env0_0);
} else {
r1 = !!value6;
}
r0 = r1;
}
return r0;
}
function getPollResultsReplyPreviewMobile(a0) { // fn#57204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4665, offset: 0x013df435, size: 136 bytes, params: 2, frame: 17
var pollResultsPollName;
var messageAuthor;
var intl;
if ('author' in a0) {
messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(a0);
pollResultsPollName = getPollResultsPollName(a0, POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS);
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return intl.formatToParts((require(1244) /* metro dependency 1244: indexNative */).t.Vn97Ka,
{username: messageAuthor.nick, title: pollResultsPollName});
}
return null;
}
function getTotalVotes(a0) { // fn#57205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4907, offset: 0x013df4bd, size: 26 bytes, params: 2, frame: 13
return a0.reduce(function(a0, {count_details}) {
return a0 + (count_details?.vote ?? 0);
}, 0);
}
function getPollAnswerVotesTooltipText(a0, a1, a2) { // fn#57207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:5192, offset: 0x013df506, size: 154 bytes, params: 4, frame: 18
const message = MessageStore.getMessage(a1, a0);
if (message == null) {
return '';
}
const value3 = '';
const reaction = message.getReaction({'id': null, 'name': '', 'animated': false, id: a2});
const vote = reaction == null || reaction.count_details == null ? undefined : reaction.count_details.vote;
const value6 = 0;
const r3 = vote ?? value6;
const sampleOfVoterUsernamesForAnswer = getSampleOfVoterUsernamesForAnswer(message, a2);
return value6 === sampleOfVoterUsernamesForAnswer.length ? value3 : formatVoterTooltipText(sampleOfVoterUsernamesForAnswer,
r3);
}
function formatPollResultNotificationCenterText(a0) { // fn#57208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:5535, offset: 0x013df5a0, size: 377 bytes, params: 2, frame: 19
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const questionText = a0.questionText;
const victorAnswerText = a0.victorAnswerText;
const victorAnswerVotes = a0.victorAnswerVotes;
const victorAnswerId = a0.victorAnswerId;
const totalVotes = a0.totalVotes;
const totalVotes2 = a0.totalVotes;
const value = 0;
const r9 = totalVotes2 > value ? global.Math.round(victorAnswerVotes / totalVotes * 100) : value;
return value === totalVotes ? intl.formatToPlainString(t['8anM0l'],
{questionText: questionText}) : victorAnswerId != null ? intl.formatToPlainString(t['8yEgvE'],
{questionText: questionText, victorAnswerText: victorAnswerText,
percentage: '' + r9 + '%'}) : intl.formatToPlainString(t.XVk6Zv, {questionText: questionText,
percentage: '' + r9 + '%'});
}
function _fun57190(a0) { // fn#57190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:2027, offset: 0x013dedb5, size: 72 bytes, params: 2, frame: 17
const value = environment.__proto__;
return (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getName(env0_1, env0_0?.id, a0);
}
function _fun57196() { // fn#57196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3326, offset: 0x013df13c, size: 204 bytes, params: 1, frame: 18
var r1;
var value5;
var POLLS;
var value6;
var isPrivate2;
let r0 = env0_0 != null && env0_0.id !== (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
if (r0) {
value5 = environment.__proto__;
POLLS = ChannelTypesSets.POLLS;
value6 = POLLS.has(env0_0.type);
if (value6) {
isPrivate2 = env0_0.isPrivate();
r1 = isPrivate2 ? !!isPrivate2 : PermissionStore.can(Permissions.SEND_MESSAGES,
env0_0) && PermissionStore.can(Permissions.SEND_POLLS, env0_0);
function isPollCreationEmpty({length}, a1) { // fn#57197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3510, offset: 0x013df208, size: 46 bytes, params: 3, frame: 12
var r0;
let value = length === 0;
if (value) {
value = a1.find(function(a0) {
return isAnswerFilled(a0);
});
value = value == null;
r0 = value;
} else {
r1 = !!value6;
r0 = value;
}
r0 = r1;
return r0;
function _fun57198(a0) { // fn#57198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3579, offset: 0x00eed705, size: 19 bytes, params: 2, frame: 11
return isAnswerFilled(a0);
}
}
return r0;
function createPollServerDataFromCreateRequest(a0) { // fn#57200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3873, offset: 0x013df277, size: 132 bytes, params: 2, frame: 16
var r6;
var r2;
var r3;
var value;
var answers;
var object;
if (a0 != null) {
value = undefined;
if (a0 == null) {
r2 = value;
} else {
answers = a0.answers;
if (answers == null) {
r2 = value;
r6 = answers;
} else {
r2 = answers.map(_fun57201);
r6 = answers;
}
}
r3 = (a0 == null ? value : a0.duration) != null ? createPollExpiryTimestamp(a0.duration) : '0';
object = {};
copyDataProperties(object, a0, r6);
object['expiry'] = r3;
object['answers'] = r2;
return object;
}
}
function getPollResultsReplyPreview(a0) { // fn#57203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4448, offset: 0x013df3bd, size: 120 bytes, params: 2, frame: 17
const messageAuthor = (UseMessageAuthorModule).getMessageAuthor(a0);
const pollResultsPollName = getPollResultsPollName(a0, POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS);
const intl = (IndexNativeModule).intl;
const format = intl.format;
const Vn97Ka = (IndexNativeModule).t.Vn97Ka;
return Reflect.apply(format, intl, [Vn97Ka, {username: messageAuthor.nick, title: pollResultsPollName}]);
}
function getPollResultsReplyPreviewMobile(a0) { // fn#57204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4665, offset: 0x013df435, size: 136 bytes, params: 2, frame: 17
var pollResultsPollName;
var messageAuthor;
var intl;
if ('author' in a0) {
messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(a0);
pollResultsPollName = getPollResultsPollName(a0, POLL_RESULT_MESSAGE_POLL_TITLE_MAX_VISIBLE_CHARS);
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return intl.formatToParts((require(1244) /* metro dependency 1244: indexNative */).t.Vn97Ka,
{username: messageAuthor.nick, title: pollResultsPollName});
}
return null;
}
function getTotalVotes(a0) { // fn#57205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4907, offset: 0x013df4bd, size: 26 bytes, params: 2, frame: 13
return a0.reduce(function(a0, {count_details}) {
return a0 + (count_details?.vote ?? 0);
}, 0);
}
function getPollAnswerVotesTooltipText(a0, a1, a2) { // fn#57207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:5192, offset: 0x013df506, size: 154 bytes, params: 4, frame: 18
const message = MessageStore.getMessage(a1, a0);
if (message == null) {
return '';
}
const value3 = '';
const reaction = message.getReaction({'id': null, 'name': '', 'animated': false, id: a2});
const vote = reaction == null || reaction.count_details == null ? undefined : reaction.count_details.vote;
const value6 = 0;
const r3 = vote ?? value6;
const sampleOfVoterUsernamesForAnswer = getSampleOfVoterUsernamesForAnswer(message, a2);
return value6 === sampleOfVoterUsernamesForAnswer.length ? value3 : formatVoterTooltipText(sampleOfVoterUsernamesForAnswer,
r3);
}
function formatPollResultNotificationCenterText(a0) { // fn#57208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:5535, offset: 0x013df5a0, size: 377 bytes, params: 2, frame: 19
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const questionText = a0.questionText;
const victorAnswerText = a0.victorAnswerText;
const victorAnswerVotes = a0.victorAnswerVotes;
const victorAnswerId = a0.victorAnswerId;
const totalVotes = a0.totalVotes;
const totalVotes2 = a0.totalVotes;
const value = 0;
const r9 = totalVotes2 > value ? global.Math.round(victorAnswerVotes / totalVotes * 100) : value;
return value === totalVotes ? intl.formatToPlainString(t['8anM0l'],
{questionText: questionText}) : victorAnswerId != null ? intl.formatToPlainString(t['8yEgvE'],
{questionText: questionText, victorAnswerText: victorAnswerText,
percentage: '' + r9 + '%'}) : intl.formatToPlainString(t.XVk6Zv, {questionText: questionText,
percentage: '' + r9 + '%'});
}
}
function _fun57201(a0, a1) { // fn#57201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:3990, offset: 0x013df2fb, size: 138 bytes, params: 3, frame: 16
@@ -440,8 +458,8 @@ function _fun57201(a0, a1) { // fn#57201, source: /ci/build/discord/discord/disc
const poll_media = a0.poll_media;
let value = undefined;
const emoji = poll_media == null ? value : poll_media.emoji;
const object2 = {};
copyDataProperties(object2, a0.poll_media, r6);
const object = {};
copyDataProperties(object, a0.poll_media, r6);
if (emoji != null) {
name = emoji.name;
value = name != null;
@@ -450,11 +468,18 @@ function _fun57201(a0, a1) { // fn#57201, source: /ci/build/discord/discord/disc
} else {
r3 = value;
}
object2['emoji'] = r3;
const object4 = {};
copyDataProperties(object4, a0, r6);
object4['answer_id'] = a1 + 1;
object4['poll_media'] = object2;
return object4;
object['emoji'] = r3;
const object3 = {};
copyDataProperties(object3, a0, r6);
object3['answer_id'] = a1 + 1;
object3['poll_media'] = object;
return object3;
}
function _fun57206(a0, {count_details}) { // fn#57206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7327:4950, offset: 0x013df4d7, size: 47 bytes, params: 3, frame: 4
return a0 + (count_details?.vote ?? 0);
}
global.__d(_fun57179, 7149, [1379, 7150, 4814, 3784, 3793, 7217, 661, 491, 566, 5225, 672, 1862, 4634, 1244, 7152,
22, 4617,
2]) /* metro module 7149, dependencies: [1379, 7150, 4814, 3784, 3793, 7217, 661, 491, 566, 5225, 672, 1862, 4634, 1244, 7152, 22, 4617, 2] */;
@@ -1,31 +1,33 @@
/* Metro module 8437; source: modules/polls/chat/PollMessageChatDataTypes.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun67000(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8622:6, offset: 0x01c11d98, size: 243 bytes, params: 8, frame: 19
var object4;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object4 = {NONE: 0};
object4[0] = 'NONE';
object4.LOW = 1;
object4[1] = 'LOW';
object4.HIGH = 2;
object4[2] = 'HIGH';
const object5 = {NONE: 0};
object5[0] = 'NONE';
object5.HOLLOW = 1;
object5[1] = 'HOLLOW';
object5.FILLED = 2;
object5[2] = 'FILLED';
object5.CHECKMARK = 3;
object5[3] = 'CHECKMARK';
const object6 = {LIST: 1};
object6[1] = 'LIST';
object6.CHECKBOXES = 2;
object6[2] = 'CHECKBOXES';
object6.RADIO_BUTTONS = 3;
object6[3] = 'RADIO_BUTTONS';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/PollMessageChatDataTypes.tsx');
exports.NativeShadowType = object4;
exports.PollRadioStyle = object5;
exports.PollChatAnswerInteractionType = object6;
object = {NONE: 0};
object[0] = 'NONE';
object.LOW = 1;
object[1] = 'LOW';
object.HIGH = 2;
object[2] = 'HIGH';
const object2 = {NONE: 0};
object2[0] = 'NONE';
object2.HOLLOW = 1;
object2[1] = 'HOLLOW';
object2.FILLED = 2;
object2[2] = 'FILLED';
object2.CHECKMARK = 3;
object2[3] = 'CHECKMARK';
const object3 = {LIST: 1};
object3[1] = 'LIST';
object3.CHECKBOXES = 2;
object3[2] = 'CHECKBOXES';
object3.RADIO_BUTTONS = 3;
object3[3] = 'RADIO_BUTTONS';
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/PollMessageChatDataTypes.tsx');
exports.NativeShadowType = object;
exports.PollRadioStyle = object2;
exports.PollChatAnswerInteractionType = object3;
}
global.__d(_fun67000, 8437, [2]) /* metro module 8437, dependencies: [2] */;
@@ -1,60 +1,71 @@
/* Metro module 8434; source: modules/polls/chat/buildPlatformPollResources.native.tsx; dependencies: [22, 8435, 4501, 697, 8191, 6753, 6810, 1426, 2] */
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as AvatarUtilsModule from '../../../utils/native/AvatarUtils.tsx'; /* Metro dependency 1426 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PollStylesModule from './native/PollStyles.tsx'; /* Metro dependency 8435 */
function _fun66979(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:6, offset: 0x01c11529, size: 168 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importDefault(22) /* metro dependency 22 */;
const env0_3 = value.mapValues((require(8435) /* metro dependency 8435: PollStyles */).pollStyleSets, _fun66980);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/buildPlatformPollResources.native.tsx');
const env0_3 = Module00022.mapValues((PollStylesModule).pollStyleSets, _fun66980);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/buildPlatformPollResources.native.tsx');
exports.buildPlatformPollResources = buildPlatformPollResources;
exports.getAvatarUrl = getAvatarUrl;
function _fun66980(a0) { // fn#66980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:139, offset: 0x01c115d1, size: 65 bytes, params: 2, frame: 12
const env0_0 = a0;
const env0_1 = (CreateStylesModule).createNativeStyleProperties(_fun66981);
return _fun66983;
function _fun66981(a0) { // fn#66981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:186, offset: 0x01c11612, size: 75 bytes, params: 2, frame: 15
var environment;
const binding = env0_0;
let value = environment.__proto__;
value = importDefault(697) /* metro dependency 697: native */;
value = binding(value, a0);
return (importDefault(22) /* metro dependency 22 */).pickBy(value, function(a0) {
var value = typeof a0;
return value !== 'number' && value !== 'boolean';
});
}
function _fun66983(a0, a1) { // fn#66983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:288, offset: 0x01c11678, size: 107 bytes, params: 3, frame: 16
const value3 = env0_0(Native, a1);
const value4 = (importDefault(22) /* metro dependency 22 */).pickBy(value3, function(a0) {
var value = typeof a0;
return value === 'number' || value === 'boolean';
});
const object = {};
copyDataProperties(object, env0_1(a0, a1), value3);
copyDataProperties(object, value4, value3);
return object;
}
}
function buildPlatformPollResources(a0, a1) { // fn#66985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:526, offset: 0x01c116fe, size: 153 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const object = {};
const defaultImport = Module00022;
object.styles = defaultImport.mapValues(env0_3, _fun66986);
object.selectedIcon = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(6753) /* metro dependency 6753 */);
object.checkmarkIcon = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(6810) /* metro dependency 6810 */);
return object;
function _fun66986(a0) { // fn#66986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:602, offset: 0x00e57ee9, size: 24 bytes, params: 2, frame: 13
return a0(env0_0, require);
}
}
function getAvatarUrl(a0, a1) { // fn#66987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:732, offset: 0x01c11797, size: 63 bytes, params: 3, frame: 15
const ensureAvatarSource = AvatarUtilsModule.ensureAvatarSource;
const getAvatarSource = a0.getAvatarSource;
return Reflect.apply(ensureAvatarSource, AvatarUtilsModule, [Reflect.apply(getAvatarSource, a0, [a1, false])]).uri;
}
}
function _fun66980(a0) { // fn#66980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:139, offset: 0x01c115d1, size: 65 bytes, params: 2, frame: 12
const env0_0 = a0;
const env0_1 = (require(4501) /* metro dependency 4501: createStyles */).createNativeStyleProperties(_fun66981);
return _fun66983;
}
function buildPlatformPollResources(a0, a1) { // fn#66985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:526, offset: 0x01c116fe, size: 153 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const object2 = {};
const defaultImport = importDefault(22) /* metro dependency 22 */;
object2.styles = defaultImport.mapValues(env0_3, _fun66986);
object2.selectedIcon = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(6753) /* metro dependency 6753 */);
object2.checkmarkIcon = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(6810) /* metro dependency 6810 */);
return object2;
}
function getAvatarUrl(a0, a1) { // fn#66987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:732, offset: 0x01c11797, size: 63 bytes, params: 3, frame: 15
const value = require(1426) /* metro dependency 1426: AvatarUtils */;
const ensureAvatarSource = value.ensureAvatarSource;
const getAvatarSource = a0.getAvatarSource;
return Reflect.apply(ensureAvatarSource, value, [Reflect.apply(getAvatarSource, a0, [a1, false])]).uri;
}
function _fun66981(a0) { // fn#66981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:186, offset: 0x01c11612, size: 75 bytes, params: 2, frame: 15
var environment;
const binding = env0_0;
let value = environment.__proto__;
value = importDefault(697) /* metro dependency 697: native */;
value = binding(value, a0);
return (importDefault(22) /* metro dependency 22 */).pickBy(value, function(a0) {
var value = typeof a0;
return value !== 'number' && value !== 'boolean';
});
}
function _fun66983(a0, a1) { // fn#66983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8619:288, offset: 0x01c11678, size: 107 bytes, params: 3, frame: 16
const value3 = env0_0(importDefault(697) /* metro dependency 697: native */, a1);
const value4 = (importDefault(22) /* metro dependency 22 */).pickBy(value3, function(a0) {
var value = typeof a0;
return value === 'number' || value === 'boolean';
});
const object2 = {};
copyDataProperties(object2, env0_1(a0, a1), value3);
copyDataProperties(object2, value4, value3);
return object2;
}
global.__d(_fun66979, 8434, [22, 8435, 4501, 697, 8191, 6753, 6810, 1426,
2]) /* metro module 8434, dependencies: [22, 8435, 4501, 697, 8191, 6753, 6810, 1426, 2] */;
@@ -1,18 +1,23 @@
/* Metro module 8438; source: modules/polls/chat/buildPollResources.tsx; dependencies: [8434, 22, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00022Module from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
import * as BuildPlatformPollResourcesNativeModule from './buildPlatformPollResources.native.tsx'; /* Metro dependency 8434 */
function _fun67001(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8623:6, offset: 0x01c11e8b, size: 127 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(22) /* metro dependency 22 */;
let value = Module00022Module;
value = value.memoize(buildPollResources, function({theme, layoutType}) {
return '' + theme + ':' + layoutType;
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/buildPollResources.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/buildPollResources.tsx');
exports.default = value;
function buildPollResources({theme, layoutType}) { // fn#67002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8623:115, offset: 0x01c11f0a, size: 53 bytes, params: 2, frame: 14
return (BuildPlatformPollResourcesNativeModule).buildPlatformPollResources(theme,
layoutType);
}
}
function buildPollResources({theme, layoutType}) { // fn#67002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8623:115, offset: 0x01c11f0a, size: 53 bytes, params: 2, frame: 14
return (require(8434) /* metro dependency 8434: buildPlatformPollResourcesNative */).buildPlatformPollResources(theme,
layoutType);
}
global.__d(_fun67001, 8438, [8434, 22, 2]) /* metro module 8438, dependencies: [8434, 22, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,14 @@
/* Metro module 8435; source: modules/polls/chat/native/PollStyles.tsx; dependencies: [4242, 8436, 8437, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module04242Module from '../../../../by-id/module-04242.js'; /* Metro dependency 4242 */
import * as PollLayoutTypesModule from '../../../../external/discord_common/js/shared/shared-constants/PollLayoutTypes.tsx'; /* Metro dependency 8436 */
import * as PollMessageChatDataTypesModule from '../PollMessageChatDataTypes.tsx'; /* Metro dependency 8437 */
function _fun66988(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:6, offset: 0x01c117d6, size: 215 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {loserSelected: function(a0, a1) {
object = {loserSelected: function(a0, a1) {
var object = {};
var notVotedBinding = notVoted;
copyDataProperties(object, notVotedBinding(a0, a1), notVotedBinding);
@@ -13,7 +17,7 @@ function _fun66988(global, require, importDefault, importAll, module, exports, d
object['radioBackground'] = a0.colors.INTERACTIVE_TEXT_ACTIVE;
object['radioForeground'] = a0.colors.BACKGROUND_BASE_LOW;
return object;
}, normal: normal, notVoted: function(a0, a1) {
}, normal: normal_66989, notVoted: function(a0, a1) {
var object = {};
var normalVoteBinding = normalVote;
copyDataProperties(object, normalVoteBinding(a0, a1), normalVoteBinding);
@@ -32,100 +36,101 @@ function _fun66988(global, require, importDefault, importAll, module, exports, d
return object;
}, voted: voted, normalVote: function(a0, a1) {
var object = {};
var normalBinding = normal;
copyDataProperties(object, normalBinding(a0, a1), normalBinding);
var normal_66989Binding = normal_66989;
copyDataProperties(object, normal_66989Binding(a0, a1), normal_66989Binding);
object['borderWidth'] = 0;
return object;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/native/PollStyles.tsx');
exports.pollStyleSets = object2;
}
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/native/PollStyles.tsx');
exports.pollStyleSets = object;
function normal_66989(a0, a1) { // fn#66989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:103, offset: 0x01c118ad, size: 260 bytes, params: 3, frame: 20
const env0_0 = a0;
const object = {};
const BORDER_SUBTLE = a0.colors.BORDER_SUBTLE;
object.border = BORDER_SUBTLE;
object.borderWidth = 1;
const CARD_SECONDARY_BG = a0.colors.CARD_SECONDARY_BG;
object.fill = CARD_SECONDARY_BG;
let value = Module04242Module;
value = value.match(a1);
const PollLayoutTypes = (PollLayoutTypesModule).PollLayoutTypes;
const IMAGE_ONLY_ANSWERS = PollLayoutTypes.IMAGE_ONLY_ANSWERS;
value = value.with(IMAGE_ONLY_ANSWERS, _fun66990);
object.label = value.otherwise(_fun66991);
object.opacity = 1;
const BACKGROUND_MOD_MUTED = a0.colors.BACKGROUND_MOD_MUTED;
object.answerBackground = BACKGROUND_MOD_MUTED;
const BACKGROUND_MOD_SUBTLE = a0.colors.BACKGROUND_MOD_SUBTLE;
object.answerFill = BACKGROUND_MOD_SUBTLE;
const PollRadioStyle = (PollMessageChatDataTypesModule).PollRadioStyle;
const HOLLOW = PollRadioStyle.HOLLOW;
object.radioStyle = HOLLOW;
const INTERACTIVE_TEXT_ACTIVE = a0.colors.INTERACTIVE_TEXT_ACTIVE;
object.radioBackground = INTERACTIVE_TEXT_ACTIVE;
const WHITE = a0.colors.WHITE;
object.radioForeground = WHITE;
return object;
function _fun66990() { // fn#66990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:260, offset: 0x01c119b1, size: 20 bytes, params: 1, frame: 1
return env0_0.colors.WHITE;
}
function normal(a0, a1) { // fn#66989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:103, offset: 0x01c118ad, size: 260 bytes, params: 3, frame: 20
const env0_0 = a0;
const object2 = {};
const BORDER_SUBTLE = a0.colors.BORDER_SUBTLE;
object2.border = BORDER_SUBTLE;
object2.borderWidth = 1;
const CARD_SECONDARY_BG = a0.colors.CARD_SECONDARY_BG;
object2.fill = CARD_SECONDARY_BG;
let value = require(4242) /* metro dependency 4242 */;
value = value.match(a1);
const PollLayoutTypes = (require(8436) /* metro dependency 8436: PollLayoutTypes */).PollLayoutTypes;
const IMAGE_ONLY_ANSWERS = PollLayoutTypes.IMAGE_ONLY_ANSWERS;
value = value.with(IMAGE_ONLY_ANSWERS, _fun66990);
object2.label = value.otherwise(_fun66991);
object2.opacity = 1;
const BACKGROUND_MOD_MUTED = a0.colors.BACKGROUND_MOD_MUTED;
object2.answerBackground = BACKGROUND_MOD_MUTED;
const BACKGROUND_MOD_SUBTLE = a0.colors.BACKGROUND_MOD_SUBTLE;
object2.answerFill = BACKGROUND_MOD_SUBTLE;
const PollRadioStyle = (require(8437) /* metro dependency 8437: PollMessageChatDataTypes */).PollRadioStyle;
const HOLLOW = PollRadioStyle.HOLLOW;
object2.radioStyle = HOLLOW;
const INTERACTIVE_TEXT_ACTIVE = a0.colors.INTERACTIVE_TEXT_ACTIVE;
object2.radioBackground = INTERACTIVE_TEXT_ACTIVE;
const WHITE = a0.colors.WHITE;
object2.radioForeground = WHITE;
return object2;
}
function _fun66991() { // fn#66991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:292, offset: 0x01c119c5, size: 20 bytes, params: 1, frame: 1
return env0_0.colors.TEXT_DEFAULT;
}
function victorNotSelected(a0, a1) { // fn#66994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:739, offset: 0x01c11a65, size: 129 bytes, params: 3, frame: 15
const object2 = {};
const normalVoteBinding = normalVote;
copyDataProperties(object2, normalVoteBinding(a0, a1), normalVoteBinding);
const STATUS_POSITIVE = a0.colors.STATUS_POSITIVE;
object2['border'] = STATUS_POSITIVE;
object2['borderWidth'] = 1;
const POLLS_VICTOR_FILL = a0.colors.POLLS_VICTOR_FILL;
object2['answerFill'] = POLLS_VICTOR_FILL;
const PollRadioStyle = (require(8437) /* metro dependency 8437: PollMessageChatDataTypes */).PollRadioStyle;
const NONE = PollRadioStyle.NONE;
object2['radioStyle'] = NONE;
return object2;
}
}
function selected(a0, a1) { // fn#66996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:1116, offset: 0x01c11b5d, size: 151 bytes, params: 3, frame: 15
const object2 = {};
const normalVoteBinding = normalVote;
copyDataProperties(object2, normalVoteBinding(a0, a1), normalVoteBinding);
const BACKGROUND_BRAND = a0.colors.BACKGROUND_BRAND;
object2['border'] = BACKGROUND_BRAND;
object2['borderWidth'] = 1;
const PollRadioStyle = (require(8437) /* metro dependency 8437: PollMessageChatDataTypes */).PollRadioStyle;
const FILLED = PollRadioStyle.FILLED;
object2['radioStyle'] = FILLED;
const REDESIGN_INPUT_CONTROL_SELECTED = a0.colors.REDESIGN_INPUT_CONTROL_SELECTED;
object2['radioBackground'] = REDESIGN_INPUT_CONTROL_SELECTED;
const STATUS_POSITIVE_TEXT = a0.colors.STATUS_POSITIVE_TEXT;
object2['radioForeground'] = STATUS_POSITIVE_TEXT;
return object2;
}
function victorNotSelected(a0, a1) { // fn#66994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:739, offset: 0x01c11a65, size: 129 bytes, params: 3, frame: 15
const object = {};
const normalVoteBinding = normalVote;
copyDataProperties(object, normalVoteBinding(a0, a1), normalVoteBinding);
const STATUS_POSITIVE = a0.colors.STATUS_POSITIVE;
object['border'] = STATUS_POSITIVE;
object['borderWidth'] = 1;
const POLLS_VICTOR_FILL = a0.colors.POLLS_VICTOR_FILL;
object['answerFill'] = POLLS_VICTOR_FILL;
const PollRadioStyle = (PollMessageChatDataTypesModule).PollRadioStyle;
const NONE = PollRadioStyle.NONE;
object['radioStyle'] = NONE;
return object;
}
function voted(a0, a1) { // fn#66998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:1562, offset: 0x01c11c6b, size: 173 bytes, params: 3, frame: 15
const object2 = {};
const normalVoteBinding = normalVote;
copyDataProperties(object2, normalVoteBinding(a0, a1), normalVoteBinding);
const BACKGROUND_BRAND = a0.colors.BACKGROUND_BRAND;
object2['border'] = BACKGROUND_BRAND;
object2['borderWidth'] = 1;
const POLLS_VOTED_FILL = a0.colors.POLLS_VOTED_FILL;
object2['answerFill'] = POLLS_VOTED_FILL;
const PollRadioStyle = (require(8437) /* metro dependency 8437: PollMessageChatDataTypes */).PollRadioStyle;
const CHECKMARK = PollRadioStyle.CHECKMARK;
object2['radioStyle'] = CHECKMARK;
const REDESIGN_INPUT_CONTROL_SELECTED = a0.colors.REDESIGN_INPUT_CONTROL_SELECTED;
object2['radioBackground'] = REDESIGN_INPUT_CONTROL_SELECTED;
const STATUS_POSITIVE_TEXT = a0.colors.STATUS_POSITIVE_TEXT;
object2['radioForeground'] = STATUS_POSITIVE_TEXT;
return object2;
}
function selected(a0, a1) { // fn#66996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:1116, offset: 0x01c11b5d, size: 151 bytes, params: 3, frame: 15
const object = {};
const normalVoteBinding = normalVote;
copyDataProperties(object, normalVoteBinding(a0, a1), normalVoteBinding);
const BACKGROUND_BRAND = a0.colors.BACKGROUND_BRAND;
object['border'] = BACKGROUND_BRAND;
object['borderWidth'] = 1;
const PollRadioStyle = (PollMessageChatDataTypesModule).PollRadioStyle;
const FILLED = PollRadioStyle.FILLED;
object['radioStyle'] = FILLED;
const REDESIGN_INPUT_CONTROL_SELECTED = a0.colors.REDESIGN_INPUT_CONTROL_SELECTED;
object['radioBackground'] = REDESIGN_INPUT_CONTROL_SELECTED;
const STATUS_POSITIVE_TEXT = a0.colors.STATUS_POSITIVE_TEXT;
object['radioForeground'] = STATUS_POSITIVE_TEXT;
return object;
}
function _fun66990() { // fn#66990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:260, offset: 0x01c119b1, size: 20 bytes, params: 1, frame: 1
return env0_0.colors.WHITE;
}
function voted(a0, a1) { // fn#66998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:1562, offset: 0x01c11c6b, size: 173 bytes, params: 3, frame: 15
const object = {};
const normalVoteBinding = normalVote;
copyDataProperties(object, normalVoteBinding(a0, a1), normalVoteBinding);
const BACKGROUND_BRAND = a0.colors.BACKGROUND_BRAND;
object['border'] = BACKGROUND_BRAND;
object['borderWidth'] = 1;
const POLLS_VOTED_FILL = a0.colors.POLLS_VOTED_FILL;
object['answerFill'] = POLLS_VOTED_FILL;
const PollRadioStyle = (PollMessageChatDataTypesModule).PollRadioStyle;
const CHECKMARK = PollRadioStyle.CHECKMARK;
object['radioStyle'] = CHECKMARK;
const REDESIGN_INPUT_CONTROL_SELECTED = a0.colors.REDESIGN_INPUT_CONTROL_SELECTED;
object['radioBackground'] = REDESIGN_INPUT_CONTROL_SELECTED;
const STATUS_POSITIVE_TEXT = a0.colors.STATUS_POSITIVE_TEXT;
object['radioForeground'] = STATUS_POSITIVE_TEXT;
return object;
}
function _fun66991() { // fn#66991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8620:292, offset: 0x01c119c5, size: 20 bytes, params: 1, frame: 1
return env0_0.colors.TEXT_DEFAULT;
}
global.__d(_fun66988, 8435, [4242, 8436, 8437, 2]) /* metro module 8435, dependencies: [4242, 8436, 8437, 2] */;
@@ -1,35 +1,40 @@
/* Metro module 8433; source: modules/polls/chat/useFormattedExpirationLabel.tsx; dependencies: [3738, 1244, 2] */
import Module03738 from '../../../by-id/module-03738.js'; /* Metro dependency 3738 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
function _fun66976(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8618:6, offset: 0x01c1136e, size: 120 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = formatExpirationLabel;
const formatExpirationLabel2 = formatExpirationLabel;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/useFormattedExpirationLabel.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/useFormattedExpirationLabel.tsx');
exports.default = useFormattedExpirationLabel;
exports.formatExpirationLabel = closure;
}
function formatExpirationLabel(a0) { // fn#66977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8618:43, offset: 0x01c113e6, size: 294 bytes, params: 2, frame: 19
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const value2 = (importDefault(3738) /* metro dependency 3738 */)();
if (a0 <= value2) {
return undefined;
}
const value3 = a0.diff(value2, 'days');
if (value3 > 1) {
return intl.formatToPlainString(t.dex68a, {days: value3});
exports.formatExpirationLabel = formatExpirationLabel2;
function formatExpirationLabel(a0) { // fn#66977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8618:43, offset: 0x01c113e6, size: 294 bytes, params: 2, frame: 19
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const value2 = (Module03738)();
if (a0 <= value2) {
return undefined;
}
const value3 = a0.diff(value2, 'days');
if (value3 > 1) {
return intl.formatToPlainString(t.dex68a, {days: value3});
}
const value4 = a0.diff(value2, 'hours');
if (value4 > 1) {
return intl.formatToPlainString(t.BWqf0c, {hours: value4});
}
return intl.formatToPlainString(t['3SLXAz'], {minutes: a0.diff(value2, 'minutes')});
}
const value4 = a0.diff(value2, 'hours');
if (value4 > 1) {
return intl.formatToPlainString(t.BWqf0c, {hours: value4});
}
return intl.formatToPlainString(t['3SLXAz'], {minutes: a0.diff(value2, 'minutes')});
}
function useFormattedExpirationLabel(a0) { // fn#66978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8618:544, offset: 0x01c1150c, size: 29 bytes, params: 2, frame: 11
if (a0 != null) {
return formatExpirationLabel(a0);
function useFormattedExpirationLabel(a0) { // fn#66978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8618:544, offset: 0x01c1150c, size: 29 bytes, params: 2, frame: 11
if (a0 != null) {
return formatExpirationLabel(a0);
}
}
}
global.__d(_fun66976, 8433, [3738, 1244, 2]) /* metro module 8433, dependencies: [3738, 1244, 2] */;
@@ -1,42 +1,44 @@
/* Metro module 11404; source: modules/polls/chat/usePollMessageContextItemTypes.tsx; dependencies: [1226, 566, 2] */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
function _fun87385(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11590:6, offset: 0x01fbcdfb, size: 148 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
object2 = {END_EARLY: 0};
object2[0] = 'END_EARLY';
object = {END_EARLY: 0};
object[0] = 'END_EARLY';
const env0_4 = [];
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/chat/usePollMessageContextItemTypes.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/chat/usePollMessageContextItemTypes.tsx');
exports.default = usePollMessageContextItemTypes;
exports.PollMessageContextItemTypes = object2;
}
function usePollMessageContextItemTypes(a0) { // fn#87386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11590:265, offset: 0x01fbce8f, size: 175 bytes, params: 2, frame: 17
var expiry;
var isSameOrBefore;
var Date;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let items2 = [AuthenticationStore];
const id = Reflect.apply(useStateFromStores, fluxModule, [items2, function() {
return AuthenticationStore.getId();
}]);
const poll = a0.poll;
if (a0.isPoll()) {
if (poll == null) {
return env0_4;
exports.PollMessageContextItemTypes = object;
function usePollMessageContextItemTypes(a0) { // fn#87386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11590:265, offset: 0x01fbce8f, size: 175 bytes, params: 2, frame: 17
var expiry;
var isSameOrBefore;
var Date;
const useStateFromStores = FluxModule.useStateFromStores;
let items2 = [AuthenticationStore];
const id = Reflect.apply(useStateFromStores, FluxModule, [items2, function() {
return AuthenticationStore.getId();
}]);
const poll = a0.poll;
if (a0.isPoll()) {
if (poll == null) {
return env0_4;
}
items2 = [];
expiry = poll.expiry;
isSameOrBefore = expiry.isSameOrBefore;
Date = global.Date;
if (!Reflect.apply(isSameOrBefore, expiry, [Date.now()]) && a0.author.id === id) {
items2.push(env0_3.END_EARLY);
}
return items2;
}
items2 = [];
expiry = poll.expiry;
isSameOrBefore = expiry.isSameOrBefore;
Date = global.Date;
if (!Reflect.apply(isSameOrBefore, expiry, [Date.now()]) && a0.author.id === id) {
items2.push(env0_3.END_EARLY);
}
return items2;
return env0_4;
}
return env0_4;
}
global.__d(_fun87385, 11404, [1226, 566, 2]) /* metro module 11404, dependencies: [1226, 566, 2] */;
@@ -1,93 +1,153 @@
/* Metro module 11750; source: modules/polls/native/EditPollCreationImageAltTextModal.tsx; dependencies: [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467, 8127, 7972, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import KeyboardAwareView from '../../keyboard/native/KeyboardAwareView.tsx'; /* Metro dependency 5467 */
import Module08160 from '../../../by-id/module-08160.js'; /* Metro dependency 8160 */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as EditPollCreationImageAltTextModalActionCreatorsModule from './EditPollCreationImageAltTextModalActionCreators.tsx'; /* Metro dependency 11749 */
function _fun90052(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:6, offset: 0x020286fc, size: 473 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_5 = value.TouchableOpacity;
const env0_6 = value.View;
const env0_7 = (require(7217) /* metro dependency 7217: PollsConstants */).MAX_POLL_ANSWER_LENGTH;
value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object2.header = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 18,
object.container = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object.header = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 18,
'paddingTop': 10};
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
object2.separator = {borderBottomWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
object2.contentContainer = {'flex': 1, 'justifyContent': 'center'};
const object3 = {'borderRadius': null, 'justifyContent': 'center', 'alignItems': 'center', 'alignSelf': 'center',
object.separator = {borderBottomWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
object.contentContainer = {'flex': 1, 'justifyContent': 'center'};
const object4 = {'borderRadius': null, 'justifyContent': 'center', 'alignItems': 'center', 'alignSelf': 'center',
'overflow': 'hidden', 'aspectRatio': 1};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.imageContainer = object3;
object2.formContainer = {paddingHorizontal: 16};
const object5 = {};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.imageContainer = object4;
object.formContainer = {paddingHorizontal: 16};
const object6 = {};
const REDESIGN_CHAT_INPUT_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_CHAT_INPUT_BACKGROUND;
object5.backgroundColor = REDESIGN_CHAT_INPUT_BACKGROUND;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.textInput = object5;
const env0_10 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModal.tsx');
object6.backgroundColor = REDESIGN_CHAT_INPUT_BACKGROUND;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.textInput = object6;
const env0_10 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModal.tsx');
exports.default = EditPollCreationImageAltTextModal;
}
function EditPollCreationImageAltTextModal({channelId, answer, onSave, imageSize}) { // fn#90053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:844, offset: 0x020288d5, size: 1096 bytes, params: 2, frame: 40
const styles = useStyles();
const {renderImage,
upload} = (UseRenderPollAnswerImage)(channelId,
answer.localCreationAnswerId, answer.image, imageSize, imageSize);
const useState = ReactModule.useState;
const value6 = Module00057(Reflect.apply(useState, ReactModule, [upload?.description ?? '']), 2);
const property = value6[0];
const property2 = value6[1];
const value7 = ReactModule.useCallback(_fun90054, [onSave, property]);
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const closeEditPollCreationImageAltTextModal = (EditPollCreationImageAltTextModalActionCreatorsModule).closeEditPollCreationImageAltTextModal;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const Icon = (NativeModule).Icon;
const items3 = [
<TouchableOpacity
onPress={closeEditPollCreationImageAltTextModal}
activeOpacity={0.5}
accessibilityRole="button"
accessibilityLabel={Reflect.apply(string, intl, [cpT0Cq])}
>
<Icon source={Module08160} />
</TouchableOpacity>,
];
const Text = (TextModule).Text;
string = intl.string;
const Cq44Rg = (require(1244) /* metro dependency 1244: indexNative */).t.Cq44Rg;
items3[1] = (
<Text variant="redesign/heading-18/bold" color="mobile-text-heading-primary">
{Reflect.apply(string, intl, [Cq44Rg])}
</Text>
);
items3[2] = (
<TouchableOpacity onPress={value7} activeOpacity={0.5}>
<Text variant="text-md/medium" color="text-brand">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+'])}
</Text>
</TouchableOpacity>
);
const items2 = [
<View style={styles.header}>
{items3}
</View>,
];
items2[1] = <View style={styles.separator} />;
const view = (
<View style={styles.imageContainer}>
{renderImage}
</View>
);
const Spacer = (NativeModule).Spacer;
const items4 = [
<Spacer size={27} />,
];
items4[1] = ((Component) => <Component>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}</Component>)(importDefault(8127) /* metro dependency 8127: FormHeader */);
const FormInput = (NativeModule2).FormInput;
const ClearButtonVisibility = (NativeModule).ClearButtonVisibility;
const WITH_CONTENT = ClearButtonVisibility.WITH_CONTENT;
items4[2] = (
<FormInput
showTopContainer={false}
showBorder={false}
multiline={false}
value={property}
onChange={property2}
clearButtonVisibility={WITH_CONTENT}
style={styles.textInput}
textContentType="none"
maxLength={MAX_POLL_ANSWER_LENGTH}
autoFocus
autoCorrect
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}
/>
);
items4[3] = <Spacer size={27} />;
items2[2] = (
<KeyboardAwareView style={styles.contentContainer}>
{view}
<View style={styles.formContainer}>
{items4}
</View>
</KeyboardAwareView>
);
return (
<SafeAreaPaddingView top style={styles.container}>
{items2}
</SafeAreaPaddingView>
);
function _fun90054() { // fn#90054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:1118, offset: 0x02028d1d, size: 65 bytes, params: 1, frame: 11
if (env0_1 != null) {
onSave(env0_1);
}
const value = environment.__proto__;
(EditPollCreationImageAltTextModalActionCreatorsModule).closeEditPollCreationImageAltTextModal();
}
function EditPollCreationImageAltTextModal({channelId, answer, onSave, imageSize}) { // fn#90053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:844, offset: 0x020288d5, size: 1096 bytes, params: 2, frame: 40
const styles = useStyles();
const {renderImage,
upload} = (importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */)(channelId,
answer.localCreationAnswerId, answer.image, imageSize, imageSize);
const binding = env0_4;
const useState = binding.useState;
const value6 = env0_3(Reflect.apply(useState, binding, [upload?.description ?? '']), 2);
const property = value6[0];
const property2 = value6[1];
const value7 = env0_4.useCallback(_fun90054, [onSave, property]);
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const closeEditPollCreationImageAltTextModal = (require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).closeEditPollCreationImageAltTextModal;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const items3 = [<TouchableOpacity onPress={closeEditPollCreationImageAltTextModal} activeOpacity={0.5} accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
intl, [cpT0Cq])}><Icon source={importDefault(8160) /* metro dependency 8160 */} /></TouchableOpacity>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Cq44Rg = (require(1244) /* metro dependency 1244: indexNative */).t.Cq44Rg;
items3[1] = <Text variant="redesign/heading-18/bold" color="mobile-text-heading-primary">{Reflect.apply(string,
intl, [Cq44Rg])}</Text>;
items3[2] = <TouchableOpacity onPress={value7} activeOpacity={0.5}><Text variant="text-md/medium" color="text-brand">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+'])}</Text></TouchableOpacity>;
const items2 = [<View style={styles.header}>{items3}</View>];
items2[1] = <View style={styles.separator} />;
const KeyboardAwareView = importDefault(5467) /* metro dependency 5467: KeyboardAwareView */;
const view = <View style={styles.imageContainer}>{renderImage}</View>;
const Spacer = (require(1305) /* metro dependency 1305: native */).Spacer;
const items4 = [<Spacer size={27} />];
items4[1] = ((Component) => <Component>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}</Component>)(importDefault(8127) /* metro dependency 8127: FormHeader */);
const FormInput = (require(7972) /* metro dependency 7972: native */).FormInput;
const ClearButtonVisibility = (require(1305) /* metro dependency 1305: native */).ClearButtonVisibility;
const WITH_CONTENT = ClearButtonVisibility.WITH_CONTENT;
items4[2] = <FormInput showTopContainer={false} showBorder={false} multiline={false} value={property} onChange={property2} clearButtonVisibility={WITH_CONTENT} style={styles.textInput} textContentType="none" maxLength={MAX_POLL_ANSWER_LENGTH} autoFocus autoCorrect accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])} />;
items4[3] = <Spacer size={27} />;
items2[2] = <KeyboardAwareView style={styles.contentContainer}>{view}<View style={styles.formContainer}>{items4}</View></KeyboardAwareView>;
return (
<SafeAreaPaddingView top style={styles.container}>
{items2}
</SafeAreaPaddingView>
);
}
function _fun90054() { // fn#90054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:1118, offset: 0x02028d1d, size: 65 bytes, params: 1, frame: 11
if (env0_1 != null) {
onSave(env0_1);
}
const value = environment.__proto__;
(require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).closeEditPollCreationImageAltTextModal();
}
global.__d(_fun90052, 11750, [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467,
8127, 7972,
2]) /* metro module 11750, dependencies: [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467, 8127, 7972, 2] */;
@@ -1,22 +1,26 @@
/* Metro module 11749; source: modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx; dependencies: [5080, 11750, 1962, 2] */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun90049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:6, offset: 0x0202860b, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx');
exports.openEditPollCreationImageAltTextModal = openEditPollCreationImageAltTextModal;
exports.closeEditPollCreationImageAltTextModal = closeEditPollCreationImageAltTextModal;
function openEditPollCreationImageAltTextModal(a0) { // fn#90050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:286, offset: 0x0202867f, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'edit-poll-creation-image-alt-text-modal']);
}
function closeEditPollCreationImageAltTextModal() { // fn#90051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:376, offset: 0x020286d1, size: 43 bytes, params: 1, frame: 12
(ModalActionCreators).popWithKey('edit-poll-creation-image-alt-text-modal');
}
}
function openEditPollCreationImageAltTextModal(a0) { // fn#90050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:286, offset: 0x0202867f, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'edit-poll-creation-image-alt-text-modal']);
}
function closeEditPollCreationImageAltTextModal() { // fn#90051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:376, offset: 0x020286d1, size: 43 bytes, params: 1, frame: 12
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('edit-poll-creation-image-alt-text-modal');
}
global.__d(_fun90049, 11749, [5080, 11750, 1962, 2]) /* metro module 11749, dependencies: [5080, 11750, 1962, 2] */;
@@ -1,80 +1,127 @@
/* Metro module 11748; source: modules/polls/native/ImageInputActionSheet.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as ActionSheetRowNativeModule from '../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as EditPollCreationImageAltTextModalActionCreatorsModule from './EditPollCreationImageAltTextModalActionCreators.tsx'; /* Metro dependency 11749 */
function _fun90043(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:6, offset: 0x020280a8, size: 283 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const env0_5 = (require(7217) /* metro dependency 7217: PollsConstants */).POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY;
let value = require(33) /* metro dependency 33 */;
let value = JsxRuntimeModule;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {marginRight: 12};
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const object2 = {marginRight: 12};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const env0_8 = Reflect.apply(createStyles, value, [{emojiContainer: {'flexDirection': 'row', 'alignItems': 'center',
'marginHorizontal': 24}, emojiIcon: object}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/ImageInputActionSheet.tsx');
'marginHorizontal': 24}, emojiIcon: object2}]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/ImageInputActionSheet.tsx');
exports.default = ImageInputAnswerActionSheet;
}
function ImageInputAnswerActionSheet({channelId, index, answer, onSaveAltText, onRemoveAnswerImage, openExpressionPicker}) { // fn#90044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:452, offset: 0x020281c3, size: 884 bytes, params: 2, frame: 35
var r5;
var items3;
var Text;
const styles = useStyles();
const defaultImport = UseRenderPollAnswerImage;
const localCreationAnswerId = answer.localCreationAnswerId;
let image = answer.image;
const {renderImage, upload} = defaultImport(channelId, localCreationAnswerId, image, 40, 40);
const r12 = upload != null || answer.image?.emoji != null;
const env0_6 = onSaveAltText.useCallback(function() {
require(dependencyMap[7]).dismissKeyboard();
importDefault(dependencyMap[8]).hideActionSheet(POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY);
}, []);
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
if (r12) {
var viewBindingProps = {style: styles.emojiContainer};
items3 = [
<View style={styles.emojiIcon}>
{renderImage}
</View>,
];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
image = answer.image;
items3[1] = (
<Text variant="text-md/bold" color="mobile-text-heading-primary">
{':' + (image == null || image.emoji == null ? undefined : image.emoji.name) + ':'}
</Text>
);
r5 = (
<View {...viewBindingProps}>
{items3}
</View>
);
} else {
r5 = r12;
}
const items2 = [r5];
const Spacer = (NativeModule).Spacer;
items2[1] = <Spacer size={21} />;
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
const Group = ActionSheetRow.Group;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
items2[2] = (
<Group hasIcons={false}>
<ActionSheetRow
label={r12 ? Reflect.apply(string, intl, [t.CZeRhU]) : Reflect.apply(string, intl, [t.dzcU1Q])}
onPress={onPress_90046}
/>
{
upload != null
? (
<ActionSheetRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w7x2t4)}
onPress={onPress_90047}
/>
)
: null
}
{
r12
? (
<ActionSheetRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.IhMxgu)}
onPress={onPress_90048}
/>
)
: null
}
</Group>
);
return (
<ActionSheet startExpanded>
{items2}
</ActionSheet>
);
function ImageInputAnswerActionSheetOnPress() { // fn#90046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1296, owner: ImageInputAnswerActionSheet.onPress, offset: 0x0202857b, size: 23 bytes, params: 1, frame: 10
env0_6();
openExpressionPicker();
}
function ImageInputAnswerActionSheetOnPress_90047() { // fn#90047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1401, owner: ImageInputAnswerActionSheet.onPress, offset: 0x02028592, size: 93 bytes, params: 1, frame: 14
env0_6();
(EditPollCreationImageAltTextModalActionCreatorsModule).openEditPollCreationImageAltTextModal({channelId: channelId,
answer: answer, index: index, onSave: onSaveAltText, imageSize: 40});
}
function ImageInputAnswerActionSheetOnPress_90048() { // fn#90048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1602, owner: ImageInputAnswerActionSheet.onPress, offset: 0x020285ef, size: 28 bytes, params: 1, frame: 12
onRemoveAnswerImage(index);
env0_6();
}
function ImageInputAnswerActionSheet({channelId, index, answer, onSaveAltText, onRemoveAnswerImage, openExpressionPicker}) { // fn#90044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:452, offset: 0x020281c3, size: 884 bytes, params: 2, frame: 35
var r5;
var items3;
var Text;
const styles = useStyles();
const defaultImport = importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */;
const localCreationAnswerId = answer.localCreationAnswerId;
let image = answer.image;
const {renderImage, upload} = defaultImport(channelId, localCreationAnswerId, image, 40, 40);
const r12 = upload != null || answer.image?.emoji != null;
const env0_6 = onSaveAltText.useCallback(function() {
require(dependencyMap[7]).dismissKeyboard();
importDefault(dependencyMap[8]).hideActionSheet(POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY);
}, []);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
if (r12) {
var viewBindingProps = {style: styles.emojiContainer};
items3 = [<View style={styles.emojiIcon}>{renderImage}</View>];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
image = answer.image;
items3[1] = <Text variant="text-md/bold" color="mobile-text-heading-primary">{':' + (image == null || image.emoji == null ? undefined : image.emoji.name) + ':'}</Text>;
r5 = <View {...viewBindingProps}>{items3}</View>;
} else {
r5 = r12;
}
const items2 = [r5];
const Spacer = (require(1305) /* metro dependency 1305: native */).Spacer;
items2[1] = <Spacer size={21} />;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
items2[2] = <Group hasIcons={false}><ActionSheetRow label={r12 ? Reflect.apply(string, intl,
[t.CZeRhU]) : Reflect.apply(string, intl,
[t.dzcU1Q])} onPress={onPress_90046} />{upload != null ? <ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w7x2t4)} onPress={onPress_90047} /> : null}{r12 ? <ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.IhMxgu)} onPress={onPress_90048} /> : null}</Group>;
return (
<ActionSheet startExpanded>
{items2}
</ActionSheet>
);
}
function ImageInputAnswerActionSheetOnPress() { // fn#90046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1296, owner: ImageInputAnswerActionSheet.onPress, offset: 0x0202857b, size: 23 bytes, params: 1, frame: 10
env0_6();
openExpressionPicker();
}
function ImageInputAnswerActionSheetOnPress_90047() { // fn#90047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1401, owner: ImageInputAnswerActionSheet.onPress, offset: 0x02028592, size: 93 bytes, params: 1, frame: 14
env0_6();
(require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).openEditPollCreationImageAltTextModal({channelId: channelId,
answer: answer, index: index, onSave: onSaveAltText, imageSize: 40});
}
function ImageInputAnswerActionSheetOnPress_90048() { // fn#90048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1602, owner: ImageInputAnswerActionSheet.onPress, offset: 0x020285ef, size: 28 bytes, params: 1, frame: 12
onRemoveAnswerImage(index);
env0_6();
}
global.__d(_fun90043, 11748, [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749,
2]) /* metro module 11748, dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */;
+230 -186
View File
@@ -1,215 +1,259 @@
/* Metro module 11746; source: modules/polls/native/PollAnswerInput.tsx; dependencies: [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529, 7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751, 2] */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import Module07951 from '../../../by-id/module-07951.js'; /* Metro dependency 7951 */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as NativeModule from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
function _fun90028(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:6, offset: 0x020271e5, size: 576 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_4 = value.Keyboard;
const env0_5 = value.TouchableOpacity;
const env0_6 = value.View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_8 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
value = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_9 = value.MAX_POLL_ANSWER_LENGTH;
const env0_10 = value.POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY;
const env0_11 = (require(1881) /* metro dependency 1881: EmojiConstants */).EmojiIntention;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
const env0_14 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {defaultContainer: {'flexDirection': 'row', 'alignItems': 'center'}};
const object4 = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null, 'borderRadius': null,
object = {defaultContainer: {'flexDirection': 'row', 'alignItems': 'center'}};
const object2 = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null, 'borderRadius': null,
'flex': 1, 'overflow': 'hidden'};
const INPUT_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BACKGROUND_DEFAULT;
object4.backgroundColor = INPUT_BACKGROUND_DEFAULT;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.defaultImageAndTextContainer = object4;
object3.cannotRemove = {marginRight: 30};
object3.defaultImageContainer = {'width': 60, 'height': 48, 'justifyContent': 'center', 'alignItems': 'center'};
object3.pollAnswerTextInput = {'flex': 1, 'paddingStart': 0};
object2.backgroundColor = INPUT_BACKGROUND_DEFAULT;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.defaultImageAndTextContainer = object2;
object.cannotRemove = {marginRight: 30};
object.defaultImageContainer = {'width': 60, 'height': 48, 'justifyContent': 'center', 'alignItems': 'center'};
object.pollAnswerTextInput = {'flex': 1, 'paddingStart': 0};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object3.defaultRemoveButtonContainer = {'paddingLeft': 6, 'height': 48, 'justifyContent': 'center',
object.defaultRemoveButtonContainer = {'paddingLeft': 6, 'height': 48, 'justifyContent': 'center',
color: TEXT_MUTED};
object3.uploadContainer = {alignItems: 'flex-start'};
object.uploadContainer = {alignItems: 'flex-start'};
const BORDER_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_FEEDBACK_CRITICAL;
object3.errorInput = {borderColor: BORDER_FEEDBACK_CRITICAL, borderWidth: 2};
const env0_15 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollAnswerInput.tsx');
object.errorInput = {borderColor: BORDER_FEEDBACK_CRITICAL, borderWidth: 2};
const env0_15 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollAnswerInput.tsx');
exports.default = PollAnswerInput;
}
function ImageInput({channelId, localCreationAnswerId, image, iconSrc, openExpressionPicker, emojiSize, containerStyle, imageSize, answerIndex, openImageInputActionSheet}) { // fn#90029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:998, offset: 0x02027425, size: 450 bytes, params: 2, frame: 30
emojiSize = emojiSize === undefined ? 24 : emojiSize;
const styles = useStyles();
const {renderImage, upload,
setUploadSize} = (importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */)(channelId,
localCreationAnswerId, image, imageSize, emojiSize);
const env0_3 = setUploadSize;
const value5 = env0_3.useMemo(_fun90030, [image, upload, answerIndex]);
const value6 = env0_3.useCallback(function(a0) {
setUploadSize(a0.nativeEvent.layout.width);
}, [setUploadSize]);
let r4 = upload != null || image?.emoji != null;
const r15 = r4 ? openImageInputActionSheet : openExpressionPicker;
const r14 = r4 ? undefined : openImageInputActionSheet;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const r6 = imageSize == null ? value6 : undefined;
const items2 = [containerStyle];
items2[1] = upload != null && styles.uploadContainer;
if (r4) {
r4 = <View>{renderImage}</View>;
} else {
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
r4 = <Icon source={iconSrc} />;
}
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={value5}
onPress={r15}
onLongPress={r14}
onLayout={r6}
style={items2}
>
{r4}
</PressableOpacity>
);
}
function PollAnswerInput({answer, index, inputRef, channelId, onAnswerTextChange, onAnswerEmojiSelect, canRemoveAnswer, onRemoveAnswer, onRemoveAnswerImage, onSubmitEditing, error}) { // fn#90032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2039, offset: 0x02027750, size: 1002 bytes, params: 2, frame: 37
var r10;
var object;
var defaultRemoveButtonContainer;
var Icon;
var value;
const styles = useStyles();
const image = answer.image;
let localCreationAnswerId = answer.localCreationAnswerId;
const closure = function() {
var value3 = ChannelStore.getChannel(channelId);
if (value3 != null) {
Keyboard.dismiss();
require(dependencyMap[14]).openEmojiPickerActionSheet({channel: value3, onPressEmoji: _fun90034,
pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
function ImageInput({channelId, localCreationAnswerId, image, iconSrc, openExpressionPicker, emojiSize, containerStyle, imageSize, answerIndex, openImageInputActionSheet}) { // fn#90029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:998, offset: 0x02027425, size: 450 bytes, params: 2, frame: 30
emojiSize = emojiSize === undefined ? 24 : emojiSize;
const styles = useStyles();
const {renderImage, upload,
setUploadSize} = (UseRenderPollAnswerImage)(channelId,
localCreationAnswerId, image, imageSize, emojiSize);
const setUploadSize2 = setUploadSize;
const value5 = setUploadSize2.useMemo(_fun90030, [image, upload, answerIndex]);
const value6 = setUploadSize2.useCallback(function(a0) {
setUploadSize(a0.nativeEvent.layout.width);
}, [setUploadSize]);
let r4 = upload != null || image?.emoji != null;
const r15 = r4 ? openImageInputActionSheet : openExpressionPicker;
const r14 = r4 ? undefined : openImageInputActionSheet;
const PressableOpacity = (PressablesModule).PressableOpacity;
const r6 = imageSize == null ? value6 : undefined;
const items2 = [containerStyle];
items2[1] = upload != null && styles.uploadContainer;
if (r4) {
r4 = (
<View>
{renderImage}
</View>
);
} else {
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
r4 = <Icon source={iconSrc} />;
}
};
const handleSaveAltText = function(a0) {
var defaultImport = importDefault(dependencyMap[15]);
var channelIdBinding = channelId;
var localCreationAnswerId = answer.localCreationAnswerId;
var Poll = DraftType.Poll;
defaultImport.update(channelIdBinding, localCreationAnswerId, Poll, {description: a0});
};
let r5 = error != null && error.length > 0;
const jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
const items3 = [styles.defaultContainer];
items3[1] = !canRemoveAnswer && styles.cannotRemove;
const items2 = [styles.defaultImageAndTextContainer];
items2[1] = r5 && styles.errorInput;
const imageInput = <ImageInput channelId={channelId} localCreationAnswerId={localCreationAnswerId} image={image} openExpressionPicker={closure} openImageInputActionSheet={openImageInputActionSheet} iconSrc={importDefault(7951) /* metro dependency 7951 */} containerStyle={styles.defaultImageContainer} imageSize={48} answerIndex={index} />;
const FormInput = (require(7972) /* metro dependency 7972: native */).FormInput;
const formInputProps = {'ref': null, 'textAlignVertical': 'center', 'showTopContainer': false, 'showBorder': false,
ref: inputRef};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const NNHVlv = (require(1244) /* metro dependency 1244: indexNative */).t.NNHVlv;
formInputProps.placeholder = Reflect.apply(string, intl, [NNHVlv]);
formInputProps.onChange = function(a0) {
return onAnswerTextChange({text: a0, index: index, localCreationAnswerId: localCreationAnswerId});
};
formInputProps.onSubmitEditing = onSubmitEditing;
formInputProps.blurOnSubmit = false;
formInputProps.style = styles.pollAnswerTextInput;
formInputProps.textContentType = 'none';
formInputProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['3+V8G9'],
{answerNumber: index + 1});
formInputProps.accessibilityHint = r5 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
formInputProps.maxLength = MAX_POLL_ANSWER_LENGTH;
formInputProps.returnKeyType = 'next';
formInputProps.required = true;
formInputProps.autoCorrect = true;
formInputProps['aria-invalid'] = error;
const view = <View style={items2}>{imageInput}<FormInput {...formInputProps} /></View>;
if (canRemoveAnswer) {
object = {onPress: function() {
return onRemoveAnswer(index);
}, accessibilityRole: 'button'};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
object.style = defaultRemoveButtonContainer;
object.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['22fjEc'],
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={value5}
onPress={r15}
onLongPress={r14}
onLayout={r6}
style={items2}
>
{r4}
</PressableOpacity>
);
function _fun90030() { // fn#90030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:1273, offset: 0x020275e7, size: 361 bytes, params: 1, frame: 19
var r8;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
var object;
var value5;
var vcC7Qn;
var value6;
if (image?.emoji != null) {
value6 = environment.__proto__;
return intl.formatToPlainString(t.vcC7Qn, {imageName: image.emoji.name, answerNumber: answerIndex + 1});
}
if (upload != null) {
r8 = upload.item.filename ?? '';
value5 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
vcC7Qn = t.vcC7Qn;
object = {};
object.imageName = (require(7149) /* metro dependency 7149: PollsUtils */).filterOutUUID(r8);
object.answerNumber = answerIndex + 1;
return Reflect.apply(formatToPlainString, intl, [vcC7Qn, object]);
}
return intl.formatToPlainString(t.ieNrxk, {answerNumber: answerIndex + 1});
}
}
function PollAnswerInput({answer, index, inputRef, channelId, onAnswerTextChange, onAnswerEmojiSelect, canRemoveAnswer, onRemoveAnswer, onRemoveAnswerImage, onSubmitEditing, error}) { // fn#90032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2039, offset: 0x02027750, size: 1002 bytes, params: 2, frame: 37
var r10;
var object2;
var defaultRemoveButtonContainer;
var Icon;
var value;
const styles = useStyles();
const image = answer.image;
let localCreationAnswerId = answer.localCreationAnswerId;
const closure = function() {
var value3 = ChannelStore.getChannel(channelId);
if (value3 != null) {
Keyboard.dismiss();
require(dependencyMap[14]).openEmojiPickerActionSheet({channel: value3, onPressEmoji: _fun90034,
pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
};
const handleSaveAltText = function(a0) {
var defaultImport = importDefault(dependencyMap[15]);
var channelIdBinding = channelId;
var localCreationAnswerId = answer.localCreationAnswerId;
var Poll = DraftType.Poll;
defaultImport.update(channelIdBinding, localCreationAnswerId, Poll, {description: a0});
};
let r5 = error != null && error.length > 0;
const jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
const items3 = [styles.defaultContainer];
items3[1] = !canRemoveAnswer && styles.cannotRemove;
const items2 = [styles.defaultImageAndTextContainer];
items2[1] = r5 && styles.errorInput;
const imageInput = (
<ImageInput
channelId={channelId}
localCreationAnswerId={localCreationAnswerId}
image={image}
openExpressionPicker={closure}
openImageInputActionSheet={openImageInputActionSheet}
iconSrc={Module07951}
containerStyle={styles.defaultImageContainer}
imageSize={48}
answerIndex={index}
/>
);
const FormInput = (NativeModule).FormInput;
const formInputProps = {'ref': null, 'textAlignVertical': 'center', 'showTopContainer': false, 'showBorder': false,
ref: inputRef};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const NNHVlv = (require(1244) /* metro dependency 1244: indexNative */).t.NNHVlv;
formInputProps.placeholder = Reflect.apply(string, intl, [NNHVlv]);
formInputProps.onChange = function(a0) {
return onAnswerTextChange({text: a0, index: index, localCreationAnswerId: localCreationAnswerId});
};
formInputProps.onSubmitEditing = onSubmitEditing;
formInputProps.blurOnSubmit = false;
formInputProps.style = styles.pollAnswerTextInput;
formInputProps.textContentType = 'none';
formInputProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['3+V8G9'],
{answerNumber: index + 1});
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.MEDIUM,
source: importDefault(4072) /* metro dependency 4072 */};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
iconProps.color = defaultRemoveButtonContainer.color;
r10 = <TouchableOpacity {...object}><Icon {...iconProps} /></TouchableOpacity>;
} else {
r10 = canRemoveAnswer;
formInputProps.accessibilityHint = r5 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
formInputProps.maxLength = MAX_POLL_ANSWER_LENGTH;
formInputProps.returnKeyType = 'next';
formInputProps.required = true;
formInputProps.autoCorrect = true;
formInputProps['aria-invalid'] = error;
const view = (
<View style={items2}>
{imageInput}
<FormInput {...formInputProps} />
</View>
);
if (canRemoveAnswer) {
object2 = {onPress: function() {
return onRemoveAnswer(index);
}, accessibilityRole: 'button'};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
object2.style = defaultRemoveButtonContainer;
object2.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['22fjEc'],
{answerNumber: index + 1});
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.MEDIUM,
source: importDefault(4072) /* metro dependency 4072 */};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
iconProps.color = defaultRemoveButtonContainer.color;
r10 = (
<TouchableOpacity {...object2}>
<Icon {...iconProps} />
</TouchableOpacity>
);
} else {
r10 = canRemoveAnswer;
}
const view2 = (
<View style={items3}>
{view}
{r10}
</View>
);
if (r5) {
value = importDefault(11751) /* metro dependency 11751: PollCreationInputError */;
value = ((Component) => <Component message={error} />)(value);
r5 = value;
}
return (
<>
{view2}
{r5}
</>
);
function openExpressionPicker() { // fn#90033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2300, owner: PollAnswerInput.openExpressionPicker, offset: 0x02027b3a, size: 128 bytes, params: 1, frame: 13
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
Keyboard.dismiss();
(require(8529) /* metro dependency 8529: openEmojiPickerActionSheet */).openEmojiPickerActionSheet({channel: channel,
onPressEmoji: function(a0) {
onAnswerEmojiSelect(a0, index);
}, pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
function openExpressionPickerOnPressEmoji(a0) { // fn#90034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2409, owner: PollAnswerInput.openExpressionPicker.onPressEmoji, offset: 0x02027bba, size: 24 bytes, params: 2, frame: 13
onAnswerEmojiSelect(a0, index);
}
}
function openImageInputActionSheet() { // fn#90036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2869, owner: PollAnswerInput.openImageInputActionSheet, offset: 0x02027c21, size: 135 bytes, params: 1, frame: 18
const defaultImport = importDefault(dependencyMap[16]);
defaultImport.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths),
POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY, {channelId: channelId, index: index, answer: answer,
onSaveAltText: handleSaveAltText, onRemoveAnswerImage: onRemoveAnswerImage,
openExpressionPicker: openExpressionPicker});
}
}
const view2 = <View style={items3}>{view}{r10}</View>;
if (r5) {
value = importDefault(11751) /* metro dependency 11751: PollCreationInputError */;
value = ((Component) => <Component message={error} />)(value);
r5 = value;
}
return (
<>
{view2}
{r5}
</>
);
}
function _fun90030() { // fn#90030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:1273, offset: 0x020275e7, size: 361 bytes, params: 1, frame: 19
var r8;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var object2;
var value5;
var vcC7Qn;
var value6;
if (image?.emoji != null) {
value6 = environment.__proto__;
return intl.formatToPlainString(t.vcC7Qn, {imageName: image.emoji.name, answerNumber: answerIndex + 1});
}
if (upload != null) {
r8 = upload.item.filename ?? '';
value5 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
vcC7Qn = t.vcC7Qn;
object2 = {};
object2.imageName = (require(7149) /* metro dependency 7149: PollsUtils */).filterOutUUID(r8);
object2.answerNumber = answerIndex + 1;
return Reflect.apply(formatToPlainString, intl, [vcC7Qn, object2]);
}
return intl.formatToPlainString(t.ieNrxk, {answerNumber: answerIndex + 1});
}
function PollAnswerInputOpenExpressionPicker() { // fn#90033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2300, owner: PollAnswerInput.openExpressionPicker, offset: 0x02027b3a, size: 128 bytes, params: 1, frame: 13
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
Keyboard.dismiss();
(require(8529) /* metro dependency 8529: openEmojiPickerActionSheet */).openEmojiPickerActionSheet({channel: channel,
onPressEmoji: function(a0) {
onAnswerEmojiSelect(a0, index);
}, pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
}
function openImageInputActionSheet() { // fn#90036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2869, owner: PollAnswerInput.openImageInputActionSheet, offset: 0x02027c21, size: 135 bytes, params: 1, frame: 18
const defaultImport = importDefault(dependencyMap[16]);
defaultImport.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths),
POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY, {channelId: channelId, index: index, answer: answer,
onSaveAltText: handleSaveAltText, onRemoveAnswerImage: onRemoveAnswerImage,
openExpressionPicker: openExpressionPicker_90033});
}
global.__d(_fun90028, 11746, [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529,
7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751,
2]) /* metro module 11746, dependencies: [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529, 7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751, 2] */;
+40 -30
View File
@@ -1,46 +1,56 @@
/* Metro module 15065; source: modules/polls/native/PollBadge.tsx; dependencies: [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244, 2] */
import Module15066 from '../../../by-id/module-15066.js'; /* Metro dependency 15066 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun113993(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:6, offset: 0x0240fcd5, size: 312 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
ReactModule;
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {'borderRadius': null, 'paddingHorizontal': 8, 'backgroundColor': null, 'color': null,
const object2 = {'borderRadius': null, 'paddingHorizontal': 8, 'backgroundColor': null, 'color': null,
'flexDirection': 'row', 'alignItems': 'center'};
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object.backgroundColor = BACKGROUND_SURFACE_HIGH;
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object.color = TEXT_MUTED;
const env0_6 = Reflect.apply(createStyles, value, [{container: object, text: {'marginLeft': 4,
object2.color = TEXT_MUTED;
const env0_6 = Reflect.apply(createStyles, value, [{container: object2, text: {'marginLeft': 4,
'textTransform': 'uppercase'}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollBadge.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollBadge.tsx');
exports.default = PollBadge;
function PollBadge({style}) { // fn#113994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:488, offset: 0x0240fe0d, size: 253 bytes, params: 2, frame: 22
const styles = useStyles();
const items2 = [styles.container, style];
const Icon = (NativeModule).Icon;
const IconSizes = (NativeModule).IconSizes;
const EXTRA_SMALL_10 = IconSizes.EXTRA_SMALL_10;
const icon = <Icon size={EXTRA_SMALL_10} source={Module15066} />;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const RgIi2B = (IndexNativeModule).t.RgIi2B;
return (
<View style={items2}>
{icon}
<Text style={styles.text} variant="text-xs/semibold">
{Reflect.apply(string, intl, [RgIi2B])}
</Text>
</View>
);
}
}
function PollBadge({style}) { // fn#113994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:488, offset: 0x0240fe0d, size: 253 bytes, params: 2, frame: 22
const styles = useStyles();
const items2 = [styles.container, style];
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const IconSizes = (require(1305) /* metro dependency 1305: native */).IconSizes;
const EXTRA_SMALL_10 = IconSizes.EXTRA_SMALL_10;
const icon = <Icon size={EXTRA_SMALL_10} source={importDefault(15066) /* metro dependency 15066 */} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const RgIi2B = (require(1244) /* metro dependency 1244: indexNative */).t.RgIi2B;
return (
<View style={items2}>
{icon}
<Text style={styles.text} variant="text-xs/semibold">
{Reflect.apply(string, intl, [RgIi2B])}
</Text>
</View>
);
}
global.__d(_fun113993, 15065, [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244,
2]) /* metro module 15065, dependencies: [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244, 2] */;
+422 -337
View File
@@ -1,358 +1,443 @@
/* Metro module 11734; source: modules/polls/native/PollCreation.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080, 11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277, 5313, 11744, 7972, 11746, 8950, 2] */
import Module05313 from '../../../by-id/module-05313.js'; /* Metro dependency 5313 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import UseTrackImpression from '../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import UsePollDurationOptions from '../usePollDurationOptions.tsx'; /* Metro dependency 11735 */
import PollAnswerInput from './PollAnswerInput.tsx'; /* Metro dependency 11746 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as AnalyticsUtilsModule from '../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as AccessibilityAnnouncerAndroidModule from '../../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/AccessibilityAnnouncer.android.tsx'; /* Metro dependency 3869 */
import * as AlertModalNativeModule from '../../../design/components/AlertModal/native/AlertModal.native.tsx'; /* Metro dependency 4500 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as UseNavigatorBackPressHandlerNativeModule from '../../../design/components/Navigator/native/useNavigatorBackPressHandler.native.tsx'; /* Metro dependency 5286 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as PollsUtilsModule from '../PollsUtils.tsx'; /* Metro dependency 7149 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as TextInputNativeModule from '../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */
import * as TableCheckboxRowNativeModule from '../../../design/components/TableRow/native/TableCheckboxRow.native.tsx'; /* Metro dependency 8950 */
import * as PollsIconModule from '../../../design/components/Icon/native/redesign/generated/PollsIcon.tsx'; /* Metro dependency 11098 */
import * as PollCreationModalActionCreatorsModule from './PollCreationModalActionCreators.tsx'; /* Metro dependency 11733 */
import * as UseTrackPollEventsModule from '../useTrackPollEvents.tsx'; /* Metro dependency 11742 */
function _fun89916(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6, offset: 0x02023666, size: 668 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.TouchableOpacity;
const env0_5 = value2.View;
const env0_6 = value2.ScrollView;
const pollsConstantsModule = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_7 = pollsConstantsModule.MAX_POLL_QUESTION_LENGTH;
const env0_8 = pollsConstantsModule.POLL_CREATION_DURATION_ACTION_SHEET_KEY;
const value4 = require(33) /* metro dependency 33 */;
const env0_9 = value4.jsx;
const env0_10 = value4.Fragment;
const env0_11 = value4.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
object2.viewPadding = {paddingHorizontal: 18};
object2.scrollContainer = {'paddingVertical': 20, 'gap': 16};
const createStyles = CreateStylesModule.createStyles;
object = {};
object.viewPadding = {paddingHorizontal: 18};
object.scrollContainer = {'paddingVertical': 20, 'gap': 16};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.safeAreaContainer = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object.safeAreaContainer = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
const value6 = 10;
object2.header = {'flexDirection': 'row', 'paddingHorizontal': 18, 'paddingVertical': 10};
object2.actionButton = {'flex': 0, 'justifyContent': 'flex-start', 'minWidth': 48, 'paddingHorizontal': 0,
object.header = {'flexDirection': 'row', 'paddingHorizontal': 18, 'paddingVertical': 10};
object.actionButton = {'flex': 0, 'justifyContent': 'flex-start', 'minWidth': 48, 'paddingHorizontal': 0,
'marginHorizontal': 0};
object2.postButton = {justifyContent: 'flex-end'};
object2.title = {'textAlign': 'center', 'flexGrow': 1};
object2.label = {fontSize: 14};
object2.answerInputsContainer = {'marginVertical': 20, 'rowGap': 16};
const object3 = {'paddingVertical': null, 'paddingLeft': 14, 'marginRight': 30, 'display': 'flex',
object.postButton = {justifyContent: 'flex-end'};
object.title = {'textAlign': 'center', 'flexGrow': 1};
object.label = {fontSize: 14};
object.answerInputsContainer = {'marginVertical': 20, 'rowGap': 16};
const object4 = {'paddingVertical': null, 'paddingLeft': 14, 'marginRight': 30, 'display': 'flex',
'flexDirection': 'row', 'gap': 16, 'alignItems': 'center', 'justifyContent': 'flex-start'};
object3.paddingVertical = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value6 : 8;
object4.paddingVertical = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value6 : 8;
const MESSAGE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_BACKGROUND_HOVER;
object3.backgroundColor = MESSAGE_BACKGROUND_HOVER;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.addAnswerButtonDefault = object3;
object4.backgroundColor = MESSAGE_BACKGROUND_HOVER;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.addAnswerButtonDefault = object4;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.addAnswerIcon = {color: TEXT_MUTED};
object.addAnswerIcon = {color: TEXT_MUTED};
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
object2.pollConfigSection = {borderTopWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object2]);
const env0_13 = value.forwardRef(_fun89921);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreation.tsx');
object.pollConfigSection = {borderTopWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_13 = ReactModule.forwardRef(_fun89921);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreation.tsx');
exports.default = PollCreation;
}
function UnsavedChangesAlertModal({onConfirm}) { // fn#89917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1199, offset: 0x02023902, size: 370 bytes, params: 2, frame: 29
const AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const HMrgcp = (require(1244) /* metro dependency 1244: indexNative */).t.HMrgcp;
object2.title = Reflect.apply(string, intl, [HMrgcp]);
object2.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Wxa/j8']);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const AlertActionButton = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton;
string = intl.string;
const TzJA4g = (require(1244) /* metro dependency 1244: indexNative */).t.TzJA4g;
object2.actions = <><AlertActionButton text={Reflect.apply(string, intl,
[TzJA4g])} onPress={onConfirm} key="confirm" /><AlertActionButton variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2BR5R2'])} key="back" /></>;
return <AlertModal {...object2} />;
}
function AddAnswerButton({onPress}) { // fn#89918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2194, offset: 0x02023a74, size: 319 bytes, params: 2, frame: 22
const styles = useStyles();
const addAnswerButtonDefault = styles.addAnswerButtonDefault;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
let object2 = {};
object2.source = importDefault(10376) /* metro dependency 10376 */;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const LARGE = Sizes.LARGE;
object2.size = LARGE;
object2.color = styles.addAnswerIcon.color;
const icon = <Icon {...object2} />;
object2 = {onPress: onPress, style: addAnswerButtonDefault, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
object2.accessibilityLabel = Reflect.apply(string, intl, [B2Uvme]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
return (
<TouchableOpacity {...object2}>
{icon}
<Text variant="text-md/medium" color="text-muted">
{Reflect.apply(string, intl, [B2Uvme])}
</Text>
</TouchableOpacity>
);
}
function PollDurationSelectionRow({selectedDuration, onChange}) { // fn#89919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2604, offset: 0x02023bb3, size: 342 bytes, params: 2, frame: 24
const property = (importDefault(11735) /* metro dependency 11735: usePollDurationOptions */)()[selectedDuration];
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object2.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb]);
object2.accessibilityLabel = '' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb) + ' ' + property;
string = intl.string;
const A4PJ1o = (require(1244) /* metro dependency 1244: indexNative */).t.A4PJ1o;
object2.accessibilityHint = Reflect.apply(string, intl, [A4PJ1o]);
object2.onPress = function() {
require(dependencyMap[18]).dismissKeyboard();
importDefault(dependencyMap[14]).openLazy(require(dependencyMap[16])(dependencyMap[15], dependencyMap.paths),
POLL_CREATION_DURATION_ACTION_SHEET_KEY, {selectedDuration: selectedDuration, onChange: onChange});
};
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
object2.trailing = <Text variant="text-md/normal" color="text-muted">{property}</Text>;
object2.arrow = true;
return <TableRow {...object2} />;
}
function _fun89921({onChange, onSubmitEditing, error}, a1) { // fn#89921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1616, offset: 0x02023d84, size: 410 bytes, params: 3, frame: 25
const r9 = error != null && error.length > 0;
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
const object2 = {ref: a1, textAlignVertical: 'center'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.label = Reflect.apply(string, intl, [WBiKnI]);
string = intl.string;
WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.accessibilityLabel = Reflect.apply(string, intl, [WBiKnI]);
object2.accessibilityHint = r9 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
object2.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/uQqJW']);
object2.onChange = onChange;
object2.isClearable = true;
object2.status = r9 ? 'error' : 'default';
object2.errorMessage = error;
object2.maxLength = MAX_POLL_QUESTION_LENGTH;
object2.returnKeyType = 'next';
object2.blurOnSubmit = false;
object2.onSubmitEditing = onSubmitEditing;
object2.textContentType = 'none';
object2.autoFocus = true;
object2.autoCorrect = true;
return <TextInput {...object2} />;
}
function PollCreation({channel, onCancel}) { // fn#89922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3104, offset: 0x02023f1e, size: 1620 bytes, params: 2, frame: 44
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
const object2 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object2.type = VIEW;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const POLL_EDITOR_VIEWED = ImpressionNames.POLL_EDITOR_VIEWED;
object2.name = POLL_EDITOR_VIEWED;
defaultImport(object2);
const binding = env0_3;
binding.useEffect(function() {
return _fun89924;
}, [onCancel]);
const styles = useStyles();
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
const env0_2 = binding.useRef(false);
const value5 = (importDefault(11737) /* metro dependency 11737: useCreatePollFormData */)(channel,
binding.useCallback(_fun89925, []), binding.useCallback(function({indexToRemove}) {
var AccessibilityAnnouncer = require(dependencyMap[25]).AccessibilityAnnouncer;
var intl = require(dependencyMap[8]).intl;
var BByGU4 = require(dependencyMap[8]).t.BByGU4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(BByGU4, {number: indexToRemove + 1}));
}, []));
const answers = value5.answers;
const env0_4 = value5.question;
const allowMultiSelect = value5.allowMultiSelect;
const env0_6 = value5.setAllowMultiSelect;
const canAddMoreAnswers = value5.canAddMoreAnswers;
const env0_7 = value5.canRemoveMoreAnswers;
const handleQuestionChange = value5.handleQuestionChange;
const env0_8 = value5.handleAnswerTextChange;
const env0_9 = value5.handleEmojiSelect;
const handleAddAnswer = value5.handleAddAnswer;
const env0_11 = value5.handleRemoveAnswer;
const env0_12 = value5.handleRemoveAnswerImage;
const handleSubmitPoll = value5.handleSubmitPoll;
const fieldErrors = value5.fieldErrors;
const env0_13 = fieldErrors;
const duration = value5.duration;
const setDuration = value5.setDuration;
const createPollError = value5.createPollError;
const submitting = value5.submitting;
const shouldFocusOnInvalidField = value5.shouldFocusOnInvalidField;
const setShouldFocusOnInvalidField = value5.setShouldFocusOnInvalidField;
const useTrackPollEventsModule = require(11742) /* metro dependency 11742: useTrackPollEvents */;
const useTrackPollCreationEvents = useTrackPollEventsModule.useTrackPollCreationEvents;
const env0_16 = Reflect.apply(useTrackPollCreationEvents, useTrackPollEventsModule, [answers,
allowMultiSelect]).trackPollCreationCancelled;
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(_fun89928);
const value6 = (importDefault(11743) /* metro dependency 11743: useFocusHelper */)({onAddAnswer: function() {
handleAddAnswer();
}});
binding.useEffect(_fun89930, [fieldErrors, value6, setShouldFocusOnInvalidField, shouldFocusOnInvalidField]);
const items3 = [styles.safeAreaContainer];
items3[1] = {paddingTop: insets.top, paddingBottom: insets.bottom};
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [<HeaderActionButton accessibilityLabel={Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']])} onPress={onPress_89931} source={importDefault(5313) /* metro dependency 5313 */} style={styles.actionButton} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Flr51u = (require(1244) /* metro dependency 1244: indexNative */).t.Flr51u;
items2[1] = <Text accessibilityRole="header" variant="redesign/heading-18/bold" color="mobile-text-heading-primary" style={styles.title}>{Reflect.apply(string,
intl, [Flr51u])}</Text>;
string = intl.string;
const JOj8Zk = (require(1244) /* metro dependency 1244: indexNative */).t.JOj8Zk;
items2[2] = <HeaderActionButton text={Reflect.apply(string, intl, [JOj8Zk])} style={[styles.actionButton,
styles.postButton]} disabled={submitting} onPress={handleSubmitPoll} />;
const items4 = [<View style={styles.header}>{items2}</View>];
const items5 = [createPollError != null && ((Component) => <Component>{createPollError?.getAnyErrorMessage()}</Component>)(importDefault(11744) /* metro dependency 11744: ErrorBlock */)];
items5[1] = ((Component) => <Component ref={value6.refWithKey('question')} onChange={handleQuestionChange} onSubmitEditing={value6.focusNext} error={fieldErrors?.question} />)(env0_13);
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
const items6 = [<FormLabel text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oMBfeS)} color="text-subtle" style={styles.label} />];
items6[1] = answers.map(_fun89932);
items6[2] = canAddMoreAnswers && <AddAnswerButton onPress={handleAddAnswer} />;
items5[2] = <View style={styles.answerInputsContainer}>{items6}</View>;
items4[1] = <ScrollView style={styles.viewPadding} contentContainerStyle={styles.scrollContainer} keyboardShouldPersistTaps="handled">{items5}</ScrollView>;
const pollDurationSelectionRow = <PollDurationSelectionRow selectedDuration={duration} onChange={setDuration} />;
const TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
items4[2] = <View style={styles.pollConfigSection}>{pollDurationSelectionRow}<TableCheckboxRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Ux+iQU'])} checked={allowMultiSelect} onPress={function() {
return setAllowMultiSelect(!allowMultiSelect);
}} /></View>;
return (
<View style={items3}>
function UnsavedChangesAlertModal({onConfirm}) { // fn#89917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1199, offset: 0x02023902, size: 370 bytes, params: 2, frame: 29
const AlertModal = (AlertModalNativeModule).AlertModal;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const HMrgcp = (require(1244) /* metro dependency 1244: indexNative */).t.HMrgcp;
object.title = Reflect.apply(string, intl, [HMrgcp]);
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Wxa/j8']);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const AlertActionButton = (AlertModalNativeModule).AlertActionButton;
string = intl.string;
const TzJA4g = (require(1244) /* metro dependency 1244: indexNative */).t.TzJA4g;
object.actions = (
<>
{items4}
<AlertActionButton
text={Reflect.apply(string, intl, [TzJA4g])}
onPress={onConfirm}
key="confirm"
/>
<AlertActionButton
variant="secondary"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2BR5R2'])}
key="back"
/>
</>
</View>
);
}
function _fun89923() { // fn#89923, offset: 0x02024572, size: 11 bytes, params: 1, frame: 1
return _fun89924;
}
function _fun89925() { // fn#89925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3387, offset: 0x020245a7, size: 166 bytes, params: 1, frame: 17
env0_2.current = true;
let value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object2 = {key: 'POLL_CREATED_SUCCESS'};
const PollsIcon = (require(11098) /* metro dependency 11098: PollsIcon */).PollsIcon;
object2.IconComponent = PollsIcon;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const OPsckI = (require(1244) /* metro dependency 1244: indexNative */).t.OPsckI;
object2.content = Reflect.apply(string, intl, [OPsckI]);
Reflect.apply(open, value, [object2]);
}
function handleCancelClose() { // fn#89927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4249, owner: PollCreation.handleCancelClose, offset: 0x020246c2, size: 124 bytes, params: 1, frame: 16
trackPollCreationCancelled();
const value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
const AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
const announce = AccessibilityAnnouncer.announce;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
}
function _fun89928() { // fn#89928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4413, offset: 0x0202473e, size: 214 bytes, params: 1, frame: 18
var r0;
var moduleValue2;
var openAlert;
var AccessibilityAnnouncer;
var announce;
var intl;
let value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
trackPollCreationCancelled();
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
announce = AccessibilityAnnouncer.announce;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
r0 = false;
} else {
moduleValue2 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue2.openAlert;
value = <UnsavedChangesAlertModal onConfirm={handleCancelClose} />;
Reflect.apply(openAlert, moduleValue2, ['poll-creation-unsaved-changes', value]);
value = true;
r0 = value;
);
return <AlertModal {...object} />;
}
return r0;
}
function _fun89930() { // fn#89930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4720, offset: 0x02024814, size: 186 bytes, params: 1, frame: 20
var value3;
var intl;
const Object = global.Object;
const value2 = Object.keys(fieldErrors);
if (value2.length > 0) {
value3 = environment.__proto__;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.w8e4qF,
{numOfErrors: value2.length}));
if (shouldFocusOnInvalidField) {
env0_18.focus(value2[0]);
setShouldFocusOnInvalidField(false);
function AddAnswerButton({onPress}) { // fn#89918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2194, offset: 0x02023a74, size: 319 bytes, params: 2, frame: 22
const styles = useStyles();
const addAnswerButtonDefault = styles.addAnswerButtonDefault;
const Icon = (NativeModule).Icon;
let object = {};
object.source = importDefault(10376) /* metro dependency 10376 */;
const Icon2 = (NativeModule).Icon;
const Sizes = Icon2.Sizes;
const LARGE = Sizes.LARGE;
object.size = LARGE;
object.color = styles.addAnswerIcon.color;
const icon = <Icon {...object} />;
object = {onPress: onPress, style: addAnswerButtonDefault, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
object.accessibilityLabel = Reflect.apply(string, intl, [B2Uvme]);
const Text = (TextModule).Text;
string = intl.string;
B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
return (
<TouchableOpacity {...object}>
{icon}
<Text variant="text-md/medium" color="text-muted">
{Reflect.apply(string, intl, [B2Uvme])}
</Text>
</TouchableOpacity>
);
}
function PollDurationSelectionRow({selectedDuration, onChange}) { // fn#89919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2604, offset: 0x02023bb3, size: 342 bytes, params: 2, frame: 24
const property = (UsePollDurationOptions)()[selectedDuration];
const TableRow = (TableRowNativeModule).TableRow;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb]);
object.accessibilityLabel = '' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb) + ' ' + property;
string = intl.string;
const A4PJ1o = (require(1244) /* metro dependency 1244: indexNative */).t.A4PJ1o;
object.accessibilityHint = Reflect.apply(string, intl, [A4PJ1o]);
object.onPress = function() {
require(dependencyMap[18]).dismissKeyboard();
importDefault(dependencyMap[14]).openLazy(require(dependencyMap[16])(dependencyMap[15], dependencyMap.paths),
POLL_CREATION_DURATION_ACTION_SHEET_KEY, {selectedDuration: selectedDuration, onChange: onChange});
};
const Text = (TextModule).Text;
object.trailing = (
<Text variant="text-md/normal" color="text-muted">
{property}
</Text>
);
object.arrow = true;
return <TableRow {...object} />;
}
function _fun89921({onChange, onSubmitEditing, error}, a1) { // fn#89921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1616, offset: 0x02023d84, size: 410 bytes, params: 3, frame: 25
const r9 = error != null && error.length > 0;
const TextInput = (TextInputNativeModule).TextInput;
const object = {ref: a1, textAlignVertical: 'center'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object.label = Reflect.apply(string, intl, [WBiKnI]);
string = intl.string;
WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object.accessibilityLabel = Reflect.apply(string, intl, [WBiKnI]);
object.accessibilityHint = r9 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
object.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/uQqJW']);
object.onChange = onChange;
object.isClearable = true;
object.status = r9 ? 'error' : 'default';
object.errorMessage = error;
object.maxLength = MAX_POLL_QUESTION_LENGTH;
object.returnKeyType = 'next';
object.blurOnSubmit = false;
object.onSubmitEditing = onSubmitEditing;
object.textContentType = 'none';
object.autoFocus = true;
object.autoCorrect = true;
return <TextInput {...object} />;
}
function PollCreation({channel, onCancel}) { // fn#89922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3104, offset: 0x02023f1e, size: 1620 bytes, params: 2, frame: 44
const defaultImport = UseTrackImpression;
const object = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object.type = VIEW;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const POLL_EDITOR_VIEWED = ImpressionNames.POLL_EDITOR_VIEWED;
object.name = POLL_EDITOR_VIEWED;
defaultImport(object);
const binding = env0_3;
binding.useEffect(function() {
return _fun89924;
}, [onCancel]);
const styles = useStyles();
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({includeKeyboardHeight: true}).insets;
const env0_2 = binding.useRef(false);
const value5 = (importDefault(11737) /* metro dependency 11737: useCreatePollFormData */)(channel,
binding.useCallback(_fun89925, []), binding.useCallback(function({indexToRemove}) {
var AccessibilityAnnouncer = require(dependencyMap[25]).AccessibilityAnnouncer;
var intl = require(dependencyMap[8]).intl;
var BByGU4 = require(dependencyMap[8]).t.BByGU4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(BByGU4, {number: indexToRemove + 1}));
}, []));
const answers = value5.answers;
const env0_4 = value5.question;
const allowMultiSelect = value5.allowMultiSelect;
const env0_6 = value5.setAllowMultiSelect;
const canAddMoreAnswers = value5.canAddMoreAnswers;
const env0_7 = value5.canRemoveMoreAnswers;
const handleQuestionChange = value5.handleQuestionChange;
const env0_8 = value5.handleAnswerTextChange;
const env0_9 = value5.handleEmojiSelect;
const handleAddAnswer = value5.handleAddAnswer;
const env0_11 = value5.handleRemoveAnswer;
const env0_12 = value5.handleRemoveAnswerImage;
const handleSubmitPoll = value5.handleSubmitPoll;
const fieldErrors = value5.fieldErrors;
const fieldErrors2 = fieldErrors;
const duration = value5.duration;
const setDuration = value5.setDuration;
const createPollError = value5.createPollError;
const submitting = value5.submitting;
const shouldFocusOnInvalidField = value5.shouldFocusOnInvalidField;
const setShouldFocusOnInvalidField = value5.setShouldFocusOnInvalidField;
const useTrackPollCreationEvents = UseTrackPollEventsModule.useTrackPollCreationEvents;
const env0_16 = Reflect.apply(useTrackPollCreationEvents, UseTrackPollEventsModule, [answers,
allowMultiSelect]).trackPollCreationCancelled;
(UseNavigatorBackPressHandlerNativeModule).useNavigatorBackPressHandler(_fun89928);
const value6 = (importDefault(11743) /* metro dependency 11743: useFocusHelper */)({onAddAnswer: function() {
handleAddAnswer();
}});
binding.useEffect(_fun89930, [fieldErrors, value6, setShouldFocusOnInvalidField, shouldFocusOnInvalidField]);
const items3 = [styles.safeAreaContainer];
items3[1] = {paddingTop: insets.top, paddingBottom: insets.bottom};
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [
<HeaderActionButton
accessibilityLabel={Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']])}
onPress={onPress_89931}
source={Module05313}
style={styles.actionButton}
/>,
];
const Text = (TextModule).Text;
string = intl.string;
const Flr51u = (require(1244) /* metro dependency 1244: indexNative */).t.Flr51u;
items2[1] = (
<Text
accessibilityRole="header"
variant="redesign/heading-18/bold"
color="mobile-text-heading-primary"
style={styles.title}
>
{Reflect.apply(string, intl, [Flr51u])}
</Text>
);
string = intl.string;
const JOj8Zk = (require(1244) /* metro dependency 1244: indexNative */).t.JOj8Zk;
items2[2] = (
<HeaderActionButton
text={Reflect.apply(string, intl, [JOj8Zk])}
style={[styles.actionButton, styles.postButton]}
disabled={submitting}
onPress={handleSubmitPoll}
/>
);
const items4 = [
<View style={styles.header}>
{items2}
</View>,
];
const items5 = [
createPollError != null && ((Component) => <Component>{createPollError?.getAnyErrorMessage()}</Component>)(importDefault(11744) /* metro dependency 11744: ErrorBlock */),
];
items5[1] = ((Component) => <Component ref={value6.refWithKey('question')} onChange={handleQuestionChange} onSubmitEditing={value6.focusNext} error={fieldErrors?.question} />)(fieldErrors2);
const FormLabel = (NativeModule2).FormLabel;
const items6 = [
<FormLabel
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oMBfeS)}
color="text-subtle"
style={styles.label}
/>,
];
items6[1] = answers.map(_fun89932);
items6[2] = canAddMoreAnswers && <AddAnswerButton onPress={handleAddAnswer} />;
items5[2] = (
<View style={styles.answerInputsContainer}>
{items6}
</View>
);
items4[1] = (
<ScrollView
style={styles.viewPadding}
contentContainerStyle={styles.scrollContainer}
keyboardShouldPersistTaps="handled"
>
{items5}
</ScrollView>
);
const pollDurationSelectionRow = <PollDurationSelectionRow selectedDuration={duration} onChange={setDuration} />;
const TableCheckboxRow = (TableCheckboxRowNativeModule).TableCheckboxRow;
items4[2] = (
<View style={styles.pollConfigSection}>
{pollDurationSelectionRow}
<TableCheckboxRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Ux+iQU'])}
checked={allowMultiSelect}
onPress={function() {
return setAllowMultiSelect(!allowMultiSelect);
}}
/>
</View>
);
return (
<View style={items3}>
<>
{items4}
</>
</View>
);
function _fun89923() { // fn#89923, offset: 0x02024572, size: 11 bytes, params: 1, frame: 1
return _fun89924;
function _fun89924() { // fn#89924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3263, offset: 0x0202457d, size: 42 bytes, params: 1, frame: 11
if (!(env1_2.current || onCancel == null)) {
onCancel();
}
}
}
function _fun89925() { // fn#89925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3387, offset: 0x020245a7, size: 166 bytes, params: 1, frame: 17
env0_2.current = true;
let value = environment.__proto__;
(PollCreationModalActionCreatorsModule).closeCreatePollModal();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object = {key: 'POLL_CREATED_SUCCESS'};
const PollsIcon = (PollsIconModule).PollsIcon;
object.IconComponent = PollsIcon;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const OPsckI = (IndexNativeModule).t.OPsckI;
object.content = Reflect.apply(string, intl, [OPsckI]);
Reflect.apply(open, value, [object]);
}
function handleCancelClose() { // fn#89927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4249, owner: PollCreation.handleCancelClose, offset: 0x020246c2, size: 124 bytes, params: 1, frame: 16
trackPollCreationCancelled();
const value = environment.__proto__;
(PollCreationModalActionCreatorsModule).closeCreatePollModal();
const AccessibilityAnnouncer = (AccessibilityAnnouncerAndroidModule).AccessibilityAnnouncer;
const announce = AccessibilityAnnouncer.announce;
const intl = (IndexNativeModule).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((IndexNativeModule).t['+G3oRq'])]);
}
function _fun89928() { // fn#89928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4413, offset: 0x0202473e, size: 214 bytes, params: 1, frame: 18
var r0;
var moduleValue2;
var openAlert;
var AccessibilityAnnouncer;
var announce;
var intl;
let value = environment.__proto__;
if (PollsUtilsModule.isPollCreationEmpty(question, answers)) {
trackPollCreationCancelled();
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
announce = AccessibilityAnnouncer.announce;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
r0 = false;
} else {
moduleValue2 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue2.openAlert;
value = <UnsavedChangesAlertModal onConfirm={handleCancelClose} />;
Reflect.apply(openAlert, moduleValue2, ['poll-creation-unsaved-changes', value]);
value = true;
r0 = value;
}
return r0;
}
function _fun89930() { // fn#89930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4720, offset: 0x02024814, size: 186 bytes, params: 1, frame: 20
var value3;
var intl;
const Object = global.Object;
const value2 = Object.keys(fieldErrors);
if (value2.length > 0) {
value3 = environment.__proto__;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.w8e4qF,
{numOfErrors: value2.length}));
if (shouldFocusOnInvalidField) {
env0_18.focus(value2[0]);
setShouldFocusOnInvalidField(false);
}
}
}
function PollCreationOnPress() { // fn#89931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:5162, owner: PollCreation.onPress, offset: 0x020248ce, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
if (PollsUtilsModule.isPollCreationEmpty(question, answers)) {
handleCancelClose();
} else {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('poll-creation-unsaved-changes',
<UnsavedChangesAlertModal onConfirm={handleCancelClose} />);
}
}
function _fun89932(a0, a1) { // fn#89932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6126, offset: 0x0202494c, size: 232 bytes, params: 3, frame: 22
let value = environment.__proto__;
value = undefined;
const binding = env0_18;
return (
<PollAnswerInput
inputRef={binding.refWithKey('answer-' + a0.localCreationAnswerId)}
answer={a0}
index={a1}
channelId={channel.id}
onSubmitEditing={binding.focusNext}
onAnswerTextChange={handleAnswerTextChange}
onAnswerEmojiSelect={handleEmojiSelect}
onRemoveAnswer={handleRemoveAnswer}
onRemoveAnswerImage={handleRemoveAnswerImage}
canRemoveAnswer={canRemoveMoreAnswers}
error={fieldErrors == null ? value : fieldErrors['answer-' + a0.localCreationAnswerId]}
key={a0.localCreationAnswerId}
/>
);
}
}
}
function PollCreationOnPress() { // fn#89931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:5162, owner: PollCreation.onPress, offset: 0x020248ce, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
handleCancelClose();
} else {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('poll-creation-unsaved-changes',
<UnsavedChangesAlertModal onConfirm={handleCancelClose} />);
}
}
function _fun89932(a0, a1) { // fn#89932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6126, offset: 0x0202494c, size: 232 bytes, params: 3, frame: 22
let value = environment.__proto__;
value = undefined;
const PollAnswerInput = importDefault(11746) /* metro dependency 11746: PollAnswerInput */;
const binding = env0_18;
return (
<PollAnswerInput
inputRef={binding.refWithKey('answer-' + a0.localCreationAnswerId)}
answer={a0}
index={a1}
channelId={channel.id}
onSubmitEditing={binding.focusNext}
onAnswerTextChange={handleAnswerTextChange}
onAnswerEmojiSelect={handleEmojiSelect}
onRemoveAnswer={handleRemoveAnswer}
onRemoveAnswerImage={handleRemoveAnswerImage}
canRemoveAnswer={canRemoveMoreAnswers}
error={fieldErrors == null ? value : fieldErrors['answer-' + a0.localCreationAnswerId]}
key={a0.localCreationAnswerId}
/>
);
}
function _fun89924() { // fn#89924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3263, offset: 0x0202457d, size: 42 bytes, params: 1, frame: 11
if (!(env1_2.current || onCancel == null)) {
onCancel();
}
}
global.__d(_fun89916, 11734, [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080,
11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277,
5313, 11744, 7972, 11746, 8950,
2]) /* metro module 11734, dependencies: [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080, 11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277, 5313, 11744, 7972, 11746, 8950, 2] */;
@@ -1,45 +1,59 @@
/* Metro module 11751; source: modules/polls/native/PollCreationInputError.tsx; dependencies: [31, 27, 33, 4501, 697, 3869, 1305, 4573, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun90055(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:6, offset: 0x02028d5e, size: 259 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
const TEXT_FEEDBACK_CRITICAL = (Native).colors.TEXT_FEEDBACK_CRITICAL;
const env0_6 = Reflect.apply(createStyles, value, [{container: {'flexDirection': 'row', 'alignItems': 'center',
'marginTop': -10}, icon: {'alignSelf': 'center', 'marginRight': 5, color: TEXT_FEEDBACK_CRITICAL}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreationInputError.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreationInputError.tsx');
exports.default = PollCreationInputError;
}
function PollCreationInputError({message}) { // fn#90056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:330, offset: 0x02028e61, size: 200 bytes, params: 2, frame: 20
const styles = useStyles();
ReactModule.useEffect(_fun90057, [message]);
const WarningCircle = (NativeModule).WarningCircle;
const warningCircle = (
<WarningCircle
width={16}
height={16}
style={styles.icon}
/>
);
const Text = (TextModule).Text;
return (
<View style={styles.container}>
{warningCircle}
<Text variant="text-xs/medium" color="text-feedback-critical">
{message}
</Text>
</View>
);
function _fun90057() { // fn#90057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:405, offset: 0x02028f29, size: 81 bytes, params: 1, frame: 12
var value4;
var AccessibilityAnnouncer;
if (message != null && message !== '') {
value4 = environment.__proto__;
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(message);
}
}
function PollCreationInputError({message}) { // fn#90056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:330, offset: 0x02028e61, size: 200 bytes, params: 2, frame: 20
const styles = useStyles();
env0_2.useEffect(_fun90057, [message]);
const WarningCircle = (require(1305) /* metro dependency 1305: native */).WarningCircle;
const warningCircle = <WarningCircle width={16} height={16} style={styles.icon} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.container}>
{warningCircle}
<Text variant="text-xs/medium" color="text-feedback-critical">
{message}
</Text>
</View>
);
}
function _fun90057() { // fn#90057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:405, offset: 0x02028f29, size: 81 bytes, params: 1, frame: 12
var value4;
var AccessibilityAnnouncer;
if (message != null && message !== '') {
value4 = environment.__proto__;
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(message);
}
}
global.__d(_fun90055, 11751, [31, 27, 33, 4501, 697, 3869, 1305, 4573,
2]) /* metro module 11751, dependencies: [31, 27, 33, 4501, 697, 3869, 1305, 4573, 2] */;
@@ -1,22 +1,26 @@
/* Metro module 11733; source: modules/polls/native/PollCreationModalActionCreators.tsx; dependencies: [5080, 11734, 1962, 2] */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun89913(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:6, offset: 0x02023575, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreationModalActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreationModalActionCreators.tsx');
exports.openCreatePollModal = openCreatePollModal;
exports.closeCreatePollModal = closeCreatePollModal;
function openCreatePollModal(a0) { // fn#89914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:230, offset: 0x020235e9, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'create-poll-modal']);
}
function closeCreatePollModal() { // fn#89915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:302, offset: 0x0202363b, size: 43 bytes, params: 1, frame: 12
(ModalActionCreators).popWithKey('create-poll-modal');
}
}
function openCreatePollModal(a0) { // fn#89914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:230, offset: 0x020235e9, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'create-poll-modal']);
}
function closeCreatePollModal() { // fn#89915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:302, offset: 0x0202363b, size: 43 bytes, params: 1, frame: 12
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('create-poll-modal');
}
global.__d(_fun89913, 11733, [5080, 11734, 1962, 2]) /* metro module 11733, dependencies: [5080, 11734, 1962, 2] */;
@@ -1,92 +1,101 @@
/* Metro module 11736; source: modules/polls/native/PollDurationActionSheet.tsx; dependencies: [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805, 2] */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import UsePollDurationOptions from '../usePollDurationOptions.tsx'; /* Metro dependency 11735 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as AccessibilityAnnouncerAndroidModule from '../../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/AccessibilityAnnouncer.android.tsx'; /* Metro dependency 3869 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as TableRadioRowNativeModule from '../../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */
import * as TableRadioGroupNativeModule from '../../../design/components/TableRow/native/TableRadioGroup.native.tsx'; /* Metro dependency 7988 */
function _fun89936(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:6, offset: 0x02024c9b, size: 153 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollDurationActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollDurationActionSheet.tsx');
exports.default = PollDurationActionSheet;
}
function PollDurationRadioGroup({selectedDuration, onChange}) { // fn#89937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:120, offset: 0x02024d34, size: 234 bytes, params: 2, frame: 22
var object2;
const value2 = (importDefault(11735) /* metro dependency 11735: usePollDurationOptions */)();
const value3 = env0_3.useCallback(_fun89938, [value2, onChange]);
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0ZStp9']);
object2.hasIcons = false;
object2.onChange = value3;
object2.defaultValue = selectedDuration;
const Object = global.Object;
return (
<TableRadioGroup {...object2}>
{Object.entries(value2).map(_fun89939)}
</TableRadioGroup>
);
}
function PollDurationActionSheet({selectedDuration, onChange}) { // fn#89940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:619, offset: 0x02024efb, size: 90 bytes, params: 2, frame: 18
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
return (
<ActionSheet>
<PollDurationRadioGroup selectedDuration={selectedDuration} onChange={onChange} />
</ActionSheet>
);
}
function _fun89938(a0) { // fn#89938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:218, offset: 0x02024e1e, size: 93 bytes, params: 2, frame: 15
onChange(a0);
const AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(env0_1[a0]);
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
function _fun89939(a0) { // fn#89939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:459, offset: 0x02024e7b, size: 128 bytes, params: 2, frame: 18
var r0;
var r1;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r5 = value;
} else {
r0 = item3;
r1 = value3;
r5 = item;
function PollDurationRadioGroup({selectedDuration, onChange}) { // fn#89937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:120, offset: 0x02024d34, size: 234 bytes, params: 2, frame: 22
const value2 = (UsePollDurationOptions)();
const value3 = ReactModule.useCallback(_fun89938, [value2, onChange]);
const TableRadioGroup = (TableRadioGroupNativeModule).TableRadioGroup;
object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0ZStp9']);
object.hasIcons = false;
object.onChange = value3;
object.defaultValue = selectedDuration;
const Object = global.Object;
return (
<TableRadioGroup {...object}>
{Object.entries(value2).map(_fun89939)}
</TableRadioGroup>
);
function _fun89938(a0) { // fn#89938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:218, offset: 0x02024e1e, size: 93 bytes, params: 2, frame: 15
onChange(a0);
const AccessibilityAnnouncer = (AccessibilityAnnouncerAndroidModule).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(env0_1[a0]);
(ActionSheetActionCreators).hideActionSheet();
}
function _fun89939(a0) { // fn#89939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:459, offset: 0x02024e7b, size: 128 bytes, params: 2, frame: 18
var r0;
var r1;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r5 = value;
} else {
r0 = item3;
r1 = value3;
r5 = item;
}
}
if (!r1) {
r0.return();
}
const TableRadioRow = (TableRadioRowNativeModule).TableRadioRow;
return (
<TableRadioRow
value={global.parseInt(r3)}
label={r5}
key={r3}
/>
);
}
}
if (!r1) {
r0.return();
function PollDurationActionSheet({selectedDuration, onChange}) { // fn#89940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:619, offset: 0x02024efb, size: 90 bytes, params: 2, frame: 18
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
return (
<ActionSheet>
<PollDurationRadioGroup selectedDuration={selectedDuration} onChange={onChange} />
</ActionSheet>
);
}
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
return (
<TableRadioRow
value={global.parseInt(r3)}
label={r5}
key={r3}
/>
);
}
global.__d(_fun89936, 11736, [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805,
2]) /* metro module 11736, dependencies: [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805, 2] */;
File diff suppressed because it is too large. Load diff
+167 -161
View File
@@ -1,179 +1,185 @@
/* Metro module 11743; source: modules/polls/native/useFocusHelper.tsx; dependencies: [7, 6, 31, 44, 6518, 2] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import UseInitialValue from '../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
function _fun90009(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:6, offset: 0x020269b2, size: 184 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = value(FocusHelperState);
const env0_5 = CreateClass(FocusHelperState);
const env0_6 = _fun90011();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/useFocusHelper.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/useFocusHelper.tsx');
exports.default = useFocusHelper;
}
function FocusHelperState() { // fn#90010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:131, offset: 0x02026a6a, size: 42 bytes, params: 1, frame: 13
ClassCallCheck(this, FocusHelperState);
this.refsByKey = {};
this.keyOrder = [];
}
function FocusHelperState() { // fn#90010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:131, offset: 0x02026a6a, size: 42 bytes, params: 1, frame: 13
env0_3(this, FocusHelperState);
this.refsByKey = {};
this.keyOrder = [];
}
function _fun90011() { // fn#90011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:224, offset: 0x02026a94, size: 113 bytes, params: 1, frame: 15
return env0_2(FocusHelperImpl, [{key: 'restartState', value: value_90015}, {key: 'commitState', value: function() {
var pendingState = this.pendingState;
if (pendingState != null) {
this.validState = pendingState;
}
this.pendingState = undefined;
}}, {key: 'refWithKey', value: value_90017}]);
function FocusHelperImpl() { // fn#90012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:245, offset: 0x02026b05, size: 89 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
env1_3(this, FocusHelperImpl);
this.validState = new env1_5();
this.focusNext = focusNext;
this.focus = focus_90014;
function focusNext() { // fn#90013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:333, owner: FocusHelperImpl.focusNext, offset: 0x02026b5e, size: 249 bytes, params: 1, frame: 25
var r11;
var r5;
var r6;
var r3;
var r4;
var propertyName;
var propertyName2;
var property;
var current;
var isFocused2;
var value3;
var onAddAnswer;
var value;
const {refsByKey, keyOrder} = env0_0.validState;
const value2 = undefined;
const properties = Object.keys(refsByKey);
const properties2 = 0;
const properties3 = properties.length;
if (properties === value2) {
r6 = value2;
} else {
r11 = properties2;
while (true) {
propertyName = properties[r11];
propertyName2 = r11 + 1;
if (propertyName === value2) {
r6 = value2;
break;
}
property = refsByKey[propertyName];
if (property == null) {
r5 = value2;
continue;
}
current = property.current;
if (current == null) {
r5 = value2;
continue;
}
isFocused2 = current.isFocused();
r5 = isFocused2;
if (r5 !== true) {
r11 = propertyName2;
continue;
}
r6 = propertyName;
break;
}
}
if (r6 != null) {
value3 = keyOrder.indexOf(r6);
if (value3 === -1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else if (value3 >= keyOrder.length - 1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else {
property = refsByKey[env0_0.validState.keyOrder[value3 + 1]];
value = property == null;
if (value) {
r3 = value;
r4 = property;
} else {
current = property.current;
r3 = current == null;
r4 = current;
}
if (!r3) {
r4.focus();
}
}
}
return value2;
}
function FocusHelperImplFocus(a0) { // fn#90014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:684, owner: FocusHelperImpl.focus, offset: 0x02026c57, size: 67 bytes, params: 2, frame: 12
var r0;
var r1;
var current;
const property = env0_0.validState.refsByKey[a0];
const value = property == null;
if (value) {
r0 = value;
r1 = property;
} else {
current = property.current;
r0 = current == null;
r1 = current;
}
if (!r0) {
r1.focus();
}
}
function _fun90011() { // fn#90011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:224, offset: 0x02026a94, size: 113 bytes, params: 1, frame: 15
return env0_2(FocusHelperImpl, [{key: 'restartState', value: value_90015}, {key: 'commitState', value: function() {
var pendingState = this.pendingState;
if (pendingState != null) {
this.validState = pendingState;
}
this.pendingState = undefined;
}}, {key: 'refWithKey', value: value_90017}]);
}
function useFocusHelper() { // fn#90018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1263, offset: 0x02026d52, size: 101 bytes, params: 1, frame: 14
const value = a0;
const env0_0 = (value !== undefined ? value : {}).onAddAnswer;
const value2 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun90019);
value2.restartState();
env0_4.useEffect(_fun90020);
return value2;
}
function FocusHelperImpl() { // fn#90012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:245, offset: 0x02026b05, size: 89 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
env1_3(this, FocusHelperImpl);
this.validState = new env1_5();
this.focusNext = focusNext;
this.focus = focus_90014;
}
function value_90015() { // fn#90015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:795, offset: 0x02026c9a, size: 40 bytes, params: 1, frame: 9
const value = environment.__proto__;
this.pendingState = new env1_5();
}
function value_90017(a0) { // fn#90017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:972, offset: 0x02026ce1, size: 113 bytes, params: 2, frame: 17
const pendingState = this.pendingState;
let value = environment.__proto__;
(importDefault(44) /* metro dependency 44 */)(pendingState != null, 'Called refWithKey without a valid state');
pendingState.keyOrder.push(a0);
const property = pendingState.refsByKey[a0];
if (property != null) {
return property;
}
value = env1_4.createRef();
pendingState.refsByKey[a0] = value;
return value;
}
function _fun90019() { // fn#90019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1322, offset: 0x02026db7, size: 29 bytes, params: 1, frame: 9
let value = environment.__proto__;
const binding = env1_6;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding();
return binding2 instanceof Object ? binding2 : value;
}
function _fun90020() { // fn#90020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1371, offset: 0x02026dd4, size: 37 bytes, params: 1, frame: 10
env0_1.onAddAnswer = onAddAnswer;
env0_1.commitState();
}
function focusNext() { // fn#90013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:333, owner: FocusHelperImpl.focusNext, offset: 0x02026b5e, size: 249 bytes, params: 1, frame: 25
var r11;
var r5;
var r6;
var r3;
var r4;
var propertyName;
var propertyName2;
var property;
var current;
var isFocused2;
var value3;
var onAddAnswer;
var value;
const {refsByKey, keyOrder} = env0_0.validState;
const value2 = undefined;
const properties = Object.keys(refsByKey);
const properties2 = 0;
const properties3 = properties.length;
if (properties === value2) {
r6 = value2;
} else {
r11 = properties2;
while (true) {
propertyName = properties[r11];
propertyName2 = r11 + 1;
if (propertyName === value2) {
r6 = value2;
break;
}
property = refsByKey[propertyName];
if (property == null) {
r5 = value2;
continue;
}
current = property.current;
if (current == null) {
r5 = value2;
continue;
}
isFocused2 = current.isFocused();
r5 = isFocused2;
if (r5 !== true) {
r11 = propertyName2;
continue;
}
r6 = propertyName;
break;
function value_90015() { // fn#90015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:795, offset: 0x02026c9a, size: 40 bytes, params: 1, frame: 9
const value = environment.__proto__;
this.pendingState = new env1_5();
}
}
if (r6 != null) {
value3 = keyOrder.indexOf(r6);
if (value3 === -1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else if (value3 >= keyOrder.length - 1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else {
property = refsByKey[env0_0.validState.keyOrder[value3 + 1]];
value = property == null;
if (value) {
r3 = value;
r4 = property;
} else {
current = property.current;
r3 = current == null;
r4 = current;
}
if (!r3) {
r4.focus();
function value_90017(a0) { // fn#90017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:972, offset: 0x02026ce1, size: 113 bytes, params: 2, frame: 17
const pendingState = this.pendingState;
let value = environment.__proto__;
(Module00044)(pendingState != null, 'Called refWithKey without a valid state');
pendingState.keyOrder.push(a0);
const property = pendingState.refsByKey[a0];
if (property != null) {
return property;
}
value = env1_4.createRef();
pendingState.refsByKey[a0] = value;
return value;
}
}
return value2;
}
function FocusHelperImplFocus(a0) { // fn#90014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:684, owner: FocusHelperImpl.focus, offset: 0x02026c57, size: 67 bytes, params: 2, frame: 12
var r0;
var r1;
var current;
const property = env0_0.validState.refsByKey[a0];
const value = property == null;
if (value) {
r0 = value;
r1 = property;
} else {
current = property.current;
r0 = current == null;
r1 = current;
}
if (!r0) {
r1.focus();
function useFocusHelper() { // fn#90018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1263, offset: 0x02026d52, size: 101 bytes, params: 1, frame: 14
const value = a0;
const env0_0 = (value !== undefined ? value : {}).onAddAnswer;
const value2 = (UseInitialValue)(_fun90019);
value2.restartState();
ReactModule.useEffect(_fun90020);
return value2;
function _fun90019() { // fn#90019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1322, offset: 0x02026db7, size: 29 bytes, params: 1, frame: 9
let value = environment.__proto__;
const binding = env1_6;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding();
return binding2 instanceof Object ? binding2 : value;
}
function _fun90020() { // fn#90020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1371, offset: 0x02026dd4, size: 37 bytes, params: 1, frame: 10
env0_1.onAddAnswer = onAddAnswer;
env0_1.commitState();
}
}
}
global.__d(_fun90009, 11743, [7, 6, 31, 44, 6518,
2]) /* metro module 11743, dependencies: [7, 6, 31, 44, 6518, 2] */;
@@ -1,91 +1,98 @@
/* Metro module 11747; source: modules/polls/native/useRenderPollAnswerImage.tsx; dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as PollTypesModule from '../PollTypes.tsx'; /* Metro dependency 11741 */
function _fun90039(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:6, offset: 0x02027ce6, size: 240 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).ActivityIndicator;
const env0_6 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const env0_8 = (require(1881) /* metro dependency 1881: EmojiConstants */).EMOJI_URL_BASE_SIZE;
const env0_9 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/useRenderPollAnswerImage.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/useRenderPollAnswerImage.tsx');
exports.default = useRenderPollAnswerImage;
}
function useRenderPollAnswerImage(a0, a1, a2, a3, a4) { // fn#90040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:312, offset: 0x02027dd6, size: 279 bytes, params: 6, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
const value2 = undefined;
const upload = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore],
_fun90041);
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(), 2);
const status = a2 == null || a2.mediaAttachmentState == null ? value2 : a2.mediaAttachmentState.status;
const PollMediaUploadAttachmentStatus = (require(11741) /* metro dependency 11741: PollTypes */).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
const value5 = status === PREPARING;
binding = env0_4;
const useMemo = binding.useMemo;
return {renderImage: Reflect.apply(useMemo, binding, [_fun90042, [a2, a4, a3, upload, value5, property]]),
upload: upload, setUploadSize: property2};
}
function _fun90041() { // fn#90041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:397, offset: 0x02027eed, size: 43 bytes, params: 1, frame: 15
const getUpload = UploadAttachmentStore.getUpload;
const binding = env0_0;
const Poll = DraftType.Poll;
return Reflect.apply(getUpload, UploadAttachmentStore, [binding, require, Poll]);
}
function _fun90042() { // fn#90042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:609, offset: 0x02027f18, size: 400 bytes, params: 1, frame: 22
var r7;
var r6;
var value3;
var Emoji;
var object2;
var binding;
var item;
var value;
if (result) {
value = environment.__proto__;
return <ActivityIndicator />;
}
if (upload != null) {
item = upload.item;
r6 = importAll ?? env0_6;
value = environment.__proto__;
value = importDefault(5475) /* metro dependency 5475: FastImage */;
return ((Component) => <Component style={{width: r6, height: r6}} source={{uri: item.uri}} />)(value);
}
const value2 = undefined;
let emoji = importDefault == null ? value2 : importDefault.emoji;
if (emoji != null) {
emoji = importDefault.emoji;
value3 = environment.__proto__;
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
object2 = {};
function useRenderPollAnswerImage(a0, a1, a2, a3, a4) { // fn#90040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:312, offset: 0x02027dd6, size: 279 bytes, params: 6, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
const value2 = undefined;
const upload = (FluxModule).useStateFromStores([UploadAttachmentStore],
_fun90041);
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(), 2);
const status = a2 == null || a2.mediaAttachmentState == null ? value2 : a2.mediaAttachmentState.status;
const PollMediaUploadAttachmentStatus = (PollTypesModule).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
const value5 = status === PREPARING;
binding = env0_4;
object2.fastImageStyle = {width: binding, height: binding};
object2.textEmojiStyle = {fontSize: binding};
r7 = emoji.type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
value = '';
r6 = r7 ?? value;
object2.name = r6;
if (emoji.id != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emoji.id, animated: emoji.animated, size: EMOJI_URL_BASE_SIZE});
r6 = value;
} else {
r6 = value2;
const useMemo = binding.useMemo;
return {renderImage: Reflect.apply(useMemo, binding, [_fun90042, [a2, a4, a3, upload, value5, property]]),
upload: upload, setUploadSize: property2};
function _fun90041() { // fn#90041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:397, offset: 0x02027eed, size: 43 bytes, params: 1, frame: 15
const uploadAttachmentStoreBinding = UploadAttachmentStore;
const getUpload = uploadAttachmentStoreBinding.getUpload;
const binding = env0_0;
const Poll = DraftType.Poll;
return Reflect.apply(getUpload, uploadAttachmentStoreBinding, [binding, require, Poll]);
}
object2.src = r6;
return <Emoji {...object2} />;
function _fun90042() { // fn#90042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:609, offset: 0x02027f18, size: 400 bytes, params: 1, frame: 22
var r7;
var r6;
var value3;
var Emoji;
var object;
var binding;
var item;
var value;
if (result) {
value = environment.__proto__;
return <ActivityIndicator />;
}
if (upload != null) {
item = upload.item;
r6 = importAll ?? DraftStoreModule.DraftType;
value = environment.__proto__;
value = importDefault(5475) /* metro dependency 5475: FastImage */;
return ((Component) => <Component style={{width: r6, height: r6}} source={{uri: item.uri}} />)(value);
}
const value2 = undefined;
let emoji = importDefault == null ? value2 : importDefault.emoji;
if (emoji != null) {
emoji = importDefault.emoji;
value3 = environment.__proto__;
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
object = {};
binding = env0_4;
object.fastImageStyle = {width: binding, height: binding};
object.textEmojiStyle = {fontSize: binding};
r7 = emoji.type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
value = '';
r6 = r7 ?? value;
object.name = r6;
if (emoji.id != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emoji.id, animated: emoji.animated, size: EMOJI_URL_BASE_SIZE});
r6 = value;
} else {
r6 = value2;
}
object.src = r6;
return <Emoji {...object} />;
}
return value2;
}
}
return value2;
}
global.__d(_fun90039, 11747, [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423,
2]) /* metro module 11747, dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */;
@@ -1,4 +1,6 @@
/* Metro module 8302; source: modules/polls/parsePollResultSystemMessageEmbed.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun66190(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:6, offset: 0x01bf1616, size: 109 bytes, params: 8, frame: 16
const _arrayLikeToArray_66193 = function(a0, a1) {
var r0;
@@ -45,140 +47,146 @@ function _fun66190(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/parsePollResultSystemMessageEmbed.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/parsePollResultSystemMessageEmbed.tsx');
exports.default = parsePollResultSystemMessageEmbed;
}
function _createForOfIteratorHelperLoose_66191(a0, a1) { // fn#66191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:46, offset: 0x01bf1683, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
function _createForOfIteratorHelperLoose_66191(a0, a1) { // fn#66191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:46, offset: 0x01bf1683, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
return _fun66192;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_66193(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun66192;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_66193(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_66193(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_66193(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
if (r5) {
}
return _fun66192;
}
return _fun66192;
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun66192() { // fn#66192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:617, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function parsePollResultSystemMessageEmbed(a0) { // fn#66194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:1103, offset: 0x01bf17f7, size: 375 bytes, params: 2, frame: 29
var r4;
var value5;
var rawName;
var rawValue;
var parseInt;
var value6;
var animated;
if (a0?.fields == null) {
return null;
}
const object3 = {};
const object4 = {};
const value3 = _createForOfIteratorHelperLoose_66191(a0.fields);
const value4 = value3();
let done = value4.done;
if (!done) {
r4 = value4;
while (true) {
value5 = r4.value;
rawName = value5.rawName;
if (rawName !== 'poll_question_text') {
if (rawName === 'victor_answer_id') {
object3.victorAnswerId = value5.rawValue;
break;
}
if (rawName === 'victor_answer_text') {
object3.victorAnswerText = value5.rawValue;
break;
}
if (rawName === 'victor_answer_votes') {
parseInt = global.parseInt;
object3.victorAnswerVotes = parseInt(value5.rawValue, 10);
break;
}
if (rawName === 'total_votes') {
parseInt = global.parseInt;
object3.totalVotes = parseInt(value5.rawValue, 10);
break;
}
if (rawName === 'victor_answer_emoji_id') {
object4.id = value5.rawValue;
break;
}
if (rawName === 'victor_answer_emoji_name') {
object4.name = value5.rawValue;
function parsePollResultSystemMessageEmbed(a0) { // fn#66194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8487:1103, offset: 0x01bf17f7, size: 375 bytes, params: 2, frame: 29
var r4;
var value5;
var rawName;
var rawValue;
var parseInt;
var value6;
var animated;
if (a0?.fields == null) {
return null;
}
const object = {};
const object2 = {};
const value3 = _createForOfIteratorHelperLoose_66191(a0.fields);
const value4 = value3();
let done = value4.done;
if (!done) {
r4 = value4;
while (true) {
value5 = r4.value;
rawName = value5.rawName;
if (rawName !== 'poll_question_text') {
if (rawName === 'victor_answer_id') {
object.victorAnswerId = value5.rawValue;
break;
}
if (rawName === 'victor_answer_text') {
object.victorAnswerText = value5.rawValue;
break;
}
if (rawName === 'victor_answer_votes') {
parseInt = global.parseInt;
object.victorAnswerVotes = parseInt(value5.rawValue, 10);
break;
}
if (rawName === 'total_votes') {
parseInt = global.parseInt;
object.totalVotes = parseInt(value5.rawValue, 10);
break;
}
if (rawName === 'victor_answer_emoji_id') {
object2.id = value5.rawValue;
break;
}
if (rawName === 'victor_answer_emoji_name') {
object2.name = value5.rawValue;
break;
}
if (rawName !== 'victor_answer_emoji_animated') {
break;
}
object2.animated = value5.rawValue === 'true';
break;
}
if (rawName !== 'victor_answer_emoji_animated') {
rawValue = value5.rawValue;
object.questionText = rawValue;
value6 = value3();
done = value6.done;
if (done) {
break;
}
object4.animated = value5.rawValue === 'true';
break;
r4 = value6;
continue;
}
rawValue = value5.rawValue;
object3.questionText = rawValue;
value6 = value3();
done = value6.done;
if (done) {
break;
}
r4 = value6;
continue;
}
}
if (object4.name != null) {
animated = object4.animated;
object4.animated = animated != null && animated;
object3.victorEmoji = object4;
if (object2.name != null) {
animated = object2.animated;
object2.animated = animated != null && animated;
object.victorEmoji = object2;
}
return object;
}
return object3;
}
global.__d(_fun66190, 8302, [2]) /* metro module 8302, dependencies: [2] */;
+14 -10
View File
@@ -1,17 +1,21 @@
/* Metro module 4640; source: modules/polls/transformMessagPoll.tsx; dependencies: [3738, 2] */
import Module03738 from '../../by-id/module-03738.js'; /* Metro dependency 3738 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun39901(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4818:6, offset: 0x010ef32e, size: 97 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/transformMessagPoll.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/transformMessagPoll.tsx');
exports.default = transformMessagePoll;
function transformMessagePoll(a0) { // fn#39902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4818:173, offset: 0x010ef38f, size: 61 bytes, params: 2, frame: 14
const object = {};
copyDataProperties(object, a0, undefined);
let value = Module03738;
value = value(a0.expiry);
object['expiry'] = value;
return object;
}
}
function transformMessagePoll(a0) { // fn#39902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4818:173, offset: 0x010ef38f, size: 61 bytes, params: 2, frame: 14
const object2 = {};
copyDataProperties(object2, a0, undefined);
let value = importDefault(3738) /* metro dependency 3738 */;
value = value(a0.expiry);
object2['expiry'] = value;
return object2;
}
global.__d(_fun39901, 4640, [3738, 2]) /* metro module 4640, dependencies: [3738, 2] */;
+377 -367
View File
@@ -1,4 +1,16 @@
/* Metro module 11737; source: modules/polls/useCreatePollFormData.tsx; dependencies: [5, 57, 31, 7217, 7149, 11738, 11197, 11739, 11740, 11741, 1244, 8436, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import PollsActionCreators from './PollsActionCreators.tsx'; /* Metro dependency 11197 */
import UseRequest from '../../hooks/useRequest.tsx'; /* Metro dependency 11738 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as PollsUtilsModule from './PollsUtils.tsx'; /* Metro dependency 7149 */
import * as PollsConstantsModule from './PollsConstants.tsx'; /* Metro dependency 7217 */
import * as PollUploadAttachmentActionCreatorsNativeModule from './PollUploadAttachmentActionCreators.native.tsx'; /* Metro dependency 11739 */
import * as PollTypesModule from './PollTypes.tsx'; /* Metro dependency 11741 */
function _fun89941(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:6, offset: 0x02024f55, size: 210 bytes, params: 8, frame: 20
const env0_0 = require;
const createPollCreationImageForMedia = function(a0, a1) {
@@ -6,379 +18,377 @@ function _fun89941(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(5) /* metro dependency 5 */;
const env0_5 = importDefault(57) /* metro dependency 57 */;
const env0_6 = importAll(31) /* metro dependency 31 */;
const pollsConstantsModule = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_7 = pollsConstantsModule.MAX_NUMBER_OF_ANSWERS_PER_POLL;
const env0_8 = pollsConstantsModule.MIN_NUMBER_OF_ANSWERS_PER_POLL;
const env0_9 = pollsConstantsModule.PollDurations;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/useCreatePollFormData.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/useCreatePollFormData.tsx');
exports.default = useCreatePollCommonData;
}
function useCreatePollCommonData(a0, a1, a2, a3) { // fn#89943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:435, offset: 0x0202504d, size: 1112 bytes, params: 5, frame: 45
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const id = a0.id;
const env0_4 = id;
let binding = env0_6;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [_fun89944]);
const value3 = undefined;
const value4 = env0_5(value2, 2);
const property = value4[0];
var env0_5 = property;
var env0_6 = value4[1];
const value6 = binding.useState((a3 == null ? value3 : a3.initialQuestion) ?? '');
binding = env0_5;
const value7 = binding(value6, 2);
const property2 = value7[0];
const property3 = value7[1];
const binding2 = env0_6;
useState = binding2.useState;
const value8 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property4 = value8[0];
const property5 = value8[1];
const value9 = binding2.useState((a3 == null ? value3 : a3.initialDuration) ?? PollDurations.ONE_DAY);
binding = env0_5;
const value10 = binding(value9, 2);
const property6 = value10[0];
const property7 = value10[1];
const binding3 = env0_6;
useState = binding3.useState;
const value11 = binding(Reflect.apply(useState, binding3, [{}]), 2);
const property8 = value11[0];
const env0_11 = value11[1];
useState = binding3.useState;
const value12 = binding(Reflect.apply(useState, binding3, [false]), 2);
const property9 = value12[0];
const property10 = value12[1];
const value13 = property.filter(_fun89946);
const r18 = property2.length > 0 && value13.length >= MIN_NUMBER_OF_ANSWERS_PER_POLL && property.filter(_fun89947).length === 0;
const value19 = env0_5((importDefault(11738) /* metro dependency 11738: useRequest */)((importDefault(11197) /* metro dependency 11197: PollsActionCreators */).createPoll),
2);
const property11 = value19[0];
const {error, loading} = value19[1];
const value20 = property.length < MAX_NUMBER_OF_ANSWERS_PER_POLL;
const value21 = property.length > MIN_NUMBER_OF_ANSWERS_PER_POLL;
binding = env0_6;
let useCallback = binding.useCallback;
const value22 = Reflect.apply(useCallback, binding, [_fun89948, []]);
const value23 = binding.useCallback(_fun89950, []);
const value24 = binding.useCallback(_fun89953, []);
const value25 = binding.useCallback(_fun89955, [property]);
const value27 = binding.useCallback(_fun89956(), [property, value24, value25]);
const value28 = binding.useCallback(_fun89960, [property, value24, value25]);
const value29 = binding.useCallback(_fun89961, [id, value24, value25]);
const value30 = binding.useCallback(_fun89962, []);
const value31 = binding.useCallback(_fun89964, [value20]);
const value32 = binding.useCallback(_fun89966, [property.length, value21, id, a2, value25]);
binding.useEffect(function() {
return _fun89969;
}, [id]);
const value33 = binding.useCallback(_fun89970, [property, property2]);
useCallback = binding.useCallback;
let value = env0_4(_fun89974);
value = Reflect.apply(useCallback, binding, [value, [property2, value13, property4, property6, property11, a0, a1]]);
useCallback = binding.useCallback;
return {answers: property, question: property2, setQuestion: property3, allowMultiSelect: property4,
setAllowMultiSelect: property5, duration: property6, setDuration: property7, canPost: r18,
canAddMoreAnswers: value20, canRemoveMoreAnswers: value21, handleQuestionChange: value22,
handleAnswerTextChange: value23, handleGifSelect: value27, handleEmojiSelect: value29,
handleCustomUpload: value28, handleAddAnswer: value31, handleRemoveAnswer: value32,
handleRemoveAnswerImage: value30, fieldErrors: property8, createPoll: value,
handleSubmitPoll: Reflect.apply(useCallback, binding, [_fun89975, [value, loading, value33]]),
submitting: loading, createPollError: error, shouldFocusOnInvalidField: property9,
setShouldFocusOnInvalidField: property10};
}
function _fun89944() { // fn#89944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:506, offset: 0x020254a5, size: 133 bytes, params: 1, frame: 15
var environment;
var items2;
var value;
let r0 = importAll == null || importAll.initialAnswers == null ? undefined : importAll.initialAnswers.map(_fun89945);
if (r0 == null) {
value = environment.__proto__;
value = require(7149) /* metro dependency 7149: PollsUtils */;
value = value.generateEmptyPollAnswer();
items2 = [value];
value = require(7149) /* metro dependency 7149: PollsUtils */;
items2[1] = value.generateEmptyPollAnswer();
r0 = items2;
}
return r0;
}
function _fun89946(a0) { // fn#89946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1044, offset: 0x02025562, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (require(7149) /* metro dependency 7149: PollsUtils */).isAnswerFilled(a0);
}
function _fun89947(a0) { // fn#89947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1087, offset: 0x0202558b, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (require(7149) /* metro dependency 7149: PollsUtils */).isIncompleteAnswer(a0);
}
function _fun89948(a0) { // fn#89948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1282, offset: 0x020255b4, size: 37 bytes, params: 2, frame: 12
env0_11(function(a0) {
var r1;
var object = {};
copyDataProperties(object, a0, r1);
delete object.question;
return object;
});
env0_8(a0);
}
function _fun89950({text, index, localCreationAnswerId}) { // fn#89950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1365, offset: 0x020255ec, size: 72 bytes, params: 2, frame: 13
env0_11(function(a0) {
var r3;
var object = {};
copyDataProperties(object, a0, r3);
delete object['answer-' + localCreationAnswerId];
return object;
});
env0_6(function(a0) {
var r4;
var items = [];
arraySpread(items, a0, 0, r4);
var indexBinding = index;
var object = {};
copyDataProperties(object, items[indexBinding], 0);
object['text'] = text;
items[indexBinding] = object;
return items;
});
}
function _fun89953(a0, a1) { // fn#89953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1544, offset: 0x0202569c, size: 39 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
env0_6(_fun89954);
}
function _fun89955(a0, a1, a2) { // fn#89955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1631, offset: 0x020256fa, size: 149 bytes, params: 4, frame: 19
var value4;
var moduleValue;
var removePollUploadAttachment;
var localCreationAnswerId;
var moduleValue2;
const property = env0_5[a1];
const image = property.image;
const value = undefined;
const mediaAttachmentState = image == null ? value : image.mediaAttachmentState;
if (mediaAttachmentState != null && mediaAttachmentState.mediaURL !== a2) {
value4 = environment.__proto__;
moduleValue = importAll(11739) /* metro dependency 11739: PollUploadAttachmentActionCreatorsNative */;
removePollUploadAttachment = moduleValue.removePollUploadAttachment;
localCreationAnswerId = property.localCreationAnswerId;
moduleValue2 = require(11740) /* metro dependency 11740: PollAttachmentUtils */;
Reflect.apply(removePollUploadAttachment, moduleValue, [a0, localCreationAnswerId,
moduleValue2.getFileNameFromGifUrl(property.localCreationAnswerId, mediaAttachmentState.mediaURL)]);
}
return value;
}
function _fun89956() { // fn#89956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1881, offset: 0x0202578f, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_4(_fun89958);
return _fun89959;
}
function _fun89960(a0, a1, a2) { // fn#89960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2375, offset: 0x020258bf, size: 180 bytes, params: 4, frame: 24
const localCreationAnswerId = env0_5[a1].localCreationAnswerId;
const URL = global.URL;
const objectURL = URL.createObjectURL(a2);
env0_19(a0, a1);
let binding = env0_18;
const createPollCreationImageForMediaBinding = createPollCreationImageForMedia;
const PollMediaUploadAttachmentStatus = (require(11741) /* metro dependency 11741: PollTypes */).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
binding(createPollCreationImageForMediaBinding(objectURL, PREPARING), a1);
(importAll(11739) /* metro dependency 11739: PollUploadAttachmentActionCreatorsNative */).handlePollMediaAttachmentAdd(a0,
localCreationAnswerId, a2);
binding = env0_18;
const READY_TO_UPLOAD = PollMediaUploadAttachmentStatus.READY_TO_UPLOAD;
binding(createPollCreationImageForMediaBinding(objectURL, READY_TO_UPLOAD), a1);
}
function _fun89961(a0, a1) { // fn#89961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2714, offset: 0x02025973, size: 54 bytes, params: 3, frame: 14
env0_19(id, a1);
env0_18({emoji: a0, stickerId: undefined, mediaAttachmentState: undefined}, a1);
}
function _fun89962(a0) { // fn#89962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2822, offset: 0x020259a9, size: 32 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_6(_fun89963);
}
function _fun89964() { // fn#89964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2910, offset: 0x020259fe, size: 34 bytes, params: 1, frame: 11
if (result) {
env0_6(function(a0) {
var r4;
var items = [];
var value = arraySpread(items, a0, 0, r4);
items[value] = require(dependencyMap[4]).generateEmptyPollAnswer();
value + 1;
return items;
});
}
}
function _fun89966(a0) { // fn#89966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2992, offset: 0x02025a61, size: 97 bytes, params: 2, frame: 16
var length;
var binding;
const env0_0 = a0;
if (result_2) {
length = env0_5.length;
binding = env0_19;
binding(id, a0);
function useCreatePollCommonData(a0, a1, a2, a3) { // fn#89943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:435, offset: 0x0202504d, size: 1112 bytes, params: 5, frame: 45
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const id = a0.id;
const id2 = id;
let binding = env0_6;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [_fun89944]);
const value3 = undefined;
const value4 = property12(value2, 2);
const property = value4[0];
var property12 = property;
var env0_6 = value4[1];
const value6 = binding.useState((a3 == null ? value3 : a3.initialQuestion) ?? '');
binding = property12;
const value7 = binding(value6, 2);
const property2 = value7[0];
const property3 = value7[1];
const binding2 = env0_6;
useState = binding2.useState;
const value8 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property4 = value8[0];
const property5 = value8[1];
const value9 = binding2.useState((a3 == null ? value3 : a3.initialDuration) ?? PollDurations.ONE_DAY);
binding = property12;
const value10 = binding(value9, 2);
const property6 = value10[0];
const property7 = value10[1];
const binding3 = env0_6;
useState = binding3.useState;
const value11 = binding(Reflect.apply(useState, binding3, [{}]), 2);
const property8 = value11[0];
const env0_11 = value11[1];
useState = binding3.useState;
const value12 = binding(Reflect.apply(useState, binding3, [false]), 2);
const property9 = value12[0];
const property10 = value12[1];
const value13 = property.filter(_fun89946);
const r18 = property2.length > 0 && value13.length >= MIN_NUMBER_OF_ANSWERS_PER_POLL && property.filter(_fun89947).length === 0;
const value19 = property12((UseRequest)((PollsActionCreators).createPoll),
2);
const property11 = value19[0];
const {error, loading} = value19[1];
const value20 = property.length < MAX_NUMBER_OF_ANSWERS_PER_POLL;
const value21 = property.length > MIN_NUMBER_OF_ANSWERS_PER_POLL;
binding = env0_6;
binding(_fun89967);
if (importDefault != null) {
importDefault({indexToRemove: a0, numberOfAnswers: length});
let useCallback = binding.useCallback;
const value22 = Reflect.apply(useCallback, binding, [_fun89948, []]);
const value23 = binding.useCallback(_fun89950, []);
const value24 = binding.useCallback(_fun89953, []);
const value25 = binding.useCallback(_fun89955, [property]);
const value27 = binding.useCallback(_fun89956(), [property, value24, value25]);
const value28 = binding.useCallback(_fun89960, [property, value24, value25]);
const value29 = binding.useCallback(_fun89961, [id, value24, value25]);
const value30 = binding.useCallback(_fun89962, []);
const value31 = binding.useCallback(_fun89964, [value20]);
const value32 = binding.useCallback(_fun89966, [property.length, value21, id, a2, value25]);
binding.useEffect(function() {
return _fun89969;
}, [id]);
const value33 = binding.useCallback(_fun89970, [property, property2]);
useCallback = binding.useCallback;
let value = id2(_fun89974);
value = Reflect.apply(useCallback, binding, [value, [property2, value13, property4, property6, property11, a0, a1]]);
useCallback = binding.useCallback;
return {answers: property, question: property2, setQuestion: property3, allowMultiSelect: property4,
setAllowMultiSelect: property5, duration: property6, setDuration: property7, canPost: r18,
canAddMoreAnswers: value20, canRemoveMoreAnswers: value21, handleQuestionChange: value22,
handleAnswerTextChange: value23, handleGifSelect: value27, handleEmojiSelect: value29,
handleCustomUpload: value28, handleAddAnswer: value31, handleRemoveAnswer: value32,
handleRemoveAnswerImage: value30, fieldErrors: property8, createPoll: value,
handleSubmitPoll: Reflect.apply(useCallback, binding, [_fun89975, [value, loading, value33]]),
submitting: loading, createPollError: error, shouldFocusOnInvalidField: property9,
setShouldFocusOnInvalidField: property10};
function _fun89944() { // fn#89944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:506, offset: 0x020254a5, size: 133 bytes, params: 1, frame: 15
var environment;
var items2;
var value;
let r0 = importAll == null || importAll.initialAnswers == null ? undefined : importAll.initialAnswers.map(_fun89945);
if (r0 == null) {
value = environment.__proto__;
value = require(7149) /* metro dependency 7149: PollsUtils */;
value = value.generateEmptyPollAnswer();
items2 = [value];
value = require(7149) /* metro dependency 7149: PollsUtils */;
items2[1] = value.generateEmptyPollAnswer();
r0 = items2;
}
return r0;
function _fun89945(a0) { // fn#89945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:585, offset: 0x0202552a, size: 56 bytes, params: 2, frame: 13
const object = {};
let value = environment.__proto__.__proto__;
value = require(7149) /* metro dependency 7149: PollsUtils */;
copyDataProperties(object, value.generateEmptyPollAnswer(), require);
copyDataProperties(object, a0, require);
return object;
}
}
}
}
function _fun89968() { // fn#89968, offset: 0x02025aea, size: 11 bytes, params: 1, frame: 1
return _fun89969;
}
function _fun89970() { // fn#89970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3238, offset: 0x02025b22, size: 314 bytes, params: 1, frame: 18
var environment;
var value2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let env0_0 = true;
const object2 = {};
let binding = env0_7;
if (binding.trim().length === 0) {
env0_0 = false;
value2 = environment.__proto__;
object2.question = intl.string(t.gPX3oI);
}
binding = env0_5;
if (binding.filter(_fun89971).length < MIN_NUMBER_OF_ANSWERS_PER_POLL) {
env0_0 = false;
object2['answer-' + env0_5[0].localCreationAnswerId] = intl.string(t.fYvzEX);
}
env0_5.forEach(_fun89972);
env0_11(object2);
env0_12(!env0_0);
return env0_0;
}
function* _fun89974() { // fn#89974, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3663, offset: 0x02025d24, size: 137 bytes, params: 1, frame: 15
if (true) {
value = environment.__proto__;
var binding = env1_14;
var object2 = {};
object2.channel = require;
object2.question = MAX_NUMBER_OF_ANSWERS_PER_POLL;
object2.answers = env1_13;
object2.allowMultiSelect = PollDurations;
object2.duration = createPollCreationImageForMedia;
var PollLayoutTypes = env2_0(env2_3[11]).PollLayoutTypes;
var DEFAULT = PollLayoutTypes.DEFAULT;
object2.layout = DEFAULT;
object2.onClose = importDefault;
yield binding(object2);
}
}
function _fun89975() { // fn#89975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3835, offset: 0x02025dad, size: 40 bytes, params: 1, frame: 11
if (!loading && env0_20()) {
env0_21();
}
}
function _fun89945(a0) { // fn#89945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:585, offset: 0x0202552a, size: 56 bytes, params: 2, frame: 13
const object2 = {};
let value = environment.__proto__.__proto__;
value = require(7149) /* metro dependency 7149: PollsUtils */;
copyDataProperties(object2, value.generateEmptyPollAnswer(), require);
copyDataProperties(object2, a0, require);
return object2;
}
function _fun89954(a0) { // fn#89954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1555, offset: 0x020256c3, size: 55 bytes, params: 2, frame: 15
const items2 = [];
arraySpread(items2, a0, 0, undefined);
const object2 = {};
copyDataProperties(object2, items2[require], 0);
object2['image'] = env0_0;
items2[require] = object2;
return items2;
}
function* _fun89958(a0, a1, a2) { // fn#89958, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1901, offset: 0x020257be, size: 257 bytes, params: 4, frame: 24
if (true) {
value = environment.__proto__.__proto__;
var localCreationAnswerId = env2_5[a1].localCreationAnswerId;
env2_19(a0, a1);
var binding = env2_18;
var binding2 = env3_10;
var binding3 = env3_0;
var binding4 = env3_3;
var PollMediaUploadAttachmentStatus = binding3(binding4[9]).PollMediaUploadAttachmentStatus;
var PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
binding(binding2(a2, PREPARING), a1);
var value4 = env3_2(binding4[7]);
yield value4.handlePollGifAttachmentAdd(a0, localCreationAnswerId, a2);
var value5 = undefined;
if (false) {
return value5;
function _fun89946(a0) { // fn#89946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1044, offset: 0x02025562, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (PollsUtilsModule).isAnswerFilled(a0);
}
if (value5 != null) {
env2_18(env3_10(a2, env3_0(env3_3[9]).PollMediaUploadAttachmentStatus.READY_TO_UPLOAD), a1);
} else {
env2_18(env3_10(a2, env3_0(env3_3[9]).PollMediaUploadAttachmentStatus.ERROR), a1);
function _fun89947(a0) { // fn#89947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1087, offset: 0x0202558b, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (PollsUtilsModule).isIncompleteAnswer(a0);
}
function _fun89948(a0) { // fn#89948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1282, offset: 0x020255b4, size: 37 bytes, params: 2, frame: 12
env0_11(function(a0) {
var r1;
var object = {};
copyDataProperties(object, a0, r1);
delete object.question;
return object;
});
(0, PollsConstantsModule.MIN_NUMBER_OF_ANSWERS_PER_POLL)(a0);
}
function _fun89950({text, index, localCreationAnswerId}) { // fn#89950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1365, offset: 0x020255ec, size: 72 bytes, params: 2, frame: 13
env0_11(function(a0) {
var r3;
var object = {};
copyDataProperties(object, a0, r3);
delete object['answer-' + localCreationAnswerId];
return object;
});
env0_6(function(a0) {
var r4;
var items = [];
arraySpread(items, a0, 0, r4);
var indexBinding = index;
var object = {};
copyDataProperties(object, items[indexBinding], 0);
object['text'] = text;
items[indexBinding] = object;
return items;
});
}
function _fun89953(a0, a1) { // fn#89953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1544, offset: 0x0202569c, size: 39 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
env0_6(_fun89954);
function _fun89954(a0) { // fn#89954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1555, offset: 0x020256c3, size: 55 bytes, params: 2, frame: 15
const items2 = [];
arraySpread(items2, a0, 0, undefined);
const object = {};
copyDataProperties(object, items2[require], 0);
object['image'] = env0_0;
items2[require] = object;
return items2;
}
}
function _fun89955(a0, a1, a2) { // fn#89955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1631, offset: 0x020256fa, size: 149 bytes, params: 4, frame: 19
var value4;
var moduleValue;
var removePollUploadAttachment;
var localCreationAnswerId;
var moduleValue2;
const property = Module00057[a1];
const image = property.image;
const value = undefined;
const mediaAttachmentState = image == null ? value : image.mediaAttachmentState;
if (mediaAttachmentState != null && mediaAttachmentState.mediaURL !== a2) {
value4 = environment.__proto__;
moduleValue = importAll(11739) /* metro dependency 11739: PollUploadAttachmentActionCreatorsNative */;
removePollUploadAttachment = moduleValue.removePollUploadAttachment;
localCreationAnswerId = property.localCreationAnswerId;
moduleValue2 = require(11740) /* metro dependency 11740: PollAttachmentUtils */;
Reflect.apply(removePollUploadAttachment, moduleValue, [a0, localCreationAnswerId,
moduleValue2.getFileNameFromGifUrl(property.localCreationAnswerId, mediaAttachmentState.mediaURL)]);
}
return value;
}
function _fun89956() { // fn#89956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1881, offset: 0x0202578f, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_4(_fun89958);
return _fun89959;
function* _fun89958(a0, a1, a2) { // fn#89958, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:1901, offset: 0x020257be, size: 257 bytes, params: 4, frame: 24
if (true) {
value = environment.__proto__.__proto__;
var localCreationAnswerId = env2_5[a1].localCreationAnswerId;
env2_19(a0, a1);
var binding = env2_18;
var binding2 = env3_10;
var binding3 = env3_0;
var binding4 = env3_3;
var PollMediaUploadAttachmentStatus = binding3(binding4[9]).PollMediaUploadAttachmentStatus;
var PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
binding(binding2(a2, PREPARING), a1);
var value4 = env3_2(binding4[7]);
yield value4.handlePollGifAttachmentAdd(a0, localCreationAnswerId, a2);
var value5 = undefined;
if (false) {
return value5;
}
if (value5 != null) {
env2_18(env3_10(a2, env3_0(env3_3[9]).PollMediaUploadAttachmentStatus.READY_TO_UPLOAD), a1);
} else {
env2_18(env3_10(a2, env3_0(env3_3[9]).PollMediaUploadAttachmentStatus.ERROR), a1);
}
}
}
function _fun89959() { // fn#89959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2300, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun89960(a0, a1, a2) { // fn#89960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2375, offset: 0x020258bf, size: 180 bytes, params: 4, frame: 24
const localCreationAnswerId = Module00057[a1].localCreationAnswerId;
const URL = global.URL;
const objectURL = URL.createObjectURL(a2);
env0_19(a0, a1);
let binding = env0_18;
const createPollCreationImageForMediaBinding = createPollCreationImageForMedia;
const PollMediaUploadAttachmentStatus = (PollTypesModule).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
binding(createPollCreationImageForMediaBinding(objectURL, PREPARING), a1);
(PollUploadAttachmentActionCreatorsNativeModule).handlePollMediaAttachmentAdd(a0,
localCreationAnswerId, a2);
binding = env0_18;
const READY_TO_UPLOAD = PollMediaUploadAttachmentStatus.READY_TO_UPLOAD;
binding(createPollCreationImageForMediaBinding(objectURL, READY_TO_UPLOAD), a1);
}
function _fun89961(a0, a1) { // fn#89961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2714, offset: 0x02025973, size: 54 bytes, params: 3, frame: 14
env0_19(id, a1);
env0_18({emoji: a0, stickerId: undefined, mediaAttachmentState: undefined}, a1);
}
function _fun89962(a0) { // fn#89962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2822, offset: 0x020259a9, size: 32 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_6(_fun89963);
function _fun89963(a0) { // fn#89963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2829, offset: 0x020259c9, size: 53 bytes, params: 2, frame: 15
const items2 = [];
arraySpread(items2, a0, 0, undefined);
const binding = env0_0;
const object = {};
copyDataProperties(object, items2[binding], 0);
object['image'] = undefined;
items2[binding] = object;
return items2;
}
}
function _fun89964() { // fn#89964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2910, offset: 0x020259fe, size: 34 bytes, params: 1, frame: 11
if (result) {
env0_6(function(a0) {
var r4;
var items = [];
var value = arraySpread(items, a0, 0, r4);
items[value] = require(dependencyMap[4]).generateEmptyPollAnswer();
value + 1;
return items;
});
}
}
function _fun89966(a0) { // fn#89966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2992, offset: 0x02025a61, size: 97 bytes, params: 2, frame: 16
var length;
var binding;
const env0_0 = a0;
if (result_2) {
length = Module00057.length;
binding = env0_19;
binding(id, a0);
binding = env0_6;
binding(_fun89967);
if (importDefault != null) {
importDefault({indexToRemove: a0, numberOfAnswers: length});
}
}
function _fun89967(a0) { // fn#89967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3029, offset: 0x02025ac2, size: 40 bytes, params: 2, frame: 14
const items2 = [];
arraySpread(items2, a0, 0, undefined);
items2.splice(env0_0, 1);
return items2;
}
}
function _fun89968() { // fn#89968, offset: 0x02025aea, size: 11 bytes, params: 1, frame: 1
return _fun89969;
function _fun89969() { // fn#89969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3162, offset: 0x02025af5, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importAll(11739) /* metro dependency 11739: PollUploadAttachmentActionCreatorsNative */;
value.removeAllPollUploadAttachments(id);
}
}
function _fun89970() { // fn#89970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3238, offset: 0x02025b22, size: 314 bytes, params: 1, frame: 18
var environment;
var value2;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
let env0_0 = true;
const object = {};
let binding = PollsConstantsModule.MAX_NUMBER_OF_ANSWERS_PER_POLL;
if (binding.trim().length === 0) {
env0_0 = false;
value2 = environment.__proto__;
object.question = intl.string(t.gPX3oI);
}
binding = Module00057;
if (binding.filter(_fun89971).length < MIN_NUMBER_OF_ANSWERS_PER_POLL) {
env0_0 = false;
object['answer-' + Module00057[0].localCreationAnswerId] = intl.string(t.fYvzEX);
}
Module00057.forEach(_fun89972);
env0_11(object);
env0_12(!env0_0);
return env0_0;
function _fun89971(a0) { // fn#89971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3353, offset: 0x02025c5c, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (PollsUtilsModule).isAnswerFilled(a0);
}
function _fun89972(a0) { // fn#89972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3494, offset: 0x02025c85, size: 148 bytes, params: 2, frame: 16
var binding;
var value3;
var intl;
if (PollsUtilsModule.isIncompleteAnswer(a0)) {
binding = env0_1;
value3 = 'answer-' + a0.localCreationAnswerId;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
binding[value3] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8Qqkc+']);
}
}
}
function* _fun89974() { // fn#89974, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3663, offset: 0x02025d24, size: 137 bytes, params: 1, frame: 15
if (true) {
value = environment.__proto__;
var binding = env1_14;
var object = {};
object.channel = require;
object.question = MAX_NUMBER_OF_ANSWERS_PER_POLL;
object.answers = env1_13;
object.allowMultiSelect = PollDurations;
object.duration = createPollCreationImageForMedia;
var PollLayoutTypes = env2_0(env2_3[11]).PollLayoutTypes;
var DEFAULT = PollLayoutTypes.DEFAULT;
object.layout = DEFAULT;
object.onClose = importDefault;
yield binding(object);
}
}
function _fun89975() { // fn#89975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3835, offset: 0x02025dad, size: 40 bytes, params: 1, frame: 11
if (!loading && env0_20()) {
env0_21();
}
}
}
}
function _fun89963(a0) { // fn#89963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:2829, offset: 0x020259c9, size: 53 bytes, params: 2, frame: 15
const items2 = [];
arraySpread(items2, a0, 0, undefined);
const binding = env0_0;
const object2 = {};
copyDataProperties(object2, items2[binding], 0);
object2['image'] = undefined;
items2[binding] = object2;
return items2;
}
function _fun89967(a0) { // fn#89967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3029, offset: 0x02025ac2, size: 40 bytes, params: 2, frame: 14
const items2 = [];
arraySpread(items2, a0, 0, undefined);
items2.splice(env0_0, 1);
return items2;
}
function _fun89969() { // fn#89969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3162, offset: 0x02025af5, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importAll(11739) /* metro dependency 11739: PollUploadAttachmentActionCreatorsNative */;
value.removeAllPollUploadAttachments(id);
}
function _fun89971(a0) { // fn#89971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3353, offset: 0x02025c5c, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (require(7149) /* metro dependency 7149: PollsUtils */).isAnswerFilled(a0);
}
function _fun89972(a0) { // fn#89972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11923:3494, offset: 0x02025c85, size: 148 bytes, params: 2, frame: 16
var binding;
var value3;
var intl;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isIncompleteAnswer(a0)) {
binding = env0_1;
value3 = 'answer-' + a0.localCreationAnswerId;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
binding[value3] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8Qqkc+']);
}
}
global.__d(_fun89941, 11737, [5, 57, 31, 7217, 7149, 11738, 11197, 11739, 11740, 11741, 1244, 8436,
2]) /* metro module 11737, dependencies: [5, 57, 31, 7217, 7149, 11738, 11197, 11739, 11740, 11741, 1244, 8436, 2] */;
@@ -1,31 +1,34 @@
/* Metro module 8628; source: modules/polls/useMaybeAddPollsMarketingEasterEggNote.tsx; dependencies: [1949, 566, 1244, 2] */
import LocaleStore from '../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
function _fun68072(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8813:6, offset: 0x01c3dc8f, size: 114 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/useMaybeAddPollsMarketingEasterEggNote.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/useMaybeAddPollsMarketingEasterEggNote.tsx');
exports.default = useMaybeAddPollsMarketingEasterEggNote;
}
function useMaybeAddPollsMarketingEasterEggNote(a0) { // fn#68073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8813:206, offset: 0x01c3dd01, size: 146 bytes, params: 2, frame: 17
var r0;
var intl;
let value = a0;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
if (value !== ':pizza:') {
r0 = value;
} else if (Reflect.apply(useStateFromStores, fluxModule, [[LocaleStore], function() {
return LocaleStore.locale.startsWith('en-');
}])) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['1knDPI'],
{emojiName: value});
r0 = value;
} else {
r0 = value;
function useMaybeAddPollsMarketingEasterEggNote(a0) { // fn#68073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8813:206, offset: 0x01c3dd01, size: 146 bytes, params: 2, frame: 17
var r0;
var intl;
let value = a0;
const useStateFromStores = FluxModule.useStateFromStores;
if (value !== ':pizza:') {
r0 = value;
} else if (Reflect.apply(useStateFromStores, FluxModule, [[LocaleStore], function() {
return LocaleStore.locale.startsWith('en-');
}])) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['1knDPI'],
{emojiName: value});
r0 = value;
} else {
r0 = value;
}
return r0;
}
return r0;
}
global.__d(_fun68072, 8628, [1949, 566, 1244, 2]) /* metro module 8628, dependencies: [1949, 566, 1244, 2] */;
@@ -1,32 +1,36 @@
/* Metro module 11735; source: modules/polls/usePollDurationOptions.tsx; dependencies: [7217, 1244, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as PollsConstantsModule from './PollsConstants.tsx'; /* Metro dependency 7217 */
function _fun89934(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11921:6, offset: 0x02024a4b, size: 117 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(7217) /* metro dependency 7217: PollsConstants */).PollDurations;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/usePollDurationOptions.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/usePollDurationOptions.tsx');
exports.default = usePollDurationOptions;
function usePollDurationOptions() { // fn#89935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11921:204, offset: 0x02024ac0, size: 475 bytes, params: 1, frame: 23
const Object = global.Object;
const freeze = Object.freeze;
const ONE_HOUR = PollDurations.ONE_HOUR;
const intl = (IndexNativeModule).intl;
const formatToPlainString = intl.formatToPlainString;
const t = (IndexNativeModule).t;
const FOUR_HOURS = PollDurations.FOUR_HOURS;
const EIGHT_HOURS = PollDurations.EIGHT_HOURS;
const ONE_DAY = PollDurations.ONE_DAY;
const THREE_DAYS = PollDurations.THREE_DAYS;
const string = intl.string;
const Xn5rX3 = t.Xn5rX3;
const SEVEN_DAYS = PollDurations.SEVEN_DAYS;
const FOURTEEN_DAYS = PollDurations.FOURTEEN_DAYS;
return Reflect.apply(freeze, Object, [{[ONE_HOUR]: Reflect.apply(formatToPlainString, intl, [t['b/mgtw'],
{num: 1}]), [FOUR_HOURS]: intl.formatToPlainString(t['b/mgtw'], {num: 4}),
[EIGHT_HOURS]: intl.formatToPlainString(t['b/mgtw'], {num: 8}), [ONE_DAY]: intl.formatToPlainString(t['b/mgtw'],
{num: 24}), [THREE_DAYS]: Reflect.apply(string, intl, [Xn5rX3]), [SEVEN_DAYS]: intl.string(t['Lmq+rj']),
[FOURTEEN_DAYS]: intl.string(t['mb8A/O'])}]);
}
}
function usePollDurationOptions() { // fn#89935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11921:204, offset: 0x02024ac0, size: 475 bytes, params: 1, frame: 23
const Object = global.Object;
const freeze = Object.freeze;
const ONE_HOUR = PollDurations.ONE_HOUR;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const formatToPlainString = intl.formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const FOUR_HOURS = PollDurations.FOUR_HOURS;
const EIGHT_HOURS = PollDurations.EIGHT_HOURS;
const ONE_DAY = PollDurations.ONE_DAY;
const THREE_DAYS = PollDurations.THREE_DAYS;
const string = intl.string;
const Xn5rX3 = t.Xn5rX3;
const SEVEN_DAYS = PollDurations.SEVEN_DAYS;
const FOURTEEN_DAYS = PollDurations.FOURTEEN_DAYS;
return Reflect.apply(freeze, Object, [{[ONE_HOUR]: Reflect.apply(formatToPlainString, intl, [t['b/mgtw'],
{num: 1}]), [FOUR_HOURS]: intl.formatToPlainString(t['b/mgtw'], {num: 4}),
[EIGHT_HOURS]: intl.formatToPlainString(t['b/mgtw'], {num: 8}), [ONE_DAY]: intl.formatToPlainString(t['b/mgtw'],
{num: 24}), [THREE_DAYS]: Reflect.apply(string, intl, [Xn5rX3]), [SEVEN_DAYS]: intl.string(t['Lmq+rj']),
[FOURTEEN_DAYS]: intl.string(t['mb8A/O'])}]);
}
global.__d(_fun89934, 11735, [7217, 1244, 2]) /* metro module 11735, dependencies: [7217, 1244, 2] */;
+47 -41
View File
@@ -1,52 +1,58 @@
/* Metro module 11742; source: modules/polls/useTrackPollEvents.tsx; dependencies: [31, 661, 4863, 8436, 2] */
import AppAnalyticsUtils from '../app_analytics/AppAnalyticsUtils.tsx'; /* Metro dependency 4863 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as PollLayoutTypesModule from '../../external/discord_common/js/shared/shared-constants/PollLayoutTypes.tsx'; /* Metro dependency 8436 */
function _fun90005(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:6, offset: 0x020267c8, size: 143 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/useTrackPollEvents.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/useTrackPollEvents.tsx');
exports.useTrackPollCreationEvents = useTrackPollCreationEvents;
}
function useTrackPollCreationEvents(a0, a1) { // fn#90006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:230, offset: 0x02026857, size: 62 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const object = {};
object.trackPollCreationCancelled = ReactModule.useCallback(_fun90007, [a0, a1]);
return object;
function _fun90007() { // fn#90007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:320, offset: 0x02026895, size: 178 bytes, params: 1, frame: 19
const env0_0 = 0;
const env0_1 = 0;
const env0_2 = 0;
const binding = env0_0;
binding.forEach(_fun90008);
const defaultImport = AppAnalyticsUtils;
const trackWithMetadata = defaultImport.trackWithMetadata;
const POLL_CREATION_CANCELLED = AnalyticEvents.POLL_CREATION_CANCELLED;
const object = {};
object.answers_count = binding.length;
object.attachments_count = env0_0;
object.emojis_count = env0_1;
object.stickers_count = env0_2;
object.allow_multiselect = require;
const PollLayoutTypes = (PollLayoutTypesModule).PollLayoutTypes;
const DEFAULT = PollLayoutTypes.DEFAULT;
object.layout_type = DEFAULT;
Reflect.apply(trackWithMetadata, defaultImport, [POLL_CREATION_CANCELLED, object]);
function _fun90008({image}) { // fn#90008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:352, offset: 0x02026947, size: 107 bytes, params: 2, frame: 3
if (image != null) {
if (image.emoji != null) {
env0_1 += 1;
} else if (image.stickerId != null) {
env0_2 += 1;
} else if (image.mediaAttachmentState != null) {
env0_0 += 1;
}
}
}
function useTrackPollCreationEvents(a0, a1) { // fn#90006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:230, offset: 0x02026857, size: 62 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const object2 = {};
object2.trackPollCreationCancelled = env0_3.useCallback(_fun90007, [a0, a1]);
return object2;
}
function _fun90007() { // fn#90007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:320, offset: 0x02026895, size: 178 bytes, params: 1, frame: 19
const env0_0 = 0;
const env0_1 = 0;
const env0_2 = 0;
const binding = env0_0;
binding.forEach(_fun90008);
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const POLL_CREATION_CANCELLED = AnalyticEvents.POLL_CREATION_CANCELLED;
const object2 = {};
object2.answers_count = binding.length;
object2.attachments_count = env0_0;
object2.emojis_count = env0_1;
object2.stickers_count = env0_2;
object2.allow_multiselect = require;
const PollLayoutTypes = (require(8436) /* metro dependency 8436: PollLayoutTypes */).PollLayoutTypes;
const DEFAULT = PollLayoutTypes.DEFAULT;
object2.layout_type = DEFAULT;
Reflect.apply(trackWithMetadata, defaultImport, [POLL_CREATION_CANCELLED, object2]);
}
function _fun90008({image}) { // fn#90008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11928:352, offset: 0x02026947, size: 107 bytes, params: 2, frame: 3
if (image != null) {
if (image.emoji != null) {
env0_1 += 1;
} else if (image.stickerId != null) {
env0_2 += 1;
} else if (image.mediaAttachmentState != null) {
env0_0 += 1;
}
}
}
global.__d(_fun90005, 11742, [31, 661, 4863, 8436,
2]) /* metro module 11742, dependencies: [31, 661, 4863, 8436, 2] */;
+39 -32
View File
@@ -1,40 +1,47 @@
/* Metro module 11200; source: modules/polls/useVoteReactors.tsx; dependencies: [7150, 661, 566, 7152, 644, 2] */
import Module00644 from '../../by-id/module-00644.js'; /* Metro dependency 644 */
import MessageReactionsStore from '../../stores/MessageReactionsStore.tsx'; /* Metro dependency 7150 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as MessageReactionsTypesModule from '../messages/MessageReactionsTypes.tsx'; /* Metro dependency 7152 */
function _fun85598(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11386:6, offset: 0x01f75201, size: 140 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const messageReactionsStore = importDefault(7150) /* metro dependency 7150: MessageReactionsStore */;
const env0_4 = (require(661) /* metro dependency 661: Constants */).DEFAULT_NUM_REACTION_USERS;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/useVoteReactors.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/useVoteReactors.tsx');
exports.default = useVoteReactors;
function useVoteReactors({channelId, messageId, reaction}) { // fn#85599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11386:220, offset: 0x01f7528d, size: 189 bytes, params: 2, frame: 22
const useStateFromStores = FluxModule.useStateFromStores;
const items2 = [MessageReactionsStore];
const items3 = [channelId, messageId];
items3[2] = reaction.emoji;
let value = Module00644;
value = Reflect.apply(useStateFromStores, FluxModule, [items2, _fun85600, items3, value]);
return {reactors: value, hasMore: (reaction.count_details?.vote ?? 0) > value.length};
function _fun85600() { // fn#85600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11386:325, offset: 0x01f7534a, size: 128 bytes, params: 1, frame: 21
let value = environment.__proto__;
const messageReactionsStoreBinding = MessageReactionsStore;
const getReactions = messageReactionsStoreBinding.getReactions;
const channelIdBinding = channelId;
const messageIdBinding = messageId;
const emoji = reaction.emoji;
value = undefined;
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
const VOTE = ReactionTypes.VOTE;
const value3 = Reflect.apply(getReactions, messageReactionsStoreBinding, [channelIdBinding, messageIdBinding, emoji,
DEFAULT_NUM_REACTION_USERS, VOTE]);
const Array = global.Array;
const from = Array.from;
let r0 = value3 == null ? value : value3.values();
r0 = r0 ?? [];
return Reflect.apply(from, Array, [r0]);
}
}
}
function useVoteReactors({channelId, messageId, reaction}) { // fn#85599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11386:220, offset: 0x01f7528d, size: 189 bytes, params: 2, frame: 22
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const items2 = [MessageReactionsStore];
const items3 = [channelId, messageId];
items3[2] = reaction.emoji;
let value = importDefault(644) /* metro dependency 644 */;
value = Reflect.apply(useStateFromStores, fluxModule, [items2, _fun85600, items3, value]);
return {reactors: value, hasMore: (reaction.count_details?.vote ?? 0) > value.length};
}
function _fun85600() { // fn#85600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11386:325, offset: 0x01f7534a, size: 128 bytes, params: 1, frame: 21
let value = environment.__proto__;
const getReactions = MessageReactionsStore.getReactions;
const channelIdBinding = channelId;
const messageIdBinding = messageId;
const emoji = reaction.emoji;
value = undefined;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const VOTE = ReactionTypes.VOTE;
const value3 = Reflect.apply(getReactions, MessageReactionsStore, [channelIdBinding, messageIdBinding, emoji,
DEFAULT_NUM_REACTION_USERS, VOTE]);
const Array = global.Array;
const from = Array.from;
let r0 = value3 == null ? value : value3.values();
r0 = r0 ?? [];
return Reflect.apply(from, Array, [r0]);
}
global.__d(_fun85598, 11200, [7150, 661, 566, 7152, 644,
2]) /* metro module 11200, dependencies: [7150, 661, 566, 7152, 644, 2] */;