game:DefineFastFlag("AvatarMoodSearchForReplacementWhenRemovingAnimator", false);
game:DefineFastFlag("AvatarMoodValidateMoodAnimation", false);
local l_Players_0 = game:GetService("Players");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
local _ = require(l_CoreGui_0:WaitForChild("RobloxGui").Modules.Logger):new(script.Name);
local v4 = nil;
local v5 = nil;
local v6 = nil;
local l_Core_0 = Enum.AnimationPriority.Core;
local v8 = nil;
local v9 = true;
local v10 = false;
local v11 = {};
local v12 = {
    EmoteStopped = "currentEmoteTrackStopped",
    EmoteKeyframeReached = "emoteKeyframeReached",
    AnimationInstanceChanged = "animationInstanceChanged",
    EmoteTriggered = "localEmote",
    AnimateScriptAdded = "animateScriptAdded",
    AnimateScriptMoodAdded = "animateScriptMoodAdded",
    AnimateScriptMoodRemoved = "animateScriptMoodRemoved",
    MoodChildAdded = "moodChildAdded",
    HeadChildAdded = "headChildAdded",
    CharacterHumanoidAdded = "characterHumanoidAdded",
    HumanoidAnimatorAdded = "humanoidAnimatorAdded",
    CharacterChildAdded = "characterChildAdded",
    CharacterChildRemoved = "characterChildRemoved",
    DescendantAdded = "DescendantAdded",
    DescendantRemoving = "DescendantRemoving",
    AnimationStreamTrackPlayed = "AnimationStreamTrackPlayed",
    StreamTrackStopped = "StreamTrackStopped"
};
local v13 = {
    wave = true,
    point = true,
    dance = true,
    dance2 = true,
    dance3 = true,
    laugh = true,
    cheer = true
};
local function _(v14)
    if not v14.Character then
        return nil;
    else
        return v14.Character:FindFirstChildOfClass("Humanoid");
    end;
end;
local function _(v16)
    local v17 = if not v16.Character then nil else v16.Character:FindFirstChildOfClass("Humanoid");
    if not v17 then
        return nil;
    else
        return v17:FindFirstChildOfClass("Animator");
    end;
end;
local function _(v19)
    l_Core_0 = v19;
    if v6 then
        v6.Priority = l_Core_0;
    end;
end;
local function _(v21)
    if v11[v21] ~= nil then
        v11[v21]:Disconnect();
        v11[v21] = nil;
    end;
end;
local function _()
    v8 = nil;
    if v6 ~= nil then
        v6:Play();
    end;
    local l_EmoteStopped_0 = v12.EmoteStopped;
    if v11[l_EmoteStopped_0] ~= nil then
        v11[l_EmoteStopped_0]:Disconnect();
        v11[l_EmoteStopped_0] = nil;
    end;
    l_EmoteStopped_0 = v12.EmoteKeyframeReached;
    if v11[l_EmoteStopped_0] ~= nil then
        v11[l_EmoteStopped_0]:Disconnect();
        v11[l_EmoteStopped_0] = nil;
    end;
end;
local function v31(v25, v26)
    if not v9 or v6 == nil then
        return ;
    else
        if not (not v25 or not v26) then
            v6:Stop();
            v8 = v26;
            v10 = true;
            local l_EmoteStopped_1 = v12.EmoteStopped;
            if v11[l_EmoteStopped_1] ~= nil then
                v11[l_EmoteStopped_1]:Disconnect();
                v11[l_EmoteStopped_1] = nil;
            end;
            l_EmoteStopped_1 = v12.EmoteKeyframeReached;
            if v11[l_EmoteStopped_1] ~= nil then
                v11[l_EmoteStopped_1]:Disconnect();
                v11[l_EmoteStopped_1] = nil;
            end;
            v11[v12.EmoteStopped] = v8.Stopped:Connect(function()
                v8 = nil;
                if v6 ~= nil then
                    v6:Play();
                end;
                local l_EmoteStopped_2 = v12.EmoteStopped;
                if v11[l_EmoteStopped_2] ~= nil then
                    v11[l_EmoteStopped_2]:Disconnect();
                    v11[l_EmoteStopped_2] = nil;
                end;
                l_EmoteStopped_2 = v12.EmoteKeyframeReached;
                if v11[l_EmoteStopped_2] ~= nil then
                    v11[l_EmoteStopped_2]:Disconnect();
                    v11[l_EmoteStopped_2] = nil;
                end;
                v10 = false;
            end);
            v11[v12.EmoteKeyframeReached] = v8.KeyframeReached:Connect(function(v29)
                if not (not (v29 == "End") or v8.Looped) then
                    v8 = nil;
                    if v6 ~= nil then
                        v6:Play();
                    end;
                    local l_EmoteStopped_3 = v12.EmoteStopped;
                    if v11[l_EmoteStopped_3] ~= nil then
                        v11[l_EmoteStopped_3]:Disconnect();
                        v11[l_EmoteStopped_3] = nil;
                    end;
                    l_EmoteStopped_3 = v12.EmoteKeyframeReached;
                    if v11[l_EmoteStopped_3] ~= nil then
                        v11[l_EmoteStopped_3]:Disconnect();
                        v11[l_EmoteStopped_3] = nil;
                    end;
                    v10 = false;
                end;
            end);
        end;
        return ;
    end;
end;
local function v32(v33)
    local l_v33_PlayingAnimationTracks_0 = v33:GetPlayingAnimationTracks();
    local v35 = false;
    for _, v37 in pairs(l_v33_PlayingAnimationTracks_0) do
        if not ((not v37.IsPlaying or not v37.Animation.Parent) or not v13[v37.Animation.Parent.Name]) then
            local l_EmoteStopped_4 = v12.EmoteStopped;
            if v11[l_EmoteStopped_4] ~= nil then
                v11[l_EmoteStopped_4]:Disconnect();
                v11[l_EmoteStopped_4] = nil;
            end;
            l_EmoteStopped_4 = v12.EmoteKeyframeReached;
            if v11[l_EmoteStopped_4] ~= nil then
                v11[l_EmoteStopped_4]:Disconnect();
                v11[l_EmoteStopped_4] = nil;
            end;
            v8 = v37;
            v10 = false;
            v6:Stop();
            v11[v12.EmoteStopped] = v8.Stopped:Connect(function()
                wait(0.3);
                if not (v32(v33) or v10) then
                    v8 = nil;
                    if v6 ~= nil then
                        v6:Play();
                    end;
                    local l_EmoteStopped_5 = v12.EmoteStopped;
                    if v11[l_EmoteStopped_5] ~= nil then
                        v11[l_EmoteStopped_5]:Disconnect();
                        v11[l_EmoteStopped_5] = nil;
                    end;
                    l_EmoteStopped_5 = v12.EmoteKeyframeReached;
                    if v11[l_EmoteStopped_5] ~= nil then
                        v11[l_EmoteStopped_5]:Disconnect();
                        v11[l_EmoteStopped_5] = nil;
                    end;
                end;
            end);
            v11[v12.EmoteKeyframeReached] = v8.KeyframeReached:Connect(function(v40)
                if v40 == "End" then
                    wait(0.3);
                    if not (v32(v33) or v10) then
                        v8 = nil;
                        if v6 ~= nil then
                            v6:Play();
                        end;
                        local l_EmoteStopped_6 = v12.EmoteStopped;
                        if v11[l_EmoteStopped_6] ~= nil then
                            v11[l_EmoteStopped_6]:Disconnect();
                            v11[l_EmoteStopped_6] = nil;
                        end;
                        l_EmoteStopped_6 = v12.EmoteKeyframeReached;
                        if v11[l_EmoteStopped_6] ~= nil then
                            v11[l_EmoteStopped_6]:Disconnect();
                            v11[l_EmoteStopped_6] = nil;
                        end;
                    end;
                end;
            end);
            v35 = true;
        end;
    end;
    return v35;
end;
v4 = l_LocalPlayer_0.Chatted:Connect(function(v42)
    if not v9 or v6 == nil then
        return ;
    else
        if l_LocalPlayer_0.Character then
            local l_Humanoid_0 = l_LocalPlayer_0.Character:FindFirstChildWhichIsA("Humanoid");
            if l_Humanoid_0 then
                local v44 = "";
                if string.sub(v42, 1, 3) == "/e " then
                    v44 = string.sub(v42, 4);
                elseif string.sub(v42, 1, 7) == "/emote " then
                    v44 = string.sub(v42, 8);
                end;
                if v13[v44] then
                    wait(0.3);
                    v32(l_Humanoid_0);
                end;
            end;
        end;
        return ;
    end;
end);
local function _()
    if v6 ~= nil then
        v6:Stop();
        v6:Destroy();
        v6 = nil;
    end;
end;
local function _()
    if v6 ~= nil then
        v6:Stop();
        v6:Destroy();
        v6 = nil;
    end;
    local l_EmoteStopped_7 = v12.EmoteStopped;
    if v11[l_EmoteStopped_7] ~= nil then
        v11[l_EmoteStopped_7]:Disconnect();
        v11[l_EmoteStopped_7] = nil;
    end;
    l_EmoteStopped_7 = v12.EmoteKeyframeReached;
    if v11[l_EmoteStopped_7] ~= nil then
        v11[l_EmoteStopped_7]:Disconnect();
        v11[l_EmoteStopped_7] = nil;
    end;
    l_EmoteStopped_7 = v12.AnimationInstanceChanged;
    if v11[l_EmoteStopped_7] ~= nil then
        v11[l_EmoteStopped_7]:Disconnect();
        v11[l_EmoteStopped_7] = nil;
    end;
    l_EmoteStopped_7 = v12.EmoteTriggered;
    if v11[l_EmoteStopped_7] ~= nil then
        v11[l_EmoteStopped_7]:Disconnect();
        v11[l_EmoteStopped_7] = nil;
    end;
    v5 = nil;
end;
local _ = function(_, _, v50, v51)
    v6 = v51:LoadAnimation(v5);
    v6.Priority = l_Core_0;
    if v8 == nil then
        v6:Play();
    end;
    local l_EmoteTriggered_0 = v12.EmoteTriggered;
    if v11[l_EmoteTriggered_0] ~= nil then
        v11[l_EmoteTriggered_0]:Disconnect();
        v11[l_EmoteTriggered_0] = nil;
    end;
    v11[v12.EmoteTriggered] = v50.EmoteTriggered:Connect(v31);
end;
local function v65(v54, v55, v56)
    local l_Animator_0 = v56:FindFirstChild("Animator");
    if l_Animator_0 then
        v6 = l_Animator_0:LoadAnimation(v5);
        v6.Priority = l_Core_0;
        if v8 == nil then
            v6:Play();
        end;
        local l_EmoteTriggered_1 = v12.EmoteTriggered;
        if v11[l_EmoteTriggered_1] ~= nil then
            v11[l_EmoteTriggered_1]:Disconnect();
            v11[l_EmoteTriggered_1] = nil;
        end;
        v11[v12.EmoteTriggered] = v56.EmoteTriggered:Connect(v31);
    end;
    if v11[v12.HumanoidAnimatorAdded] then
        local l_HumanoidAnimatorAdded_0 = v12.HumanoidAnimatorAdded;
        if v11[l_HumanoidAnimatorAdded_0] ~= nil then
            v11[l_HumanoidAnimatorAdded_0]:Disconnect();
            v11[l_HumanoidAnimatorAdded_0] = nil;
        end;
    end;
    v11[v12.HumanoidAnimatorAdded] = v56.ChildAdded:Connect(function(v60)
        if v60.Name == "Animator" then
            local _ = v54;
            local _ = v55;
            local l_v56_0 = v56;
            v6 = v60:LoadAnimation(v5);
            v6.Priority = l_Core_0;
            if v8 == nil then
                v6:Play();
            end;
            local l_EmoteTriggered_2 = v12.EmoteTriggered;
            if v11[l_EmoteTriggered_2] ~= nil then
                v11[l_EmoteTriggered_2]:Disconnect();
                v11[l_EmoteTriggered_2] = nil;
            end;
            v11[v12.EmoteTriggered] = l_v56_0.EmoteTriggered:Connect(v31);
        end;
    end);
end;
local function v66(v67, v68)
    if (v67 ~= nil and v68 ~= nil) and v9 then
        if v11[v12.AnimationInstanceChanged] then
            local l_AnimationInstanceChanged_0 = v12.AnimationInstanceChanged;
            if v11[l_AnimationInstanceChanged_0] ~= nil then
                v11[l_AnimationInstanceChanged_0]:Disconnect();
                v11[l_AnimationInstanceChanged_0] = nil;
            end;
        end;
        if v11[v12.CharacterHumanoidAdded] then
            local l_CharacterHumanoidAdded_0 = v12.CharacterHumanoidAdded;
            if v11[l_CharacterHumanoidAdded_0] ~= nil then
                v11[l_CharacterHumanoidAdded_0]:Disconnect();
                v11[l_CharacterHumanoidAdded_0] = nil;
            end;
        end;
        if v6 ~= nil then
            v6:Stop();
            v6:Destroy();
            v6 = nil;
        end;
        v5 = v68;
        v11[v12.AnimationInstanceChanged] = v5.Changed:Connect(function(_)
            v66(v67, v68);
        end);
        local l_Humanoid_1 = v67:FindFirstChildWhichIsA("Humanoid");
        if l_Humanoid_1 then
            v65(v67, v68, l_Humanoid_1);
        end;
        v11[v12.CharacterHumanoidAdded] = v67.ChildAdded:Connect(function(v73)
            if v73:IsA("Humanoid") then
                v65(v67, v68, l_Humanoid_1);
            end;
        end);
        return ;
    else
        return ;
    end;
end;
initAvatarMood = function(v74)
    local l_MoodsEnabled_0 = v74:FindFirstChild("MoodsEnabled");
    local l_AnimateScriptMoodAdded_0 = v12.AnimateScriptMoodAdded;
    if v11[l_AnimateScriptMoodAdded_0] ~= nil then
        v11[l_AnimateScriptMoodAdded_0]:Disconnect();
        v11[l_AnimateScriptMoodAdded_0] = nil;
    end;
    l_AnimateScriptMoodAdded_0 = v12.AnimateScriptMoodRemoved;
    if v11[l_AnimateScriptMoodAdded_0] ~= nil then
        v11[l_AnimateScriptMoodAdded_0]:Disconnect();
        v11[l_AnimateScriptMoodAdded_0] = nil;
    end;
    if not l_MoodsEnabled_0 then
        l_AnimateScriptMoodAdded_0 = v74:FindFirstChild("mood");
        if not l_AnimateScriptMoodAdded_0 then
            if v6 ~= nil then
                v6:Stop();
                v6:Destroy();
                v6 = nil;
            end;
            local l_EmoteStopped_8 = v12.EmoteStopped;
            if v11[l_EmoteStopped_8] ~= nil then
                v11[l_EmoteStopped_8]:Disconnect();
                v11[l_EmoteStopped_8] = nil;
            end;
            l_EmoteStopped_8 = v12.EmoteKeyframeReached;
            if v11[l_EmoteStopped_8] ~= nil then
                v11[l_EmoteStopped_8]:Disconnect();
                v11[l_EmoteStopped_8] = nil;
            end;
            l_EmoteStopped_8 = v12.AnimationInstanceChanged;
            if v11[l_EmoteStopped_8] ~= nil then
                v11[l_EmoteStopped_8]:Disconnect();
                v11[l_EmoteStopped_8] = nil;
            end;
            l_EmoteStopped_8 = v12.EmoteTriggered;
            if v11[l_EmoteStopped_8] ~= nil then
                v11[l_EmoteStopped_8]:Disconnect();
                v11[l_EmoteStopped_8] = nil;
            end;
            v5 = nil;
        else
            if #l_AnimateScriptMoodAdded_0:GetChildren() > 0 then
                if not game:GetFastFlag("AvatarMoodValidateMoodAnimation") then
                    v66(l_LocalPlayer_0.Character, l_AnimateScriptMoodAdded_0:GetChildren()[1]);
                else
                    v66(l_LocalPlayer_0.Character, l_AnimateScriptMoodAdded_0:FindFirstChildWhichIsA("Animation"));
                end;
            end;
            local l_MoodChildAdded_0 = v12.MoodChildAdded;
            if v11[l_MoodChildAdded_0] ~= nil then
                v11[l_MoodChildAdded_0]:Disconnect();
                v11[l_MoodChildAdded_0] = nil;
            end;
            v11[v12.MoodChildAdded] = l_AnimateScriptMoodAdded_0.ChildAdded:Connect(function(v79)
                if not game:GetFastFlag("AvatarMoodValidateMoodAnimation") then
                    v66(l_LocalPlayer_0.Character, v79);
                elseif v79:IsA("Animation") then
                    v66(l_LocalPlayer_0.Character, v79);
                    return ;
                end;
            end);
        end;
        v11[v12.AnimateScriptMoodAdded] = v74.ChildAdded:Connect(function(v80)
            if v80.Name == "mood" then
                if #v80:GetChildren() > 0 then
                    v66(l_LocalPlayer_0.Character, v80:GetChildren()[1]);
                end;
                local l_MoodChildAdded_1 = v12.MoodChildAdded;
                if v11[l_MoodChildAdded_1] ~= nil then
                    v11[l_MoodChildAdded_1]:Disconnect();
                    v11[l_MoodChildAdded_1] = nil;
                end;
                v11[v12.MoodChildAdded] = v80.ChildAdded:Connect(function(v82)
                    v66(l_LocalPlayer_0.Character, v82);
                end);
                return ;
            else
                if v80.Name == "MoodsEnabled" then
                    v9 = false;
                end;
                return ;
            end;
        end);
        v11[v12.AnimateScriptMoodRemoved] = v74.ChildRemoved:Connect(function(v83)
            if v83.Name == "mood" then
                local l_mood_0 = v74:FindFirstChild("mood");
                if not l_mood_0 then
                    if v6 ~= nil then
                        v6:Stop();
                        v6:Destroy();
                        v6 = nil;
                    end;
                    local l_EmoteStopped_9 = v12.EmoteStopped;
                    if v11[l_EmoteStopped_9] ~= nil then
                        v11[l_EmoteStopped_9]:Disconnect();
                        v11[l_EmoteStopped_9] = nil;
                    end;
                    l_EmoteStopped_9 = v12.EmoteKeyframeReached;
                    if v11[l_EmoteStopped_9] ~= nil then
                        v11[l_EmoteStopped_9]:Disconnect();
                        v11[l_EmoteStopped_9] = nil;
                    end;
                    l_EmoteStopped_9 = v12.AnimationInstanceChanged;
                    if v11[l_EmoteStopped_9] ~= nil then
                        v11[l_EmoteStopped_9]:Disconnect();
                        v11[l_EmoteStopped_9] = nil;
                    end;
                    l_EmoteStopped_9 = v12.EmoteTriggered;
                    if v11[l_EmoteStopped_9] ~= nil then
                        v11[l_EmoteStopped_9]:Disconnect();
                        v11[l_EmoteStopped_9] = nil;
                    end;
                    v5 = nil;
                else
                    v66(l_LocalPlayer_0.Character, l_mood_0:FindFirstChildWhichIsA("Animation"));
                    return ;
                end;
            end;
        end);
        return ;
    else
        v9 = false;
        return ;
    end;
end;
local function v89()
    local l_Animate_0 = l_LocalPlayer_0.Character:FindFirstChild("Animate");
    if l_Animate_0 then
        initAvatarMood(l_Animate_0);
    end;
    local l_AnimateScriptAdded_0 = v12.AnimateScriptAdded;
    if v11[l_AnimateScriptAdded_0] ~= nil then
        v11[l_AnimateScriptAdded_0]:Disconnect();
        v11[l_AnimateScriptAdded_0] = nil;
    end;
    v11[v12.AnimateScriptAdded] = l_LocalPlayer_0.Character.ChildAdded:Connect(function(v88)
        if v88.Name == "Animate" then
            initAvatarMood(v88);
        end;
    end);
end;
local function v93(v90)
    if v90:FindFirstChildWhichIsA("FaceControls") then
        v89();
    end;
    local l_HeadChildAdded_0 = v12.HeadChildAdded;
    if v11[l_HeadChildAdded_0] ~= nil then
        v11[l_HeadChildAdded_0]:Disconnect();
        v11[l_HeadChildAdded_0] = nil;
    end;
    v11[v12.HeadChildAdded] = v90.ChildAdded:Connect(function(v92)
        if v92:IsA("FaceControls") then
            v89();
        end;
    end);
end;
local function _(v94)
    local l_StreamTrackStopped_0 = v12.StreamTrackStopped;
    if v11[l_StreamTrackStopped_0] ~= nil then
        v11[l_StreamTrackStopped_0]:Disconnect();
        v11[l_StreamTrackStopped_0] = nil;
    end;
    l_Core_0 = Enum.AnimationPriority.Idle;
    if v6 then
        v6.Priority = l_Core_0;
    end;
    v11[v12.StreamTrackStopped] = v94.Stopped:Connect(function()
        local l_StreamTrackStopped_1 = v12.StreamTrackStopped;
        if v11[l_StreamTrackStopped_1] ~= nil then
            v11[l_StreamTrackStopped_1]:Disconnect();
            v11[l_StreamTrackStopped_1] = nil;
        end;
        l_Core_0 = Enum.AnimationPriority.Core;
        if v6 then
            v6.Priority = l_Core_0;
        end;
    end);
end;
local function v109(v98)
    local l_AnimationStreamTrackPlayed_0 = v12.AnimationStreamTrackPlayed;
    if v11[l_AnimationStreamTrackPlayed_0] ~= nil then
        v11[l_AnimationStreamTrackPlayed_0]:Disconnect();
        v11[l_AnimationStreamTrackPlayed_0] = nil;
    end;
    v11[v12.AnimationStreamTrackPlayed] = v98.AnimationStreamTrackPlayed:Connect(function(v100)
        local l_StreamTrackStopped_2 = v12.StreamTrackStopped;
        if v11[l_StreamTrackStopped_2] ~= nil then
            v11[l_StreamTrackStopped_2]:Disconnect();
            v11[l_StreamTrackStopped_2] = nil;
        end;
        l_Core_0 = Enum.AnimationPriority.Idle;
        if v6 then
            v6.Priority = l_Core_0;
        end;
        v11[v12.StreamTrackStopped] = v100.Stopped:Connect(function()
            local l_StreamTrackStopped_3 = v12.StreamTrackStopped;
            if v11[l_StreamTrackStopped_3] ~= nil then
                v11[l_StreamTrackStopped_3]:Disconnect();
                v11[l_StreamTrackStopped_3] = nil;
            end;
            l_Core_0 = Enum.AnimationPriority.Core;
            if v6 then
                v6.Priority = l_Core_0;
            end;
        end);
    end);
    l_AnimationStreamTrackPlayed_0 = v98:GetPlayingAnimationTracksCoreScript();
    local v103 = nil;
    for _, v105 in l_AnimationStreamTrackPlayed_0, nil, nil do
        if v105:IsA("AnimationStreamTrack") then
            v103 = v105;
            break;
        end;
    end;
    if not v103 then
        l_Core_0 = Enum.AnimationPriority.Core;
        if v6 then
            v6.Priority = l_Core_0;
        end;
        return ;
    else
        local l_v103_0 = v103;
        local l_StreamTrackStopped_4 = v12.StreamTrackStopped;
        if v11[l_StreamTrackStopped_4] ~= nil then
            v11[l_StreamTrackStopped_4]:Disconnect();
            v11[l_StreamTrackStopped_4] = nil;
        end;
        l_Core_0 = Enum.AnimationPriority.Idle;
        if v6 then
            v6.Priority = l_Core_0;
        end;
        v11[v12.StreamTrackStopped] = l_v103_0.Stopped:Connect(function()
            local l_StreamTrackStopped_5 = v12.StreamTrackStopped;
            if v11[l_StreamTrackStopped_5] ~= nil then
                v11[l_StreamTrackStopped_5]:Disconnect();
                v11[l_StreamTrackStopped_5] = nil;
            end;
            l_Core_0 = Enum.AnimationPriority.Core;
            if v6 then
                v6.Priority = l_Core_0;
            end;
        end);
        return ;
    end;
end;
local _ = function(_)
    assert(not game:GetFastFlag("AvatarMoodSearchForReplacementWhenRemovingAnimator"));
    local l_AnimationStreamTrackPlayed_1 = v12.AnimationStreamTrackPlayed;
    if v11[l_AnimationStreamTrackPlayed_1] ~= nil then
        v11[l_AnimationStreamTrackPlayed_1]:Disconnect();
        v11[l_AnimationStreamTrackPlayed_1] = nil;
    end;
    l_AnimationStreamTrackPlayed_1 = v12.StreamTrackStopped;
    if v11[l_AnimationStreamTrackPlayed_1] ~= nil then
        v11[l_AnimationStreamTrackPlayed_1]:Disconnect();
        v11[l_AnimationStreamTrackPlayed_1] = nil;
    end;
    l_Core_0 = Enum.AnimationPriority.Core;
    if v6 then
        v6.Priority = l_Core_0;
    end;
end;
local function v117(v113, _)
    assert(game:GetFastFlag("AvatarMoodSearchForReplacementWhenRemovingAnimator"));
    local l_AnimationStreamTrackPlayed_2 = v12.AnimationStreamTrackPlayed;
    if v11[l_AnimationStreamTrackPlayed_2] ~= nil then
        v11[l_AnimationStreamTrackPlayed_2]:Disconnect();
        v11[l_AnimationStreamTrackPlayed_2] = nil;
    end;
    l_AnimationStreamTrackPlayed_2 = v12.StreamTrackStopped;
    if v11[l_AnimationStreamTrackPlayed_2] ~= nil then
        v11[l_AnimationStreamTrackPlayed_2]:Disconnect();
        v11[l_AnimationStreamTrackPlayed_2] = nil;
    end;
    l_Core_0 = Enum.AnimationPriority.Core;
    if v6 then
        v6.Priority = l_Core_0;
    end;
    local v116 = if not v113.Character then nil else v113.Character:FindFirstChildOfClass("Humanoid");
    l_AnimationStreamTrackPlayed_2 = if not v116 then nil else v116:FindFirstChildOfClass("Animator");
    if l_AnimationStreamTrackPlayed_2 then
        v109(l_AnimationStreamTrackPlayed_2);
    end;
end;
local function v128(v118, v119)
    local l_Head_0 = v119:FindFirstChild("Head");
    if l_Head_0 then
        v93(l_Head_0);
    end;
    v11[v12.CharacterChildAdded] = v119.ChildAdded:Connect(function(v121)
        if v121.Name == "Head" then
            v93(v121);
        end;
    end);
    v11[v12.CharacterChildRemoved] = v119.ChildRemoved:Connect(function(v122)
        if v122.Name == "Head" then
            if v6 ~= nil then
                v6:Stop();
                v6:Destroy();
                v6 = nil;
            end;
            local l_Head_1 = v119:FindFirstChild("Head");
            if l_Head_1 then
                v93(l_Head_1);
            end;
        end;
    end);
    v11[v12.DescendantAdded] = v119.DescendantAdded:Connect(function(v124)
        if v124:IsA("Animator") then
            v109(v124);
        end;
    end);
    local l_v119_FirstChildWhichIsA_0 = v119:FindFirstChildWhichIsA("Animator", true);
    if l_v119_FirstChildWhichIsA_0 then
        v109(l_v119_FirstChildWhichIsA_0);
    end;
    v11[v12.DescendantRemoving] = v119.DescendantRemoving:Connect(function(v126)
        if v126:IsA("Animator") then
            if not game:GetFastFlag("AvatarMoodSearchForReplacementWhenRemovingAnimator") then
                assert(not game:GetFastFlag("AvatarMoodSearchForReplacementWhenRemovingAnimator"));
                local l_AnimationStreamTrackPlayed_3 = v12.AnimationStreamTrackPlayed;
                if v11[l_AnimationStreamTrackPlayed_3] ~= nil then
                    v11[l_AnimationStreamTrackPlayed_3]:Disconnect();
                    v11[l_AnimationStreamTrackPlayed_3] = nil;
                end;
                l_AnimationStreamTrackPlayed_3 = v12.StreamTrackStopped;
                if v11[l_AnimationStreamTrackPlayed_3] ~= nil then
                    v11[l_AnimationStreamTrackPlayed_3]:Disconnect();
                    v11[l_AnimationStreamTrackPlayed_3] = nil;
                end;
                l_Core_0 = Enum.AnimationPriority.Core;
                if v6 then
                    v6.Priority = l_Core_0;
                end;
            else
                v117(v118, v126);
                return ;
            end;
        end;
    end);
end;
local function v132(_)
    if v6 ~= nil then
        v6:Stop();
        v6:Destroy();
        v6 = nil;
    end;
    for _, v131 in pairs(v11) do
        if v131 then
            v131:Disconnect();
        end;
    end;
    table.clear(v11);
end;
if l_LocalPlayer_0.Character then
    v128(l_LocalPlayer_0, l_LocalPlayer_0.Character);
end;
l_LocalPlayer_0.CharacterAdded:Connect(function(v133)
    v128(l_LocalPlayer_0, v133);
end);
l_LocalPlayer_0.CharacterRemoving:Connect(v132);


local l_StarterGui_0 = game:GetService("StarterGui");
local l_Players_0 = game:GetService("Players");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while l_LocalPlayer_0 == nil do
    l_Players_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local l_Modules_0 = l_RobloxGui_0:WaitForChild("Modules");
local l_PromptCreator_0 = require(l_Modules_0:WaitForChild("PromptCreator"));
local l_SocialUtil_0 = require(l_Modules_0:WaitForChild("SocialUtil"));
local v7 = require(l_Modules_0.BlockingUtility);
local l_Size150x150_0 = Enum.ThumbnailSize.Size150x150;
local l_Size352x352_0 = Enum.ThumbnailSize.Size352x352;
local l_HeadShot_0 = Enum.ThumbnailType.HeadShot;
local l_AvatarThumbnail_0 = Enum.ThumbnailType.AvatarThumbnail;
createFetchImageFunction = function(...)
    local v12 = {
        ...
    };
    return function(v13)
        spawn(function()
            local v14 = l_SocialUtil_0.GetPlayerImage(unpack(v12));
            if not (not v13 or not v13.Parent) then
                v13.Image = v14;
            end;
        end);
    end;
end;
DoPromptBlockPlayer = function(v15)
    if not v7:IsPlayerBlockedByUserId(v15.UserId) then
        l_PromptCreator_0:CreatePrompt({
            WindowTitle = "Confirm Block",
            MainText = string.format("Are you sure you want to block %s?", v15.Name),
            ConfirmationText = "Block",
            CancelText = "Cancel",
            CancelActive = true,
            Image = "",
            ImageConsoleVR = "",
            FetchImageFunction = createFetchImageFunction(v15.UserId, l_Size150x150_0, l_HeadShot_0),
            FetchImageFunctionConsoleVR = createFetchImageFunction(v15.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
            PromptCompletedCallback = function(v16)
                if not (not v16 or v7:BlockPlayerAsync(v15)) then
                    while l_PromptCreator_0:IsCurrentlyPrompting() do
                        wait();
                    end;
                    l_PromptCreator_0:CreatePrompt({
                        WindowTitle = "Error Blocking User",
                        MainText = string.format("An error occurred while blocking %s. Please try again later.", v15.Name),
                        ConfirmationText = "Okay",
                        CancelActive = false,
                        Image = "",
                        ImageConsoleVR = "",
                        FetchImageFunction = createFetchImageFunction(v15.UserId, l_Size150x150_0, l_HeadShot_0),
                        FetchImageFunctionConsoleVR = createFetchImageFunction(v15.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                        StripeColor = Color3.fromRGB(183, 34, 54)
                    });
                end;
            end
        });
        return ;
    else
        return ;
    end;
end;
PromptBlockPlayer = function(v17)
    if l_LocalPlayer_0.UserId < 0 then
        error("PromptBlockPlayer can not be called for guests");
    end;
    if not (typeof(v17) == "Instance") or not v17:IsA("Player") then
        error("Invalid argument to PromptBlockPlayer");
        return ;
    else
        if v17.UserId < 0 then
            error("PromptBlockPlayer can not be called on guests");
        end;
        if v17 == l_LocalPlayer_0 then
            error("PromptBlockPlayer: A user can not block themselves");
        end;
        DoPromptBlockPlayer(v17);
        return ;
    end;
end;
DoPromptUnblockPlayer = function(v18)
    local _ = not v7:IsPlayerBlockedByUserId(v18.UserId);
    l_PromptCreator_0:CreatePrompt({
        WindowTitle = "Confirm Unblock",
        MainText = string.format("Would you like to unblock %s?", v18.Name),
        ConfirmationText = "Unblock",
        CancelText = "Cancel",
        CancelActive = true,
        Image = "",
        ImageConsoleVR = "",
        FetchImageFunction = createFetchImageFunction(v18.UserId, l_Size150x150_0, l_HeadShot_0),
        FetchImageFunctionConsoleVR = createFetchImageFunction(v18.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
        PromptCompletedCallback = function(v20)
            if not (not v20 or v7:UnblockPlayerAsync(v18)) then
                while l_PromptCreator_0:IsCurrentlyPrompting() do
                    wait();
                end;
                l_PromptCreator_0:CreatePrompt({
                    WindowTitle = "Error Unblocking User",
                    MainText = string.format("An error occurred while unblocking %s. Please try again later.", v18.Name),
                    ConfirmationText = "Okay",
                    Image = "",
                    ImageConsoleVR = "",
                    FetchImageFunction = createFetchImageFunction(v18.UserId, l_Size150x150_0, l_HeadShot_0),
                    FetchImageFunctionConsoleVR = createFetchImageFunction(v18.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                    StripeColor = Color3.fromRGB(183, 34, 54)
                });
            end;
        end
    });
end;
PromptUnblockPlayer = function(v21)
    if l_LocalPlayer_0.UserId < 0 then
        error("PromptUnblockPlayer can not be called for guests");
    end;
    if not (typeof(v21) == "Instance") or not v21:IsA("Player") then
        error("Invalid argument to PromptUnblockPlayer");
        return ;
    else
        if v21.UserId < 0 then
            error("PromptUnblockPlayer can not be called on guests");
        end;
        if v21 == l_LocalPlayer_0 then
            error("PromptUnblockPlayer: A user can not block themselves");
        end;
        DoPromptUnblockPlayer(v21);
        return ;
    end;
end;
GetBlockedUserIds = function()
    if l_LocalPlayer_0.UserId < 0 then
        error("GetBlockedUserIds can not be called for guests");
    end;
    return v7:GetBlockedUserIdsAsync();
end;
l_StarterGui_0:RegisterSetCore("PromptBlockPlayer", PromptBlockPlayer);
l_StarterGui_0:RegisterSetCore("PromptUnblockPlayer", PromptUnblockPlayer);
l_StarterGui_0:RegisterGetCore("GetBlockedUserIds", GetBlockedUserIds);
v7:InitBlockListAsync();


local l_Players_0 = game:GetService("Players");
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(game:GetService("CoreGui").RobloxGui.Modules.ApolloClient);
local v3 = require(l_CorePackages_0.Workspace.Packages.UserProfiles);
local v4 = {};
local v5 = {
    CharacterAdded = "CharacterAdded",
    CharacterRemoving = "CharacterRemoving",
    HumanoidDisplayNameChanged = "HumanoidDisplayNameChanged",
    CharacterHumanoidAdded = "CharacterHumanoidAdded"
};
local function v11(v6, v7, v8)
    local l_combinedName_0 = v8.names.combinedName;
    local l_displayName_0 = v8.names.displayName;
    if v8.names.displayName == v6.DisplayName then
        v6.InternalDisplayName = l_combinedName_0;
        v4[v7][v5.HumanoidDisplayNameChanged] = v6:GetPropertyChangedSignal("DisplayName"):Connect(function()
            if l_displayName_0 ~= v6.DisplayName then
                v6.InternalDisplayName = "";
            end;
        end);
    end;
end;
local function v17(v12, v13, v14)
    local l_Humanoid_0 = v13:FindFirstChildWhichIsA("Humanoid");
    if l_Humanoid_0 then
        v11(l_Humanoid_0, v12, v14);
    end;
    v4[v12][v5.CharacterHumanoidAdded] = v13.ChildAdded:Connect(function(v16)
        if v16:IsA("Humanoid") then
            v11(v16, v12, v14);
        end;
    end);
end;
local function v23(v18, v19)
    v4[v18] = {};
    if v18.Character then
        v17(v18, v18.Character, v19);
    end;
    v4[v18][v5.CharacterAdded] = v18.CharacterAdded:Connect(function(v20)
        v17(v18, v20, v19);
    end);
    v4[v18][v5.CharacterRemoving] = v18.CharacterRemoving:Connect(function()
        local v21 = v4[v18][v5.CharacterHumanoidAdded];
        local v22 = v4[v18][v5.HumanoidDisplayNameChanged];
        if v21 then
            v4[v18][v5.CharacterHumanoidAdded]:Disconnect();
        end;
        if v22 then
            v4[v18][v5.HumanoidDisplayNameChanged]:Disconnect();
        end;
    end);
end;
local function v32()
    local l_l_Players_0_Players_0 = l_Players_0:GetPlayers();
    local v25 = {};
    local v26 = {};
    for _, v28 in pairs(l_l_Players_0_Players_0) do
        table.insert(v25, (tostring(v28.UserId)));
        v26[tostring(v28.UserId)] = v28;
    end;
    v2:query({
        query = v3.Queries.userProfilesAllNamesByUserIds,
        variables = {
            userIds = v25
        }
    }):andThen(function(v29)
        for _, v31 in pairs(v29.data.userProfiles) do
            v23(v26[v31.id], v31);
        end;
    end, function()
    end);
end;
local function v35(v33)
    v2:query({
        query = v3.Queries.userProfilesAllNamesByUserIds,
        variables = {
            userIds = {
                (tostring(v33.UserId))
            }
        }
    }):andThen(function(v34)
        v23(v33, v34.data.userProfiles[1]);
    end, function()
    end);
end;
local function v40(v36)
    local v37 = v4[v36];
    if v4[v36] then
        for _, v39 in pairs(v37) do
            v39:Disconnect();
        end;
        v4[v36] = nil;
    end;
end;
v32();
l_Players_0.PlayerAdded:Connect(v35);
l_Players_0.PlayerRemoving:Connect(v40);


local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local _ = game:GetService("CorePackages");
local l_Players_0 = game:GetService("Players");
local l_Stats_0 = game:GetService("Stats");
local l_CoreGui_0 = game:GetService("CoreGui");
local v5 = require(l_CoreGui_0.RobloxGui.Modules.EmotesMenu.Constants);
local v6 = require(l_CoreGui_0.RobloxGui.Modules.EmotesMenu.Utility.MaybeSendEmoteFailureAnalyticsFromPlayer);
while l_Players_0.LocalPlayer == nil do
    wait();
end;
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
local function v9(v8)
    l_RbxAnalyticsService_0:SetRBXEventStream("client", "chat", "emoteTriggered", {
        pid = tostring(game.PlaceId),
        uid = tostring(l_LocalPlayer_0.UserId),
        btid = l_Stats_0:GetBrowserTrackerId(),
        assetID = if not v8.AssetId then nil else tostring(v8.AssetId),
        slotNumber = if not v8.Slot then nil else tostring(v8.Slot)
    });
end;
local function v12(v10, v11)
    l_RbxAnalyticsService_0:SendEventDeferred("client", "chat", "emoteTriggerFailed", {
        pid = tostring(game.PlaceId),
        uid = tostring(l_LocalPlayer_0.UserId),
        btid = l_Stats_0:GetBrowserTrackerId(),
        assetID = if not not v11 and v11.AssetId then tostring(v11.AssetId) else nil,
        slotNumber = if not not v11 and v11.Slot then tostring(v11.Slot) else nil,
        errorType = v10,
        invokedByCoreGui = false
    });
end;
local function _(v13)
    local l_Character_0 = v13.Character;
    if not l_Character_0 then
        return nil;
    else
        return l_Character_0:FindFirstChildOfClass("Humanoid");
    end;
end;
local function _(v16)
    local l_Character_1 = v16.Character;
    local v18 = if not l_Character_1 then nil else l_Character_1:FindFirstChildOfClass("Humanoid");
    if not v18 then
        return nil;
    else
        return v18:FindFirstChildOfClass("HumanoidDescription");
    end;
end;
local function _(v20)
    if string.sub(v20, 1, 3) == "/e " then
        return string.sub(v20, 4):lower();
    elseif string.sub(v20, 1, 7) == "/emote " then
        return string.sub(v20, 8):lower();
    else
        return nil;
    end;
end;
local _ = function(v22, v23)
    for _, v25 in ipairs((v22:GetEquippedEmotes())) do
        if v25.Slot == v23 then
            return v25;
        end;
    end;
    return nil;
end;
local function v31(v27, v28)
    for v29, v30 in pairs((v27:GetEmotes())) do
        if string.lower(v28.Name) == string.lower(v29) then
            return {
                Name = v29,
                Slot = v28.Slot,
                AssetId = v30[1]
            };
        end;
    end;
    return nil;
end;
local function v36(v32, v33)
    for v34, v35 in pairs((v32:GetEmotes())) do
        if string.lower(v33) == string.lower(v34) then
            return {
                Name = v34,
                Slot = nil,
                AssetId = v35[1]
            };
        end;
    end;
    return nil;
end;
local _ = function(v37, v38)
    local v39 = tonumber(v38);
    if not v39 then
        return (v36(v37, v38));
    else
        local v40;
        for _, v42 in ipairs((v37:GetEquippedEmotes())) do
            if v42.Slot == v39 then
                v40 = v42;
                goto label0 --[[  true, false  ]];
            end;
        end;
        v40 = nil;
        ::label0::;
        if not v40 then
            return nil;
        else
            return (v31(v37, v40));
        end;
    end;
end;
local v44 = {
    wave = {
        R6 = 128777973,
        R15 = 507770239
    },
    point = {
        R6 = 128853357,
        R15 = 507770453
    },
    dance = {
        R6 = 182435998,
        R15 = 507771019
    },
    dance2 = {
        R6 = 182436842,
        R15 = 507776043
    },
    dance3 = {
        R6 = 182436935,
        R15 = 507777268
    },
    laugh = {
        R6 = 129423131,
        R15 = 507770818
    },
    cheer = {
        R6 = 129423030,
        R15 = 507770677
    }
};
local function _(v45, v46, v47)
    return {
        Name = v46,
        Slot = nil,
        AssetId = if not (v45.RigType == Enum.HumanoidRigType.R15) then v47.R6 else v47.R15
    };
end;
l_LocalPlayer_0.Chatted:Connect(function(v49, _)
    local v51 = if string.sub(v49, 1, 3) == "/e " then string.sub(v49, 4):lower() else if string.sub(v49, 1, 7) == "/emote " then string.sub(v49, 8):lower() else nil;
    if v51 then
        local v52 = nil;
        local v53 = v44[v51];
        if not v53 then
            local l_Character_2 = l_LocalPlayer_0.Character;
            local v55 = if not l_Character_2 then nil else l_Character_2:FindFirstChildOfClass("Humanoid");
            local v56 = if not v55 then nil else v55:FindFirstChildOfClass("HumanoidDescription");
            if v56 then
                local v57 = tonumber(v51);
                if not v57 then
                    v52 = v36(v56, v51);
                else
                    for _, v59 in ipairs((v56:GetEquippedEmotes())) do
                        if v59.Slot == v57 then
                            v55 = v59;
                            goto label1 --[[  true, false  ]];
                        end;
                    end;
                    v55 = nil;
                    ::label1::;
                    v52 = if not v55 then nil else v31(v56, v55);
                end;
            end;
        else
            local l_Character_3 = l_LocalPlayer_0.Character;
            local v61 = if not l_Character_3 then nil else l_Character_3:FindFirstChildOfClass("Humanoid");
            if v61 then
                v52 = {
                    Name = v51,
                    Slot = nil,
                    AssetId = if not (v61.RigType == Enum.HumanoidRigType.R15) then v53.R6 else v53.R15
                };
            end;
        end;
        do
            local l_v52_0 = v52;
            if not l_v52_0 then
                v12(v5.ErrorTypes.NoMatchingEmote);
            else
                v9(l_v52_0);
                v6(l_LocalPlayer_0, function(v63)
                    v12(v63, l_v52_0);
                end);
            end;
        end;
    end;
end);


local l_ContextActionService_0 = game:GetService("ContextActionService");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Players_0 = game:GetService("Players");
local l_GuiService_0 = game:GetService("GuiService");
local l_TouchEnabled_0 = l_UserInputService_0.TouchEnabled;
local v5 = {};
local v6 = {};
local v7 = nil;
local v8 = nil;
local _ = {};
local v10 = {
    [1] = UDim2.new(0, 123, 0, 70),
    [2] = UDim2.new(0, 30, 0, 60),
    [3] = UDim2.new(0, 180, 0, 160),
    [4] = UDim2.new(0, 85, 0, -25),
    [5] = UDim2.new(0, 185, 0, -25),
    [6] = UDim2.new(0, 185, 0, 260),
    [7] = UDim2.new(0, 216, 0, 65)
};
local v11 = #v10;
game:GetService("ContentProvider"):Preload("https://www.roblox.com/asset/?id=97166756");
game:GetService("ContentProvider"):Preload("https://www.roblox.com/asset/?id=97166444");
local v12 = require(game:GetService("CoreGui"):WaitForChild("RobloxGui").Modules.CoreUtility);
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while not l_LocalPlayer_0 do
    l_Players_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local v14 = v12.waitForChildOfClass(l_LocalPlayer_0, "PlayerGui");
createContextActionGui = function()
    if not (v7 or not l_TouchEnabled_0) then
        v7 = Instance.new("ScreenGui");
        v7.Name = "ContextActionGui";
        v7.ResetOnSpawn = false;
        v8 = Instance.new("Frame");
        v8.BackgroundTransparency = 1;
        v8.Size = UDim2.new(0.3, 0, 0.5, 0);
        v8.Position = UDim2.new(0.7, 0, 0.5, 0);
        v8.Name = "ContextButtonFrame";
        v8.Parent = v7;
        v8.Visible = l_GuiService_0.TouchControlsEnabled;
        l_GuiService_0:GetPropertyChangedSignal("TouchControlsEnabled"):Connect(function()
            v8.Visible = l_GuiService_0.TouchControlsEnabled;
        end);
    end;
end;
setButtonSizeAndPosition = function(v15)
    local v16 = 55;
    local v17 = 10;
    if not (game:GetService("CoreGui").RobloxGui.AbsoluteSize.X < 600) then
        v16 = 85;
        v17 = 40;
    end;
    v15.Size = UDim2.new(0, v16, 0, v16);
end;
contextActionButtonDown = function(v18, v19, v20)
    v18.Image = "https://www.roblox.com/asset/?id=97166756";
    l_ContextActionService_0:CallFunction(v20, Enum.UserInputState.Begin, v19);
end;
contextActionButtonMoved = function(v21, v22, v23)
    v21.Image = "https://www.roblox.com/asset/?id=97166756";
    l_ContextActionService_0:CallFunction(v23, Enum.UserInputState.Change, v22);
end;
contextActionButtonUp = function(v24, v25, v26)
    v24.Image = "https://www.roblox.com/asset/?id=97166444";
    l_ContextActionService_0:CallFunction(v26, Enum.UserInputState.End, v25);
end;
contextActionButtonCancel = function(v27, v28, v29)
    v27.Image = "https://www.roblox.com/asset/?id=97166444";
    l_ContextActionService_0:CallFunction(v29, Enum.UserInputState.Cancel, v28);
end;
isSmallScreenDevice = function()
    return game:GetService("GuiService"):GetScreenResolution().Y <= 320;
end;
createNewButton = function(v30, v31)
    local l_ImageButton_0 = Instance.new("ImageButton");
    l_ImageButton_0.Name = "ContextActionButton";
    l_ImageButton_0.BackgroundTransparency = 1;
    l_ImageButton_0.Size = UDim2.new(0, 45, 0, 45);
    l_ImageButton_0.Active = true;
    if isSmallScreenDevice() then
        l_ImageButton_0.Size = UDim2.new(0, 35, 0, 35);
    end;
    l_ImageButton_0.Image = "https://www.roblox.com/asset/?id=97166444";
    l_ImageButton_0.Parent = v8;
    local v33 = nil;
    local v34 = false;
    l_UserInputService_0.InputEnded:connect(function(v35)
        if v35.UserInputType ~= Enum.UserInputType.Touch then
            return ;
        elseif v33 ~= v35 then
            return ;
        else
            if not (not (v35.UserInputState == Enum.UserInputState.End) or not v34) then
                contextActionButtonCancel(l_ImageButton_0, v35, v30);
            end;
            v33 = nil;
            v34 = false;
            return ;
        end;
    end);
    l_ImageButton_0.InputBegan:connect(function(v36)
        if v36.UserInputType ~= Enum.UserInputType.Touch then
            return ;
        elseif v36.UserInputState == Enum.UserInputState.Begin then
            v33 = v36;
            v34 = false;
            contextActionButtonDown(l_ImageButton_0, v36, v30);
            return ;
        else
            if v36.UserInputState == Enum.UserInputState.Change then
                if v33 ~= v36 then
                    return ;
                else
                    v34 = false;
                end;
            end;
            return ;
        end;
    end);
    l_ImageButton_0.InputEnded:connect(function(v37)
        if v37.UserInputType ~= Enum.UserInputType.Touch then
            return ;
        elseif v33 ~= v37 then
            return ;
        elseif v37.UserInputState == Enum.UserInputState.End then
            v33 = nil;
            v34 = false;
            contextActionButtonUp(l_ImageButton_0, v37, v30);
            return ;
        else
            if v37.UserInputState == Enum.UserInputState.Change then
                v34 = true;
            end;
            return ;
        end;
    end);
    l_ImageButton_0.InputChanged:connect(function(v38)
        if v38.UserInputType ~= Enum.UserInputType.Touch then
            return ;
        elseif v33 ~= v38 then
            return ;
        else
            contextActionButtonMoved(l_ImageButton_0, v38, v30);
            return ;
        end;
    end);
    local l_ImageLabel_0 = Instance.new("ImageLabel");
    l_ImageLabel_0.Name = "ActionIcon";
    l_ImageLabel_0.Position = UDim2.new(0.175, 0, 0.175, 0);
    l_ImageLabel_0.Size = UDim2.new(0.65, 0, 0.65, 0);
    l_ImageLabel_0.BackgroundTransparency = 1;
    if v31.image and type(v31.image) == "string" then
        l_ImageLabel_0.Image = v31.image;
    end;
    l_ImageLabel_0.Parent = l_ImageButton_0;
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Name = "ActionTitle";
    l_TextLabel_0.Size = UDim2.new(1, 0, 1, 0);
    l_TextLabel_0.BackgroundTransparency = 1;
    l_TextLabel_0.Font = Enum.Font.SourceSansBold;
    l_TextLabel_0.TextColor3 = Color3.new(1, 1, 1);
    l_TextLabel_0.TextStrokeTransparency = 0;
    l_TextLabel_0.FontSize = Enum.FontSize.Size18;
    l_TextLabel_0.TextWrapped = true;
    l_TextLabel_0.Text = "";
    if v31.title and type(v31.title) == "string" then
        l_TextLabel_0.Text = v31.title;
    end;
    l_TextLabel_0.Parent = l_ImageButton_0;
    return l_ImageButton_0;
end;
createButton = function(v41, v42)
    local v43 = createNewButton(v41, v42);
    local v44 = nil;
    for v45 = 1, #v6 do
        if v6[v45] == "empty" then
            v44 = v45;
            break;
        end;
    end;
    if not v44 then
        v44 = #v6 + 1;
    end;
    if v11 < v44 then
        return ;
    else
        v6[v44] = v43;
        v5[v41].button = v43;
        v43.Position = v10[v44];
        v43.Parent = v8;
        if v7 and v7.Parent == nil then
            v7.Parent = v14;
            if not v8.Parent then
                v8.Parent = v7;
            end;
        end;
        return ;
    end;
end;
removeAction = function(v46)
    if v5[v46] then
        local l_button_0 = v5[v46].button;
        if l_button_0 then
            l_button_0.Parent = nil;
            for v48 = 1, #v6 do
                if v6[v48] == l_button_0 then
                    v6[v48] = "empty";
                    break;
                end;
            end;
            l_button_0:Destroy();
        end;
        v5[v46] = nil;
        return ;
    else
        return ;
    end;
end;
addAction = function(v49, v50, v51)
    if v5[v49] then
        removeAction(v49);
    end;
    v5[v49] = {
        v51
    };
    if not (not v50 or not l_TouchEnabled_0) then
        createContextActionGui();
        createButton(v49, v51);
    end;
end;
l_ContextActionService_0.BoundActionChanged:connect(function(v52, v53, v54)
    if not (not v5[v52] or not v54) then
        local l_button_1 = v5[v52].button;
        local v56 = v54[v53] or (not (v53 ~= "image" and v53 ~= "title") or v53 == "description") and "";
        if l_button_1 then
            if v53 == "image" then
                l_button_1.ActionIcon.Image = v56;
                return ;
            elseif v53 == "title" then
                l_button_1.ActionTitle.Text = v56;
                return ;
            elseif v53 == "description" then
                return ;
            elseif v53 == "position" then
                l_button_1.Position = v56;
            end;
        end;
    end;
end);
l_ContextActionService_0.BoundActionAdded:connect(function(v57, v58, v59)
    addAction(v57, v58, v59);
end);
l_ContextActionService_0.BoundActionRemoved:connect(function(v60, _)
    removeAction(v60);
end);
l_ContextActionService_0.GetActionButtonEvent:connect(function(v62)
    if v5[v62] then
        l_ContextActionService_0:FireActionButtonFoundSignal(v62, v5[v62].button);
    end;
end);
for v63, v64 in pairs((l_ContextActionService_0:GetAllBoundActionInfo())) do
    addAction(v63, v64.createTouchButton, v64);
end;


local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_HttpService_0 = game:GetService("HttpService");
local l_Players_0 = game:GetService("Players");
local l_RobloxReplicatedStorage_0 = game:GetService("RobloxReplicatedStorage");
local l_RunService_0 = game:GetService("RunService");
local l_ScriptContext_0 = game:GetService("ScriptContext");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local v10 = require(l_RobloxGui_0.Modules.ErrorReporting.RateLimiter);
local v11 = require(l_RobloxGui_0.Modules.ErrorReporting.PiiFilter);
local l_BacktraceReporter_0 = require(l_CorePackages_0.Workspace.Packages.ErrorReporters).BacktraceReporter;
local v13 = require(l_CorePackages_0.Packages.React);
game:DefineFastFlag("DisableCorescriptBacktraceReporting", false);
game:DefineFastString("CoreScriptBacktraceErrorUploadToken", "");
game:DefineFastInt("CoreScriptBacktracePIIFilterEraseTimeoutSeconds", 300);
game:DefineFastFlag("CoreScriptBacktraceRepeatedErrorRateLimiting", true);
game:DefineFastInt("CoreScriptBacktraceRepeatedErrorRateLimitCount", 5);
game:DefineFastInt("CoreScriptBacktraceRepeatedErrorRateLimitPeriod", 60);
game:DefineFastInt("CoreScriptBacktraceRepeatedErrorRateLimitProcessIntervalTenths", 10);
game:DefineFastFlag("AddRobloxChannelToLuaBacktrace", false);
game:DefineFastInt("CoreScriptBacktraceErrorReportPercentage", 100);
local function _()
    return math.random(1, 100) <= math.clamp(game:GetFastInt("CoreScriptBacktraceErrorReportPercentage"), 0, 100);
end;
if not (not (not game:GetFastFlag("DisableCorescriptBacktraceReporting") and game:GetFastString("CoreScriptBacktraceErrorUploadToken") ~= "") or not (math.random(1, 100) <= math.clamp(game:GetFastInt("CoreScriptBacktraceErrorReportPercentage"), 0, 100))) then
    local v15 = {
        LocalVersion = l_RunService_0:GetRobloxVersion(),
        BaseUrl = l_ContentProvider_0.BaseUrl,
        PlaceId = game.PlaceId,
        Platform = l_UserInputService_0:GetPlatform().Name,
        UserAgent = l_HttpService_0:GetUserAgent(),
        CoreScriptVersion = l_RunService_0:GetCoreScriptVersion()
    };
    local v16 = v11.new({
        eraseTimeout = game:GetFastInt("CoreScriptBacktracePIIFilterEraseTimeoutSeconds")
    });
    local l_CoreScriptBacktraceRepeatedErrorRateLimiting_0 = game:GetFastFlag("CoreScriptBacktraceRepeatedErrorRateLimiting");
    local v18 = nil;
    if l_CoreScriptBacktraceRepeatedErrorRateLimiting_0 then
        v18 = v10.new({
            period = game:GetFastInt("CoreScriptBacktraceRepeatedErrorRateLimitPeriod"),
            threshold = game:GetFastInt("CoreScriptBacktraceRepeatedErrorRateLimitCount"),
            processInterval = game:GetFastInt("CoreScriptBacktraceRepeatedErrorRateLimitProcessIntervalTenths") / 10
        });
    end;
    local v20 = l_BacktraceReporter_0.new({
        httpService = l_HttpService_0,
        token = game:GetFastString("CoreScriptBacktraceErrorUploadToken"),
        processErrorReportMethod = function(v19)
            v19:addAttributes(v15);
            v19:addAttributes({
                PlayerCount = #l_Players_0:GetPlayers()
            });
            if game:GetFastFlag("AddRobloxChannelToLuaBacktrace") then
                v19:addAttributes({
                    RobloxChannel = l_RunService_0:GetRobloxClientChannel()
                });
            end;
            return v19;
        end
    });
    do
        local l_v18_0 = v18;
        local function v31(v22, v23, v24, v25)
            if not (not (v24 ~= nil) or not v24:IsDescendantOf(l_CoreGui_0) and not v24:IsDescendantOf(l_CorePackages_0)) then
                local v26, v27 = v13.unstable_parseReactError(v22);
                v22 = v26.message;
                v23 = v26.stack or v23;
                v25 = v25 or v27;
                local v28 = v16:cleanPii(v22);
                local v29 = v16:cleanPii(v23);
                if v25 ~= nil then
                    v25 = v16:cleanPii(v25);
                end;
                if l_CoreScriptBacktraceRepeatedErrorRateLimiting_0 then
                    local v30 = v28 .. v29;
                    if not l_v18_0:isRateLimited(v30) then
                        l_v18_0:increment(v30);
                    else
                        return ;
                    end;
                end;
                v20:reportErrorDeferred(v28, v29, v25);
            end;
        end;
        l_ScriptContext_0.ErrorDetailed:Connect(function(...)
            local l_status_0, l_result_0 = pcall(v31, ...);
            if not l_status_0 then
                warn(("CoreScript error reporter failed to handle an error:\n%s"):format(l_result_0));
            end;
        end);
        v15.ServerVersion = l_RobloxReplicatedStorage_0:WaitForChild("GetServerVersion", math.huge):InvokeServer();
    end;
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local v4 = require(l_RobloxGui_0.Modules.Common.CoreScriptsRootProvider);
local v5 = require(l_RobloxGui_0.Modules.GamepadDisconnect.CoreScriptsGamepadDisconnectListener);
local v6 = require(l_CorePackages_0.Packages.React);
local v7 = require(l_CorePackages_0.Packages.Roact);
local l_DeviceType_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppEnums).DeviceType;
local l_useLogInputTypeChanged_0 = require(l_CorePackages_0.Workspace.Packages.UiShellEvents).useLogInputTypeChanged;
local l_GetFFlagLogInputTypeChanged_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagLogInputTypeChanged;
local v11 = require(l_CorePackages_0.Workspace.Packages.Analytics).AnalyticsReporters.EventIngest.new((game:GetService("EventIngestService")));
local l_game_EngineFeature_0 = game:GetEngineFeature("RbxAnalyticsServiceExposePlaySessionId");
v7.mount(v6.createElement(function(_)
    if l_GetFFlagLogInputTypeChanged_0() then
        if not l_game_EngineFeature_0 then
            l_useLogInputTypeChanged_0(v11);
        else
            l_useLogInputTypeChanged_0(v11, l_RbxAnalyticsService_0:GetPlaySessionId());
        end;
    end;
    return v6.createElement(v4, {
        styleOverride = {
            deviceType = l_DeviceType_0.Console
        }
    }, {
        CoreScriptsGamepadDisconnectListener = v6.createElement(v5)
    });
end), l_CoreGui_0, "CoreScriptsGlobalEffects");


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_TextChatService_0 = game:GetService("TextChatService");
local l_StarterGui_0 = game:GetService("StarterGui");
local v4 = l_CoreGui_0:WaitForChild("RobloxGui", math.huge);
local v5 = require(v4.Modules.Flags.GetFFlagConsolidateBubbleChat);
if not game:IsLoaded() then
    local _ = game.Loaded:Wait();
end;
if not v5() and l_TextChatService_0.ChatVersion ~= Enum.ChatVersion.TextChatService then
    return ;
else
    local v7 = require(v4.Modules.RobloxTranslator);
    local v8 = require(v4.Modules.ApolloClient);
    local v9 = require(l_CorePackages_0.ExperienceChat);
    local v10 = game:DefineFastFlag("FFlagEnableSetCoreGuiEnabledExpChat", false);
    local v11 = game:DefineFastFlag("ExperienceChatSiblingZIndexBehavior", false);
    local v12 = require(v4.Modules.Flags.FFlagAvatarChatCoreScriptSupport);
    local v13 = require(v4.Modules.Flags.getFFlagAddApolloClientToExperienceChat);
    local v14 = require(v4.Modules.Flags.getFFlagDoNotPromptCameraPermissionsOnMount);
    local v15 = require(v4.Modules.Flags.getFFlagEnableAlwaysAvailableCamera);
    local v16 = require(v4.Modules.Flags.GetFFlagRemoveInGameChatBubbleChatReferences);
    local v17 = require(v4.Modules.Flags.getFFlagRenderVoiceBubbleAfterAsyncInit);
    local v18 = require(v4.Modules.Chrome.Enabled)();
    local v19 = require(v4.Modules.VoiceChat.Components.getIconVoiceIndicator);
    local v20 = require(v4.Modules.VoiceChat.Components.onClickedVoiceIndicator);
    local v21 = nil;
    local v22 = nil;
    local v23 = nil;
    local v24 = nil;
    local v25 = nil;
    local v26 = nil;
    local v27 = nil;
    if v12 then
        v21 = require(v4.Modules.VoiceChat.Components.onClickedCameraIndicator);
        v22 = require(v4.Modules.VoiceChat.Components.getPermissions);
        v23 = require(v4.Modules.VoiceChat.Components.selfViewListenerChanged);
        if v14() then
            v24 = require(v4.Modules.InGameChat.BubbleChat.Helpers.displayCameraDeniedToast);
            if v16() then
                v24 = require(v4.Modules.VoiceChat.Helpers.displayCameraDeniedToast);
            end;
            v25 = require(v4.Modules.Settings.isCamEnabledForUserAndPlace);
        end;
        if v15() then
            v26 = require(v4.Modules.Settings.isCameraOnlyUser);
        end;
        if v17() then
            v27 = require(v4.Modules.VoiceChat.Components.isVoiceServiceInitialized);
        end;
    end;
    if v18 then
        v22 = require(v4.Modules.VoiceChat.Components.getPermissions);
    end;
    local l_ScreenGui_0 = Instance.new("ScreenGui");
    l_ScreenGui_0.Name = "ExperienceChat";
    l_ScreenGui_0.ResetOnSpawn = false;
    l_ScreenGui_0.DisplayOrder = -1;
    if v11 then
        l_ScreenGui_0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
    end;
    l_ScreenGui_0.Parent = l_CoreGui_0;
    local function v31(v29)
        local l_l_TextChatService_0_FirstChild_0 = l_TextChatService_0:FindFirstChild(v29, true);
        while not l_l_TextChatService_0_FirstChild_0 do
            wait();
            l_l_TextChatService_0_FirstChild_0 = l_TextChatService_0:FindFirstChild(v29, true);
        end;
        return l_l_TextChatService_0_FirstChild_0;
    end;
    if v10 then
        l_StarterGui_0.CoreGuiChangedSignal:Connect(function(v32, v33)
            if not (v32 ~= Enum.CoreGuiType.All) or v32 == Enum.CoreGuiType.Chat then
                v9.Events.SetCoreGuiEnabledChanged(v33);
            end;
        end);
    end;
    local v34 = nil;
    local v35 = nil;
    if not v5() then
        v34 = l_TextChatService_0.CreateDefaultTextChannels;
    else
        local v36 = false;
        if l_TextChatService_0.ChatVersion == Enum.ChatVersion.TextChatService then
            v36 = l_TextChatService_0.CreateDefaultTextChannels;
        end;
        v34 = v36;
        v35 = require(v4.Modules.InGameChat.BubbleChat.Types).IChatSettings;
    end;
    v9.mountClientApp({
        apolloClient = if not v13() then nil else v8,
        getIconVoiceIndicator = v19 or nil,
        onClickedVoiceIndicator = v20 or nil,
        onClickedCameraIndicator = v21 or nil,
        displayCameraDeniedToast = v24 or nil,
        isCamEnabledForUserAndPlace = v25 or nil,
        isCameraOnlyUser = v26 or nil,
        getPermissions = v22 or nil,
        selfViewListenerChanged = v23 or nil,
        defaultTargetTextChannel = if not v34 then nil else v31("RBXGeneral"),
        defaultSystemTextChannel = if not v34 then nil else v31("RBXSystem"),
        validateLegacyBubbleChatSettings = v35 or nil,
        isVoiceServiceInitialized = v27 or nil,
        translator = v7,
        parent = l_ScreenGui_0
    });
    return ;
end;