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

+295 -283
View File
@@ -1,28 +1,33 @@
/* Metro module 6869; source: modules/spotify/SpotifyActionCreators.tsx; dependencies: [6870, 6868, 661, 4041, 507, 694, 672, 477, 6871, 2] */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
import SpotifyProtocolStore from './SpotifyProtocolStore.tsx'; /* Metro dependency 6870 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as HTTPUtilsModule from '../../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
import * as SpotifyConstantsModule from './SpotifyConstants.tsx'; /* Metro dependency 6868 */
function _fun54365(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:6, offset: 0x01363f14, size: 371 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const closure = apiRequest;
const closure2 = getAccessToken;
const apiRequest_543662 = apiRequest_54366;
const getAccessToken2 = getAccessToken;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const spotifyProtocolStore = importDefault(6870) /* metro dependency 6870: SpotifyProtocolStore */;
let value = require(6868) /* metro dependency 6868: SpotifyConstants */;
let value = SpotifyConstantsModule;
const env0_4 = value.SPOTIFY_APP_PROTOCOL;
const env0_5 = value.SpotifyEndpoints;
value = require(661) /* metro dependency 661: Constants */;
const env0_6 = value.AbortCodes;
const env0_7 = value.Endpoints;
const env0_8 = value.PlatformTypes;
object2 = {};
const bind = closure.bind;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
object = {};
const bind = apiRequest_543662.bind;
const HTTP = (HTTPUtilsModule).HTTP;
const get = HTTP.get;
object2.get = Reflect.apply(bind, closure, [null, get]);
object2.put = closure.bind(null, HTTP.put);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyActionCreators.tsx');
exports.SpotifyAPI = object2;
exports.getAccessToken = closure2;
object.get = Reflect.apply(bind, apiRequest_543662, [null, get]);
object.put = apiRequest_543662.bind(null, HTTP.put);
(FileImportTrackerModule).fileFinishedImporting('modules/spotify/SpotifyActionCreators.tsx');
exports.SpotifyAPI = object;
exports.getAccessToken = getAccessToken2;
exports.subscribePlayerStateNotifications = subscribePlayerStateNotifications;
exports.getProfile = getProfile;
exports.getDevices = getDevices;
@@ -30,298 +35,305 @@ function _fun54365(global, require, importDefault, importAll, module, exports, d
exports.pause = pause_54388;
exports.fetchIsSpotifyProtocolRegistered = fetchIsSpotifyProtocolRegistered;
exports.setActiveDevice = setActiveDevice_54392;
}
function apiRequest(a0, a1, a2, a3) { // fn#54366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:219, offset: 0x01364087, size: 136 bytes, params: 5, frame: 17
let value = a4;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a3;
const env0_3 = value !== undefined ? value : 1;
const object2 = {};
copyDataProperties(object2, a3, undefined);
object2['headers'] = {authorization: 'Bearer ' + a2};
value = a0(object2);
value = value.then(function(a0) {
var r0;
var value = a0;
if (value.status !== 202) {
r0 = value;
} else {
value = global.Promise.reject(value);
r0 = value;
}
return r0;
});
return value.catch(_fun54368);
}
function getAccessToken(a0) { // fn#54374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:780, offset: 0x0136429f, size: 124 bytes, params: 2, frame: 17
const env0_0 = a0;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const get = HTTP.get;
const CONNECTION_ACCESS_TOKEN = Endpoints.CONNECTION_ACCESS_TOKEN;
const SPOTIFY = PlatformTypes.SPOTIFY;
let value = Reflect.apply(get, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: Reflect.apply(CONNECTION_ACCESS_TOKEN, Endpoints, [SPOTIFY, a0])}]);
value = value.catch(_fun54375);
return value.then(_fun54377);
}
function subscribePlayerStateNotifications(a0, a1, a2) { // fn#54378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1544, offset: 0x01364494, size: 105 bytes, params: 4, frame: 18
const value = a3;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = value !== undefined ? value : 2;
const binding = env0_9;
const put = binding.put;
const NOTIFICATIONS_PLAYER = SpotifyEndpoints.NOTIFICATIONS_PLAYER;
return Reflect.apply(put, binding, [a0, a1, {url: NOTIFICATIONS_PLAYER,
query: {connection_id: a2}}]).catch(_fun54379);
}
function getProfile(a0, a1) { // fn#54381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1803, offset: 0x01364588, size: 64 bytes, params: 3, frame: 16
const env0_0 = a0;
const binding = env0_9;
const get = binding.get;
const PROFILE = SpotifyEndpoints.PROFILE;
return Reflect.apply(get, binding, [a0, a1, {url: PROFILE}]).then(_fun54382);
}
function getDevices(a0, a1) { // fn#54383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1990, offset: 0x01364620, size: 64 bytes, params: 3, frame: 16
const env0_0 = a0;
const binding = env0_9;
const get = binding.get;
const PLAYER_DEVICES = SpotifyEndpoints.PLAYER_DEVICES;
return Reflect.apply(get, binding, [a0, a1, {url: PLAYER_DEVICES}]).then(_fun54384);
}
function play_54385(a0, a1, a2, a3) { // fn#54385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2169, offset: 0x013646b8, size: 273 bytes, params: 5, frame: 25
let value = a4;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = undefined;
const r2 = value !== value2 ? value : {};
const value3 = SpotifyEndpoints.PLAYER_OPEN(a3, a2, false);
const deviceId = r2.deviceId;
const position = r2.position;
const contextUri = r2.contextUri;
const env0_5 = r2.repeat;
const binding = env0_9;
const put = binding.put;
const PLAYER_PLAY = SpotifyEndpoints.PLAYER_PLAY;
value = Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PLAY, query: {device_id: deviceId},
body: {context_uri: contextUri ?? value2, uris: contextUri == null ? [value3] : value2,
offset: contextUri != null ? {uri: value3} : value2, position_ms: position ?? 0}}]);
value = value.then(_fun54386);
return value.then(_fun54387);
}
function pause_54388(a0, a1) { // fn#54388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2644, offset: 0x0136487e, size: 61 bytes, params: 3, frame: 15
const binding = env0_9;
const put = binding.put;
const PLAYER_PAUSE = SpotifyEndpoints.PLAYER_PAUSE;
return Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PAUSE}]).then(_fun54389);
}
function fetchIsSpotifyProtocolRegistered() { // fn#54390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2802, offset: 0x013648ef, size: 111 bytes, params: 1, frame: 13
var moduleValue;
if (!SpotifyProtocolStore.isProtocolRegistered()) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isDesktop()) {
(importDefault(6871) /* metro dependency 6871: GameUtilsNative */).isProtocolRegistered(SPOTIFY_APP_PROTOCOL).then(_fun54391);
}
}
}
function setActiveDevice_54392(a0, a1) { // fn#54392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:3031, offset: 0x01364997, size: 65 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_SET_ACTIVE_DEVICE',
accountId: a0, deviceId: a1});
}
function _fun54368(a0) { // fn#54368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:364, offset: 0x01364136, size: 208 bytes, params: 2, frame: 14
var environment;
var r4;
var r0;
var value;
if (a0.status === 401) {
if (env0_3 > 0) {
if (a0.status === 202) {
value = environment.__proto__;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(5000);
r4 = value;
function apiRequest_54366(a0, a1, a2, a3) { // fn#54366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:219, offset: 0x01364087, size: 136 bytes, params: 5, frame: 17
let value = a4;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a3;
const env0_3 = value !== undefined ? value : 1;
const object = {};
copyDataProperties(object, a3, undefined);
object['headers'] = {authorization: 'Bearer ' + a2};
value = a0(object);
value = value.then(function(a0) {
var r0;
var value = a0;
if (value.status !== 202) {
r0 = value;
} else {
r4 = global.Promise.resolve();
value = global.Promise.reject(value);
r0 = value;
}
value = r4.then(function() {
return r0;
});
return value.catch(_fun54368);
function _fun54368(a0) { // fn#54368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:364, offset: 0x01364136, size: 208 bytes, params: 2, frame: 14
var environment;
var r4;
var r0;
var value;
if (a0.status === 401) {
if (env0_3 > 0) {
if (a0.status === 202) {
value = environment.__proto__;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(5000);
r4 = value;
} else {
r4 = global.Promise.resolve();
}
value = r4.then(function() {
return getAccessToken(require);
});
value = value.then(_fun54370);
value = value.then(_fun54371);
r0 = value;
} else {
r0 = global.Promise.reject(a0);
}
} else if (importAll.onlyRetryOnAuthorizationErrors !== true && a0.status === 202) {
if (env0_3 > 0) {
if (a0.status === 202) {
value = environment.__proto__;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(5000);
r4 = value;
} else {
r4 = global.Promise.resolve();
}
value = r4.then(_fun54369);
value = value.then(_fun54370);
value = value.then(_fun54371);
r0 = value;
} else {
r0 = global.Promise.reject(a0);
}
} else {
r0 = global.Promise.reject(a0);
}
return r0;
function _fun54369() { // fn#54369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:528, offset: 0x01364206, size: 23 bytes, params: 1, frame: 11
return getAccessToken(require);
});
value = value.then(_fun54370);
value = value.then(_fun54371);
r0 = value;
} else {
r0 = global.Promise.reject(a0);
}
function _fun54370({body}) { // fn#54370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:558, offset: 0x0136421d, size: 55 bytes, params: 2, frame: 19
return apiRequest_54366(env1_0, require, body.access_token, importAll, env1_3 - 1);
}
function _fun54371(a0) { // fn#54371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:617, offset: 0x01364254, size: 44 bytes, params: 2, frame: 11
let env0_0 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(function(a0) {
var env0_0 = a0;
return global.setImmediate(_fun54373);
});
return promise instanceof Object ? promise : value;
function _fun54372(a0) { // fn#54372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:633, offset: 0x01364280, size: 31 bytes, params: 2, frame: 11
const env0_0 = a0;
return global.setImmediate(_fun54373);
function _fun54373() { // fn#54373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:650, offset: 0x00d11605, size: 23 bytes, params: 1, frame: 11
return env0_0(env1_0);
}
}
}
}
} else if (importAll.onlyRetryOnAuthorizationErrors !== true && a0.status === 202) {
if (env0_3 > 0) {
if (a0.status === 202) {
}
function getAccessToken(a0) { // fn#54374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:780, offset: 0x0136429f, size: 124 bytes, params: 2, frame: 17
const env0_0 = a0;
const HTTP = (HTTPUtilsModule).HTTP;
const get = HTTP.get;
const CONNECTION_ACCESS_TOKEN = Endpoints.CONNECTION_ACCESS_TOKEN;
const SPOTIFY = PlatformTypes.SPOTIFY;
let value = Reflect.apply(get, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: Reflect.apply(CONNECTION_ACCESS_TOKEN, Endpoints, [SPOTIFY, a0])}]);
value = value.catch(_fun54375);
return value.then(_fun54377);
function _fun54375(a0) { // fn#54375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:920, offset: 0x0136431b, size: 274 bytes, params: 2, frame: 15
const code = a0.body?.code;
const CONNECTION_REVOKED = AbortCodes.CONNECTION_REVOKED;
if (code === CONNECTION_REVOKED) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE',
accountId: env0_0});
return global.Promise.reject(a0);
}
if (a0.status !== 429) {
return global.Promise.reject(a0);
}
const property = a0.headers['retry-after'];
const Millis = (Durations).Millis;
const SECOND = Millis.SECOND;
const value3 = property * SECOND;
const r5 = global.isNaN(value3) || value3 === 0 ? 5000 : value3;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(r5);
return value.then(_fun54376);
function _fun54376() { // fn#54376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1204, offset: 0x0136442d, size: 23 bytes, params: 1, frame: 11
return getAccessToken(env1_0);
}
}
function _fun54377(a0) { // fn#54377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1262, offset: 0x01364444, size: 80 bytes, params: 2, frame: 14
const access_token = a0.body.access_token;
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN',
accountId: env0_0, accessToken: access_token});
return a0;
}
}
function subscribePlayerStateNotifications(a0, a1, a2) { // fn#54378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1544, offset: 0x01364494, size: 105 bytes, params: 4, frame: 18
const value = a3;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = value !== undefined ? value : 2;
const binding = env0_9;
const put = binding.put;
const NOTIFICATIONS_PLAYER = SpotifyEndpoints.NOTIFICATIONS_PLAYER;
return Reflect.apply(put, binding, [a0, a1, {url: NOTIFICATIONS_PLAYER,
query: {connection_id: a2}}]).catch(_fun54379);
function _fun54379(a0) { // fn#54379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1676, offset: 0x013644fd, size: 98 bytes, params: 2, frame: 12
var environment;
var r0;
var value;
if (env0_3 <= 0) {
r0 = global.Promise.reject(a0);
} else {
value = environment.__proto__;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(5000);
r4 = value;
} else {
r4 = global.Promise.resolve();
value = value.then(_fun54380);
r0 = value;
}
value = r4.then(_fun54369);
value = value.then(_fun54370);
value = value.then(_fun54371);
r0 = value;
} else {
r0 = global.Promise.reject(a0);
return r0;
function _fun54380() { // fn#54380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1736, offset: 0x0136455f, size: 41 bytes, params: 1, frame: 17
return subscribePlayerStateNotifications(env1_0, require, importDefault, env1_3 - 1);
}
}
} else {
r0 = global.Promise.reject(a0);
}
return r0;
}
function _fun54375(a0) { // fn#54375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:920, offset: 0x0136431b, size: 274 bytes, params: 2, frame: 15
const code = a0.body?.code;
const CONNECTION_REVOKED = AbortCodes.CONNECTION_REVOKED;
if (code === CONNECTION_REVOKED) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE',
accountId: env0_0});
return global.Promise.reject(a0);
function getProfile(a0, a1) { // fn#54381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1803, offset: 0x01364588, size: 64 bytes, params: 3, frame: 16
const env0_0 = a0;
const binding = env0_9;
const get = binding.get;
const PROFILE = SpotifyEndpoints.PROFILE;
return Reflect.apply(get, binding, [a0, a1, {url: PROFILE}]).then(_fun54382);
function _fun54382(a0) { // fn#54382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1868, offset: 0x013645c8, size: 88 bytes, params: 2, frame: 14
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'SPOTIFY_PROFILE_UPDATE',
accountId: env0_0, isPremium: a0.body.product === 'premium'});
return a0;
}
}
if (a0.status !== 429) {
return global.Promise.reject(a0);
function getDevices(a0, a1) { // fn#54383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1990, offset: 0x01364620, size: 64 bytes, params: 3, frame: 16
const env0_0 = a0;
const binding = env0_9;
const get = binding.get;
const PLAYER_DEVICES = SpotifyEndpoints.PLAYER_DEVICES;
return Reflect.apply(get, binding, [a0, a1, {url: PLAYER_DEVICES}]).then(_fun54384);
function _fun54384(a0) { // fn#54384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2062, offset: 0x01364660, size: 88 bytes, params: 2, frame: 13
var value;
if (a0.body) {
value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'SPOTIFY_SET_DEVICES', accountId: env0_0, devices: a0.body.devices});
}
return a0;
}
}
const property = a0.headers['retry-after'];
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const SECOND = Millis.SECOND;
const value3 = property * SECOND;
const r5 = global.isNaN(value3) || value3 === 0 ? 5000 : value3;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(r5);
return value.then(_fun54376);
}
function _fun54377(a0) { // fn#54377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1262, offset: 0x01364444, size: 80 bytes, params: 2, frame: 14
const access_token = a0.body.access_token;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN',
accountId: env0_0, accessToken: access_token});
return a0;
}
function play_54385(a0, a1, a2, a3) { // fn#54385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2169, offset: 0x013646b8, size: 273 bytes, params: 5, frame: 25
let value = a4;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = undefined;
const r2 = value !== value2 ? value : {};
const value3 = SpotifyEndpoints.PLAYER_OPEN(a3, a2, false);
const deviceId = r2.deviceId;
const position = r2.position;
const contextUri = r2.contextUri;
const env0_5 = r2.repeat;
const binding = env0_9;
const put = binding.put;
const PLAYER_PLAY = SpotifyEndpoints.PLAYER_PLAY;
value = Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PLAY, query: {device_id: deviceId},
body: {context_uri: contextUri ?? value2, uris: contextUri == null ? [value3] : value2,
offset: contextUri != null ? {uri: value3} : value2, position_ms: position ?? 0}}]);
value = value.then(_fun54386);
return value.then(_fun54387);
function _fun54386(a0) { // fn#54386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2455, offset: 0x013647c9, size: 97 bytes, params: 2, frame: 19
var r0;
var binding;
var put;
var binding2;
let value = a0;
let repeatBinding = repeat;
if (repeatBinding == null) {
r0 = value;
} else {
value = environment.__proto__;
binding = env1_9;
put = binding.put;
binding2 = env0_0;
repeatBinding = repeat;
value = 'off';
value = Reflect.apply(put, binding, [binding2, require, {url: SpotifyEndpoints.PLAYER_REPEAT,
query: {device_id: deviceId, state: repeatBinding ? 'context' : value}}]);
r0 = value;
}
return r0;
}
function _fun54387(a0) { // fn#54387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2553, offset: 0x0136482a, size: 84 bytes, params: 2, frame: 14
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_PLAY',
id: importDefault, position: position ?? 0});
return a0;
}
function _fun54379(a0) { // fn#54379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1676, offset: 0x013644fd, size: 98 bytes, params: 2, frame: 12
var environment;
var r0;
var value;
if (env0_3 <= 0) {
r0 = global.Promise.reject(a0);
} else {
value = environment.__proto__;
value = require(4041) /* metro dependency 4041: Timers */;
value = value.timeoutPromise(5000);
value = value.then(_fun54380);
r0 = value;
}
return r0;
}
function _fun54382(a0) { // fn#54382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1868, offset: 0x013645c8, size: 88 bytes, params: 2, frame: 14
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PROFILE_UPDATE',
accountId: env0_0, isPremium: a0.body.product === 'premium'});
return a0;
}
function pause_54388(a0, a1) { // fn#54388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2644, offset: 0x0136487e, size: 61 bytes, params: 3, frame: 15
const binding = env0_9;
const put = binding.put;
const PLAYER_PAUSE = SpotifyEndpoints.PLAYER_PAUSE;
return Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PAUSE}]).then(_fun54389);
function _fun54389(a0) { // fn#54389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2709, offset: 0x013648bb, size: 52 bytes, params: 2, frame: 12
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'SPOTIFY_PLAYER_PAUSE'});
return a0;
}
function _fun54384(a0) { // fn#54384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2062, offset: 0x01364660, size: 88 bytes, params: 2, frame: 13
var value;
if (a0.body) {
value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'SPOTIFY_SET_DEVICES', accountId: env0_0, devices: a0.body.devices});
}
return a0;
}
function _fun54386(a0) { // fn#54386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2455, offset: 0x013647c9, size: 97 bytes, params: 2, frame: 19
var r0;
var binding;
var put;
var binding2;
let value = a0;
let repeatBinding = repeat;
if (repeatBinding == null) {
r0 = value;
} else {
value = environment.__proto__;
binding = env1_9;
put = binding.put;
binding2 = env0_0;
repeatBinding = repeat;
value = 'off';
value = Reflect.apply(put, binding, [binding2, require, {url: SpotifyEndpoints.PLAYER_REPEAT,
query: {device_id: deviceId, state: repeatBinding ? 'context' : value}}]);
r0 = value;
function fetchIsSpotifyProtocolRegistered() { // fn#54390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2802, offset: 0x013648ef, size: 111 bytes, params: 1, frame: 13
var moduleValue;
const spotifyProtocolStoreBinding = SpotifyProtocolStore;
if (!spotifyProtocolStoreBinding.isProtocolRegistered()) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isDesktop()) {
(importDefault(6871) /* metro dependency 6871: GameUtilsNative */).isProtocolRegistered(SPOTIFY_APP_PROTOCOL).then(_fun54391);
}
}
function _fun54391(a0) { // fn#54391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2931, offset: 0x0136495e, size: 57 bytes, params: 2, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'SPOTIFY_SET_PROTOCOL_REGISTERED',
isRegistered: a0});
}
}
return r0;
}
function _fun54387(a0) { // fn#54387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2553, offset: 0x0136482a, size: 84 bytes, params: 2, frame: 14
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_PLAY',
id: importDefault, position: position ?? 0});
return a0;
}
function setActiveDevice_54392(a0, a1) { // fn#54392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:3031, offset: 0x01364997, size: 65 bytes, params: 3, frame: 13
(Dispatcher).dispatch({type: 'SPOTIFY_SET_ACTIVE_DEVICE',
accountId: a0, deviceId: a1});
}
function _fun54389(a0) { // fn#54389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2709, offset: 0x013648bb, size: 52 bytes, params: 2, frame: 12
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_PAUSE'});
return a0;
}
function _fun54391(a0) { // fn#54391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2931, offset: 0x0136495e, size: 57 bytes, params: 2, frame: 13
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_SET_PROTOCOL_REGISTERED',
isRegistered: a0});
}
function _fun54369() { // fn#54369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:528, offset: 0x01364206, size: 23 bytes, params: 1, frame: 11
return getAccessToken(require);
}
function _fun54370({body}) { // fn#54370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:558, offset: 0x0136421d, size: 55 bytes, params: 2, frame: 19
return apiRequest(env1_0, require, body.access_token, importAll, env1_3 - 1);
}
function _fun54371(a0) { // fn#54371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:617, offset: 0x01364254, size: 44 bytes, params: 2, frame: 11
let env0_0 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(function(a0) {
var env0_0 = a0;
return global.setImmediate(_fun54373);
});
return promise instanceof Object ? promise : value;
}
function _fun54376() { // fn#54376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1204, offset: 0x0136442d, size: 23 bytes, params: 1, frame: 11
return getAccessToken(env1_0);
}
function _fun54380() { // fn#54380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1736, offset: 0x0136455f, size: 41 bytes, params: 1, frame: 17
return subscribePlayerStateNotifications(env1_0, require, importDefault, env1_3 - 1);
}
function _fun54372(a0) { // fn#54372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:633, offset: 0x01364280, size: 31 bytes, params: 2, frame: 11
const env0_0 = a0;
return global.setImmediate(_fun54373);
}
global.__d(_fun54365, 6869, [6870, 6868, 661, 4041, 507, 694, 672, 477, 6871,
2]) /* metro module 6869, dependencies: [6870, 6868, 661, 4041, 507, 694, 672, 477, 6871, 2] */;
+53 -48
View File
@@ -1,9 +1,13 @@
/* Metro module 6868; source: modules/spotify/SpotifyConstants.tsx; dependencies: [661, 4915, 477, 2] */
import Platforms from '../../lib/Platforms.tsx'; /* Metro dependency 4915 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun54357(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:6, offset: 0x01363a5c, size: 692 bytes, params: 8, frame: 27
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const PlatformTypes = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
let value = importDefault(4915) /* metro dependency 4915: Platforms */;
const PlatformTypes = (ConstantsModule).PlatformTypes;
let value = Platforms;
const get = value.get;
const SPOTIFY = PlatformTypes.SPOTIFY;
const name = Reflect.apply(get, value, [SPOTIFY]).name;
@@ -12,21 +16,21 @@ function _fun54357(global, require, importDefault, importAll, module, exports, d
};
Object = global.Object;
const freeze = Object.freeze;
const object = {};
object.PROFILE = '' + 'https://api.spotify.com/v1' + '/me';
object.NOTIFICATIONS_PLAYER = '' + 'https://api.spotify.com/v1' + '/me/notifications/player';
object.PLAYER = '' + 'https://api.spotify.com/v1' + '/me/player';
object.PLAYER_DEVICES = '' + 'https://api.spotify.com/v1' + '/me/player/devices';
object.PLAYER_PLAY = '' + 'https://api.spotify.com/v1' + '/me/player/play';
object.PLAYER_PAUSE = '' + 'https://api.spotify.com/v1' + '/me/player/pause';
object.PLAYER_REPEAT = '' + 'https://api.spotify.com/v1' + '/me/player/repeat';
object.WEB_OPEN = function(a0, a1) {
const object2 = {};
object2.PROFILE = '' + 'https://api.spotify.com/v1' + '/me';
object2.NOTIFICATIONS_PLAYER = '' + 'https://api.spotify.com/v1' + '/me/notifications/player';
object2.PLAYER = '' + 'https://api.spotify.com/v1' + '/me/player';
object2.PLAYER_DEVICES = '' + 'https://api.spotify.com/v1' + '/me/player/devices';
object2.PLAYER_PLAY = '' + 'https://api.spotify.com/v1' + '/me/player/play';
object2.PLAYER_PAUSE = '' + 'https://api.spotify.com/v1' + '/me/player/pause';
object2.PLAYER_REPEAT = '' + 'https://api.spotify.com/v1' + '/me/player/repeat';
object2.WEB_OPEN = function(a0, a1) {
var value = a2;
return 'https://open.spotify.com/' + (0, global.encodeURIComponent)(a0) + '/' + (0,
global.encodeURIComponent)(a1) + spotifyUtmParams(value !== undefined ? value : 'desktop');
};
object.EMBED = EMBED;
object.PLAYER_OPEN = function(a0, a1) {
object2.EMBED = EMBED;
object2.PLAYER_OPEN = function(a0, a1) {
var r1;
var r7;
var value = a2;
@@ -38,17 +42,17 @@ function _fun54357(global, require, importDefault, importAll, module, exports, d
var value4 = '';
return value4 + 'spotify' + ':' + value + ':' + value3 + (r1 ? spotifyUtmParams(r7) : value4);
};
object.PREMIUM_SITE = 'https://www.spotify.com/premium/' + closure('desktop');
object.INSTALL_ATTRIBUTION = function(a0) {
object2.PREMIUM_SITE = 'https://www.spotify.com/premium/' + closure('desktop');
object2.INSTALL_ATTRIBUTION = function(a0) {
return 'https://app.adjust.com/bdyga9?campaign=' + a0;
};
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
let value2 = 'https://itunes.apple.com/us/app/spotify-music/id324684580?mt=8';
object.APP_STORE = value ? 'https://play.google.com/store/apps/details?id=com.spotify.music&hl=en_US&gl=US' : value2;
object.IOS_APP_STORE = value2;
value = Reflect.apply(freeze, Object, [object]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyConstants.tsx');
object2.APP_STORE = value ? 'https://play.google.com/store/apps/details?id=com.spotify.music&hl=en_US&gl=US' : value2;
object2.IOS_APP_STORE = value2;
value = Reflect.apply(freeze, Object, [object2]);
(FileImportTrackerModule).fileFinishedImporting('modules/spotify/SpotifyConstants.tsx');
exports.SPOTIFY_APP_PROTOCOL = 'spotify';
exports.SPOTIFY_PARTY_PREFIX = 'spotify:';
exports.SPOTIFY_PLATFORM_NAME = name;
@@ -62,35 +66,36 @@ function _fun54357(global, require, importDefault, importAll, module, exports, d
exports.SPOTIFY_HOSTNAMES = ['open.spotify.com', 'www.spotify.com'];
exports.SpotifyEndpoints = value;
exports.getSpotifyResourceType = getSpotifyResourceType;
}
function EMBED(a0) { // fn#54360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:932, offset: 0x01363d82, size: 55 bytes, params: 2, frame: 13
let value = a1;
value = spotifyUtmParams(value !== undefined ? value : 'desktop');
return 'https://open.spotify.com/embed' + a0 + value;
}
function getSpotifyResourceType(a0) { // fn#54364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:1908, offset: 0x01363e6a, size: 170 bytes, params: 2, frame: 3
if (typeof a0 === 'string') {
if (a0 === 'track') {
return env0_0.TRACK;
}
if (a0 === 'artist') {
return env0_0.ARTIST;
}
if (a0 === 'album') {
return env0_0.ALBUM;
}
if (a0 === 'playlist') {
return env0_0.PLAYLIST;
}
if (a0 === 'episode') {
return env0_0.EPISODE;
}
if (a0 === 'show') {
return env0_0.SHOW;
}
function EMBED(a0) { // fn#54360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:932, offset: 0x01363d82, size: 55 bytes, params: 2, frame: 13
let value = a1;
value = spotifyUtmParams(value !== undefined ? value : 'desktop');
return 'https://open.spotify.com/embed' + a0 + value;
}
return null;
function getSpotifyResourceType(a0) { // fn#54364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:1908, offset: 0x01363e6a, size: 170 bytes, params: 2, frame: 3
if (typeof a0 === 'string') {
if (a0 === 'track') {
return env0_0.TRACK;
}
if (a0 === 'artist') {
return env0_0.ARTIST;
}
if (a0 === 'album') {
return env0_0.ALBUM;
}
if (a0 === 'playlist') {
return env0_0.PLAYLIST;
}
if (a0 === 'episode') {
return env0_0.EPISODE;
}
if (a0 === 'show') {
return env0_0.SHOW;
}
}
return null;
}
}
global.__d(_fun54357, 6868, [661, 4915, 477, 2]) /* metro module 6868, dependencies: [661, 4915, 477, 2] */;
@@ -1,56 +1,73 @@
/* Metro module 6870; source: modules/spotify/SpotifyProtocolStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 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 PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun54393(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:6, offset: 0x013649d8, size: 267 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
const Store = (Flux).Store;
let value = _fun54397(Store);
value.displayName = 'SpotifyProtocolStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{SPOTIFY_SET_PROTOCOL_REGISTERED: function(a0) {
env0_5 = a0.isRegistered;
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyProtocolStore.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/spotify/SpotifyProtocolStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_54394() { // fn#54394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:148, offset: 0x01364ae3, size: 94 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) {
function _isNativeReflectConstruct_54394() { // fn#54394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:148, offset: 0x01364ae3, size: 94 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_54394_isNativeReflectConstruct = function() {
return !!result;
})();
}
return (_isNativeReflectConstruct_54394_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun54397(a0) { // fn#54397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:356, offset: 0x01364b41, size: 68 bytes, params: 2, frame: 15
const closure = SpotifyProtocolStore;
env0_4(closure, a0);
return env0_1(closure, [{key: 'isProtocolRegistered', value: value_54399}]);
function _fun54397(a0) { // fn#54397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:356, offset: 0x01364b41, size: 68 bytes, params: 2, frame: 15
const SpotifyProtocolStore2 = SpotifyProtocolStore;
Inherits(SpotifyProtocolStore2, a0);
return CreateClass(SpotifyProtocolStore2, [{key: 'isProtocolRegistered', value: value_54399}]);
function SpotifyProtocolStore() { // fn#54398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:368, offset: 0x00c7a0d6, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_0(this, SpotifyProtocolStore);
const value3 = env1_3(SpotifyProtocolStore);
return env1_2(this, _isNativeReflectConstruct_54394() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function value_54399() { // fn#54399, offset: 0x00e40571, size: 9 bytes, params: 1, frame: 1
return env1_5;
}
}
}
global.__d(_fun54393, 6870, [6, 7, 15, 17, 18, 566, 694,
2]) /* metro module 6870, dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */;
File diff suppressed because it is too large. Load diff
+259 -246
View File
@@ -1,4 +1,13 @@
/* Metro module 10217; source: modules/spotify/SpotifyUtils.tsx; dependencies: [5, 4266, 6870, 6867, 6868, 661, 672, 4915, 6869, 10218, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import RunningGameStoreNative from '../game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */
import SpotifyStore from './SpotifyStore.tsx'; /* Metro dependency 6867 */
import SpotifyProtocolStore from './SpotifyProtocolStore.tsx'; /* Metro dependency 6870 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as SpotifyConstantsModule from './SpotifyConstants.tsx'; /* Metro dependency 6868 */
function _fun79476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:6, offset: 0x01e54e7c, size: 369 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_79479 = function(a0, a1) {
@@ -53,19 +62,10 @@ function _fun79476(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const runningGameStoreNative = importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
const spotifyProtocolStore = importDefault(6870) /* metro dependency 6870: SpotifyProtocolStore */;
const spotifyStore = importDefault(6867) /* metro dependency 6867: SpotifyStore */;
const spotifyConstantsModule = require(6868) /* metro dependency 6868: SpotifyConstants */;
const env0_7 = spotifyConstantsModule.SPOTIFY_APP_PROTOCOL;
const env0_8 = spotifyConstantsModule.SpotifyResourceTypes;
const env0_9 = spotifyConstantsModule.getSpotifyResourceType;
const env0_10 = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const Millis = (Durations).Millis;
const SECOND = Millis.SECOND;
const env0_11 = 30 * SECOND;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/spotify/SpotifyUtils.tsx');
exports.isSpotifyPlayable = isSpotifyPlayable;
exports.ensureSpotifyPlayable = ensureSpotifyPlayable;
exports.isSpotifyPremium = isSpotifyPremium;
@@ -73,106 +73,155 @@ function _fun79476(global, require, importDefault, importAll, module, exports, d
exports.getSpotifyMetadataFromActivity = function() {
return _getSpotifyMetadataFromActivity.apply(this, arguments);
};
}
function _createForOfIteratorHelperLoose_79477(a0, a1) { // fn#79477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:253, offset: 0x01e54fed, 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_79477(a0, a1) { // fn#79477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:253, offset: 0x01e54fed, 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 _fun79478;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_79479(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 _fun79478;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_79479(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_79479(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_79479(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
if (r5) {
}
return _fun79478;
}
return _fun79478;
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 _fun79478() { // fn#79478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:824, 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 _getSpotifyMetadataFromActivity() { // fn#79481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1287, offset: 0x01e55195, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun79483).apply(this, arguments);
}
function _getSpotifyMetadataFromActivity() { // fn#79481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1287, offset: 0x01e55195, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun79483).apply(this, arguments);
function* _fun79483(a0, a1) { // fn#79483, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1372, offset: 0x01e551d2, size: 348 bytes, params: 3, frame: 19
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = undefined;
const value4 = binding(env2_2[9]);
const getMetadata = value4.getMetadata;
yield Reflect.apply(getMetadata, value4, [a0, a1]);
const value5 = undefined;
if (false) {
return value5;
}
binding = env2_9;
const binding2 = env2_14;
const r3 = value5.type ?? env2_8.TRACK;
binding2(r3);
const value7 = binding(r3);
if (value7 === null) {
throw new global.Error('invalid type ' + value5.type);
}
const object = {};
let context_uri = value5.context_uri;
context_uri = typeof context_uri !== 'string' ? value3 : value5.context_uri;
object.context_uri = context_uri;
binding = env2_14;
const album_id = value5.album_id;
binding(album_id);
object.album_id = album_id;
let Array = global.Array;
object.artist_ids = Array.isArray(value5.artist_ids) ? value5.artist_ids.map(env2_14) : [];
object.type = value7;
Array = global.Array;
object.button_urls = Array.isArray(value5.button_urls) ? value5.button_urls.map(env2_14) : [];
return object;
}
function isSpotifyPlayable(a0) { // fn#79484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1888, offset: 0x01e5532e, size: 41 bytes, params: 2, frame: 10
let value = a0.getActiveSocketAndDevice();
value = value != null;
return value || SpotifyProtocolStore.isProtocolRegistered();
}
function ensureSpotifyPlayable() { // fn#79485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2012, offset: 0x01e55357, size: 342 bytes, params: 1, frame: 19
var Promise;
var playableComputerDevices;
var isObservedAppRunning;
var defaultImport;
var promise;
var property;
var socket;
var device;
var value;
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
if (activeSocketAndDevice != null) {
return global.Promise.resolve(activeSocketAndDevice);
}
if (SpotifyProtocolStore.isProtocolRegistered()) {
playableComputerDevices = SpotifyStore.getPlayableComputerDevices();
isObservedAppRunning = RunningGameStoreNative.isObservedAppRunning;
defaultImport = importDefault(4915) /* metro dependency 4915: Platforms */;
if (Reflect.apply(isObservedAppRunning, RunningGameStoreNative,
[defaultImport.get(PlatformTypes.SPOTIFY).name])) {
if (playableComputerDevices.length > 0) {
property = playableComputerDevices[0];
socket = property.socket;
device = property.device;
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
value.setActiveDevice(socket.accountId, device.id);
function isSpotifyPlayable(a0) { // fn#79484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1888, offset: 0x01e5532e, size: 41 bytes, params: 2, frame: 10
let value = a0.getActiveSocketAndDevice();
value = value != null;
return value || SpotifyProtocolStore.isProtocolRegistered();
}
function ensureSpotifyPlayable() { // fn#79485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2012, offset: 0x01e55357, size: 342 bytes, params: 1, frame: 19
var Promise;
var playableComputerDevices;
var runningGameStoreNativeBinding;
var isObservedAppRunning;
var defaultImport;
var promise;
var property;
var socket;
var device;
var value;
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
if (activeSocketAndDevice != null) {
return global.Promise.resolve(activeSocketAndDevice);
}
const spotifyProtocolStoreBinding = SpotifyProtocolStore;
if (spotifyProtocolStoreBinding.isProtocolRegistered()) {
playableComputerDevices = SpotifyStore.getPlayableComputerDevices();
runningGameStoreNativeBinding = RunningGameStoreNative;
isObservedAppRunning = runningGameStoreNativeBinding.isObservedAppRunning;
defaultImport = importDefault(4915) /* metro dependency 4915: Platforms */;
if (Reflect.apply(isObservedAppRunning, runningGameStoreNativeBinding,
[defaultImport.get(PlatformTypes.SPOTIFY).name])) {
if (playableComputerDevices.length > 0) {
property = playableComputerDevices[0];
socket = property.socket;
device = property.device;
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
value.setActiveDevice(socket.accountId, device.id);
Promise = global.Promise;
return Promise.resolve({socket: socket, device: device});
}
Promise = global.Promise;
return Promise.resolve({socket: socket, device: device});
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
promise = new Promise(_fun79486);
return promise instanceof Object ? promise : value;
}
Promise = global.Promise;
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
@@ -180,162 +229,126 @@ function ensureSpotifyPlayable() { // fn#79485, source: /ci/build/discord/discor
return promise instanceof Object ? promise : value;
}
Promise = global.Promise;
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
promise = new Promise(_fun79486);
return promise instanceof Object ? promise : value;
}
Promise = global.Promise;
const reject = Promise.reject;
const Error = global.Error;
return Reflect.apply(reject, Promise, [new Error('protocol is not registered')]);
}
function isSpotifyPremium() { // fn#79492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3034, offset: 0x01e556b0, size: 40 bytes, params: 1, frame: 10
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
const value2 = null;
return value2 == activeSocketAndDevice ? value2 : activeSocketAndDevice.socket.isPremium;
}
function ensureSpotifyPremium() { // fn#79493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3161, offset: 0x01e556d8, size: 181 bytes, params: 1, frame: 14
var r0;
var Promise;
var value;
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
if (activeSocketAndDevice == null) {
Promise = global.Promise;
return Promise.reject(new global.Error('no active profile'));
}
const socket = activeSocketAndDevice.socket;
if (socket.isPremium) {
r0 = global.Promise.resolve();
} else {
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
value = value.getProfile(socket.accountId, socket.accessToken);
value = value.then(_fun79494);
r0 = value;
}
return r0;
}
function* _fun79483(a0, a1) { // fn#79483, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1372, offset: 0x01e551d2, size: 348 bytes, params: 3, frame: 19
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = undefined;
const value4 = binding(env2_2[9]);
const getMetadata = value4.getMetadata;
yield Reflect.apply(getMetadata, value4, [a0, a1]);
const value5 = undefined;
if (false) {
return value5;
}
binding = env2_9;
const binding2 = env2_14;
const r3 = value5.type ?? env2_8.TRACK;
binding2(r3);
const value7 = binding(r3);
if (value7 === null) {
throw new global.Error('invalid type ' + value5.type);
}
const object2 = {};
let context_uri = value5.context_uri;
context_uri = typeof context_uri !== 'string' ? value3 : value5.context_uri;
object2.context_uri = context_uri;
binding = env2_14;
const album_id = value5.album_id;
binding(album_id);
object2.album_id = album_id;
let Array = global.Array;
object2.artist_ids = Array.isArray(value5.artist_ids) ? value5.artist_ids.map(env2_14) : [];
object2.type = value7;
Array = global.Array;
object2.button_urls = Array.isArray(value5.button_urls) ? value5.button_urls.map(env2_14) : [];
return object2;
}
function _fun79486(a0, a1) { // fn#79486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2454, offset: 0x01e554ad, size: 124 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = global.setTimeout(_fun79487, env1_11);
SpotifyStore.addChangeListener(onSpotifyStoreChange);
global.window.open('' + SPOTIFY_APP_PROTOCOL + ':');
}
function _fun79494() { // fn#79494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3398, offset: 0x01e5578d, size: 73 bytes, params: 1, frame: 13
if (socket.isPremium) {
return undefined;
}
const Promise = global.Promise;
const reject = Promise.reject;
const Error = global.Error;
return Reflect.apply(reject, Promise, [new Error('spotify account is not premium')]);
}
function _fun79487() { // fn#79487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2480, offset: 0x01e55529, size: 72 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
SpotifyStore.removeChangeListener(onSpotifyStoreChange);
const Error = global.Error;
require(new Error('timeout launching spotify'));
}
function onSpotifyStoreChange() { // fn#79488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2598, offset: 0x01e55571, size: 89 bytes, params: 1, frame: 15
var environment;
var r2;
var value3;
var socket;
var device;
var value4;
const closure = onSpotifyStoreChange_loop;
let value = environment.__proto__.__proto__;
const _createForOfIteratorHelperLoose_79477Binding = _createForOfIteratorHelperLoose_79477;
value = SpotifyStore.getPlayableComputerDevices();
value = _createForOfIteratorHelperLoose_79477Binding(value);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
socket = value3.socket;
device = value3.device;
closure(socket, device);
value4 = value();
done = value4.done;
if (done) {
break;
const reject = Promise.reject;
const Error = global.Error;
return Reflect.apply(reject, Promise, [new Error('protocol is not registered')]);
function _fun79486(a0, a1) { // fn#79486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2454, offset: 0x01e554ad, size: 124 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = global.setTimeout(_fun79487, env1_11);
SpotifyStore.addChangeListener(onSpotifyStoreChange);
global.window.open('' + SPOTIFY_APP_PROTOCOL + ':');
function _fun79487() { // fn#79487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2480, offset: 0x01e55529, size: 72 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
const spotifyStoreBinding = SpotifyStore;
spotifyStoreBinding.removeChangeListener(onSpotifyStoreChange);
const Error = global.Error;
require(new Error('timeout launching spotify'));
}
function onSpotifyStoreChange() { // fn#79488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2598, offset: 0x01e55571, size: 89 bytes, params: 1, frame: 15
var environment;
var r2;
var value3;
var socket;
var device;
var value4;
const onSpotifyStoreChange_loop2 = onSpotifyStoreChange_loop;
let value = environment.__proto__.__proto__;
const _createForOfIteratorHelperLoose_79477Binding = _createForOfIteratorHelperLoose_79477;
value = SpotifyStore.getPlayableComputerDevices();
value = _createForOfIteratorHelperLoose_79477Binding(value);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
socket = value3.socket;
device = value3.device;
onSpotifyStoreChange_loop2(socket, device);
value4 = value();
done = value4.done;
if (done) {
break;
}
}
}
function onSpotifyStoreChange_loop(a0, a1) { // fn#79489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2619, owner: onSpotifyStoreChange._loop, offset: 0x01e555ca, size: 113 bytes, params: 3, frame: 14
var environment;
var clearTimeout;
var value2;
var spotifyStoreBinding;
const env0_0 = a0;
const env0_1 = a1;
let value = environment.__proto__.__proto__;
value = env2_0.find(function(a0) {
return a0.device.id === require.id;
});
if (value == null) {
clearTimeout = global.clearTimeout;
value = environment.__proto__;
clearTimeout(env1_2);
value2 = environment.__proto__.__proto__.__proto__;
spotifyStoreBinding = SpotifyStore;
spotifyStoreBinding.removeChangeListener(onSpotifyStoreChange);
global.setImmediate(_fun79491);
}
function _fun79491() { // fn#79491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2748, offset: 0x01e5565b, size: 85 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
const setActiveDevice = value.setActiveDevice;
const binding = env0_0;
Reflect.apply(setActiveDevice, value, [binding.accountId, require.id]);
value = environment.__proto__.__proto__;
env2_0({socket: binding, device: require});
}
}
}
}
}
}
function onSpotifyStoreChange_loop(a0, a1) { // fn#79489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2619, owner: onSpotifyStoreChange._loop, offset: 0x01e555ca, size: 113 bytes, params: 3, frame: 14
var environment;
var clearTimeout;
var value2;
const env0_0 = a0;
const env0_1 = a1;
let value = environment.__proto__.__proto__;
value = env2_0.find(function(a0) {
return a0.device.id === require.id;
});
if (value == null) {
clearTimeout = global.clearTimeout;
value = environment.__proto__;
clearTimeout(env1_2);
value2 = environment.__proto__.__proto__.__proto__;
SpotifyStore.removeChangeListener(onSpotifyStoreChange);
global.setImmediate(_fun79491);
function isSpotifyPremium() { // fn#79492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3034, offset: 0x01e556b0, size: 40 bytes, params: 1, frame: 10
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
const value2 = null;
return value2 == activeSocketAndDevice ? value2 : activeSocketAndDevice.socket.isPremium;
}
function ensureSpotifyPremium() { // fn#79493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3161, offset: 0x01e556d8, size: 181 bytes, params: 1, frame: 14
var r0;
var Promise;
var value;
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
if (activeSocketAndDevice == null) {
Promise = global.Promise;
return Promise.reject(new global.Error('no active profile'));
}
const socket = activeSocketAndDevice.socket;
if (socket.isPremium) {
r0 = global.Promise.resolve();
} else {
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
value = value.getProfile(socket.accountId, socket.accessToken);
value = value.then(_fun79494);
r0 = value;
}
return r0;
function _fun79494() { // fn#79494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3398, offset: 0x01e5578d, size: 73 bytes, params: 1, frame: 13
if (socket.isPremium) {
return undefined;
}
const Promise = global.Promise;
const reject = Promise.reject;
const Error = global.Error;
return Reflect.apply(reject, Promise, [new Error('spotify account is not premium')]);
}
}
}
function _fun79491() { // fn#79491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2748, offset: 0x01e5565b, size: 85 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
const setActiveDevice = value.setActiveDevice;
const binding = env0_0;
Reflect.apply(setActiveDevice, value, [binding.accountId, require.id]);
value = environment.__proto__.__proto__;
env2_0({socket: binding, device: require});
}
global.__d(_fun79476, 10217, [5, 4266, 6870, 6867, 6868, 661, 672, 4915, 6869, 10218,
2]) /* metro module 10217, dependencies: [5, 4266, 6870, 6867, 6868, 661, 672, 4915, 6869, 10218, 2] */;