local l_COLLAB2850_FixMcTooltips_0 = game:GetFastFlag("COLLAB2850_FixMcTooltips");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local v4 = require(l_Parent_0.Packages.Framework);
local l_Stylizer_0 = v4.Style.Stylizer;
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v8 = require(l_Parent_0.Src.Util.PermissionsConstants);
local v9 = require(l_Parent_0.Src.Components.CollaboratorItem);
local v10 = require(l_Parent_0.Src.Components.RolesetCollaboratorItem);
local l_Separator_0 = require(l_Parent_0.Packages.Framework).UI.Separator;
local v12 = require(l_Parent_0.Src.Components.Thumbnails.GroupIconThumbnail);
local v13 = require(l_Parent_0.Src.Selectors.IsGroupOwner);
local v14 = require(l_Parent_0.Src.Selectors.GetGroupRolesets);
local v15 = require(l_Parent_0.Src.Selectors.GetGroupPermission);
local v16 = require(l_Parent_0.Src.Selectors.GetGroupName);
local v17 = require(l_Parent_0.Src.Thunks.RemoveGroupCollaborator);
local v18 = require(l_Parent_0.Src.Thunks.SetGroupPermission);
local l_ExpandablePane_0 = v4.UI.ExpandablePane;
local l_Button_0 = v4.UI.Button;
local l_NoAccessKey_0 = v8.NoAccessKey;
local v22 = v2.PureComponent:extend("GroupCollaboratorItem");
v22.init = function(v23)
    v23.state = {
        expanded = false
    };
end;
v22.getCurrentPermission = function(v24)
    local l_props_0 = v24.props;
    local l_IsOwner_0 = l_props_0.IsOwner;
    local l_CurrentPermission_0 = l_props_0.CurrentPermission;
    if not l_IsOwner_0 then
        return l_CurrentPermission_0;
    else
        return v8.MultipleKey;
    end;
end;
v22.getAvailablePermissions = function(v28)
    local l_props_1 = v28.props;
    local l_IsOwner_1 = l_props_1.IsOwner;
    local l_Localization_0 = l_props_1.Localization;
    if not l_IsOwner_1 then
        return {
            {
                Key = v8.NoAccessKey,
                Display = l_Localization_0:getText("PermissionLabels", "NoAccess"),
                Description = l_Localization_0:getText("PermissionDescriptions", "NoAccess")
            },
            {
                Key = v8.PlayKey,
                Display = l_Localization_0:getText("PermissionLabels", "Play"),
                Description = l_Localization_0:getText("PermissionDescriptions", "Play")
            }
        };
    else
        return {};
    end;
end;
v22.render = function(v32)
    local l_props_2 = v32.props;
    local l_Localization_1 = l_props_2.Localization;
    local l_LayoutOrder_0 = l_props_2.LayoutOrder;
    local l_Writable_0 = l_props_2.Writable;
    local l_Id_0 = l_props_2.Id;
    local l_Stylizer_1 = l_props_2.Stylizer;
    local l_IsOwner_2 = l_props_2.IsOwner;
    local l_GroupRolesets_0 = l_props_2.GroupRolesets;
    local l_GroupName_0 = l_props_2.GroupName;
    local v42 = if not l_COLLAB2850_FixMcTooltips_0 then nil else l_props_2.IsGroupGame;
    local l_SetGroupPermission_0 = l_props_2.SetGroupPermission;
    local l_RemoveGroupCollaborator_0 = l_props_2.RemoveGroupCollaborator;
    local l_GroupRolePermissions_0 = l_props_2.GroupRolePermissions;
    local l_HideSeparator_0 = l_props_2.HideSeparator;
    local v47 = #l_GroupRolesets_0 == 0;
    local v48 = {};
    local v49 = {};
    for v50, v51 in ipairs(l_GroupRolesets_0) do
        local v52 = v2.createElement(v10, {
            LayoutOrder = v50,
            Id = v51,
            Writable = l_Writable_0,
            CurrentPermission = l_NoAccessKey_0,
            IsGroupOwner = l_IsOwner_2,
            RolePermissions = if not l_IsOwner_2 then nil else l_GroupRolePermissions_0[v51],
            IsGroupGame = v42
        });
        if v50 <= 3 then
            table.insert(v48, v52);
        else
            table.insert(v49, v52);
        end;
    end;
    if #v49 == 0 then
        v48[#v48].props.HideSeparator = true;
    end;
    return v2.createElement("Frame", {
        LayoutOrder = l_LayoutOrder_0,
        AutomaticSize = Enum.AutomaticSize.Y,
        BackgroundTransparency = 1,
        Position = UDim2.new(0, l_Stylizer_1.collaboratorItem.groupCollaboratorItem.collaboratorItemOffset, 0, 0),
        Size = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.size
    }, {
        UILayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            Padding = UDim.new(0, 0),
            SortOrder = Enum.SortOrder.LayoutOrder,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            HorizontalAlignment = Enum.HorizontalAlignment.Right
        }),
        GroupCollaborator = v2.createElement(v9, {
            Name = l_GroupName_0,
            Icon = v2.createElement(v12, {
                Id = l_Id_0,
                Size = UDim2.fromScale(1, 1)
            }),
            Writable = l_Writable_0 and not l_IsOwner_2,
            Loading = v47,
            Removable = if not l_COLLAB2850_FixMcTooltips_0 then not l_IsOwner_2 else l_Writable_0 and not l_IsOwner_2,
            OnRemoved = function()
                l_RemoveGroupCollaborator_0(l_Id_0);
            end,
            CurrentPermission = v32:getCurrentPermission(),
            AvailablePermissions = v32:getAvailablePermissions(),
            OnPermissionChanged = function(v53)
                l_SetGroupPermission_0(l_Id_0, v53);
            end
        }),
        Role1 = v48[1],
        Role2 = v48[2],
        Role3 = v48[3],
        AdditionalRoles = if #v49 > 0 then v2.createElement(l_ExpandablePane_0, {
            Expanded = v32.state.expanded,
            OnExpandedChanged = function()
            end,
            HeaderComponent = function()
                local _ = nil;
                return v2.createElement(l_Button_0, {
                    Size = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.headerComponent.size,
                    Text = "",
                    LayoutOrder = 1000000,
                    Style = "RoundSubtle",
                    OnClick = function()
                        if not v47 then
                            v32:setState({
                                expanded = not v32.state.expanded
                            });
                            return ;
                        else
                            return ;
                        end;
                    end
                }, {
                    Arrow = v2.createElement("ImageLabel", {
                        Image = if not v32.state.expanded then l_Stylizer_1.arrows.right else l_Stylizer_1.arrows.down,
                        Position = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.headerComponent.arrowLabel.position,
                        AnchorPoint = Vector2.new(0, 0.5),
                        BackgroundTransparency = 1,
                        Size = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.headerComponent.arrowLabel.size
                    }),
                    Text = v2.createElement("TextLabel", {
                        Text = if #v49 == 1 then if v32.state.expanded then l_Localization_1:getText("Buttons", "HideRole") else l_Localization_1:getText("Buttons", "SeeOneMoreRole") else if v32.state.expanded then l_Localization_1:getText("Buttons", "HideRoles", {
                            count = string.format("%u", #v49)
                        }) else l_Localization_1:getText("Buttons", "SeeMoreRoles", {
                            count = string.format("%u", #v49)
                        }),
                        Position = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.headerComponent.textLabel.position,
                        AnchorPoint = Vector2.new(0, 0.5),
                        TextSize = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.ExpandTextSize,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextColor3 = l_Stylizer_1.fontStyle.Normal.TextColor3,
                        Font = l_Stylizer_1.fontStyle.Normal.Font,
                        BackgroundTransparency = 1
                    })
                });
            end,
            LayoutOrder = 4,
            ContentPadding = 0,
            ContentSpacing = 0,
            PutHeaderLast = v32.state.expanded,
            Size = l_Stylizer_1.collaboratorItem.groupCollaboratorItem.expandablePaneSize,
            HorizontalAlignment = Enum.HorizontalAlignment.Right,
            Style = "Arrowless"
        }, v49) else nil,
        Separator = not l_HideSeparator_0 and v2.createElement(l_Separator_0, {
            LayoutOrder = 5
        })
    });
end;
return (v3.connect(function(v55, v56)
    return {
        IsOwner = v13(v55, v56.Id),
        GroupRolesets = v14(v55, v56.Id),
        GroupName = v16(v55, v56.Id),
        CurrentPermission = v15(v55, v56.Id),
        GroupRolePermissions = v55.GroupRolePermissions.PermissionsByRole
    };
end, function(v57)
    return {
        SetGroupPermission = function(...)
            v57(v18(...));
        end,
        RemoveGroupCollaborator = function(...)
            v57(v17(...));
        end
    };
end)((l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_ContextServices_0.Localization
})(v22))));


local l_COLLAB2850_FixMcTooltips_0 = game:GetFastFlag("COLLAB2850_FixMcTooltips");
local l_StudioPublishService_0 = game:GetService("StudioPublishService");
local l_StudioService_0 = game:GetService("StudioService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v4 = require(l_Parent_0.Packages.Roact);
local v5 = require(l_Parent_0.Packages.RoactRodux);
local v6 = require(l_Parent_0.Packages.Cryo);
local v7 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v7.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Stylizer_0 = v7.Style.Stylizer;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_UI_0 = v7.UI;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_Container_0 = l_UI_0.Container;
local l_LoadingIndicator_0 = l_UI_0.LoadingIndicator;
local l_StyledDialog_0 = v7.UI.StyledDialog;
local v17 = require(l_Parent_0.Src.Util.ShowDialog);
local v18 = require(l_Parent_0.Src.Components.CollaboratorsWidget);
local v19 = require(l_Parent_0.Src.Components.CollaboratorSearchWidget);
local v20 = require(l_Parent_0.Src.Components.Footer);
local v21 = require(l_Parent_0.Src.Thunks.SavePermissions);
local v22 = require(l_Parent_0.Src.Thunks.PermissionsLoader);
local v23 = require(l_Parent_0.Src.Util.LoadState);
local v24 = require(l_Parent_0.Src.Util.SaveState);
local v25 = require(l_Parent_0.Src.Selectors.GetHasCollaborators);
local v26 = require(l_Parent_0.Src.Selectors.GetHasCurrentEditCollaborators);
local v27 = require(l_Parent_0.Src.Util.IsTeamCreateEnabled);
local l_LayoutOrderIterator_0 = v7.Util.LayoutOrderIterator;
local v29 = require(l_Parent_0.Src.Util.Analytics);
local v30 = v4.PureComponent:extend("PermissionsView");
v30.isGroupGame = function(v31)
    return v31.props.OwnerType == Enum.CreatorType.Group;
end;
v30.isLoggedInUserGameOwner = function(v32)
    local l_l_StudioService_0_UserId_0 = l_StudioService_0:GetUserId();
    local l_props_0 = v32.props;
    local l_OwnerId_0 = l_props_0.OwnerId;
    local l_GroupOwnerUserId_0 = l_props_0.GroupOwnerUserId;
    if not v32:isGroupGame() then
        return l_l_StudioService_0_UserId_0 == l_OwnerId_0;
    else
        return l_l_StudioService_0_UserId_0 == l_GroupOwnerUserId_0;
    end;
end;
v30.init = function(v37)
    v37.scrollingFrameRef = v4.createRef();
    v37.contentHeightChanged = function(v38)
        local l_current_0 = v37.scrollingFrameRef.current;
        if l_current_0 then
            l_current_0.CanvasSize = UDim2.new(1, 0, 0, v38.AbsoluteContentSize.Y + v37.props.Stylizer.scrollingFrame.yPadding);
        end;
    end;
end;
v30.onSavePressed = function(v40)
    v40.props.SavePermissions(v40:isGroupGame());
    if not v27() then
        l_StudioPublishService_0:PublishThenTurnOnTeamCreate();
    end;
end;
v30.onCancelPressed = function(v41, v42)
    local l_props_1 = v41.props;
    local l_Plugin_0 = l_props_1.Plugin;
    local l_Localization_1 = l_props_1.Localization;
    local l_Stylizer_1 = l_props_1.Stylizer;
    local l_CloseWidget_0 = l_props_1.CloseWidget;
    v29.reportCancelPressed(v41:isGroupGame());
    if v42 then
        v17(l_Plugin_0, l_Localization_1, l_StyledDialog_0, {
            Buttons = {
                {
                    Key = "NO",
                    Text = l_Localization_1:getText("Buttons", "No")
                },
                {
                    Key = "YES",
                    Text = l_Localization_1:getText("Buttons", "Yes"),
                    Style = "RoundPrimary"
                }
            },
            MinContentSize = l_Stylizer_1.cancelDialog.Size,
            Style = "CancelDialog",
            OnButtonPressed = function(v48)
                if v48 == "YES" then
                    l_CloseWidget_0();
                end;
            end,
            OnClose = function()
            end,
            Title = l_Localization_1:getText("Title", "DiscardChanges"),
            Modal = true
        }, {
            Contents = v4.createElement("TextLabel", {
                BackgroundTransparency = 1,
                TextSize = l_Stylizer_1.cancelDialog.Text.TextSize,
                Text = l_Localization_1:getText("Description", "DiscardChanges"),
                TextColor3 = l_Stylizer_1.cancelDialog.Text.TextColor3,
                Font = l_Stylizer_1.cancelDialog.Text.Font,
                Size = UDim2.fromScale(1, 1),
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = l_Stylizer_1.cancelDialog.Position
            })
        });
        return ;
    else
        l_CloseWidget_0();
        return ;
    end;
end;
v30.render = function(v49)
    local l_props_2 = v49.props;
    if l_props_2.Enabled then
        local l_Stylizer_2 = l_props_2.Stylizer;
        local l_Localization_2 = l_props_2.Localization;
        local l_SaveState_0 = l_props_2.SaveState;
        local l_LoadState_0 = l_props_2.LoadState;
        local l_HasCollaborators_0 = l_props_2.HasCollaborators;
        local l_HasCurrentEditCollaborators_0 = l_props_2.HasCurrentEditCollaborators;
        if l_SaveState_0 == v24.Saved then
            l_props_2.CloseWidget();
            return ;
        else
            local v57 = l_LoadState_0 == v23.Loaded;
            local v58 = false;
            local v59 = nil;
            if l_LoadState_0 == v23.Unloaded then
                l_props_2.LoadPermissions();
            end;
            if not (l_LoadState_0 ~= v23.LoadFailed) or l_SaveState_0 == v24.SaveFailed then
                v58 = true;
                v59 = if l_LoadState_0 == v23.LoadFailed then l_Localization_2:getText("FailureMessage", "LoadFailure") else l_Localization_2:getText("FailureMessage", "SaveFailure");
            end;
            local v60 = v49:isLoggedInUserGameOwner();
            local v61 = v57 and not v58;
            local v62 = v27();
            local v63 = (v61 and not v62) and (l_HasCollaborators_0 or l_HasCurrentEditCollaborators_0);
            local v64 = l_Localization_2:getText("Description", not l_HasCurrentEditCollaborators_0 and "SaveEnableTC" or "SaveEnableTcCurrentEditors");
            local l_height_0 = l_Stylizer_2.footer.height;
            if v63 then
                l_height_0 = l_height_0 + l_Stylizer_2.saveMessage.boxHeight;
            end;
            local v66 = l_LayoutOrderIterator_0.new();
            local v67 = l_LayoutOrderIterator_0.new();
            return v4.createElement("Frame", {
                Size = UDim2.new(1, 0, 1, 0),
                BackgroundColor3 = l_Stylizer_2.backgroundColor
            }, {
                Layout = v61 and v4.createElement("UIListLayout", {
                    FillDirection = Enum.FillDirection.Vertical,
                    SortOrder = Enum.SortOrder.LayoutOrder,
                    Padding = UDim.new(0, l_Stylizer_2.permissionsView.Padding)
                }),
                ScrollingFrame = v61 and v4.createElement(l_ScrollingFrame_0, {
                    LayoutOrder = v66:getNextOrder(),
                    Size = UDim2.new(1, 0, 1, -l_height_0),
                    Layout = Enum.FillDirection.Vertical,
                    AutomaticCanvasSize = Enum.AutomaticSize.Y,
                    Spacing = UDim.new(0, if not v60 then l_Stylizer_2.scrollingFrame.yPaddingNonOwner else l_Stylizer_2.scrollingFrame.yPadding)
                }, {
                    SearchBarWidget = v60 and v4.createElement(v19, {
                        LayoutOrder = v67:getNextOrder(),
                        Writable = true,
                        IsGroupGame = v49:isGroupGame()
                    }),
                    Frame = not v60 and v4.createElement("Frame", {
                        BackgroundTransparency = 1
                    }),
                    CollaboratorsWidget = v4.createElement(v18, {
                        LayoutOrder = v67:getNextOrder(),
                        Writable = v60,
                        IsGroupGame = if not l_COLLAB2850_FixMcTooltips_0 then nil else v49:isGroupGame()
                    })
                }),
                TextFrame = if not v63 then nil else v4.createElement("Frame", {
                    BackgroundTransparency = 1,
                    BackgroundColor3 = l_Stylizer_2.backgroundColor,
                    LayoutOrder = v66:getNextOrder(),
                    Size = UDim2.new(1, 0, 0, l_Stylizer_2.saveMessage.boxHeight),
                    BorderSizePixel = 0
                }, {
                    Text = v4.createElement("TextLabel", v6.Dictionary.join(l_Stylizer_2.saveMessage.textStyle, {
                        AnchorPoint = Vector2.new(0, 0.5),
                        Position = l_Stylizer_2.saveMessage.InnerTextPosition,
                        Text = v64,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        BorderSizePixel = 0,
                        TextWrapped = true,
                        Size = UDim2.new(0.55, 0, 1, 0),
                        BackgroundTransparency = 1
                    }))
                }),
                FooterContent = v61 and v4.createElement(l_Container_0, {
                    LayoutOrder = v66:getNextOrder(),
                    Size = UDim2.new(1, 0, 0, l_Stylizer_2.footer.height)
                }, {
                    Footer = v4.createElement(v20, {
                        IsTeamCreateEnabled = v62,
                        OnSavePressed = function()
                            v49:onSavePressed();
                        end,
                        OnCancelPressed = function(v68)
                            v49:onCancelPressed(v68);
                        end
                    })
                }),
                LoadingIndicator = (not v57 and not v58) and v4.createElement(l_LoadingIndicator_0, {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.fromScale(0.5, 0.5)
                }),
                FailureText = v58 and v4.createElement("TextLabel", {
                    Text = v59,
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.fromScale(0.5, 0.25),
                    TextColor3 = l_Stylizer_2.fontStyle.Normal.TextColor3,
                    TextSize = l_Stylizer_2.fontStyle.Normal.TextSize,
                    Font = l_Stylizer_2.fontStyle.Normal.Font
                })
            });
        end;
    else
        return ;
    end;
end;
return (v5.connect(function(v69, _)
    return {
        LoadState = v69.LoadState.CurrentLoadState or v23.Unloaded,
        SaveState = v69.SaveState.CurrentSaveState or v24.Unsaved,
        OwnerId = v69.GameOwnerMetadata.creatorId,
        OwnerType = v69.GameOwnerMetadata.creatorType,
        GroupOwnerUserId = v69.GameOwnerMetadata.groupOwnerId,
        HasCollaborators = v25(v69),
        HasCurrentEditCollaborators = v26(v69),
        GroupRolePermissions = v69.GroupRolePermissions.PermissionsByRole
    };
end, function(v71)
    return {
        LoadPermissions = function()
            v71(v22:LoadPermissions());
        end,
        SavePermissions = function(v72)
            v71(v21(v72));
        end
    };
end)((l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_Localization_0
})(v30))));


local l_COLLAB2850_FixMcTooltips_0 = game:GetFastFlag("COLLAB2850_FixMcTooltips");
local l_COLLAB4802_FixManageCollabLanguageBug_0 = game:GetFastFlag("COLLAB4802_FixManageCollabLanguageBug");
local l_Parent_0 = script.Parent.Parent.Parent;
local v3 = require(l_Parent_0.Packages.Roact);
local v4 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v7 = require(l_Parent_0.Src.Util.PermissionsConstants);
local v8 = require(l_Parent_0.Src.Components.CollaboratorItem);
local v9 = require(l_Parent_0.Src.Selectors.IsRolesetOwner);
local v10 = require(l_Parent_0.Src.Selectors.GetRolesetName);
local v11 = require(l_Parent_0.Src.Selectors.GetRolesetPermission);
local v12 = require(l_Parent_0.Src.Thunks.SetRolesetPermission);
local v13 = v3.PureComponent:extend("RolesetCollaboratorItem");
v13.getAvailablePermissions = function(v14)
    local l_props_0 = v14.props;
    local l_IsRolesetOwner_0 = l_props_0.IsRolesetOwner;
    local l_IsGroupOwner_0 = l_props_0.IsGroupOwner;
    local l_RolePermissions_0 = l_props_0.RolePermissions;
    local l_Localization_0 = l_props_0.Localization;
    if not l_IsRolesetOwner_0 then
        if not l_IsGroupOwner_0 then
            return {
                {
                    Key = v7.NoAccessKey,
                    Display = l_Localization_0:getText("PermissionLabels", "NoAccess"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "NoAccess")
                },
                {
                    Key = v7.PlayKey,
                    Display = l_Localization_0:getText("PermissionLabels", "Play"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "Play")
                }
            };
        elseif not (l_RolePermissions_0 ~= nil) or not l_RolePermissions_0.groupEconomyPermissions.manageGroupGames then
            return {
                {
                    Key = v7.NoAccessKey,
                    Display = l_Localization_0:getText("PermissionLabels", "NoAccess"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "NoAccess")
                },
                {
                    Key = v7.PlayKey,
                    Display = l_Localization_0:getText("PermissionLabels", "Play"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "Play")
                },
                {
                    Key = v7.EditKey,
                    Display = l_Localization_0:getText("PermissionLabels", "Edit"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "Edit")
                }
            };
        else
            return {
                {
                    Key = v7.EditKey,
                    Display = l_Localization_0:getText("PermissionLabels", "Edit"),
                    Description = l_Localization_0:getText("PermissionDescriptions", "Edit")
                }
            };
        end;
    else
        return {
            {
                Key = v7.OwnerKey,
                Display = l_Localization_0:getText("PermissionLabels", "Owner"),
                Description = l_Localization_0:getText("PermissionDescriptions", "Owner")
            }
        };
    end;
end;
v13.getCurrentPermission = function(v20)
    local l_props_1 = v20.props;
    local l_IsRolesetOwner_1 = l_props_1.IsRolesetOwner;
    local l_RolePermissions_1 = l_props_1.RolePermissions;
    local l_CurrentPermission_0 = l_props_1.CurrentPermission;
    if not l_IsRolesetOwner_1 then
        if not (l_RolePermissions_1 ~= nil) or not l_RolePermissions_1.groupEconomyPermissions.manageGroupGames then
            return l_CurrentPermission_0;
        else
            return v7.EditKey;
        end;
    else
        return v7.OwnerKey;
    end;
end;
v13.render = function(v25)
    local l_props_2 = v25.props;
    local l_LayoutOrder_0 = l_props_2.LayoutOrder;
    local _ = if not l_COLLAB2850_FixMcTooltips_0 then nil else l_props_2.Localization;
    local l_Id_0 = l_props_2.Id;
    local l_Writable_0 = l_props_2.Writable;
    local l_RolesetName_0 = l_props_2.RolesetName;
    local l_IsRolesetOwner_2 = l_props_2.IsRolesetOwner;
    local l_HideSeparator_0 = l_props_2.HideSeparator;
    local l_SetRolesetPermission_0 = l_props_2.SetRolesetPermission;
    local v35 = v25:getAvailablePermissions();
    local v36 = nil;
    local v37 = nil;
    local l_Localization_1 = l_props_2.Localization;
    if l_COLLAB2850_FixMcTooltips_0 then
        v36 = l_props_2.IsGroupGame;
        if not l_IsRolesetOwner_2 then
            if not v36 then
                if not l_Writable_0 then
                    v37 = l_Localization_1:getText("PermissionDescriptions", "GameOwnerToEdit");
                end;
            elseif l_Writable_0 then
                if #v35 <= 1 then
                    if not l_COLLAB4802_FixManageCollabLanguageBug_0 then
                        assert(v35[1].Display == "Edit");
                    else
                        assert(v35[1].Display == l_Localization_1:getText("PermissionLabels", "Edit"));
                    end;
                    v37 = l_Localization_1:getText("PermissionDescriptions", "RoleHasEditPerms");
                end;
            else
                v37 = l_Localization_1:getText("PermissionDescriptions", "GroupOwnerToEdit");
            end;
        end;
    end;
    return v3.createElement(v8, {
        LayoutOrder = l_LayoutOrder_0,
        Name = l_RolesetName_0,
        Writable = if not l_COLLAB2850_FixMcTooltips_0 then l_Writable_0 and not l_IsRolesetOwner_2 else (l_Writable_0 and not l_IsRolesetOwner_2) and #v35 > 1,
        Loading = false,
        Removable = false,
        IsRolesetCollaborator = true,
        HideSeparator = l_HideSeparator_0,
        TooltipText = v37,
        HidePermissions = if l_COLLAB2850_FixMcTooltips_0 then nil else not l_Writable_0 and not l_IsRolesetOwner_2,
        CurrentPermission = v25:getCurrentPermission(),
        AvailablePermissions = v35,
        OnPermissionChanged = function(v39)
            l_SetRolesetPermission_0(l_Id_0, v39);
        end
    });
end;
return (v4.connect(function(v40, v41)
    return {
        IsRolesetOwner = v9(v40, v41.Id),
        RolesetName = v10(v40, v41.Id),
        CurrentPermission = v11(v40, v41.Id)
    };
end, function(v42)
    return {
        SetRolesetPermission = function(...)
            v42(v12(...));
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v13))));


local l_TextService_0 = game:GetService("TextService");
local l_StudioPublishService_0 = game:GetService("StudioPublishService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v3 = require(l_Parent_0.Packages.Roact);
local v4 = require(l_Parent_0.Packages.Framework);
local l_Button_0 = v4.UI.Button;
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Stylizer_0 = v4.Style.Stylizer;
local l_Localization_0 = l_ContextServices_0.Localization;
local v10 = require(l_Parent_0.Src.Util.Analytics);
local v11 = v3.PureComponent:extend("SaveToRobloxView");
v11.render = function(v12)
    local l_props_0 = v12.props;
    local l_CloseWidget_0 = l_props_0.CloseWidget;
    local l_Localization_1 = l_props_0.Localization;
    local l_Stylizer_1 = l_props_0.Stylizer;
    local v17 = l_Localization_1:getText("Buttons", "SaveToRoblox");
    local l_l_TextService_0_TextSize_0 = l_TextService_0:GetTextSize(v17, l_Stylizer_1.saveToRobloxView.Text.TextSize, l_Stylizer_1.saveToRobloxView.Text.Font, Vector2.new(math.huge, math.huge));
    return v3.createElement("Frame", {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundColor3 = l_Stylizer_1.backgroundColor
    }, {
        SaveText = v3.createElement("TextLabel", {
            Text = l_Localization_1:getText("Description", "SaveToRoblox"),
            TextColor3 = l_Stylizer_1.saveToRobloxView.Text.TextColor3,
            TextSize = l_Stylizer_1.saveToRobloxView.Text.TextSize,
            Font = l_Stylizer_1.saveToRobloxView.Text.Font,
            Position = UDim2.new(0.5, 0, 0, l_Stylizer_1.saveToRobloxView.Text.YOffset),
            AnchorPoint = Vector2.new(0.5, 0.5)
        }),
        SaveButton = v3.createElement(l_Button_0, {
            Style = "Active",
            Text = v17,
            Size = UDim2.new(0, l_l_TextService_0_TextSize_0.X + l_Stylizer_1.saveToRobloxView.publishButton.paddingX, 0, l_l_TextService_0_TextSize_0.Y + l_Stylizer_1.saveToRobloxView.publishButton.paddingY),
            Position = UDim2.new(0.5, 0, 0, l_Stylizer_1.saveToRobloxView.publishButton.offset),
            AnchorPoint = Vector2.new(0.5, 0.5),
            OnClick = function()
                v10.reportSaveToRobloxPressed();
                l_StudioPublishService_0:ShowSaveOrPublishPlaceToRoblox(false, false, Enum.StudioCloseMode.None);
                l_CloseWidget_0();
            end
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_Localization_0
})(v11));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v7 = require(l_Parent_0.Packages.Framework);
local l_Stylizer_0 = v7.Style.Stylizer;
local l_LayoutOrderIterator_0 = v7.Util.LayoutOrderIterator;
local l_COLLABORATORTYPE_USER_0 = v3.COLLABORATORTYPE_USER;
local v11 = require(l_Parent_0.Src.Util.PermissionsConstants);
local l_DropdownMenu_0 = v7.UI.DropdownMenu;
local v13 = require(l_Parent_0.Src.Util.CreateFitToContent);
local l_LoadingIndicator_0 = v7.UI.LoadingIndicator;
local l_TextService_0 = game:GetService("TextService");
local v16 = game:getFastFlag("StudioManageCollabFixFocusError");
local v17 = game:DefineFastFlag("StudioManageCollabFixTextBoxNilError", false);
local v18 = v13("Frame", "UIListLayout", {
    SortOrder = Enum.SortOrder.LayoutOrder,
    Padding = UDim.new(0, 0)
});
local v19 = v13("Frame", "UIListLayout", {
    SortOrder = Enum.SortOrder.LayoutOrder,
    Padding = UDim.new(0, 0),
    FillDirection = Enum.FillDirection.Horizontal
});
local v20 = v13("ImageLabel", "UIListLayout", {
    SortOrder = Enum.SortOrder.LayoutOrder,
    Padding = UDim.new(0, 0),
    FillDirection = Enum.FillDirection.Horizontal
});
local v21 = v1.PureComponent:extend("SearchBar");
local function _(v22)
    return not not v22 and v22:gsub("\n", " ") or "";
end;
v21.init = function(v24)
    v24.state = {
        text = "",
        isFocused = false,
        isContainerHovered = false,
        isClearButtonHovered = false,
        isKeyHovered = false,
        showDropdown = false,
        dropdownItem = nil,
        lastDelay = {},
        lastResults = {},
        mergedItems = {}
    };
    v24.textBoxRef = v1.createRef();
    v24.requestSearch = function()
        v24.props.onSearchRequested(v24.state.text);
    end;
    v24.onContainerHovered = function()
        v24:setState({
            isContainerHovered = true
        });
    end;
    v24.onContainerHoverEnded = function()
        v24:setState({
            isContainerHovered = false
        });
    end;
    v24.onTextChanged = function(v25)
        local l_Text_0 = v25.Text;
        local v27 = not not l_Text_0 and l_Text_0:gsub("\n", " ") or "";
        l_Text_0 = v24.textBoxRef.current;
        if not (v17 and not l_Text_0) and v24.state.text ~= v27 then
            v24:setState({
                text = v27
            });
            if v24.props.onTextChanged then
                v24.props.onTextChanged(v27);
            end;
            local v28 = {};
            v24.state.lastDelay = v28;
            delay(0.5, function()
                if v28 == v24.state.lastDelay and v27 ~= "" then
                    v24.requestSearch();
                    if not v24.state.showDropdown and next(v24.state.mergedItems) ~= nil then
                        v24.showDropdown();
                    end;
                end;
            end);
            if l_Text_0.AbsoluteSize.x < l_TextService_0:GetTextSize(v27, l_Text_0.TextSize, l_Text_0.Font, Vector2.new(0, math.huge)).x then
                l_Text_0.TextXAlignment = Enum.TextXAlignment.Right;
                return ;
            else
                l_Text_0.TextXAlignment = Enum.TextXAlignment.Left;
            end;
        end;
    end;
    v24.onTextBoxFocused = function(v29, _)
        local l_current_0 = v24.textBoxRef.current;
        v24:setState({
            isFocused = true
        });
        if not v29 then
            l_current_0:ReleaseFocus();
        end;
        if next(v24.state.mergedItems) ~= nil then
            v24.showDropdown();
        end;
    end;
    v24.onTextBoxFocusLost = function(_, _, _)
        if not v16 or not v24.isUnmounting then
            v24:setState({
                isFocused = false,
                isContainerHovered = false
            });
            if not v24.state.dropdownItem then
                v24.hideDropdown();
            end;
            return ;
        else
            return ;
        end;
    end;
    v24.onClearButtonHovered = function()
        v24:setState({
            isClearButtonHovered = true
        });
    end;
    v24.onClearButtonHoverEnded = function()
        v24:setState({
            isClearButtonHovered = false
        });
    end;
    v24.onClearButtonClicked = function()
        local l_current_1 = v24.textBoxRef.current;
        v24:setState({
            isFocused = true
        });
        l_current_1.Text = "";
        l_current_1:CaptureFocus();
        l_current_1.TextXAlignment = Enum.TextXAlignment.Left;
        v24.onClearButtonHoverEnded();
    end;
    v24.onItemClicked = function(v36)
        v24.props.OnItemClicked(v36.Key);
        v24.hideDropdown();
    end;
    v24.showDropdown = function()
        v24:setState({
            showDropdown = true
        });
    end;
    v24.hideDropdown = function()
        if not v24.state.isFocused then
            v24:setState({
                showDropdown = false,
                dropdownItem = v1.None,
                isKeyHovered = false
            });
        end;
    end;
    v24.onKeyMouseEnter = function(v37)
        v24:setState({
            dropdownItem = v37,
            isKeyHovered = true
        });
    end;
    v24.onKeyMouseLeave = function(v38)
        if v24.state.dropdownItem == v38 then
            v24:setState({
                dropdownItem = v1.None,
                isKeyHovered = false
            });
        end;
    end;
    v24.onRenderItem = function(v39, v40, v41)
        local l_props_0 = v24.props;
        local l_Stylizer_1 = l_props_0.Stylizer;
        local l_IsGroupGame_0 = l_props_0.IsGroupGame;
        local l_Localization_1 = l_props_0.Localization;
        local l_searchBar_0 = l_Stylizer_1.searchBar;
        local l_dropdownItem_0 = v24.state.dropdownItem;
        local l_NoResultsText_0 = l_props_0.NoResultsText;
        local l_HeaderHeight_0 = l_props_0.HeaderHeight;
        local l_ItemHeight_0 = l_props_0.ItemHeight;
        local l_textPadding_0 = l_searchBar_0.textPadding;
        local v52 = nil;
        local v53 = v24.textBoxRef and v24.textBoxRef.current;
        local l_Is17PlusGame_0 = l_props_0.Is17PlusGame;
        if v53 then
            v53 = v53.Parent;
            local l_AbsolutePosition_0 = v53.AbsolutePosition;
            local v56 = l_AbsolutePosition_0 + v53.AbsoluteSize;
            v52 = Rect.new(l_AbsolutePosition_0.X, l_AbsolutePosition_0.Y, v56.X, v56.Y);
        end;
        local v57 = v52.Width - l_searchBar_0.dropDown.item.offset;
        if (typeof(v39) == "string" and v39 ~= "LoadingIndicator") and v39 ~= "NoResults" then
            return v1.createElement("Frame", {
                Size = UDim2.new(0, v57, 0, l_HeaderHeight_0),
                BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
                LayoutOrder = v40,
                BorderSizePixel = 0
            }, {
                CollabTypeText = v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.searchBar.dropDown.collaboratorTypeText, {
                    Text = l_Localization_1:getText("CollaboratorTypes", v39),
                    TextXAlignment = Enum.TextXAlignment.Left,
                    Position = l_Stylizer_1.searchBar.collabTypeTextPosition,
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0
                })),
                FriendsEditAccessText = (not (l_Is17PlusGame_0 or l_IsGroupGame_0) and v39 == l_COLLABORATORTYPE_USER_0) and v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.searchBar.dropDown.collaboratorTypeText, {
                    Text = l_Localization_1:getText("Description", "FriendsEditAccess"),
                    TextXAlignment = Enum.TextXAlignment.Right,
                    Position = l_searchBar_0.friendsAccessTextPosition,
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0
                })) or nil
            });
        elseif v39 == "NoResults" then
            return v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.fontStyle.Normal, {
                Size = UDim2.new(0, v57, 0, l_ItemHeight_0),
                Text = l_NoResultsText_0,
                TextXAlignment = Enum.TextXAlignment.Left,
                BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
                BorderSizePixel = 0,
                TextWrapped = true,
                LayoutOrder = v40
            }), {
                Padding = v1.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, l_textPadding_0)
                })
            });
        elseif v39 == "LoadingIndicator" then
            return v1.createElement("Frame", {
                Size = UDim2.new(0, v57, 0, l_ItemHeight_0),
                BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
                BorderSizePixel = 0,
                LayoutOrder = v40
            }, {
                LoadingIndicator = v1.createElement(l_LoadingIndicator_0, {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    ZIndex = 3
                })
            });
        else
            local l_Key_0 = v39.Key;
            local l_IsFriend_0 = v39.IsFriend;
            local v60 = l_Key_0.Type == v11.UserSubjectKey;
            local v61 = not l_Key_0.IsEligible;
            local v62 = nil;
            if v61 then
                v62 = l_Key_0.EligibilityText or l_Localization_1:getText("SearchBar", "UnknownError");
            end;
            local v63 = if not l_IsFriend_0 then l_ItemHeight_0 else l_searchBar_0.nameHeight;
            local v64 = false;
            if l_dropdownItem_0 == l_Key_0 then
                v64 = not v61;
            end;
            local v65 = l_LayoutOrderIterator_0.new();
            local v66 = not not v64 and l_searchBar_0.dropDown.hovered.backgroundColor or l_searchBar_0.dropDown.backgroundColor;
            return v1.createElement("ImageButton", {
                Size = UDim2.new(0, v57, 0, l_ItemHeight_0),
                BackgroundColor3 = v66,
                BorderSizePixel = 0,
                LayoutOrder = v40,
                AutoButtonColor = false,
                Active = not v61,
                [v1.Event.Activated] = v41,
                [v1.Event.MouseEnter] = function()
                    v24.onKeyMouseEnter(l_Key_0);
                end,
                [v1.Event.MouseLeave] = function()
                    v24.onKeyMouseLeave(l_Key_0);
                end
            }, {
                GrayOutBox = if not not v61 and l_props_0.Is17PlusGame then v1.createElement("Frame", {
                    AnchorPoint = Vector2.new(0, 0),
                    Size = UDim2.new(0, v57, 0, l_ItemHeight_0),
                    BackgroundTransparency = 0.75,
                    LayoutOrder = v40
                }) else nil;
                v1.createElement(v19, {
                    LayoutOrder = v40,
                    BackgroundTransparency = 1
                }, {
                    IconFrame = v1.createElement("Frame", {
                        BackgroundTransparency = 1,
                        LayoutOrder = v65:getNextOrder(),
                        Size = UDim2.new(0, l_ItemHeight_0, 0, l_ItemHeight_0)
                    }, {
                        SmallIcon = v1.createElement("Frame", {
                            AnchorPoint = Vector2.new(0.5, 0.5),
                            Position = UDim2.new(0.5, 0, 0.5, 0),
                            Size = UDim2.new(0, l_searchBar_0.thumbnailSize, 0, l_searchBar_0.thumbnailSize),
                            BackgroundColor3 = v66,
                            BorderSizePixel = 0
                        }, {
                            Icon = v39.Icon
                        }),
                        Padding = v1.createElement("UIPadding", {
                            PaddingLeft = UDim.new(0, l_searchBar_0.thumbnailPaddingLeft)
                        })
                    }),
                    NameAndFriendStatus = v1.createElement("Frame", {
                        LayoutOrder = v65:getNextOrder(),
                        Size = UDim2.new(0, l_searchBar_0.nameLabelWidth, 1, 0),
                        BackgroundTransparency = 1
                    }, {
                        Layout = v1.createElement("UIListLayout", {
                            FillDirection = Enum.FillDirection.Vertical,
                            SortOrder = Enum.SortOrder.LayoutOrder,
                            Padding = UDim.new(0, 0)
                        }),
                        TextFrame = v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.fontStyle.Normal, {
                            Size = UDim2.new(0, l_searchBar_0.nameLabelWidth, 0, v63),
                            Text = v39.Name,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            TextYAlignment = Enum.TextYAlignment.Center,
                            TextColor3 = not not v64 and l_searchBar_0.dropDown.hovered.displayText or l_searchBar_0.dropDown.displayText,
                            BackgroundTransparency = 1,
                            TextWrapped = true,
                            ClipsDescendants = true,
                            LayoutOrder = 1,
                            BorderSizePixel = 0
                        }), {
                            Padding = v1.createElement("UIPadding", {
                                PaddingLeft = UDim.new(0, l_searchBar_0.renderItemTextPadding)
                            })
                        }),
                        FriendFrame = if not l_IsFriend_0 then nil else v1.createElement(v19, {
                            LayoutOrder = 2,
                            BackgroundTransparency = 1
                        }, {
                            Padding = v1.createElement("UIPadding", {
                                PaddingLeft = UDim.new(0, l_searchBar_0.renderItemTextPadding),
                                PaddingBottom = UDim.new(0, l_searchBar_0.renderItemTextPadding)
                            }),
                            FriendImageLabel = v1.createElement("ImageLabel", {
                                Size = UDim2.new(0, l_searchBar_0.friendIcon.Width, 0, l_searchBar_0.friendIcon.Height),
                                Image = l_searchBar_0.friendIcon.Image,
                                BackgroundTransparency = 1,
                                LayoutOrder = 1
                            }),
                            FriendTextLabel = v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.fontStyle.Subtext, {
                                Size = UDim2.new(1, 0, 0, l_searchBar_0.friendIcon.LabelHeight),
                                AutomaticSize = Enum.AutomaticSize.X,
                                Text = l_Localization_1:getText("SearchBar", "FriendLabel"),
                                TextXAlignment = Enum.TextXAlignment.Left,
                                TextColor3 = not not v64 and l_searchBar_0.dropDown.hovered.displayText or l_searchBar_0.dropDown.displayText,
                                BackgroundTransparency = 1,
                                LayoutOrder = 2,
                                BorderSizePixel = 0
                            }), {
                                Padding = v1.createElement("UIPadding", {
                                    PaddingLeft = UDim.new(0, l_searchBar_0.renderItemTextPadding / 2)
                                })
                            })
                        })
                    }),
                    RestrictionLabel = if (not not v61 and l_props_0.Is17PlusGame) and v60 then v1.createElement("TextLabel", v2.Dictionary.join(l_Stylizer_1.fontStyle.Normal, {
                        Size = UDim2.new(0, l_searchBar_0.dropDown.eligibilityLabelWidth, 0, l_ItemHeight_0),
                        Text = v62,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextColor3 = not not v64 and l_searchBar_0.dropDown.hovered.displayText or l_searchBar_0.dropDown.displayText,
                        BackgroundTransparency = 1,
                        LayoutOrder = v65:getNextOrder(),
                        BorderSizePixel = 0
                    })) else nil
                })
            });
        end;
    end;
    if v24.props.onTextChanged then
        v24.props.onTextChanged("");
    end;
end;
v21.mergeResultsTable = function(v67, v68)
    local v69 = {};
    if next(v68) == nil then
        if not v67.props.LoadingMore and v67.state.text ~= "" then
            table.insert(v69, "NoResults");
        end;
    else
        local v70 = {};
        for v71, _ in pairs(v68) do
            table.insert(v70, v71);
        end;
        table.sort(v70, function(v73, v74)
            return v68[v73].LayoutOrder < v68[v74].LayoutOrder;
        end);
        for _, v76 in ipairs(v70) do
            table.insert(v69, v76);
            for _, v78 in ipairs(v68[v76]) do
                table.insert(v69, v78);
            end;
        end;
    end;
    if v67.props.LoadingMore then
        table.insert(v69, "LoadingIndicator");
    end;
    return v69;
end;
v21.render = function(v79)
    local l_props_1 = v79.props;
    local l_Stylizer_2 = l_props_1.Stylizer;
    local l_Mouse_0 = l_props_1.Mouse;
    local l_state_0 = v79.state;
    local v84 = l_props_1.LayoutOrder or 0;
    local l_text_0 = l_state_0.text;
    local v86 = l_state_0.isFocused and l_props_1.Enabled;
    local v87 = l_state_0.isContainerHovered and l_props_1.Enabled;
    local v88 = (v79.state.isClearButtonHovered or v79.state.isKeyHovered) and l_props_1.Enabled;
    local v89 = v79.state.isContainerHovered and l_props_1.Enabled;
    if not v88 then
        if not v89 then
            l_Mouse_0:__resetCursor();
        else
            l_Mouse_0:__pushCursor("IBeam");
        end;
    else
        l_Mouse_0:__pushCursor("PointingHand");
    end;
    local l_searchBar_1 = l_Stylizer_2.searchBar;
    local v91 = nil;
    v91 = if not v86 then if v87 then l_searchBar_1.borderHover else l_searchBar_1.border else l_searchBar_1.borderSelected;
    local l_DefaultText_0 = l_props_1.DefaultText;
    local l_ErrorText_0 = l_props_1.ErrorText;
    local v94 = l_state_0.showDropdown and v79.state.text ~= "";
    local v95;
    v95 = (v79.textBoxRef and v79.textBoxRef.current) and v95.Parent;
    local v96 = nil;
    if v95 then
        local l_AbsolutePosition_1 = v95.AbsolutePosition;
        local v98 = l_AbsolutePosition_1 + v95.AbsoluteSize;
        v96 = Rect.new(l_AbsolutePosition_1.X, l_AbsolutePosition_1.Y, v98.X, v98.Y);
    end;
    local v99 = l_props_1.Results or {};
    if l_state_0.lastResults ~= v99 then
        l_state_0.mergedItems = v79:mergeResultsTable(v99);
        l_state_0.lastResults = v99;
    end;
    return v1.createElement(v18, {
        BackgroundTransparency = 1,
        LayoutOrder = v84
    }, {
        Background = v1.createElement(v20, {
            BackgroundTransparency = 1,
            Image = v3.ROUNDED_BORDER_IMAGE,
            ImageColor3 = v91,
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = v3.ROUNDED_FRAME_SLICE,
            [v1.Event.MouseEnter] = v79.onContainerHovered,
            [v1.Event.MouseMoved] = v79.onContainerHovered,
            [v1.Event.MouseLeave] = v79.onContainerHoverEnded
        }, {
            Padding = v1.createElement("UIPadding", {
                PaddingLeft = UDim.new(0, 12)
            }),
            TextBox = v1.createElement("TextBox", v2.Dictionary.join(l_Stylizer_2.fontStyle.Normal, {
                LayoutOrder = 1,
                Size = UDim2.new(1, -l_searchBar_1.searchBarHeight, 0, l_searchBar_1.searchBarHeight),
                BackgroundTransparency = 1,
                ClipsDescendants = true,
                ClearTextOnFocus = false,
                TextXAlignment = Enum.TextXAlignment.Left,
                Text = not not l_props_1.Enabled and l_text_0 or "",
                TextEditable = l_props_1.Enabled,
                PlaceholderText = l_ErrorText_0 or l_DefaultText_0,
                PlaceholderColor3 = not not l_ErrorText_0 and l_Stylizer_2.warningColor or l_searchBar_1.placeholderText,
                [v1.Ref] = v79.textBoxRef,
                [v1.Change.Text] = v79.onTextChanged,
                [v1.Event.Focused] = function(...)
                    v79.onTextBoxFocused(l_props_1.Enabled, ...);
                end,
                [v1.Event.FocusLost] = v79.onTextBoxFocusLost
            }), {
                Dropdown = v95 and v1.createElement(l_DropdownMenu_0, {
                    Hide = not v94,
                    Items = v79.state.mergedItems,
                    OnFocusLost = v79.hideDropdown,
                    OnItemActivated = v79.onItemClicked,
                    OnRenderItem = v79.onRenderItem,
                    Style = "Search",
                    Width = v96.Width,
                    MaxHeight = l_searchBar_1.dropDown.maxHeight
                })
            }),
            ClearButtonFrame = v1.createElement("Frame", {
                BackgroundTransparency = 1,
                LayoutOrder = 2,
                Size = UDim2.new(0, l_searchBar_1.searchBarHeight, 0, l_searchBar_1.searchBarHeight)
            }, {
                ClearButton = v1.createElement("ImageButton", {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    Size = UDim2.new(0, l_searchBar_1.clearButtonIconSize, 0, l_searchBar_1.clearButtonIconSize),
                    BackgroundTransparency = 1,
                    Visible = l_text_0 ~= "",
                    Image = l_Stylizer_2.deleteIcon,
                    [v1.Event.MouseEnter] = v79.onClearButtonHovered,
                    [v1.Event.MouseMoved] = v79.onClearButtonHovered,
                    [v1.Event.MouseLeave] = v79.onClearButtonHoverEnded,
                    [v1.Event.MouseButton1Down] = v79.onClearButtonClicked
                })
            })
        })
    });
end;
v21.didMount = function(v100)
    if v16 then
        v100.isUnmounting = false;
    end;
end;
v21.willUnmount = function(v101)
    if v16 then
        v101.isUnmounting = true;
    end;
end;
return (l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_Localization_0,
    Mouse = l_ContextServices_0.Mouse
})(v21));


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_Stylizer_0 = v2.Style.Stylizer;
local l_withContext_0 = v2.ContextServices.withContext;
local v5 = require(l_Parent_0.Src.Components.Thumbnails.AutoThumbnail);
local v6 = v1.Component:extend(script.Name);
v6.getThumbnail = function(v7, v8, v9)
    local l_Stylizer_1 = v7.props.Stylizer;
    if v9 == Enum.AssetFetchStatus.Success then
        return v8;
    elseif v9 == Enum.AssetFetchStatus.Failure then
        return l_Stylizer_1.groupThumbnail.loadFailureImage;
    else
        return l_Stylizer_1.groupThumbnail.loadingImage;
    end;
end;
v6.render = function(v11)
    local l_props_0 = v11.props;
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = l_props_0.Size,
        Position = l_props_0.Position,
        AnchorPoint = l_props_0.AnchorPoint,
        LayoutOrder = l_props_0.LayoutOrder,
        ZIndex = l_props_0.ZIndex
    }, {
        AutoThumbnail = v1.createElement(v5, {
            Id = l_props_0.Id,
            ThumbnailType = "GroupIcon",
            RenderContents = function(v13, v14)
                return v1.createElement("ImageLabel", {
                    Size = UDim2.fromScale(1, 1),
                    BackgroundTransparency = 1,
                    Image = v11:getThumbnail(v13, v14)
                });
            end
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_Stylizer_0
})(v6));


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_Stylizer_0 = v2.Style.Stylizer;
local l_withContext_0 = v2.ContextServices.withContext;
local v5 = require(l_Parent_0.Src.Components.Thumbnails.AutoThumbnail);
local v6 = v1.Component:extend(script.Name);
v6.getThumbnail = function(v7, v8, v9)
    local l_Stylizer_1 = v7.props.Stylizer;
    if v9 == Enum.AssetFetchStatus.Success then
        return v8;
    elseif v9 == Enum.AssetFetchStatus.Failure then
        return l_Stylizer_1.subjectThumbnail.loadFailureImage;
    else
        return l_Stylizer_1.subjectThumbnail.loadingImage;
    end;
end;
v6.init = function(v11)
    v11.maskRef = v1.createRef();
    v11.maskBackgroundParent = nil;
    v11.parentChanged = nil;
    v11.colorChanged = nil;
    v11.getBackgroundParent = function(v12)
        local l_Parent_1 = v12.Parent;
        if l_Parent_1 ~= nil and l_Parent_1:IsA("GuiObject") then
            if l_Parent_1.BackgroundTransparency ~= 1 then
                return l_Parent_1;
            else
                return v11.getBackgroundParent(l_Parent_1);
            end;
        else
            return nil;
        end;
    end;
end;
v6.didMount = function(v14)
    local function v16()
        local v15 = v14.maskRef:getValue();
        if v15 then
            v15.ImageColor3 = v14.maskBackgroundParent.BackgroundColor3;
            return ;
        else
            return ;
        end;
    end;
    local function v19()
        local v17 = v14.maskRef:getValue();
        if v17 then
            v14.maskBackgroundParent = v14.getBackgroundParent(v17.Parent);
            if v14.colorChanged then
                v14.colorChanged:Disconnect();
            end;
            if v14.maskBackgroundParent then
                v14.colorChanged = v14.maskBackgroundParent:GetPropertyChangedSignal("BackgroundColor3"):Connect(v16);
                local v18 = v14.maskRef:getValue();
                if v18 then
                    v18.ImageColor3 = v14.maskBackgroundParent.BackgroundColor3;
                else
                    return ;
                end;
            end;
            return ;
        else
            return ;
        end;
    end;
    v14.parentChanged = v14.maskRef:getValue().AncestryChanged:Connect(v19);
    v19();
end;
v6.willUnmount = function(v20)
    v20.parentChanged:Disconnect();
    if v20.colorChanged then
        v20.colorChanged:Disconnect();
    end;
end;
v6.render = function(v21)
    local l_props_0 = v21.props;
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = l_props_0.Size,
        Position = l_props_0.Position,
        AnchorPoint = l_props_0.AnchorPoint,
        LayoutOrder = l_props_0.LayoutOrder,
        ZIndex = l_props_0.ZIndex
    }, {
        AutoThumbnail = v1.createElement(v5, {
            Id = l_props_0.Id,
            ThumbnailType = "AvatarHeadShot",
            RenderContents = function(v23, v24)
                local v25 = v21:getThumbnail(v23, v24);
                local l_Stylizer_2 = v21.props.Stylizer;
                return v1.createElement("ImageLabel", {
                    Size = UDim2.fromScale(1, 1),
                    BackgroundColor3 = l_Stylizer_2.subjectThumbnail.background,
                    BackgroundTransparency = 0,
                    BorderSizePixel = 0,
                    Image = v25
                }, {
                    Mask = v1.createElement("ImageLabel", {
                        [v1.Ref] = v21.maskRef,
                        Size = UDim2.fromScale(1, 1),
                        BackgroundTransparency = 1,
                        Image = l_Stylizer_2.subjectThumbnail.maskImage
                    })
                });
            end
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_Stylizer_0
})(v6));


local l_COLLAB2850_FixMcTooltips_0 = game:GetFastFlag("COLLAB2850_FixMcTooltips");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_Parent_0.Src.Util.PermissionsConstants);
local v7 = require(l_Parent_0.Src.Components.Thumbnails.UserHeadshotThumbnail);
local v8 = require(l_Parent_0.Src.Components.CollaboratorItem);
local v9 = require(l_Parent_0.Src.Selectors.IsUserOwner);
local v10 = require(l_Parent_0.Src.Selectors.IsUserCreatorFriend);
local v11 = require(l_Parent_0.Src.Selectors.GetUserName);
local v12 = require(l_Parent_0.Src.Selectors.GetUserPermission);
local v13 = require(l_Parent_0.Src.Thunks.SetUserPermission);
local v14 = require(l_Parent_0.Src.Thunks.RemoveUserCollaborator);
local v15 = v2.PureComponent:extend("UserCollaboratorItem");
local v16 = {
    [v6.OwnerKey] = "Owner",
    [v6.PlayKey] = "Play",
    [v6.EditKey] = "Edit",
    [v6.NoAccessKey] = "NoAccess",
    [v6.AdminKey] = "Admin"
};
v15.DEPRECATED_getPermissionForKey = function(v17, v18)
    local l_Localization_0 = v17.props.Localization;
    if v16[v18] then
        return {
            Key = v18,
            Display = l_Localization_0:getText("PermissionLabels", v16[v18]),
            Description = l_Localization_0:getText("PermissionDescriptions", v16[v18])
        };
    else
        return {
            Key = v18,
            Display = tostring(v18),
            Description = "Error: This permission is not recognized."
        };
    end;
end;
v15.getAvailablePermissions = function(v20)
    local l_props_0 = v20.props;
    local l_IsOwner_0 = l_props_0.IsOwner;
    local l_IsOwnerFriend_0 = l_props_0.IsOwnerFriend;
    local l_OwnerType_0 = l_props_0.OwnerType;
    local l_Writable_0 = l_props_0.Writable;
    if not l_IsOwner_0 then
        if l_Writable_0 then
            local v26 = {
                v20:DEPRECATED_getPermissionForKey(v6.PlayKey)
            };
            if not (not (l_OwnerType_0 == Enum.CreatorType.User) or not l_IsOwnerFriend_0) then
                table.insert(v26, v20:DEPRECATED_getPermissionForKey(v6.EditKey));
            end;
            return v26;
        else
            return {
                v20:DEPRECATED_getPermissionForKey(v20:getCurrentPermission())
            };
        end;
    else
        return {
            v20:DEPRECATED_getPermissionForKey(v6.OwnerKey)
        };
    end;
end;
v15.getCurrentPermission = function(v27)
    local l_props_1 = v27.props;
    local l_IsOwner_1 = l_props_1.IsOwner;
    local l_CurrentPermission_0 = l_props_1.CurrentPermission;
    if not l_IsOwner_1 then
        return l_CurrentPermission_0;
    else
        return v6.OwnerKey;
    end;
end;
v15.render = function(v31)
    local l_props_2 = v31.props;
    local l_LayoutOrder_0 = l_props_2.LayoutOrder;
    local v34 = if not l_COLLAB2850_FixMcTooltips_0 then nil else l_props_2.Localization;
    local l_Id_0 = l_props_2.Id;
    local l_Writable_1 = l_props_2.Writable;
    local l_UserName_0 = l_props_2.UserName;
    local l_IsOwner_2 = l_props_2.IsOwner;
    local l_HideSeparator_0 = l_props_2.HideSeparator;
    local l_SetUserPermission_0 = l_props_2.SetUserPermission;
    local l_RemoveUserCollaborator_0 = l_props_2.RemoveUserCollaborator;
    local v42 = if not l_COLLAB2850_FixMcTooltips_0 then nil else l_props_2.IsGroupGame;
    local v43 = v31:getAvailablePermissions();
    local v44 = nil;
    if not (not l_COLLAB2850_FixMcTooltips_0 or l_IsOwner_2) then
        if not v42 then
            if l_Writable_1 then
                if #v43 <= 1 then
                    v44 = v34:getText("PermissionDescriptions", "FriendToEdit");
                end;
            else
                v44 = v34:getText("PermissionDescriptions", "GameOwnerToEdit");
            end;
        else
            v44 = if l_Writable_1 then v34:getText("PermissionDescriptions", "UsersOnlyPlayLevel") else v34:getText("PermissionDescriptions", "GroupOwnerToEdit");
        end;
    end;
    return v2.createElement(v8, {
        LayoutOrder = l_LayoutOrder_0,
        Name = l_UserName_0,
        Icon = v2.createElement(v7, {
            Id = l_Id_0,
            Size = UDim2.fromScale(1, 1)
        }),
        Writable = if not l_COLLAB2850_FixMcTooltips_0 then l_Writable_1 and not l_IsOwner_2 else (l_Writable_1 and not l_IsOwner_2) and #v43 > 1,
        Loading = false,
        IsOwner = if not l_COLLAB2850_FixMcTooltips_0 then nil else l_IsOwner_2,
        HideSeparator = l_HideSeparator_0,
        Removable = if not l_COLLAB2850_FixMcTooltips_0 then not l_IsOwner_2 else l_Writable_1 and not l_IsOwner_2,
        OnRemoved = function()
            l_RemoveUserCollaborator_0(l_Id_0);
        end,
        TooltipText = v44,
        CurrentPermission = v31:getCurrentPermission(),
        AvailablePermissions = v43,
        OnPermissionChanged = function(v45)
            l_SetUserPermission_0(l_Id_0, v45);
        end
    });
end;
return (v3.connect(function(v46, v47)
    return {
        OwnerType = v46.GameOwnerMetadata.creatorType,
        IsOwner = v9(v46, v47.Id),
        IsOwnerFriend = v10(v46, v47.Id),
        UserName = v11(v46, v47.Id),
        CurrentPermission = v12(v46, v47.Id)
    };
end, function(v48)
    return {
        SetUserPermission = function(...)
            v48(v13(...));
        end,
        RemoveUserCollaborator = function(...)
            v48(v14(...));
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v15))));


local v0 = game:getFastFlag("ImprovePluginSpeed_ManageCollaborators");
local l_Parent_0 = script.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Rodux);
local v4 = require(l_Parent_0.Packages.Framework);
local l_Util_0 = v4.Util;
local l_CrossPluginCommunication_0 = l_Util_0.CrossPluginCommunication;
local l_Dialog_0 = v4.UI.Dialog;
local l_ContextServices_0 = v4.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_Store_0 = l_ContextServices_0.Store;
local v12 = require(l_Parent_0.Src.Reducers.MainReducer);
local v13 = require(l_Parent_0.Src.Resources.MakeTheme);
local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
local l_Components_0 = l_Parent_0.Src.Components;
local v17 = require(l_Components_0.PermissionsView);
local v18 = require(l_Components_0.SaveToRobloxView);
local l_TeamCreateService_0 = game:GetService("TeamCreateService");
local v20 = v2.PureComponent:extend("MainPlugin");
local v21 = require(l_Parent_0.Src.Networking.Networking);
local v22 = require(l_Parent_0.Src.Controllers.GroupMetadataController);
local v23 = require(l_Parent_0.Src.Controllers.GroupRolePermissionsController);
local v24 = require(l_Parent_0.Src.Controllers.GamePermissionsController);
local v25 = require(l_Parent_0.Src.Controllers.GameMetadataController);
local v26 = require(l_Parent_0.Src.Controllers.SocialController);
local v27 = require(l_Parent_0.Src.Actions.ResetStore);
local v28 = require(l_Parent_0.Src.Util.Analytics);
v20.init = function(v29, v30)
    v29.plugin = l_Plugin_0.new(v30.Plugin);
    v29.state = {
        enabled = false
    };
    v29.toggleEnabled = function()
        v29:setState(function(v31)
            return {
                enabled = not v31.enabled
            };
        end);
    end;
    v29.onClose = function()
        v29.store:dispatch(v27());
        v29:setState({
            enabled = false
        });
    end;
    v29.onRestore = function(v32)
        v29:setState({
            enabled = v32
        });
    end;
    v29.onWidgetEnabledChanged = function(v33)
        v29:setState({
            enabled = v33.Enabled
        });
    end;
    local v34 = {};
    local v35 = v21.new();
    local v36 = v22.new(v35:get());
    local v37 = v23.new(v35:get());
    local v38 = v24.new(v35:get());
    local v39 = v25.new(v35:get());
    local v40 = v26.new(v35:get());
    v34.networking = v35:get();
    v34.groupMetadataController = v36;
    v34.groupRolePermisionsController = v37;
    v34.gamePermissionsController = v38;
    v34.gameMetadataController = v39;
    v34.socialController = v40;
    v29.store = v3.Store.new(v12, nil, {
        (l_Util_0.ThunkWithArgsMiddleware(v34))
    });
    v29.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "ManageCollaborators"
    });
    v29.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
    local function v41()
        v28.reportCollaborateButtonPressed();
        v29.toggleEnabled();
    end;
    if not v0 then
        l_TeamCreateService_0.ToggleManageCollaborators:Connect(v41);
    else
        v30.PluginLoaderContext.signals["TeamCreateService.ToggleManageCollaborators"]:Connect(v41);
    end;
    v29.communication = l_CrossPluginCommunication_0.new("ManageCollaborators");
    v29.communication:Connect("ToggleManageCollaborators", function()
        v29.toggleEnabled();
    end);
end;
v20.render = function(v42)
    local l_props_0 = v42.props;
    local l_enabled_0 = v42.state.enabled;
    local v45 = game.GameId ~= 0;
    return l_ContextServices_0.provide({
        v42.plugin,
        l_Store_0.new(v42.store),
        l_Mouse_0.new(l_props_0.Plugin:getMouse()),
        v13(),
        v42.localization,
        v42.analytics
    }, {
        Dialog = v2.createElement(l_Dialog_0, {
            CreateWidgetImmediately = true,
            Enabled = l_enabled_0,
            Modal = true,
            Title = v42.localization:getText("Plugin", "Title"),
            Size = Vector2.new(800, 571),
            OnClose = v42.onClose
        }, {
            PermissionsView = not not v45 and v2.createElement(v17, {
                CloseWidget = v42.onClose,
                Plugin = v42.plugin,
                Enabled = l_enabled_0
            }) or nil,
            SaveToRobloxView = not v45 and v2.createElement(v18, {
                CloseWidget = v42.onClose
            })
        })
    });
end;
return v20;


local l_HttpRbxApiService_0 = game:GetService("HttpRbxApiService");
local l_HttpService_0 = game:GetService("HttpService");
local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_Parent_0 = script.Parent.Parent.Parent;
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
local v5 = require(l_Parent_0.Src.Util.Constants);
local l_BaseUrl_0 = l_ContentProvider_0.BaseUrl;
if not l_BaseUrl_0:find("https://www.") then
    if l_BaseUrl_0:find("http://www.") then
        l_BaseUrl_0 = l_BaseUrl_0:sub(12);
    end;
else
    l_BaseUrl_0 = l_BaseUrl_0:sub(13);
end;
local function v12(v7)
    local l_Params_0 = v7.Params;
    v7.Params = nil;
    if l_Params_0 then
        local v9 = {};
        for v10, v11 in pairs(l_Params_0) do
            table.insert(v9, l_HttpService_0:UrlEncode(v10) .. "=" .. l_HttpService_0:UrlEncode(v11));
        end;
        v7.Url = v7.Url .. "?" .. table.concat(v9, "&");
    end;
end;
return {
    BuildRobloxUrl = function(v13, v14, ...)
        return "https://" .. v13 .. "." .. l_BaseUrl_0 .. (string.format(v14, ...) or "");
    end,
    Request = function(v15)
        v12(v15);
        return l_Promise_0.new(function(v16, v17)
            spawn(function()
                local l_status_0, l_result_0 = pcall(l_HttpRbxApiService_0.RequestAsync, l_HttpRbxApiService_0, v15);
                if not l_status_0 then
                    v17(l_result_0);
                    return ;
                else
                    v16(l_result_0);
                    return ;
                end;
            end);
        end);
    end,
    RequestInternal = function(v20)
        v12(v20);
        return l_Promise_0.new(function(v21, v22)
            spawn(function()
                l_HttpService_0:RequestInternal(v20):Start(function(v23, v24)
                    if not v23 then
                        v22("HTTP error: " .. tostring(v24.HttpError));
                        return ;
                    elseif v5.BAD_REQUEST <= v24.StatusCode then
                        v22("HTTP error: " .. tostring(v24.StatusCode));
                        return ;
                    else
                        v21(v24.Body);
                        return ;
                    end;
                end);
            end);
        end);
    end
};


local l_Parent_0 = script.Parent.Parent.Parent;
local l_ContextItem_0 = require(l_Parent_0.Packages.Framework).ContextServices.ContextItem;
local v2 = require(l_Parent_0.Src.Networking.NetworkingImpl);
local v3 = l_ContextItem_0:extend(script.Name);
v3.new = function(...)
    return (setmetatable({
        impl = v2.new(...)
    }, v3));
end;
v3.get = function(v4)
    return v4.impl;
end;
return v3;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Networking.Requests.GroupRoles);
local v4 = require(l_Parent_0.Src.Util.PermissionsConstants);
local v5 = require(l_Parent_0.Src.Networking.WebKeyConstants);
local function _(v6)
    if not v6[v5.UserId] then
        if not v6[v5.RoleId] then
            if not v6[v5.GroupId] then
                error("Could not determine subject type");
                return ;
            else
                return v4.GroupSubjectKey;
            end;
        else
            return v4.RoleSubjectKey;
        end;
    else
        return v4.UserSubjectKey;
    end;
end;
local function _(v8)
    if v8 == v5.PlayAction then
        return v4.PlayKey;
    elseif v8 == v5.EditAction then
        return v4.EditKey;
    elseif v8 == v5.AdminAction then
        return v4.EditKey;
    elseif v8 == nil then
        return v4.NoAccessKey;
    else
        error("Unsupported Action: " .. tostring(v8));
        return ;
    end;
end;
local v21 = {
    _DEPRECATEDFixEndpointKeyTypes = function(v10)
        for _, v12 in pairs(v10) do
            for v13, v14 in pairs(v12) do
                if not ((v13 ~= v5.GroupId and v13 ~= v5.UserId) and v13 ~= v5.RoleId) or v13 == v5.RoleRank then
                    v12[v13] = tonumber(v14);
                end;
            end;
        end;
    end,
    _deserializeOne = function(v15, v16)
        local v17 = {};
        local l_ActionKey_0 = v4.ActionKey;
        local v19 = v15[v5.Action];
        local v20;
        if v19 == v5.PlayAction then
            v20 = v4.PlayKey;
        elseif v19 == v5.EditAction then
            v20 = v4.EditKey;
        elseif v19 == v5.AdminAction then
            v20 = v4.EditKey;
        elseif v19 == nil then
            v20 = v4.NoAccessKey;
        else
            error("Unsupported Action: " .. tostring(v19));
            v20 = nil;
        end;
        v17[l_ActionKey_0] = v20;
        l_ActionKey_0 = nil;
        v20 = nil;
        if v16 == v4.UserSubjectKey then
            l_ActionKey_0 = v15[v5.UserName];
            v20 = v15[v5.UserId];
        elseif v16 == v4.GroupSubjectKey then
            l_ActionKey_0 = v15[v5.GroupName];
            v20 = v15[v5.GroupId];
        elseif v16 == v4.RoleSubjectKey then
            l_ActionKey_0 = v15[v5.RoleName];
            v20 = v15[v5.RoleId];
        end;
        v17[v4.SubjectNameKey] = l_ActionKey_0;
        v17[v4.SubjectIdKey] = v20;
        v19 = v15[v5.AllowedPermissions];
        if v16 == v4.UserSubjectKey then
            if not (v19 and v19 ~= "") or v19 == "Play" then
                v17[v4.IsFriendKey] = false;
            else
                v17[v4.IsFriendKey] = true;
            end;
        end;
        if v16 == v4.RoleSubjectKey then
            v17[v4.SubjectRankKey] = v15[v5.RoleRank];
            v17[v4.GroupIdKey] = v15[v5.GroupId];
        end;
        return v17;
    end
};
v21._deserializeAll = function(v22)
    local v23 = {};
    local v24 = {
        [v4.UserSubjectKey] = {},
        [v4.RoleSubjectKey] = {}
    };
    for _, v26 in pairs(v22) do
        local v27;
        if not v26[v5.UserId] then
            if not v26[v5.RoleId] then
                if not v26[v5.GroupId] then
                    error("Could not determine subject type");
                    v27 = nil;
                else
                    v27 = v4.GroupSubjectKey;
                end;
            else
                v27 = v4.RoleSubjectKey;
            end;
        else
            v27 = v4.UserSubjectKey;
        end;
        if v27 == v4.GroupSubjectKey then
            local v28 = v21._deserializeOne(v26, v27);
            v23[v28[v4.SubjectIdKey]] = {
                Name = v28[v4.SubjectNameKey]
            };
        end;
    end;
    for _, v30 in pairs(v22) do
        local v31;
        if not v30[v5.UserId] then
            if not v30[v5.RoleId] then
                if not v30[v5.GroupId] then
                    error("Could not determine subject type");
                    v31 = nil;
                else
                    v31 = v4.GroupSubjectKey;
                end;
            else
                v31 = v4.RoleSubjectKey;
            end;
        else
            v31 = v4.UserSubjectKey;
        end;
        local v32 = v21._deserializeOne(v30, v31);
        local v33 = v32[v4.SubjectIdKey];
        if v31 ~= v4.GroupSubjectKey and (not (v32[v4.SubjectRankKey] == 0) or v32[v4.ActionKey] ~= v4.NoAccessKey) then
            v24[v31][v33] = v32;
        end;
    end;
    return v24, v23;
end;
v21._addOwnerIfMissing = function(v34, v35, v36, v37)
    local v38 = v37 == Enum.CreatorType.User and v5.UserId or v5.GroupId;
    local v39 = false;
    for _, v41 in pairs(v34) do
        if v41[v38] == v36 then
            v39 = true;
            break;
        end;
    end;
    if not v39 then
        if v37 == Enum.CreatorType.User then
            table.insert(v34, {
                [v5.UserId] = v36,
                [v5.UserName] = v35,
                [v5.Action] = v5.EditAction
            });
            return l_Promise_0.new(function(v42)
                v42();
            end);
        else
            table.insert(v34, {
                [v5.GroupId] = v36,
                [v5.GroupName] = v35,
                [v5.Action] = nil
            });
            return v3.Get(v36):andThen(function(v43)
                for _, v45 in pairs(v43) do
                    if v45[v5.RoleId] == 255 then
                        table.insert(v34, v2.Dictionary.join(v45, {
                            [v5.GroupId] = v36,
                            [v5.GroupName] = v35,
                            [v5.Action] = v5.EditAction
                        }));
                    else
                        table.insert(v34, v2.Dictionary.join(v45, {
                            [v5.GroupId] = v36,
                            [v5.GroupName] = v35,
                            [v5.Action] = nil
                        }));
                    end;
                end;
            end);
        end;
    else
        return l_Promise_0.new(function(v46)
            v46();
        end);
    end;
end;
v21.DeserializePermissions = function(v47, v48, v49, v50)
    v21._DEPRECATEDFixEndpointKeyTypes(v47);
    v21._addOwnerIfMissing(v47, v48, v49, v50):await();
    local v51, v52 = v21._deserializeAll(v47);
    return v51, v52;
end;
return v21;


local l_HttpService_0 = game:GetService("HttpService");
local v1 = require(script.Parent.Parent.Parent.Parent.Src.Networking.Http);
local l_webKeys_0 = require(script.Parent.Constants).webKeys;
return {
    Get = function(v3)
        local v4 = {};
        return v1.Request({
            Url = v1.BuildRobloxUrl("groups", "v1/groups/%d/roles", v3),
            Method = "GET"
        }):andThen(function(v5)
            for _, v7 in pairs(l_HttpService_0:JSONDecode(v5).roles) do
                table.insert(v4, {
                    [l_webKeys_0.RoleName] = v7.name,
                    [l_webKeys_0.RoleId] = v7.id,
                    [l_webKeys_0.RoleRank] = v7.rank
                });
            end;
            return v4;
        end);
    end
};


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.PermissionsConstants);
local v2 = require(l_Parent_0.Src.Networking.WebKeyConstants);
local v3 = {
    v1.NoAccessKey,
    v1.PlayKey,
    v1.EditKey
};
local v4 = {};
for v5, v6 in pairs(v3) do
    v4[v6] = v5;
end;
local function _(v7)
    if v7 == v1.UserSubjectKey then
        return v2.UserSubject;
    elseif v7 == v1.GroupSubjectKey then
        return v2.GroupSubject;
    elseif v7 == v1.RoleSubjectKey then
        return v2.RoleSubject;
    else
        error("Invalid SubjectType: " .. tostring(v7));
        return ;
    end;
end;
local function _(v9)
    if v9 == v1.PlayKey then
        return v2.PlayAction;
    elseif v9 == v1.EditKey then
        return v2.EditAction;
    elseif v9 == v1.AdminKey then
        return v2.EditAction;
    elseif v9 == v1.NoAccessKey then
        return nil;
    else
        error("Invalid Action: " .. tostring(v9));
        return ;
    end;
end;
local v53 = {
    _getGroupsForRoles = function(v11, v12)
        local v13 = {};
        for v14, v15 in pairs(v11[v1.RoleSubjectKey]) do
            v13[v14] = v15[v1.GroupIdKey];
        end;
        for v16, v17 in pairs(v12[v1.RoleSubjectKey]) do
            v13[v16] = v17[v1.GroupIdKey];
        end;
        return v13;
    end,
    diffPermissionChanges = function(v18, v19)
        local v20 = {
            [v1.GroupSubjectKey] = {}
        };
        for v21, _ in pairs(v18) do
            v20[v21] = {};
        end;
        for v23, _ in pairs(v19) do
            v20[v23] = {};
        end;
        for v25, v26 in pairs(v18) do
            for v27, v28 in pairs(v26) do
                v20[v25][v27] = {
                    Current = v28[v1.ActionKey]
                };
            end;
        end;
        for v29, v30 in pairs(v19) do
            for v31, v32 in pairs(v30) do
                v20[v29][v31] = v20[v29][v31] or {};
                v20[v29][v31].Changed = v32[v1.ActionKey];
            end;
        end;
        return v20;
    end,
    _resolvePermissionChanges = function(v33, _)
        local v35 = {};
        local v36 = {};
        for v37, v38 in pairs(v33) do
            for v39, v40 in pairs(v38) do
                local v41 = v4[v40.Current] or v4[v1.NoAccessKey];
                local v42 = v4[v40.Changed] or v4[v1.NoAccessKey];
                if v41 < v42 then
                    for v43 = v41 + 1, v42 do
                        local v44 = {};
                        local l_SubjectType_0 = v2.SubjectType;
                        local v46;
                        if v37 == v1.UserSubjectKey then
                            v46 = v2.UserSubject;
                        elseif v37 == v1.GroupSubjectKey then
                            v46 = v2.GroupSubject;
                        elseif v37 == v1.RoleSubjectKey then
                            v46 = v2.RoleSubject;
                        else
                            error("Invalid SubjectType: " .. tostring(v37));
                            v46 = nil;
                        end;
                        v44[l_SubjectType_0] = v46;
                        v44[v2.SubjectId] = v39;
                        l_SubjectType_0 = v2.Action;
                        local v47 = v3[v43];
                        if v47 == v1.PlayKey then
                            v46 = v2.PlayAction;
                        elseif v47 == v1.EditKey then
                            v46 = v2.EditAction;
                        elseif v47 == v1.AdminKey then
                            v46 = v2.EditAction;
                        elseif v47 == v1.NoAccessKey then
                            v46 = nil;
                        else
                            error("Invalid Action: " .. tostring(v47));
                            v46 = nil;
                        end;
                        v44[l_SubjectType_0] = v46;
                        table.insert(v35, v44);
                    end;
                elseif v42 < v41 then
                    for v48 = v41, v42 + 1, -1 do
                        local v49 = {};
                        local l_SubjectType_1 = v2.SubjectType;
                        local v51;
                        if v37 == v1.UserSubjectKey then
                            v51 = v2.UserSubject;
                        elseif v37 == v1.GroupSubjectKey then
                            v51 = v2.GroupSubject;
                        elseif v37 == v1.RoleSubjectKey then
                            v51 = v2.RoleSubject;
                        else
                            error("Invalid SubjectType: " .. tostring(v37));
                            v51 = nil;
                        end;
                        v49[l_SubjectType_1] = v51;
                        v49[v2.SubjectId] = v39;
                        l_SubjectType_1 = v2.Action;
                        local v52 = v3[v48];
                        if v52 == v1.PlayKey then
                            v51 = v2.PlayAction;
                        elseif v52 == v1.EditKey then
                            v51 = v2.EditAction;
                        elseif v52 == v1.AdminKey then
                            v51 = v2.EditAction;
                        elseif v52 == v1.NoAccessKey then
                            v51 = nil;
                        else
                            error("Invalid Action: " .. tostring(v52));
                            v51 = nil;
                        end;
                        v49[l_SubjectType_1] = v51;
                        table.insert(v36, v49);
                    end;
                end;
            end;
        end;
        return v35, v36;
    end
};
v53.SerializePermissions = function(v54, v55)
    local v56, v57 = v53._resolvePermissionChanges(v53.diffPermissionChanges(v54, v55), (v53._getGroupsForRoles(v54, v55)));
    return v56, v57;
end;
return v53;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Keys.loadingInProgress);
local v4 = {
    CachedSearchResults = {},
    SearchText = ""
};
return v1.createReducer(v4, {
    ResetStore = function(_, _)
        return v4;
    end,
    LoadedWebResults = function(v7, v8)
        return v2.Dictionary.join(v7, {
            CachedSearchResults = v2.Dictionary.join(v7.CachedSearchResults, {
                [v8.key] = not not v8.success and v8.results or nil
            })
        });
    end,
    LoadWebResults = function(v9, v10)
        return v2.Dictionary.join(v9, {
            CachedSearchResults = v2.Dictionary.join(v9.CachedSearchResults, {
                [v10.searchTerm] = v3
            })
        });
    end,
    SearchTextChanged = function(v11, v12)
        return v2.Dictionary.join(v11, {
            SearchText = v12.text
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return v1.createReducer({
    creatorType = nil,
    creatorId = nil,
    creatorName = nil,
    creatorFriends = nil,
    groupOwnerId = nil,
    groupOwnerName = nil
}, {
    ResetStore = function(_, _)
        return {};
    end,
    SetCreatorType = function(v5, v6)
        return v2.Dictionary.join(v5, {
            creatorType = v6.creatorType
        });
    end,
    SetCreatorId = function(v7, v8)
        return v2.Dictionary.join(v7, {
            creatorId = v8.creatorId
        });
    end,
    SetCreatorName = function(v9, v10)
        return v2.Dictionary.join(v9, {
            creatorName = v10.creatorName
        });
    end,
    SetCreatorFriends = function(v11, v12)
        assert(v11.creatorType == Enum.CreatorType.User, "Setting friends in non-user owned game");
        return v2.Dictionary.join(v11, {
            creatorFriends = v12.creatorFriends
        });
    end,
    SetGroupOwnerId = function(v13, v14)
        assert(v13.creatorType == Enum.CreatorType.Group, "Setting group owner id in non-group owned game");
        return v2.Dictionary.join(v13, {
            groupOwnerId = v14.groupOwnerId
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v4 = require(l_Actions_0.SetGroupMetadata);
local v5 = require(l_Actions_0.SetCurrentGroupMetadata);
local v6 = require(l_Parent_0.Src.Util.IsEqualCheck);
local function _()
    return {
        CurrentGroupMetadata = {}
    };
end;
return v1.createReducer({
    CurrentGroupMetadata = {}
}, {
    ResetStore = function(_, _)
        return {
            CurrentGroupMetadata = {}
        };
    end,
    [v4.name] = function(v10, v11)
        local l_newGroupMetadata_0 = v11.newGroupMetadata;
        assert(type(l_newGroupMetadata_0) == "table");
        if v6(v10.CurrentGroupMetadata, l_newGroupMetadata_0) then
            l_newGroupMetadata_0 = v2.None;
        end;
        return v2.Dictionary.join(v10, {
            NewGroupMetadata = l_newGroupMetadata_0
        });
    end,
    [v5.name] = function(v13, v14)
        return v2.Dictionary.join(v13, {
            CurrentGroupMetadata = v14.currentGroupMetadata
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Actions.SetGroupRolePermissions);
local function _()
    return {
        PermissionsByRole = {}
    };
end;
return v1.createReducer({
    PermissionsByRole = {}
}, {
    ResetStore = function(_, _)
        return {
            PermissionsByRole = {}
        };
    end,
    [v3.name] = function(v7, v8)
        return v2.Dictionary.join(v7, {
            PermissionsByRole = v8.groupRolePermissions
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return v1.createReducer({}, {
    ResetStore = function(_, _)
        return {};
    end,
    [require(l_Parent_0.Src.Actions.SetLoadState).name] = function(v5, v6)
        return v2.Dictionary.join(v5, {
            CurrentLoadState = v6.loadState
        });
    end
});


return (require(script.Parent.Parent.Parent.Packages.Rodux).combineReducers({
    GameOwnerMetadata = require(script.Parent.GameOwnerMetadata),
    Permissions = require(script.Parent.Permissions),
    GroupMetadata = require(script.Parent.GroupMetadata),
    GroupRolePermissions = require(script.Parent.GroupRolePermissions),
    CollaboratorSearch = require(script.Parent.CollaboratorSearch),
    LoadState = require(script.Parent.LoadState),
    SaveState = require(script.Parent.SaveState)
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v4 = require(l_Actions_0.SetUserMinimumAge);
local v5 = require(l_Actions_0.SetUserPermission);
local v6 = require(l_Actions_0.SetCurrentUserPermissions);
local v7 = require(l_Parent_0.Src.Util.IsEqualCheck);
local function _()
    return {
        MinimumAge = 0,
        CurrentPermissions = {}
    };
end;
return v1.createReducer({
    MinimumAge = 0,
    CurrentPermissions = {}
}, {
    ResetStore = function(_, _)
        return {
            MinimumAge = 0,
            CurrentPermissions = {}
        };
    end,
    [v4.name] = function(v11, v12)
        return v2.Dictionary.join(v11, {
            MinimumAge = v12.MinimumAge
        });
    end,
    [v5.name] = function(v13, v14)
        local l_newPermissions_0 = v14.newPermissions;
        assert(type(l_newPermissions_0) == "table");
        if v7(v13.CurrentPermissions, l_newPermissions_0) then
            l_newPermissions_0 = v2.None;
        end;
        return v2.Dictionary.join(v13, {
            NewPermissions = l_newPermissions_0
        });
    end,
    [v6.name] = function(v16, v17)
        return v2.Dictionary.join(v16, {
            CurrentPermissions = v17.currentPermissions
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return v1.createReducer({}, {
    ResetStore = function(_, _)
        return {};
    end,
    [require(l_Parent_0.Src.Actions.SetSaveState).name] = function(v5, v6)
        return v2.Dictionary.join(v5, {
            CurrentSaveState = v6.saveState
        });
    end
});