2026-07-23 10:11:24 +00:00
// Module ID: 4468
2026-07-24 07:16:23 +00:00
// Function ID: 39452
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 15, 17, 18, 57, 1194, 1348, 4469, 653, 22, 21, 1327, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
// Module 4468 (_isNativeReflectConstruct)
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import set from "set" ;
import _getPrototypeOf from "_getPrototypeOf" ;
import _inherits from "_inherits" ;
import _slicedToArray from "_slicedToArray" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_isNativeReflectConstruct" ;
import closure_11 from "_isNativeReflectConstruct" ;
2026-07-22 07:54:56 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-23 10:11:24 +00:00
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function getUserDrafts ( id ) {
2026-07-23 10:11:24 +00:00
let tmp = table [ id ] ;
2026-07-20 16:05:17 +00:00
if ( null == tmp ) {
const obj = { } ;
2026-07-23 10:11:24 +00:00
table [ id ] = obj ;
2026-07-20 16:05:17 +00:00
tmp = obj ;
}
return tmp ;
}
function handleChanged ( type ) {
let channelId ;
let draft ;
let draftType ;
( { channelId , draft , draftType } = type ) ;
2026-07-23 10:11:24 +00:00
const channel = store2 . getChannel ( channelId ) ;
2026-07-20 16:05:17 +00:00
let template ;
if ( null != channel ) {
template = channel . template ;
}
if ( draft === template ) {
draft = "" ;
}
const id = store . getId ( ) ;
if ( null != id ) {
if ( null != draft ) {
if ( "" !== draft ) {
const tmp6 = getUserDrafts ( id ) ;
let tmp7 = tmp6 [ channelId ] ;
if ( null == tmp7 ) {
let obj = { } ;
tmp6 [ channelId ] = obj ;
tmp7 = obj ;
}
let substr = draft ;
if ( draft . length > closure_12 ) {
substr = draft . substr ( 0 , closure_12 ) ;
}
draft = undefined ;
if ( null != tmp7 [ draftType ] ) {
draft = tmp11 . draft ;
}
if ( substr !== draft ) {
obj = { } ;
const _Date = Date ;
obj . timestamp = Date . now ( ) ;
obj . draft = substr ;
tmp7 [ draftType ] = obj ;
}
}
return "DRAFT_SAVE" === type . type ;
}
}
deleteDraft ( channelId , draftType ) ;
}
function deleteDraft ( channelId , draftType , id ) {
if ( id === undefined ) {
id = store . getId ( ) ;
}
if ( null == id ) {
return false ;
} else {
2026-07-23 10:11:24 +00:00
const tmp8 = getUserDrafts ( id ) [ channelId ] ;
if ( null == tmp8 ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
2026-07-23 10:11:24 +00:00
delete tmp4 [ tmp3 ] ;
if ( obj . isEmpty ( tmp8 ) ) {
delete tmp [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
}
}
}
}
function pruneNonexistentChannels() {
const id = store . getId ( ) ;
if ( null != id ) {
if ( obj . totalUnavailableGuilds <= 0 ) {
2026-07-23 10:11:24 +00:00
const tmp6 = getUserDrafts ( id ) ;
for ( const key10012 in tmp6 ) {
let tmp8 = key10012 ;
let tmp9 = store2 ;
if ( null != store2 . getChannel ( key10012 ) ) {
2026-07-20 16:05:17 +00:00
continue ;
} else {
2026-07-23 10:11:24 +00:00
delete tmp [ tmp2 ] ;
continue ;
2026-07-20 16:05:17 +00:00
}
continue ;
}
}
}
}
function handleChannelDelete ( arg0 ) {
const id = store . getId ( ) ;
if ( null != id ) {
getUserDrafts ( id ) ;
2026-07-23 10:11:24 +00:00
delete tmp [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
}
return false ;
}
2026-07-23 10:11:24 +00:00
let closure_12 = require ( "ME" ) . MAX_MESSAGE_LENGTH_PREMIUM + 500 ;
2026-07-20 16:05:17 +00:00
let obj = { ChannelMessage : 0 , [ 0 ] : "ChannelMessage" , ThreadSettings : 1 , [ 1 ] : "ThreadSettings" , FirstThreadMessage : 2 , [ 2 ] : "FirstThreadMessage" , ApplicationLauncherCommand : 3 , [ 3 ] : "ApplicationLauncherCommand" , Poll : 4 , [ 4 ] : "Poll" , SlashCommand : 5 , [ 5 ] : "SlashCommand" , ForwardContextMessage : 6 , [ 6 ] : "ForwardContextMessage" , InteractionModal : 7 , [ 7 ] : "InteractionModal" } ;
let closure_14 = { } ;
2026-07-23 10:11:24 +00:00
let tmp2 = ( ( PersistedStore ) = > {
2026-07-20 16:05:17 +00:00
class DraftStore {
constructor ( ) {
self = this ;
2026-07-23 10:11:24 +00:00
tmp = outer1_3 ( this , DraftStore ) ;
obj = outer1_6 ( DraftStore ) ;
tmp2 = outer1_5 ;
if ( outer1_15 ( ) ) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis ;
_Reflect = Reflect ;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6 ;
2026-07-20 16:05:17 +00:00
tmp8 = arguments ;
2026-07-23 10:11:24 +00:00
constructResult = Reflect . construct ( obj , arguments , outer1_6 ( self ) . constructor ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments ;
tmp4 = arguments ;
constructResult = obj ( . . . arguments ) ;
}
return tmp2 ( self , constructResult ) ;
}
}
callback2 ( DraftStore , PersistedStore ) ;
let obj = {
key : "initialize" ,
value ( arg0 ) {
let iter5 ;
let tmp4 ;
let tmp5 ;
let obj = arg0 ;
const self = this ;
if ( null == arg0 ) {
obj = { } ;
}
2026-07-23 10:11:24 +00:00
const outer1_14 = obj ;
const tmp = outer1_16 ( outer1_1 ( outer1_2 [ 11 ] ) . entries ( outer1_14 ) ) ;
2026-07-20 16:05:17 +00:00
const iter = tmp ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = outer1_8 ;
let tmp3 = outer1_8 ( iter2 . value , 2 ) ;
let tmp6 = outer1_16 ;
let tmp7 = outer1_1 ;
let tmp8 = outer1_2 ;
2026-07-20 16:05:17 +00:00
[ tmp4 , tmp5 ] = tmp3 ;
2026-07-23 10:11:24 +00:00
let obj3 = outer1_1 ( outer1_2 [ 11 ] ) ;
let tmp9 = outer1_16 ( obj3 . entries ( tmp5 ) ) ;
2026-07-20 16:05:17 +00:00
let iter3 = tmp9 ( ) ;
if ( ! iter3 . done ) {
do {
2026-07-23 10:11:24 +00:00
let tmp10 = outer1_8 ;
let tmp11 = outer1_8 ( iter3 . value , 2 ) ;
2026-07-20 16:05:17 +00:00
let first = tmp11 [ 0 ] ;
2026-07-23 10:11:24 +00:00
let tmp13 = outer1_13 ;
let tmp14 = tmp11 [ 1 ] [ outer1_13 . ChannelMessage ] ;
2026-07-20 16:05:17 +00:00
if ( null != tmp14 ) {
let tmp15 = "" !== tmp14 . draft ;
if ( tmp15 ) {
let str = tmp14 . draft ;
tmp15 = "" !== str . trim ( ) ;
}
if ( ! tmp15 ) {
2026-07-23 10:11:24 +00:00
let tmp16 = outer1_19 ;
let tmp17 = outer1_13 ;
let tmp18 = outer1_19 ( first , outer1_13 . ChannelMessage , tmp4 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
iter4 = tmp9 ( ) ;
2026-07-20 16:05:17 +00:00
iter3 = iter4 ;
let tmp19 = first ;
let tmp20 = tmp14 ;
} while ( ! iter4 . done ) ;
}
iter5 = tmp ( ) ;
iter2 = iter5 ;
} while ( ! iter5 . done ) ;
}
2026-07-23 10:11:24 +00:00
self . waitFor ( outer1_9 , outer1_10 , outer1_11 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
const items = [ obj , , , , , ] ;
obj = {
key : "getState" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_14 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 1 ] = obj ;
obj = {
key : "getThreadDraftWithParentMessageId" ,
value ( arg0 ) {
2026-07-23 10:11:24 +00:00
let self = this ;
self = this ;
let closure_1 = arg0 ;
const id = outer1_9 . getId ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != id ) {
let threadSettings ;
2026-07-23 10:11:24 +00:00
const tmp4 = outer1_18 ( id ) ;
const keys = outer1_1 ( outer1_2 [ 11 ] ) . keys ( tmp4 ) ;
2026-07-20 16:05:17 +00:00
const found = keys . find ( ( arg0 ) = > {
const threadSettings = self . getThreadSettings ( arg0 ) ;
let parentMessageId ;
if ( null != threadSettings ) {
parentMessageId = threadSettings . parentMessageId ;
}
2026-07-23 10:11:24 +00:00
return parentMessageId === closure_1 ;
2026-07-20 16:05:17 +00:00
} ) ;
if ( null != found ) {
threadSettings = self . getThreadSettings ( found ) ;
}
return threadSettings ;
}
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "getRecentlyEditedDrafts" ,
value ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
const id = outer1_9 . getId ( ) ;
2026-07-20 16:05:17 +00:00
if ( null == id ) {
return [ ] ;
} else {
2026-07-23 10:11:24 +00:00
const tmp3 = outer1_18 ( id ) ;
const obj = outer1_1 ( outer1_2 [ 10 ] ) ( outer1_18 ( id ) ) ;
const mapValuesResult = outer1_1 ( outer1_2 [ 10 ] ) ( outer1_18 ( id ) ) . mapValues ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let tmp ;
if ( null != arg0 ) {
tmp = arg0 [ closure_0 ] ;
}
return tmp ;
} ) ;
2026-07-23 10:11:24 +00:00
const pickByResult = outer1_1 ( outer1_2 [ 10 ] ) ( outer1_18 ( id ) ) . mapValues ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let tmp ;
if ( null != arg0 ) {
tmp = arg0 [ closure_0 ] ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) . pickBy ( DraftStore ( outer1_2 [ 12 ] ) . isNotNullish ) ;
const mapped = outer1_1 ( outer1_2 [ 10 ] ) ( outer1_18 ( id ) ) . mapValues ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let tmp ;
if ( null != arg0 ) {
tmp = arg0 [ closure_0 ] ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) . pickBy ( DraftStore ( outer1_2 [ 12 ] ) . isNotNullish ) . toPairs ( ) . map ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let tmp ;
[ tmp , ] = arg0 ;
return { channelId , timestamp , draft } ;
} ) ;
2026-07-23 10:11:24 +00:00
const toPairsResult = outer1_1 ( outer1_2 [ 10 ] ) ( outer1_18 ( id ) ) . mapValues ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let tmp ;
if ( null != arg0 ) {
tmp = arg0 [ closure_0 ] ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) . pickBy ( DraftStore ( outer1_2 [ 12 ] ) . isNotNullish ) . toPairs ( ) ;
2026-07-20 16:05:17 +00:00
return mapped . sortBy ( ( timestamp ) = > - timestamp . timestamp ) . value ( ) ;
}
}
} ;
items [ 4 ] = {
key : "getDraft" ,
value ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
const id = outer1_9 . getId ( ) ;
2026-07-20 16:05:17 +00:00
if ( null == id ) {
return "" ;
} else {
2026-07-23 10:11:24 +00:00
const tmp4 = outer1_18 ( id ) [ arg0 ] ;
2026-07-20 16:05:17 +00:00
if ( null != tmp4 ) {
if ( null != tmp4 [ arg1 ] ) {
return tmp6 . draft ;
}
}
return "" ;
}
}
} ;
items [ 5 ] = {
key : "getThreadSettings" ,
value ( arg0 ) {
2026-07-23 10:11:24 +00:00
const id = outer1_9 . getId ( ) ;
2026-07-20 16:05:17 +00:00
if ( null == id ) {
return null ;
} else {
2026-07-23 10:11:24 +00:00
const tmp4 = outer1_18 ( id ) [ arg0 ] ;
2026-07-20 16:05:17 +00:00
let tmp5 = null ;
if ( null != tmp4 ) {
2026-07-23 10:11:24 +00:00
tmp5 = tmp4 [ outer1_13 . ThreadSettings ] ;
2026-07-20 16:05:17 +00:00
}
return tmp5 ;
}
}
} ;
return callback ( DraftStore , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( require ( "initialize" ) . PersistedStore ) ;
2026-07-20 16:05:17 +00:00
tmp2 . displayName = "DraftStore" ;
tmp2 . persistKey = "DraftStore" ;
2026-07-23 10:11:24 +00:00
let items = [
2026-07-20 16:05:17 +00:00
( obj ) = > {
if ( null == obj ) {
return { } ;
} else {
for ( const key10005 in arg0 ) {
let tmp3 = key10005 ;
if ( ! ( "timestamp" in arg0 [ key10005 ] ) ) {
continue ;
} else {
obj = { } ;
2026-07-23 10:11:24 +00:00
let tmp2 = obj ;
obj [ obj . ChannelMessage ] = arg0 [ key10005 ] ;
2026-07-20 16:05:17 +00:00
arg0 [ key10005 ] = obj ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
continue ;
}
return obj ;
}
} ,
( obj ) = > {
const id = store . getId ( ) ;
if ( null != obj ) {
if ( null != id ) {
obj = { } ;
obj = { } ;
obj [ id ] = obj ;
for ( const key10009 in arg0 ) {
let tmp3 = key10009 ;
obj [ key10009 ] = arg0 [ key10009 ] ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
return obj ;
}
}
return { } ;
}
] ;
tmp2 . migrations = items ;
obj = {
CONNECTION_OPEN : function handleConnectionOpen() {
const id = store . getId ( ) ;
if ( ! ( id in closure_14 ) ) {
closure_14 [ id ] = { } ;
}
pruneNonexistentChannels ( ) ;
return false ;
} ,
LOGOUT : function handleLogout ( isSwitchingAccount ) {
if ( ! isSwitchingAccount . isSwitchingAccount ) {
let closure_14 = { } ;
}
} ,
MULTI_ACCOUNT_REMOVE_ACCOUNT : function handleMultiAccountRemove ( userId ) {
if ( userId . userId in closure_14 ) {
userId = userId . userId ;
2026-07-23 10:11:24 +00:00
delete tmp2 [ tmp ] ;
2026-07-20 16:05:17 +00:00
}
} ,
GUILD_DELETE : function handleGuildDelete() {
pruneNonexistentChannels ( ) ;
return false ;
} ,
CHANNEL_DELETE : handleChannelDelete ,
THREAD_DELETE : handleChannelDelete ,
THREAD_CREATE : function handleThreadCreate ( channel ) {
channel = channel . channel ;
const id = store . getId ( ) ;
if ( null != id ) {
if ( channel . ownerId !== id ) {
const tmp10 = getUserDrafts ( id ) ;
if ( null == tmp10 [ channel . parent_id ] ) {
return false ;
2026-07-23 10:11:24 +00:00
} else if ( null == tmp11 [ obj . ThreadSettings ] ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
if ( tmp13 . parentMessageId !== obj3 . castChannelIdAsMessageId ( channel . id ) ) {
return false ;
} else if ( null == tmp10 [ channel . parent_id ] ) {
return false ;
} else {
let draft ;
2026-07-23 10:11:24 +00:00
if ( null != tmp16 [ obj . FirstThreadMessage ] ) {
2026-07-20 16:05:17 +00:00
draft = tmp18 . draft ;
}
let str2 = "" ;
if ( null != draft ) {
str2 = draft ;
}
if ( "" !== str2 ) {
2026-07-23 10:11:24 +00:00
obj = { } ;
2026-07-20 16:05:17 +00:00
obj = { } ;
const _Date = Date ;
obj . timestamp = Date . now ( ) ;
obj . draft = str2 ;
obj [ obj . ChannelMessage ] = obj ;
tmp10 [ channel . id ] = obj ;
}
deleteDraft ( channel . parent_id , obj . ThreadSettings ) ;
deleteDraft ( channel . parent_id , obj . FirstThreadMessage ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
return false ;
} ,
DRAFT_SAVE : handleChanged ,
DRAFT_CHANGE : handleChanged ,
DRAFT_CLEAR : function handleDraftClear ( channelId ) {
return deleteDraft ( channelId . channelId , channelId . draftType ) ;
} ,
THREAD_SETTINGS_DRAFT_CHANGE : function handleThreadSettingsDraftChanged ( arg0 ) {
let channelId ;
let draft ;
( { channelId , draft } = arg0 ) ;
const id = store . getId ( ) ;
if ( null != id ) {
const tmp3 = getUserDrafts ( id ) ;
let tmp4 = tmp3 [ channelId ] ;
if ( null == tmp4 ) {
let obj = { } ;
tmp3 [ channelId ] = obj ;
tmp4 = obj ;
}
obj = { } ;
const _Date = Date ;
obj . timestamp = Date . now ( ) ;
2026-07-23 10:11:24 +00:00
const merged = Object . assign ( tmp4 [ obj . ThreadSettings ] ) ;
2026-07-20 16:05:17 +00:00
const merged1 = Object . assign ( draft ) ;
obj [ "parentChannelId" ] = channelId ;
tmp4 [ obj . ThreadSettings ] = obj ;
}
}
} ;
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2 ( require ( "dispatcher" ) , obj ) ;
let result = require ( "_possibleConstructorReturn" ) . fileFinishedImporting ( "stores/DraftStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp2 ;
export const DraftType = obj ;