local l_CorePackages_0 = game:GetService("CorePackages");
local l_LocalizationService_0 = game:GetService("LocalizationService");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_reverse_0 = require(l_CorePackages_0.Packages.LuauPolyfill).Array.reverse;
local v4 = require(l_CorePackages_0.Workspace.Packages.AppCommonLib);
local l_Localization_0 = require(l_CorePackages_0.Workspace.Packages.InExperienceLocales).Localization;
local l_Signal_0 = v4.Signal;
local v7 = require(script.Parent.ChromeUtils);
local v8 = require(script.Parent.LocalStore);
local v9 = require(script.Parent.ViewportUtil);
local v10 = require(script.Parent.WindowSizeSignal);
local l_ObservableValue_0 = v7.ObservableValue;
local l_NotifySignal_0 = v7.NotifySignal;
local l_AvailabilitySignal_0 = v7.AvailabilitySignal;
local _ = require(script.Parent.Types);
local v15 = require(script.Parent.Parent.Flags.GetFFlagEnableUnibarSneakPeak);
local v16 = require(script.Parent.Parent.Flags.GetFFlagEnableChromeFTUX);
local v17 = require(script.Parent.Parent.Flags.GetFFlagEnableUnibarMaxDefaultOpen);
local v18 = require(script.Parent.Parent.Flags.GetFFlagEnableChromeEscapeFix);
local v19 = require(script.Parent.Parent.Flags.GetFFlagEnableChromeDefaultOpen);
local v20 = require(script.Parent.Parent.Flags.GetFFlagNewUnibarIA);
local v21 = require(script.Parent.Parent.Flags.GetFFlagEnableChromePinIntegrations);
local v22 = require(script.Parent.Parent.Flags.GetFFlagEnableChromePinnedChat)();
local l_GetFFlagChromeSurveySupport_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagChromeSurveySupport;
local v24 = require(script.Parent.Parent.Flags.GetFFlagOpenControlsOnMenuOpen);
local l_GetFFlagSupportCompactUtility_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagSupportCompactUtility;
local v26 = require(script.Parent.Parent.Flags.GetFFlagDisableMostRecentlyUsed);
local v27 = require(script.Parent.Parent.Flags.GetFFlagEnableSaveUserPins);
local v28 = require(script.Parent.Parent.Flags.GetFFlagUseSelfieViewFlatIcon);
local v29 = game:DefineFastFlag("PreserveWindowsCompactUtility", false);
local v30 = game:DefineFastString("ChromeServiceDefaultPins", "leaderboard,trust_and_safety");
local v31 = {};
v31.__index = v31;
v31.AvailabilitySignal = v7.AvailabilitySignalState;
v31.MenuStatus = {
    Closed = 0,
    Open = 1
};
v31.IntegrationStatus = {
    None = 0,
    Icon = 1,
    Window = 2
};
v31.Key = {
    MostRecentlyUsed = "MRU",
    UserPinned = if not v21 then nil else "UP"
};
noop = function()
end;
local v32 = {
    id = "div",
    label = "div",
    initialAvailability = v31.AvailabilitySignal.Unavailable,
    availability = l_AvailabilitySignal_0.new(v31.AvailabilitySignal.Unavailable),
    notification = l_NotifySignal_0.new(),
    components = {},
    hideNotificationCountWhileOpen = false
};
createUnibarLayoutInfo = function(v33, v34, v35)
    return {
        [v31.MenuStatus.Open] = Rect.new(v33, v33 + v35),
        [v31.MenuStatus.Closed] = Rect.new(v33, v33 + v34)
    };
end;
v31.new = function()
    local l_RobloxLocaleId_0 = l_LocalizationService_0.RobloxLocaleId;
    local v37 = {
        _chromeSeenCount = not v17() and 0 or getChromeSeenCount()
    };
    local v38 = if not not v19() and (v15() or v17()) then getInitialStatus(v37._chromeSeenCount) else v7.ObservableValue.new(v31.MenuStatus.Closed);
    v37._status = v38;
    v37._layout = v7.ObservableValue.new(createUnibarLayoutInfo(Vector2.zero, Vector2.zero, Vector2.zero));
    v37._menuAbsolutePosition = Vector2.zero;
    v37._menuAbsoluteSizeOpen = Vector2.zero;
    v37._menuAbsoluteSizeClosed = Vector2.zero;
    v37._currentSubMenu = v7.ObservableValue.new(nil);
    v37._selectedItem = v7.ObservableValue.new(nil);
    v37._selectedItemIdx = 0;
    v37._integrations = {};
    v37._integrationsConnections = {};
    v37._integrationsStatus = {};
    v37._menuConfig = {};
    v37._subMenuConfig = {};
    v37._compactUtilityConfig = {};
    v37._currentCompactUtility = l_ObservableValue_0.new(nil);
    v37._subMenuNotifications = {};
    v37._menuList = l_ObservableValue_0.new({});
    v37._windowList = l_ObservableValue_0.new({});
    v37._dragConnection = {};
    v37._windowPositions = l_ObservableValue_0.new({});
    v37._totalNotifications = l_NotifySignal_0.new(true);
    v37._mostRecentlyUsedFullRecord = {};
    v37._mostRecentlyUsed = {};
    v37._userPins = {};
    v37._mostRecentlyUsedAndPinnedLimit = 1;
    v37._localization = l_Localization_0.new(l_RobloxLocaleId_0);
    v37._localizedLabelKeys = {};
    v37._notificationIndicator = l_ObservableValue_0.new(nil);
    v37._lastDisplayedNotificationTick = 0;
    v37._lastDisplayedNotificationId = "";
    v37._orderAlignment = l_ObservableValue_0.new(Enum.HorizontalAlignment.Left);
    v37._onIntegrationRegistered = l_Signal_0.new();
    v37._onIntegrationActivated = l_Signal_0.new();
    v37._onIntegrationStatusChanged = l_Signal_0.new();
    v37._lastInputToOpenMenu = if (not not v18() and v19()) and v38:get() == v31.MenuStatus.Open then Enum.UserInputType.MouseButton1 else Enum.UserInputType.None;
    local v39 = setmetatable(v37, v31);
    v9.viewport:connect(function(v40)
        v39:updateScreenSize(v40.size, v40.isMobileDevice, v40.portraitOrientation, v40.tinyPortrait);
    end, true);
    if v17() then
        v39:storeChromeSeen();
    end;
    return v39;
end;
getChromeSeenCount = function()
    if not l_GetFFlagChromeSurveySupport_0() then
        if not (not v17() or not v8.isEnabled()) then
            local v41 = v8.loadForLocalPlayer("ChromeSeenCount");
            if not (not v41 or not tonumber(v41)) then
                return v41;
            end;
        end;
        return 0;
    else
        return v8.getChromeSeenCount();
    end;
end;
getInitialStatus = function(v42)
    if v8.isEnabled() then
        if not v15() or not v8.loadForLocalPlayer("ChromeInteracted2") then
            if v17() and v42 >= 3 then
                return v7.ObservableValue.new(v31.MenuStatus.Closed);
            end;
        else
            return v7.ObservableValue.new(v31.MenuStatus.Closed);
        end;
    end;
    return v7.ObservableValue.new(v31.MenuStatus.Open);
end;
v31.storeChromeInteracted = function(_)
    if not (not v15() or not v8.isEnabled()) then
        v8.storeForLocalPlayer("ChromeInteracted2", true);
    end;
end;
v31.storeChromeSeen = function(v44)
    if not (not v17() or not v8.isEnabled()) and v44._chromeSeenCount + 1 < math.huge then
        v8.storeForLocalPlayer("ChromeSeenCount", v44._chromeSeenCount + 1);
    end;
end;
v31.updateScreenSize = function(v45, _, v47, v48, v49)
    local v50 = 0;
    if not v47 then
        v50 = 4;
    else
        v50 = if not v49 then v48 and 1 or 2 else 0;
        if not (not v22 or v20()) then
            v50 = math.max(0, v50 - 1);
        end;
    end;
    if v50 ~= v45._mostRecentlyUsedAndPinnedLimit then
        v45._mostRecentlyUsedAndPinnedLimit = v50;
        if v21() then
            v45:rebuildUserPins();
        end;
        v45:rebuildMostRecentlyUsed();
    end;
    v45:updateWindowSizeSignals();
end;
v31.rebuildMostRecentlyUsed = function(v51)
    table.clear(v51._mostRecentlyUsed);
    local v52 = #v51._mostRecentlyUsedFullRecord;
    if v52 > 0 then
        local v53 = (v52 - v51._mostRecentlyUsedAndPinnedLimit) + 1;
        if v21() then
            v53 = ((v52 - v51._mostRecentlyUsedAndPinnedLimit) + #v51._userPins) + 1;
        end;
        table.move(v51._mostRecentlyUsedFullRecord, math.max(1, v53), v52, 1, v51._mostRecentlyUsed);
    end;
    v51:updateMenuList();
    v51:updateNotificationTotals();
end;
v31.rebuildUserPins = function(v54)
    if v21() and v54._mostRecentlyUsedAndPinnedLimit < #v54._userPins then
        local v55 = {};
        local v56 = #v54._userPins;
        table.move(v54._userPins, math.max(1, (v56 - v54._mostRecentlyUsedAndPinnedLimit) + 1), v56, 1, v55);
        v54._userPins = v55;
        v54:updateMenuList();
        v54:updateNotificationTotals();
    end;
    if v27() then
        local v57 = {};
        for v58 in v30:gmatch("([^,]+),?") do
            table.insert(v57, v58);
        end;
        v54._userPins = v8.loadForLocalPlayer("ChromePinned") or v57;
        v54:updateMenuList();
        v54:updateNotificationTotals();
    end;
end;
v31.updateWindowSizeSignals = function(v59)
    for _, v61 in v59._integrations, nil, nil do
        if v61.windowSize then
            v61.windowSize:updateConstraints();
        end;
    end;
end;
v31.triggerNotificationIndicator = function(v62, v63)
    local l__status_0 = v62._status;
    local v65 = v62._integrations[v63];
    local v66 = v65.availability:get();
    if not (v66 ~= v31.AvailabilitySignal.Unavailable) or v66 == v31.AvailabilitySignal.Pinned then
        return ;
    elseif l__status_0:get() ~= v31.MenuStatus.Closed then
        return ;
    else
        local v67 = v65.notification:get();
        if v67.type == "count" and v67.value > 0 then
            local v68 = tick();
            local v69 = v68 - v62._lastDisplayedNotificationTick;
            v62._lastDisplayedNotificationTick = v68;
            if v62._lastDisplayedNotificationId == v63 and v69 < 10 then
                return ;
            else
                v62._lastDisplayedNotificationId = v63;
                v62._notificationIndicator:setMomentary(v62:createIconProps(v63, 0, false), 2.5);
            end;
        end;
        return ;
    end;
end;
v31.notificationIndicator = function(v70)
    return v70._notificationIndicator;
end;
v31.toggleSubMenu = function(v71, v72)
    if v71._status:get() == v31.MenuStatus.Closed then
        warn("Can't toggleSubMenu while menu is closed");
        return ;
    elseif v71._subMenuConfig[v72] then
        if v71._currentSubMenu:get() == v72 then
            v71._currentSubMenu:set(nil);
            return ;
        else
            v71._currentSubMenu:set(v72);
            return ;
        end;
    else
        warn("Not a valid subMenuId:" .. v72);
        return ;
    end;
end;
v31.currentSubMenu = function(v73)
    return v73._currentSubMenu;
end;
v31.toggleOpen = function(v74)
    local l__status_1 = v74._status;
    local l__currentSubMenu_0 = v74._currentSubMenu;
    if not v15() then
        if l__status_1:get() == v31.MenuStatus.Closed then
            l__status_1:set(v31.MenuStatus.Open);
            v74._lastDisplayedNotificationId = "";
            v74._notificationIndicator:set(nil);
            v74._lastInputToOpenMenu = l_UserInputService_0:GetLastInputType();
            return ;
        else
            v74._selectedItem:set(nil);
            l__currentSubMenu_0:set(nil);
            l__status_1:set(v31.MenuStatus.Closed);
            v74._lastInputToOpenMenu = Enum.UserInputType.None;
            return ;
        end;
    elseif l__status_1:get() == v31.MenuStatus.Closed then
        v74:open();
        return ;
    else
        v74:close();
        return ;
    end;
end;
v31.open = function(v77, v78)
    local l__status_2 = v77._status;
    if l__status_2:get() == v31.MenuStatus.Closed then
        l__status_2:set(v31.MenuStatus.Open);
        v77._lastDisplayedNotificationId = "";
        v77._notificationIndicator:set(nil);
        if not v16() and not v24() then
            v77._lastInputToOpenMenu = l_UserInputService_0:GetLastInputType();
        else
            v77._lastInputToOpenMenu = if not v78 then l_UserInputService_0:GetLastInputType() else Enum.UserInputType.Touch;
            return ;
        end;
    end;
end;
v31.close = function(v80, v81)
    local l__status_3 = v80._status;
    local l__currentSubMenu_1 = v80._currentSubMenu;
    local l__currentCompactUtility_0 = v80._currentCompactUtility;
    if l__status_3:get() == v31.MenuStatus.Open then
        if not (l_GetFFlagSupportCompactUtility_0() and l__currentCompactUtility_0:get() ~= nil) or v81 then
            if l_GetFFlagSupportCompactUtility_0() then
                local v85 = l__currentCompactUtility_0:get();
                if v85 then
                    v80:toggleCompactUtility(v85);
                end;
            end;
            v80._selectedItem:set(nil);
            l__currentSubMenu_1:set(nil);
            l__status_3:set(v31.MenuStatus.Closed);
            v80._lastInputToOpenMenu = Enum.UserInputType.None;
        else
            return ;
        end;
    end;
end;
v31.getLastInputToOpenMenu = function(v86)
    return v86._lastInputToOpenMenu;
end;
v31.toggleWindow = function(v87, v88)
    if v87._integrations[v88].components.Window then
        if not (v87._integrationsStatus[v88] and v87._integrationsStatus[v88] ~= v31.IntegrationStatus.None) or v87._integrationsStatus[v88] == v31.IntegrationStatus.Icon then
            v87._integrationsStatus[v88] = v31.IntegrationStatus.Window;
        else
            v87._integrationsStatus[v88] = v31.IntegrationStatus.Icon;
        end;
        v87._onIntegrationStatusChanged:fire(v88, v87._integrationsStatus[v88]);
    end;
    v87:updateMenuList();
end;
v31.isWindowOpen = function(v89, v90)
    return v89._integrations[v90].components.Window and v89._integrationsStatus[v90] == v31.IntegrationStatus.Window;
end;
v31.status = function(v91)
    return v91._status;
end;
v31.menuList = function(v92)
    return v92._menuList;
end;
v31.windowList = function(v93)
    return v93._windowList;
end;
v31.dragConnection = function(v94, v95)
    if not v94._integrations[v95] then
        return nil;
    else
        return v94._dragConnection[v95];
    end;
end;
v31.updateLocalization = function(v96, v97)
    local v98 = "";
    local v99 = "";
    v96._localizedLabelKeys[v97.id] = {};
    v96._localizedLabelKeys[v97.id].label = v97.label;
    v98 = v97.label;
    local l_status_0, l_result_0 = pcall(function()
        v98 = v96._localization:Format(v98);
    end);
    if not l_status_0 then
        v98 = v97.label;
        warn(l_result_0);
    end;
    v97.label = v98;
    if v97.secondaryAction then
        v96._localizedLabelKeys[v97.id].secondaryActionLabel = v97.secondaryAction.label;
        v99 = v97.secondaryAction.label;
        local l_status_1, l_result_1 = pcall(function()
            v99 = v96._localization:Format(v99);
        end);
        if not l_status_1 then
            v99 = v97.secondaryAction.label;
            warn(l_result_1);
        end;
        v97.secondaryAction.label = v99;
    end;
    return v97;
end;
v31.register = function(v104, v105)
    if v104._integrations[v105.id] then
        warn(string.format(v105.id .. "already registered", debug.traceback()));
        for _, v107 in v104._integrationsConnections[v105.id], nil, nil do
            v107:disconnect();
        end;
    end;
    v104._integrationsConnections[v105.id] = {};
    local v108 = v104._integrationsConnections[v105.id];
    if v105.initialAvailability == nil then
        v105.initialAvailability = v31.AvailabilitySignal.Unavailable;
    end;
    if v105.availability == nil then
        v105.availability = l_AvailabilitySignal_0.new(v105.initialAvailability or v31.AvailabilitySignal.Unavailable);
    end;
    if v105.notification == nil then
        v105.notification = l_NotifySignal_0.new();
    end;
    if v105.components == nil then
        v105.components = {};
    end;
    if v105.availability then
        v108[#v108 + 1] = v105.availability:connect(function()
            v104:availabilityChanged(v105);
        end);
    end;
    if not (not v105.notification or v105.notification:excludeFromTotalCounts()) then
        v108[#v108 + 1] = v105.notification:connect(function()
            v104:triggerNotificationIndicator(v105.id);
            v104:updateNotificationTotals();
        end);
    end;
    if not ((not (v105.windowSize == nil) or not v105.components) or not v105.components.Window) then
        v105.windowSize = v10.new();
    end;
    v105 = v104:updateLocalization(v105);
    local l_v105_0 = v105;
    v104._integrations[v105.id] = l_v105_0;
    return l_v105_0;
end;
v31.createIconProps = function(v110, v111, v112, v113)
    local v114 = v112 or 0;
    if not v110._integrations[v111] then
        return {
            id = v111,
            children = {},
            order = v114,
            activated = noop,
            integration = v32
        };
    else
        return {
            id = v111,
            children = {},
            order = v114,
            component = v110._integrations[v111].components.Icon,
            integration = v110._integrations[v111],
            isDivider = false,
            recentlyUsedItem = v113 or false,
            activated = function()
                v110:activate(v111);
            end
        };
    end;
end;
reverseOrder = function(v115)
    local v116 = #v115;
    local v117 = {};
    for v118 = 1, v116 do
        v117[v118] = v115[v118].order;
    end;
    for v119 = 1, v116 do
        v115[v119].order = v117[(v116 - v119) + 1];
    end;
end;
v31.updateMenuList = function(v120)
    local v121 = 0;
    local v122 = 0;
    local function v125(v123, v124)
        v122 = v122 + 1;
        return v120:createIconProps(v123, v122, v124);
    end;
    local function v127(v126)
        v122 = v122 + 1;
        if not v120._integrations[v126] then
            return {
                id = v126,
                children = {},
                order = v122,
                activated = noop,
                integration = v32
            };
        else
            return {
                id = v126,
                children = {},
                order = v122,
                component = v120._integrations[v126].components.Window,
                activated = noop,
                integration = v120._integrations[v126]
            };
        end;
    end;
    local function v129(_)
        v121 = v121 + 1;
        v122 = v122 + 1;
        return {
            id = "DIV" .. v121,
            order = v122,
            isDivider = true,
            children = {},
            activated = noop,
            integration = v32
        };
    end;
    local function _(v130)
        local v131 = v120._integrations[v130];
        if not v131 then
            return false;
        else
            local l_availability_0 = v131.availability;
            return l_availability_0 and l_availability_0:get() ~= v31.AvailabilitySignal.Unavailable;
        end;
    end;
    local function v134(v135, v136, v137, v138)
        local v139 = 0;
        for v140, v141 in pairs(v135) do
            if v141 == v31.Key.MostRecentlyUsed then
                v134(v120._mostRecentlyUsed, v136, v137);
            elseif v21() and v141 == v31.Key.UserPinned then
                v134(v120._userPins, v136, v137);
            elseif type(v141) == "table" then
                if not #v136.children then
                    table.insert(v136.children, (v129(v121)));
                end;
                if v134(v141, v136, v137) > 0 then
                    table.insert(v136.children, (v129(v121)));
                end;
            else
                if typeof(v141) ~= "string" then
                    error((("Only tables or strings should be passed into the items list, received %* (at key %*)"):format(v141, v140)));
                end;
                if not v120._subMenuConfig[v141] then
                    local v142 = v120._integrations[v141];
                    local v143;
                    if not v142 then
                        v143 = false;
                    else
                        local l_availability_1 = v142.availability;
                        v143 = l_availability_1 and l_availability_1:get() ~= v31.AvailabilitySignal.Unavailable;
                    end;
                    if v143 then
                        if not v120:isWindowOpen(v141) then
                            table.insert(v136.children, v125(v141));
                            v139 = v139 + 1;
                        else
                            table.insert(v137, (v127(v141)));
                            if v28() then
                                table.insert(v136.children, v125(v141));
                                v139 = v139 + 1;
                            end;
                        end;
                    end;
                else
                    local v145 = v120._integrations[v141];
                    local v146;
                    if not v145 then
                        v146 = false;
                    else
                        local l_availability_2 = v145.availability;
                        v146 = l_availability_2 and l_availability_2:get() ~= v31.AvailabilitySignal.Unavailable;
                    end;
                    if v146 then
                        v122 = v122 + 1;
                        v146 = v120:createIconProps(v141, v122, v138);
                        v139 = v139 + 1;
                        v134(v120._subMenuConfig[v141], v146, v137);
                        if #v146.children > 0 then
                            table.insert(v136.children, v146);
                        end;
                    end;
                end;
            end;
        end;
        return v139;
    end;
    local v148 = {
        children = {}
    };
    local v149 = {};
    local v150 = if not l_GetFFlagSupportCompactUtility_0() then nil else v120._currentCompactUtility:get();
    if (not l_GetFFlagSupportCompactUtility_0() or not v150) or not v120._compactUtilityConfig[v150] then
        v134(v120._menuConfig, v148, v149);
    else
        v134(v120._compactUtilityConfig[v150], v148, v149);
    end;
    if not ((not #v148.children or not v148.children[#v148.children]) or not v148.children[#v148.children].isDivider) then
        table.remove(v148.children, #v148.children);
    end;
    if v120._orderAlignment:get() == Enum.HorizontalAlignment.Left then
        v148.children = l_reverse_0(v148.children);
        reverseOrder(v148.children);
    end;
    if not (((not l_GetFFlagSupportCompactUtility_0() or not v29) or not v150) or not v120._compactUtilityConfig[v150]) then
        for _, v152 in v120._windowList:get() do
            if v120:isWindowOpen(v152.integration.id) then
                table.insert(v149, v152);
            end;
        end;
    end;
    v120._menuList:set(v148.children);
    v120._windowList:set(v149);
    v120:repairSelected();
end;
v31.availabilityChanged = function(v153, _)
    v153:updateNotificationTotals();
    v153:updateMenuList();
end;
v31.subMenuNotifications = function(v155, v156)
    if not v155._subMenuNotifications[v156] then
        v155._subMenuNotifications[v156] = l_NotifySignal_0.new(true);
    end;
    return v155._subMenuNotifications[v156];
end;
v31.totalNotifications = function(v157)
    return v157._totalNotifications;
end;
v31.onIntegrationRegistered = function(v158)
    return v158._onIntegrationRegistered;
end;
v31.onIntegrationActivated = function(v159)
    return v159._onIntegrationActivated;
end;
v31.onIntegrationStatusChanged = function(v160)
    return v160._onIntegrationStatusChanged;
end;
v31.integrations = function(v161)
    return v161._integrations;
end;
v31.userPins = function(v162)
    return v162._userPins;
end;
v31.mostRecentlyUsed = function(v163)
    return v163._mostRecentlyUsed;
end;
v31.updateNotificationTotals = function(v164)
    local v165 = 0;
    for _, v167 in v164._integrations, nil, nil do
        if not (not (v167.availability:get() ~= v31.AvailabilitySignal.Unavailable and v167.availability:get() ~= v31.AvailabilitySignal.Pinned) or v167.notification:excludeFromTotalCounts()) then
            local v168 = v167.notification:get();
            if v168 and v168.type == "count" then
                assert(typeof(v168.value) == "number", "Expected count value to be number");
                v165 = v165 + v168.value;
            end;
        end;
    end;
    v164._totalNotifications:fireCount(v165);
    for v169, v170 in v164._subMenuNotifications, nil, nil do
        local v171 = v164:withinCurrentTopLevelMenu(v169);
        v165 = 0;
        if v171 then
            for _, v173 in v171.children, nil, nil do
                if not (not (not v164:withinCurrentTopLevelMenu(v173.id) and v173.integration.availability:get() ~= v31.AvailabilitySignal.Unavailable) or v173.integration.notification:excludeFromTotalCounts()) then
                    local v174 = v173.integration.notification:get();
                    if v174 and v174.type == "count" then
                        assert(typeof(v174.value) == "number", "Expected count value to be number");
                        v165 = v165 + v174.value;
                    end;
                end;
            end;
            v170:fireCount(v165);
        end;
    end;
end;
v31.configureReset = function(v175)
    v175._menuConfig = {};
    v175._subMenuConfig = {};
    v175._compactUtilityConfig = {};
    v175._subMenuNotifications = {};
    v175:updateMenuList();
end;
v31.configureMenu = function(v176, v177)
    v176._menuConfig = v177;
    v176:updateNotificationTotals();
    v176:updateMenuList();
end;
v31.configureSubMenu = function(v178, v179, v180)
    v178._subMenuConfig[v179] = v180;
    if not v178._subMenuNotifications[v179] then
        v178._subMenuNotifications[v179] = l_NotifySignal_0.new(true);
    end;
    v178:updateNotificationTotals();
    v178:updateMenuList();
end;
v31.configureCompactUtility = function(v181, v182, v183)
    if l_GetFFlagSupportCompactUtility_0() then
        v181._compactUtilityConfig[v182] = v183;
        v181:updateMenuList();
    end;
end;
v31.toggleCompactUtility = function(v184, v185)
    local v186 = v184._currentCompactUtility:get();
    if l_GetFFlagSupportCompactUtility_0() then
        if not v186 or v186 ~= v185 then
            v184._currentCompactUtility:set(v185);
        else
            v184._currentCompactUtility:set(nil);
        end;
        v184:updateMenuList();
    end;
end;
v31.getCurrentUtility = function(v187)
    return v187._currentCompactUtility;
end;
v31.gesture = function(v188, v189, v190, v191)
    if v188._integrations[v189] then
        v188._dragConnection[v189] = {
            connection = v190,
            inputObject = v191
        };
    end;
end;
v31.withinCurrentTopLevelMenu = function(v192, v193)
    for v194, v195 in (v192._menuList:get()), nil, nil do
        if v195.id == v193 then
            return v195, v194;
        end;
    end;
    return nil, 0;
end;
v31.withinCurrentSubmenu = function(v196, v197)
    local v198 = v196._currentSubMenu:get();
    if v198 then
        local v199 = v196._menuList:get();
        local v200 = nil;
        for _, v202 in v199, nil, nil do
            if v202.id == v198 then
                v200 = v202.children;
                break;
            end;
        end;
        if v200 then
            for _, v204 in v200, nil, nil do
                if v204.id == v197 then
                    return true;
                end;
            end;
            return false;
        else
            return false;
        end;
    else
        return false;
    end;
end;
v31.isMostRecentlyUsed = function(v205, v206)
    return table.find(v205._mostRecentlyUsed, v206) ~= nil;
end;
v31.removeRecentlyUsed = function(v207, v208)
    local v209 = table.find(v207._mostRecentlyUsedFullRecord, v208);
    if v209 then
        table.remove(v207._mostRecentlyUsedFullRecord, v209);
    end;
    v207:rebuildMostRecentlyUsed();
end;
v31.setRecentlyUsed = function(v210, v211, v212)
    if not v26() then
        if not (not v212 and (not v210:withinCurrentSubmenu(v211) or v210:isMostRecentlyUsed(v211))) then
            if not v21() or not v210:isUserPinned(v211) then
                table.insert(v210._mostRecentlyUsed, v211);
                local l__mostRecentlyUsedAndPinnedLimit_0 = v210._mostRecentlyUsedAndPinnedLimit;
                if v21() then
                    l__mostRecentlyUsedAndPinnedLimit_0 = v210._mostRecentlyUsedAndPinnedLimit - #v210._userPins;
                end;
                while v210._mostRecentlyUsedAndPinnedLimit >= 0 and l__mostRecentlyUsedAndPinnedLimit_0 < #v210._mostRecentlyUsed do
                    table.remove(v210._mostRecentlyUsed, 1);
                end;
                v210:updateMenuList();
                v210:updateNotificationTotals();
                local v214 = table.find(v210._mostRecentlyUsedFullRecord, v211);
                if v214 then
                    table.remove(v210._mostRecentlyUsedFullRecord, v214);
                end;
                table.insert(v210._mostRecentlyUsedFullRecord, v211);
            else
                return ;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
v31.isUserPinned = function(v215, v216)
    return v21() and table.find(v215._userPins, v216) ~= nil;
end;
v31.removeUserPin = function(v217, v218)
    if v21() then
        local v219 = table.find(v217._userPins, v218);
        if v219 then
            table.remove(v217._userPins, v219);
        end;
        if v27() then
            v8.storeForLocalPlayer("ChromePinned", v217._userPins);
        end;
        v217:updateMenuList();
        v217:updateNotificationTotals();
        return ;
    else
        return ;
    end;
end;
v31.setUserPin = function(v220, v221, v222)
    if v27() then
        local v223 = v8.loadForLocalPlayer("ChromePinned") or {};
        if not table.find(v223, v221) then
            table.insert(v223, v221);
            v8.storeForLocalPlayer("ChromePinned", v223);
        else
            return ;
        end;
    end;
    if not (not (not (not v222 and (not v220:withinCurrentSubmenu(v221) or v220:isUserPinned(v221))) and #v220._userPins < v220._mostRecentlyUsedAndPinnedLimit) or not v21()) then
        table.insert(v220._userPins, v221);
        v220:removeRecentlyUsed(v221);
    end;
end;
v31.areUserPinsFull = function(v224)
    return v21() and v224._mostRecentlyUsedAndPinnedLimit <= #v224._userPins;
end;
v31.windowPosition = function(v225, v226)
    return v225._windowPositions[v226];
end;
v31.updateWindowPosition = function(v227, v228, v229)
    v227._windowPositions[v228] = v229;
end;
v31.activate = function(v230, v231)
    local v232 = nil;
    if v230._integrations[v231] then
        local v233 = false;
        local l_l_UserInputService_0_LastInputType_0 = l_UserInputService_0:GetLastInputType();
        local v235 = true;
        if l_l_UserInputService_0_LastInputType_0 ~= Enum.UserInputType.MouseButton1 then
            v235 = l_l_UserInputService_0_LastInputType_0 == Enum.UserInputType.Touch;
        end;
        v230:setRecentlyUsed(v231);
        local l_activated_0 = v230._integrations[v231].activated;
        v230._onIntegrationActivated:fire(v231);
        if v15() then
            v230:storeChromeInteracted();
        end;
        if v16() then
            v8.storeForLocalPlayer(v231, true);
        end;
        if not l_activated_0 then
            if v230._subMenuConfig[v231] then
                v230:toggleSubMenu(v231);
                v233 = true;
            end;
            v230:toggleWindow(v231);
        else
            local l_status_2, l_result_2 = pcall(function()
                l_activated_0(v230._integrations[v231]);
            end);
            if not l_status_2 then
                warn("ChromeService: activate error thrown for " .. v231);
                v232 = l_result_2;
            end;
        end;
        if v230._currentSubMenu:get() ~= v231 then
            v230._currentSubMenu:set(nil);
        end;
        local v239 = if not l_GetFFlagSupportCompactUtility_0() then nil else v230._currentCompactUtility ~= nil;
        if ((not v15() or v235) or v233) or v239 then
            if not ((v15() or v235) or v233) and v230._status:get() == v31.MenuStatus.Open then
                v230:toggleOpen();
            end;
        else
            v230:close();
        end;
    end;
    if v232 then
        error(v232);
    end;
end;
v31.selectedItem = function(v240)
    return v240._selectedItem;
end;
v31.setSelected = function(v241, v242)
    local v243, v244 = v241:withinCurrentTopLevelMenu(v242 or "");
    if v243 then
        local l_l_UserInputService_0_LastInputType_1 = l_UserInputService_0:GetLastInputType();
        local v246 = true;
        if l_l_UserInputService_0_LastInputType_1 ~= Enum.UserInputType.MouseButton1 then
            v246 = l_l_UserInputService_0_LastInputType_1 == Enum.UserInputType.Touch;
        end;
        local v247 = v241._currentSubMenu:get();
        if not (not (v247 and v247 ~= v242) or v246) then
            v241:toggleSubMenu(v247);
        end;
        v241._selectedItemIdx = v244;
        v241._selectedItem:set(v242);
        return ;
    else
        return ;
    end;
end;
v31.setSelectedByOffset = function(v248, v249)
    local v250 = v248._menuList:get();
    local _, v252 = v248:withinCurrentTopLevelMenu(v248._selectedItem:get() or "");
    if v252 > 0 then
        v248:setSelected(v250[math.clamp(v252 + v249, 1, #v250)].id);
    end;
end;
v31.repairSelected = function(v253)
    if v253._selectedItem:get() then
        local _, v255 = v253:withinCurrentTopLevelMenu(v253._selectedItem:get() or "");
        if v255 == 0 then
            v255 = v253._selectedItemIdx;
        end;
        local v256 = v253._menuList:get();
        v253:setSelected(v256[math.clamp(v255, 1, #v256)].id);
    end;
end;
v31.configureOrderAlignment = function(v257, v258)
    if v257._orderAlignment:get() ~= v258 then
        v257._orderAlignment:set(v258);
        v257:updateMenuList();
    end;
end;
v31.orderAlignment = function(v259)
    return v259._orderAlignment;
end;
v31.setMenuAbsolutePosition = function(v260, v261)
    if v261 ~= v260._menuAbsolutePosition then
        v260._menuAbsolutePosition = v261;
        v260._layout:set(createUnibarLayoutInfo(v261, v260._menuAbsoluteSizeClosed, v260._menuAbsoluteSizeOpen));
    end;
end;
v31.setMenuAbsoluteSize = function(v262, v263, v264)
    if not (v263 == v262._menuAbsoluteSizeClosed) or v264 ~= v262._menuAbsoluteSizeOpen then
        v262._menuAbsoluteSizeClosed = v263;
        v262._menuAbsoluteSizeOpen = v264;
        v262._layout:set(createUnibarLayoutInfo(v262._menuAbsolutePosition, v263, v264));
    end;
end;
v31.layout = function(v265)
    return v265._layout;
end;
return v31;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_GuiService_0 = game:GetService("GuiService");
local l_RunService_0 = game:GetService("RunService");
local v3 = require(l_CorePackages_0.Packages.React);
local v4 = require(l_CorePackages_0.Workspace.Packages.RoactUtils);
local l_useSelector_0 = v4.Hooks.RoactRodux.useSelector;
local l_dependencyArray_0 = v4.Hooks.dependencyArray;
local v7 = require(script.Parent.Parent.Flags.GetFFlagFixKeepOutAreasCompatibility);
local function v22(v8, v9, v10)
    local v11 = {};
    local l_X_0 = v8.X;
    local l_Y_0 = v8.Y;
    local l_X_1 = v9.X;
    local v15 = v9.Y - l_Y_0;
    local l_l_X_0_0 = l_X_0;
    local v17 = 0;
    for _, v19 in ipairs(v10) do
        local v20 = l_l_X_0_0 + v17;
        table.insert(v11, {
            Position = {
                X = v20,
                Y = l_Y_0
            },
            Size = {
                X = v19.position.X - v20,
                Y = v15
            }
        });
        l_l_X_0_0 = v19.position.X;
        v17 = v19.size.X;
    end;
    local v21 = l_l_X_0_0 + v17;
    table.insert(v11, {
        Position = {
            X = v21,
            Y = l_Y_0
        },
        Size = {
            X = l_X_1 - v21,
            Y = v15
        }
    });
    return v11;
end;
local function v37(v23, v24)
    local v25 = {};
    local v26 = {};
    for _, v28 in pairs(v24) do
        table.insert(v26, {
            id = v28.id,
            size = v28.size,
            position = v28.position
        });
    end;
    table.sort(v26, function(v29, v30)
        local v31 = false;
        if v29.position.X < v30.position.X then
            v31 = v29.position.X + v29.size.X < v30.size.X + v30.position.X;
        end;
        return v31;
    end);
    local l_l_GuiService_0_GuiInset_0, _ = l_GuiService_0:GetGuiInset();
    v25 = v22(Vector2.new(0, 0), Vector2.new(v23.X, l_l_GuiService_0_GuiInset_0.Y), v26);
    local v34 = nil;
    for _, v36 in ipairs(v25) do
        if not v34 or v34.Width < v36.Size.X then
            v34 = Rect.new(v36.Position.X, v36.Position.Y, v36.Position.X + v36.Size.X, v36.Position.Y + v36.Size.Y);
        end;
    end;
    return v34;
end;
local function _(v38, v39)
    local v40 = v37(v38, v39);
    if v40 then
        l_GuiService_0:SetTopbarInset(v40);
    end;
end;
KeepOutAreasHandler = function(_)
    local v44 = l_useSelector_0(function(v43)
        return v43.displayOptions.screenSize;
    end);
    local v46 = l_useSelector_0(function(v45)
        return v45.displayOptions.keepOutAreas;
    end);
    v3.useEffect(function()
        if not (not v7() and (not game:GetEngineFeature("InGameChromeSignalAPI") or not l_RunService_0:IsStudio())) then
            local v47 = v37(v44, v46);
            if v47 then
                l_GuiService_0:SetTopbarInset(v47);
            end;
        end;
    end, l_dependencyArray_0(v44, v46));
end;
return KeepOutAreasHandler;


local l_AppStorageService_0 = game:GetService("AppStorageService");
local l_HttpService_0 = game:GetService("HttpService");
local l_Players_0 = game:GetService("Players");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_game_EngineFeature_0 = game:GetEngineFeature("InGameMenuStateStorageKey");
local v5 = require(script.Parent.Parent.Flags.GetFFlagEnableUnibarMaxDefaultOpen);
local l_GetFFlagChromeSurveySupport_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagChromeSurveySupport;
local v7 = require(script.Parent.Parent.Flags.GetFFlagEnableChromeFTUX);
local v8 = nil;
local v9 = false;
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while not l_LocalPlayer_0 do
    l_Players_0:GetPropertyChangedSignal("LocalPlayer"):Wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local v11 = "player_" .. tostring(not l_LocalPlayer_0 and 0 or l_LocalPlayer_0.UserId);
local function v12()
    if v8.LocalPlayer == nil then
        v8.LocalPlayer = {};
    end;
    if v8.LocalPlayer[v11] == nil then
        v8.LocalPlayer[v11] = {};
    end;
    if v8.AnyPlayer == nil then
        v8.AnyPlayer = {};
    end;
end;
local function v14(v13)
    if (not v13 or not v13.LocalPlayer) or not v13.LocalPlayer[v11] then
        return v13;
    else
        return v13.LocalPlayer[v11];
    end;
end;
local function v16(v15)
    if not v15 or not v15.AnyPlayer then
        return v15;
    else
        return v15.AnyPlayer;
    end;
end;
local function v21()
    if l_game_EngineFeature_0 then
        local l_status_0, l_result_0 = pcall(function()
            return l_AppStorageService_0:GetItem("InGameMenuState");
        end);
        if l_status_0 then
            v9 = true;
            if #l_result_0 > 0 then
                local l_status_1, l_result_1 = pcall(function()
                    return l_HttpService_0:JSONDecode(l_result_0);
                end);
                if not l_status_1 then
                    v8 = {};
                else
                    v8 = l_result_1;
                end;
            else
                v8 = {};
            end;
            v12();
        end;
        return ;
    else
        return ;
    end;
end;
local function v26()
    if l_game_EngineFeature_0 then
        if v9 then
            local l_status_2, l_result_2 = pcall(function()
                return l_HttpService_0:JSONEncode(v8);
            end);
            if not l_status_2 then
                error("Failed to encode JSON", 0);
            else
                local l_status_3, l_result_3 = pcall(function()
                    l_AppStorageService_0:SetItem("InGameMenuState", l_result_2);
                    l_AppStorageService_0:Flush();
                end);
                if not l_status_3 then
                    print(l_result_3);
                    error("Failed to write JSON to AppStorageService", 0);
                    return ;
                end;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
local function v27(v28)
    if type(v28) ~= "table" then
        return v28;
    else
        local v29 = {};
        for v30, v31 in pairs(v28) do
            v29[v30] = v27(v31);
        end;
        return v29;
    end;
end;
local function _(v32, v33, v34)
    if not v9 then
        v21();
    end;
    if v9 then
        local v35 = not not v34 and v34(v8) or v8;
        local v36 = v35[v32];
        v35[v32] = v27(v33);
        if v36 ~= v35[v32] then
            v26();
        end;
    end;
end;
local function _(v38, v39)
    if not v9 then
        v21();
    end;
    if v9 then
        local v40 = not not v39 and v39(v8) or v8;
        if v40 then
            return (v27(v40[v38]));
        end;
    end;
    return nil;
end;
local function _()
    if not ((not l_GetFFlagChromeSurveySupport_0() or not v5()) or not l_game_EngineFeature_0) then
        local l_v14_0 = v14;
        if not v9 then
            v21();
        end;
        local v43;
        if v9 then
            local v44 = not not l_v14_0 and l_v14_0(v8) or v8;
            if v44 then
                v43 = v27(v44.ChromeSeenCount);
                goto label0 --[[  true, true  ]];
            end;
        end;
        v43 = nil;
        ::label0::;
        if not (not v43 or not tonumber(v43)) then
            return v43;
        end;
    end;
    return 0;
end;
return {
    isEnabled = function()
        return l_game_EngineFeature_0;
    end,
    storeForLocalPlayer = function(v46, v47)
        local l_v14_1 = v14;
        if not v9 then
            v21();
        end;
        if v9 then
            local v49 = not not l_v14_1 and l_v14_1(v8) or v8;
            local v50 = v49[v46];
            v49[v46] = v27(v47);
            if v50 ~= v49[v46] then
                v26();
            end;
        end;
    end,
    loadForLocalPlayer = function(v51)
        local l_v14_2 = v14;
        if not v9 then
            v21();
        end;
        if v9 then
            local v53 = not not l_v14_2 and l_v14_2(v8) or v8;
            if v53 then
                return (v27(v53[v51]));
            end;
        end;
        return nil;
    end,
    storeForAnyPlayer = function(v54, v55)
        local l_v16_0 = v16;
        if not v9 then
            v21();
        end;
        if v9 then
            local v57 = not not l_v16_0 and l_v16_0(v8) or v8;
            local v58 = v57[v54];
            v57[v54] = v27(v55);
            if v58 ~= v57[v54] then
                v26();
            end;
        end;
    end,
    loadForAnyPlayer = function(v59)
        local l_v16_1 = v16;
        if not v9 then
            v21();
        end;
        if v9 then
            local v61 = not not l_v16_1 and l_v16_1(v8) or v8;
            if v61 then
                return (v27(v61[v59]));
            end;
        end;
        return nil;
    end,
    clearCache = function()
        v9 = false;
        v8 = nil;
    end,
    getChromeSeenCount = function()
        if not ((not l_GetFFlagChromeSurveySupport_0() or not v5()) or not l_game_EngineFeature_0) then
            local l_v14_3 = v14;
            if not v9 then
                v21();
            end;
            local v63;
            if v9 then
                local v64 = not not l_v14_3 and l_v14_3(v8) or v8;
                if v64 then
                    v63 = v27(v64.ChromeSeenCount);
                    goto label1 --[[  true, true  ]];
                end;
            end;
            v63 = nil;
            ::label1::;
            if not (not v63 or not tonumber(v63)) then
                return v63;
            end;
        end;
        return 0;
    end,
    getValue = function(v65)
        if not v7() then
            return nil;
        else
            local l_v14_4 = v14;
            if not v9 then
                v21();
            end;
            if v9 then
                local v67 = not not l_v14_4 and l_v14_4(v8) or v8;
                if v67 then
                    return (v27(v67[v65]));
                end;
            end;
            return nil;
        end;
    end,
    deleteValue = function(v68)
        if v7() then
            local l_v14_5 = v14;
            if not v9 then
                v21();
            end;
            if v9 then
                local v70 = not not l_v14_5 and l_v14_5(v8) or v8;
                local v71 = v70[v68];
                v70[v68] = v27(nil);
                if v71 ~= v70[v68] then
                    v26();
                end;
            end;
        end;
    end
};


local _ = require(script.Parent.ChromeUtils);
local _ = require(script.Parent.WindowSizeSignal);
return nil;


local l_Workspace_0 = game:GetService("Workspace");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_ObservableValue_0 = require(script.Parent.ChromeUtils).ObservableValue;
local v3 = l_ObservableValue_0.new(Vector2.new(0, 0));
local v4 = l_ObservableValue_0.new(false);
local v5 = nil;
createViewportInfo = function(v6)
    local v7 = v6.X < v6.Y;
    local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
    local v9 = true;
    if l_l_UserInputService_0_Platform_0 ~= Enum.Platform.IOS then
        v9 = l_l_UserInputService_0_Platform_0 == Enum.Platform.Android;
    end;
    return {
        size = v6,
        portraitOrientation = v7,
        tinyPortrait = (v9 and v7) and v6.X < 360,
        isMobileDevice = v9
    };
end;
local v10 = l_ObservableValue_0.new(createViewportInfo(Vector2.zero));
updateViewportSize = function(v11)
    local v12 = Vector2.new(v11.X, v11.Y);
    v3:set(v12);
    v10:set(createViewportInfo(v12));
end;
setCurrentCamera = function(v13)
    if v5 then
        pcall(function()
            v5:Disconnect();
        end);
        v5 = nil;
    end;
    if v13 then
        local l_l_UserInputService_0_Platform_1 = l_UserInputService_0:GetPlatform();
        local l_v4_0 = v4;
        local v16 = true;
        if l_l_UserInputService_0_Platform_1 ~= Enum.Platform.IOS then
            v16 = l_l_UserInputService_0_Platform_1 == Enum.Platform.Android;
        end;
        l_v4_0:set(v16);
        v5 = v13:GetPropertyChangedSignal("ViewportSize"):Connect(function()
            updateViewportSize(v13.ViewportSize);
        end);
        updateViewportSize(v13.ViewportSize);
    end;
end;
l_Workspace_0:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
    setCurrentCamera(l_Workspace_0.CurrentCamera);
end);
setCurrentCamera(l_Workspace_0.CurrentCamera);
return {
    screenSize = v3,
    mobileDevice = v4,
    viewport = v10,
    isSmallTouchScreen = function()
        local v17 = v3:get();
        local l_TouchEnabled_0 = l_UserInputService_0.TouchEnabled;
        if l_TouchEnabled_0 then
            l_TouchEnabled_0 = true;
            if v17.Y >= 500 then
                l_TouchEnabled_0 = v17.X < 700;
            end;
        end;
        return l_TouchEnabled_0;
    end
};


local l_Signal_0 = require(game:GetService("CorePackages").Workspace.Packages.AppCommonLib).Signal;
local v1 = require(script.Parent.ViewportUtil);
local v2 = require(script.Parent.Parent.Unibar.Constants);
local function v10(v3, v4)
    local v5 = v1.mobileDevice:get();
    local v6 = v1.screenSize:get();
    local v7 = v6.X < v6.Y;
    local l_v3_0 = v3;
    local l_v4_0 = v4;
    if v5 then
        if not v7 then
            if not v7 then
                l_v4_0 = math.min(v4, v2.MAX_HEIGHT_LANDSCAPE);
                l_v3_0 = math.min(v3, v2.MAX_WIDTH_LANDSCAPE);
            end;
        else
            l_v4_0 = math.min(v4, v2.MAX_HEIGHT_PORTRAIT);
            l_v3_0 = math.min(v3, v2.MAX_WIDTH_PORTRAIT);
        end;
    end;
    return UDim2.new(0, l_v3_0, 0, l_v4_0);
end;
local v11 = {};
v11.__index = v11;
v11.new = function(v12, v13, v14)
    return (setmetatable({
        _state = v10(v12 or v2.DEFAULT_WIDTH, v13 or v2.DEFAULT_HEIGHT),
        _isLarge = v14 or false,
        _changeSignal = l_Signal_0.new()
    }, v11));
end;
v11.connect = function(v15, v16)
    return v15._changeSignal:connect(v16);
end;
v11.requestSize = function(v17, v18, v19)
    local v20 = v10(v18, v19);
    if v17._state ~= v20 then
        v17._state = v20;
        v17._changeSignal:fire(v20);
    end;
end;
v11.toggleIsLarge = function(v21)
    local v22 = not v21._isLarge;
    v21._isLarge = v22;
    v21._changeSignal:fire(v22);
end;
v11.get = function(v23)
    return v23._state;
end;
v11.getIsLarge = function(v24)
    return v24._isLarge;
end;
v11.updateConstraints = function(v25)
    v25:requestSize(v25._state.Width.Offset, v25._state.Height.Offset);
end;
return v11;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_UserInputService_0 = game:GetService("UserInputService");
local v3 = require(l_CorePackages_0.Packages.React);
local v4 = require(l_CorePackages_0.UIBlox);
local l_Badge_0 = v4.App.Indicator.Badge;
local l_Interactable_0 = v4.Core.Control.Interactable;
local l_ControlState_0 = v4.Core.Control.Enum.ControlState;
local l_useStyle_0 = v4.Core.Style.useStyle;
local l_withTooltip_0 = v4.App.Dialog.TooltipV2.withTooltip;
local l_useSelectionCursor_0 = v4.App.SelectionImage.useSelectionCursor;
local l_CursorKind_0 = v4.App.SelectionImage.CursorKind;
local l_Parent_0 = script.Parent.Parent.Parent;
local v13 = require(l_Parent_0.Unibar.Constants);
local v14 = require(l_Parent_0.Service);
local v15 = require(l_Parent_0.Analytics.ChromeAnalytics);
local _ = require(l_Parent_0.Service.Types);
local v17 = require(l_Parent_0.Flags.GetFFlagEnableChromeAnalytics)();
local v18 = require(l_Parent_0.Flags.GetFFlagEnableUnibarSneakPeak);
local v19 = require(l_Parent_0.Hooks.useObservableValue);
local v20 = require(l_Parent_0.Hooks.useNotificationCount);
local v21 = require(l_Parent_0.Hooks.useMappedObservableValue);
local v22 = require(l_Parent_0.Hooks.useMappedObservableValueBinding);
local v23 = require(l_Parent_0.Hooks.useTimeHysteresis);
local v24 = require(l_Parent_0.Utility.shouldRejectMultiTouch);
local v25 = {};
areTooltipsDisplaying = function()
    local v26 = tick();
    for _, v28 in v25, nil, nil do
        if v28.displaying or v26 - v28.time < 0.15 then
            return true;
        end;
    end;
    return false;
end;
logTooltipState = function(v29, v30)
    if not v25[v29] or v25[v29].displaying ~= v30 then
        v25[v29] = {
            displaying = v30,
            time = tick()
        };
    end;
end;
NotificationBadge = function(v31)
    if v31.integration then
        local v32 = v20(v31.integration.integration);
        if v21(v14:currentSubMenu(), function(v33)
            return v33 == v31.integration.id;
        end) then
            v32 = 0;
        end;
        local v34 = false;
        if not (not v31.integration or not v31.integration.integration) then
            v34 = v31.integration.integration.hideNotificationCountWhileOpen or false;
        end;
        local l_createElement_0 = v3.createElement;
        local v36 = "Frame";
        local v38 = {
            BackgroundTransparency = 1,
            Size = UDim2.fromScale(1, 1),
            Visible = (not not not v31.toggleTransition or v31.toggleTransition:map(function(v37)
                if not v34 then
                    return true;
                else
                    return v37 < 0.5;
                end;
            end)) or true,
            ZIndex = 2
        };
        local v39 = {};
        local v40 = false;
        if v32 > 0 then
            v40 = v3.createElement(l_Badge_0, {
                position = UDim2.fromOffset(20, 0),
                anchorPoint = Vector2.new(0, 0),
                hasShadow = false,
                value = v32
            });
        end;
        v39.Badge = v40;
        return l_createElement_0(v36, v38, v39);
    else
        return nil;
    end;
end;
NotificationIndicator = function(v41)
    local v42 = v19(v14:notificationIndicator());
    v41.setIconVisible(not v42 and true or false);
    return (v3.createElement("Frame", {
        Name = "NotificationIndicatorFrame",
        Size = UDim2.new(1, 0, 1, 0),
        BorderSizePixel = 0,
        BackgroundTransparency = 1
    }, {
        IntegrationIcon = not not v42 and v42.component(v41) or nil,
        UIListLayout = v3.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Horizontal,
            VerticalAlignment = Enum.VerticalAlignment.Center,
            HorizontalAlignment = Enum.HorizontalAlignment.Center
        })
    }));
end;
HighlightCircle = function(v43)
    return v3.createElement("Frame", {
        Name = v43.name or "Highlighter",
        Size = UDim2.new(0, 36, 0, 36),
        AnchorPoint = Vector2.new(0.5, 0.5),
        Position = UDim2.new(0.5, 0, 0.5, 0),
        BackgroundColor3 = v43.color.Color,
        BackgroundTransparency = v43.color.Transparency,
        BorderSizePixel = 0,
        Visible = v43.visible
    }, {
        corner = v3.createElement("UICorner", {
            CornerRadius = UDim.new(1, 0)
        })
    });
end;
TooltipButton = function(v44)
    local v45 = v3.useRef(nil);
    local l_secondaryAction_0 = v44.integration.integration.secondaryAction;
    local v47 = v44.integration.integration.draggable or false;
    local v48 = v3.useRef(nil);
    v3.useEffect(function()
        return function()
            if v48.current then
                v48.current:Disconnect();
                v48.current = nil;
            end;
        end;
    end, {});
    local v49 = nil;
    local v50 = nil;
    if not l_secondaryAction_0 then
        local v51, v52 = v23(0.6, 0.65, 0.7);
        v49 = v51;
        v50 = v52;
    else
        local v53, v54 = v23(0.05, 0.15, 0.35);
        v49 = v53;
        v50 = v54;
    end;
    local v55, v56 = v23(0, 0, 0.65);
    local v57, v58 = v3.useState(false);
    local v59, v60 = v23(0, 1);
    local v65 = v3.useCallback(function(v61, v62)
        if v62 == l_ControlState_0.Selected and v61 == l_ControlState_0.Default then
            v14:setSelected(v44.integration.id);
        end;
        local v63 = v62 ~= l_ControlState_0.Default;
        v44.setHovered(v63);
        local v64 = v62 == l_ControlState_0.Hover;
        v50(v64, not not v64 and v55 or areTooltipsDisplaying());
        if not v63 then
            v60(false);
        end;
    end, {
        v44.setHovered,
        v50,
        v60,
        v55
    });
    local v71 = v3.useCallback(function(_, v67)
        if v47 then
            if not (v67.UserInputType ~= Enum.UserInputType.MouseButton1) or v67.UserInputType == Enum.UserInputType.Touch then
                local l_Position_0 = v67.Position;
                v60(true, true);
                if v17 then
                    v15.default:onIconTouchBegan(v44.integration.id);
                end;
                if not v48.current then
                    v48.current = l_UserInputService_0.InputChanged:Connect(function(v69, _)
                        if not v24(v67, v69) then
                            if v13.DRAG_MAGNITUDE_THRESHOLD < math.abs((l_Position_0 - v69.Position).Magnitude) then
                                if v17 then
                                    v15.default:onIconDrag(v44.integration.id);
                                end;
                                if v18() then
                                    v14:storeChromeInteracted();
                                end;
                                v14:toggleWindow(v44.integration.id);
                                v14:gesture(v44.integration.id, v48, v67);
                            end;
                            return ;
                        else
                            return ;
                        end;
                    end);
                end;
            end;
            return ;
        else
            return ;
        end;
    end, {
        v47
    });
    local v74 = v3.useCallback(function(_, v73)
        if v47 then
            if not (v73.UserInputType ~= Enum.UserInputType.MouseButton1) or v73.UserInputType == Enum.UserInputType.Touch then
                v60(false);
                if v48.current then
                    v48.current:Disconnect();
                    v48.current = nil;
                    v14:gesture(v44.integration.id, nil);
                end;
            end;
            return ;
        else
            return ;
        end;
    end, {
        v47
    });
    local v75 = ((v49 or v55) or v57) and not v59;
    logTooltipState(v44.integration.id, v75);
    local v79 = v3.useCallback(function(v76)
        return v3.createElement(l_Interactable_0, {
            Name = "IconHitArea_" .. v44.integration.id,
            Size = UDim2.new(1, 0, 1, 0),
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            onStateChanged = v65,
            ref = v45,
            SelectionOrder = 100 - v44.integration.order,
            Position = v44.isCurrentlyOpenSubMenu:map(function(v77)
                return UDim2.new(0, 0, 0, not v77 and 0 or 1);
            end),
            SelectionImageObject = l_useSelectionCursor_0(l_CursorKind_0.SelectedKnob),
            SelectionGroup = true,
            SelectionBehaviorUp = Enum.SelectionBehavior.Stop,
            SelectionBehaviorDown = v44.isCurrentlyOpenSubMenu:map(function(v78)
                if not (v75 and l_secondaryAction_0) and not v78 then
                    return Enum.SelectionBehavior.Stop;
                else
                    return Enum.SelectionBehavior.Escape;
                end;
            end),
            [v3.Change.AbsolutePosition] = v76,
            [v3.Change.AbsoluteSize] = v76,
            [v3.Event.InputBegan] = v71,
            [v3.Event.InputEnded] = v74,
            [v3.Event.Activated] = function()
                v60(true, true);
                v44.integration.activated();
                if v48.current then
                    v48.current:Disconnect();
                    v48.current = nil;
                    v14:gesture(v44.integration.id, nil);
                end;
            end
        });
    end, {
        v65,
        v50,
        v60,
        v71,
        v74,
        v44.isCurrentlyOpenSubMenu,
        v75,
        l_secondaryAction_0
    });
    local v80 = v3.useRef(nil);
    return l_withTooltip_0({
        headerText = v44.integration.integration.label,
        hotkeyCodes = v44.integration.integration.hotkeyCodes,
        textAlignment = Enum.TextXAlignment.Left,
        buttonProps = if not l_secondaryAction_0 then nil else {
            text = l_secondaryAction_0.label,
            onStateChanged = function(_, v82)
                if v82 == l_ControlState_0.Selected then
                    v58(true);
                    return ;
                else
                    v58(false);
                    return ;
                end;
            end,
            onActivated = function()
                l_secondaryAction_0.activated(v44.integration);
            end,
            NextSelectionUp = v45,
            NextSelectionLeft = v45,
            NextSelectionRight = v45,
            NextSelectionDown = v45
        },
        ref = if not l_secondaryAction_0 then nil else v3.useCallback(function(v83)
            local v84 = nil;
            local v85 = nil;
            local v86 = nil;
            local function v87()
                if v84 then
                    v84:disconnect();
                    v84 = nil;
                end;
                if v85 then
                    v85:disconnect();
                    v85 = nil;
                end;
                if v86 then
                    v86:disconnect();
                    v86 = nil;
                end;
            end;
            if v83 ~= v80.current then
                pcall(v87);
                if v83 then
                    v84 = v83.MouseEnter:Connect(function()
                        v56(true, true);
                    end);
                    v85 = v83.MouseLeave:Connect(function()
                        v56(false);
                    end);
                    v86 = v83.Destroying:Connect(function()
                        v56(false);
                    end);
                end;
                v80.current = v83;
            end;
        end, {
            v56
        })
    }, {
        active = v75,
        guiTarget = l_CoreGui_0,
        DisplayOrder = 10
    }, v79);
end;
IconHost = function(v88)
    if not (v88.integration and v88.integration.component) then
        warn("IconHost has no component to render");
    end;
    local v89, v90 = v3.useBinding(false);
    local v91, v92 = v3.useBinding(true);
    local l_BackgroundOnHover_0 = l_useStyle_0().Theme.BackgroundOnHover;
    local v95 = v22(v14:currentSubMenu(), function(v94)
        return v94 == v88.integration.id;
    end);
    return v3.createElement("Frame", {
        Size = UDim2.new(0, v13.ICON_CELL_WIDTH, 0, v13.ICON_CELL_WIDTH),
        LayoutOrder = v88.integration.order,
        BorderSizePixel = 0,
        BackgroundTransparency = 1,
        Position = v88.position,
        Visible = v88.visible,
        ZIndex = v88.integration.order
    }, {
        v3.createElement("Frame", {
            Name = "IntegrationIconFrame",
            Size = UDim2.new(1, 0, 1, 0),
            BorderSizePixel = 0,
            BackgroundTransparency = 1,
            Visible = v91
        }, {
            IntegrationIcon = (not not v88.integration and v88.integration.component) and v88.integration.component(v88) or nil,
            UIListLayout = v3.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Horizontal,
                VerticalAlignment = Enum.VerticalAlignment.Center,
                HorizontalAlignment = Enum.HorizontalAlignment.Center
            })
        }),
        if not v88.integration.integration.flashNotificationSource then nil else v3.createElement(NotificationIndicator, {
            integration = v88.integration,
            setIconVisible = v92
        }),
        v3.createElement(HighlightCircle, {
            name = "SelectedHighlighter",
            color = l_BackgroundOnHover_0,
            visible = v95
        }),
        v3.createElement(HighlightCircle, {
            name = "Highlighter",
            color = l_BackgroundOnHover_0,
            visible = v89
        }),
        v3.createElement(NotificationBadge, v88),
        if not v88.disableButtonBehaviors then v3.createElement(TooltipButton, {
            integration = v88.integration,
            setHovered = v90,
            isCurrentlyOpenSubMenu = v95
        }) else nil
    });
end;
return IconHost;


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Packages.React);
local v2 = require(l_CorePackages_0.Packages.ReactRoblox);
local l_CoreGui_0 = game:GetService("CoreGui");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_TweenService_0 = game:GetService("TweenService");
local v6 = require(l_CorePackages_0.Packages.ReactOtter);
local l_Interactable_0 = require(l_CorePackages_0.UIBlox).Core.Control.Interactable;
local l_Parent_0 = script.Parent.Parent.Parent;
local v9 = require(l_Parent_0.Utility.debounce);
local v10 = require(l_Parent_0.Service);
local v11 = require(l_Parent_0.Unibar.Constants);
local _ = require(l_Parent_0.Service.Types);
local v13 = require(l_Parent_0.Analytics.ChromeAnalytics);
local v14 = require(l_Parent_0.Flags.GetFFlagEnableChromeAnalytics)();
local v15 = require(l_Parent_0.Flags.GetFFlagSelfViewFixes)();
local v16 = require(l_Parent_0.Utility.shouldRejectMultiTouch);
local l_useSelector_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local l_GetFFlagSelfViewAssertFix_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagSelfViewAssertFix;
local v19 = require(script.Parent.Parent.Parent.Hooks.useWindowSize);
local v20 = {
    dampingRatio = 1,
    frequency = 3
};
local v21 = {
    INTEGRATION = 1,
    CLOSE_BUTTON = 2,
    INPUT_SHIELD = 3,
    INPUT_WRAPPER = 4
};
return function(v22)
    local v23 = v19(v22.integration.integration);
    local v24 = v1.useRef(nil);
    local v25 = v1.useRef(nil);
    local v26, v27 = v1.useBinding(false);
    local v28 = v1.useMemo(function()
        return nil;
    end, {});
    local v30 = if not v15 then nil else l_useSelector_0(function(v29)
        return v29.displayOptions.menuOpen or v29.displayOptions.inspectMenuOpen;
    end);
    local v31, v32 = v1.useBinding(false);
    local v33, v34 = v6.useAnimatedBinding(v23.X.Offset);
    local v35, v36 = v6.useAnimatedBinding(v23.Y.Offset);
    v1.useEffect(function()
        v34(v6.spring(v23.X.Offset, v20));
    end, {
        v23.X.Offset
    });
    v1.useEffect(function()
        v36(v6.spring(v23.Y.Offset, v20));
    end, {
        v23.Y.Offset
    });
    v1.useEffect(function()
        local v37 = nil;
        local v38 = nil;
        local v39 = v10:dragConnection(v22.integration.id);
        v37 = v39.connection;
        v38 = v39.inputObject;
        assert(v24.current ~= nil);
        assert(v24.current.Parent ~= nil);
        local l_current_0 = v24.current;
        local l_AbsoluteSize_0 = v24.current:FindFirstAncestorWhichIsA("ScreenGui").AbsoluteSize;
        if v37 ~= nil then
            v25 = v37;
            v27(true);
            if v25 then
                v34((v6.instant(42)));
                v36((v6.instant(42)));
                task.defer(v34, v6.spring(v23.X.Offset, v20));
                task.defer(v36, v6.spring(v23.Y.Offset, v20));
                local v42 = Vector3.new(v24.current.AbsolutePosition.X, v24.current.AbsolutePosition.Y, 0);
                if v14 then
                    v13.default:setWindowDefaultPosition(v22.integration.id, Vector2.new(v42.X, v42.Y));
                end;
                v25.current = l_UserInputService_0.InputChanged:Connect(function(v43, _)
                    local l_Position_0 = v43.Position;
                    if not v16(v38, v43) then
                        local v46 = l_Position_0 - v42;
                        local v47 = {
                            X = math.clamp((v46 + v42).X, 0, l_AbsoluteSize_0.X),
                            Y = math.clamp((v46 + v42).Y, 0, l_AbsoluteSize_0.Y)
                        };
                        l_current_0.Position = UDim2.fromOffset(v47.X, v47.Y);
                        return ;
                    else
                        return ;
                    end;
                end);
            end;
        else
            local v48 = v22.position or UDim2.new();
            if not v22.integration.integration.cachePosition then
                l_current_0.Position = UDim2.new(0, if v48.X.Scale == 1 then l_AbsoluteSize_0.X else 0 + v48.X.Offset, 0, v48.Y.Offset);
            else
                local v49 = v10:windowPosition(v22.integration.id) or UDim2.new();
                l_current_0.Position = UDim2.new(0, if v49.X.Scale == 1 then l_AbsoluteSize_0.X else 0 + v49.X.Offset, 0, v49.Y.Offset);
            end;
        end;
    end, {});
    local v51 = v1.useCallback(function(v50)
        if v22.integration.integration.cachePosition then
            v10:updateWindowPosition(v22.integration.id, v50);
        end;
    end, {
        v22.integration
    });
    local v66 = v1.useCallback(function(_, v53)
        assert(v24.current ~= nil);
        assert(v24.current.Parent ~= nil);
        local l_current_1 = v24.current;
        local l_AbsoluteSize_1 = v24.current:FindFirstAncestorWhichIsA("ScreenGui").AbsoluteSize;
        local v56 = v33:getValue() / 2;
        local v57 = v35:getValue() / 2;
        local l_Position_1 = v53.Position;
        local v59 = Vector3.new(v24.current.AbsolutePosition.X + v56, v24.current.AbsolutePosition.Y + v57, 0);
        if not (v53.UserInputType ~= Enum.UserInputType.MouseButton1) or v53.UserInputType == Enum.UserInputType.Touch then
            if v14 then
                v13.default:onWindowTouchBegan(v22.integration.id, Vector2.new(v24.current.AbsolutePosition.X, v24.current.AbsolutePosition.Y));
            end;
            if not (v25.current or v31:getValue()) then
                local v60 = {
                    X = math.clamp(v59.X, 0, l_AbsoluteSize_1.X - v56),
                    Y = math.clamp(v59.Y, 0, l_AbsoluteSize_1.Y - v57)
                };
                l_current_1.Position = UDim2.fromOffset(v60.X, v60.Y);
                v25.current = l_UserInputService_0.InputChanged:Connect(function(v61, _)
                    if not v16(v53, v61) then
                        v27(true);
                        local l_Position_2 = v61.Position;
                        local v64 = l_Position_2 - l_Position_1;
                        local v65 = {
                            X = math.clamp((v64 + v59).X, v56, l_AbsoluteSize_1.X - v56),
                            Y = math.clamp((v64 + v59).Y, v57, l_AbsoluteSize_1.Y - v57)
                        };
                        l_current_1.Position = UDim2.fromOffset(v65.X, v65.Y);
                        if v14 then
                            v13.default:onWindowDrag(v22.integration.id, l_Position_2);
                        end;
                        return ;
                    else
                        return ;
                    end;
                end);
            end;
        end;
    end, {});
    local function v75(v67)
        local l_Parent_1 = v67.Parent;
        local l_Offset_0 = v67.Position.X.Offset;
        local l_Offset_1 = v67.Position.Y.Offset;
        local v71 = v33:getValue() / 2;
        local v72 = v35:getValue() / 2;
        local l_AbsoluteSize_2 = l_Parent_1.AbsoluteSize;
        local v74 = true;
        if l_Offset_0 >= v71 then
            v74 = true;
            if l_AbsoluteSize_2.X - v71 >= l_Offset_0 then
                v74 = true;
                if l_Offset_1 >= v72 then
                    v74 = l_AbsoluteSize_2.Y - v72 < l_Offset_1;
                end;
            end;
        end;
        return v74;
    end;
    local v85 = v1.useCallback(function()
        if l_GetFFlagSelfViewAssertFix_0() and (not (v24 ~= nil) or v24.current == nil) then
            return ;
        else
            assert(v24.current ~= nil);
            assert(v24.current.Parent ~= nil);
            local l_current_2 = v24.current;
            local l_Offset_2 = l_current_2.Position.X.Offset;
            local l_Offset_3 = l_current_2.Position.Y.Offset;
            if v28 and v28.PlaybackState == Enum.PlaybackState.Playing then
                v28:Cancel();
            end;
            if not v75(l_current_2) then
                v51(UDim2.new(0, l_Offset_2, 0, l_Offset_3));
                return ;
            elseif l_current_2 == nil then
                return ;
            else
                local l_Parent_2 = v24.current.Parent;
                local v80 = v33:getValue() / 2;
                local v81 = v35:getValue() / 2;
                local l_AbsoluteSize_3 = l_Parent_2.AbsoluteSize;
                v32(true);
                local v83 = UDim2.new(0, math.clamp(l_Offset_2, v80, l_AbsoluteSize_3.X - v80), 0, (math.clamp(l_Offset_3, v81, l_AbsoluteSize_3.Y - v81)));
                v51(v83);
                v28 = l_TweenService_0:Create(l_current_2, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
                    Position = v83
                });
                assert(v28 ~= nil);
                v28.Completed:Connect(function(_)
                    v32(false);
                    v28 = nil;
                end);
                v28:Play();
                return ;
            end;
        end;
    end, {});
    return v2.createPortal({
        Name = v1.createElement("ScreenGui", {
            Name = v11.WINDOW_HOST_GUI_NAME .. ":" .. v22.integration.id,
            [v1.Change.AbsoluteSize] = v9(function()
                v85();
            end, 0.2),
            DisplayOrder = if v15 then v30 and -1 or 100 else 100,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling
        }, {
            WindowFrame = v1.createElement("Frame", {
                Size = v1.joinBindings({
                    v33,
                    v35
                }):map(function(v86)
                    return UDim2.fromOffset(v86[1], v86[2]);
                end),
                LayoutOrder = 1,
                ref = v24,
                BorderSizePixel = 0,
                AnchorPoint = Vector2.new(0.5, 0.5),
                BackgroundTransparency = 1
            }, {
                WindowWrapper = v1.createElement("Frame", {
                    Size = UDim2.new(1, 0, 1, 0),
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0
                }, {
                    Integration = v22.integration.component(v22) or nil,
                    InputShield = v1.createElement(l_Interactable_0, {
                        ZIndex = v21.INPUT_SHIELD,
                        Size = UDim2.fromScale(1, 1),
                        BackgroundTransparency = 1,
                        Visible = v26
                    }),
                    InputWrapper = v1.createElement("Frame", {
                        ZIndex = v21.INPUT_WRAPPER,
                        Size = UDim2.fromScale(1, 1),
                        BackgroundTransparency = 1,
                        [v1.Event.InputBegan] = v66,
                        [v1.Event.InputEnded] = v1.useCallback(function(_, v88)
                            if not (v88.UserInputType ~= Enum.UserInputType.MouseButton1) or v88.UserInputType == Enum.UserInputType.Touch then
                                if not (not v24.current or not v14) then
                                    v13.default:onWindowTouchEnded(v22.integration.id, Vector2.new(v24.current.AbsolutePosition.X, v24.current.AbsolutePosition.Y), (v75(v24.current)));
                                end;
                                if v25.current then
                                    v25.current:Disconnect();
                                    v25.current = nil;
                                    v27(false);
                                    v10:gesture(v22.integration.id, nil);
                                    v85();
                                end;
                            end;
                        end, {})
                    })
                })
            })
        })
    }, l_CoreGui_0);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local _ = require(l_CorePackages_0.Packages.ReactOtter);
local l_IconSize_0 = require(l_CorePackages_0.UIBlox).App.ImageSet.Enum.IconSize;
local v3 = {
    MouseAndKeyboard = "MouseAndKeyboard",
    Touch = "Touch",
    Gamepad = "Gamepad"
};
local v4 = {
    Landscape = "Landscape",
    Portrait = "Portrait",
    Sensor = "Sensor"
};
return {
    ICON_CELL_WIDTH = 44,
    DIVIDER_CELL_WIDTH = 5,
    ICON_SIZE = 36,
    SUB_MENU_ROW_HEIGHT = 56,
    PIN_ICON_SIZE = UDim2.new(0, 18, 0, 18),
    PIN_BUTTON_SIZE = 40,
    PIN_RIGHT_PADDING = 13,
    NEW_BADGE_SIZE = 66,
    MENU_ANIMATION_SPRING = {
        dampingRatio = 1.1,
        frequency = 6.666666666666667,
        restingPositionLimit = 0.1,
        restingVelocityLimit = 0.05
    },
    UNIBAR_KEEP_OUT_AREA_ID = "unibar",
    WINDOW_HOST_GUI_NAME = "WindowHost",
    CLOSE_BUTTON_FRAME = UDim2.fromOffset(44, 44),
    CLOSE_BUTTON_SIZE = UDim2.fromOffset(22, 22),
    CLOSE_ICON_SIZE = l_IconSize_0.Small,
    CORNER_RADIUS = UDim.new(0, 8),
    WINDOW_ACTIVE_SECONDS = 2,
    DRAG_MAGNITUDE_THRESHOLD = 10,
    DEFAULT_HEIGHT_LARGE = 324,
    DEFAULT_WIDTH_LARGE = 150,
    DEFAULT_HEIGHT = 185,
    DEFAULT_WIDTH = 86,
    MAX_HEIGHT_PORTRAIT = 324,
    MAX_WIDTH_PORTRAIT = 150,
    MAX_HEIGHT_LANDSCAPE = 240,
    MAX_WIDTH_LANDSCAPE = 112,
    HEALTH = {
        RED = Color3.fromRGB(255, 28, 0),
        YELLOW = Color3.fromRGB(250, 235, 0),
        GREEN = Color3.fromRGB(27, 252, 107),
        RED_THRESHOLD = 0.1,
        YELLOW_THRESHOLD = 0.5,
        GREEN_THRESHOLD = 0.8
    },
    ANALYTICS = {
        SCREEN_ORIENTATION_MAP = {
            [Enum.ScreenOrientation.LandscapeLeft] = v4.Landscape,
            [Enum.ScreenOrientation.LandscapeRight] = v4.Landscape,
            [Enum.ScreenOrientation.LandscapeSensor] = v4.Landscape,
            [Enum.ScreenOrientation.Portrait] = v4.Portrait,
            [Enum.ScreenOrientation.Sensor] = v4.Sensor
        },
        INPUT_TYPE_MAP = {
            [Enum.UserInputType.MouseButton1] = v3.MouseAndKeyboard,
            [Enum.UserInputType.MouseButton2] = v3.MouseAndKeyboard,
            [Enum.UserInputType.MouseButton3] = v3.MouseAndKeyboard,
            [Enum.UserInputType.MouseWheel] = v3.MouseAndKeyboard,
            [Enum.UserInputType.MouseMovement] = v3.MouseAndKeyboard,
            [Enum.UserInputType.Keyboard] = v3.MouseAndKeyboard,
            [Enum.UserInputType.Gamepad1] = v3.Gamepad,
            [Enum.UserInputType.Gamepad2] = v3.Gamepad,
            [Enum.UserInputType.Gamepad3] = v3.Gamepad,
            [Enum.UserInputType.Gamepad4] = v3.Gamepad,
            [Enum.UserInputType.Gamepad5] = v3.Gamepad,
            [Enum.UserInputType.Gamepad6] = v3.Gamepad,
            [Enum.UserInputType.Gamepad7] = v3.Gamepad,
            [Enum.UserInputType.Gamepad8] = v3.Gamepad,
            [Enum.UserInputType.Touch] = v3.Touch
        },
        UNIBAR_OPENED = "chrome_unibar_opened",
        UNIBAR_CLOSED = "chrome_unibar_closed",
        ICON_ACTIVATED = "chrome_unibar_icon_activated",
        ICON_DRAG_START = "chrome_unibar_icon_drag_started",
        ICON_DRAG_END = "chrome_unibar_icon_drag_ended",
        WINDOW_DRAG_START = "chrome_unibar_window_drag_started",
        WINDOW_DRAG_END = "chrome_unibar_window_drag_ended",
        WINDOW_RESIZE = "chrome_unibar_window_resized",
        WINDOW_OPENED = "chrome_unibar_window_opened",
        WINDOW_CLOSED = "chrome_unibar_window_closed",
        PIN_ADDED = "chrome_unibar_pin_added",
        PIN_REMOVED = "chrome_unibar_pin_removed"
    }
};


local v0 = require(game:GetService("CorePackages").Packages.React);
local v1 = require(script.Parent.Constants);
local l_Parent_0 = script.Parent.Parent;
local v3 = require(l_Parent_0.Hooks.useHealthBinding);
local v4 = require(l_Parent_0.Hooks.useCoreGuiEnabled);
local v5 = require(l_Parent_0.Hooks.useChromeMenuStatus);
local v6 = require(l_Parent_0.Service);
local function _(v7)
    return (Vector3.new(v7.R, v7.G, v7.B));
end;
local v9 = {};
local l_RED_0 = v1.HEALTH.RED;
v9[Vector3.new(l_RED_0.R, l_RED_0.G, l_RED_0.B)] = v1.HEALTH.RED_THRESHOLD;
l_RED_0 = v1.HEALTH.YELLOW;
v9[Vector3.new(l_RED_0.R, l_RED_0.G, l_RED_0.B)] = v1.HEALTH.YELLOW_THRESHOLD;
l_RED_0 = v1.HEALTH.GREEN;
v9[Vector3.new(l_RED_0.R, l_RED_0.G, l_RED_0.B)] = v1.HEALTH.GREEN_THRESHOLD;
local function v19(v11)
    if v11 <= v1.HEALTH.RED_THRESHOLD then
        return v1.HEALTH.RED;
    elseif v1.HEALTH.GREEN_THRESHOLD <= v11 then
        return v1.HEALTH.GREEN;
    else
        local v12 = Vector3.new(0, 0, 0);
        local v13 = 0;
        for v14, v15 in pairs(v9) do
            local v16 = v11 - v15;
            if v16 == 0 then
                return Color3.new(v14.X, v14.Y, v14.Z);
            else
                local v17 = 1 / (v16 * v16);
                v12 = v12 + v17 * v14;
                v13 = v13 + v17;
            end;
        end;
        local v18 = v12 / v13;
        return Color3.new(v18.X, v18.Y, v18.Z);
    end;
end;
HealthBar = function(v20)
    local v21 = v3();
    return v0.createElement("Frame", {
        Name = "HealthBar",
        AnchorPoint = Vector2.new(0, 1),
        Position = UDim2.new(0, 0, 1, -1),
        Size = v21:map(function(v22)
            return UDim2.new(v22, (v1.ICON_CELL_WIDTH / 4) * ((0.5 - v22) * 2), 0, 2);
        end),
        BorderSizePixel = 0,
        BackgroundTransparency = 1,
        ClipsDescendants = true,
        Visible = v21:map(function(v23)
            return v23 < 1;
        end)
    }, {
        v0.createElement("Frame", {
            AnchorPoint = Vector2.new(0, 1),
            Position = UDim2.new(0, 0, 1, 0),
            Size = v20.size,
            BackgroundColor3 = v21:map(v19)
        }, {
            v0.createElement("UICorner", {
                CornerRadius = UDim.new(1, 0)
            })
        })
    });
end;
HealthBarToggled = function(v24)
    local v25 = v5() == v6.MenuStatus.Open;
    if not v4(Enum.CoreGuiType.Health) or not v25 then
        return nil;
    else
        return v0.createElement(HealthBar, v24);
    end;
end;
return HealthBarToggled;


local v0 = require(game:GetService("CorePackages").Packages.React);
local v1 = require(script.Parent.Parent.Hooks.useChromeWindowItems);
local v2 = require(script.Parent.ComponentHosts.WindowHost);
return function(_)
    local v4 = v1();
    local v5 = {};
    for _, v7 in v4, nil, nil do
        v5["window_" .. v7.integration.id] = v0.createElement(v2, {
            position = v7.integration.startingWindowPosition,
            integration = v7
        });
    end;
    return v5;
end;


return function(v0, v1)
    local v2 = 0;
    return function(...)
        local v3 = {
            ...
        };
        local v4 = time();
        v2 = v4;
        delay(v1, function()
            if v2 == v4 then
                v0(unpack(v3));
            end;
        end);
    end;
end;


return function(v0, v1)
    if not (v0 ~= nil) or v1 == nil then
        return false;
    else
        local v2 = false;
        if v0.UserInputType == Enum.UserInputType.Touch then
            v2 = v1 ~= v0;
        end;
        return v2;
    end;
end;


return {
    Service = require(script.Service),
    Integrations = require(script.Integrations)
};


local l_Players_0 = game:GetService("Players");
local v1 = game:DefineFastFlag("FixAvatarUtilCharacter", false);
local v2 = {};
v2.__index = v2;
v2.new = function(v3)
    local v4 = setmetatable({}, v2);
    v4.player = v3;
    v4.characterChangedEvent = Instance.new("BindableEvent");
    v4.eventQueued = false;
    v4.connections = {};
    v4.connections.characterAddedConnection = v3.CharacterAdded:Connect(function(v5)
        v4:onCharacterChanged(v5);
    end);
    v4.connections.characterAppearanceChangedConnection = v3.CharacterAppearanceLoaded:Connect(function(v6)
        v4:onCharacterChanged(v6);
    end);
    if not (not v1 or not v4.player.Character) then
        v4:onCharacterChanged(v4.player.Character);
    end;
    return v4;
end;
v2.removeConnection = function(v7, v8)
    if v7.connections[v8] then
        v7.connections[v8]:Disconnect();
        v7.connections[v8] = nil;
    end;
end;
v2.onCharacterChanged = function(v9, v10)
    v9:removeConnection("descendantAddedConnection");
    v9.connections.descendantAddedConnection = v10.DescendantAdded:Connect(function(v11)
        v9:onDescendantAdded(v11);
    end);
    v9:removeConnection("descendantRemovedConnection");
    v9.connections.descendantRemovedConnection = v10.DescendantRemoving:Connect(function(v12)
        v9:onDescendantRemoving(v12);
    end);
    for _, v14 in pairs(v10:GetDescendants()) do
        v9:onDescendantAdded(v14);
    end;
    v9:fireCharacterChanged();
end;
v2.onDescendantAdded = function(v15, v16)
    if v16:IsA("NumberValue") then
        local v17 = v16.Name .. "Connection";
        v15:removeConnection(v17);
        v15.connections[v17] = v16.Changed:Connect(function()
            v15:fireCharacterChanged();
        end);
    end;
    v15:fireCharacterChanged();
end;
v2.onDescendantRemoving = function(v18, v19)
    if v19:IsA("NumberValue") then
        v18:removeConnection(v19.Name .. "Connection");
    end;
    v18:fireCharacterChanged();
end;
v2.fireCharacterChanged = function(v20)
    if not v20.eventQueued then
        v20.eventQueued = true;
        task.delay(0.1, function()
            v20.eventQueued = false;
            local l_Character_0 = v20.player.Character;
            if l_Character_0 then
                v20.characterChangedEvent:Fire(l_Character_0);
            end;
        end);
        return ;
    else
        return ;
    end;
end;
local v22 = {};
v22.__index = v22;
v22.new = function()
    local v23 = setmetatable({}, v22);
    v23.playerConnections = {};
    return v23;
end;
v22.connectLocalCharacterChanges = function(v24, v25)
    local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    while not l_LocalPlayer_0 do
        l_Players_0.Changed:Wait();
        l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    end;
    v24:connectPlayerCharacterChanges(l_LocalPlayer_0, v25);
end;
v22.connectPlayerCharacterChanges = function(v27, v28, v29)
    if not v27.playerConnections[v28] then
        v27.playerConnections[v28] = v2.new(v28);
    end;
    v27.playerConnections[v28].characterChangedEvent.Event:Connect(v29);
    v27.playerConnections[v28]:fireCharacterChanged();
end;
return v22;


return {
    TableConcat = function(v0, v1)
        for v2 = 1, #v1 do
            v0[#v0 + 1] = v1[v2];
        end;
        return v0;
    end,
    SortByName = function(v3)
        table.sort(v3, function(v4, v5)
            return v4.Name < v5.Name;
        end);
        return v3;
    end,
    Create = function(v6)
        return function(v7)
            local v8 = Instance.new(v6);
            local v9 = nil;
            for v10, v11 in pairs(v7) do
                if type(v10) == "number" then
                    v11.Parent = v8;
                elseif v10 == "Parent" then
                    v9 = v11;
                else
                    v8[v10] = v11;
                end;
            end;
            if v9 then
                v8.Parent = v9;
            end;
            return v8;
        end;
    end
};


local v0 = game:DefineFastFlag("FixConnectionUtilKeys", false);
local v1 = {};
v1.__index = v1;
v1.new = function()
    local v2 = setmetatable({}, v1);
    if not v0 then
        v2.connections_old = {};
        return v2;
    else
        v2.connections = {};
        return v2;
    end;
end;
v1.connect = function(v3, v4, v5, v6)
    if not v0 then
        if v3.connections_old[v5] then
            v3.connections_old[v5]:Disconnect();
        end;
        v3.connections_old[v5] = v5:Connect(v6);
        return ;
    else
        if v3.connections[v4] then
            v3.connections[v4]();
        end;
        local v7 = v5:Connect(v6);
        v3.connections[v4] = function()
            v7:Disconnect();
        end;
        return ;
    end;
end;
v1.connectManual = function(v8, v9, v10)
    assert(v0);
    if v8.connections[v9] then
        v8.connections[v9]();
    end;
    v8.connections[v9] = v10;
end;
v1.disconnect = function(v11, v12)
    assert(v0);
    if v11.connections[v12] then
        v11.connections[v12]();
        v11.connections[v12] = nil;
    end;
end;
v1.disconnectAll = function(v13)
    if not v0 then
        for _, v15 in pairs(v13.connections_old) do
            if v15 then
                v15:Disconnect();
            end;
        end;
        v13.connections_old = {};
        return ;
    else
        for _, v17 in pairs(v13.connections) do
            v17();
        end;
        v13.connections = {};
        return ;
    end;
end;
return v1;


local _ = require(script.Parent.Flags.GetFFlagEnableInGameMenuDurationLogger)();
return {
    COLORS = {
        SLATE = Color3.fromRGB(35, 37, 39),
        FLINT = Color3.fromRGB(57, 59, 61),
        GRAPHITE = Color3.fromRGB(101, 102, 104),
        PUMICE = Color3.fromRGB(189, 190, 190),
        WHITE = Color3.fromRGB(255, 255, 255)
    },
    ERROR_PROMPT_HEIGHT = {
        Default = 236,
        XBox = 180
    },
    ERROR_PROMPT_MIN_HEIGHT = {
        Default = 250
    },
    ERROR_PROMPT_MIN_WIDTH = {
        Default = 320,
        XBox = 400
    },
    ERROR_PROMPT_MAX_WIDTH = {
        Default = 400,
        XBox = 400
    },
    ERROR_TITLE_FRAME_HEIGHT = {
        Default = 50
    },
    SPLIT_LINE_THICKNESS = 1,
    BUTTON_CELL_PADDING = 10,
    BUTTON_HEIGHT = 36,
    SIDE_PADDING = 20,
    LAYOUT_PADDING = 20,
    SIDE_MARGIN = 20,
    VERTICAL_MARGIN = 50,
    PRIMARY_BUTTON_TEXTURE = "rbxasset://textures/ui/ErrorPrompt/PrimaryButton.png",
    SECONDARY_BUTTON_TEXTURE = "rbxasset://textures/ui/ErrorPrompt/SecondaryButton.png",
    SHIMMER_TEXTURE = "rbxasset://textures/ui/LuaApp/graphic/shimmer_darkTheme.png",
    OVERLAY_TEXTURE = "rbxasset://textures/ui/ErrorPrompt/ShimmerOverlay.png",
    VIP_SERVER = "VIPServer",
    RESERVED_SERVER = "ReservedServer",
    STANDARD_SERVER = "StandardServer",
    AnalyticsInGameMenuName = "ingame_menu",
    AnalyticsPerfMenuOpening = "perf_menu_opening",
    AnalyticsPerfMenuStarted = "perf_menu_started",
    AnalyticsPerfMenuEnding = "perf_menu_ending",
    AnalyticsPerfMenuClosed = "perf_menu_closed",
    AnalyticsGameMenuFlowStart = "gamemenu_flow_start",
    AnalyticsGameMenuOpenStart = "gamemenu_open_start",
    AnalyticsGameMenuOpenEnd = "gamemenu_open_end",
    AnalyticsGameMenuCloseStart = "gamemenu_close_start",
    AnalyticsGameMenuCloseEnd = "gamemenu_close_end",
    AnalyticsGameMenuFlowEnd = "gamemenu_flow_end"
};


local l_CorePackages_0 = game:GetService("CorePackages");
local l_LocalizationService_0 = game:GetService("LocalizationService");
local l_GuiService_0 = game:GetService("GuiService");
local v3 = game:DefineFastFlag("SwitchCSRootProviderTranslationsPackage", false);
local v4 = nil;
v4 = if not v3 then require(l_CorePackages_0.Workspace.Packages.RobloxAppLocales).Localization else require(l_CorePackages_0.Workspace.Packages.InExperienceLocales).Localization;
local l_LocalizationProvider_0 = require(l_CorePackages_0.Workspace.Packages.Localization).LocalizationProvider;
local l_DesignTokenProvider_0 = require(l_CorePackages_0.Workspace.Packages.Style).DesignTokenProvider;
local v7 = require(l_CorePackages_0.Packages.Cryo);
local v8 = require(l_CorePackages_0.Packages.React);
local v9 = require(l_CorePackages_0.Packages.Rodux);
local v10 = require(l_CorePackages_0.RoactRodux);
local v11 = require(l_CorePackages_0.UIBlox);
local l_SelectionCursorProvider_0 = v11.App.SelectionImage.SelectionCursorProvider;
local v13 = require(l_CorePackages_0.Workspace.Packages.RobloxAppEnums);
local v14 = require(l_CorePackages_0.Packages.ReactFocusNavigation);
local l_Provider_0 = require(l_CorePackages_0.Workspace.Packages.FocusNavigationUtils).FocusNavigableSurfaceRegistry.Provider;
local l_DeviceType_0 = v13.DeviceType;
local l_GamepadDisconnectTokenMapper_0 = require(l_CorePackages_0.Workspace.Packages.InputUi).Gamepad.GamepadDisconnectTokenMapper;
local l_GetFFlagEnableUISoundAndHaptics_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagEnableUISoundAndHaptics;
local v19 = require(l_CorePackages_0.Workspace.Packages.InteractionFeedback);
local l_InteractionFeedbackContext_0 = v19.InteractionFeedbackContext;
local l_FeedbackManagerInjectionContextProvider_0 = v19.FeedbackManagerInjectionContextProvider;
local l_InteractionFeedbackAppConfig_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppInteractionFeedbackConfig).InteractionFeedbackAppConfig;
local v23 = game:DefineFastFlag("CoreScriptsDynamicDefaultDeviceType", false);
local v24 = v14.FocusNavigationService.new(v14.EngineInterface.CoreGui);
local v25 = nil;
v25 = if not v23 then {
    themeName = "dark",
    fontName = "gotham",
    deviceType = l_DeviceType_0.Desktop
} else {
    themeName = "dark",
    fontName = "gotham",
    deviceType = if not l_GuiService_0:IsTenFootInterface() then l_DeviceType_0.Desktop else l_DeviceType_0.Console
};
return function(v26)
    local v28 = v8.createElement(v10.StoreProvider, {
        store = v9.Store.new(function(v27)
            return v27;
        end, {}, {})
    }, {
        AppStyleProvider = v8.createElement(v11.App.Style.AppStyleProvider, {
            style = v7.Dictionary.join(v25, v26.styleOverride or {})
        }, {
            DesignTokenProvider = v8.createElement(l_DesignTokenProvider_0, {
                tokenMappers = {
                    GamepadDisconnect = l_GamepadDisconnectTokenMapper_0
                }
            }, {
                CursorProvider = v8.createElement(l_SelectionCursorProvider_0, {}, {
                    LocalizationProvider = v8.createElement(l_LocalizationProvider_0, {
                        localization = v4.new(l_LocalizationService_0.RobloxLocaleId)
                    }, {
                        FocusNavigationProvider = v8.createElement(v14.FocusNavigationContext.Provider, {
                            value = v24
                        }, {
                            FocusNavigationRegistryProvider = v8.createElement(l_Provider_0, nil, v26.children)
                        })
                    })
                })
            })
        })
    });
    if l_GetFFlagEnableUISoundAndHaptics_0() then
        v28 = v8.createElement(l_InteractionFeedbackContext_0.Provider, {
            value = l_InteractionFeedbackAppConfig_0
        }, {
            tree = v8.createElement(l_FeedbackManagerInjectionContextProvider_0, nil, {
                tree = v28
            })
        });
    end;
    return v28;
end;


return function(v0, v1)
    return function(v2)
        local v3 = Instance.new(v0);
        local v4 = nil;
        for v5, v6 in next, v2, nil do
            if type(v5) == "string" then
                if v5 == "Parent" then
                    v4 = v6;
                else
                    v3[v5] = v6;
                end;
            else
                local v7 = typeof(v6);
                if v7 == "function" then
                    v6(v3);
                elseif v7 == "Instance" then
                    v6.Parent = v3;
                end;
            end;
        end;
        if not v4 then
            if v1 then
                v3.Parent = v1;
            end;
            return v3;
        else
            v3.Parent = v4;
            return v3;
        end;
    end;
end;


local v0 = require(game:GetService("CorePackages").Roact);
local v1 = v0.Component:extend("EventConnection");
v1.init = function(v2)
    v2.connection = nil;
end;
v1.render = function(v3)
    return v0.oneChild(v3.props[v0.Children]);
end;
v1.didMount = function(v4)
    v4.connection = v4.props.event:Connect(v4.props.callback);
end;
v1.didUpdate = function(v5, v6)
    if not (v5.props.event == v6.event) or v5.props.callback ~= v6.callback then
        v5.connection:Disconnect();
        v5.connection = v5.props.event:Connect(v5.props.callback);
    end;
end;
v1.willUnmount = function(v7)
    if v7.connection then
        v7.connection:Disconnect();
        v7.connection = nil;
    end;
end;
return v1;