decord/source/modules/premium/gifting/native/GiftIntentGifModal.tsx

312 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11034
// Function ID: 11035
2026-07-20 16:05:17 +00:00
// Name: _sendGiftIntentGif
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 5, 19, 17, 1391, 676, 4670, 21, 4668, 712, 7465, 7474, 698, 7197, 5446, 589, 8131, 1236, 11035, 10232, 4750, 5265, 7165, 6345, 6343, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 11034 (_sendGiftIntentGif)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "asyncGeneratorStep" /* 5 */;
import closure_5 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
import { AnalyticEvents } from "ME" /* 676 */;
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING" /* 4670 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _sendGiftIntentGif() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === url) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c2 = tmp5;
let callback = tmp2;
let user;
callback = undefined;
c2 = undefined;
url = undefined;
({ channel: c0, giftIntentType: c1, text: c2, gif: c3 } = user);
c4 = undefined;
url = 1;
c4 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else {
if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
c4 = c2.trim().length > 0;
if (c4) {
let obj6 = callback(c2[10]);
const id2 = user.id;
let obj7 = callback(c2[11]);
let obj2 = { location: null };
obj2[0] = constants2.GIFTING;
url = 2;
c4 = 1;
let obj3 = { value: null, done: false };
obj3[0] = obj6.sendMessage(id2, obj7.parse(user, c2), true, obj2);
return obj3;
}
}
} else if (2 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const obj5 = { gift_intent_type: null, is_custom_message: null, location_stack: null };
obj5[0] = callback;
obj5[1] = c4;
const items = [callback(c2[13]).PREMIUM_GIFT_INTENT_CARD];
obj5[2] = items;
callback(c2[12]).track(constants.GIFT_INTENT_MESSAGE_SENT, obj5);
c4 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
obj2 = callback(c2[10]);
const id = user.id;
obj3 = callback(c2[11]);
obj6 = { location: null };
obj6[0] = constants2.GIFTING;
url = 3;
c4 = 1;
obj7 = { value: null, done: false };
obj7[0] = obj2.sendMessage(id, obj3.parse(user, url.url), true, obj6);
return obj7;
}
} catch (tmp33) {
c4 = tmp;
throw tmp33;
}
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_13 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function GiftIntentGifModalBody(channelId) {
channelId = channelId.channelId;
const giftIntentType = channelId.giftIntentType;
const onClose = channelId.onClose;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let ref;
let first;
2026-08-24 06:08:38 +00:00
closure_6 = undefined;
const tmp = callback3();
2026-07-23 10:11:24 +00:00
let obj = channelId(onClose[15]);
2026-08-24 06:08:38 +00:00
const items = [closure_7];
stateFromStores = obj.useStateFromStores(items, () => closure_1_7.getChannel(channelId));
2026-07-29 08:29:29 +00:00
ref = first.useRef(null);
const tmp7 = stateFromStores(first.useState(null), 2);
first = tmp7[0];
closure_6 = tmp7[1];
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores, giftIntentType, first, onClose];
2026-07-23 10:11:24 +00:00
const callback = first.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-20 16:05:17 +00:00
callback((src) => {
src = undefined;
2026-07-29 08:29:29 +00:00
if (src != null) {
2026-07-20 16:05:17 +00:00
src = src.src;
}
let tmp2 = null;
if (src !== src.src) {
tmp2 = src;
}
return tmp2;
});
}, []);
2026-07-29 08:29:29 +00:00
obj = { style: items2, children: null };
2026-07-23 10:11:24 +00:00
items2 = [tmp.container, { paddingBottom: giftIntentType(onClose[14])().insets.bottom }];
2026-07-29 08:29:29 +00:00
obj = { style: tmp.messageContainer, children: null };
2026-07-23 10:11:24 +00:00
const callback1 = first.useCallback(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != stateFromStores;
if (tmp2) {
tmp2 = null != first;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = 0 !== first.url.length;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
const obj = { channel: null, giftIntentType: null, text: null, gif: null };
obj[0] = stateFromStores;
obj[1] = giftIntentType;
2026-07-20 16:05:17 +00:00
const current = ref.current;
2026-07-29 08:29:29 +00:00
let str;
if (current != null) {
str = current.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = str;
obj[3] = first;
2026-07-23 10:11:24 +00:00
!(function sendGiftIntentGif(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = closure_13.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})(obj);
2026-07-20 16:05:17 +00:00
onClose();
}
}, items1);
2026-08-24 06:08:38 +00:00
obj1 = { ref, accessibilityLabel: null, placeholder: null };
2026-07-23 10:11:24 +00:00
const intl = channelId(onClose[17]).intl;
2026-07-29 08:29:29 +00:00
obj1[1] = intl.string(channelId(onClose[17]).t.ZV02cV);
2026-07-23 10:11:24 +00:00
let obj4 = channelId(onClose[18]);
2026-07-29 08:29:29 +00:00
obj1[2] = obj4.getGiftIntentCustomMessagePlaceholder();
obj[1] = callback2(channelId(onClose[16]).TextArea, obj1);
2026-07-23 10:11:24 +00:00
const items3 = [callback2(closure_6, obj), , ];
2026-07-29 08:29:29 +00:00
const obj2 = { style: tmp.pickerContainer, children: null };
const obj3 = { bottomSheetRef: first.useRef(null), channelId, guildId: null, initialQuery: null, inActionSheet: false, contentHorizontalPadding: null, selectedGifSrc: null, keyboardDismissMode: "on-drag", onPressGIF: null };
2026-07-20 16:05:17 +00:00
let guild_id;
2026-07-23 10:11:24 +00:00
const ref1 = first.useRef(null);
2026-07-29 08:29:29 +00:00
let tmp2 = giftIntentType;
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
guild_id = stateFromStores.guild_id;
}
2026-07-29 08:29:29 +00:00
obj3[2] = guild_id;
const intl2 = tmp4(tmp3[17]).intl;
obj3[3] = intl2.string(channelId(onClose[17]).t.jrtJi4);
obj3[5] = tmp2(onClose[9]).space.PX_16;
2026-07-20 16:05:17 +00:00
let src;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
src = first.src;
}
2026-07-29 08:29:29 +00:00
obj3[6] = src;
obj3[8] = callback;
obj2[1] = callback2(giftIntentType(onClose[19]), obj3);
items3[1] = callback2(closure_6, obj2);
obj4 = { style: tmp.footer, children: null };
const obj5 = { grow: true, variant: "primary", text: null, onPress: null, disabled: null };
const intl3 = tmp4(tmp3[17]).intl;
obj5[2] = intl3.string(channelId(onClose[17]).t.TXNS7S);
obj5[3] = callback1;
obj5[4] = null == first;
2026-07-23 10:11:24 +00:00
const items4 = [callback2(channelId(onClose[20]).Button, obj5), ];
2026-07-29 08:29:29 +00:00
const obj6 = { grow: true, variant: "secondary", text: null, onPress: null };
const intl4 = tmp4(tmp3[17]).intl;
obj6[2] = intl4.string(channelId(onClose[17]).t["ETE/oC"]);
obj6[3] = onClose;
2026-07-23 10:11:24 +00:00
items4[1] = callback2(channelId(onClose[20]).Button, obj6);
2026-07-29 08:29:29 +00:00
obj4[1] = items4;
items3[2] = closure_11(closure_6, obj4);
obj[1] = items3;
return closure_11(closure_6, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
createCacheKey = { container: null, messageContainer: null, pickerContainer: null, footer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { flex: 1, backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { paddingHorizontal: ThemesDefault.space.PX_16, paddingBottom: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
createCacheKey[2] = { flex: 1 };
2026-08-24 06:08:38 +00:00
let obj1 = { paddingHorizontal: ThemesDefault.space.PX_16, paddingBottom: ThemesDefault.space.PX_8 };
createCacheKey[3] = { gap: ThemesDefault.space.PX_8, paddingHorizontal: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_8 };
let closure_12 = createCacheKey.createStyles(createCacheKey);
2026-07-29 08:29:29 +00:00
let closure_15 = { GIFT_INTENT_GIF: "GIFT_INTENT_GIF" };
2026-08-24 06:08:38 +00:00
let obj2 = { gap: ThemesDefault.space.PX_8, paddingHorizontal: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_8 };
const result = require("set").fileFinishedImporting("modules/premium/gifting/native/GiftIntentGifModal.tsx");
2026-07-20 16:05:17 +00:00
export default function GiftIntentGifModal(arg0) {
2026-07-23 10:11:24 +00:00
({ channelId: require, giftIntentType: importDefault, onDismiss } = arg0);
2026-08-24 06:08:38 +00:00
closure_3 = undefined;
2026-07-20 16:05:17 +00:00
const items = [onDismiss];
2026-08-24 06:08:38 +00:00
closure_3 = React.useCallback(() => {
let arr = closure_1_1(onDismiss[21]);
2026-07-20 16:05:17 +00:00
arr = arr.pop();
2026-07-29 08:29:29 +00:00
if (onDismiss != null) {
2026-07-20 16:05:17 +00:00
onDismiss();
}
}, items);
2026-07-23 10:11:24 +00:00
const tmp = importDefault(onDismiss[22])(() => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-29 08:29:29 +00:00
obj = { title: null, headerLeft: null, render: null };
2026-08-24 06:08:38 +00:00
const intl = closure_1_0(onDismiss[17]).intl;
obj[0] = intl.string(closure_1_0(onDismiss[17]).t.PQRuGc);
obj[1] = closure_1_0(onDismiss[23]).getHeaderCloseButton(closure_3);
2026-07-29 08:29:29 +00:00
obj[2] = function render() {
2026-08-24 06:08:38 +00:00
return closure_1_10(closure_1_14, { channelId: closure_0, giftIntentType: closure_1, onClose: closure_3 });
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
obj[closure_1_15.GIFT_INTENT_GIF] = obj;
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
return callback2(require(onDismiss[24]).Navigator, {
2026-07-20 16:05:17 +00:00
initialRouteName: constants.GIFT_INTENT_GIF,
2026-07-23 10:11:24 +00:00
screens: importDefault(onDismiss[22])(() => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-29 08:29:29 +00:00
obj = { title: null, headerLeft: null, render: null };
2026-08-24 06:08:38 +00:00
const intl = closure_1_0(onDismiss[17]).intl;
obj[0] = intl.string(closure_1_0(onDismiss[17]).t.PQRuGc);
obj[1] = closure_1_0(onDismiss[23]).getHeaderCloseButton(closure_3);
2026-07-29 08:29:29 +00:00
obj[2] = function render() {
2026-08-24 06:08:38 +00:00
return closure_1_10(closure_1_14, { channelId: closure_0, giftIntentType: closure_1, onClose: closure_3 });
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
obj[closure_1_15.GIFT_INTENT_GIF] = obj;
2026-07-20 16:05:17 +00:00
return obj;
})
});
};