2026-07-25 08:10:48 +00:00
// Module ID: 10044
2026-07-27 11:26:19 +00:00
// Function ID: 77804
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1348, 1918, 1838, 1907, 3971, 1850, 653, 5044, 10042, 6115, 3970, 4277, 5048, 4975, 10043, 566, 686, 2]
2026-07-23 10:11:24 +00:00
2026-07-25 08:10:48 +00:00
// Module 10044 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import conceal from "conceal" ;
import requestMembersDebounced from "requestMembersDebounced" ;
import closure_7 from "_createForOfIteratorHelperLoose" ;
import closure_8 from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_createForOfIteratorHelperLoose" ;
import closure_11 from "_isNativeReflectConstruct" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
import set from "_possibleConstructorReturn" ;
2026-07-20 16:05:17 +00:00
let SearchTokenTypes ;
2026-07-23 10:11:24 +00:00
let closure_14 ;
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 getOrCreateUserSearchContext ( searchContext ) {
2026-07-25 08:10:48 +00:00
let obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
const searchContextId = obj . getSearchContextId ( searchContext ) ;
let value = map1 . get ( searchContextId ) ;
if ( null == value ) {
2026-07-25 08:10:48 +00:00
obj = { results : [ ] , context : importDefault ( 6115 ) . getUserSearchContext ( handleUserSearchResults . bind ( null , searchContext ) ) } ;
2026-07-20 16:05:17 +00:00
value = obj ;
2026-07-25 08:10:48 +00:00
const obj3 = importDefault ( 6115 ) ;
2026-07-20 16:05:17 +00:00
}
const result = map1 . set ( searchContextId , value ) ;
return value ;
}
function stateFactory ( searchContext ) {
let autocompletes ;
let cursorScope ;
let mode ;
let query ;
let tokens ;
searchContext = searchContext . searchContext ;
( { query , mode , tokens , cursorScope , autocompletes } = searchContext ) ;
getOrCreateUserSearchContext ( searchContext ) ;
return { searchContext , query , mode , tokens , cursorScope , autocompletes } ;
}
function isUserAutocompleteFilter ( filter ) {
let tmp = null != filter ;
if ( tmp ) {
let tmp3 = filter === SearchTokenTypes . FILTER_FROM ;
if ( ! tmp3 ) {
tmp3 = filter === SearchTokenTypes . FILTER_MENTIONS ;
}
tmp = tmp3 ;
}
return tmp ;
}
function isUserAutocompleteMode ( autocompleteMode ) {
let tmp = autocompleteMode . type === constants . FILTER ;
if ( tmp ) {
tmp = isUserAutocompleteFilter ( autocompleteMode . filter ) ;
}
return tmp ;
}
function handleUserSearchResults ( searchContext , results ) {
let mode ;
let tokens ;
2026-07-25 08:10:48 +00:00
let obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
const searchContextId = obj . getSearchContextId ( searchContext ) ;
let value = map1 . get ( searchContextId ) ;
value = map . get ( searchContextId ) ;
if ( null != value ) {
if ( null != value ) {
if ( isUserAutocompleteMode ( value . mode ) ) {
let num = 3 ;
if ( value . mode . type === constants . FILTER ) {
num = 10 ;
}
if ( num === undefined ) {
num = 10 ;
}
const items = [ ] ;
const tmp6 = _createForOfIteratorHelperLoose ( results . results ) ;
const iter = tmp6 ( ) ;
if ( ! iter . done ) {
while ( items . length < num ) {
let tmp9 = user ;
2026-07-23 10:11:24 +00:00
user = user . getUser ( tmp8 . id ) ;
2026-07-20 16:05:17 +00:00
if ( null != user ) {
let tmp11 = importDefault ;
let tmp12 = dependencyMap ;
2026-07-25 08:10:48 +00:00
let obj2 = importDefault ( 3970 ) ;
2026-07-20 16:05:17 +00:00
let userTag = obj2 . getUserTag ( user ) ;
let tmp14 = userTag ;
if ( null != userTag ) {
obj = { text : userTag , user } ;
let arr = items . push ( obj ) ;
let tmp16 = userTag ;
}
}
let iter2 = tmp6 ( ) ;
let tmp7 = iter2 ;
if ( iter2 . done ) {
break ;
}
}
}
value . results = items ;
( { mode , tokens } = value ) ;
obj = { searchContext , query : value.query , mode , tokens , cursorScope : value.cursorScope , autocompletes : getAutocompleteList ( searchContext , mode , tokens ) } ;
const result = map . set ( searchContextId , stateFactory ( obj ) ) ;
tmp6 . emitChange ( ) ;
}
}
}
}
function setSelectedSearchContext ( searchContext ) {
2026-07-25 08:10:48 +00:00
if ( ! importDefault ( 4277 ) ( closure_18 , searchContext ) ) {
2026-07-20 16:05:17 +00:00
closure_18 = searchContext ;
2026-07-25 08:10:48 +00:00
require ( 10042 ) /* _createForOfIteratorHelperLoose */ . clearTokenCache ( ) ;
const obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
}
function getAutocompleteList ( searchContext , autocompleteMode , tokens ) {
const type = autocompleteMode . type ;
if ( constants . FILTER === type ) {
2026-07-23 10:11:24 +00:00
let obj = { } ;
2026-07-20 16:05:17 +00:00
( { filter : obj.filter , token : obj.currentToken } = autocompleteMode ) ;
obj . searchContext = searchContext ;
2026-07-23 10:11:24 +00:00
obj . maxResults = c22 ;
2026-07-20 16:05:17 +00:00
obj . tokens = tokens ;
2026-07-23 10:11:24 +00:00
const tmp7 = ( function generateFilterResults ( arg0 ) {
2026-07-20 16:05:17 +00:00
let currentToken ;
let filter ;
let maxResults ;
let searchContext ;
( { filter , currentToken , searchContext , maxResults } = arg0 ) ;
let currentUser ;
if ( null == filter ) {
return null ;
} else {
let trimmed ;
if ( null != currentToken ) {
const str = currentToken . getFullMatch ( ) ;
if ( null != str ) {
trimmed = str . trim ( ) ;
}
}
let str2 = "" ;
if ( null != trimmed ) {
str2 = trimmed ;
}
2026-07-23 10:11:24 +00:00
let obj = outer1_0 ( outer1_2 [ 13 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj . isGuildLikeSearchContext ( searchContext ) ) {
2026-07-23 10:11:24 +00:00
if ( outer1_29 ( filter ) ) {
2026-07-20 16:05:17 +00:00
if ( 0 !== str2 . length ) {
2026-07-23 10:11:24 +00:00
const results = outer1_27 ( searchContext ) . results ;
2026-07-20 16:05:17 +00:00
let arr3 = results ;
if ( null != results ) {
arr3 = results ;
2026-07-23 10:11:24 +00:00
if ( outer1_29 ( filter ) ) {
2026-07-20 16:05:17 +00:00
arr3 = results ;
if ( obj3 . isMeAutcompleteAnswer ( str2 ) ) {
2026-07-23 10:11:24 +00:00
currentUser = outer1_13 . getCurrentUser ( ) ;
2026-07-20 16:05:17 +00:00
arr3 = results ;
if ( null != currentUser ) {
const found = results . filter ( ( user ) = > {
user = user . user ;
let id ;
if ( null != user ) {
id = user . id ;
}
return id !== currentUser . id ;
} ) ;
2026-07-23 10:11:24 +00:00
obj = { text : outer1_16 , user : currentUser } ;
2026-07-20 16:05:17 +00:00
found . unshift ( obj ) ;
arr3 = found ;
}
}
2026-07-23 10:11:24 +00:00
obj3 = outer1_0 ( outer1_2 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
let tmp18 = null ;
if ( null != arr3 ) {
tmp18 = null ;
if ( 0 !== arr3 . length ) {
obj = { group : filter , results : arr3 } ;
tmp18 = obj ;
}
}
return tmp18 ;
}
}
}
2026-07-23 10:11:24 +00:00
const tmp9 = outer1_1 ( outer1_2 [ 19 ] ) [ filter ] ;
2026-07-20 16:05:17 +00:00
let getAutocompletions ;
if ( null != tmp9 ) {
getAutocompletions = tmp9 . getAutocompletions ;
}
if ( null != getAutocompletions ) {
const obj1 = { query : str2 , searchContext , maxResults , tokens : tmp } ;
let autocompletions = getAutocompletions ( obj1 ) ;
} else {
autocompletions = [ ] ;
}
}
2026-07-23 10:11:24 +00:00
} ) ( obj ) ;
2026-07-20 16:05:17 +00:00
if ( null != tmp7 ) {
const items = [ tmp7 ] ;
let tmp9 = items ;
} else {
tmp9 = closure_19 ;
}
return tmp9 ;
} else {
return closure_19 ;
}
}
function handleChannelCreateOrDelete() {
2026-07-25 08:10:48 +00:00
require ( 10042 ) /* _createForOfIteratorHelperLoose */ . clearTokenCache ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
function rebuildAutocompleteResults ( c18 ) {
2026-07-20 16:05:17 +00:00
let mode ;
let tokens ;
2026-07-25 08:10:48 +00:00
let obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-23 10:11:24 +00:00
const searchContextId = obj . getSearchContextId ( c18 ) ;
2026-07-20 16:05:17 +00:00
const value = map . get ( searchContextId ) ;
if ( null == value ) {
return false ;
} else {
( { mode , tokens } = value ) ;
2026-07-23 10:11:24 +00:00
obj = { searchContext : c18 , query : value.query , mode , tokens , cursorScope : value.cursorScope , autocompletes : getAutocompleteList ( c18 , mode , tokens ) } ;
2026-07-20 16:05:17 +00:00
const result = map . set ( searchContextId , stateFactory ( obj ) ) ;
}
}
2026-07-23 10:11:24 +00:00
( { SearchPopoutModes : closure_14 , SearchTokenTypes } = ME ) ;
ME = ME . ME ;
require ( "HeaderRecord" ) . AutocompleterResultTypes ;
let c18 = null ;
2026-07-20 16:05:17 +00:00
let closure_19 = [ ] ;
const map = new Map ( ) ;
const map1 = new Map ( ) ;
2026-07-23 10:11:24 +00:00
let c22 = 10 ;
let items = [ , , ] ;
2026-07-20 16:05:17 +00:00
( { FILTER_FROM : arr [ 0 ] , FILTER_IN : arr [ 1 ] , FILTER_MENTIONS : arr [ 2 ] } = SearchTokenTypes ) ;
2026-07-23 10:11:24 +00:00
let set = new Set ( items ) ;
let tmp6 = ( ( Store ) = > {
2026-07-20 16:05:17 +00:00
class SearchAutocompleteStoreClass {
constructor ( ) {
self = this ;
2026-07-23 10:11:24 +00:00
tmp = outer1_3 ( this , SearchAutocompleteStoreClass ) ;
obj = outer1_6 ( SearchAutocompleteStoreClass ) ;
tmp2 = outer1_5 ;
if ( outer1_24 ( ) ) {
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 ( SearchAutocompleteStoreClass , Store ) ;
let obj = {
key : "initialize" ,
value() {
2026-07-23 10:11:24 +00:00
this . waitFor ( outer1_8 , outer1_9 , outer1_10 , outer1_11 , outer1_12 , outer1_13 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
const items = [ obj , , ] ;
obj = {
key : "getState" ,
value ( searchContext ) {
2026-07-23 10:11:24 +00:00
let obj = SearchAutocompleteStoreClass ( outer1_2 [ 13 ] ) ;
let value = outer1_20 . get ( obj . getSearchContextId ( searchContext ) ) ;
2026-07-20 16:05:17 +00:00
if ( null == value ) {
obj = { searchContext , query : "" } ;
2026-07-23 10:11:24 +00:00
obj = { type : outer1_14 . EMPTY , filter : null , token : null } ;
2026-07-20 16:05:17 +00:00
obj . mode = obj ;
obj . tokens = [ ] ;
obj . cursorScope = null ;
obj . autocompletes = [ ] ;
value = obj ;
}
return value ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "getSelectedSearchContext" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_18 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 2 ] = obj ;
return callback ( SearchAutocompleteStoreClass , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( require ( "initialize" ) . Store ) ;
2026-07-20 16:05:17 +00:00
tmp6 . displayName = "SearchAutocompleteStore" ;
2026-07-23 10:11:24 +00:00
tmp6 = new tmp6 ( require ( "dispatcher" ) , {
2026-07-20 16:05:17 +00:00
SEARCH_AUTOCOMPLETE_INITIALIZE : function handleSearchAutocompleteInitialize ( searchContext ) {
searchContext = searchContext . searchContext ;
setSelectedSearchContext ( searchContext ) ;
rebuildAutocompleteResults ( searchContext ) ;
} ,
SEARCH_AUTOCOMPLETE_QUERY_UPDATE : function handleSearchAutocompleteQueryUpdate ( arg0 ) {
let cursorScope ;
let searchContext ;
let tokens ;
( { searchContext , tokens , cursorScope } = arg0 ) ;
setSelectedSearchContext ( searchContext ) ;
2026-07-25 08:10:48 +00:00
let obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
const queryFromTokens = obj . getQueryFromTokens ( tokens ) ;
2026-07-25 08:10:48 +00:00
let obj1 = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
const autocompleteMode = obj1 . getAutocompleteMode ( cursorScope , tokens ) ;
2026-07-25 08:10:48 +00:00
const searchContextId = require ( 10042 ) /* _createForOfIteratorHelperLoose */ . getSearchContextId ( searchContext ) ;
2026-07-20 16:05:17 +00:00
let value = map . get ( searchContextId ) ;
if ( null != value ) {
if ( queryFromTokens === value . query ) {
let autocompletes = value . autocompletes ;
let flag = false ;
}
obj = { searchContext , query : queryFromTokens , mode : autocompleteMode , tokens , cursorScope , autocompletes } ;
const result = map . set ( searchContextId , stateFactory ( obj ) ) ;
return flag ;
}
if ( isUserAutocompleteMode ( autocompleteMode ) ) {
const tmp10 = getOrCreateUserSearchContext ( searchContext ) ;
const token = autocompleteMode . token ;
let trimmed ;
if ( null != token ) {
const str = token . getFullMatch ( ) ;
if ( null != str ) {
trimmed = str . trim ( ) ;
}
}
if ( null != trimmed ) {
if ( trimmed . length > 0 ) {
2026-07-25 08:10:48 +00:00
const guildIdFromSearchContext = require ( 10042 ) /* _createForOfIteratorHelperLoose */ . getGuildIdFromSearchContext ( searchContext ) ;
2026-07-20 16:05:17 +00:00
if ( null != guildIdFromSearchContext ) {
2026-07-25 08:10:48 +00:00
const members = importDefault ( 5048 ) . requestMembers ( guildIdFromSearchContext , trimmed , c22 ) ;
const obj5 = importDefault ( 5048 ) ;
2026-07-20 16:05:17 +00:00
}
const context3 = tmp10 . context ;
obj = { query : trimmed } ;
obj1 = { } ;
let tmp21 ;
if ( null != guildIdFromSearchContext ) {
tmp21 = guildIdFromSearchContext ;
}
obj1 . guild = tmp21 ;
obj . filters = obj1 ;
2026-07-25 08:10:48 +00:00
const obj4 = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
obj . boosters = require ( 4975 ) /* _createForOfIteratorHelperLoose */ . getBoosterMap ( AutocompleterResultTypes . USER ) ;
2026-07-20 16:05:17 +00:00
context3 . setQuery ( obj ) ;
autocompletes = undefined ;
if ( null != value ) {
autocompletes = value . autocompletes ;
}
if ( null == autocompletes ) {
autocompletes = [ ] ;
}
flag = false ;
2026-07-25 08:10:48 +00:00
const obj8 = require ( 4975 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
}
const context2 = tmp10 . context ;
context2 . clearQuery ( ) ;
autocompletes = getAutocompleteList ( searchContext , autocompleteMode , tokens ) ;
flag = true ;
} else {
value = map1 . get ( searchContextId ) ;
if ( null != value ) {
const context = value . context ;
context . clearQuery ( ) ;
value . results = [ ] ;
}
autocompletes = getAutocompleteList ( searchContext , autocompleteMode , tokens ) ;
flag = true ;
}
} ,
2026-07-24 07:16:23 +00:00
SEARCH_QUERY_TEXT_CLEAR : function handleSearchQueryTextClear ( id ) {
2026-07-20 16:05:17 +00:00
id = id . id ;
const value = map1 . get ( id ) ;
if ( null != value ) {
const context = value . context ;
context . destroy ( ) ;
value . results = [ ] ;
map1 . delete ( id ) ;
}
map . delete ( id ) ;
2026-07-23 10:11:24 +00:00
let c18 = null ;
2026-07-20 16:05:17 +00:00
} ,
CHANNEL_CREATE : handleChannelCreateOrDelete ,
CHANNEL_DELETE : handleChannelCreateOrDelete ,
STREAMER_MODE_UPDATE : function handleStreamerModeUpdate() {
2026-07-23 10:11:24 +00:00
let tmp = null != c18 ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = rebuildAutocompleteResults ( c18 ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ,
CHANNEL_SELECT : function handleChannelSelect() {
2026-07-23 10:11:24 +00:00
let tmp = null != c18 ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = rebuildAutocompleteResults ( c18 ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
}
} ) ;
2026-07-23 10:11:24 +00:00
let closure_23 = tmp6 ;
let result = set . fileFinishedImporting ( "modules/search/SearchAutocompleteStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp6 ;