local l_Players_0 = game:GetService("Players");
local l_TextChatService_0 = game:GetService("TextChatService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v4 = require(l_Parent_0.React);
local v5 = require(l_Parent_0.UIBlox);
local v6 = require(l_Parent_0.Promise);
local l_List_0 = require(l_Parent_0.llama).List;
local l_Images_0 = v5.App.ImageSet.Images;
local l_ImageSetLabel_0 = v5.Core.ImageSet.ImageSetLabel;
local v10 = require(l_script_FirstAncestor_0.ClientSettings.useInterpolatedClientSettings);
local v11 = require(l_script_FirstAncestor_0.Config);
local v12 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/" .. script.Name);
local v13 = require(l_script_FirstAncestor_0.Commands.autoCastCommand);
local v14 = require(l_script_FirstAncestor_0.Commands.Whisper.RBXWhisperCommand);
local v15 = require(l_script_FirstAncestor_0.Commands.RBXTeamCommand);
local v16 = require(l_script_FirstAncestor_0.Localization);
local v17 = require(l_script_FirstAncestor_0.getOtherDisplayNameInWhisperChannel);
local v18 = require(script.Parent.ChannelChip);
local v19 = require(l_script_FirstAncestor_0.Autocomplete.AutocompleteText);
local v20 = require(l_script_FirstAncestor_0.Autocomplete.Initializations.initializeEmojis);
local v21 = require(l_script_FirstAncestor_0.Autocomplete.Initializations.initializeCommands);
local v22 = require(l_script_FirstAncestor_0.Autocomplete.SortingCallbacks.sortEmojiResultsCallback);
local v23 = require(l_script_FirstAncestor_0.Autocomplete.SortingCallbacks.sortCommandResultsCallback);
local v24 = require(script:FindFirstAncestor("ChatInput").UI.AutocompleteDropdown);
local v25 = require(l_script_FirstAncestor_0.Flags.GetFFlagFixChatInputFocus);
local v26 = require(l_script_FirstAncestor_0.Flags.getEnableChatInputBarConfigurationPropertyIsFocused);
local v27 = require(l_script_FirstAncestor_0.Flags.getEnableChatInputBarConfigurationAutocompleteEnabled);
local v28 = require(l_script_FirstAncestor_0.Flags.FFlagEnableCommandAutocomplete);
local v29 = game:DefineFastFlag("TriggerEmojiAutocompleteWithTwoCharacters", false);
local v30 = require(l_script_FirstAncestor_0.Flags.getTextChatServiceTextChatCommandAutocompleteVisible);
local function v34(v31, v32)
    return v32:map(function(v33)
        return v31 + v33 * (1 - v31);
    end);
end;
return v16.connect(function(v35)
    local v36 = nil;
    if v35.targetTextChannel then
        for v37, v38 in pairs({
            RBXTeam = "CoreScripts.TextChat.TeamChat.PrefixText",
            RBXWhisper = "CoreScripts.TextChat.WhisperChat.PrefixText.Outgoing"
        }) do
            if string.match(v35.targetTextChannel.Name, v37) then
                if v37 == "RBXWhisper" then
                    local v39 = v17(v35.targetTextChannel, v35.localPlayer);
                    if v39 then
                        v36 = {
                            v38,
                            {
                                RBX_NAME = v39
                            }
                        };
                    end;
                else
                    v36 = v38;
                end;
            end;
        end;
    end;
    return {
        targetTextChannelDisplayName = v36
    };
end)(function(v40)
    local v41, v42 = v4.useState("");
    local v43, v44 = v4.useState(false);
    local v45, v46 = v4.useState(0);
    local v47, v48 = v4.useBinding(0);
    local v49 = v4.useRef(false);
    local v50 = v4.useRef(nil);
    local v51 = v4.useRef(nil);
    local v52 = v4.useRef(nil);
    local v53 = v4.useRef(nil);
    local v54 = v4.useRef(false);
    local v55, v56 = v4.useState(0);
    local v57 = v19.new(v20);
    local v58 = v19.new(v21);
    v4.useEffect(function()
        if v28() then
            l_TextChatService_0.ChildAdded:Connect(function(v59)
                if v59.ClassName == "TextChatCommand" and string.sub(v59.PrimaryAlias, 1, 1) == "/" then
                    v58 = v19.new(v21);
                    if v30() then
                        v59:GetPropertyChangedSignal("AutocompleteVisible"):Connect(function()
                            v58 = v19.new(v21);
                        end);
                    end;
                end;
            end);
        end;
    end, {});
    local v61 = v4.useCallback(function()
        v12:trace("onSendActivated with input text: '{}'", v41);
        if v49.current and v40.canLocalUserChat then
            if not v50.current then
                v12:debug("onSendActivated could not send message because textBoxRef.current was nil");
            else
                local l_Text_0 = v50.current.Text;
                if v40.onSendChat and string.find(l_Text_0, "%S") ~= nil then
                    v40.onSendChat(l_Text_0);
                else
                    v12:debug("onSendActivated could not send message. text: '{}' canLocalUserChat: {}", l_Text_0, v40.canLocalUserChat);
                end;
                v50.current.Text = "";
                v50.current:ReleaseFocus();
                v42("");
                if v40.targetTextChannel and v40.targetTextChannelDisplayName ~= "" then
                    v54.current = true;
                    return ;
                end;
            end;
            return ;
        else
            v12:debug("onSendActivated could not send message. isMounted: {} canLocalUserChat: {}", tostring(v49.current), v40.canLocalUserChat);
            return ;
        end;
    end, {
        v41
    });
    local v68 = v4.useCallback(function(v62)
        v40.autocompleteDropdownActivated(false);
        v40.autocompleteDropdownResultsChanged({});
        local l_current_0 = v50.current;
        if not l_current_0 then
            v12:error("Could not find textBox");
            return ;
        else
            local l_Text_1 = l_current_0.Text;
            local v65 = string.sub(l_Text_1, 1, v45 - 1);
            local v66 = string.sub(l_Text_1, v45, #l_Text_1);
            local v67 = "";
            if v40.autocompleteDropdownReducer.autocompleteType == "emojis" then
                v67 = string.gsub(v65, ":[^:]*$", v62.EmojiLabel.Text);
            elseif v28() and v40.autocompleteDropdownReducer.autocompleteType == "commands" then
                v67 = string.gsub(v65, "(/.*)", v62.TextLabel.Text);
            end;
            if v66 ~= "" then
                v67 = v67 .. v66;
            end;
            l_current_0.Text = v67;
            v42(v67);
            if v49.current then
                l_current_0:CaptureFocus();
                if v66 ~= "" then
                    l_current_0.CursorPosition = (#v67 - #v66) + 1;
                end;
            end;
            v40.autocompleteDropdownDeactivated();
            return ;
        end;
    end);
    v4.useEffect(function()
        if v49.current then
            local l_current_1 = v50.current;
            if not l_current_1 then
                v12:error("Could not focus chat input bar because textBox not found");
            else
                l_current_1:CaptureFocus();
                return ;
            end;
        end;
    end, {
        v40.shouldFocusChatInputBar
    });
    v4.useEffect(function()
        v12:trace("Mounted");
        v49.current = true;
        return function()
            v12:trace("Unmounting");
            v49.current = false;
        end;
    end, {});
    v4.useEffect(function()
        if v40.autocompleteEnabled then
            local l_current_2 = v50.current;
            if l_current_2 then
                l_current_2:GetPropertyChangedSignal("CursorPosition"):Connect(function()
                    local l_CursorPosition_0 = l_current_2.CursorPosition;
                    if l_CursorPosition_0 and l_CursorPosition_0 ~= -1 then
                        v46(l_CursorPosition_0);
                    end;
                end);
            end;
        end;
    end, {});
    v4.useEffect(function()
        if not v40.autocompleteEnabled then
            return function()
            end;
        else
            v53.current = v40.userInputService.InputBegan:connect(function(v72, _)
                if v40.autocompleteDropdownReducer.activated and (Enum.KeyCode.Up or Enum.KeyCode.Down) then
                    if v72.KeyCode == Enum.KeyCode.Up and v40.autocompleteDropdownReducer.selectedIndex > 1 then
                        v40.autocompleteDropdownSelectionChanged(v40.autocompleteDropdownReducer.selectedIndex - 1);
                    end;
                    if v72.KeyCode == Enum.KeyCode.Down and v40.autocompleteDropdownReducer.selectedIndex < #v40.autocompleteDropdownReducer.results then
                        v40.autocompleteDropdownSelectionChanged(v40.autocompleteDropdownReducer.selectedIndex + 1);
                    end;
                end;
            end);
            return function()
                local l_current_3 = v53.current;
                if not (not l_current_3 or not l_current_3.Connected) then
                    l_current_3:Disconnect();
                end;
                v53.current = nil;
            end;
        end;
    end, {
        v40.userInputService,
        v40.autocompleteDropdownReducer
    });
    v4.useEffect(function()
        v52.current = v40.userInputService.InputEnded:connect(function(v75, _)
            if (v50.current and v50.current:IsFocused()) and v75.KeyCode == Enum.KeyCode.Backspace then
                if not v54.current then
                    if v41 == "" and v40.targetTextChannelDisplayName ~= "" then
                        v54.current = true;
                    end;
                else
                    v40.resetTargetChannel();
                    v12:debug("ChatInputBar ChatInputBarResetTargetChannel()");
                    v54.current = false;
                    return ;
                end;
            end;
        end);
        return function()
            local l_current_4 = v52.current;
            if not (not l_current_4 or not l_current_4.Connected) then
                l_current_4:Disconnect();
            end;
            v52.current = nil;
        end;
    end, {
        v40.userInputService
    });
    v4.useEffect(function()
        v40.contextActionService:BindCoreAction("FocusChat", function(_, v79, v80)
            if v40.isChatHotkeyEnabled and (not (v80.KeyCode ~= v11.ChatInputBarDefaultFocusKeyCode) or v80.KeyCode == v40.devDefinedFocusKeyCode) then
                local l_current_5 = v50.current;
                if not ((not (l_current_5 and v79 == Enum.UserInputState.Begin) or not l_current_5) or l_current_5:IsFocused()) then
                    if not v25() then
                        task.defer(function()
                            l_current_5:CaptureFocus();
                        end);
                    else
                        task.delay(0, function()
                            l_current_5:CaptureFocus();
                        end);
                    end;
                    v40.focusChatHotKeyActivated();
                    return Enum.ContextActionResult.Sink;
                end;
            end;
            return Enum.ContextActionResult.Pass;
        end, false, Enum.UserInputType.Keyboard);
        return function()
            v40.contextActionService:UnbindCoreAction("FocusChat");
        end;
    end, {
        v40.isChatHotkeyEnabled,
        v40.devDefinedFocusKeyCode
    });
    local function _(v82)
        local l_ChatInputBarConfiguration_0 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
        if not (not l_ChatInputBarConfiguration_0 or not v26()) then
            l_ChatInputBarConfiguration_0.IsFocusedWrite = v82;
        end;
    end;
    local v86 = v4.useCallback(function()
        v44(true);
        v40.onFocus();
        local l_ChatInputBarConfiguration_1 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
        if not (not l_ChatInputBarConfiguration_1 or not v26()) then
            l_ChatInputBarConfiguration_1.IsFocusedWrite = true;
        end;
    end, {
        v40.onFocus
    });
    local v103 = v4.useCallback(function(_, v88, v89)
        v12:debug("Focus lost with enter: {}", (tostring(v88)));
        local l_current_6 = v51.current;
        if v88 then
            if not ((not v40.autocompleteEnabled or not l_current_6) or not v40.autocompleteDropdownReducer.activated) and #v40.autocompleteDropdownReducer.results > 0 then
                for _, v92 in ipairs(l_current_6.ScrollBarFrame.ScrollViewFrame.ScrollView.OffsetFrame:GetChildren()) do
                    if v92.ClassName == "Frame" and v92.LayoutOrder == v40.autocompleteDropdownReducer.selectedIndex then
                        v68(v92.TextLabelButton);
                        return ;
                    end;
                end;
            else
                v61();
            end;
        end;
        if v49.current then
            if (not v40.autocompleteEnabled or not l_current_6) or not v40.autocompleteDropdownReducer.activated then
                v44(false);
            elseif v89.KeyCode == Enum.KeyCode.Escape then
                v40.autocompleteDropdownActivated(false);
                local l_current_7 = v50.current;
                if not l_current_7 then
                    v12:error("Could not focus chat input bar because textBox not found");
                else
                    local l_v45_0 = v45;
                    l_current_7:CaptureFocus();
                    l_current_7.CursorPosition = l_v45_0;
                    return ;
                end;
            else
                local l_X_0 = v89.Position.X;
                local l_Y_0 = v89.Position.Y;
                local l_X_1 = l_current_6.AbsolutePosition.X;
                local v98 = l_X_1 + l_current_6.AbsoluteSize.X;
                local l_Y_1 = l_current_6.AbsolutePosition.Y;
                local v100 = l_Y_1 + l_current_6.AbsoluteSize.Y;
                if not ((l_X_0 >= l_X_1 and v98 >= l_X_0) and l_Y_0 >= l_Y_1) or v100 < l_Y_0 then
                    v40.autocompleteDropdownActivated(false);
                end;
            end;
        end;
        v40.onUnfocus();
        local l_ChatInputBarConfiguration_2 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
        if not (not l_ChatInputBarConfiguration_2 or not v26()) then
            l_ChatInputBarConfiguration_2.IsFocusedWrite = false;
        end;
        l_ChatInputBarConfiguration_2 = l_Players_0.LocalPlayer;
        if l_ChatInputBarConfiguration_2 then
            local l_TextBox_0 = Instance.new("TextBox");
            l_TextBox_0.Visible = false;
            l_TextBox_0.Parent = l_ChatInputBarConfiguration_2:FindFirstChildOfClass("PlayerGui");
            l_TextBox_0:CaptureFocus();
            l_TextBox_0:ReleaseFocus();
            l_TextBox_0:Destroy();
        end;
    end);
    local function v120(v104, v105, v106)
        if v28() and (not (not (v106 == "/") or v104.CursorPosition ~= 2) or v40.autocompleteDropdownReducer.autocompleteType == "commands" and v106 ~= ":") then
            v40.autocompleteDropdownTypeChanged("commands");
            v40.autocompleteDropdownActivated(true);
            if v106 ~= "" and v106 ~= " " then
                local v107 = string.sub(v105, 1, v104.CursorPosition - 1):lower();
                local v108 = v58:getResults(v107, v23);
                v40.autocompleteDropdownResultsChanged(v108);
                if v107 == v108[1] then
                    v40.autocompleteDropdownActivated(false);
                    v40.autocompleteDropdownResultsChanged({});
                    return ;
                end;
            else
                v40.autocompleteDropdownDeactivated();
            end;
            return ;
        elseif (v40.autocompleteDropdownReducer.activated or #v40.autocompleteDropdownReducer.results > 0) and v40.autocompleteDropdownReducer.autocompleteType == "emojis" then
            v40.autocompleteDropdownActivated(true);
            local v109 = string.find(string.sub(v105, 1, v104.CursorPosition - 1), ":[^:]*$");
            if not ((v106 ~= "" and v106 ~= ":") and v106 ~= " ") or not v109 then
                if v106 == ":" then
                    if v109 ~= v55 then
                        local v110 = string.sub(v105, v55 + 1, v104.CursorPosition - 2):lower();
                        if not l_List_0.includes(v40.autocompleteDropdownReducer.results, v110) then
                            v40.autocompleteDropdownActivated(false);
                            v40.autocompleteDropdownResultsChanged({});
                        else
                            local v111 = string.sub(v105, 1, v104.CursorPosition - 2) .. string.sub(v105, v104.CursorPosition, #v105);
                            v104.Text = v111;
                            v42(v111);
                            v104.CursorPosition = v104.CursorPosition - 1;
                            local l_current_8 = v51.current;
                            if l_current_8 then
                                for _, v114 in ipairs(l_current_8.ScrollBarFrame.ScrollViewFrame.ScrollView.OffsetFrame:GetChildren()) do
                                    if v114.ClassName == "Frame" then
                                        local l_TextLabelButton_0 = v114:FindFirstChild("TextLabelButton");
                                        if l_TextLabelButton_0 then
                                            local l_TextLabel_0 = l_TextLabelButton_0:FindFirstChild("TextLabel");
                                            if not (not l_TextLabel_0 or not l_TextLabel_0.Text) and l_TextLabel_0.Text == v110 then
                                                v68(l_TextLabelButton_0);
                                                return ;
                                            end;
                                        end;
                                    end;
                                end;
                                return ;
                            end;
                        end;
                        return ;
                    else
                        v40.autocompleteDropdownResultsChanged({});
                        return ;
                    end;
                elseif v106 == " " then
                    v40.autocompleteDropdownActivated(false);
                    v40.autocompleteDropdownResultsChanged({});
                    return ;
                else
                    v40.autocompleteDropdownDeactivated();
                    v56(0);
                    return ;
                end;
            elseif not v29 then
                v40.autocompleteDropdownResultsChanged((v57:getResults(string.sub(v105, v109 + 1, v104.CursorPosition - 1):lower(), v22)));
                return ;
            else
                local v117 = string.sub(v105, v109 + 1, v104.CursorPosition - 1):lower();
                local v118 = {};
                if v117 and string.len(v117) > 1 then
                    v118 = v57:getResults(v117, v22);
                end;
                v40.autocompleteDropdownResultsChanged(v118);
                return ;
            end;
        else
            local v119 = string.find(v105, ":[^:]*$");
            if v106 == ":" then
                v40.autocompleteDropdownTypeChanged("emojis");
                v40.autocompleteDropdownActivated(true);
                v40.autocompleteDropdownResultsChanged({});
                v56(v119);
            end;
            return ;
        end;
    end;
    local v131 = v4.useCallback(function(v121)
        local l_Text_2 = v121.Text;
        if v40.autocompleteEnabled then
            local v123 = string.find(l_Text_2, "\r");
            local v124 = v121.CursorPosition < #l_Text_2 + 1;
            if v123 then
                local v125 = string.gsub(l_Text_2, "\r", "");
                v121.Text = v125;
                v42(v125);
                if v124 then
                    v121.CursorPosition = v121.CursorPosition - 1;
                end;
                return ;
            end;
        end;
        local v126 = string.sub(l_Text_2, v121.CursorPosition - 1, v121.CursorPosition - 1);
        v12:trace("Input: {}", l_Text_2);
        local v127 = if not utf8.len(l_Text_2) then string.len(l_Text_2) else utf8.len(utf8.nfcnormalize(l_Text_2));
        if v127 and v40.messageCharacterLimit < v127 then
            v12:debug("Message is over the character limit of {}", (tostring(v40.messageCharacterLimit)));
            v121.Text = v41;
            return ;
        else
            v42(l_Text_2);
            if not (not v27() or not v40.autocompleteEnabled) then
                v120(v121, l_Text_2, v126);
            end;
            local l_v54_0 = v54;
            local v129 = false;
            if #l_Text_2 == 0 then
                v129 = v54.current;
            end;
            l_v54_0.current = v129;
            if v40.localPlayer then
                l_v54_0 = v40.localPlayer.UserId;
                v6.any({
                    v13(v15, l_v54_0, l_Text_2),
                    v13(v14, l_v54_0, l_Text_2)
                }):andThen(function()
                    v121.Text = "";
                    v42("");
                    v54.current = true;
                end):catch(function(v130)
                    v12:trace("Could not send autoCastCommand. Error: {}", v130);
                end);
            end;
            return ;
        end;
    end);
    local v133 = v4.useCallback(function(v132)
        v48(not not v132.Visible and v132.AbsoluteSize.X or 0);
    end);
    local v135 = v4.useCallback(function(v134)
        v40.autocompleteDropdownSelectionChanged(v134.LayoutOrder);
    end);
    local v136 = v41 == "";
    local v137 = v136 and not v43;
    local l_chatInputBarSettings_0 = v40.chatInputBarSettings;
    local l_chatWindowSettings_0 = v40.chatWindowSettings;
    local l_BackgroundTransparency_0 = v10(l_chatInputBarSettings_0).BackgroundTransparency;
    local l_BackgroundTransparency_1 = v10(l_chatWindowSettings_0).BackgroundTransparency;
    local l_BackgroundColor3_0 = v10(l_chatWindowSettings_0).BackgroundColor3;
    local l_createElement_0 = v4.createElement;
    local v144 = "Frame";
    local v150 = {
        AutomaticSize = Enum.AutomaticSize.Y,
        BackgroundColor3 = l_BackgroundColor3_0,
        BackgroundTransparency = v40.transparencyValue:map(function(v145)
            return l_BackgroundTransparency_1 + v145 * (1 - l_BackgroundTransparency_1);
        end),
        BorderSizePixel = 0,
        LayoutOrder = v40.LayoutOrder,
        Size = v40.size,
        Visible = v40.visible,
        [v4.Event.MouseEnter] = v40.onHovered,
        [v4.Event.MouseLeave] = v40.onUnhovered,
        [v4.Change.AbsoluteSize] = v4.useCallback(function(v146)
            local l_ChatInputBarConfiguration_3 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
            if not (not l_ChatInputBarConfiguration_3 or not v40.onAbsoluteSizeChanged) then
                v40.onAbsoluteSizeChanged(v146, l_ChatInputBarConfiguration_3);
            end;
        end),
        [v4.Change.AbsolutePosition] = v4.useCallback(function(v148)
            local l_ChatInputBarConfiguration_4 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
            if not (not l_ChatInputBarConfiguration_4 or not v40.onAbsolutePositionChanged) then
                v40.onAbsolutePositionChanged(v148, l_ChatInputBarConfiguration_4);
            end;
        end)
    };
    local v151 = {
        AutocompleteDropdown = (not not v27() and v40.autocompleteEnabled) and v4.createElement(v24, {
            chatInputBarSettings = l_chatInputBarSettings_0,
            chatWindowSettings = l_chatWindowSettings_0,
            setTransparency = v34,
            transparencyValue = v40.transparencyValue,
            activated = v40.autocompleteDropdownReducer.activated and v43,
            results = v40.autocompleteDropdownReducer.results,
            selectedIndex = v40.autocompleteDropdownReducer.selectedIndex,
            autocompleteType = v40.autocompleteDropdownReducer.autocompleteType,
            onAutocompleteDropdownHover = v135,
            onAutocompleteSelected = v68,
            autocompleteDropdownRef = v51,
            textBoxRef = v50
        }) or nil,
        UISizeConstraint = v4.createElement("UISizeConstraint", {
            MaxSize = Vector2.new(v11.ChatWindowMaxWidth, math.huge)
        }),
        UIPadding = v4.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, 8),
            PaddingRight = UDim.new(0, 8),
            PaddingTop = not not v40.addTopPadding and UDim.new(0, 8) or UDim.new(0, 0),
            PaddingBottom = UDim.new(0, 1)
        })
    };
    local l_createElement_1 = v4.createElement;
    local v153 = "Frame";
    local v155 = {
        AutomaticSize = Enum.AutomaticSize.XY,
        BackgroundColor3 = l_chatInputBarSettings_0.BackgroundColor3,
        BackgroundTransparency = v40.transparencyValue:map(function(v154)
            return l_BackgroundTransparency_0 + v154 * (1 - l_BackgroundTransparency_0);
        end),
        Size = UDim2.new(1, 0, 0, 0)
    };
    local v156 = {};
    local l_createElement_2 = v4.createElement;
    local v158 = "UIStroke";
    local v159 = {
        ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
        Color = v11.ChatInputBarBorderColor3
    };
    local l_ChatInputBarBorderTransparency_0 = v11.ChatInputBarBorderTransparency;
    local l_l_ChatInputBarBorderTransparency_0_0 = l_ChatInputBarBorderTransparency_0 --[[ copy: 47 -> 60 ]];
    v159.Transparency = v40.transparencyValue:map(function(v162)
        return l_l_ChatInputBarBorderTransparency_0_0 + v162 * (1 - l_l_ChatInputBarBorderTransparency_0_0);
    end);
    v156.Border = l_createElement_2(v158, v159);
    v156.Corner = v4.createElement("UICorner", {
        CornerRadius = UDim.new(0, 3)
    });
    l_createElement_2 = v4.createElement;
    v158 = "Frame";
    v159 = {
        AutomaticSize = Enum.AutomaticSize.Y,
        Size = UDim2.fromScale(1, 0),
        BackgroundTransparency = 1
    };
    local v163 = {};
    l_ChatInputBarBorderTransparency_0 = v4.createElement;
    local v164 = "Frame";
    local v165 = {
        AutomaticSize = Enum.AutomaticSize.Y,
        BackgroundTransparency = 1,
        Size = UDim2.new(1, -v40.sendButtonContainerWidth, 0, 0)
    };
    local v166 = {};
    local l_createElement_3 = v4.createElement;
    local l_v18_0 = v18;
    local v169 = {};
    local l_transparencyValue_0 = v40.transparencyValue;
    local v171 = 0;
    local l_v171_0 = v171 --[[ copy: 59 -> 61 ]];
    v169.transparency = l_transparencyValue_0:map(function(v173)
        return l_v171_0 + v173 * (1 - l_v171_0);
    end);
    v169.onAbsoluteSizeChanged = v133;
    v169.onChannelChipActivated = v40.resetTargetChannel;
    v169.targetTextChannelDisplayName = v40.targetTextChannelDisplayName or "";
    v166.TargetChannelChip = l_createElement_3(l_v18_0, v169);
    l_createElement_3 = not v40.canLocalUserChat;
    if l_createElement_3 then
        l_createElement_3 = v4.createElement;
        l_v18_0 = "TextLabel";
        v169 = {
            AnchorPoint = Vector2.new(1, 0),
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            Font = v11.ChatInputBarFont,
            Text = v40.disabledChatPlaceholderText,
            Position = UDim2.fromScale(1, 0),
            Size = v47:map(function(v174)
                return UDim2.new(1, -(v174 + 8), 0, 0);
            end),
            TextColor3 = not not v137 and l_chatInputBarSettings_0.PlaceholderColor3 or l_chatInputBarSettings_0.TextColor3,
            TextSize = l_chatInputBarSettings_0.TextSize
        };
        l_transparencyValue_0 = not v137 and 0 or 0.5;
        local l_l_transparencyValue_0_0 = l_transparencyValue_0 --[[ copy: 55 -> 62 ]];
        v169.TextTransparency = v40.transparencyValue:map(function(v176)
            return l_l_transparencyValue_0_0 + v176 * (1 - l_l_transparencyValue_0_0);
        end);
        v169.TextWrapped = true;
        v169.TextXAlignment = Enum.TextXAlignment.Left;
        v169.TextYAlignment = Enum.TextYAlignment.Top;
        l_createElement_3 = l_createElement_3(l_v18_0, v169);
    end;
    v166.DisabledPlaceholderLabel = l_createElement_3;
    l_createElement_3 = v40.canLocalUserChat;
    if l_createElement_3 then
        l_createElement_3 = v4.createElement;
        l_v18_0 = "Frame";
        v169 = {
            AnchorPoint = Vector2.new(1, 0),
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            Position = UDim2.fromScale(1, 0),
            Size = v47:map(function(v177)
                return UDim2.new(1, -(v177 + 8), 0, 0);
            end)
        };
        local v178 = {};
        l_transparencyValue_0 = v40.canLocalUserChat;
        if l_transparencyValue_0 then
            l_transparencyValue_0 = v4.createElement;
            local v179 = "TextBox";
            local v180 = {
                AnchorPoint = Vector2.new(0, 0),
                AutomaticSize = Enum.AutomaticSize.XY,
                BackgroundTransparency = 1,
                ClearTextOnFocus = false,
                FontFace = l_chatInputBarSettings_0.FontFace,
                PlaceholderText = not not v137 and v40.placeholderText or "",
                Size = UDim2.fromScale(1, 0),
                Text = "",
                PlaceholderColor3 = l_chatInputBarSettings_0.PlaceholderColor3,
                TextColor3 = l_chatInputBarSettings_0.TextColor3,
                TextSize = l_chatInputBarSettings_0.TextSize
            };
            v171 = not v137 and 0 or 0.5;
            local l_v171_1 = v171 --[[ copy: 59 -> 63 ]];
            v180.TextTransparency = v40.transparencyValue:map(function(v182)
                return l_v171_1 + v182 * (1 - l_v171_1);
            end);
            v171 = l_chatInputBarSettings_0.TextStrokeTransparency;
            v180.TextStrokeTransparency = v40.transparencyValue:map(function(v183)
                return v171 + v183 * (1 - v171);
            end);
            v180.TextStrokeColor3 = l_chatInputBarSettings_0.TextStrokeColor3;
            v180.TextWrapped = true;
            v180.TextXAlignment = Enum.TextXAlignment.Left;
            v180.TextYAlignment = Enum.TextYAlignment.Top;
            v180[v4.Event.Focused] = v86;
            v180[v4.Event.FocusLost] = v103;
            v180[v4.Change.Text] = v131;
            v180.ref = v50;
            l_transparencyValue_0 = l_transparencyValue_0(v179, v180);
        end;
        v178.TextBox = l_transparencyValue_0;
        l_createElement_3 = l_createElement_3(l_v18_0, v169, v178);
    end;
    v166.TextBoxContainer = l_createElement_3;
    v166.UIPadding = v4.createElement("UIPadding", {
        PaddingBottom = UDim.new(0, 10),
        PaddingLeft = UDim.new(0, 10),
        PaddingRight = UDim.new(0, 10),
        PaddingTop = UDim.new(0, 10)
    });
    v163.TextContainer = l_ChatInputBarBorderTransparency_0(v164, v165, v166);
    l_ChatInputBarBorderTransparency_0 = v4.createElement;
    v164 = "TextButton";
    v165 = {
        AnchorPoint = Vector2.new(1, 0),
        BackgroundTransparency = 1,
        LayoutOrder = 2,
        Position = UDim2.fromScale(1, 0),
        Size = UDim2.new(0, v40.sendButtonContainerWidth, 1, 0),
        Text = "",
        [v4.Event.Activated] = v61
    };
    v166 = {
        Layout = v4.createElement("UIListLayout", {
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Center
        })
    };
    l_createElement_3 = v4.createElement;
    l_v18_0 = l_ImageSetLabel_0;
    v169 = {
        BackgroundTransparency = 1,
        ImageColor3 = not not v136 and l_chatInputBarSettings_0.PlaceholderColor3 or l_chatInputBarSettings_0.TextColor3
    };
    l_transparencyValue_0 = not v136 and 0 or 0.5;
    v169.ImageTransparency = v40.transparencyValue:map(function(v184)
        return l_transparencyValue_0 + v184 * (1 - l_transparencyValue_0);
    end);
    v169.Image = l_Images_0["icons/actions/send"];
    v169.Size = UDim2.new(0, 30, 0, 30);
    v166.SendIcon = l_createElement_3(l_v18_0, v169);
    v163.SendButton = l_ChatInputBarBorderTransparency_0(v164, v165, v166);
    v156.Container = l_createElement_2(v158, v159, v163);
    v151.Background = l_createElement_1(v153, v155, v156);
    return l_createElement_0(v144, v150, v151);
end);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.Otter);
local v4 = require(l_script_FirstAncestor_0.Timer);
local v5 = require(l_Parent_0.UIBlox);
local l_Images_0 = v5.App.ImageSet.Images;
local l_ImageSetLabel_0 = v5.Core.ImageSet.ImageSetLabel;
local l_Config_0 = v5.Config;
local v9 = require(l_script_FirstAncestor_0.Localization);
local l_GameSettings_0 = UserSettings().GameSettings;
local v11 = v2.Component:extend("ChatTranslationFTUX");
v11.defaultProps = {
    timer = v4.new(10)
};
local v12 = nil;
local v13 = nil;
if not l_Config_0.enableFontNameMapping then
    v12 = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal);
    v13 = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal);
else
    v12 = Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal);
    v13 = Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal);
end;
local v14 = {
    dampingRatio = 1,
    frequency = 2
};
if game:GetEngineFeature("TextChatServiceSettingsSaved") then
    l_GameSettings_0.ChatTranslationFTUXShown = true;
end;
v11.init = function(v15)
    local v16, v17 = v2.createBinding(1);
    v15.transparency = v16;
    v15.updateTransparency = v17;
    v15.transparencyMotor = v3.createSingleMotor(1);
    v15.transparencyMotor:onStep(v15.updateTransparency);
end;
v11.render = function(v18)
    return v2.createElement("Frame", {
        AutomaticSize = Enum.AutomaticSize.XY,
        Position = UDim2.new(0, 10, 0, 20),
        Size = UDim2.new(0.25, 0, 0, 0),
        BackgroundTransparency = 1
    }, {
        BubbleTail = v2.createElement(l_ImageSetLabel_0, {
            Size = UDim2.new(0, 15, 0, 10),
            BackgroundTransparency = 1,
            ImageTransparency = v18.transparency,
            ImageColor3 = Color3.new(0.5, 0.5, 0.5),
            Image = l_Images_0["component_assets/triangleUp_16"],
            Position = UDim2.new(0, 15, 0, -10),
            ZIndex = 100
        }),
        BubbleBody = v2.createElement("Frame", {
            Active = true,
            BackgroundTransparency = v18.transparency,
            BackgroundColor3 = Color3.new(0.5, 0.5, 0.5),
            AutomaticSize = Enum.AutomaticSize.XY,
            ZIndex = 100,
            Style = Enum.FrameStyle.Custom,
            [v2.Event.TouchTap] = function()
                v18:fadeOut();
            end,
            [v2.Event.InputEnded] = function(_, v20)
                if v20.UserInputType == Enum.UserInputType.MouseButton1 then
                    v18:fadeOut();
                end;
            end
        }, {
            RoundCorners = v2.createElement("UICorner", {
                CornerRadius = UDim.new(0, 5)
            }),
            SizeConstraint = v2.createElement("UISizeConstraint", {
                MaxSize = Vector2.new(300, 400)
            }),
            Padding = v2.createElement("UIPadding", {
                PaddingRight = UDim.new(0, 10),
                PaddingTop = UDim.new(0, 10),
                PaddingBottom = UDim.new(0, 10),
                PaddingLeft = UDim.new(0, 10)
            }),
            Layout = v2.createElement("UIListLayout", {
                SortOrder = Enum.SortOrder.LayoutOrder,
                FillDirection = Enum.FillDirection.Vertical,
                Padding = UDim.new(0, 10)
            }),
            Title = v2.createElement("TextLabel", {
                AutomaticSize = Enum.AutomaticSize.Y,
                Size = UDim2.new(1, 0, 0, 0),
                Text = if v18.props.FTUXTitle ~= "" then v18.props.FTUXTitle else "Chat translation is on for supported languages",
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Top,
                TextTransparency = v18.transparency,
                FontFace = v12,
                TextSize = 16,
                TextWrapped = true,
                BackgroundTransparency = 1,
                TextColor3 = Color3.new(1, 1, 1),
                ZIndex = 101,
                LayoutOrder = 1
            }),
            Body = v2.createElement("TextLabel", {
                AutomaticSize = Enum.AutomaticSize.Y,
                Size = UDim2.new(1, 0, 0, 0),
                Text = if v18.props.FTUXBody ~= "" then v18.props.FTUXBody else "Messages you send and receive will be translated automatically",
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Top,
                TextTransparency = v18.transparency,
                FontFace = v13,
                TextSize = 16,
                TextWrapped = true,
                BackgroundTransparency = 1,
                TextColor3 = Color3.new(1, 1, 1),
                ZIndex = 101,
                LayoutOrder = 2
            })
        })
    });
end;
v11.fadeOut = function(v21)
    if not v21.isFadingOut then
        v21.isFadingOut = true;
        v21.transparencyMotor:setGoal((function(v22)
            return v3.spring(v22, v14);
        end)(1));
    end;
end;
v11.didMount = function(v23)
    v23.transparencyMotor:setGoal((function(v24)
        return v3.spring(v24, v14);
    end)(0));
    v23.props.timer:start():andThen(function()
        v23:fadeOut();
    end);
end;
v11.willUnmount = function(v25)
    v25.transparencyMotor:destroy();
end;
return v9.connect(function()
    return {
        FTUXTitle = "CoreScripts.TextChat.ChatTranslation.FTUX.TitleNew",
        FTUXBody = "CoreScripts.TextChat.ChatTranslation.FTUX.BodyNew"
    };
end)(v11);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.RoactRodux);
local l_List_0 = require(l_Parent_0.llama).List;
local v5 = require(l_script_FirstAncestor_0.memoize);
local v6 = require(l_script_FirstAncestor_0.Flags.FFlagShowVerifiedBadgeInNewChat);
local v7 = require(script.Parent.UI.ChatWindow);
local v8 = v2.Component:extend("ChatWindowApp");
v8.defaultProps = {
    LayoutOrder = 1,
    messages = {},
    size = UDim2.fromScale(1, 1)
};
v8.render = function(v9)
    return v2.createElement(v7, {
        LayoutOrder = v9.props.LayoutOrder,
        messages = v9.props.messages,
        size = v9.props.size,
        transparencyValue = v9.props.transparencyValue,
        textTransparency = v9.props.textTransparency,
        onHovered = v9.props.onHovered,
        onUnhovered = v9.props.onUnhovered,
        mutedUserIds = v9.props.mutedUserIds,
        verifiedUserIds = if not v6() then nil else v9.props.verifiedUserIds,
        activateWhisperMode = v9.props.activateWhisperMode,
        resetTargetChannel = v9.props.resetTargetChannel,
        visible = v9.props.visible,
        onAbsoluteSizeChanged = v9.props.onAbsoluteSizeChanged,
        onAbsolutePositionChanged = v9.props.onAbsolutePositionChanged,
        chatWindowSettings = v9.props.chatWindowSettings,
        showTranslationButton = v9.props.showTranslationButton
    });
end;
local v12 = v5(function(v10)
    return l_List_0.map(v10.windowMessagesInOrder, function(v11)
        return v10.byMessageId[v11];
    end);
end);
return v3.connect(function(v13)
    return {
        messages = v12(v13.Messages),
        mutedUserIds = v13.MutedUsers,
        verifiedUserIds = v13.VerifiedUsers
    };
end)(v8);


local l_Parent_0 = script:FindFirstAncestor("ExpChat").Parent;
local v1 = require(l_Parent_0.React);
local v2 = require(l_Parent_0.VirtualizedList);
local l_useStyle_0 = require(l_Parent_0.UIBlox).Core.Style.useStyle;
local v4 = game:DefineFastInt("ExpChatScrollLockThreshold", 90) / 100;
local function _(v5)
    local l_AbsoluteWindowSize_0 = v5.AbsoluteWindowSize;
    local l_CanvasPosition_0 = v5.CanvasPosition;
    local l_AbsoluteCanvasSize_0 = v5.AbsoluteCanvasSize;
    local v9 = l_CanvasPosition_0.Y / (l_AbsoluteCanvasSize_0 - l_AbsoluteWindowSize_0).Y;
    if l_AbsoluteCanvasSize_0.Y <= l_AbsoluteWindowSize_0.Y then
        return true;
    else
        return v4 <= v9;
    end;
end;
local function _(v11)
    local v12 = true;
    if v11.UserInputType ~= Enum.UserInputType.MouseMovement then
        v12 = v11.UserInputType == Enum.UserInputType.Touch;
    end;
    return v12;
end;
return function(v14)
    local l_Theme_0 = l_useStyle_0().Theme;
    local v16 = v1.useRef(nil);
    local v17 = v1.useRef(nil);
    local v18, v19 = v1.useState(true);
    local v20, v21 = v1.useState(false);
    local v22, v23 = v1.useState(false);
    v1.useEffect(function()
        if v17.current then
            local l_FirstChildWhichIsA_0 = v17.current:FindFirstChildWhichIsA("ScrollingFrame", true);
            if l_FirstChildWhichIsA_0 then
                v16.current = l_FirstChildWhichIsA_0;
            end;
        end;
    end, {
        v17
    });
    v1.useEffect(function()
        if not (not (v18 and v22 == false) or not v16.current) then
            v16.current.CanvasPosition = Vector2.new(0, 9223372036854775807);
        end;
    end, {
        tostring(v14.messages),
        v18,
        v22,
        (tostring(v16))
    });
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = v14.Size,
        ref = v17,
        [v1.Event.InputBegan] = function(_, v26)
            local v27 = true;
            if v26.UserInputType ~= Enum.UserInputType.MouseMovement then
                v27 = v26.UserInputType == Enum.UserInputType.Touch;
            end;
            if v27 then
                v21(true);
            end;
            if v26.UserInputType == Enum.UserInputType.Touch then
                v23(true);
            end;
        end,
        [v1.Event.InputEnded] = function(_, v29)
            local v30 = true;
            if v29.UserInputType ~= Enum.UserInputType.MouseMovement then
                v30 = v29.UserInputType == Enum.UserInputType.Touch;
            end;
            if v30 then
                v21(false);
            end;
            if v29.UserInputType == Enum.UserInputType.Touch then
                v23(false);
            end;
        end
    }, {
        padding = v1.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 0),
            PaddingBottom = UDim.new(0, 0),
            PaddingLeft = UDim.new(0, 8),
            PaddingRight = UDim.new(0, 8)
        }),
        scrollView = v1.createElement(v2.ScrollView, {
            style = {
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                ScrollBarImageColor3 = l_Theme_0.UIEmphasis.Color,
                ScrollBarImageTransparency = not v20 and 1 or 0,
                ScrollBarThickness = 8
            },
            contentContainerStyle = {
                BackgroundTransparency = 1
            },
            Size = UDim2.fromScale(1, 1),
            onScroll = function(v31)
                local l_v19_0 = v19;
                local l_AbsoluteWindowSize_1 = v31.AbsoluteWindowSize;
                local l_CanvasPosition_1 = v31.CanvasPosition;
                local l_AbsoluteCanvasSize_1 = v31.AbsoluteCanvasSize;
                l_v19_0(l_AbsoluteCanvasSize_1.Y <= l_AbsoluteWindowSize_1.Y or v4 <= l_CanvasPosition_1.Y / (l_AbsoluteCanvasSize_1 - l_AbsoluteWindowSize_1).Y);
            end
        }, v14.children)
    });
end;


local l_TextChatService_0 = game:GetService("TextChatService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v3 = require(l_Parent_0.React);
local l_Dictionary_0 = require(l_Parent_0.llama).Dictionary;
local v5 = require(l_script_FirstAncestor_0.Flags.FFlagShowVerifiedBadgeInNewChat);
local v6 = require(l_script_FirstAncestor_0.Flags.getFFlagChatTranslationUIEnabled);
local v7 = require(l_script_FirstAncestor_0.Config);
local v8 = require(l_script_FirstAncestor_0.ClientSettings.useInterpolatedClientSettings);
local l_script_FirstAncestor_1 = script:FindFirstAncestor("UI");
local v10 = require(l_script_FirstAncestor_1.ScrollingView);
local v11 = require(l_script_FirstAncestor_1.TextMessageLabel);
local v12 = require(l_script_FirstAncestor_1.TranslatedTextMessage);
local v13 = {
    LayoutOrder = 1,
    size = UDim2.fromScale(1, 1),
    messages = {},
    transparencyValue = v7.ChatWindowBackgroundTransparency,
    textTransparency = 0,
    mutedUserIds = {},
    verifiedUserIds = {},
    showTranslationButton = false
};
return function(v14)
    local v15 = l_Dictionary_0.join(v13, v14);
    local l_chatWindowSettings_0 = v15.chatWindowSettings;
    local l_BackgroundTransparency_0 = v8(l_chatWindowSettings_0).BackgroundTransparency;
    local l_BackgroundColor3_0 = v8(l_chatWindowSettings_0).BackgroundColor3;
    local v22 = v3.useCallback(function(v19, v20)
        if type(v20) == "number" then
            return v15.transparencyValue;
        else
            return v20:map(function(v21)
                return v19 + v21 * (1 - v19);
            end);
        end;
    end);
    local v25 = v3.useCallback(function(v23)
        v15.resetTargetChannel();
        local v24 = tonumber(v23.userId);
        if v24 then
            v15.activateWhisperMode(v24);
        end;
    end);
    return v3.createElement("Frame", {
        BackgroundColor3 = l_BackgroundColor3_0,
        BorderSizePixel = 0,
        LayoutOrder = v15.LayoutOrder,
        Size = v15.size,
        Visible = v15.visible,
        BackgroundTransparency = v22(l_BackgroundTransparency_0, v15.transparencyValue),
        [v3.Event.MouseEnter] = v15.onHovered,
        [v3.Event.MouseLeave] = v15.onUnhovered,
        [v3.Change.AbsoluteSize] = function(v26)
            local l_ChatWindowConfiguration_0 = l_TextChatService_0:FindFirstChildOfClass("ChatWindowConfiguration");
            if not (not l_ChatWindowConfiguration_0 or not v15.onAbsoluteSizeChanged) then
                v15.onAbsoluteSizeChanged(v26, l_ChatWindowConfiguration_0);
            end;
        end,
        [v3.Change.AbsolutePosition] = function(v28)
            local l_ChatWindowConfiguration_1 = l_TextChatService_0:FindFirstChildOfClass("ChatWindowConfiguration");
            if not (not l_ChatWindowConfiguration_1 or not v15.onAbsoluteSizeChanged) then
                v15.onAbsolutePositionChanged(v28, l_ChatWindowConfiguration_1);
            end;
        end
    }, {
        uiSizeConstraint = v3.createElement("UISizeConstraint", {
            MaxSize = Vector2.new(v7.ChatWindowMaxWidth, v7.ChatWindowMaxHeight)
        }),
        scrollingView = v3.createElement(v10, {
            size = v15.size,
            messages = v15.messages
        }, v3.useCallback(function(v30)
            local v34 = l_Dictionary_0.map(v30, function(v31, v32)
                if not v31.isVisibleInChatWindow then
                    return nil, nil;
                else
                    local v33 = not not v31.userId and if v5() then l_Dictionary_0.has(v15.verifiedUserIds, v31.userId) else false;
                    if not v6() then
                        return v3.createElement(v11, {
                            message = v31,
                            LayoutOrder = v32,
                            isUserVerified = v33,
                            textTransparency = v22(0, v15.textTransparency),
                            textStrokeTransparency = v22(v15.chatWindowSettings.TextStrokeTransparency, v15.textTransparency),
                            onTextMessageLabelButtonActivated = v25,
                            chatWindowSettings = v15.chatWindowSettings
                        }), v31.messageId;
                    else
                        return v3.createElement(v12, {
                            message = v31,
                            LayoutOrder = v32,
                            isUserVerified = v33,
                            textTransparency = v22(0, v15.textTransparency),
                            textStrokeTransparency = v22(v15.chatWindowSettings.TextStrokeTransparency, v15.textTransparency),
                            onTextMessageLabelButtonActivated = v25,
                            chatWindowSettings = v15.chatWindowSettings,
                            showTranslationButton = v15.showTranslationButton,
                            onToggle = function()
                            end
                        }), v31.messageId;
                    end;
                end;
            end);
            v34["$layout"] = v3.createElement("UIListLayout", {
                Padding = UDim.new(0, 4),
                SortOrder = Enum.SortOrder.LayoutOrder
            });
            return v34;
        end)(v15.messages))
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v1 = require(l_script_FirstAncestor_0.Parent.Roact);
local v2 = require(l_script_FirstAncestor_0.ChatWindow.UI.BottomLockedScrollView);
local v3 = v1.Component:extend("ScrollingView");
v3.defaultProps = {};
v3.render = function(v4)
    return v1.createElement("ImageButton", {
        BackgroundTransparency = 1,
        Size = v4.props.size
    }, {
        bottomLockedScrollView = v1.createElement(v2, {
            Size = UDim2.fromScale(1, 1),
            messages = v4.props.messages
        }, v4.props[v1.Children])
    });
end;
return v3;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local l_Parent_1 = l_script_FirstAncestor_0.Parent;
local v3 = require(l_Parent_1.React);
local v4 = require(l_Parent_0.RoactRodux);
local v5 = require(l_Parent_1.ApolloClient);
local l_gql_0 = v5.gql;
local l_useQuery_0 = v5.useQuery;
local v8 = require(l_script_FirstAncestor_0.Config);
local v9 = require(l_script_FirstAncestor_0.context);
local l_game_EngineFeature_0 = game:GetEngineFeature("TextChatServiceIncludesColon");
local v11 = require(l_script_FirstAncestor_0.Flags.isExperienceChatUserProfileApiEnabled);
appendVerifiedBadge = function(v12)
    if not l_game_EngineFeature_0 then
        return v12 .. v8.VERIFIED_EMOJI;
    else
        return string.gsub(v12, ":(%S-)$", v8.VERIFIED_EMOJI .. ":%1");
    end;
end;
local function v14(v13)
    if not v9.apolloClient then
        return nil;
    else
        return (l_useQuery_0(l_gql_0("\t\t\tquery UserProfiles($userIds: [String] $userIds) {\n\t\t\t\t\tid\n\t\t\t\t\tnames {\n\t\t\t\t\t\tcombinedName\n\t\t\t\t\t\tusername\n\t\t\t\t\t\talias\n\t\t\t\t\t\tdisplayName\n\t\t\t\t\t\tcontactName\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t"), {
            errorPolicy = "all",
            variables = {
                userIds = {
                    (tostring(v13.userId))
                }
            },
            client = v9.apolloClient
        }));
    end;
end;
trim = function(v15)
    if not v15:match("^()%s*$") then
        return (v15:match("^%s*(.*%S)"));
    else
        return "";
    end;
end;
getMessageText = function(v16, v17, v18)
    if not (v17 ~= nil) or v17 == "" then
        return v18 or "";
    elseif not v16 then
        return v18 or "";
    else
        return v17 or "";
    end;
end;
return (v4.connect(function()
end, function(v19)
    return {
        onToggle = function(v20, v21)
            v19({
                type = "ChatTranslationMessageToggled",
                useTranslation = v20,
                messageId = v21
            });
        end
    };
end)(function(v22)
    local v23, v24 = v3.useState(nil);
    local l_showTranslationButton_0 = v22.showTranslationButton;
    if l_showTranslationButton_0 then
        l_showTranslationButton_0 = false;
        if v22.message.translation ~= nil then
            l_showTranslationButton_0 = v22.message.translation ~= "";
        end;
    end;
    local v26 = getMessageText(v22.message.useTranslation, v22.message.translation, v22.message.text);
    local v27 = v22.message.prefixText or "";
    local v28 = v23 or v27;
    local l_chatWindowSettings_0 = v22.chatWindowSettings;
    local v30 = if not not v11() and v22.message.userId then v14(v22.message) else nil;
    v3.useEffect(function()
        if not (not v30 or not v30.data) then
            local l_names_0 = v30.data.userProfiles[1].names;
            v24((string.gsub(v28, l_names_0.displayName, l_names_0.combinedName)));
        end;
    end, {
        v22.message.userId,
        if not v30 then nil else v30.data
    });
    if v22.isUserVerified then
        v28 = appendVerifiedBadge(v28);
    end;
    v28 = if not l_game_EngineFeature_0 then v28 .. ": " else v28 .. " ";
    local v32 = l_chatWindowSettings_0.TextSize - 2;
    return v3.createElement("Frame", {
        BackgroundTransparency = 1,
        AutomaticSize = Enum.AutomaticSize.XY,
        Size = UDim2.new(1, 0, 0, 0)
    }, {
        TextLabel = v3.createElement("Frame", {
            AutomaticSize = Enum.AutomaticSize.XY,
            BackgroundTransparency = 1,
            LayoutOrder = v22.LayoutOrder
        }, {
            TextMessage = v3.createElement("TextLabel", {
                AutomaticSize = Enum.AutomaticSize.XY,
                BackgroundTransparency = 1,
                FontFace = l_chatWindowSettings_0.FontFace,
                RichText = true,
                Size = UDim2.new(1, 0, 0, 0),
                Text = if not l_showTranslationButton_0 then if string.len(v27) == 0 then v26 else v28 .. v26 else if string.len(v27) == 0 then v26 else v28 .. "   " .. v26,
                TextColor3 = l_chatWindowSettings_0.TextColor3,
                TextSize = l_chatWindowSettings_0.TextSize,
                TextStrokeColor3 = l_chatWindowSettings_0.TextStrokeColor3,
                TextStrokeTransparency = v22.textStrokeTransparency or 0.5,
                TextTransparency = v22.textTransparency or 0,
                TextWrapped = true,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Top
            }, {
                TextMessageButton = if string.len(v27) ~= 0 then v3.createElement("Frame", {
                    BackgroundTransparency = 1,
                    AutomaticSize = Enum.AutomaticSize.XY,
                    Size = UDim2.new(1, 0, 0, 0)
                }, {
                    Layout = v3.createElement("UIListLayout", {
                        FillDirection = Enum.FillDirection.Horizontal,
                        SortOrder = Enum.SortOrder.LayoutOrder,
                        Padding = UDim.new(0, 4)
                    }),
                    TextButton = v3.createElement("TextButton", {
                        AutomaticSize = Enum.AutomaticSize.XY,
                        BackgroundTransparency = 1,
                        FontFace = l_chatWindowSettings_0.FontFace,
                        RichText = true,
                        Size = UDim2.new(0, 0, 0, 0),
                        Text = trim(v28),
                        TextSize = l_chatWindowSettings_0.TextSize,
                        TextStrokeTransparency = 1,
                        TextTransparency = 1,
                        TextWrapped = true,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextYAlignment = Enum.TextYAlignment.Top,
                        LayoutOrder = 1,
                        [v3.Event.Activated] = function()
                            v22.onTextMessageLabelButtonActivated(v22.message);
                        end
                    }),
                    TranslationButton = if not l_showTranslationButton_0 then nil else v3.createElement("ImageButton", {
                        Size = UDim2.new(0, v32, 0, v32),
                        Image = "rbxasset://textures/translateIcon.png",
                        HoverImage = "rbxasset://textures/translateIconDark.png",
                        PressedImage = "rbxasset://textures/translateIconDark.png",
                        ImageTransparency = v22.textTransparency or 0,
                        LayoutOrder = 2,
                        BackgroundTransparency = 1,
                        [v3.Event.Activated] = function()
                            v22.onToggle(not v22.message.useTranslation, v22.message.messageId);
                        end
                    })
                }) else nil
            })
        })
    });
end));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Colors_0 = require(l_script_FirstAncestor_0.Parent.UIBlox).App.Style.Colors;
local l_ChatWindowBackgroundColor3_0 = require(l_script_FirstAncestor_0.Config).ChatWindowBackgroundColor3;
return {
    getBackgroundColor = function(v3, v4)
        if v3.BackgroundColor3 == l_ChatWindowBackgroundColor3_0 then
            return l_Colors_0.Flint:Lerp(v3.BackgroundColor3, v4.preferredTransparency);
        else
            return v3.BackgroundColor3;
        end;
    end,
    getBackgroundTransparency = function(v5, v6)
        return v5.BackgroundTransparency * v6.preferredTransparency;
    end
};


return require(script:FindFirstAncestor("ExpChat").Parent.Roact).createContext({
    preferredTransparency = 1
});


local v0 = require(script:FindFirstAncestor("ExpChat").Parent.React);
local v1 = require(script.Parent);
local v2 = require(script.Parent.ClientSettingsUtility);
return function(v3)
    local v4 = v0.useContext(v1);
    local v5, v6 = v0.useState({
        BackgroundColor = v2.getBackgroundColor(v3, v4),
        BackgroundTransparency = v2.getBackgroundTransparency(v3, v4)
    });
    v0.useEffect(function()
        v6({
            BackgroundColor3 = v2.getBackgroundColor(v3, v4),
            BackgroundTransparency = v2.getBackgroundTransparency(v3, v4)
        });
    end, {
        v3,
        v4
    });
    return v5;
end;


local v0 = require(script:FindFirstAncestor("ExpChat").Actions.ChatWindowMessagesCleared);
local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/clear",
        "/cls"
    },
    clientRun = function(v2, _, _)
        v2:dispatch(v0());
        return {
            key = "",
            metadata = "Roblox.Clear.Info.Success"
        };
    end
};


local l_StarterGui_0 = game:GetService("StarterGui");
local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/console"
    },
    clientRun = function()
        local l_status_0, l_result_0 = pcall(function()
            return l_StarterGui_0:GetCore("DevConsoleVisible");
        end);
        if l_status_0 then
            pcall(function()
                l_StarterGui_0:SetCore("DevConsoleVisible", not l_result_0);
            end);
        end;
        return nil;
    end
};


local l_StarterPlayer_0 = game:GetService("StarterPlayer");
local _ = require(script.Parent.types);
local v2 = require(script:FindFirstAncestor("ExpChat").Logger):new("ExpChat/Command/Emote");
local v3 = {
    wave = true,
    point = true,
    dance = true,
    dance1 = true,
    dance2 = true,
    dance3 = true,
    laugh = true,
    cheer = true
};
local function _(v4)
    local v5 = nil;
    local l_Humanoid_0 = v4:FindFirstChildOfClass("Humanoid");
    if l_Humanoid_0 then
        if l_Humanoid_0.RigType == Enum.HumanoidRigType.R15 then
            return "dance";
        elseif l_Humanoid_0.RigType == Enum.HumanoidRigType.R6 then
            v5 = "dance" .. math.random(1, 3);
        end;
    end;
    return v5;
end;
local function v17(v8, v9)
    local l_status_0, l_result_0 = pcall(function()
        local l_Animate_0 = v9:FindFirstChild("Animate");
        if l_Animate_0 then
            local l_PlayEmote_0 = l_Animate_0:FindFirstChild("PlayEmote");
            if not l_PlayEmote_0 or not l_PlayEmote_0:IsA("BindableFunction") then
                v2:debug("PlayEmote BindableFunction does not exist.");
            else
                if v8 == "dance" then
                    local l_v9_0 = v9;
                    local v13 = nil;
                    local l_Humanoid_1 = l_v9_0:FindFirstChildOfClass("Humanoid");
                    if l_Humanoid_1 then
                        if l_Humanoid_1.RigType == Enum.HumanoidRigType.R15 then
                            v13 = "dance";
                        elseif l_Humanoid_1.RigType == Enum.HumanoidRigType.R6 then
                            v13 = "dance" .. math.random(1, 3);
                        end;
                    end;
                    v8 = v13;
                end;
                l_PlayEmote_0:Invoke(v8);
                return true;
            end;
        end;
        return false;
    end);
    if not l_status_0 or not l_result_0 then
        return {
            key = "InGame.EmotesMenu.ErrorMessageNotSupported",
            metadata = "Roblox.Emote.Error.NotSupported"
        };
    else
        v2:debug("Playing legacy emote successfully");
        return ;
    end;
end;
local function v24(v18, v19)
    local v20 = tonumber(v19, 10);
    if not v20 then
        for v21, _ in pairs((v18:GetEmotes())) do
            if string.lower(v21) == v19 then
                return v21, nil;
            end;
        end;
        return nil, {
            key = "CoreScripts.TextChat.Emote.Error.NotOwnedGeneric",
            metadata = "Roblox.Emote.Error.NotOwnedGeneric"
        };
    else
        local l_v18_EquippedEmotes_0 = v18:GetEquippedEmotes();
        if not l_v18_EquippedEmotes_0[v20] then
            if not (v20 >= 1) or v20 > 8 then
                return nil, {
                    key = "CoreScripts.TextChat.Emote.Error.DoesNotExist",
                    metadata = "Roblox.Emote.Error.DoesNotExist"
                };
            else
                return nil, {
                    key = "CoreScripts.TextChat.Emote.Error.NotEquipped",
                    metadata = "Roblox.Emote.Error.EmoteNotEquipped"
                };
            end;
        else
            return l_v18_EquippedEmotes_0[v20].Name, nil;
        end;
    end;
end;
return {
    name = script.Name,
    alias = {
        "/emote",
        "/e"
    },
    clientRun = function(v25, _, v27)
        local v28 = nil;
        if string.sub(v27, 1, 3):lower() == "/e " then
            v28 = string.sub(v27, 4);
        elseif string.sub(v27, 1, 7):lower() == "/emote " then
            v28 = string.sub(v27, 8);
        end;
        if v28 then
            v28 = string.lower(v28);
            local l_LocalCharacter_0 = v25:getState().LocalCharacter;
            if not v3[v28] then
                if l_StarterPlayer_0.UserEmotesEnabled then
                    if l_LocalCharacter_0 then
                        if l_LocalCharacter_0:FindFirstChild("Animate") then
                            local l_Humanoid_2 = l_LocalCharacter_0:FindFirstChildOfClass("Humanoid");
                            if l_Humanoid_2 then
                                if l_Humanoid_2.RigType ~= Enum.HumanoidRigType.R15 then
                                    v2:debug("Humanoid.RigType is not R15");
                                    return {
                                        key = "InGame.EmotesMenu.ErrorMessageSwitchToR15",
                                        metadata = "Roblox.Emote.Error.SwitchToR15"
                                    };
                                else
                                    local l_HumanoidDescription_0 = l_Humanoid_2:FindFirstChildOfClass("HumanoidDescription");
                                    if l_HumanoidDescription_0 then
                                        local v32, v33 = v24(l_HumanoidDescription_0, v28);
                                        if v32 then
                                            local l_status_1, l_result_1 = pcall(function()
                                                return l_Humanoid_2:PlayEmote(v32);
                                            end);
                                            if l_status_1 and l_result_1 then
                                                v2:debug("Playing emote: {}", (tostring(v32)));
                                                return nil;
                                            else
                                                v2:debug("Humanoid:PlayEmote encountered an error: {}", l_result_1);
                                                return {
                                                    key = "InGame.EmotesMenu.ErrorMessageAnimationPlaying",
                                                    metadata = "Roblox.Emote.Error.AnimationPlaying"
                                                };
                                            end;
                                        else
                                            v2:debug("Could not find a valid emote within HumanoidDescription");
                                            return v33;
                                        end;
                                    else
                                        v2:debug("HumanoidDescription missing");
                                        return {
                                            key = "InGame.EmotesMenu.ErrorMessageNotSupported",
                                            metadata = "Roblox.Emote.Error.NotSupported"
                                        };
                                    end;
                                end;
                            else
                                v2:debug("Humanoid missing");
                                return {
                                    key = "InGame.EmotesMenu.ErrorMessageTemporarilyUnavailable",
                                    metadata = "Roblox.Emote.Error.TemporarilyUnavailable"
                                };
                            end;
                        else
                            v2:debug("Animate script missing");
                            return {
                                key = "InGame.EmotesMenu.ErrorMessageNotSupported",
                                metadata = "Roblox.Emote.Error.NotSupported"
                            };
                        end;
                    else
                        v2:debug("No character loaded");
                        return {
                            key = "InGame.EmotesMenu.ErrorMessageTemporarilyUnavailable",
                            metadata = "Roblox.Emote.Error.TemporarilyUnavailable"
                        };
                    end;
                else
                    v2:debug("Experience does not have emotes enabled");
                    return {
                        key = "CoreScripts.TextChat.Emote.Error.NotEnabled",
                        metadata = "Roblox.Emote.Error.UserEmotesNotEnabled"
                    };
                end;
            else
                v2:trace("Legacy emote found");
                return v17(v28, l_LocalCharacter_0);
            end;
        else
            v2:debug("No emote string given");
            return {
                key = "CoreScripts.TextChat.Emote.Error.DoesNotExist",
                metadata = "Roblox.Emote.Error.DoesNotExist"
            };
        end;
    end
};


local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/help",
        "/?"
    },
    clientRun = function()
        return {
            key = {
                "CoreScripts.TextChat.Help.FirstLine",
                "GameChat_ChatCommandsTeller_WhisperCommand",
                "GameChat_ChatCommandsTeller_TeamCommand",
                "GameChat_ChatCommandsTeller_MuteCommand",
                "GameChat_ChatCommandsTeller_UnMuteCommand",
                "CoreScripts.TextChat.Clear.Help.Description"
            },
            metadata = "Roblox.Help.Info",
            args = nil
        };
    end
};


local v0 = require(script.Parent.getPlayersFromString);
local v1 = require(script:FindFirstAncestor("ExpChat").Actions.UserMuted);
local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/mute",
        "/m"
    },
    clientRun = function(v3, v4, v5)
        local v6 = string.split(v5, " ")[2];
        if v6 then
            local v7 = v0(v3:getState().Players, v6);
            if #v7 == 0 then
                return {
                    key = "CoreScripts.TextChat.Mute.Error.TargetDoesNotExist",
                    args = {
                        RBX_NAME = v6
                    },
                    metadata = "Roblox.Mute.Error.PlayerNotFound"
                };
            elseif #v7 > 1 then
                return {
                    key = "CoreScripts.TextChat.Mute.Error.MultipleMatches",
                    args = {},
                    metadata = "Roblox.Mute.Error.MultipleMatches"
                };
            else
                local v8 = v7[1];
                if v8.userId == tostring(v4) then
                    return {
                        key = "CoreScripts.TextChat.Mute.Error.CannotMuteSelf",
                        args = {},
                        metadata = "Roblox.Mute.Error.CannotMuteSelf"
                    };
                else
                    v3:dispatch(v1(v8.userId));
                    return {
                        key = "CoreScripts.TextChat.Mute.Success",
                        args = {
                            RBX_NAME = v8.nameToDisplay
                        },
                        metadata = "Roblox.Mute.Info.Success"
                    };
                end;
            end;
        else
            return {
                key = "CoreScripts.TextChat.Mute.Error.TargetDoesNotExist",
                args = {
                    RBX_NAME = ""
                },
                metadata = "Roblox.Mute.Error.PlayerNotFound"
            };
        end;
    end
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v1 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/Command/Team");
local v2 = require(l_script_FirstAncestor_0.Actions.ChatInputBarActivatedTeamMode);
local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/team",
        "/t",
        "%%"
    },
    clientRun = function(v4, _, _)
        if not v4:getState().LocalTeam then
            v1:debug("Could not team chat because not in team");
            return {
                key = "CoreScripts.TextChat.TeamChat.Error.NotOnTeam",
                metadata = "Roblox.Team.Error.CannotTeamChatIfNotInTeam"
            };
        else
            v4:dispatch(v2());
            return {
                key = "",
                metadata = "Roblox.Team.Info.Success"
            };
        end;
    end
};


local v0 = require(script:FindFirstAncestor("ExpChat").Version);
local _ = require(script.Parent.types);
return {
    name = script.Name,
    alias = {
        "/version",
        "/v"
    },
    clientRun = function()
        return {
            key = "CoreScripts.TextChat.Version.Success",
            metadata = "Roblox.Version.Info.Success",
            args = {
                RBX_VERSION = string.format("%s (%s)", v0[1], v0[2])
            }
        };
    end
};


local l_TextChatService_0 = game:GetService("TextChatService");
local l_RobloxReplicatedStorage_0 = game:GetService("RobloxReplicatedStorage");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Dictionary_0 = require(l_script_FirstAncestor_0.Parent.llama).Dictionary;
local v4 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/Command/Whisper");
local v5 = require(l_script_FirstAncestor_0.Actions.ChatInputBarActivatedWhisperMode);
local l_script_FirstAncestor_1 = script:FindFirstAncestor("Commands");
local v7 = require(l_script_FirstAncestor_1.getAutocompletePlayersFromString);
local v8 = require(l_script_FirstAncestor_1.Whisper.getNameFromWhisper);
local _ = require(l_script_FirstAncestor_1.types);
return {
    name = script.Name,
    alias = {
        "/whisper",
        "/w"
    },
    clientRun = function(v10, v11, v12)
        local v13 = v8(v12, v10:getState().AutoCastCommands[script.Name]);
        if v13 then
            local l_Players_0 = v10:getState().Players;
            local v15 = v7(l_Dictionary_0.join(l_Players_0, {
                byUserId = l_Dictionary_0.removeKey(l_Players_0.byUserId, (tostring(v11)))
            }), v13);
            if #v15 == 0 then
                v4:debug("Autocomplete: No matches");
                local v16 = l_Players_0.byUserId[tostring(v11)];
                if v16 and (not (v13 ~= v16.displayName) or v13 == "@" .. v16.username) then
                    return {
                        key = "GameChat_PrivateMessaging_CannotWhisperToSelf",
                        args = nil,
                        metadata = "Roblox.Whisper.Error.CannotWhisperToSelf"
                    };
                else
                    return {
                        key = "CoreScripts.TextChat.Mute.Error.TargetDoesNotExist",
                        args = {
                            RBX_NAME = v13 or ""
                        },
                        metadata = "Roblox.Whisper.Error.TargetDoesNotExist"
                    };
                end;
            elseif #v15 == 1 then
                local v17 = v15[1];
                local v18 = tonumber(v17.userId);
                if v18 then
                    local v19 = string.format("RBXWhisper:%d_%d", v11 < v18 and v11 or v18, v18 < v11 and v11 or v18);
                    if not l_TextChatService_0:FindFirstChild(v19, true) then
                        local l_ExperienceChat_0 = l_RobloxReplicatedStorage_0:FindFirstChild("ExperienceChat");
                        if not l_ExperienceChat_0 then
                            v4:error("Could not create whisper channel because RobloxReplicatedStorage.ExperienceChat is missing.");
                            return {
                                key = "",
                                metadata = "Roblox.Whisper.Error.Unknown"
                            };
                        else
                            local l_WhisperChat_0 = l_ExperienceChat_0:FindFirstChild("WhisperChat");
                            if not l_WhisperChat_0 or not l_WhisperChat_0:IsA("RemoteFunction") then
                                v4:error("Could not create whisper channel because WhisperChat RemoteFunction is missing.");
                                return {
                                    key = "",
                                    metadata = "Roblox.Whisper.Error.Unknown"
                                };
                            elseif not l_WhisperChat_0:InvokeServer(v17.userId) then
                                v4:error("Could not create whisper channel for some reason.");
                                return {
                                    key = "CoreScripts.TextChat.Whisper.Error.CannotChat",
                                    args = nil,
                                    metadata = "Roblox.Whisper.Error.Unknown"
                                };
                            end;
                        end;
                    end;
                    v10:dispatch(v5(v19));
                    return {
                        key = "CoreScripts.TextChat.Notification.WhisperChat.Created",
                        args = {
                            RBX_NAME = v13
                        },
                        metadata = "Roblox.Whisper.Info.Success"
                    };
                end;
            else
                v4:debug("Autocomplete: Too many matches");
                return {
                    key = "CoreScripts.TextChat.Whisper.Error.CannotChat",
                    metadata = "Roblox.Whisper.Error.TooManyMatches"
                };
            end;
        end;
        return {
            key = "",
            metadata = "Roblox.Whisper.Error.Unknown"
        };
    end
};


local function v6(v0, v1)
    for _, v3 in pairs(v1) do
        local v4 = v3 .. " ";
        local v5 = string.len(v4);
        if string.sub(v0, 1, v5):lower() == v4 then
            return (string.sub(v0, v5 + 1));
        end;
    end;
    return nil;
end;
return function(v7, v8)
    local v9 = v6(v7, v8);
    if not v9 then
        return nil;
    else
        return string.split(v9, " ")[1];
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v1 = require(l_script_FirstAncestor_0.Parent.Promise);
local v2 = require(l_script_FirstAncestor_0.context);
local _ = require(script:FindFirstAncestor("Commands").types);
local function v8(v4, v5)
    for _, v7 in pairs(v4) do
        if string.find(v5, "^" .. v7 .. " ") then
            return true;
        end;
    end;
    return false;
end;
return function(v9, v10, v11)
    return v1.try(function()
        assert(v2.store, "Store should exist");
        if v8(v2.store:getState().AutoCastCommands[v9.name], v11) then
            local v12 = v9.clientRun(v2.store, v10, v11);
            if not (not v12 or not string.find(v12.metadata, "Success")) then
                return v1.resolve(v12);
            end;
        end;
        return v1.reject();
    end);
end;


local l_Parent_0 = script:FindFirstAncestor("ExpChat").Parent;
local l_Dictionary_0 = require(l_Parent_0.llama).Dictionary;
local l_List_0 = require(l_Parent_0.llama).List;
return function(v3, v4)
    local v5 = {};
    v4 = string.lower(v4);
    if string.sub(v4, 1, 1) == "@" then
        local v6 = string.sub(v4, 2);
        v5 = l_Dictionary_0.values(l_Dictionary_0.filter(v3.byUsername, function(_, v8)
            return string.find(v8, "^" .. v6) ~= nil;
        end));
    else
        local l_v4_0 = v4;
        for _, v13 in pairs((l_Dictionary_0.filter(v3.byDisplayName, function(_, v11)
            return string.find(v11, "^" .. l_v4_0) ~= nil;
        end))) do
            for _, v15 in ipairs(v13) do
                table.insert(v5, v15);
            end;
        end;
    end;
    return l_List_0.map(v5, function(v16)
        return v3.byUserId[tostring(v16)];
    end);
end;


local l_Dictionary_0 = require(script:FindFirstAncestor("ExpChat").Parent.llama).Dictionary;
return function(v1, v2)
    if v2 then
        assert(v2, "will exist");
        v2 = string.lower(v2);
        if v2 and string.sub(v2, 1, 1) == "@" then
            local v3 = v1.byUsername[string.sub(v2, 2)];
            if v3 then
                return {
                    l_Dictionary_0.join(v1.byUserId[v3], {
                        nameToDisplay = "@" .. v1.byUserId[v3].username
                    })
                };
            end;
        end;
        return l_Dictionary_0.map(v1.byDisplayName[v2] or {}, function(v4)
            return l_Dictionary_0.join(v1.byUserId[v4], {
                nameToDisplay = v1.byUserId[v4].displayName
            });
        end);
    else
        return {};
    end;
end;


local v0 = require(script.RBXConsoleCommand);
local v1 = require(script.RBXHelpCommand);
local v2 = require(script.RBXMuteCommand);
local v3 = require(script.RBXUnmuteCommand);
local v4 = require(script.RBXVersionCommand);
local v5 = require(script.RBXEmoteCommand);
local v6 = require(script.RBXTeamCommand);
local v7 = require(script.Whisper.RBXWhisperCommand);
local v8 = require(script.RBXClearCommand);
local v9 = require(script:FindFirstAncestor("ExpChat").Flags.FFlagAllowClearCommand);
local _ = require(script.types);
if not v9() then
    return {
        v0,
        v1,
        v2,
        v3,
        v4,
        v5,
        v6,
        v7
    };
else
    return {
        v0,
        v1,
        v2,
        v3,
        v4,
        v5,
        v6,
        v7,
        v8
    };
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_GuiService_0 = game:GetService("GuiService");
local l_Config_0 = require(l_script_FirstAncestor_0.Parent.UIBlox).Config;
return {
    ChatInputBarFont = if not l_Config_0.enableFontNameMapping then Enum.Font.GothamMedium else Enum.Font.BuilderSansMedium,
    ChatInputBarFontFace = if not l_Config_0.enableFontNameMapping then Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal) else Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal),
    ChatInputBarTextColor3 = Color3.fromRGB(255, 255, 255),
    ChatInputBarTextSize = 14,
    ChatInputBarTextStrokeColor = Color3.fromRGB(0, 0, 0),
    ChatInputBarTextStrokeTransparency = 0.5,
    ChatInputBarPlaceholderColor = Color3.fromRGB(178, 178, 178),
    ChatInputBarBackgroundColor = Color3.fromRGB(25, 27, 29),
    ChatInputBarBackgroundTransparency = 0.2,
    ChatInputBarBorderColor3 = Color3.fromRGB(255, 255, 255),
    ChatInputBarBorderTransparency = 0.8,
    ChatInputBarDefaultFocusKeyCode = Enum.KeyCode.Slash,
    ChatLayoutPosition = UDim2.new(0, 8, 0, 4),
    ChatLayoutAnchorPoint = Vector2.new(0, 0),
    ChatWindowSize = UDim2.fromScale(0.4, 0.25),
    ChatWindowFont = if not l_Config_0.enableFontNameMapping then Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal) else Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal),
    ChatWindowTextColor3 = Color3.fromRGB(255, 255, 255),
    ChatWindowTextSize = 14,
    ChatWindowTextStrokeColor = Color3.fromRGB(0, 0, 0),
    ChatWindowTextStrokeTransparency = 0.5,
    ChatWindowBackgroundColor3 = Color3.fromRGB(25, 27, 29),
    ChatWindowBackgroundTransparency = 0.3,
    ChatWindowBackgroundFadeOutTime = 3.5,
    ChatWindowTextFadeOutTime = 30,
    ChatWindowMaxWidth = 475,
    ChatWindowMaxHeight = 275,
    DefaultChannelNames = {
        RBXGeneral = true,
        RBXSystem = true
    },
    MessageCharacterLimit = 200,
    VERIFIED_EMOJI = utf8.char(57344),
    TopBarVerticalOffset = l_GuiService_0:GetGuiInset().Y,
    DefaultBubbleChatChildrenCustomizationProperties = {
        ImageLabel = {
            Image = "",
            ImageColor3 = Color3.new(1, 1, 1),
            ImageRectOffset = Vector2.new(),
            ImageRectSize = Vector2.new(),
            ScaleType = Enum.ScaleType.Stretch,
            SliceCenter = Rect.new(Vector2.new(), Vector2.new()),
            SliceScale = 1,
            TileSize = UDim2.fromScale(1, 1)
        },
        UIGradient = {
            Enabled = false,
            Color = ColorSequence.new(Color3.fromRGB(150, 150, 150), Color3.fromRGB(250, 250, 250)),
            Offset = Vector2.new(),
            Rotation = 0,
            Transparency = NumberSequence.new(0)
        },
        UICorner = {
            CornerRadius = UDim.new(0, 12)
        },
        UIPadding = {
            PaddingTop = UDim.new(0, 8),
            PaddingRight = UDim.new(0, 8),
            PaddingBottom = UDim.new(0, 8),
            PaddingLeft = UDim.new(0, 8)
        }
    },
    DefaultBubbleChatMessagePropertiesInstanceSettings = {
        BackgroundColor3 = Color3.fromRGB(250, 250, 250),
        BackgroundTransparency = 0.1,
        FontFace = if not l_Config_0.enableFontNameMapping then Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal) else Font.new("rbxasset://fonts/families/BuilderSans.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal),
        TextColor3 = Color3.fromRGB(57, 59, 61),
        TextSize = 16
    },
    AutocompleteEntryDefaultSizeY = 30,
    AutocompleteFrameDefaultSizeY = 105,
    AutocompleteSelectedColor = Color3.fromRGB(255, 255, 255),
    AutocompleteSelectedTransparency = 0.85,
    ChatInputBarDefaultAutocompleteEnabled = false,
    AvatarChatUISettings = {
        FrameHeight = 30,
        IconSize = UDim2.fromOffset(24, 24),
        IconTransparency = 0.1,
        DoubleIconButtonSize = UDim2.fromOffset(38, 30),
        SingleIconButtonSize = UDim2.fromOffset(30, 30),
        SingleIconCornerRadiusOffset = 8,
        DoubleIconCornerRadiusOffset = 10,
        DividerSize = UDim2.fromOffset(2, 18),
        DividerColor = Color3.fromHex("#BDBEBE")
    },
    Permissions = {
        CAMERA_ACCESS = "camera",
        MICROPHONE_ACCESS = "microphone"
    }
};


local v0 = require(script:FindFirstAncestor("ExpChat").DispatchBindableEvent);
return {
    queue = {},
    add = function(v1, v2)
        v1.queue[#v1.queue + 1] = v2;
    end,
    flush = function(v3)
        if #v3.queue then
            for _, v5 in pairs(v3.queue) do
                v0:Fire(v5);
            end;
        end;
    end
};


local v0 = require(script.Parent.bindableEventQueue);
return function(v1)
    return function(v2)
        return function(...)
            local v3 = v2(...);
            if v1:GetAttribute("isConnected") ~= true then
                v0:add(v3);
                return ;
            else
                v1:Fire(v3);
                return ;
            end;
        end;
    end;
end;


return {
    ChatTopBarButtonActivated = require(script.ChatTopBarButtonActivated),
    SetCoreGuiEnabledChanged = require(script.SetCoreGuiEnabledChanged),
    AvatarContextMenuWhisperSelected = require(script.AvatarContextMenuWhisperSelected),
    VoiceStateChanged = require(script.VoiceStateChanged),
    VoiceEnabledChanged = require(script.VoiceEnabledChanged),
    VoiceParticipantAdded = require(script.VoiceParticipantAdded),
    VoiceParticipantsChanged = require(script.VoiceParticipantsChanged),
    VoiceParticipantRemoved = require(script.VoiceParticipantRemoved),
    VoiceParticipantToggleMuted = require(script.VoiceParticipantToggleMuted),
    LegacyBubbleCreated = require(script.LegacyBubbleCreated),
    LegacyBubbleTextUpdated = require(script.LegacyBubbleTextUpdated)
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
return {
    roact = require(l_script_FirstAncestor_0.Parent.Roact),
    mapStory = require(script.storyMiddleware),
    storyRoots = {
        l_script_FirstAncestor_0
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.UIBlox);
local l_Dictionary_0 = require(l_Parent_0.llama).Dictionary;
local l_status_0, l_result_0 = pcall(function()
    v3.init((require(l_script_FirstAncestor_0:FindFirstChild("UIBloxConfig"))));
end);
if not l_status_0 then
    warn("Error initializing UIBlox", l_result_0);
end;
local l_AppStyleProvider_0 = v3.App.Style.AppStyleProvider;
local l_Constants_0 = v3.App.Style.Constants;
local l_Light_0 = l_Constants_0.ThemeName.Light;
local l_Dark_0 = l_Constants_0.ThemeName.Dark;
local l_Gotham_0 = l_Constants_0.FontName.Gotham;
local v12 = {
    Light = {
        themeName = l_Light_0,
        fontName = l_Gotham_0
    },
    Dark = {
        themeName = l_Dark_0,
        fontName = l_Gotham_0
    }
};
local v13 = {};
return function(v14)
    if not v13[v14] then
        v13[v14] = function(v15)
            return v2.createElement(l_AppStyleProvider_0, {
                style = v12[v15.theme or "Dark"]
            }, {
                Child = v2.createElement(v14, l_Dictionary_0.join(v15, v15.definition and v15.definition.props))
            });
        end;
    end;
    return v13[v14];
end;


game:DefineFastFlag("AllowClearCommand", false);
return function()
    return game:GetFastFlag("AllowClearCommand");
end;


game:DefineFastFlag("EnableCommandAutocomplete", false);
return function()
    return game:GetFastFlag("EnableCommandAutocomplete");
end;


game:DefineFastFlag("FixInvalidMessagesShowingOnSenderSide", false);
return function()
    return game:GetFastFlag("FixInvalidMessagesShowingOnSenderSide");
end;


game:DefineFastFlag("ShowVerifiedBadgeInNewChat", false);
return function()
    return game:GetFastFlag("ShowVerifiedBadgeInNewChat");
end;


game:DefineFastFlag("SortAutocompleteByPopularity", false);
return function()
    return game:GetFastFlag("SortAutocompleteByPopularity");
end;


game:DefineFastFlag("FixChatInputFocus", false);
return function()
    return game:GetFastFlag("FixChatInputFocus");
end;


game:DefineFastFlag("ForceChatBubbleColor", true);
return function()
    return game:GetFastFlag("ForceChatBubbleColor");
end;


game:DefineFastFlag("VoiceTCSBubbleClickState", false);
return function()
    return game:GetFastFlag("VoiceTCSBubbleClickState");
end;


game:DefineFastString("VoiceUIImprovementsIXPLayerName", "Voice.Exposure");
return function()
    return game:GetFastString("VoiceUIImprovementsIXPLayerName");
end;


return function()
    return game:GetEngineFeature("EnableBubbleChatConfigurationMaxBubbles");
end;


return function()
    return game:GetEngineFeature("EnableBubbleChatConfigurationTailVisible");
end;


return function()
    return game:GetEngineFeature("EnableChatInputBarConfigurationAutocompleteEnabled") and not game:GetService("UserInputService").TouchEnabled;
end;


return function()
    return game:GetEngineFeature("EnableChatInputBarConfigurationPropertyIsFocused");
end;


return function()
    return game:GetEngineFeature("EnableChatInputBarConfigurationPropertyKeyboardKeyCode");
end;


return function()
    return game:GetEngineFeature("EnableChatInputBarConfigurationStyleCustomizations");
end;


return function()
    return game:GetEngineFeature("EnablePerBubbleCustomization");
end;


return function()
    return game:GetEngineFeature("EnableDisplayBubble");
end;


game:DefineFastFlag("ChatTranslationEnableSystemMessage", false);
return function()
    return game:GetFastFlag("ChatTranslationEnableSystemMessage");
end;


game:DefineFastFlag("ChatTranslationShowFTUX", false);
return function()
    return game:GetFastFlag("ChatTranslationShowFTUX");
end;


game:DefineFastFlag("ChatTranslationUIEnabled", false);
return function()
    return game:GetFastFlag("ChatTranslationUIEnabled");
end;


local l_TextChatService_0 = game:GetService("TextChatService");
local v1 = require(script.Parent.getFFlagChatTranslationUIEnabled);
return function()
    if not (l_TextChatService_0.ChatVersion == Enum.ChatVersion.LegacyChatService) then
        return v1();
    else
        return false;
    end;
end;


game:DefineFastFlag("EnableExpChatVoiceUIImprovements2", false);
return function()
    return game:GetFastFlag("EnableExpChatVoiceUIImprovements2");
end;


game:DefineFastFlag("EnableExperienceChatOptimizations", false);
return function()
    return game:GetFastFlag("EnableExperienceChatOptimizations");
end;


game:DefineFastFlag("EnablePerBubbleCustomization", false);
return function()
    return game:GetFastFlag("EnablePerBubbleCustomization");
end;


game:DefineFastFlag("EnableShimmeringIcon", false);
return function()
    return game:GetFastFlag("EnableShimmeringIcon");
end;


game:DefineFastFlag("FixBubbleChatCaret", false);
return function()
    return game:GetFastFlag("FixBubbleChatCaret");
end;


game:DefineFastFlag("FixBubbleChatTailVisible", false);
return function()
    return game:GetFastFlag("FixBubbleChatTailVisible");
end;


game:DefineFastFlag("HideLocalPlayerControlBubbleForVR", true);
return function()
    return game:GetFastFlag("HideLocalPlayerControlBubbleForVR");
end;


game:DefineFastFlag("OverridePlayerVerifiedBadge", false);
return function()
    return game:GetFastFlag("OverridePlayerVerifiedBadge");
end;


game:DefineFastFlag("ReplicateUIPaddingChildProperties", false);
return function()
    return game:GetFastFlag("ReplicateUIPaddingChildProperties");
end;


game:DefineFastString("WhitelistVerifiedUserId", "");
return function()
    return game:GetFastString("WhitelistVerifiedUserId");
end;


game:DefineFastFlag("FixBubblesOutofOrderWhenZoomedIn", false);
return function()
    return game:GetFastFlag("FixBubblesOutofOrderWhenZoomedIn");
end;


game:DefineFastFlag("SetUpBubbleChatConfigurationChildProperties", false);
return function()
    return game:GetFastFlag("SetUpBubbleChatConfigurationChildProperties");
end;


return function()
    return game:GetEngineFeature("TextChatServicePropertyTextBox");
end;


return function()
    return game:GetEngineFeature("TextChatServiceTextChatCommandAutocompleteVisible");
end;


local l_AppStorageService_0 = game:GetService("AppStorageService");
game:DefineFastInt("ExperienceChatUserProfileApiRollout_v1", 0);
game:DefineFastFlag("ExperienceChatUserProfileApiEnabledForAll_v1", false);
local function _(v1)
    local l_l_AppStorageService_0_0 = l_AppStorageService_0;
    if v1 then
        l_l_AppStorageService_0_0 = v1;
    end;
    local l_l_l_AppStorageService_0_0_Item_0 = l_l_AppStorageService_0_0:GetItem("AppInstallationId");
    local v4 = typeof(l_l_l_AppStorageService_0_0_Item_0);
    if v4 == "number" then
        return l_l_l_AppStorageService_0_0_Item_0;
    elseif v4 == "string" then
        if string.len(l_l_l_AppStorageService_0_0_Item_0) <= 0 then
            return nil;
        else
            return (tonumber((string.sub(l_l_l_AppStorageService_0_0_Item_0, -2))));
        end;
    else
        return nil;
    end;
end;
local function _(v6, v7)
    local v8 = v6();
    local l_l_AppStorageService_0_1 = l_AppStorageService_0;
    if v7 then
        l_l_AppStorageService_0_1 = v7;
    end;
    local l_l_l_AppStorageService_0_1_Item_0 = l_l_AppStorageService_0_1:GetItem("AppInstallationId");
    local v11 = typeof(l_l_l_AppStorageService_0_1_Item_0);
    local v12 = if v11 == "number" then l_l_l_AppStorageService_0_1_Item_0 else if v11 == "string" then if string.len(l_l_l_AppStorageService_0_1_Item_0) <= 0 then nil else tonumber((string.sub(l_l_l_AppStorageService_0_1_Item_0, -2))) else nil;
    if v12 == nil then
        return v8 >= 100;
    else
        return v12 % 100 + 1 <= v8;
    end;
end;
local function _(v14, v15)
    local v16 = v14();
    local l_l_AppStorageService_0_2 = l_AppStorageService_0;
    if v15 then
        l_l_AppStorageService_0_2 = v15;
    end;
    local l_l_l_AppStorageService_0_2_Item_0 = l_l_AppStorageService_0_2:GetItem("AppInstallationId");
    local v19 = typeof(l_l_l_AppStorageService_0_2_Item_0);
    local v20 = if v19 == "number" then l_l_l_AppStorageService_0_2_Item_0 else if v19 == "string" then if string.len(l_l_l_AppStorageService_0_2_Item_0) <= 0 then nil else tonumber((string.sub(l_l_l_AppStorageService_0_2_Item_0, -2))) else nil;
    local v21 = if v20 == nil then v16 >= 100 else v20 % 100 + 1 <= v16;
    return function()
        return v21;
    end;
end;
local function v23()
    return game:GetFastInt("ExperienceChatUserProfileApiRollout_v1");
end;
local function _()
    return game:GetFastFlag("ExperienceChatUserProfileApiEnabledForAll_v1");
end;
local v25 = v23();
local l_l_AppStorageService_0_Item_0 = l_AppStorageService_0:GetItem("AppInstallationId");
local v27 = typeof(l_l_AppStorageService_0_Item_0);
local v28 = if v27 == "number" then l_l_AppStorageService_0_Item_0 else if v27 == "string" then if string.len(l_l_AppStorageService_0_Item_0) <= 0 then nil else tonumber((string.sub(l_l_AppStorageService_0_Item_0, -2))) else nil;
local v29 = if v28 == nil then v25 >= 100 else v28 % 100 + 1 <= v25;
local function v30()
    return v29;
end;
return function()
    return game:GetFastFlag("ExperienceChatUserProfileApiEnabledForAll_v1") or v30();
end;


local l_Players_0 = game:GetService("Players");
local v1 = {
    Color3.new(0.9921568627450981, 0.1607843137254902, 0.2627450980392157),
    Color3.new(0.00392156862745098, 0.6352941176470588, 1),
    Color3.new(0.00784313725490196, 0.7215686274509804, 0.3411764705882353),
    BrickColor.new("Alder").Color,
    BrickColor.new("Bright orange").Color,
    BrickColor.new("Bright yellow").Color,
    BrickColor.new("Light reddish violet").Color,
    BrickColor.new("Brick yellow").Color
};
local function v7(v2)
    local v3 = 0;
    for v4 = 1, #v2 do
        local v5 = string.byte((string.sub(v2, v4, v4)));
        local v6 = (#v2 - v4) + 1;
        if #v2 % 2 == 1 then
            v6 = v6 - 1;
        end;
        if v6 % 4 >= 2 then
            v5 = -v5;
        end;
        v3 = v3 + v5;
    end;
    return v3;
end;
local function _(v8)
    return v1[(v7(v8) + 0) % #v1 + 1];
end;
return function(v10)
    local l_l_Players_0_PlayerByUserId_0 = l_Players_0:GetPlayerByUserId(v10);
    if not l_l_Players_0_PlayerByUserId_0 then
        return Color3.fromRGB(255, 255, 255);
    elseif l_l_Players_0_PlayerByUserId_0.Team ~= nil then
        return l_l_Players_0_PlayerByUserId_0.TeamColor.Color;
    else
        return v1[(v7(l_l_Players_0_PlayerByUserId_0.Name) + 0) % #v1 + 1];
    end;
end;


return {
    AvatarChatEnabled = false,
    ChromeEnabled = false,
    DoNotPromptCameraPermissionsOnMount = false,
    EnableAlwaysAvailableCamera = false,
    ConsolidateBubbleChat = false,
    RenderVoiceBubbleAfterAsyncInit = false,
    JoinWithoutMicPermissions = false
};