309 lines
11 KiB
TypeScript
309 lines
11 KiB
TypeScript
/* Metro module 9815; source: stores/views/GIFPickerViewStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 1349, 1244, 566, 694, 2] */
|
|
function _fun76879(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:6, offset: 0x01de899f, size: 470 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_7 = (require(661) /* metro dependency 661: Constants */).GIFPickerResultTypes;
|
|
const GIFType = (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType;
|
|
const env0_8 = GIFType.IMAGE;
|
|
let env0_12 = [];
|
|
const env0_13 = [];
|
|
let env0_14 = [];
|
|
let env0_15 = [];
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun76884(Store);
|
|
value.displayName = 'GIFPickerViewStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {GIF_PICKER_INITIALIZE: function(a0) {
|
|
env0_9 = a0.analyticsID;
|
|
}, GIF_PICKER_QUERY: function({query}) {
|
|
env0_10 = query;
|
|
if (query === '') {
|
|
env0_11 = '';
|
|
env0_12 = [];
|
|
env0_14 = [];
|
|
}
|
|
}, GIF_PICKER_QUERY_SUCCESS: GIF_PICKER_QUERY_SUCCESS, GIF_PICKER_QUERY_FAILURE: function({query}) {
|
|
if (query == null) {
|
|
return false;
|
|
}
|
|
env0_11 = query;
|
|
env0_12 = [];
|
|
}, GIF_PICKER_TRENDING_FETCH_SUCCESS: GIF_PICKER_TRENDING_FETCH_SUCCESS,
|
|
GIF_PICKER_SUGGESTIONS_SUCCESS: function(a0) {
|
|
env0_14 = a0.items;
|
|
}, GIF_PICKER_TRENDING_SEARCH_TERMS_SUCCESS: function(a0) {
|
|
env0_15 = a0.items;
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/views/GIFPickerViewStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_76880() { // fn#76880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:179, offset: 0x01de8b75, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_76880_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function getFormatFromUrl(a0) { // fn#76883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:825, offset: 0x01de8bd7, size: 178 bytes, params: 2, frame: 13
|
|
var URL;
|
|
var prototype;
|
|
var value;
|
|
var uRL;
|
|
var pathname;
|
|
var toLowerCase;
|
|
var endsWith;
|
|
var value2;
|
|
var property;
|
|
var GIFType;
|
|
var VIDEO;
|
|
var error;
|
|
try {
|
|
URL = global.URL;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
prototype = URL.prototype;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
uRL = new URL(a0);
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
value = uRL instanceof Object ? uRL : value;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
pathname = value.pathname;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
toLowerCase = pathname.toLowerCase;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
value = Reflect.apply(toLowerCase, pathname, []);
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
endsWith = value.endsWith;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
value2 = Reflect.apply(endsWith, value, ['.mp4']);
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
if (value2) {
|
|
try {
|
|
value = environment;
|
|
property = dependencyMap[6];
|
|
value = require(property);
|
|
GIFType = value.GIFType;
|
|
VIDEO = GIFType.VIDEO;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
return VIDEO;
|
|
}
|
|
try {
|
|
endsWith = value.endsWith;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
value = Reflect.apply(endsWith, value, ['.webm']);
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
if (value) {
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
property = dependencyMap[6];
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
value = require(property);
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
GIFType = value.GIFType;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
try {
|
|
VIDEO = GIFType.VIDEO;
|
|
} catch (error) {
|
|
value = environment;
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
return VIDEO;
|
|
}
|
|
GIFType = require(dependencyMap[6]).GIFType;
|
|
return GIFType.IMAGE;
|
|
}
|
|
|
|
function _fun76884(a0) { // fn#76884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:1015, offset: 0x01de8c89, size: 255 bytes, params: 2, frame: 16
|
|
const closure = GIFPickerViewStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'getAnalyticsID', value: value_76886}, {key: 'getQuery', value: value_76887},
|
|
{key: 'getResultQuery', value: value_76888}, {key: 'getResultItems', value: value_76889},
|
|
{key: 'getTrendingCategories', value: value_76890}, {key: 'getSelectedFormat', value: function() {
|
|
return 'tinywebp';
|
|
}}, {key: 'getSuggestions', value: value_76892}, {key: 'getTrendingSearchTerms', value: value_76893}]);
|
|
}
|
|
|
|
function GIF_PICKER_QUERY_SUCCESS(a0) { // fn#76896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:1967, offset: 0x01de8dd4, size: 93 bytes, params: 2, frame: 12
|
|
var value;
|
|
let query = a0.query;
|
|
if (query == null) {
|
|
query = a0.query;
|
|
if (query != null) {
|
|
query = a0.query;
|
|
}
|
|
value = a0.items.map(function({width, height, src, gif_src, url, id}) {
|
|
return {width: width, height: height, src: src, gifSrc: gif_src, url: url, id: id, format: IMAGE};
|
|
});
|
|
} else {
|
|
if (env0_10 === env0_11) {
|
|
return false;
|
|
}
|
|
query = a0.query;
|
|
if (query != null) {
|
|
query = a0.query;
|
|
}
|
|
value = a0.items.map(function({width, height, src, gif_src, url, id}) {
|
|
return {width: width, height: height, src: src, gifSrc: gif_src, url: url, id: id, format: IMAGE};
|
|
});
|
|
}
|
|
}
|
|
|
|
function GIF_PICKER_TRENDING_FETCH_SUCCESS(a0) { // fn#76899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:2309, offset: 0x01de8ea5, size: 218 bytes, params: 2, frame: 21
|
|
var r10;
|
|
var items;
|
|
var object;
|
|
var intl;
|
|
var src;
|
|
var getFormatFromUrlBinding;
|
|
const trendingCategories = a0.trendingCategories;
|
|
let trendingGIFPreview = a0.trendingGIFPreview;
|
|
if (trendingGIFPreview != null) {
|
|
object = {};
|
|
object.type = GIFPickerResultTypes.TRENDING_GIFS;
|
|
intl = require(dependencyMap[7]).intl;
|
|
object.name = intl.string(require(dependencyMap[7]).t.H6zNFz);
|
|
trendingGIFPreview = a0.trendingGIFPreview;
|
|
src = trendingGIFPreview.src;
|
|
object.src = src;
|
|
getFormatFromUrlBinding = getFormatFromUrl;
|
|
trendingGIFPreview = a0.trendingGIFPreview;
|
|
src = trendingGIFPreview.src;
|
|
object.format = getFormatFromUrlBinding(src);
|
|
items = [object];
|
|
r10 = dependencyMap;
|
|
} else {
|
|
items = [];
|
|
}
|
|
object = [];
|
|
arraySpread(object, trendingCategories.map(_fun76900), arraySpread(object, items, 0, r10), r10);
|
|
}
|
|
|
|
function _fun76900(a0) { // fn#76900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:2572, offset: 0x01de8f7f, size: 80 bytes, params: 2, frame: 14
|
|
const object2 = {};
|
|
copyDataProperties(object2, a0, undefined);
|
|
object2['src'] = a0.src;
|
|
const value = environment.__proto__;
|
|
const TRENDING_CATEGORY = GIFPickerResultTypes.TRENDING_CATEGORY;
|
|
object2['type'] = TRENDING_CATEGORY;
|
|
object2['format'] = getFormatFromUrl(a0.src);
|
|
return object2;
|
|
}
|
|
|