Merge pull request #10 from Re-Ignited-Development/feature/twitter-lua-to-ts

Feature/twitter lua to ts
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2020-10-16 19:55:31 +02:00
commit c2ea00c662
28 files changed
+1028 -738

No files matched your search

@@ -5,6 +5,6 @@ import { useContacts } from "./useContacts";
export const useContactsService = () => {
const setContacts = useSetRecoilState(contactsState.contacts);
useNuiEvent("BANK", "setContacts", setContacts);
useNuiEvent("CONTACTS", "setContacts", setContacts);
return useContacts();
};
@@ -147,7 +147,6 @@ export const AddTweetModal = () => {
const toggleShowEmoji = () => {
// clear the images so we can seemlessly toggle between emoji/images
setShowImagePrompt(false);
setImages([]);
setShowEmoji(!showEmoji);
};
@@ -32,7 +32,7 @@ export function Profile() {
// Annoyingling adding conditionals above this line to not render
// when profile === null results in a react error that different
// amounts of hooks are rendering
const [avatarUrl, handleAvatarChange] = useState(profile.avatar_url);
const [avatarUrl, handleAvatarChange] = useState(profile.avatar_url || "");
const [name, handleNameChange] = useState(profile.profile_name || "");
const [bio, handleBioChange] = useState(profile.bio || "");
const [location, handleLocationChange] = useState(profile.location || "");
@@ -43,7 +43,7 @@ export const useTwitterService = () => {
);
const _setProfile = (profile) => {
setProfile(profile[0]); // server returns an array of 1 profile
setProfile(profile);
};
const _setUpdateProfileSuccess = (isSuccessful) => {
setUpdateProfileSuccess(isSuccessful);
-28
View File
@@ -1,28 +0,0 @@
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNetEvent('phone:sendContacts')
AddEventHandler('phone:sendContacts', function()
ESX.TriggerServerCallback('phone:getContacts', function(contacts)
SendNUIMessage(
{
app = 'BANK',
method = 'setContacts',
data = contacts
}
)
end)
end)
RegisterNUICallback('contacts:add', function(data)
local display = data.name
local number = data.number
TriggerServerEvent('phone:addContacts', display, number)
TriggerEvent('phone:sendContacts')
end)
+20
View File
@@ -0,0 +1,20 @@
import { ESX } from '../client/client';
import events from '../utils/events';
onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
SendNuiMessage(
JSON.stringify({
app: 'CONTACTS',
method: 'setContacts',
data: contacts
})
)
})
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT_NUI);
on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT_NUI}`, (data: any) => {
const display = data.name;
const number = data.number;
emitNet(events.CONTACTS_ADD_CONTACT, display, number);
});
-322
View File
@@ -1,322 +0,0 @@
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterCommand('phone:close', function(source, args, rawCommand)
phoneCloseAnim()
SendNUIMessage({
app = 'PHONE',
method = 'setVisibility',
data = false
})
SetNuiFocus(false, false)
end, false)
-----
--END OF ESX
-----
--RegisterKeyMapping('phone', _U('keymap_phone'), 'keyboard', '') -- Lets people set a keybind for the phone command but can't be implemented yet.
--[[RegisterCommand('phone:get', function(source, args, rawCommand)
riggerServerEvent('phone:server:getCredentials')
end, false)]]
-----
--Start of Phone
----
local prop = 0
local isPhoneOpen = false
local propCreated = false
local phoneModel = "prop_amb_phone" -- Refered to in newphoneProp function. Requires custom phone being streamed.
function newPhoneProp() -- Function for creating the phone prop
deletePhone() -- deletes the already existing prop before creating another.
if propCreated == false then
RequestModel(phoneModel)
while not HasModelLoaded(phoneModel) do
Citizen.Wait(1)
print("MODEL HASNT LOADED")
end
local playerPed = GetPlayerPed(-1)
local x,y,z = table.unpack(GetEntityCoords(playerPed))
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
--prop = CreateObject(GetHashKey(phoneModel), 1.0, 1.0, 1.0, 1, 1, 0)
local boneIndex = GetPedBoneIndex(playerPed, 28422)
AttachEntityToEntity(prop, playerPed, boneIndex, 28422, 0.0, 0.0, 0.0, 0.0, 0.0, -.0, true, true, false, true, 1, true) -- Attaches the phone to the player.
propCreated = true
print("prop created")
elseif propCreated == true then
print("prop already created")
end
end
function deletePhone() -- Triggered in newphoneProp function. Only way to destory the prop correctly.
if prop ~= 0 then
Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(prop))
prop = 0
propCreated = false
print("prop destroyed")
end
end
function loadAnimDict(dict) -- Loads the animation dict. Used in the anim functions.
while ( not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Citizen.Wait(0)
end
end
function phoneOpenAnim() --Phone Open Animation
local flag = 50 -- https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
deletePhone() -- Deleting before creating a new phone where itll be deleted again.
if IsPedInAnyVehicle(GetPlayerPed(-1), true) then -- true refers to at get in.
local dict = 'anim@cellphone@in_car@ps'
local kek = "pepein"
--print(dict)
--print(kek)
ClearPedTasks(GetPlayerPed(-1))
loadAnimDict(dict)
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
Wait(300) -- Gives time for animation starts before creating the phone
--newPhoneProp() -- Creates the phone and attaches it.
else -- While not in a vehicle it will use this dict.
local dict = 'cellphone@'
local kek = "pepeout"
--print(dict)
--print(kek)
ClearPedTasks(GetPlayerPed(-1))
loadAnimDict(dict)
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
Wait(300) -- Gives time for animation starts before creating the phone
newPhoneProp() -- Creates the phone and attaches it.
end
end
function phoneCloseAnim() --Phone Close Animation
local flag = 50 -- https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
local anim = 'cellphone_text_out'
if IsPedInAnyVehicle(GetPlayerPed(-1), true) then -- true refers to at get in.
local dict = 'anim@cellphone@in_car@ps'
local kek = "pepein"
--print(dict)
--print(kek)
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) -- Stop the pull out animation
deletePhone() -- Deletes the prop early incase they get out of the vehicle.
Wait(250) -- lets it get to a certain point
loadAnimDict(dict) -- loads the new animation
TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) -- puts phone into pocket
Wait(200) -- waits until the phone is in the pocket
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) -- clears the animation
else -- While not in a vehicle it will use this dict.
local dict = 'cellphone@'
local kek = "pepeout"
--print(dict)
--print(kek)
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) -- Stop the pull out animation
Wait(100) -- lets it get to a certain point
loadAnimDict(dict) -- loads the new animation
TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) -- puts phone into pocket
Wait(200) -- waits until the phone is in the pocket
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) -- clears the animation
deletePhone() -- Deletes the prop.
end
end
--[[function carryingPhone(cb)
cb(true)
end]]
function carryingPhone(cb)
if (ESX == nil) then return cb(0) end
ESX.TriggerServerCallback('phone:getItemAmount', function(qtty)
cb(qtty > 0)
end, 'phone')
end
function noPhone()
if (ESX == nil) then return end
--exports['mythic_notify']:SendAlert('error', 'Oi Mate, No El Telephono')
ESX.ShowNotification('Oi Mate, No El Telephono')
end
function sendPhoneConfig()
ESX.TriggerServerCallback('phone:phoneConfig', function(config)
SendNUIMessage(
{
app = "PHONE",
method = "phoneConfig",
data = config
}
)
end)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustPressed(1, Config.KeyTogglePhone) then
Phone()
end
end
end)
function Phone() --Open/close phone
if Config.PhoneAsItem == true then
--print("ConfigOn")
carryingPhone(function (carryingPhone)
if carryingPhone == true then
if isPhoneOpen == false then
isPhoneOpen = true
phoneOpenAnim()
print("phone is now open") --Left for testing purposes.
TriggerServerEvent('phone:getCredentials', source)
SetCursorLocation(0.936, 0.922) -- Experimental
local res = GetActiveScreenResolution()
--print(res)
SendNUIMessage( -- Shows phone
{
app = 'PHONE',
method = 'setVisibility',
data = true
}
)
sendPhoneConfig()
SetNuiFocus(true, true)
else
isPhoneOpen = false
print("phone is now closed") --Left for testing purposes.
SendNUIMessage( -- Hides phone
{
app = 'PHONE',
method = 'setVisibility',
data = false
}
)
SetNuiFocus(false, false)
phoneCloseAnim()
end
else
noPhone()
end
end)
elseif Config.PhoneAsItem == false then
--print("ConfigOff")
if isPhoneOpen == false then
isPhoneOpen = true
phoneOpenAnim()
print("phone is now open") --Left for testing purposes.
TriggerServerEvent('phone:getCredentials', source)
SetCursorLocation(0.936, 0.922) -- Experimental
local res = GetActiveScreenResolution()
--print(res)
SendNUIMessage( -- Shows phone
{
app = 'PHONE',
method = 'setVisibility',
data = true
}
)
sendPhoneConfig()
SetNuiFocus(true, true)
else
isPhoneOpen = false
print("phone is now closed") --Left for testing purposes.
SendNUIMessage( -- Hides phone
{
app = 'PHONE',
method = 'setVisibility',
data = false
}
)
SetNuiFocus(false, false)
phoneCloseAnim()
end
end
end
RegisterCommand('phone', function(source) -- Toggles Phone
Phone()
end, false)
RegisterNetEvent('phone:send')
AddEventHandler('phone:send', function()
TriggerEvent('phone:sendContacts')
end)
RegisterNUICallback('phone:close', function() -- Called for when the phone is closed via the UI.
Phone()
end)
RegisterNetEvent('phone:sendCredentials')
AddEventHandler('phone:sendCredentials', function(number)
print(number)
SendNUIMessage(
{
app = "SIMCARD",
method = "setNumber",
data = number
}
)
end)
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
SendNUIMessage(
{
app = 'PHONE',
method = 'setVisibility',
data = false
}
)
SetNuiFocus(false, false)
deletePhone() -- Deletes the phone incase it was attached.
ClearPedTasks(GetPlayerPed(-1)) -- Leave here until launch as it'll fix any stuck animations.
end
end)
------
--Phone Destory When Wet
------
function countPhone(cb)
if (ESX == nil) then
return cb(0)
end
ESX.TriggerServerCallback('phone:removephone', function(qtty)
cb(qtty > 0)
end, 'phone')
end
local destroyedPhone = false
Citizen.CreateThread(function()
while Config.SwimDestroy do -- Checks if phone should destroy while swimming.
Citizen.Wait(Config.RunRate * 1000) -- Checks how often the player is swimming x * 1 second.
if IsPedSwimming(GetPlayerPed(-1)) then
local chance = GetRandomIntInRange(0, 100)
if chance <= Config.DestoryChance then -- Chance of destroying the phone.
countPhone(function (countPhone)
if countPhone == true then
--print("Phone destroyed")
ESX.ShowNotification('Your phone is ruined from the water!')
destroyedPhone = true
end
end)
end
if destroyedPhone == true then -- If the phone was destroyed earlier then we will wait to check again.
Wait(Config.DestroyPhoneReCheck * 60000) -- Waits x * 1 minute before checking again because it's pointless to re check.
end
end
end
end)
+291
View File
@@ -0,0 +1,291 @@
import { ESX } from "../client/client";
import config from '../utils/config';
import { Delay } from '../utils/fivem';
import events from '../utils/events';
RegisterCommand('phone:close', (source: any, args: string[], raw: any) => {
phoneCloseAnim()
SetNuiFocus(false, false)
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
data: false
})
)
}, false);
let prop = 0
let isPhoneOpen = false
let propCreated = false
let phoneModel = "prop_amb_phone" // Refered to in newphoneProp function. Requires custom phone being streamed.
const newPhoneProp = async () => { //Function for creating the phone prop
deletePhone() //deletes the already existing prop before creating another.
if (!propCreated) {
RequestModel(phoneModel)
while (!HasModelLoaded(phoneModel)) {
await Delay(1)
console.log("MODEL HASNT LOADED")
}
const playerPed = PlayerPedId()
const [x, y, z] = GetEntityCoords(playerPed, true);
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
//prop = CreateObject(GetHashKey(phoneModel), 1.0, 1.0, 1.0, 1, 1, 0)
const boneIndex = GetPedBoneIndex(playerPed, 28422)
AttachEntityToEntity(prop, playerPed, boneIndex, 0.0, 0.0, 0.0, 0.0, 0.0, -.0, true, true, false, true, 1.0, true); //-- Attaches the phone to the player.
propCreated = true
console.log("prop created")
}
else if (propCreated) {
console.log("prop already created")
}
}
function deletePhone() { //-- Triggered in newphoneProp function. Only way to destory the prop correctly.
if (prop != 0) {
//Citizen.invokeNative(0xAE3CBE5BF394C9C9 , Citizen.pointerValueIntInitialized(prop))
DeleteEntity(prop);
prop = 0
propCreated = false
console.log("prop destroyed")
}
}
async function loadAnimDict(dict: any) { //-- Loads the animation dict. Used in the anim functions.
while (!HasAnimDictLoaded(dict)) {
RequestAnimDict(dict)
await Delay(100)
}
}
async function phoneOpenAnim() { //Phone Open Animation
const flag = 50 //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
deletePhone() //Deleting before creating a new phone where itll be deleted again.
if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //-- true refers to at get in.
const dict = 'anim@cellphone@in_car@ps'
const kek = "pepein"
ClearPedTasks(GetPlayerPed(-1))
await loadAnimDict(dict)
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
await Delay(300) //Gives time for animation starts before creating the phone
await newPhoneProp() //Creates the phone and attaches it.
}
else { //While not in a vehicle it will use this dict.
const dict = 'cellphone@'
const kek = "pepeout"
ClearPedTasks(GetPlayerPed(-1))
await loadAnimDict(dict)
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
await Delay(300) //Gives time for animation starts before creating the phone
await newPhoneProp() //Creates the phone and attaches it.
}
}
async function phoneCloseAnim() { //Phone Close Animation
const flag = 50 //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
const anim = 'cellphone_text_out'
if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //true refers to at get in.
const dict = 'anim@cellphone@in_car@ps'
const kek = "pepein"
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation
deletePhone() //Deletes the prop early incase they get out of the vehicle.
await Delay(250) //lets it get to a certain point
loadAnimDict(dict) //loads the new animation
TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) //puts phone into pocket
await Delay(200) //waits until the phone is in the pocket
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) //clears the animation
}
else { //While not in a vehicle it will use this dict.
const dict = 'cellphone@'
const kek = "pepeout"
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation
await Delay(100) //lets it get to a certain point
loadAnimDict(dict) //loads the new animation
TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) //puts phone into pocket
await Delay(200) //waits until the phone is in the pocket
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) //clears the animation
deletePhone() //Deletes the prop.
}
}
async function carryingPhone(cb: any) {
if (ESX === null) return cb(0);
ESX.TriggerServerCallback('phone:getItemAmount', (qtty: number) => {
cb(qtty > 0);
}, 'phone');
}
function noPhone() {
if (ESX === null) return;
ESX.ShowNotification('Oi Mate, No El Telephono')
}
function sendPhoneConfig() {
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "phoneConfig",
data: config
})
)
}
setTick(() => {
if (IsControlJustPressed(1, config.KeyTogglePhone)) {
Phone();
}
})
async function Phone() {
if (config.PhoneAsItem) {
carryingPhone(async (carryingPhone: any) => {
if (carryingPhone) {
if (!isPhoneOpen) {
isPhoneOpen = true
await phoneOpenAnim()
console.log("phone is now open") //Left for testing purposes.
emitNet(events.CONTACTS_GET_CONTACTS);
emitNet('phone:getCredentials') // Gets the credentials. Will eventually most likely only get the phone number and name, idk.
SetCursorLocation(0.936, 0.922) //Experimental
let res = GetActiveScreenResolution()
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
data: true
})
)
sendPhoneConfig()
SetNuiFocus(true, true)
}
else {
isPhoneOpen = false
console.log("phone is now closed") //Left for testing purposes.
SendNuiMessage( //Hides phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
data: false
})
)
SetNuiFocus(false, false)
phoneCloseAnim()
}
}
else {
noPhone();
}
})
}
else if (!config.PhoneAsItem) {
if (!isPhoneOpen) {
isPhoneOpen = true
await phoneOpenAnim()
console.log("phone is now open") //Left for testing purposes.
emitNet(events.CONTACTS_GET_CONTACTS);
emitNet('phone:getCredentials')
SetCursorLocation(0.936, 0.922) //Experimental
let res = GetActiveScreenResolution()
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
data: true
})
)
sendPhoneConfig()
SetNuiFocus(true, true)
}
else {
isPhoneOpen = false
console.log("phone is now closed") //Left for testing purposes.
SendNuiMessage( //Hides phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
data: false
})
)
SetNuiFocus(false, false)
await phoneCloseAnim()
}
}
}
RegisterCommand('phone', () => { //-- Toggles Phone
Phone()
}, false)
RegisterNuiCallbackType('phone:close');
on(`__cfx_nui:phone:close`, () => {
Phone();
}) // Called for when the phone is closed via the UI.
AddEventHandler('onResourceStop', function(resource: string) {
if (resource === GetCurrentResourceName()) {
SendNuiMessage(
JSON.stringify({
app: 'PHONE',
method: 'setVisibility',
data: false
})
)
SetNuiFocus(false, false)
deletePhone() //Deletes the phone incase it was attached.
ClearPedTasks(GetPlayerPed(-1)) //Leave here until launch as it'll fix any stuck animations.
}
})
//
//Phone Destory When Wet
//
function countPhone(cb: any) {
if (ESX === null) return cb(0)
ESX.TriggerServerCallback('phone:getItemAmount', (qtty: number) => {
cb(qtty > 0);
}, 'phone');
}
let destroyedPhone = false
setTick(async () => {
while (config.SwimDestroy) {
await Delay(config.RunRate * 1000);
if (IsPedSwimming(PlayerPedId())) {
let chance = Math.floor((Math.random() * 100) + 1);
if (chance <= config.DestoryChance) {
countPhone((countPhone: boolean) => {
if (countPhone) {
ESX.ShowNotification('Your phone is ruined from the water!')
destroyedPhone = true
}
})
}
if (destroyedPhone) {
await Delay(config.DestroyPhoneReCheck * 60000)
}
}
}
})
onNet('phone:sendCredentials', (number: string) => {
SendNuiMessage(
JSON.stringify({
app: "SIMCARD",
method: "setNumber",
data: number
})
)
});
-83
View File
@@ -1,83 +0,0 @@
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
local APP_NAME = 'TWITTER'
function sendTwitterMessage(method, data)
SendNUIMessage(
{
app = APP_NAME,
method = method,
data = data
}
)
end
RegisterNetEvent('phone:fetchTweets')
AddEventHandler('phone:fetchTweets', function()
ESX.TriggerServerCallback('phone:fetchTweets', function(tweets)
sendTwitterMessage('fetchTweets', tweets)
end)
end)
RegisterNetEvent('phone:fetchTweetsFiltered')
AddEventHandler('phone:fetchTweetsFiltered', function(searchValue)
ESX.TriggerServerCallback('phone:fetchTweetsFiltered', function(tweets)
sendTwitterMessage('fetchTweetsFiltered', tweets)
end, searchValue)
end)
RegisterNUICallback('phone:fetchTweets', function()
TriggerEvent('phone:fetchTweets')
end)
RegisterNUICallback('phone:fetchTweetsFiltered', function(searchValue)
TriggerEvent('phone:fetchTweetsFiltered', searchValue)
end)
RegisterNUICallback('phone:createTweet', function(data)
sendTwitterMessage('createTweetLoading', true)
ESX.TriggerServerCallback('phone:createTweet', function(isSuccessful)
sendTwitterMessage('createTweetResult', isSuccessful)
TriggerEvent('phone:fetchTweets')
end, data)
end)
function getOrCreateTwitterProfile()
ESX.TriggerServerCallback('phone:getOrCreateTwitterProfile', function(profile)
sendTwitterMessage('getOrCreateTwitterProfile', profile)
end)
end
-- called directly from the UI on app load
RegisterNUICallback('phone:getOrCreateTwitterProfile', function()
getOrCreateTwitterProfile()
end)
-- called during subsequent updates
RegisterNetEvent('phone:getOrCreateTwitterProfile')
AddEventHandler('phone:getOrCreateTwitterProfile', function()
getOrCreateTwitterProfile()
end)
RegisterNUICallback('phone:updateTwitterProfile', function(data)
sendTwitterMessage('updateProfileLoading', true)
ESX.TriggerServerCallback('phone:updateTwitterProfile', function(result)
sendTwitterMessage('updateProfileResult', result)
TriggerEvent('phone:getOrCreateTwitterProfile')
end, data)
end)
RegisterNUICallback('phone:toggleLike', function(tweetId)
TriggerServerEvent('phone:toggleLike', tweetId)
end)
+93
View File
@@ -0,0 +1,93 @@
import events from '../utils/events';
import { sendTwitterMessage } from '../utils/messages';
/**
* Twitter get or create profile
*/
RegisterNuiCallbackType(events.TWITTER_GET_OR_CREATE_PROFILE);
on(`__cfx_nui:${events.TWITTER_GET_OR_CREATE_PROFILE}`, () => {
emitNet(events.TWITTER_GET_OR_CREATE_PROFILE);
});
onNet(events.TWITTER_GET_OR_CREATE_PROFILE_SUCCESS, (profile: any) => {
sendTwitterMessage(events.TWITTER_GET_OR_CREATE_PROFILE_SUCCESS, profile);
});
onNet(events.TWITTER_GET_OR_CREATE_PROFILE_FAILURE, () => {
sendTwitterMessage(events.TWITTER_GET_OR_CREATE_PROFILE_FAILURE);
});
/**
* Twitter update profile
*/
RegisterNuiCallbackType(events.TWITTER_UPDATE_PROFILE);
on(`__cfx_nui:${events.TWITTER_UPDATE_PROFILE}`, (data: string) => {
sendTwitterMessage(events.TWITTER_UPDATE_PROFILE_LOADING, true);
emitNet(events.TWITTER_UPDATE_PROFILE, data);
});
onNet(events.TWITTER_UPDATE_PROFILE_RESULT, (result: boolean) => {
sendTwitterMessage(events.TWITTER_UPDATE_PROFILE_RESULT, result);
emitNet(events.TWITTER_GET_OR_CREATE_PROFILE);
});
/**
* Twitter fetch tweets
*/
RegisterNuiCallbackType(events.TWITTER_FETCH_TWEETS);
on(`__cfx_nui:${events.TWITTER_FETCH_TWEETS}`, () => {
emitNet(events.TWITTER_FETCH_TWEETS);
});
onNet(events.TWITTER_FETCH_TWEETS_SUCCESS, (tweets: any) => {
sendTwitterMessage(events.TWITTER_FETCH_TWEETS_SUCCESS, tweets);
});
onNet(events.TWITTER_FETCH_TWEETS_FAILURE, () => {
sendTwitterMessage(events.TWITTER_FETCH_TWEETS_FAILURE);
});
/**
* Twitter fetch filtered tweets
*/
RegisterNuiCallbackType(events.TWITTER_FETCH_TWEETS_FILTERED);
on(`__cfx_nui:${events.TWITTER_FETCH_TWEETS_FILTERED}`, (searchValue: string) => {
emitNet(events.TWITTER_FETCH_TWEETS_FILTERED, searchValue);
});
onNet(events.TWITTER_FETCH_TWEETS_FILTERED_SUCCESS, (tweets: any) => {
sendTwitterMessage(events.TWITTER_FETCH_TWEETS_FILTERED_SUCCESS, tweets);
});
onNet(events.TWITTER_FETCH_TWEETS_FILTERED_FAILURE, () => {
sendTwitterMessage(events.TWITTER_FETCH_TWEETS_FILTERED_FAILURE);
});
/**
* Twitter create tweet
*/
RegisterNuiCallbackType(events.TWITTER_CREATE_TWEET);
on(`__cfx_nui:${events.TWITTER_CREATE_TWEET}`, (data: string) => {
sendTwitterMessage(events.TWITTER_CREATE_TWEET_LOADING, true);
emitNet(events.TWITTER_CREATE_TWEET, data);
});
onNet(events.TWITTER_CREATE_TWEET_RESULT, (result: boolean) => {
sendTwitterMessage(events.TWITTER_CREATE_TWEET_RESULT, result);
emitNet(events.TWITTER_FETCH_TWEETS);
});
onNet(events.TWITTER_CREATE_TWEET_FAILURE, () => {
sendTwitterMessage(events.TWITTER_CREATE_TWEET_FAILURE);
});
/**
* Twitter likes
*/
RegisterNuiCallbackType(events.TWITTER_TOGGLE_LIKE);
on(`__cfx_nui:${events.TWITTER_TOGGLE_LIKE}`, (tweetId: number) => {
emitNet(events.TWITTER_TOGGLE_LIKE, tweetId);
});
+7 -2
View File
@@ -1,7 +1,12 @@
let ESX = null;
import { ESXClient } from "fivem-esx-js/client/esx_client";
import './cl_main';
import './cl_twitter';
import './cl_contacts';
export let ESX: ESXClient = null;
setTick(() => {
while (ESX === null) {
emit('esx:getSharedObject', (obj) => ESX = obj);
emit('esx:getSharedObject', (obj: ESXClient) => ESX = obj);
}
});
-1
View File
@@ -1 +0,0 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e){e(()=>{emitNet("helloserver")}),onNet("helloclient",e=>{console.log("The server replied: "+e)})}).call(this,n(2).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(3),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,c,u,a=1,l={},s=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&p(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(c+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return l[a]=o,r(a),a++},d.clearImmediate=m}function m(e){delete l[e]}function p(e){if(s)setTimeout(p,0,e);else{var t=l[e];if(t){s=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{m(e),s=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(0),n(4))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var a,l=[],s=!1,f=-1;function d(){s&&a&&(s=!1,a.length?l=a.concat(l):f=-1,l.length&&m())}function m(){if(!s){var e=u(d);s=!0;for(var t=l.length;t;){for(a=l,l=[];++f<t;)a&&a[f].run();f=-1,t=l.length}a=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arLine truncated
+7 -7
View File
@@ -1,14 +1,14 @@
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=245)}([function(e,t,a){"use strict";e.exports=a(432)},function(e,t,a){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}a.d(t,"a",(function(){return n}))},function(e,t,a){e.exports=a(442)()},function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(37);function r(e,t){if(null==e)return{};var a,r,i=Object(n.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}},function(e,t,a){"use strict";e.exports=a(441)},function(e,t,a){var n=a(14),r=a(25),i=a(42),o=a(39),u=a(47),s=function(e,t,a){var l,f,d,c,_=e&s.F,h=e&s.G,g=e&s.S,m=e&s.P,F=e&s.B,p=h?n:g?n[t]||(n[t]={}):(n[t]||{}).prototype,b=h?r:r[t]||(r[t]={}),y=b.prototype||(b.prototype={});for(l in h&&(a=t),a)d=((f=!_&&p&&void 0!==p[l])?p:a)[l],c=F&&f?u(d,n):m&&"function"==typeof d?u(Function.call,d):d,p&&o(p,l,d,e&s.U),b[l]!=d&&i(b,l,c),m&&y[l]!=d&&(y[l]=d)};n.core=r,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,a){"use strict";function n(e){var t,a,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(a=n(e[t]))&&(r&&(r+=" "),r+=a);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}t.a=function(){for(var e,t,a=0,r="";a<arguments.length;)(e=arguments[a++])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}},function(e,t,a){"use strict";var n=a(1),r=a(3),i=a(0),o=a.n(i),u=(a(2),a(84)),s=a.n(u),l=a(496),f=a(495),d=a(494),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(a){var i=t.defaultTheme,u=t.withTheme,c=void 0!==u&&u,_=t.name,h=Object(r.a)(t,["defaultTheme","withTheme","name"]);var g=_,m=Object(l.a)(e,Object(n.a)({defaultTheme:i,Component:a,name:_||a.displayName,classNamePrefix:g},h)),F=o.a.forwardRef((function(e,t){e.classes;var u,s=e.innerRef,l=Object(r.a)(e,["classes","innerRef"]),h=m(Object(n.a)(Object(n.a)({},a.defaultProps),e)),g=l;return("string"==typeof _||c)&&(u=Object(d.a)()||i,_&&(g=Object(f.a)({theme:u,name:_,props:l})),c&&!g.theme&&(g.theme=u)),o.a.createElement(a,Object(n.a)({ref:s||t,classes:h},g))}));return s()(F,a),F}},_=a(62);t.a=function(e,t){return c(e,Object(n.a)({defaultTheme:_.a},t))}},,function(e,t,a){"use strict";function n(e,t){return function(){return null}}a.r(t),a.d(t,"chainPropTypes",(function(){return n})),a.d(t,"deepmerge",(function(){return r.a})),a.d(t,"elementAcceptingRef",(function(){return s})),a.d(t,"elementTypeAcceptingRef",(function(){return l})),a.d(t,"exactProp",(function(){return f})),a.d(t,"formatMuiErrorMessage",(function(){return d.a})),a.d(t,"getDisplayName",(function(){return p})),a.d(t,"HTMLElementType",(function(){return b})),a.d(t,"ponyfillGlobal",(function(){return y})),a.d(t,"refType",(function(){return k}));var r=a(154),i=a(2),o=a.n(i);var u=(o.a.element,function(){return null});u.isRequired=(o.a.element.isRequired,function(){return null});var s=u;var l=(i.elementType,function(){return null});a(24),a(1);function f(e){return e}var d=a(109),c=a(34),_=a(58),h=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function g(e){var t="".concat(e).match(h);return t&&t[1]||""}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||g(e)||t}function F(e,t,a){var n=m(t);return e.displayName||(""!==n?"".concat(a,"(").concat(n,")"):a)}function p(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return m(e,"Component");if("object"===Object(c.a)(e))switch(e.$$typeof){case _.ForwardRef:return F(e,e.render,"ForwardRef");case _.Memo:return F(e,e.type,"memo");default:return}}}function b(e,t,a,n,r){return null}var y="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k=o.a.oneOfType([o.a.func,o.a.object])},function(e,t,a){"use strict";a.dLine truncated
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=245)}([function(e,t,a){"use strict";e.exports=a(432)},function(e,t,a){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}a.d(t,"a",(function(){return n}))},function(e,t,a){e.exports=a(442)()},function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(37);function r(e,t){if(null==e)return{};var a,r,i=Object(n.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}},function(e,t,a){"use strict";e.exports=a(441)},function(e,t,a){var n=a(14),r=a(25),i=a(42),o=a(39),u=a(47),s=function(e,t,a){var l,f,d,c,_=e&s.F,h=e&s.G,g=e&s.S,m=e&s.P,F=e&s.B,p=h?n:g?n[t]||(n[t]={}):(n[t]||{}).prototype,b=h?r:r[t]||(r[t]={}),y=b.prototype||(b.prototype={});for(l in h&&(a=t),a)d=((f=!_&&p&&void 0!==p[l])?p:a)[l],c=F&&f?u(d,n):m&&"function"==typeof d?u(Function.call,d):d,p&&o(p,l,d,e&s.U),b[l]!=d&&i(b,l,c),m&&y[l]!=d&&(y[l]=d)};n.core=r,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,a){"use strict";function n(e){var t,a,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(a=n(e[t]))&&(r&&(r+=" "),r+=a);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}t.a=function(){for(var e,t,a=0,r="";a<arguments.length;)(e=arguments[a++])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}},function(e,t,a){"use strict";var n=a(1),r=a(3),i=a(0),o=a.n(i),u=(a(2),a(84)),s=a.n(u),l=a(496),f=a(495),d=a(494),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(a){var i=t.defaultTheme,u=t.withTheme,c=void 0!==u&&u,_=t.name,h=Object(r.a)(t,["defaultTheme","withTheme","name"]);var g=_,m=Object(l.a)(e,Object(n.a)({defaultTheme:i,Component:a,name:_||a.displayName,classNamePrefix:g},h)),F=o.a.forwardRef((function(e,t){e.classes;var u,s=e.innerRef,l=Object(r.a)(e,["classes","innerRef"]),h=m(Object(n.a)(Object(n.a)({},a.defaultProps),e)),g=l;return("string"==typeof _||c)&&(u=Object(d.a)()||i,_&&(g=Object(f.a)({theme:u,name:_,props:l})),c&&!g.theme&&(g.theme=u)),o.a.createElement(a,Object(n.a)({ref:s||t,classes:h},g))}));return s()(F,a),F}},_=a(62);t.a=function(e,t){return c(e,Object(n.a)({defaultTheme:_.a},t))}},,function(e,t,a){"use strict";function n(e,t){return function(){return null}}a.r(t),a.d(t,"chainPropTypes",(function(){return n})),a.d(t,"deepmerge",(function(){return r.a})),a.d(t,"elementAcceptingRef",(function(){return s})),a.d(t,"elementTypeAcceptingRef",(function(){return l})),a.d(t,"exactProp",(function(){return f})),a.d(t,"formatMuiErrorMessage",(function(){return d.a})),a.d(t,"getDisplayName",(function(){return p})),a.d(t,"HTMLElementType",(function(){return b})),a.d(t,"ponyfillGlobal",(function(){return y})),a.d(t,"refType",(function(){return k}));var r=a(154),i=a(2),o=a.n(i);var u=(o.a.element,function(){return null});u.isRequired=(o.a.element.isRequired,function(){return null});var s=u;var l=(i.elementType,function(){return null});a(24),a(1);function f(e){return e}var d=a(109),c=a(34),_=a(58),h=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function g(e){var t="".concat(e).match(h);return t&&t[1]||""}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||g(e)||t}function F(e,t,a){var n=m(t);return e.displayName||(""!==n?"".concat(a,"(").concat(n,")"):a)}function p(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return m(e,"Component");if("object"===Object(c.a)(e))switch(e.$$typeof){case _.ForwardRef:return F(e,e.render,"ForwardRef");case _.Memo:return F(e,e.type,"memo");default:return}}}function b(e,t,a,n,r){return null}var y="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k=o.a.oneOfType([o.a.func,o.a.object])},function(e,t,a){"use strict";a.dLine truncated
/*!
* Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),n.forEach((function(t){o(e,t,a[t])}))}return e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=[],n=!0,r=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(n=(o=u.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return a}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}a.d(t,"a",(function(){return Ee})),a.d(t,"b",(function(){return we}));var l=function(){},f={},d={},c={mark:l,measure:l};try{"undefined"!=typeof window&&(f=window),"undefined"!=typeof document&&(d=document),"undefined"!=typeof MutationObserver&&MutationObserver,"undefined"!=typeof performance&&(c=performance)}catch(e){}var _=(f.navigator||{}).userAgent,h=void 0===_?"":_,g=f,m=d,F=c,p=(g.document,!!m.documentElement&&!!m.head&&"function"==typeof m.addEventListener&&"function"==typeof m.createElement),b=(~h.indexOf("MSIE")||h.indexOf("Trident/"),function(){try{}catch(e){return!1}}(),[1,2,3,4,5,6,7,8,9,10]),y=b.concat([11,12,13,14,15,16,17,18,19,20]),k={GROUP:"group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},v=(["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","flip-both","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter",k.GROUP,k.SWAP_OPACITY,k.PRIMARY,k.SECONDARY].concat(b.map((function(e){return"".concat(e,"x")}))).concat(y.map((function(e){return"w-".concat(e)}))),g.FontAwesomeConfig||{});if(m&&"function"==typeof m.querySelector){[["data-family-prefix","familyPrefix"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(e){var t=s(e,2),a=t[0],n=t[1],r=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=m.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(a));null!=r&&(v[n]=r)}))}var w=u({},{familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},v);w.autoReplaceSvg||(w.observeMutations=!1);var E=u({},w);g.FontAwesomeConfig=E;var D=g||{};D.___FONT_AWESOME___||(D.___FONT_AWESOME___={}),D.___FONT_AWESOME___.styles||(D.___FONT_AWESOME___.styles={}),D.___FONT_AWESOME___.hooks||(D.___FONT_AWESOME___.hooks={}),D.___FONT_AWESOME___.shims||(D.___FONT_AWESOME___.shims=[]);var x=D.___FONT_AWESOME___,C=[];p&&((m.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(m.readyState)||m.addEventListener("DOMContentLoaded",(function e(){m.removeEventListener("DOMContentLoaded",e),1,C.map((function(e){return e()}))})));var j,S=function(){},O=void 0!==e&&void 0!==e.process&&"function"==typeof e.process.emit,B=void 0===n?setTimeout:n,q=[];function T(){for(var e=0;e<q.length;e++)q[e][0](q[e][1]);q=[],j=!1}function A(e,t){q.push([e,t]),j||(j=!0,B(T,0))}function P(e){var t=e.owner,a=t._state,n=t._data,r=e[a],i=e.then;if("function"==typeof r){a="fulfilled";try{n=r(n)}catch(e){L(i,e)}}R(i,n)||("fulfilled"===a&&M(i,n),"rejected"===a&&L(i,n))}function R(e,t){var a;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"===r(t))){var n=t.then;if("function"==typeof n)return n.call(t,(function(n){a||(a=!0,t===n?N(e,n):M(e,n))}),(function(t){a||(a=!0,L(e,t))})),!0}}catch(t){return a||L(e,t),!0}return!1}function M(e,t){e!==t&&R(e,t)||N(e,t)}function N(e,t){"pending"===e._state&&(e._state="settled",e._data=t,A(z,e))}function L(e,t){"pending"===e._state&&(e._state="settled",e._data=t,A(W,e))}function I(e){e._then=e._then.forEach(P)}function z(e){e._state="fulfilled",I(e)}function W(t){Line truncated
function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),n.forEach((function(t){o(e,t,a[t])}))}return e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=[],n=!0,r=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(n=(o=u.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return a}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}a.d(t,"a",(function(){return Ee})),a.d(t,"b",(function(){return we}));var l=function(){},f={},d={},c={mark:l,measure:l};try{"undefined"!=typeof window&&(f=window),"undefined"!=typeof document&&(d=document),"undefined"!=typeof MutationObserver&&MutationObserver,"undefined"!=typeof performance&&(c=performance)}catch(e){}var _=(f.navigator||{}).userAgent,h=void 0===_?"":_,g=f,m=d,F=c,p=(g.document,!!m.documentElement&&!!m.head&&"function"==typeof m.addEventListener&&"function"==typeof m.createElement),b=(~h.indexOf("MSIE")||h.indexOf("Trident/"),function(){try{}catch(e){return!1}}(),[1,2,3,4,5,6,7,8,9,10]),y=b.concat([11,12,13,14,15,16,17,18,19,20]),k={GROUP:"group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},v=(["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","flip-both","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter",k.GROUP,k.SWAP_OPACITY,k.PRIMARY,k.SECONDARY].concat(b.map((function(e){return"".concat(e,"x")}))).concat(y.map((function(e){return"w-".concat(e)}))),g.FontAwesomeConfig||{});if(m&&"function"==typeof m.querySelector){[["data-family-prefix","familyPrefix"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(e){var t=s(e,2),a=t[0],n=t[1],r=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=m.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(a));null!=r&&(v[n]=r)}))}var w=u({},{familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},v);w.autoReplaceSvg||(w.observeMutations=!1);var E=u({},w);g.FontAwesomeConfig=E;var D=g||{};D.___FONT_AWESOME___||(D.___FONT_AWESOME___={}),D.___FONT_AWESOME___.styles||(D.___FONT_AWESOME___.styles={}),D.___FONT_AWESOME___.hooks||(D.___FONT_AWESOME___.hooks={}),D.___FONT_AWESOME___.shims||(D.___FONT_AWESOME___.shims=[]);var x=D.___FONT_AWESOME___,C=[];p&&((m.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(m.readyState)||m.addEventListener("DOMContentLoaded",(function e(){m.removeEventListener("DOMContentLoaded",e),1,C.map((function(e){return e()}))})));var j,S=function(){},O=void 0!==e&&void 0!==e.process&&"function"==typeof e.process.emit,B=void 0===n?setTimeout:n,q=[];function T(){for(var e=0;e<q.length;e++)q[e][0](q[e][1]);q=[],j=!1}function A(e,t){q.push([e,t]),j||(j=!0,B(T,0))}function P(e){var t=e.owner,a=t._state,n=t._data,r=e[a],i=e.then;if("function"==typeof r){a="fulfilled";try{n=r(n)}catch(e){L(i,e)}}R(i,n)||("fulfilled"===a&&M(i,n),"rejected"===a&&L(i,n))}function R(e,t){var a;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"===r(t))){var n=t.then;if("function"==typeof n)return n.call(t,(function(n){a||(a=!0,t===n?N(e,n):M(e,n))}),(function(t){a||(a=!0,L(e,t))})),!0}}catch(t){return a||L(e,t),!0}return!1}function M(e,t){e!==t&&R(e,t)||N(e,t)}function N(e,t){"pending"===e._state&&(e._state="settled",e._data=t,A(z,e))}function L(e,t){"pending"===e._state&&(e._state="settled",e._data=t,A(W,e))}function I(e){e._then=e._then.forEach(P)}function z(e){e._state="fulfilled",I(e)}function W(t){Line truncated
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var a,u,s=o(e),l=1;l<arguments.length;l++){for(var f in a=Object(arguments[l]))r.call(a,f)&&(s[f]=a[f]);if(n){u=n(a);for(var d=0;d<u.length;d++)i.call(a,u[d])&&(s[u[d]]=a[u[d]])}}return s}},function(e,t,a){"use strict";var n=a(1),r=a(3),i=a(0),o=(a(2),a(6)),u=a(7),s=a(10),l=i.forwardRef((function(e,t){var a=e.children,u=e.classes,l=e.className,f=e.color,d=void 0===f?"inherit":f,c=e.component,_=void 0===c?"svg":c,h=e.fontSize,g=void 0===h?"default":h,m=e.htmlColor,F=e.titleAccess,p=e.viewBox,b=void 0===p?"0 0 24 24":p,y=Object(r.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return i.createElement(_,Object(n.a)({className:Object(o.a)(u.root,l,"inherit"!==d&&u["color".concat(Object(s.a)(d))],"default"!==g&&u["fontSize".concat(Object(s.a)(g))]),focusable:"false",viewBox:b,color:m,"aria-hidden":!F||void 0,role:F?"img":void 0,ref:t},y),a,F?i.createElement("title",null,F):null)}));l.muiName="SvgIcon",t.a=Object(u.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(l)},function(e,t){var a,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(a===setTimeout)return setTimeout(e,0);if((a===i||!a)&&setTimeout)return a=setTimeout,setTimeout(e,0);try{return a(e,0)}catch(t){try{return a.call(null,e,0)}catch(t){return a.call(this,e,0)}}}!function(){try{a="function"==typeof setTimeout?setTimeout:i}catch(e){a=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,l=[],f=!1,d=-1;function c(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&_())}function _(){if(!f){var e=u(c);f=!0;for(var t=l.length;t;){for(s=l,l=[];++d<t;)s&&s[d].run();d=-1,t=l.length}s=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];l.push(new h(e,t)),1!==l.length||f||u(_)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,a){"use strict";a.r(t);var n=a(198);a.d(t,"default",(function(){return n.a}))},function(e){e.exports=JSON.parse('{"translation":{"COMING_SOON":"Coming soon...","APPS_DIALER":"Phone","APPS_CONTACTS":"Contacts","APPS_MESSAGES":"Messages","APPS_CALCULATOR":"Calculator","APPS_SETTINGS":"Settings","APPS_BANK":"WhoDis Banking","APPS_EXAMPLE":"Example app","APPS_BANK_DEPOSIT":"Deposit","APPS_BANK_WITHDRAW":"Withdraw","APPS_BANK_TRANSFER":"Transfer","APPS_SETTINGS_OPTIONS_WALLPAPER":"Wallpaper","APPS_SETTINGS_OPTIONS_FRAME":"Frame","APPS_TWITTER":"Twitter","APPS_TWITTER_TWEET":"Tweet","APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER":"What\'s happening?","APPS_TWITTER_IMAGE_PLACEHOLDER":"A link to your image or gif","APPS_TWITTER_SUBMIT_IMAGE":"Add Media","APPS_TWITTER_CLOSE_IMAGE":"Close","APPS_TWITTER_CLOSE":"Close","APPS_TWITTER_SEARCH_TWEETS":"Search for tweets","APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER":"Search by profile name or message","APPS_TWITTER_TWEET_MESSAGE_CHAR_Line truncated
*/var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var a,u,s=o(e),l=1;l<arguments.length;l++){for(var f in a=Object(arguments[l]))r.call(a,f)&&(s[f]=a[f]);if(n){u=n(a);for(var d=0;d<u.length;d++)i.call(a,u[d])&&(s[u[d]]=a[u[d]])}}return s}},function(e,t,a){"use strict";var n=a(1),r=a(3),i=a(0),o=(a(2),a(6)),u=a(7),s=a(10),l=i.forwardRef((function(e,t){var a=e.children,u=e.classes,l=e.className,f=e.color,d=void 0===f?"inherit":f,c=e.component,_=void 0===c?"svg":c,h=e.fontSize,g=void 0===h?"default":h,m=e.htmlColor,F=e.titleAccess,p=e.viewBox,b=void 0===p?"0 0 24 24":p,y=Object(r.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return i.createElement(_,Object(n.a)({className:Object(o.a)(u.root,l,"inherit"!==d&&u["color".concat(Object(s.a)(d))],"default"!==g&&u["fontSize".concat(Object(s.a)(g))]),focusable:"false",viewBox:b,color:m,"aria-hidden":!F||void 0,role:F?"img":void 0,ref:t},y),a,F?i.createElement("title",null,F):null)}));l.muiName="SvgIcon",t.a=Object(u.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(l)},function(e,t){var a,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(a===setTimeout)return setTimeout(e,0);if((a===i||!a)&&setTimeout)return a=setTimeout,setTimeout(e,0);try{return a(e,0)}catch(t){try{return a.call(null,e,0)}catch(t){return a.call(this,e,0)}}}!function(){try{a="function"==typeof setTimeout?setTimeout:i}catch(e){a=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,l=[],f=!1,d=-1;function c(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&_())}function _(){if(!f){var e=u(c);f=!0;for(var t=l.length;t;){for(s=l,l=[];++d<t;)s&&s[d].run();d=-1,t=l.length}s=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];l.push(new h(e,t)),1!==l.length||f||u(_)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,a){"use strict";a.r(t);var n=a(199);a.d(t,"default",(function(){return n.a}))},function(e){e.exports=JSON.parse('{"translation":{"COMING_SOON":"Coming soon...","APPS_DIALER":"Phone","APPS_CONTACTS":"Contacts","APPS_MESSAGES":"Messages","APPS_CALCULATOR":"Calculator","APPS_SETTINGS":"Settings","APPS_BANK":"WhoDis Banking","APPS_EXAMPLE":"Example app","APPS_BANK_DEPOSIT":"Deposit","APPS_BANK_WITHDRAW":"Withdraw","APPS_BANK_TRANSFER":"Transfer","APPS_SETTINGS_OPTIONS_WALLPAPER":"Wallpaper","APPS_SETTINGS_OPTIONS_FRAME":"Frame","APPS_TWITTER":"Twitter","APPS_TWITTER_TWEET":"Tweet","APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER":"What\'s happening?","APPS_TWITTER_IMAGE_PLACEHOLDER":"A link to your image or gif","APPS_TWITTER_SUBMIT_IMAGE":"Add Media","APPS_TWITTER_CLOSE_IMAGE":"Close","APPS_TWITTER_CLOSE":"Close","APPS_TWITTER_SEARCH_TWEETS":"Search for tweets","APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER":"Search by profile name or message","APPS_TWITTER_TWEET_MESSAGE_CHAR_Line truncated
/** @license React v16.13.1
* react.production.min.js
*
@@ -16,7 +16,7 @@ object-assign
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var n=a(197),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,f=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.forward_ref"):60112,_=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m="function"==typeof Symbol&&Symbol.iterator;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function y(e,t,a){this.props=e,this.context=t,this.refs=b,this.updater=a||p}function k(){}function v(e,t,a){this.props=e,this.context=t,this.refs=b,this.updater=a||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(F(85));this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=y.prototype;var w=v.prototype=new k;w.constructor=v,n(w,y.prototype),w.isPureReactComponent=!0;var E={current:null},D=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,a){var n,r={},o=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(o=""+t.key),t)D.call(t,n)&&!x.hasOwnProperty(n)&&(r[n]=t[n]);var s=arguments.length-2;if(1===s)r.children=a;else if(1<s){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];r.children=l}if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===r[n]&&(r[n]=s[n]);return{$$typeof:i,type:e,key:o,ref:u,props:r,_owner:E.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var S=/\/+/g,O=[];function B(e,t,a,n){if(O.length){var r=O.pop();return r.result=e,r.keyPrefix=t,r.func=a,r.context=n,r.count=0,r}return{result:e,keyPrefix:t,func:a,context:n,count:0}}function q(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>O.length&&O.push(e)}function T(e,t,a){return null==e?0:function e(t,a,n,r){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case o:s=!0}}if(s)return n(r,t,""===a?"."+A(t,0):a),1;if(s=0,a=""===a?".":a+":",Array.isArray(t))for(var l=0;l<t.length;l++){var f=a+A(u=t[l],l);s+=e(u,f,n,r)}else if(null===t||"object"!=typeof t?f=null:f="function"==typeof(f=m&&t[m]||t["@@iterator"])?f:null,"function"==typeof f)for(t=f.call(t),l=0;!(u=t.next()).done;)s+=e(u=u.value,f=a+A(u,l++),n,r);else if("object"===u)throw n=""+t,Error(F(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return s}(e,"",t,a)}function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function R(e,t,a){var n=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?M(e,n,a,(function(e){return e})):null!=e&&(j(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(S,"$&/")+"/")+a)),n.push(e))}function M(e,t,a,n,r){var i="";null!=a&&(i=(""+a).replace(S,"$&/")+"/"),T(e,R,t=B(t,i,n,r)),q(t)}var N={current:null};function L(){var e=N.current;if(null===e)throw Error(F(321));return e}var I={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:function(e,t,a){if(null==e)return e;var n=[];return M(e,n,null,t,a),n},forEach:function(e,t,a){if(null==e)return e;T(e,P,t=B(null,null,t,a)),q(t)},count:function(e){return T(e,(function(){return null}),null)},toArray:function(e){var t=[];return M(e,t,null,(function(e){return e})),t},only:function(e){if(!j(e))throw Error(F(143));return e}},t.Component=y,t.Fragment=u,t.Profiler=l,t.PureComponent=v,t.StrictMode=s,t.Suspense=_,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,a){if(null==e)throw Error(F(267,e));var r=n({},e.props),o=e.key,u=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(u=t.ref,s=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(f in t)D.call(t,f)&&!x.hasOwnProperty(f)&&(r[f]=void 0===t[f]&&void 0!==l?l[f]:t[f])}var f=arguments.length-2;if(1===f)r.children=a;else if(1<f){l=Array(f);for(var d=0;d<f;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:i,tLine truncated
*/var n=a(198),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,f=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.forward_ref"):60112,_=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m="function"==typeof Symbol&&Symbol.iterator;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function y(e,t,a){this.props=e,this.context=t,this.refs=b,this.updater=a||p}function k(){}function v(e,t,a){this.props=e,this.context=t,this.refs=b,this.updater=a||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(F(85));this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=y.prototype;var w=v.prototype=new k;w.constructor=v,n(w,y.prototype),w.isPureReactComponent=!0;var E={current:null},D=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,a){var n,r={},o=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(o=""+t.key),t)D.call(t,n)&&!x.hasOwnProperty(n)&&(r[n]=t[n]);var s=arguments.length-2;if(1===s)r.children=a;else if(1<s){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];r.children=l}if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===r[n]&&(r[n]=s[n]);return{$$typeof:i,type:e,key:o,ref:u,props:r,_owner:E.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var S=/\/+/g,O=[];function B(e,t,a,n){if(O.length){var r=O.pop();return r.result=e,r.keyPrefix=t,r.func=a,r.context=n,r.count=0,r}return{result:e,keyPrefix:t,func:a,context:n,count:0}}function q(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>O.length&&O.push(e)}function T(e,t,a){return null==e?0:function e(t,a,n,r){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case o:s=!0}}if(s)return n(r,t,""===a?"."+A(t,0):a),1;if(s=0,a=""===a?".":a+":",Array.isArray(t))for(var l=0;l<t.length;l++){var f=a+A(u=t[l],l);s+=e(u,f,n,r)}else if(null===t||"object"!=typeof t?f=null:f="function"==typeof(f=m&&t[m]||t["@@iterator"])?f:null,"function"==typeof f)for(t=f.call(t),l=0;!(u=t.next()).done;)s+=e(u=u.value,f=a+A(u,l++),n,r);else if("object"===u)throw n=""+t,Error(F(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return s}(e,"",t,a)}function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function R(e,t,a){var n=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?M(e,n,a,(function(e){return e})):null!=e&&(j(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(S,"$&/")+"/")+a)),n.push(e))}function M(e,t,a,n,r){var i="";null!=a&&(i=(""+a).replace(S,"$&/")+"/"),T(e,R,t=B(t,i,n,r)),q(t)}var N={current:null};function L(){var e=N.current;if(null===e)throw Error(F(321));return e}var I={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:function(e,t,a){if(null==e)return e;var n=[];return M(e,n,null,t,a),n},forEach:function(e,t,a){if(null==e)return e;T(e,P,t=B(null,null,t,a)),q(t)},count:function(e){return T(e,(function(){return null}),null)},toArray:function(e){var t=[];return M(e,t,null,(function(e){return e})),t},only:function(e){if(!j(e))throw Error(F(143));return e}},t.Component=y,t.Fragment=u,t.Profiler=l,t.PureComponent=v,t.StrictMode=s,t.Suspense=_,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,a){if(null==e)throw Error(F(267,e));var r=n({},e.props),o=e.key,u=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(u=t.ref,s=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(f in t)D.call(t,f)&&!x.hasOwnProperty(f)&&(r[f]=void 0===t[f]&&void 0!==l?l[f]:t[f])}var f=arguments.length-2;if(1===f)r.children=a;else if(1<f){l=Array(f);for(var d=0;d<f;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:i,tLine truncated
/** @license React v16.13.1
* react-dom.production.min.js
*
@@ -24,7 +24,7 @@ object-assign
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var n=a(0),r=a(197),i=a(434);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(o(227));function u(e,t,a,n,r,i,o,u,s){var l=Array.prototype.slice.call(arguments,3);try{t.apply(a,l)}catch(e){this.onError(e)}}var s=!1,l=null,f=!1,d=null,c={onError:function(e){s=!0,l=e}};function _(e,t,a,n,r,i,o,f,d){s=!1,l=null,u.apply(c,arguments)}var h=null,g=null,m=null;function F(e,t,a){var n=e.type||"unknown-event";e.currentTarget=m(a),function(e,t,a,n,r,i,u,c,h){if(_.apply(this,arguments),s){if(!s)throw Error(o(198));var g=l;s=!1,l=null,f||(f=!0,d=g)}}(n,t,void 0,e),e.currentTarget=null}var p=null,b={};function y(){if(p)for(var e in b){var t=b[e],a=p.indexOf(e);if(!(-1<a))throw Error(o(96,e));if(!v[a]){if(!t.extractEvents)throw Error(o(97,e));for(var n in v[a]=t,a=t.eventTypes){var r=void 0,i=a[n],u=t,s=n;if(w.hasOwnProperty(s))throw Error(o(99,s));w[s]=i;var l=i.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&k(l[r],u,s);r=!0}else i.registrationName?(k(i.registrationName,u,s),r=!0):r=!1;if(!r)throw Error(o(98,n,e))}}}}function k(e,t,a){if(E[e])throw Error(o(100,e));E[e]=t,D[e]=t.eventTypes[a].dependencies}var v=[],w={},E={},D={};function x(e){var t,a=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!b.hasOwnProperty(t)||b[t]!==n){if(b[t])throw Error(o(102,t));b[t]=n,a=!0}}a&&y()}var C=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),j=null,S=null,O=null;function B(e){if(e=g(e)){if("function"!=typeof j)throw Error(o(280));var t=e.stateNode;t&&(t=h(t),j(e.stateNode,e.type,t))}}function q(e){S?O?O.push(e):O=[e]:S=e}function T(){if(S){var e=S,t=O;if(O=S=null,B(e),t)for(e=0;e<t.length;e++)B(t[e])}}function A(e,t){return e(t)}function P(e,t,a,n,r){return e(t,a,n,r)}function R(){}var M=A,N=!1,L=!1;function I(){null===S&&null===O||(R(),T())}function z(e,t,a){if(L)return e(t,a);L=!0;try{return M(e,t,a)}finally{L=!1,I()}}var W=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,V=Object.prototype.hasOwnProperty,H={},U={};function G(e,t,a,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=i}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){$[e]=new G(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];$[t]=new G(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){$[e]=new G(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){$[e]=new G(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){$[e]=new G(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){$[e]=new G(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){$[e]=new G(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){$[e]=new G(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){$[e]=new G(e,5,!1,e.toLowerCase(),null,!1)}));var K=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-rLine truncated
*/var n=a(0),r=a(198),i=a(434);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(o(227));function u(e,t,a,n,r,i,o,u,s){var l=Array.prototype.slice.call(arguments,3);try{t.apply(a,l)}catch(e){this.onError(e)}}var s=!1,l=null,f=!1,d=null,c={onError:function(e){s=!0,l=e}};function _(e,t,a,n,r,i,o,f,d){s=!1,l=null,u.apply(c,arguments)}var h=null,g=null,m=null;function F(e,t,a){var n=e.type||"unknown-event";e.currentTarget=m(a),function(e,t,a,n,r,i,u,c,h){if(_.apply(this,arguments),s){if(!s)throw Error(o(198));var g=l;s=!1,l=null,f||(f=!0,d=g)}}(n,t,void 0,e),e.currentTarget=null}var p=null,b={};function y(){if(p)for(var e in b){var t=b[e],a=p.indexOf(e);if(!(-1<a))throw Error(o(96,e));if(!v[a]){if(!t.extractEvents)throw Error(o(97,e));for(var n in v[a]=t,a=t.eventTypes){var r=void 0,i=a[n],u=t,s=n;if(w.hasOwnProperty(s))throw Error(o(99,s));w[s]=i;var l=i.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&k(l[r],u,s);r=!0}else i.registrationName?(k(i.registrationName,u,s),r=!0):r=!1;if(!r)throw Error(o(98,n,e))}}}}function k(e,t,a){if(E[e])throw Error(o(100,e));E[e]=t,D[e]=t.eventTypes[a].dependencies}var v=[],w={},E={},D={};function x(e){var t,a=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!b.hasOwnProperty(t)||b[t]!==n){if(b[t])throw Error(o(102,t));b[t]=n,a=!0}}a&&y()}var C=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),j=null,S=null,O=null;function B(e){if(e=g(e)){if("function"!=typeof j)throw Error(o(280));var t=e.stateNode;t&&(t=h(t),j(e.stateNode,e.type,t))}}function q(e){S?O?O.push(e):O=[e]:S=e}function T(){if(S){var e=S,t=O;if(O=S=null,B(e),t)for(e=0;e<t.length;e++)B(t[e])}}function A(e,t){return e(t)}function P(e,t,a,n,r){return e(t,a,n,r)}function R(){}var M=A,N=!1,L=!1;function I(){null===S&&null===O||(R(),T())}function z(e,t,a){if(L)return e(t,a);L=!0;try{return M(e,t,a)}finally{L=!1,I()}}var W=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,V=Object.prototype.hasOwnProperty,H={},U={};function G(e,t,a,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=i}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){$[e]=new G(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];$[t]=new G(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){$[e]=new G(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){$[e]=new G(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){$[e]=new G(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){$[e]=new G(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){$[e]=new G(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){$[e]=new G(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){$[e]=new G(e,5,!1,e.toLowerCase(),null,!1)}));var K=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-rLine truncated
/** @license React v0.19.1
* scheduler.production.min.js
*
@@ -40,11 +40,11 @@ object-assign
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,_=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,g=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,F=n?Symbol.for("react.lazy"):60116,p=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,k=n?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case c:case o:case s:case u:case h:return e;default:switch(e=e&&e.$$typeof){case f:case _:case F:case m:case l:return e;default:return t}}case i:return t}}}function w(e){return v(e)===c}t.AsyncMode=d,t.ConcurrentMode=c,t.ContextConsumer=f,t.ContextProvider=l,t.Element=r,t.ForwardRef=_,t.Fragment=o,t.Lazy=F,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=u,t.Suspense=h,t.isAsyncMode=function(e){return w(e)||v(e)===d},t.isConcurrentMode=w,t.isContextConsumer=function(e){return v(e)===f},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return v(e)===_},t.isFragment=function(e){return v(e)===o},t.isLazy=function(e){return v(e)===F},t.isMemo=function(e){return v(e)===m},t.isPortal=function(e){return v(e)===i},t.isProfiler=function(e){return v(e)===s},t.isStrictMode=function(e){return v(e)===u},t.isSuspense=function(e){return v(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===s||e===u||e===h||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===F||e.$$typeof===m||e.$$typeof===l||e.$$typeof===f||e.$$typeof===_||e.$$typeof===b||e.$$typeof===y||e.$$typeof===k||e.$$typeof===p)},t.typeOf=v},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,a){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(r.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(r.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},a(452),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(108))},function(e,t,a){(function(e,t){!function(e,a){"use strict";if(!e.setImmediate){var n,r,i,o,u,s=1,l={},f=!1,d=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,a=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=a,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(r=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),n=function(t){e.postMessage(o+t,"*")}),c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a<t.length;a++)t[a]=arguments[a+1];var r={callback:e,args:t};return l[s]=r,n(s),s++},c.clearImmediate=_}function _(e){delete l[e]}function h(e){if(f)setTimeout(h,0,e);else{var t=l[e];if(t){f=!0;try{!function(e){var t=e.callback,a=e.args;switch(a.length){case 0:t();break;case 1:t(a[0]);break;case 2:t(a[0],a[1]);break;case 3:t(a[0],a[1],a[2]);break;default:t.apply(void 0,a)}}(t)}finally{_(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,a(108),a(199))},function(e,t,a){var n=a(454);"stLine truncated
*/var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,_=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,g=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,F=n?Symbol.for("react.lazy"):60116,p=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,k=n?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case c:case o:case s:case u:case h:return e;default:switch(e=e&&e.$$typeof){case f:case _:case F:case m:case l:return e;default:return t}}case i:return t}}}function w(e){return v(e)===c}t.AsyncMode=d,t.ConcurrentMode=c,t.ContextConsumer=f,t.ContextProvider=l,t.Element=r,t.ForwardRef=_,t.Fragment=o,t.Lazy=F,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=u,t.Suspense=h,t.isAsyncMode=function(e){return w(e)||v(e)===d},t.isConcurrentMode=w,t.isContextConsumer=function(e){return v(e)===f},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return v(e)===_},t.isFragment=function(e){return v(e)===o},t.isLazy=function(e){return v(e)===F},t.isMemo=function(e){return v(e)===m},t.isPortal=function(e){return v(e)===i},t.isProfiler=function(e){return v(e)===s},t.isStrictMode=function(e){return v(e)===u},t.isSuspense=function(e){return v(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===s||e===u||e===h||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===F||e.$$typeof===m||e.$$typeof===l||e.$$typeof===f||e.$$typeof===_||e.$$typeof===b||e.$$typeof===y||e.$$typeof===k||e.$$typeof===p)},t.typeOf=v},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,a){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(r.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(r.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},a(452),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(108))},function(e,t,a){(function(e,t){!function(e,a){"use strict";if(!e.setImmediate){var n,r,i,o,u,s=1,l={},f=!1,d=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,a=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=a,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(r=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),n=function(t){e.postMessage(o+t,"*")}),c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a<t.length;a++)t[a]=arguments[a+1];var r={callback:e,args:t};return l[s]=r,n(s),s++},c.clearImmediate=_}function _(e){delete l[e]}function h(e){if(f)setTimeout(h,0,e);else{var t=l[e];if(t){f=!0;try{!function(e){var t=e.callback,a=e.args;switch(a.length){case 0:t();break;case 1:t(a[0]);break;case 2:t(a[0],a[1]);break;case 3:t(a[0],a[1],a[2]);break;default:t.apply(void 0,a)}}(t)}finally{_(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,a(108),a(200))},function(e,t,a){var n=a(454);"stLine truncated
/*!
* Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/var Cr=r.createContext({}),jr=r.forwardRef((function(e,t){var a=e.children,n=e.classes,i=e.className,o=e.disableTypography,u=void 0!==o&&o,s=e.inset,l=void 0!==s&&s,f=e.primary,d=e.primaryTypographyProps,c=e.secondary,_=e.secondaryTypographyProps,h=Object(Ut.a)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),g=r.useContext(Cr).dense,m=null!=f?f:a;null==m||m.type===ta||u||(m=r.createElement(ta,Object(he.a)({variant:g?"body2":"body1",className:n.primary,component:"span",display:"block"},d),m));var F=c;return null==F||F.type===ta||u||(F=r.createElement(ta,Object(he.a)({variant:"body2",className:n.secondary,color:"textSecondary",display:"block"},_),F)),r.createElement("div",Object(he.a)({className:Object(Gt.a)(n.root,i,g&&n.dense,l&&n.inset,m&&F&&n.multiline),ref:t},h),m,F)})),Sr=Object(Xt.a)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(jr),Or=a(208),Br=a.n(Or),qr=a(209),Tr=a.n(qr),Ar=r.forwardRef((function(e,t){var a=e.children,n=e.classes,i=e.className,o=e.component,u=void 0===o?"ul":o,s=e.dense,l=void 0!==s&&s,f=e.disablePadding,d=void 0!==f&&f,c=e.subheader,_=Object(Ut.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),h=r.useMemo((function(){return{dense:l}}),[l]);return r.createElement(Cr.Provider,{value:h},r.createElement(u,Object(he.a)({className:Object(Gt.a)(n.root,i,l&&n.dense,!d&&n.padding,c&&n.subheader),ref:t},_),c,a))})),Pr=Object(Xt.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(Ar),Rr=function(){return(Rr=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Mr=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a},Nr=function(e){var t=Mr(e,[]);return i.a.createElement(Pr,Rr({"aria-label":"list"},t),t.children)};function Lr(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}var Ir="undefined"==typeof window?r.useEffect:r.useLayoutEffect,zr=r.forwardRef((function(e,t){var a=e.alignItems,n=void 0===a?"center":a,i=e.autoFocus,u=void 0!==i&&i,s=e.button,l=void 0!==s&&s,f=e.children,d=e.classes,c=e.className,_=e.component,h=e.ContainerComponent,g=void 0===h?"li":h,m=e.ContainerProps,F=(m=void 0===m?{}:m).className,p=Object(Ut.a)(m,["className"]),b=e.dense,y=void 0!==b&&b,k=e.disabled,v=void 0!==k&&k,w=e.disableGutters,E=void 0!==w&&w,D=e.divider,x=void 0!==D&&D,C=e.focusVisibleClassName,j=e.selected,S=void 0!==j&&j,O=Object(Ut.a)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),B=r.useContext(Cr),q={dense:y||B.dense||!1,alignItems:n},T=r.useRef(null);Ir((function(){u&&T.current&&T.current.focus()}),[u]);var A=r.Children.toArray(f),P=A.length&&Lr(A[A.length-1],["ListItemSecondaryAction"]),R=Oa(r.useCallback((function(e){T.current=o.findDOMNode(e)}),[]),t),M=Object(he.a)({className:Object(Gt.a)(d.root,c,q.dense&&d.dense,!E&&d.gutters,x&&d.divider,v&&d.disabled,l&&d.button,"center"!==n&&d.alignItemsFlexStart,P&&d.secondaryAction,S&&d.selected),disabled:v},O),N=_||"li";return l&&(M.component=_||"div",M.focusVisibleClassName=Object(Gt.a)(d.focusVisible,C),N=Fn),P?(N=M.component||_?N:"div","li"===g&&("li"===N?N="div":"li"===M.component&&(M.component="div")),r.createElement(Cr.Provider,{value:q},r.createElement(g,Object(he.a)({className:Object(Gt.a)(d.container,F),ref:R},p),r.createElement(N,M,A),A.pop()))):r.createElement(Cr.Provider,{value:q},r.createElement(N,Object(he.a)({ref:R},M),A))})),Wr=Object(Xt.a)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoLine truncated
*/var Cr=r.createContext({}),jr=r.forwardRef((function(e,t){var a=e.children,n=e.classes,i=e.className,o=e.disableTypography,u=void 0!==o&&o,s=e.inset,l=void 0!==s&&s,f=e.primary,d=e.primaryTypographyProps,c=e.secondary,_=e.secondaryTypographyProps,h=Object(Gt.a)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),g=r.useContext(Cr).dense,m=null!=f?f:a;null==m||m.type===aa||u||(m=r.createElement(aa,Object(he.a)({variant:g?"body2":"body1",className:n.primary,component:"span",display:"block"},d),m));var F=c;return null==F||F.type===aa||u||(F=r.createElement(aa,Object(he.a)({variant:"body2",className:n.secondary,color:"textSecondary",display:"block"},_),F)),r.createElement("div",Object(he.a)({className:Object($t.a)(n.root,i,g&&n.dense,l&&n.inset,m&&F&&n.multiline),ref:t},h),m,F)})),Sr=Object(Qt.a)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(jr),Or=a(209),Br=a.n(Or),qr=a(210),Tr=a.n(qr),Ar=r.forwardRef((function(e,t){var a=e.children,n=e.classes,i=e.className,o=e.component,u=void 0===o?"ul":o,s=e.dense,l=void 0!==s&&s,f=e.disablePadding,d=void 0!==f&&f,c=e.subheader,_=Object(Gt.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),h=r.useMemo((function(){return{dense:l}}),[l]);return r.createElement(Cr.Provider,{value:h},r.createElement(u,Object(he.a)({className:Object($t.a)(n.root,i,l&&n.dense,!d&&n.padding,c&&n.subheader),ref:t},_),c,a))})),Pr=Object(Qt.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(Ar),Rr=function(){return(Rr=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Mr=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a},Nr=function(e){var t=Mr(e,[]);return i.a.createElement(Pr,Rr({"aria-label":"list"},t),t.children)};function Lr(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}var Ir="undefined"==typeof window?r.useEffect:r.useLayoutEffect,zr=r.forwardRef((function(e,t){var a=e.alignItems,n=void 0===a?"center":a,i=e.autoFocus,u=void 0!==i&&i,s=e.button,l=void 0!==s&&s,f=e.children,d=e.classes,c=e.className,_=e.component,h=e.ContainerComponent,g=void 0===h?"li":h,m=e.ContainerProps,F=(m=void 0===m?{}:m).className,p=Object(Gt.a)(m,["className"]),b=e.dense,y=void 0!==b&&b,k=e.disabled,v=void 0!==k&&k,w=e.disableGutters,E=void 0!==w&&w,D=e.divider,x=void 0!==D&&D,C=e.focusVisibleClassName,j=e.selected,S=void 0!==j&&j,O=Object(Gt.a)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),B=r.useContext(Cr),q={dense:y||B.dense||!1,alignItems:n},T=r.useRef(null);Ir((function(){u&&T.current&&T.current.focus()}),[u]);var A=r.Children.toArray(f),P=A.length&&Lr(A[A.length-1],["ListItemSecondaryAction"]),R=Ba(r.useCallback((function(e){T.current=o.findDOMNode(e)}),[]),t),M=Object(he.a)({className:Object($t.a)(d.root,c,q.dense&&d.dense,!E&&d.gutters,x&&d.divider,v&&d.disabled,l&&d.button,"center"!==n&&d.alignItemsFlexStart,P&&d.secondaryAction,S&&d.selected),disabled:v},O),N=_||"li";return l&&(M.component=_||"div",M.focusVisibleClassName=Object($t.a)(d.focusVisible,C),N=Fn),P?(N=M.component||_?N:"div","li"===g&&("li"===N?N="div":"li"===M.component&&(M.component="div")),r.createElement(Cr.Provider,{value:q},r.createElement(g,Object(he.a)({className:Object($t.a)(d.container,F),ref:R},p),r.createElement(N,M,A),A.pop()))):r.createElement(Cr.Provider,{value:q},r.createElement(N,Object(he.a)({ref:R},M),A))})),Wr=Object(Qt.a)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoLine truncated
/**
* A better abstraction over CSS.
*
+2 -1
View File
@@ -50,8 +50,9 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
`profile_id` int NOT NULL,
`tweet_id` int NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_combination` (`profile_id`,`tweet_id`),
KEY `profile_idx` (`profile_id`),
KEY `tweet_idx` (`tweet_id`),
CONSTRAINT `profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`),
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+4 -1
View File
@@ -16,7 +16,10 @@
"@citizenfx/client": "^1.0.2792-1",
"@citizenfx/server": "^1.0.2792-1",
"@types/node": "^14.0.27",
"fivem-js": "^1.3.1"
"connection-string-parser": "^1.0.3",
"fivem-esx-js": "^0.1.12",
"fivem-js": "^1.3.1",
"mysql2": "^2.2.5"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.8.0",
+22
View File
@@ -0,0 +1,22 @@
import mysql from 'mysql2/promise';
import { ConnectionStringParser } from "connection-string-parser";
const CONNECTION_STRING = 'mysql_connection_string';
// we require set mysql_connection_string "mysql://root:password@localhost/es_extended?charset=utf8mb4" to be set in the config
const mysqlConnectionString = GetConvar(CONNECTION_STRING, null);
if (mysqlConnectionString === null) {
throw new Error(`No connection string provided. make sure ${CONNECTION_STRING} is set in your config.`)
}
const connectionStringParser = new ConnectionStringParser({ scheme: 'mysql', hosts: []});
const connectionOjbect = connectionStringParser .parse(mysqlConnectionString);
export const pool = mysql.createPool({
host: connectionOjbect.hosts[0].host,
user: connectionOjbect.username,
password: connectionOjbect.password,
database: connectionOjbect.endpoint,
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
});
+11 -2
View File
@@ -1,3 +1,12 @@
let ESX = null;
import { ESXServer } from "fivem-esx-js/server/esx_server";
emit('esx:getSharedObject', (obj) => ESX = obj);
import './db';
import './sv_twitter';
import './sv_main';
import './sv_contacts';
export let ESX: ESXServer = null;
emit('esx:getSharedObject', (obj: ESXServer) => ESX = obj);
export const getSource = () => parseInt(source);
-36
View File
@@ -1,36 +0,0 @@
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj)
ESX = obj
end)
ESX.RegisterServerCallback('phone:getContacts', function(source, cb)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
MySQL.Async.fetchAll('SELECT * FROM npwd_phone_contacts WHERE `identifier`=@identifier',
{
['@identifier'] = _identifier
}, function(contacts)
cb(contacts)
print("Contacts:")
for k,v in pairs(contacts) do
print(v.number, v.display)
end
end)
end)
RegisterServerEvent('phone:addContacts')
AddEventHandler('phone:addContacts', function(display, number)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
print(display, number)
MySQL.Async.execute('INSERT INTO npwd_phone_contacts (`identifier`, `number`, `display`) VALUES (@identifier, @number, @display)',
{
identifier = _identifier,
number = number,
display = display
}, function()
end)
end)
+50
View File
@@ -0,0 +1,50 @@
import { ESX } from './server';
import { pool } from './db';
import events from '../utils/events';
interface Contacts {
display: string;
number: string;
}
async function fetchAllContacts(identifier: string) : Promise<Contacts[]> {
const query = "SELECT * FROM npwd_phone_contacts WHERE identifier = ?";
const [ results ] = await pool.query(query, [identifier]);
const contacts = <Contacts[]>results;
return contacts;
}
onNet(events.CONTACTS_GET_CONTACTS, async (callback: any) => {
try {
const _source = (global as any).source;
const xPlayer = ESX.GetPlayerFromId(_source);
const _identifier = xPlayer.getIdentifier();
const contacts = await fetchAllContacts(_identifier);
console.log("Contacts: ")
contacts.forEach(element => {
console.log(element.display, element.number);
});
emitNet(events.CONTACTS_SEND_CONTACTS, _source, contacts)
} catch(error) {
console.log("Failed to fetch contacts: ", error);
}
})
//RegisterServerEvent('phone:addContacts')
//AddEventHandler('phone:addContacts', function(display, number)
// local _source = source
// local xPlayer = ESX.GetPlayerFromId(_source)
// local _identifier = xPlayer.getIdentifier()
// print(display, number)
// MySQL.Async.execute('INSERT INTO npwd_phone_contacts (`identifier`, `number`, `display`) VALUES (@identifier, @number, @display)',
// {
// identifier = _identifier,
// number = number,
// display = display
// }, function()
// end)
//end)
+66
View File
@@ -0,0 +1,66 @@
import { ESX } from './server';
import { pool } from './db';
//db = DatabaseConfig //helper variable for use in server function
//we pass the server configuration to the phone so that we can have phone or
//app specific settings configured by the server owner
//ESX.RegisterServerCallback('phone:phoneConfig', function(source, cb) {
// cb(Config)
//});
interface Credentials {
phone_number: string;
}
async function getCredentials(identifier: string) : Promise<string> {
const query = "SELECT phone_number FROM users WHERE identifier = ?";
const [ result ] = await pool.query(query, [identifier]);
const number = <Credentials[]>result;
if (number.length === 0) return "###-####";
return number[0].phone_number;
}
onNet('phone:getCredentials', async () => {
try {
const _source = (global as any).source;
const xPlayer = ESX.GetPlayerFromId(_source);
const _identifier = xPlayer.getIdentifier();
const number = await getCredentials(_identifier);
emitNet('phone:sendCredentials', _source, number)
} catch (error) {
console.log('Failed to get number. ', error);
};
});
//
//ESX.RegisterServerCallback('phone:getItemAmount', function(source, cb, item)
// local xPlayer = ESX.GetPlayerFromId(source)
// local items = xPlayer.getInventoryItem(item)
//
// if items == nil then
// cb(0)
// else
// cb(items.count)
// end
//end)
//
//----
//--Destroy Phone
//--
//
//ESX.RegisterServerCallback('phone:removephone', function(source, cb, item)
// local xPlayer = ESX.GetPlayerFromId(source)
// local items = xPlayer.getInventoryItem(item)
//
// if items == nil then
// cb(0)
// else
// cb(items.count)
// if items.count > 0 then
// xPlayer.removeInventoryItem('phone', items.count)
// xPlayer.addInventoryItem('dphone', items.count)
// end
// end
//end)
-249
View File
@@ -1,249 +0,0 @@
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj)
ESX = obj
end)
function fetchAllTweets(profileId, cb)
MySQL.Async.fetchAll([[
SELECT
npwd_twitter_profiles.profile_name,
npwd_twitter_profiles.avatar_url,
npwd_twitter_tweets.*,
npwd_twitter_likes.id IS NOT NULL AS isLiked,
TIME_TO_SEC(TIMEDIFF( NOW(), npwd_twitter_tweets.createdAt)) AS seconds_since_tweet
FROM npwd_twitter_tweets
LEFT OUTER JOIN npwd_twitter_profiles ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND npwd_twitter_likes.profile_id = @profileId
WHERE visible = 1
ORDER BY npwd_twitter_tweets.createdAt DESC
LIMIT 100
]],
{ profileId = profileId },
function(tweets)
cb(tweets)
end)
end
function fetchTweetsFiltered(profileId, searchValue, cb)
local searchValueParameterized = '%' .. searchValue .. '%'
MySQL.Async.fetchAll([[
SELECT
npwd_twitter_profiles.profile_name,
npwd_twitter_profiles.avatar_url,
npwd_twitter_tweets.*,
npwd_twitter_likes.id IS NOT NULL AS isLiked,
TIME_TO_SEC(TIMEDIFF( NOW(), npwd_twitter_tweets.createdAt)) AS seconds_since_tweet
FROM npwd_twitter_tweets
LEFT OUTER JOIN npwd_twitter_profiles ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND npwd_twitter_likes.profile_id = @profileId
WHERE visible = 1 AND (npwd_twitter_profiles.profile_name LIKE @profile_name OR npwd_twitter_tweets.message LIKE @message)
ORDER BY npwd_twitter_tweets.createdAt DESC
LIMIT 100
]],
{
profileId = profileId,
profile_name = searchValueParameterized,
message = searchValueParameterized
},
function(tweets)
cb(tweets)
end)
end
ESX.RegisterServerCallback('phone:fetchTweets', function(source, cb)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
getProfile(_identifier, function(result)
local profile = result[1]
fetchAllTweets(profile.id, cb)
end)
end)
-- search value expected to be lower case
ESX.RegisterServerCallback('phone:fetchTweetsFiltered', function(source, cb, searchValue)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
getProfile(_identifier, function(result)
local profile = result[1]
fetchTweetsFiltered(profile.id, searchValue, cb)
end)
end)
ESX.RegisterServerCallback('phone:createTweet', function(source, cb, data)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
MySQL.Async.transaction({[[
INSERT INTO npwd_twitter_tweets (`identifier`, `message`, `images`)
VALUES (@identifier, @message, @images)
]]},
{
identifier = _identifier,
message = data.message,
images = data.images
},
function(result)
cb(result)
end)
end)
function getProfile(identifier, cb)
MySQL.Async.fetchAll([[
SELECT * FROM npwd_twitter_profiles
WHERE identifier = @identifier
LIMIT 1
]],
{ identifier = identifier },
function(result)
cb(result)
end)
end
function getProfileName(identifier, cb)
local defaultProfileName = ''
if Config.twitter.generateProfileNameFromUsers == false then
cb(defaultProfileName)
return
end
-- TODO: make this query configurable
MySQL.Async.fetchAll([[
SELECT CONCAT(firstname, '_', lastname) AS profile_name
FROM users
WHERE identifier = @identifier LIMIT 1
]],
{ identifier = identifier },
function(users)
if next(users) == nil then -- no user found with this identifier
cb(defaultProfileName)
return
end
cb(users[1].profile_name)
end)
end
function createDefaultProfile(identifier, cb)
getProfileName(identifier, function(profileName)
MySQL.Async.execute([[
INSERT INTO npwd_twitter_profiles (`identifier`, `profile_name`)
VALUES (@identifier, @profile_name)
]],
{ identifier = identifier, profile_name = profileName },
function(result)
if result == 1 then -- if we created the profile then return it
getProfile(identifier, cb)
else -- otherwise just give back the failed result
cb(result)
end
end)
end)
end
-- Retrieve a twitter profile by identifier. If it does not exist then
-- create and return it
function getOrCreateProfile(identifier, cb)
getProfile(identifier, function(retrieveResult)
if next(retrieveResult) == nil then -- profile does not exist, attempt to create it
createDefaultProfile(identifier, function(createResult)
cb(createResult)
end)
else -- profile does exist
cb(retrieveResult)
end
end)
end
ESX.RegisterServerCallback('phone:getOrCreateTwitterProfile', function(source, cb)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
getOrCreateProfile(_identifier, function(result)
cb(result)
end)
end)
function updateTwitterProfile(identifier, data, cb)
MySQL.Async.transaction({[[
UPDATE npwd_twitter_profiles
SET avatar_url = @avatar_url, profile_name = @profile_name, bio = @bio, location = @location, job = @job
WHERE identifier = @identifier
]]},
{
identifier = identifier,
avatar_url= data.avatar_url,
profile_name = data.profile_name,
bio = data.bio,
location = data.location,
job = data.job,
},
function(result)
cb(result)
end)
end
ESX.RegisterServerCallback('phone:updateTwitterProfile', function(source, cb, data)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
updateTwitterProfile(_identifier, data, function(result)
cb(result)
end)
end)
function doesLikeExist(profileId, tweetId, cb)
MySQL.Async.fetchAll([[
SELECT * FROM npwd_twitter_likes
WHERE profile_id = @profileId AND tweet_id = @tweetId
LIMIT 1
]],
{ profileId = profileId, tweetId = tweetId },
function(result)
cb(result)
end)
end
function createLike(profileId, tweetId)
MySQL.Async.execute([[
INSERT INTO npwd_twitter_likes (`profile_id`, `tweet_id`)
VALUES (@profileId, @tweetId)
]],
{ profileId = profileId, tweetId = tweetId })
end
function deleteLike(profileId, tweetId)
MySQL.Async.execute([[
DELETE FROM npwd_twitter_likes
WHERE profile_id = @profileId AND tweet_id = @tweetId
]],
{ profileId = profileId, tweetId = tweetId })
end
RegisterServerEvent('phone:toggleLike')
AddEventHandler('phone:toggleLike', function(tweetId)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
getProfile(_identifier, function(result)
local profile = result[1]
doesLikeExist(profile.id, tweetId, function(result)
if next(result) == nil then -- like doesn't exist
createLike(profile.id, tweetId)
else -- like does exist
deleteLike(profile.id, tweetId)
end
end)
end)
end)
+284
View File
@@ -0,0 +1,284 @@
import { pool } from './db';
import { ESX, getSource } from './server';
import events from '../utils/events';
import config from '../utils/config';
interface Profile {
id: number;
profile_name: string;
identifier: string;
avatar_url?: string;
bio?: string;
location?: string;
job?: string;
createdAt: string;
updatedAt: string;
}
interface ProfileName {
profile_name: string;
}
interface Tweet {
id: number;
profile_name?: string;
avatar_url?: string;
message: string;
createdAt?: string;
updatedAt?: string;
images?: string;
likes?: number;
}
/**
* Retrieve the latest 100 tweets
* @param profileId - twitter profile id of the player
*/
async function fetchAllTweets(profileId: number): Promise<Tweet[]> {
const query = `
SELECT
npwd_twitter_profiles.profile_name,
npwd_twitter_profiles.avatar_url,
npwd_twitter_tweets.*,
npwd_twitter_likes.id IS NOT NULL AS isLiked,
TIME_TO_SEC(TIMEDIFF( NOW(), npwd_twitter_tweets.createdAt)) AS seconds_since_tweet
FROM npwd_twitter_tweets
LEFT OUTER JOIN npwd_twitter_profiles ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND npwd_twitter_likes.profile_id = ?
WHERE visible = 1
ORDER BY npwd_twitter_tweets.createdAt DESC
LIMIT 100
`;
const [ results ] = await pool.query(query, [profileId]);
const tweets = <Tweet[]>results;
return tweets;
}
/**
* Fetch tweets by some search value submitted by the user. Intended to let
* player's search for tweets by profile, message or more.
* @param profileId - twitter profile id of the player
* @param searchValue - value to search
*/
async function fetchTweetsFiltered(profileId: number, searchValue: string): Promise<Tweet[]> {
const parameterizedSearchValue = `%${searchValue}%`;
const query = `
SELECT
npwd_twitter_profiles.profile_name,
npwd_twitter_profiles.avatar_url,
npwd_twitter_tweets.*,
npwd_twitter_likes.id IS NOT NULL AS isLiked,
TIME_TO_SEC(TIMEDIFF( NOW(), npwd_twitter_tweets.createdAt)) AS seconds_since_tweet
FROM npwd_twitter_tweets
LEFT OUTER JOIN npwd_twitter_profiles ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND npwd_twitter_likes.profile_id = ?
WHERE visible = 1 AND (npwd_twitter_profiles.profile_name LIKE ? OR npwd_twitter_tweets.message LIKE ?)
ORDER BY npwd_twitter_tweets.createdAt DESC
LIMIT 100
`;
const [ results ] = await pool.query(query, [profileId, parameterizedSearchValue, parameterizedSearchValue]);
const tweets = <Tweet[]>results;
return tweets;
}
/**
* Creates a tweet in the database
* @param identifier - player identifier
* @param tweet - tweet to be created
*/
async function createTweet(identifier: string, tweet: Tweet): Promise<any> {
const query = `
INSERT INTO npwd_twitter_tweets (identifier, message, images)
VALUES (?, ?, ?)
`
await pool.query(query, [identifier, tweet.message, tweet.images])
}
/**
* Retrieve a player's twitter profile by their identifier
* @param identifier - player identifier
*/
async function getProfile(identifier: string): Promise<Profile | null> {
const query = `
SELECT * FROM npwd_twitter_profiles
WHERE identifier = ?
LIMIT 1
`;
const [ results ] = await pool.query(query, [identifier]);
const profiles = <Profile[]>results;
return profiles.length > 0 ? profiles[0] : null;
}
/**
* Generate a twitter profile name by the player's name
* @param identifier - player's identifier
*/
async function generateProfileName(identifier: string): Promise<string> {
const defaultProfileName = '';
if (!config.twitter.generateProfileNameFromUsers) return defaultProfileName;
const query = `
SELECT CONCAT(firstname, '_', lastname) AS profile_name
FROM users
WHERE identifier = ? LIMIT 1
`
const [ results ] = await pool.query(query, [identifier]);
const profileNames = <ProfileName[]>results;
if (profileNames.length === 0) return defaultProfileName;
return profileNames[0].profile_name;
}
/**
* Create a default twitter profile for a player. This is the intial profile
* that all player's will receive and can then customize.
* @param identifier - player's identifier
*/
async function createDefaultProfile(identifier: string): Promise<Profile> {
const profileName = await generateProfileName(identifier);
const query = `
INSERT INTO npwd_twitter_profiles (identifier, profile_name)
VALUES (?, ?)
`
const [ result ] = await pool.execute(query, [identifier, profileName]);
return getProfile(identifier);
}
/**
* Retrieve the player's profile by their identifier if it exists. If
* not, create it and return it.
* @param identifier - player's identifier
*/
async function getOrCreateProfile(identifier: string): Promise<Profile> {
const profile = await getProfile(identifier);
return profile || await createDefaultProfile(identifier);
}
async function updateProfile(identifier: string, profile: Profile) {
const { avatar_url, profile_name, bio, location, job } = profile;
const query = `
UPDATE npwd_twitter_profiles
SET avatar_url = ?, profile_name = ?, bio = ?, location = ?, job = ?
WHERE identifier = ?
`
await pool.execute(query, [
avatar_url,
profile_name,
bio,
location,
job,
identifier
]);
}
/**
* Create a "like" in the database that ties a profile & tweet together
* @param profileId - primary key of the profile conducting the like
* @param tweetId - primary key of the tweet being liked
*/
async function createLike(profileId: number, tweetId: number): Promise<void> {
const query = `
INSERT INTO npwd_twitter_likes (profile_id, tweet_id)
VALUES (?, ?)
`
await pool.execute(query, [profileId, tweetId]);
}
/**
* Delete a "like" relationship from the database
* @param profileId - primary key of the profile removing the like
* @param tweetId - primary key of the tweet to remove the like from
*/
async function deleteLike(profileId: number, tweetId: number): Promise<void> {
const query = `
DELETE FROM npwd_twitter_likes
WHERE profile_id = ? AND tweet_id = ?
`
await pool.execute(query, [profileId, tweetId]);
}
/**
* Check if a "like" relationship between a profile and a tweet exists
* @param profileId - primary key of the profile to check
* @param tweetId - primary key of the tweet to check
*/
async function doesLikeExist(profileId: number, tweetId: number): Promise<boolean> {
const query = `
SELECT * FROM npwd_twitter_likes
WHERE profile_id = ? AND tweet_id = ?
LIMIT 1
`
const [ results ] = await pool.query(query, [profileId, tweetId]);
const likes = <any[]>results;
return likes.length > 0;
}
onNet(events.TWITTER_GET_OR_CREATE_PROFILE, async () => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
const profile = await getOrCreateProfile(identifier)
emitNet(events.TWITTER_GET_OR_CREATE_PROFILE_SUCCESS, getSource(), profile);
} catch (e) {
emitNet(events.TWITTER_GET_OR_CREATE_PROFILE_FAILURE, getSource());
}
});
onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
await updateProfile(identifier, profile)
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, getSource(), true);
} catch (e) {
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, getSource(), false);
}
});
onNet(events.TWITTER_FETCH_TWEETS, async () => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
const profile = await getProfile(identifier);
const tweets = await fetchAllTweets(profile.id);
emitNet(events.TWITTER_FETCH_TWEETS_SUCCESS, getSource(), tweets);
} catch (e) {
emitNet(events.TWITTER_FETCH_TWEETS_FAILURE, getSource());
}
});
onNet(events.TWITTER_FETCH_TWEETS_FILTERED, async (searchValue: string) => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
const profile = await getProfile(identifier);
const tweets = await fetchTweetsFiltered(profile.id, searchValue);
emitNet(events.TWITTER_FETCH_TWEETS_FILTERED_SUCCESS, getSource(), tweets);
} catch (e) {
emitNet(events.TWITTER_FETCH_TWEETS_FILTERED_FAILURE, getSource());
}
});
onNet(events.TWITTER_CREATE_TWEET, async (tweet: Tweet) => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
await createTweet(identifier, tweet);
emitNet(events.TWITTER_CREATE_TWEET_RESULT, getSource(), true);
} catch (e) {
emitNet(events.TWITTER_CREATE_TWEET_RESULT, getSource(), false);
}
});
onNet(events.TWITTER_TOGGLE_LIKE, async (tweetId: number) => {
try {
const identifier = ESX.GetPlayerFromId(getSource()).getIdentifier();
const profile = await getOrCreateProfile(identifier)
const likeExists = await doesLikeExist(profile.id, tweetId);
if (likeExists) {
await deleteLike(profile.id, tweetId);
} else {
await createLike(profile.id, tweetId);
}
emitNet(events.TWITTER_TOGGLE_LIKE_SUCCESS, getSource());
} catch (e) {
emitNet(events.TWITTER_TOGGLE_LIKE_FAILURE, getSource());
}
});
+3
View File
@@ -0,0 +1,3 @@
export default {
TWITTER: 'TWITTER',
}
+23
View File
@@ -0,0 +1,23 @@
export default {
Locale: 'en',
KeyTogglePhone: 288,
KeyTakeCall: 38,
PhoneAsItem: false,
// destroy phone
SwimDestroy: false,
RunRate: 10,
DestoryChance: 100,
DestroyPhoneReCheck: 3,
// twitter app
twitter: {
generateProfileNameFromUsers: true,
characterLimit: 240,
allowEdtiableProfileName: true,
enableAvatars: true,
enableEmojis: true,
enableImages: true,
maxImages: 3,
}
};
+28
View File
@@ -0,0 +1,28 @@
export default {
// Twitter
TWITTER_FETCH_TWEETS: 'phone:fetchTweets',
TWITTER_FETCH_TWEETS_SUCCESS: 'fetchTweets',
TWITTER_FETCH_TWEETS_FAILURE: 'fetchTweetsFailed',
TWITTER_FETCH_TWEETS_FILTERED: 'phone:fetchTweetsFiltered',
TWITTER_FETCH_TWEETS_FILTERED_SUCCESS: 'fetchTweetsFiltered',
TWITTER_FETCH_TWEETS_FILTERED_FAILURE: 'fetchTweetsFilteredFailed',
TWITTER_GET_OR_CREATE_PROFILE: 'phone:getOrCreateTwitterProfile',
TWITTER_GET_OR_CREATE_PROFILE_SUCCESS: 'getOrCreateTwitterProfile',
TWITTER_GET_OR_CREATE_PROFILE_FAILURE: 'getOrCreateTwitterProfileFailed',
TWITTER_UPDATE_PROFILE: 'phone:updateTwitterProfile',
TWITTER_UPDATE_PROFILE_LOADING: 'updateProfileLoading',
TWITTER_UPDATE_PROFILE_RESULT: 'updateProfileResult',
TWITTER_CREATE_TWEET: 'phone:createTweet',
TWITTER_CREATE_TWEET_LOADING: 'createTweetLoading',
TWITTER_CREATE_TWEET_RESULT: 'createTweetResult',
TWITTER_CREATE_TWEET_FAILURE: 'createTweetResultFailed',
TWITTER_TOGGLE_LIKE: 'phone:toggleLike',
TWITTER_TOGGLE_LIKE_SUCCESS: 'toggleLikeSuccess',
TWITTER_TOGGLE_LIKE_FAILURE: 'toggleLikeFailed',
// Contacts
CONTACTS_SEND_CONTACTS: 'phone:sendContacts',
CONTACTS_GET_CONTACTS: 'phone:getContacts',
CONTACTS_ADD_CONTACT_NUI: 'contacts:add',
CONTACTS_ADD_CONTACT: 'phone:addContacts'
}
+2
View File
@@ -0,0 +1,2 @@
// https://forum.cfx.re/t/typescript-vs-lua-questions/612483/11
export const Delay = (ms: number) => new Promise(res => setTimeout(res, ms));
+13
View File
@@ -0,0 +1,13 @@
import apps from './apps';
function sendMessage(app: string, method: string, data: any) {
return SendNuiMessage(JSON.stringify({
app,
method,
data,
}))
}
export function sendTwitterMessage(method: string, data: any = {}) {
return sendMessage(apps.TWITTER, method, data);
}
+99 -2
View File
@@ -23,6 +23,11 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
"@citizenfx/client@^1.0.1688-1":
version "1.0.1688-1"
resolved "https://registry.yarnpkg.com/@citizenfx/client/-/client-1.0.1688-1.tgz#360c5db391cf9662b81129b84eaa35299d604ef5"
integrity sha512-RUnWSBalc888c/HheM+aOu6oHCa1QDmCzbgyldyLQfcq2B8uPfrKkogZenC3iR0vBB/bTdb+2NU4q/VhIU4V4Q==
"@citizenfx/client@^1.0.2792-1":
version "1.0.2792-1"
resolved "https://registry.yarnpkg.com/@citizenfx/client/-/client-1.0.2792-1.tgz#eaaaf13154ba9a010a896bdc516a09578214ef28"
@@ -953,6 +958,13 @@ concat-stream@^1.5.0:
readable-stream "^2.2.2"
typedarray "^0.0.6"
connection-string-parser@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/connection-string-parser/-/connection-string-parser-1.0.3.tgz#506d2dbb1f37303081451b6f3a67a7b6ce083c8a"
integrity sha512-JTfzMX4NkL/kN8PqncU2NXqrIHShyzcG0KQCN+otUtWmuMhpnQuG3wihyNJw3OtbJOXPKwDoI+q8AKMhui/GFQ==
dependencies:
tslib "^1.10.0"
console-browserify@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
@@ -1128,6 +1140,11 @@ define-property@^2.0.2:
is-descriptor "^1.0.2"
isobject "^3.0.1"
denque@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf"
integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==
des.js@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843"
@@ -1565,6 +1582,14 @@ findup-sync@^3.0.0:
micromatch "^3.0.4"
resolve-dir "^1.0.1"
fivem-esx-js@^0.1.12:
version "0.1.12"
resolved "https://registry.yarnpkg.com/fivem-esx-js/-/fivem-esx-js-0.1.12.tgz#269bdfef84ed1500f19eb5f2fb7087f5cb5e5353"
integrity sha512-gUSt9lll66FVBuNYP5kJVuXwU5jjg2rAaldembGRHJTAHd1WdMRIPF9899omUeJf4m4ToyfekxjcYtbttLrIJg==
dependencies:
"@citizenfx/client" "^1.0.1688-1"
fivem-js "^1.3.1"
fivem-js@^1.3.1:
version "1.4.0"
resolved "https://registry.yarnpkg.com/fivem-js/-/fivem-js-1.4.0.tgz#3e844001719e6e80108ca8edbc3d8afc6c208ad8"
@@ -1656,6 +1681,13 @@ functional-red-black-tree@^1.0.1:
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
generate-function@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f"
integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==
dependencies:
is-property "^1.0.2"
get-caller-file@^2.0.1:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
@@ -1849,6 +1881,13 @@ https-browserify@^1.0.0:
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
iconv-lite@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01"
integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
ieee754@^1.1.4:
version "1.1.13"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
@@ -2063,6 +2102,11 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4:
dependencies:
isobject "^3.0.1"
is-property@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=
is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
@@ -2219,7 +2263,12 @@ lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
lru-cache@^4.0.0:
long@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
lru-cache@^4.0.0, lru-cache@^4.1.3:
version "4.1.5"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
@@ -2234,6 +2283,13 @@ lru-cache@^5.1.1:
dependencies:
yallist "^3.0.2"
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
make-dir@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
@@ -2419,6 +2475,27 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
mysql2@^2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/mysql2/-/mysql2-2.2.5.tgz#72624ffb4816f80f96b9c97fedd8c00935f9f340"
integrity sha512-XRqPNxcZTpmFdXbJqb+/CtYVLCx14x1RTeNMD4954L331APu75IC74GDqnZMEt1kwaXy6TySo55rF2F3YJS78g==
dependencies:
denque "^1.4.1"
generate-function "^2.3.1"
iconv-lite "^0.6.2"
long "^4.0.0"
lru-cache "^6.0.0"
named-placeholders "^1.1.2"
seq-queue "^0.0.5"
sqlstring "^2.3.2"
named-placeholders@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/named-placeholders/-/named-placeholders-1.1.2.tgz#ceb1fbff50b6b33492b5cf214ccf5e39cef3d0e8"
integrity sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==
dependencies:
lru-cache "^4.1.3"
nan@^2.12.1:
version "2.14.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
@@ -3052,7 +3129,7 @@ safe-regex@^1.1.0:
dependencies:
ret "~0.1.10"
safer-buffer@^2.1.0:
"safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
@@ -3090,6 +3167,11 @@ semver@^7.2.1, semver@^7.3.2:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
seq-queue@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e"
integrity sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=
serialize-javascript@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
@@ -3254,6 +3336,11 @@ sprintf-js@~1.0.2:
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
sqlstring@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.2.tgz#cdae7169389a1375b18e885f2e60b3e460809514"
integrity sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg==
ssri@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8"
@@ -3491,6 +3578,11 @@ ts-loader@^8.0.2:
micromatch "^4.0.0"
semver "^6.0.0"
tslib@^1.10.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^1.8.1, tslib@^1.9.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.0.tgz#d624983f3e2c5e0b55307c3dd6c86acd737622c6"
@@ -3800,6 +3892,11 @@ yallist@^3.0.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
yargs-parser@^13.1.2:
version "13.1.2"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"