local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_DropdownMenu_0 = v3.UI.DropdownMenu;
local v5 = require(l_Parent_0.Core.Components.AssetConfiguration.Permissions.DetailedDropdownItem);
local l_IconButton_0 = v3.UI.IconButton;
local l_Tooltip_0 = v3.UI.Tooltip;
local l_Util_0 = l_Parent_0.Core.Util;
local v9 = require(l_Util_0.Images);
local v10 = require(l_Util_0.Constants);
local v11 = require(l_Parent_0.Core.Components.AssetConfiguration.Permissions.CollaboratorThumbnail);
local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v15 = v2.PureComponent:extend("CollaboratorItem");
local function v17(v16)
    return v2.createElement(v11, {
        Size = UDim2.new(0, 50, 0, 50),
        LayoutOrder = v16.LayoutOrder or 0,
        Image = not not v16.IsLoadedThumbnail and v16.CollaboratorIcon or v16.DefaultIcon,
        UseMask = v16.UseMask,
        IsLoadedThumbnail = v16.IsLoadedThumbnail
    });
end;
v15.init = function(v18)
    v18.state = {
        assetFetchStatus = nil,
        showDropdown = false
    };
    v18.isMounted = false;
    v18.onItemActivated = function(v19)
        local l_props_0 = v18.props;
        if not (not l_props_0.Enabled or not l_props_0.PermissionChanged) then
            l_props_0.PermissionChanged(v19.Key);
        end;
        v18.closeDropdown();
    end;
    v18.onDropdownRenderItem = function(v21, _, v23)
        return v2.createElement(v5, {
            Key = v21.Key,
            Description = v21.Description,
            OnActivated = v23,
            Selected = v21.Key == v18.props.SelectedItem,
            Title = v21.Display
        });
    end;
    v18.openDropdown = function()
        v18:setState({
            showDropdown = true
        });
    end;
    v18.closeDropdown = function()
        v18:setState({
            showDropdown = false
        });
    end;
    v18.onDelete = function()
        local l_props_1 = v18.props;
        if not (not l_props_1.Enabled or not l_props_1.Removed) then
            l_props_1.Removed();
        end;
    end;
end;
v15.didMount = function(v25)
    v25.isMounted = true;
    spawn(function()
        l_ContentProvider_0:PreloadAsync({
            v25.props.CollaboratorIcon
        }, function(_, v27)
            if v25.isMounted then
                v25:setState({
                    assetFetchStatus = v27
                });
            end;
        end);
    end);
end;
v15.willUnmount = function(v28)
    v28.isMounted = false;
end;
v15.render = function(v29)
    local l_props_2 = v29.props;
    local l_Stylizer_0 = l_props_2.Stylizer;
    l_props_2.Items = l_props_2.Items or {};
    local l_Removable_0 = l_props_2.Removable;
    if l_Removable_0 then
        l_Removable_0 = false;
        if #l_props_2.Items > 0 then
            l_Removable_0 = not l_props_2.IsLoading;
        end;
    end;
    local v33 = v29.state.assetFetchStatus == Enum.AssetFetchStatus.Success;
    local v34 = nil;
    v34 = if l_props_2.SubjectType == Enum.CreatorType.User then v9.DEFAULT_USER_THUMBNAIL else v9.DEFAULT_GROUP_THUMBNAIL;
    local l_createElement_0 = v2.createElement;
    local v36 = "Frame";
    local v37 = {
        Size = UDim2.new(1, 0, 0, 60),
        LayoutOrder = l_props_2.LayoutOrder or 0,
        BackgroundTransparency = 1,
        BorderSizePixel = 0
    };
    local v38 = {};
    local l_createElement_1 = v2.createElement;
    local v40 = "Frame";
    local v41 = {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundTransparency = 1,
        BackgroundColor3 = l_Stylizer_0.assetConfig.packagePermissions.backgroundColor
    };
    local v42 = {
        Padding = v2.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, 6),
            PaddingRight = UDim.new(0, 6),
            PaddingTop = UDim.new(0, 10),
            PaddingBottom = UDim.new(0, 10)
        })
    };
    local v43 = false;
    if l_props_2.CollaboratorIcon ~= nil then
        v43 = v2.createElement(v17, {
            LayoutOrder = 0,
            Enabled = l_props_2.Enabled,
            UseMask = l_props_2.UseMask,
            CollaboratorIcon = l_props_2.CollaboratorIcon,
            DefaultIcon = v34,
            IsLoadedThumbnail = v33
        });
    end;
    v42.Icon = v43;
    v42.Labels = v2.createElement("Frame", {
        Size = UDim2.new(1, -290, 0, 50),
        Position = UDim2.new(0, 80, 0, 0),
        LayoutOrder = l_props_2.LayoutOrder or 0,
        BackgroundTransparency = 1
    }, {
        PrimaryLabel = v2.createElement("TextLabel", {
            Size = UDim2.new(1, 0, not l_props_2.SecondaryText and 1 or 0.5, 0),
            Text = l_props_2.CollaboratorName or "",
            TextXAlignment = Enum.TextXAlignment.Left,
            Font = v10.FONT,
            TextSize = v10.FONT_SIZE_TITLE,
            TextColor3 = l_Stylizer_0.assetConfig.packagePermissions.subTextColor,
            TextTruncate = Enum.TextTruncate.AtEnd,
            BackgroundTransparency = 1
        })
    });
    v42.DropdownFrame = v2.createElement("Frame", {
        AnchorPoint = Vector2.new(1, 0),
        BackgroundTransparency = 1,
        Position = UDim2.new(1, -80, 0, 0),
        Size = UDim2.new(0, 120, 0, 50)
    }, {
        Dropdown = v2.createElement(l_DropdownMenu_0, {
            Hide = not (l_props_2.Enabled and #l_props_2.Items > 0) or not v29.state.showDropdown,
            OnFocusLost = function()
                v29.closeDropdown();
            end,
            Items = l_props_2.Items,
            OnItemActivated = v29.onItemActivated,
            OnRenderItem = v29.onDropdownRenderItem,
            Width = 300
        })
    });
    v42.Dropdown = v2.createElement(l_IconButton_0, {
        Disabled = not (l_props_2.Enabled and #l_props_2.Items > 0),
        RightIcon = "rbxasset://textures/StudioToolbox/ArrowDownIconWhite.png",
        Text = l_props_2.Action,
        OnClick = function()
            v29.openDropdown();
        end,
        AnchorPoint = Vector2.new(1, 0),
        Position = UDim2.new(1, -80, 0, 0),
        Size = UDim2.new(0, 120, 0, 50)
    }, {
        TextPadding = v2.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, 4)
        })
    });
    v42.Delete = l_Removable_0 and v2.createElement(l_IconButton_0, {
        AnchorPoint = Vector2.new(1, 0),
        BackgroundStyle = "RoundBox",
        IconColor = l_Stylizer_0.assetConfig.packagePermissions.collaboratorItem.deleteButton,
        LeftIcon = v9.CLOSE_ICON,
        OnClick = v29.onDelete,
        Position = UDim2.new(1, 0, 0, 0),
        Size = UDim2.new(0, 50, 0, 50)
    });
    v42.Tooltip = l_props_2.TooltipText and v2.createElement(l_Tooltip_0, {
        Text = l_props_2.TooltipText
    });
    v38.Contents = l_createElement_1(v40, v41, v42);
    return l_createElement_0(v36, v37, v38);
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v15));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_Util_0 = l_Parent_0.Core.Util;
local v5 = require(l_Util_0.Constants);
local v6 = require(l_Util_0.Images);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_TextService_0 = game:GetService("TextService");
local l_LayoutOrderIterator_0 = v3.Util.LayoutOrderIterator;
local l_DropdownMenu_0 = v3.UI.DropdownMenu;
local l_LoadingIndicator_0 = v3.UI.LoadingIndicator;
local v13 = require(l_Parent_0.Core.Components.AssetConfiguration.Permissions.CollaboratorSearchItem);
local v14 = v2.PureComponent:extend("CollaboratorSearchBar");
local function _(v15)
    return not not v15 and v15:gsub("\n", " ") or "";
end;
v14.init = function(v17)
    v17.state = {
        text = "",
        isFocused = false,
        isContainerHovered = false,
        isClearButtonHovered = false,
        showDropdown = false,
        dropdownItem = nil,
        lastDelay = {},
        lastResults = {},
        mergedItems = {}
    };
    v17.textBoxRef = v2.createRef();
    v17.requestSearch = function()
        v17.props.onSearchRequested(v17.state.text);
    end;
    v17.onContainerHovered = function()
        v17:setState({
            isContainerHovered = true
        });
    end;
    v17.onContainerHoverEnded = function()
        v17:setState({
            isContainerHovered = false
        });
    end;
    v17.onTextChanged = function(v18)
        local l_Text_0 = v18.Text;
        local v20 = not not l_Text_0 and l_Text_0:gsub("\n", " ") or "";
        l_Text_0 = v17.textBoxRef.current;
        if v17.state.text ~= v20 then
            v17:setState({
                text = v20
            });
            if v17.props.onTextChanged then
                v17.props.onTextChanged(v20);
            end;
            local v21 = {};
            v17.state.lastDelay = v21;
            delay(0.5, function()
                if v21 == v17.state.lastDelay and v20 ~= "" then
                    v17.requestSearch();
                    if not v17.state.showDropdown and next(v17.state.mergedItems) ~= nil then
                        v17.showDropdown();
                    end;
                end;
            end);
            if l_Text_0.AbsoluteSize.x < l_TextService_0:GetTextSize(v20, l_Text_0.TextSize, l_Text_0.Font, Vector2.new(math.huge, math.huge)).x then
                l_Text_0.TextXAlignment = Enum.TextXAlignment.Right;
                return ;
            else
                l_Text_0.TextXAlignment = Enum.TextXAlignment.Left;
            end;
        end;
    end;
    v17.onTextBoxFocused = function(_)
        local l_current_0 = v17.textBoxRef.current;
        v17:setState({
            isFocused = true
        });
        if not v17.props.Enabled then
            l_current_0:ReleaseFocus();
        end;
        if next(v17.state.mergedItems) ~= nil then
            v17.showDropdown();
        end;
    end;
    v17.onTextBoxFocusLost = function(_, _, _)
        v17:setState({
            isFocused = false,
            isContainerHovered = false
        });
    end;
    v17.onClearButtonHovered = function()
        v17:setState({
            isClearButtonHovered = true
        });
    end;
    v17.onClearButtonHoverEnded = function()
        v17:setState({
            isClearButtonHovered = false
        });
    end;
    v17.onClearButtonClicked = function()
        local l_current_1 = v17.textBoxRef.current;
        v17:setState({
            isFocused = true
        });
        l_current_1.Text = "";
        l_current_1:CaptureFocus();
        l_current_1.TextXAlignment = Enum.TextXAlignment.Left;
        v17.onClearButtonHoverEnded();
    end;
    v17.onItemClicked = function(v28)
        v17.props.OnItemClicked(v28.Key);
        v17.hideDropdown();
    end;
    v17.showDropdown = function()
        v17:setState({
            showDropdown = true
        });
    end;
    v17.hideDropdown = function()
        if not v17.state.isFocused then
            v17:setState({
                showDropdown = false,
                dropdownItem = v2.None
            });
        end;
    end;
    if v17.props.onTextChanged then
        v17.props.onTextChanged("");
    end;
end;
v14.mergeResultsTable = function(v29, v30)
    local v31 = {};
    if next(v30) == nil then
        if not v29.props.LoadingMore and v29.state.text ~= "" then
            table.insert(v31, "NoResults");
        end;
    else
        local v32 = {};
        for v33, _ in pairs(v30) do
            table.insert(v32, v33);
        end;
        table.sort(v32, function(v35, v36)
            return v30[v35].LayoutOrder < v30[v36].LayoutOrder;
        end);
        for _, v38 in ipairs(v32) do
            table.insert(v31, v38);
            for _, v40 in ipairs(v30[v38]) do
                table.insert(v31, v40);
            end;
        end;
    end;
    if v29.props.LoadingMore then
        table.insert(v31, "LoadingIndicator");
    end;
    return v31;
end;
v14.onRenderItem = function(v41, v42, v43, v44, v45, _)
    local l_props_0 = v41.props;
    local l_HeaderHeight_0 = l_props_0.HeaderHeight;
    local l_NoResultsText_0 = l_props_0.NoResultsText;
    local v50 = l_props_0.TextPadding or 16;
    local l_searchBar_0 = v45.assetConfig.packagePermissions.searchBar;
    if (typeof(v42) == "string" and v42 ~= "LoadingIndicator") and v42 ~= "NoResults" then
        return v2.createElement("TextLabel", {
            BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
            BorderSizePixel = 0,
            LayoutOrder = v43,
            Font = v5.FONT,
            Size = UDim2.new(1, 0, 0, l_HeaderHeight_0),
            Text = v42,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextWrapped = true,
            TextSize = 16,
            TextColor3 = l_searchBar_0.placeholderText
        }, {
            Padding = v2.createElement("UIPadding", {
                PaddingLeft = UDim.new(0, v50)
            })
        });
    elseif v42 == "NoResults" then
        return v2.createElement("TextLabel", {
            BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
            BorderSizePixel = 0,
            Font = v5.FONT,
            LayoutOrder = v43,
            Text = l_NoResultsText_0,
            TextSize = v5.FONT_SIZE_TITLE,
            TextColor3 = v45.assetConfig.textColor,
            TextWrapped = true,
            TextXAlignment = Enum.TextXAlignment.Left,
            Size = UDim2.new(1, 0, 0, 50)
        }, {
            Padding = v2.createElement("UIPadding", {
                PaddingLeft = UDim.new(0, v50)
            })
        });
    elseif v42 == "LoadingIndicator" then
        return v2.createElement("Frame", {
            BackgroundColor3 = l_searchBar_0.dropDown.backgroundColor,
            BorderSizePixel = 0,
            LayoutOrder = v43,
            Size = UDim2.new(1, 0, 0, 50)
        }, {
            LoadingIndicator = v2.createElement(l_LoadingIndicator_0, {
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = UDim2.new(0.5, 0, 0.5, 0),
                ZIndex = 3
            })
        });
    else
        return v2.createElement(v13, {
            Icon = v42.Icon,
            LayoutOrder = v43,
            Name = v42.Name,
            OnActivated = v44,
            Size = UDim2.new(1, 0, 0, 50),
            TextPadding = v50
        });
    end;
end;
v14.render = function(v52)
    local l_props_1 = v52.props;
    local l_state_0 = v52.state;
    local l_Stylizer_0 = l_props_1.Stylizer;
    local v56 = l_LayoutOrderIterator_0.new();
    local v57 = l_props_1.LayoutOrder or 0;
    local l_text_0 = l_state_0.text;
    local v59 = l_state_0.isFocused and l_props_1.Enabled;
    local v60 = l_state_0.isContainerHovered and l_props_1.Enabled;
    local l_isClearButtonHovered_0 = l_state_0.isClearButtonHovered;
    local l_searchBar_1 = l_Stylizer_0.assetConfig.packagePermissions.searchBar;
    local v63 = nil;
    v63 = if not v59 then if v60 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 _ = l_props_1.NoResultsText;
    local l_showDropdown_0 = l_state_0.showDropdown;
    local v68;
    v68 = (v52.textBoxRef and v52.textBoxRef.current) and v68.Parent;
    local v69 = nil;
    if v68 then
        local l_AbsolutePosition_0 = v68.AbsolutePosition;
        local v71 = l_AbsolutePosition_0 + v68.AbsoluteSize;
        v69 = Rect.new(l_AbsolutePosition_0.X, l_AbsolutePosition_0.Y, v71.X, v71.Y);
    end;
    local v72 = l_props_1.Results or {};
    local _ = l_props_1.HeaderHeight;
    local l_ItemHeight_0 = l_props_1.ItemHeight;
    local l_MaxItems_0 = l_props_1.MaxItems;
    local _ = l_props_1.ShowRibbon;
    local v77 = l_props_1.TextPadding or 16;
    local _ = l_props_1.ScrollBarPadding;
    local _ = l_props_1.ScrollBarThickness;
    if not (l_MaxItems_0 and l_MaxItems_0 * l_ItemHeight_0) then
        local _ = nil;
    end;
    local _ = l_state_0.dropdownItem;
    if l_state_0.lastResults ~= v72 then
        l_state_0.mergedItems = v52:mergeResultsTable(v72);
        l_state_0.lastResults = v72;
    end;
    return v2.createElement("Frame", {
        AutomaticSize = Enum.AutomaticSize.XY,
        LayoutOrder = v57,
        BackgroundColor3 = l_Stylizer_0.inputFields.backgroundColor,
        BorderSizePixel = 0
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        Background = v2.createElement("ImageLabel", {
            AutomaticSize = Enum.AutomaticSize.XY,
            BackgroundTransparency = 1,
            Image = v6.ROUNDED_BORDER_IMAGE,
            ImageColor3 = v63,
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = v5.ROUNDED_FRAME_SLICE,
            [v2.Event.MouseEnter] = v52.onContainerHovered,
            [v2.Event.MouseMoved] = v52.onContainerHovered,
            [v2.Event.MouseLeave] = v52.onContainerHoverEnded
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                SortOrder = Enum.SortOrder.LayoutOrder,
                FillDirection = Enum.FillDirection.Horizontal
            }),
            TextBox = v2.createElement("TextBox", {
                Font = v5.FONT,
                TextSize = v5.FONT_SIZE_TITLE,
                TextColor3 = l_Stylizer_0.assetConfig.textColor,
                LayoutOrder = v56:getNextOrder(),
                Size = UDim2.new(1, -80, 0, 40),
                BackgroundTransparency = 1,
                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_0.warningColor or l_searchBar_1.placeholderText,
                [v2.Ref] = v52.textBoxRef,
                [v2.Change.Text] = v52.onTextChanged,
                [v2.Event.Focused] = v52.onTextBoxFocused,
                [v2.Event.FocusLost] = v52.onTextBoxFocusLost
            }, {
                TextPadding = v2.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, v77)
                }),
                Dropdown = v2.createElement(l_DropdownMenu_0, {
                    Hide = not (l_showDropdown_0 and v68),
                    Items = v52.state.mergedItems,
                    OnFocusLost = v52.hideDropdown,
                    OnItemActivated = v52.onItemClicked,
                    OnRenderItem = function(v82, v83, v84)
                        return v52:onRenderItem(v82, v83, v84, l_Stylizer_0, v69);
                    end,
                    Width = not not v69 and v69.Width or nil
                })
            }),
            ClearButtonFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                LayoutOrder = v56:getNextOrder(),
                Size = UDim2.new(0, 40, 0, 40)
            }, {
                ClearButton = v2.createElement("ImageButton", {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    Size = UDim2.new(0, 24, 0, 24),
                    BackgroundTransparency = 1,
                    Visible = l_text_0 ~= "",
                    Image = not not l_isClearButtonHovered_0 and v6.CLEAR_ICON_HOVER or v6.CLEAR_ICON,
                    ImageColor3 = l_searchBar_1.clearButton.image,
                    [v2.Event.MouseEnter] = v52.onClearButtonHovered,
                    [v2.Event.MouseMoved] = v52.onClearButtonHovered,
                    [v2.Event.MouseLeave] = v52.onClearButtonHoverEnded,
                    [v2.Event.MouseButton1Down] = v52.onClearButtonClicked
                })
            }),
            ImageFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                LayoutOrder = v56:getNextOrder(),
                Size = UDim2.new(0, 40, 0, 40)
            }, {
                Image = v2.createElement("ImageLabel", {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    Size = UDim2.new(0, 20, 0, 20),
                    BackgroundTransparency = 1,
                    Image = v6.SEARCH_ICON,
                    ImageColor3 = l_Stylizer_0.assetConfig.packagePermissions.searchBar.searchIcon
                })
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v14));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Parent_0.Core.Util.Constants);
local v4 = require(l_Packages_0.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Button_0 = v4.UI.Button;
local v8 = v2.PureComponent:extend("CollaboratorSearchItem");
v8.render = function(v9)
    local l_props_0 = v9.props;
    local l_IsHovered_0 = l_props_0.IsHovered;
    local l_Icon_0 = l_props_0.Icon;
    local l_Name_0 = l_props_0.Name;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_OnActivated_0 = l_props_0.OnActivated;
    local l_Size_0 = l_props_0.Size;
    local l_TextPadding_0 = l_props_0.TextPadding;
    local l_Stylizer_0 = v9.props.Stylizer;
    local l_searchBar_0 = l_Stylizer_0.assetConfig.packagePermissions.searchBar;
    return v2.createElement(l_Button_0, {
        Size = l_Size_0,
        LayoutOrder = l_LayoutOrder_0,
        OnClick = l_OnActivated_0
    }, {
        Container = v2.createElement("Frame", {
            AutomaticSize = Enum.AutomaticSize.X,
            LayoutOrder = 0,
            BackgroundTransparency = 1
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                SortOrder = Enum.SortOrder.LayoutOrder,
                FillDirection = Enum.FillDirection.Horizontal
            }),
            IconFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                LayoutOrder = 1,
                Size = UDim2.new(0, 50, 0, 50)
            }, {
                SmallIcon = v2.createElement("Frame", {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    BackgroundColor3 = not not l_IsHovered_0 and l_searchBar_0.dropDown.hovered.backgroundColor or l_searchBar_0.dropDown.backgroundColor,
                    BorderSizePixel = 0,
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    Size = UDim2.new(0, 32, 0, 32)
                }, {
                    Icon = l_Icon_0
                })
            }),
            TextLabel = v2.createElement("TextLabel", {
                BackgroundTransparency = 1,
                ClipsDescendants = true,
                Font = v3.FONT,
                LayoutOrder = 2,
                Size = UDim2.new(1, -(not l_IsHovered_0 and 50 or 100), 0, 50),
                Text = l_Name_0,
                TextColor3 = l_Stylizer_0.assetConfig.textColor,
                TextSize = v3.FONT_SIZE_TITLE,
                TextWrapped = true,
                TextXAlignment = Enum.TextXAlignment.Left
            }, {
                Padding = v2.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, l_TextPadding_0)
                })
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v8));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Cryo);
local v3 = require(l_Packages_0.Roact);
local v4 = require(l_Packages_0.RoactRodux);
local l_Util_0 = l_Parent_0.Core.Util;
local l_LoadingInProgress_0 = require(l_Util_0.Keys).LoadingInProgress;
local v7 = require(l_Util_0.Urls);
local v8 = require(l_Util_0.Constants);
local v9 = require(l_Util_0.AssetConfigConstants);
local l_Permissions_0 = l_Parent_0.Core.Components.AssetConfiguration.Permissions;
local v11 = require(l_Permissions_0.CollaboratorSearchBar);
local v12 = require(l_Permissions_0.PermissionsConstants);
local v13 = require(l_Permissions_0.CollaboratorThumbnail);
local l_ContextServices_0 = require(l_Packages_0.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v16 = require(l_Parent_0.Core.ContextServices.NetworkContext);
local l_UseViewKey_0 = v12.UseViewKey;
local function v23(v18, v19)
    local v20 = {};
    for _, v22 in pairs(v19) do
        if v22[v12.SubjectNameKey]:lower():find(v18:lower(), 1, true) then
            table.insert(v20, v22);
        end;
    end;
    return v20;
end;
local function _(v24)
    return v24.localUserFriends == l_LoadingInProgress_0;
end;
local function v45(v26, v27, _)
    local _ = v26.cachedSearchResults;
    local l_searchText_0 = v26.searchText;
    local function v35(v31, v32)
        local v33 = v31[v12.SubjectNameKey]:lower();
        local v34 = v32[v12.SubjectNameKey]:lower();
        if v33 == v34 then
            return false;
        elseif v33 == l_searchText_0:lower() then
            return true;
        elseif v34 == l_searchText_0:lower() then
            return false;
        else
            return v33 < v34;
        end;
    end;
    local v36 = {
        Users = {}
    };
    local v37 = {};
    local v38 = {};
    local v39 = typeof(v26.localUserFriends) == "table" and v23(l_searchText_0, v26.localUserFriends) or {};
    table.sort(v39, v35);
    local v40 = false;
    if #v37 > 0 then
        v40 = v37[1][v12.SubjectNameKey]:lower() == l_searchText_0:lower();
    end;
    local v41 = math.min(not v40 and 2 or 1, #v38 + 1);
    for _, v43 in pairs(v39) do
        local v44 = v43[v12.SubjectIdKey];
        if not (not ((not v27 or not v27[v12.UserSubjectKey][v44]) or v27[v12.UserSubjectKey][v44][v12.ActionKey] == v12.NoAccessKey) or v37[v44]) then
            table.insert(v38, v41, v43);
            v41 = v41 + 1;
        end;
    end;
    v36.Users = v38;
    return v36;
end;
local function v52(v46, v47, v48)
    local v49 = nil;
    if v46 == "" then
        return {};
    else
        v49 = {
            Users = {
                LayoutOrder = 0
            }
        };
        for _, v51 in pairs(v47.Users) do
            if v12.MaxSearchResultsPerSubjectType >= #v49.Users + 1 then
                table.insert(v49.Users, {
                    Icon = v3.createElement(v13, {
                        Image = v7.constructRBXThumbUrl(v9.rbxThumbTypes.AvatarHeadShot, v51[v12.SubjectIdKey], v9.rbxThumbSizes.AvatarHeadshotImageSize),
                        Size = UDim2.new(1, 0, 1, 0),
                        UseMask = true
                    }),
                    Name = v51[v12.SubjectNameKey],
                    Key = {
                        Type = v12.UserSubjectKey,
                        Id = v51[v12.SubjectIdKey],
                        Name = v51[v12.SubjectNameKey]
                    }
                });
            else
                break;
            end;
        end;
        return {
            [v48:getText("AssetConfigPackagePermissions", "UsersCollaboratorType")] = if #v49.Users > 0 then v49.Users else nil
        };
    end;
end;
local v53 = v3.PureComponent:extend("CollaboratorSearchWidget");
v53.render = function(v54)
    local l_props_0 = v54.props;
    local l_SearchData_0 = l_props_0.SearchData;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_SearchText_0 = l_SearchData_0.SearchText;
    local v59 = v45(l_SearchData_0, l_props_0.Permissions, l_props_0.GroupMetadata);
    local v60 = l_SearchData_0.localUserFriends == l_LoadingInProgress_0;
    local v61 = -1;
    if l_props_0.GroupMetadata then
        for _, _ in pairs(l_props_0.GroupMetadata) do
            v61 = v61 + 1;
        end;
    end;
    if l_props_0.Permissions[v12.UserSubjectKey] then
        for _, _ in pairs(l_props_0.Permissions[v12.UserSubjectKey]) do
            v61 = v61 + 1;
        end;
    end;
    local v66 = v61 >= 200;
    local function v72(v67, v68, v69, v70)
        local v71 = nil;
        if v67 == v12.UserSubjectKey then
            v71 = v2.Dictionary.join(l_props_0.Permissions, {
                [v67] = v2.Dictionary.join(l_props_0.Permissions[v67], {
                    [v68] = {
                        [v12.SubjectNameKey] = v69,
                        [v12.SubjectIdKey] = v68,
                        [v12.ActionKey] = v70
                    }
                })
            });
        elseif v67 == v12.GroupSubjectKey then
            l_props_0.GroupCollaboratorAdded(v68, v69, v70);
        else
            error("Unsupported type: " .. tostring(v67));
        end;
        if v71 then
            l_props_0.PermissionsChanged(v71);
        end;
    end;
    return v3.createElement("Frame", {
        AutomaticSize = Enum.AutomaticSize.XY,
        BackgroundTransparency = 1,
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        UIListLayout = v3.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 24)
        }),
        Title = v3.createElement("TextLabel", {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = 0,
            Text = l_props_0.Localization:getText("AssetConfigPackagePermissions", "ShareWith"),
            TextXAlignment = Enum.TextXAlignment.Left,
            BackgroundTransparency = 1,
            Font = v8.FONT,
            TextSize = v8.FONT_SIZE_TITLE,
            TextColor3 = l_Stylizer_0.assetConfig.packagePermissions.subTextColor
        }),
        CollaboratorSearchBar = v3.createElement(v11, {
            LayoutOrder = 1,
            Enabled = l_props_0.Enabled and not v66,
            HeaderHeight = 25,
            ErrorText = not not v66 and l_props_0.Localization:getText("AssetConfigPackagePermissions", "TooManyCollaboratorsText", {
                maxNumCollaborators = 200
            }) or nil,
            DefaultText = l_props_0.Localization:getText("AssetConfigPackagePermissions", "SearchbarDefault"),
            NoResultsText = l_props_0.Localization:getText("AssetConfigPackagePermissions", "NoResults"),
            LoadingMore = v60,
            onSearchRequested = function(v73)
                l_props_0.SearchRequested(v54.props.Network.networkInterface, v73, true);
            end,
            onTextChanged = function(v74)
                l_props_0.SearchRequested(v54.props.Network.networkInterface, v74, false);
            end,
            OnItemClicked = function(v75)
                if v75 == nil then
                    print("TODO: enable friends option");
                    return ;
                else
                    v72(v75.Type, v75.Id, v75.Name, l_UseViewKey_0);
                    return ;
                end;
            end,
            Results = v52(l_SearchText_0, v59, l_props_0.Localization)
        })
    });
end;
return v4.connect(function(v76, _)
    return {
        SearchData = {
            searchText = v76.searchText,
            cachedSearchResults = v76.cachedSearchResults,
            localUserFriends = v76.localUserFriends
        }
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Network = v16
})(v53)));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Cryo);
local v3 = require(l_Packages_0.Roact);
local v4 = require(l_Packages_0.Framework);
local v5 = require(l_Parent_0.Core.Util.Images);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v8 = v3.PureComponent:extend("CollaboratorThumbnail");
v8.init = function(v9)
    v9.state = {
        backgroundColor = nil
    };
    local function v11()
        local l_current_0 = v9.ref.current;
        if l_current_0 == nil then
            return ;
        else
            v9:setState({
                backgroundColor = l_current_0.Parent.BackgroundColor3
            });
            return ;
        end;
    end;
    v9.parentChanged = function()
        local l_current_1 = v9.ref.current;
        if l_current_1 == nil then
            return ;
        else
            if v9.colorChanged then
                v9.colorChanged:Disconnect();
                v9.colorChanged = nil;
            end;
            if l_current_1.Parent then
                v9.colorChanged = l_current_1.Parent:GetPropertyChangedSignal("BackgroundColor3"):Connect(v11);
                local l_current_2 = v9.ref.current;
                if l_current_2 == nil then
                    return ;
                else
                    v9:setState({
                        backgroundColor = l_current_2.Parent.BackgroundColor3
                    });
                end;
            end;
            return ;
        end;
    end;
    v9.ref = v3.createRef();
end;
v8.didMount = function(v14)
    v14.parentChangedSignal = v14.ref.current:GetPropertyChangedSignal("Parent"):Connect(function()
        v14.parentChanged();
    end);
    v14.parentChanged();
end;
v8.willUnmount = function(v15)
    if v15.parentChangedSignal then
        v15.parentChangedSignal:Disconnect();
        v15.parentChangedSignal = nil;
    end;
    if v15.colorChanged then
        v15.colorChanged:Disconnect();
        v15.colorChanged = nil;
    end;
end;
v8.render = function(v16)
    local l_Stylizer_0 = v16.props.Stylizer;
    local v18 = v16.props.UseMask or false;
    return v3.createElement("ImageLabel", v2.Dictionary.join(v2.Dictionary.join(v16.props, {
        UseMask = v2.None,
        IsLoadedThumbnail = v2.None,
        Stylizer = v2.None
    }), {
        [v3.Ref] = v16.ref,
        ImageColor3 = not not (v16.props.IsLoadedThumbnail or false) and Color3.new(1, 1, 1) or l_Stylizer_0.assetConfig.packagePermissions.subjectThumbnail.defaultImageColor,
        ImageTransparency = 0,
        BackgroundColor3 = l_Stylizer_0.assetConfig.packagePermissions.subjectThumbnail.backgroundColor,
        BackgroundTransparency = not v18 and 1 or 0,
        BorderSizePixel = 0
    }), {
        Mask = v18 and v3.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 1, 0),
            Image = v5.AVATAR_MASK,
            ImageColor3 = v16.state.backgroundColor
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v8));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local l_Util_0 = l_Parent_0.Core.Util;
local v4 = require(l_Util_0.AssetConfigConstants);
local v5 = require(l_Util_0.Urls);
local v6 = require(l_Util_0.Constants);
local l_ContextServices_0 = require(l_Packages_0.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Permissions_0 = l_Parent_0.Core.Components.AssetConfiguration.Permissions;
local v10 = require(l_Permissions_0.PermissionsConstants);
local v11 = require(l_Permissions_0.CollaboratorItem);
local l_Separator_0 = require(l_Packages_0.Framework).UI.Separator;
local l_deepJoin_0 = require(l_Packages_0.Framework).Util.deepJoin;
local _ = function(v14, v15)
    for _, v17 in pairs(v15) do
        if v17.Key == v14 then
            return false;
        end;
    end;
    return true;
end;
local v19 = v2.PureComponent:extend("CollaboratorsWidget");
v19.init = function(v20)
    v20.userPermissionChanged = function(v21, v22)
        local l_props_0 = v20.props;
        l_props_0.PermissionsChanged((l_deepJoin_0(l_props_0.Permissions, {
            [v10.UserSubjectKey] = {
                [v21] = {
                    [v10.ActionKey] = v22
                }
            }
        })));
    end;
    v20.userRemoved = function(v24)
        local l_props_1 = v20.props;
        l_props_1.PermissionsChanged((l_deepJoin_0(l_props_1.Permissions, {
            [v10.UserSubjectKey] = {
                [v24] = {
                    [v10.ActionKey] = v10.NoAccessKey
                }
            }
        })));
    end;
    v20.getUserCollaboratorPermissions = function()
        local l_props_2 = v20.props;
        if l_props_2.CanManage then
            return {
                {
                    Key = v10.UseViewKey,
                    Display = l_props_2.Localization:getText("AssetConfigPackagePermissions", "UseViewLabel"),
                    Description = l_props_2.Localization:getText("AssetConfigPackagePermissions", "UseViewDescription")
                },
                {
                    Key = v10.EditKey,
                    Display = l_props_2.Localization:getText("AssetConfigPackagePermissions", "EditLabel"),
                    Description = l_props_2.Localization:getText("AssetConfigPackagePermissions", "EditDescription")
                }
            };
        else
            return {};
        end;
    end;
    v20.getLabelForAction = function(v27)
        local l_props_3 = v20.props;
        if v27 == v10.NoAccessKey then
            return l_props_3.Localization:getText("AssetConfigPackagePermissions", "NoAccessLabel");
        elseif v27 == v10.UseViewKey then
            return l_props_3.Localization:getText("AssetConfigPackagePermissions", "UseViewLabel");
        elseif v27 == v10.EditKey then
            return l_props_3.Localization:getText("AssetConfigPackagePermissions", "EditLabel");
        elseif v27 == v10.NoneKey then
            return "";
        else
            error("Unsupported Action: " .. tostring(v27));
            return "";
        end;
    end;
end;
v19.render = function(v29)
    local l_props_4 = v29.props;
    local l_Stylizer_0 = v29.props.Stylizer;
    local v32 = {};
    if l_props_4.Permissions[v10.UserSubjectKey] then
        for v33, v34 in pairs(l_props_4.Permissions[v10.UserSubjectKey]) do
            if not (l_props_4.OwnerType == Enum.CreatorType.User) or l_props_4.OwnerId ~= v33 and v34[v10.ActionKey] ~= v10.NoAccessKey then
                table.insert(v32, {
                    Name = v34[v10.SubjectNameKey],
                    Id = v34[v10.SubjectIdKey],
                    Action = v34[v10.ActionKey]
                });
            end;
        end;
        table.sort(v32, function(v35, v36)
            return v35.Name < v36.Name;
        end);
    end;
    local v37 = {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder
        })
    };
    local v38 = v29.getUserCollaboratorPermissions();
    for v39, v40 in pairs(v32) do
        local v41 = v39 ~= #v32;
        local l_Action_0 = v40.Action;
        local v43;
        for _, v45 in pairs(v38) do
            if v45.Key == l_Action_0 then
                v43 = false;
                goto label0 --[[  true, false  ]];
            end;
        end;
        v43 = true;
        ::label0::;
        v37["User" .. v39] = v2.createElement("Frame", {
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 0, 70),
            LayoutOrder = v39
        }, {
            FirstSeparator = v2.createElement(l_Separator_0, {
                Position = UDim2.new(0.5, 0, 0, 0)
            }),
            CollaboratorItem = v2.createElement(v11, {
                Enabled = l_props_4.Enabled,
                SubjectType = Enum.CreatorType.User,
                CollaboratorName = v40.Name,
                CollaboratorId = v40.Id,
                CollaboratorIcon = v5.constructRBXThumbUrl(v4.rbxThumbTypes.AvatarHeadShot, v40.Id, v4.rbxThumbSizes.AvatarHeadshotImageSize),
                UseMask = true,
                Items = not not v43 and {} or v38,
                Action = v29.getLabelForAction(v40.Action),
                SelectedItem = v40.Action,
                Removable = true,
                Removed = function()
                    v29.userRemoved(v40.Id);
                end,
                PermissionChanged = function(v46)
                    v29.userPermissionChanged(v40.Id, v46);
                end,
                HideLastSeparator = v39 ~= #v32
            }),
            LastSeparator = not v41 and v2.createElement(l_Separator_0, {
                Position = UDim2.new(0.5, 0, 1, -1)
            })
        });
    end;
    return v2.createElement("Frame", {
        AutomaticSize = Enum.AutomaticSize.Y,
        LayoutOrder = l_props_4.LayoutOrder or 0,
        BackgroundTransparency = 1,
        Size = UDim2.new(1, 0, 0, 0)
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 32)
        }),
        Padding = v2.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, v6.PERMISSIONS_UI_EDGE_PADDING)
        }),
        UsersTitle = v2.createElement("TextLabel", {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = 0,
            Font = v6.FONT,
            Text = l_props_4.Localization:getText("AssetConfigPackagePermissions", "UsersCollaboratorType"),
            TextSize = v6.FONT_SIZE_TITLE,
            TextColor3 = l_Stylizer_0.assetConfig.packagePermissions.subTextColor,
            TextXAlignment = Enum.TextXAlignment.Left,
            Visible = #v32 > 0,
            BackgroundTransparency = 1
        }),
        Users = v2.createElement("Frame", {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = 1,
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 0, 0)
        }, v37)
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v19));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Button_0 = v3.UI.Button;
local v7 = require(l_Parent_0.Core.Util.Constants);
local v8 = v2.PureComponent:extend("DetailedDropdownItem");
v8.render = function(v9)
    local l_props_0 = v9.props;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_OnActivated_0 = l_props_0.OnActivated;
    local l_Title_0 = l_props_0.Title;
    local l_Description_0 = l_props_0.Description;
    local l_detailedDropdown_0 = l_props_0.Stylizer.detailedDropdown;
    return v2.createElement(l_Button_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        LayoutOrder = l_LayoutOrder_0,
        OnClick = l_OnActivated_0,
        Size = UDim2.new(1, 0, 0, 60),
        Style = if not l_props_0.Selected then nil else "SelectedDetailedDropdownItem"
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        Padding = v2.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 10),
            PaddingBottom = UDim.new(0, 10)
        }),
        MainTextLabel = v2.createElement("TextLabel", {
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 0, 0),
            Font = v7.FONT,
            TextSize = 20,
            Text = l_Title_0,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextColor3 = not not l_props_0.IsHovered and l_detailedDropdown_0.hovered.displayText or l_detailedDropdown_0.displayText,
            TextWrapped = true,
            LayoutOrder = 0
        }, {
            Padding = v2.createElement("UIPadding", {
                PaddingLeft = UDim.new(0, 10)
            })
        }),
        DescriptionTextLabel = v2.createElement("TextLabel", {
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 0, 0),
            Font = v7.FONT,
            TextSize = 18,
            Text = l_Description_0,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextColor3 = l_detailedDropdown_0.descriptionText,
            TextWrapped = true,
            LayoutOrder = 1
        }, {
            Padding = v2.createElement("UIPadding", {
                PaddingRight = UDim.new(0, 10),
                PaddingLeft = UDim.new(0, 10)
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v8));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Cryo);
local v4 = require(l_Packages_0.Framework);
local l_Util_0 = l_Parent_0.Core.Util;
local v6 = require(l_Util_0.Urls);
local v7 = require(l_Util_0.Images);
local v8 = require(l_Util_0.AssetConfigConstants);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Permissions_0 = l_Parent_0.Core.Components.AssetConfiguration.Permissions;
local v12 = require(l_Permissions_0.CollaboratorItem);
local v13 = require(l_Permissions_0.PermissionsConstants);
local l_ExpandablePane_0 = require(l_Packages_0.Framework).UI.ExpandablePane;
local v15 = require(l_Packages_0.Framework).Util.Spritesheet(v7.ARROW_SPRITESHEET, {
    SpriteSize = 12,
    NumSprites = 4
});
local v16 = v15[2];
local v17 = v15[3];
local function _(v18, v19)
    if v18.Permissions[v13.RoleSubjectKey] then
        local v20 = v18.Permissions[v13.RoleSubjectKey];
        if v20[v19.Id] then
            return v20[v19.Id][v13.PermissionLevelKey] or v13.AssetPermissionLevel;
        else
            return v13.AssetPermissionLevel;
        end;
    else
        return v13.AssetPermissionLevel;
    end;
end;
local function _(v22, v23)
    if v22.Permissions[v13.RoleSubjectKey] then
        if v22.Permissions[v13.RoleSubjectKey][v23.Id] then
            return v22.Permissions[v13.RoleSubjectKey][v23.Id][v13.ActionKey];
        else
            return v13.NoAccessKey;
        end;
    else
        return v13.NoneKey;
    end;
end;
local _ = function(v25, v26)
    for _, v28 in pairs(v26) do
        if v28.Key == v25 then
            return false;
        end;
    end;
    return true;
end;
local v30 = v2.PureComponent:extend("GroupCollaboratorItem");
v30.init = function(v31)
    v31.state = {
        expanded = false,
        hovered = false
    };
    v31.onClick = function()
        if v31.props.Enabled then
            v31:setState({
                expanded = not v31.state.expanded
            });
            return ;
        else
            return ;
        end;
    end;
    v31.getLabelForAction = function(v32)
        local l_props_0 = v31.props;
        if v32 == v13.NoAccessKey then
            return l_props_0.Localization:getText("AssetConfigPackagePermissions", "NoAccessLabel");
        elseif v32 == v13.UseViewKey then
            return l_props_0.Localization:getText("AssetConfigPackagePermissions", "UseViewLabel");
        elseif v32 == v13.EditKey then
            return l_props_0.Localization:getText("AssetConfigPackagePermissions", "EditLabel");
        elseif v32 == v13.NoneKey then
            return "";
        else
            error("Unsupported Action: " .. tostring(v32));
            return "";
        end;
    end;
    v31.getRolesetItems = function()
        local l_props_1 = v31.props;
        if next(l_props_1.Items) == nil then
            return {};
        else
            return (v3.List.join({
                v3.Dictionary.join({
                    Key = v13.NoAccessKey,
                    Display = l_props_1.Localization:getText("AssetConfigPackagePermissions", "NoAccessLabel"),
                    Description = l_props_1.Localization:getText("AssetConfigPackagePermissions", "NoAccessDescription")
                })
            }, l_props_1.Items));
        end;
    end;
end;
v30.render = function(v35)
    local l_props_2 = v35.props;
    local v37 = {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder
        })
    };
    local v38 = false;
    local v39 = false;
    local l_LayoutOrder_0 = l_props_2.LayoutOrder;
    local v41 = not not v35.props.GroupData and v35.props.GroupData.Roles or {};
    table.sort(v41, function(v42, v43)
        return v43.Rank < v42.Rank;
    end);
    local v44 = v35.getRolesetItems();
    local v45 = not l_props_2.Enabled and 0 or 16;
    for v46, v47 in pairs(v41) do
        local v48 = if l_props_2.Permissions[v13.RoleSubjectKey] then if l_props_2.Permissions[v13.RoleSubjectKey][v47.Id] then l_props_2.Permissions[v13.RoleSubjectKey][v47.Id][v13.ActionKey] else v13.NoAccessKey else v13.NoneKey;
        if v46 == 1 then
            v39 = v48;
        end;
        local l_Enabled_0 = l_props_2.Enabled;
        if v47.Name == "Owner" then
            l_Enabled_0 = false;
        end;
        local v50 = nil;
        local l_l_Enabled_0_0 = l_Enabled_0;
        if l_l_Enabled_0_0 then
            local v52;
            if l_props_2.Permissions[v13.RoleSubjectKey] then
                local v53 = l_props_2.Permissions[v13.RoleSubjectKey];
                v52 = if v53[v47.Id] then v53[v47.Id][v13.PermissionLevelKey] or v13.AssetPermissionLevel else v13.AssetPermissionLevel;
            else
                v52 = v13.AssetPermissionLevel;
            end;
            l_l_Enabled_0_0 = v52 == v13.AssetPermissionLevel;
        end;
        l_Enabled_0 = l_l_Enabled_0_0;
        v50 = if l_Enabled_0 then nil else l_props_2.Localization:getText("AssetConfigPackagePermissions", "LockedGroup", {
            roleName = v47.Name
        });
        for _, v55 in pairs(v44) do
            if v55.Key == v48 then
                l_l_Enabled_0_0 = false;
                goto label0 --[[  true, false  ]];
            end;
        end;
        l_l_Enabled_0_0 = true;
        ::label0::;
        v39 = v39 == v48 and (v39 or false);
        v38 = (l_l_Enabled_0_0 or v47.LockedTo) and true or v38;
        v37["Roleset" .. v46] = v2.createElement("Frame", {
            BackgroundTransparency = 1,
            LayoutOrder = v46,
            Size = UDim2.new(1, 0, 0, 60)
        }, {
            v2.createElement("Frame", {
                BackgroundTransparency = 1,
                Position = UDim2.new(0, v45, 0, 0),
                Size = UDim2.new(1, -v45, 0, 1)
            }, {
                v2.createElement(v12, {
                    Enabled = l_Enabled_0,
                    CollaboratorName = v47.Name,
                    CollaboratorId = v47.Id,
                    CollaboratorIcon = nil,
                    Action = v47.LockedTo or v35.getLabelForAction(v48),
                    Items = (l_l_Enabled_0_0 or v47.LockedTo) and {} or v44,
                    SelectedItem = v48,
                    HideLastSeparator = v46 ~= #v41,
                    Removable = false,
                    PermissionChanged = function(v56)
                        if l_props_2.RolePermissionChanged then
                            l_props_2.RolePermissionChanged(v47.Id, v56);
                        end;
                    end,
                    TooltipText = v50
                })
            })
        });
    end;
    if not (v35.state.expanded and v17) then
        local _ = v16;
    end;
    return v2.createElement(l_ExpandablePane_0, {
        AutomaticSize = Enum.AutomaticSize.XY,
        Expanded = l_props_2.Enabled and v35.state.expanded,
        LayoutOrder = l_LayoutOrder_0,
        OnExpandedChanged = v35.onClick,
        HeaderComponent = not not l_props_2.GroupData and v12 or nil,
        HeaderComponentProps = {
            Enabled = false,
            SubjectType = Enum.CreatorType.Group,
            CollaboratorName = l_props_2.GroupData.Name,
            CollaboratorId = l_props_2.GroupData.Id,
            CollaboratorIcon = v6.constructRBXThumbUrl(v8.rbxThumbTypes.GroupIcon, l_props_2.GroupData.Id, v8.rbxThumbSizes.GroupIconImageSize),
            UseMask = false,
            Action = if not v39 then l_props_2.Localization:getText("AssetConfigPackagePermissions", "MultipleLabel") else v35.getLabelForAction(v39),
            Items = not not v38 and {} or l_props_2.Items,
            SecondaryText = l_props_2.SecondaryText,
            Removable = l_props_2.Removable or false,
            Removed = l_props_2.Removed,
            IsLoading = #v41 == 0,
            TooltipText = l_props_2.Localization:getText("AssetConfigPackagePermissions", "GroupOwnedTooltip") .. " " .. (v39 and "" or l_props_2.Localization:getText("AssetConfigPackagePermissions", "MultipleLabelTooltip"))
        }
    }, v37);
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v30));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_Util_0 = l_Parent_0.Core.Util;
local v5 = require(l_Util_0.Urls);
local v6 = require(l_Util_0.Constants);
local v7 = require(l_Util_0.AssetConfigConstants);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Permissions_0 = l_Parent_0.Core.Components.AssetConfiguration.Permissions;
local v11 = require(l_Permissions_0.PermissionsConstants);
local v12 = require(l_Permissions_0.CollaboratorItem);
local v13 = require(l_Permissions_0.GroupCollaboratorItem);
local l_deepJoin_0 = require(l_Packages_0.Framework).Util.deepJoin;
local function v16(v15)
    if v15.CanManage then
        return {
            {
                Key = v11.EditKey,
                Display = v15.Localization:getText("AssetConfigPackagePermissions", "EditLabel"),
                Description = v15.Localization:getText("AssetConfigPackagePermissions", "EditDescription")
            }
        };
    else
        return {};
    end;
end;
local function _()
    return {};
end;
local v18 = v2.PureComponent:extend("PackageOwnerWidget");
v18.init = function(v19)
    v19.rolePermissionChanged = function(v20, v21)
        local l_props_0 = v19.props;
        l_props_0.PermissionsChanged((l_deepJoin_0(l_props_0.Permissions, {
            [v11.RoleSubjectKey] = {
                [v20] = {
                    [v11.ActionKey] = v21
                }
            }
        })));
    end;
end;
v18.render = function(v23)
    local l_props_1 = v23.props;
    local l_Stylizer_0 = l_props_1.Stylizer;
    local _ = nil;
    return v2.createElement("Frame", {
        AutomaticSize = Enum.AutomaticSize.XY,
        BackgroundTransparency = 1,
        LayoutOrder = l_props_1.LayoutOrder or 0,
        Size = UDim2.new(1, 0, 0, 0)
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        Title = v2.createElement("TextLabel", {
            Font = v6.FONT,
            TextSize = v6.FONT_SIZE_TITLE,
            TextColor3 = l_Stylizer_0.assetConfig.packagePermissions.subTextColor,
            LayoutOrder = 0,
            Text = l_props_1.Localization:getText("AssetConfigPackagePermissions", "PackageCreator"),
            TextXAlignment = Enum.TextXAlignment.Left,
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 50, 0, 50)
        }),
        Owner = if l_props_1.OwnerType == Enum.CreatorType.User then v2.createElement(v12, {
            LayoutOrder = 1,
            Removable = false,
            SubjectType = Enum.CreatorType.User,
            CollaboratorName = l_props_1.OwnerName,
            CollaboratorId = l_props_1.OwnerId,
            CollaboratorIcon = v5.constructRBXThumbUrl(v7.rbxThumbTypes.AvatarHeadShot, l_props_1.OwnerId, v7.rbxThumbSizes.AvatarHeadshotImageSize),
            UseMask = true,
            Action = l_props_1.Localization:getText("AssetConfigPackagePermissions", "OwnerLabel"),
            Enabled = l_props_1.Enabled,
            Items = {},
            RolePermissionChanged = nil
        }) else v2.createElement(v13, {
            LayoutOrder = 1,
            Removable = false,
            GroupData = l_props_1.GroupMetadata,
            Enabled = l_props_1.Enabled,
            Items = v16(l_props_1),
            RolePermissionChanged = v23.rolePermissionChanged,
            Permissions = l_props_1.Permissions
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v18));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.RoactRodux);
local v4 = require(l_Packages_0.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_LayoutOrderIterator_0 = v4.Util.LayoutOrderIterator;
local l_ScrollingFrame_0 = v4.UI.ScrollingFrame;
local l_Separator_0 = require(l_Packages_0.Framework).UI.Separator;
local l_Permissions_0 = l_Parent_0.Core.Components.AssetConfiguration.Permissions;
local v11 = require(l_Permissions_0.PackageOwnerWidget);
local v12 = require(l_Permissions_0.CollaboratorSearchWidget);
local v13 = require(l_Permissions_0.CollaboratorsWidget);
local v14 = require(l_Permissions_0.PermissionsConstants);
local v15 = require(l_Parent_0.Core.Util.Constants);
local v16 = require(l_Parent_0.Core.Thunks.SearchCollaborators);
local v17 = require(l_Parent_0.Core.Actions.SetCollaborators);
local v18 = require(l_Parent_0.Core.Actions.SetGroupMetadata);
local v19 = require(l_Parent_0.Core.Actions.AddChange);
local v20 = v2.PureComponent:extend("Permissions");
v20.init = function(v21)
    v21.state = {
        OwnerType = Enum.CreatorType[v21.props.Owner.type]
    };
end;
v20.render = function(v22)
    local l_Stylizer_0 = v22.props.Stylizer;
    local v24 = l_LayoutOrderIterator_0.new();
    local v25 = true;
    if v22.props.CurrentUserPackagePermission ~= v14.OwnKey then
        v25 = v22.props.CurrentUserPackagePermission == v14.EditKey;
    end;
    local v26 = v22.props.CurrentUserPackagePermission == v14.OwnKey;
    local v27 = v22.state.OwnerType == Enum.CreatorType.User;
    return v2.createElement(l_ScrollingFrame_0, {
        AutomaticCanvasSize = Enum.AutomaticSize.Y,
        EnableScrollBarBackground = true,
        LayoutOrder = v22.props.LayoutOrder,
        Size = v22.props.Size
    }, {
        Padding = v2.createElement("UIPadding", {
            PaddingTop = UDim.new(0, v15.PERMISSIONS_UI_EDGE_PADDING),
            PaddingBottom = UDim.new(0, v15.PERMISSIONS_UI_EDGE_PADDING),
            PaddingLeft = UDim.new(0, v15.PERMISSIONS_UI_EDGE_PADDING),
            PaddingRight = UDim.new(0, v15.PERMISSIONS_UI_EDGE_PADDING)
        }),
        UIListLayout = v2.createElement("UIListLayout", {
            Padding = UDim.new(0, v15.PERMISSIONS_TAB_LIST_PADDING),
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        OwnerWidget = v2.createElement(v11, {
            LayoutOrder = v24:getNextOrder(),
            Enabled = true,
            OwnerName = v22.props.Owner.username,
            OwnerId = v22.props.Owner.targetId,
            OwnerType = v22.state.OwnerType,
            CanManage = v26,
            GroupMetadata = v22.props.GroupMetadata,
            Permissions = v22.props.Permissions,
            PermissionsChanged = v22.props.PermissionsChanged
        }),
        Separator = v2.createElement(l_Separator_0, {
            LayoutOrder = v24:getNextOrder()
        }),
        SearchbarWidget = (v26 and v27) and v2.createElement(v12, {
            LayoutOrder = v24:getNextOrder(),
            Enabled = true,
            GroupMetadata = v22.props.GroupMetadata,
            SearchRequested = v22.props.SearchRequested,
            SearchData = v22.props.SearchData,
            Permissions = v22.props.Permissions,
            PermissionsChanged = v22.props.PermissionsChanged
        }),
        RevokedWarningMessage = v26 and v2.createElement("TextLabel", {
            LayoutOrder = v24:getNextOrder(),
            Size = UDim2.new(1, 0, 0, v15.FONT_SIZE_MEDIUM * 2),
            Text = if not v27 then v22.props.Localization:getText("AssetConfigPackagePermissions", "GroupOwnedWarningAllVersions") else v22.props.Localization:getText("AssetConfigPackagePermissions", "UserOwnedWarningAllVersions"),
            TextXAlignment = Enum.TextXAlignment.Left,
            Font = v15.FONT,
            TextSize = v15.FONT_SIZE_MEDIUM,
            TextColor3 = l_Stylizer_0.assetConfig.packagePermissions.subTextColor,
            TextWrapped = true,
            BackgroundTransparency = 1
        }),
        CollaboratorListWidget = (v25 and v27) and v2.createElement(v13, {
            LayoutOrder = v24:getNextOrder(),
            Enabled = true,
            OwnerId = v22.props.Owner.targetId,
            OwnerType = v22.state.OwnerType,
            CanManage = v26,
            GroupMetadata = v22.props.GroupMetadata,
            Permissions = v22.props.Permissions,
            PermissionsChanged = v22.props.PermissionsChanged,
            GroupMetadataChanged = v22.props.GroupMetadataChanged
        })
    });
end;
return v3.connect(function(v28, v29)
    local v30 = {};
    local v31 = v28.collaborators or {};
    local l_NoAccessKey_0 = v14.NoAccessKey;
    if v28[v29.Owner.targetId] and Enum.CreatorType[v29.Owner.type] == Enum.CreatorType.Group then
        v30 = v28[v29.Owner.targetId].groupMetadata;
    end;
    if not ((not (v29.AssetId ~= nil) or not v28.packagePermissions) or not v28.packagePermissions[v29.AssetId]) then
        l_NoAccessKey_0 = v28.packagePermissions[v29.AssetId];
    end;
    return {
        Owner = not not v28.assetConfigData and v28.assetConfigData.Creator or v29.Owner,
        GroupMetadata = v30,
        Permissions = v31,
        CurrentUserPackagePermission = l_NoAccessKey_0
    };
end, function(v33)
    return {
        SearchRequested = function(...)
            v33(v16(...));
        end,
        PermissionsChanged = function(v34)
            v33(v17(v34));
            v33(v19("permissions", v34));
        end,
        GroupMetadataChanged = function(v35)
            v33(v18(v35));
            v33(v19("groupMetadata", v35));
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v20)));


local v0 = require(script.Parent.Parent.Parent.Parent.Parent.Packages.Cryo);
local function _(v1)
    local v2 = newproxy(true);
    getmetatable(v2).__tostring = function()
        return "Symbol(" .. v1 .. ")";
    end;
    return v2;
end;
local v4 = {};
local v5 = newproxy(true);
local v6 = getmetatable(v5);
local v7 = "NonePermission";
local l_v7_0 = v7 --[[ copy: 9 -> 10 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_0 .. ")";
end;
v4.NoneKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "NoAccessPermission";
local l_v7_1 = v7 --[[ copy: 9 -> 11 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_1 .. ")";
end;
v4.NoAccessKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "UseViewPermission";
local l_v7_2 = v7 --[[ copy: 9 -> 12 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_2 .. ")";
end;
v4.UseViewKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "EditPermission";
local l_v7_3 = v7 --[[ copy: 9 -> 13 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_3 .. ")";
end;
v4.EditKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "RevokedPermission";
local l_v7_4 = v7 --[[ copy: 9 -> 14 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_4 .. ")";
end;
v4.RevokedKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "OwnPermisison";
local l_v7_5 = v7 --[[ copy: 9 -> 15 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_5 .. ")";
end;
v4.OwnKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "UserSubjectType";
local l_v7_6 = v7 --[[ copy: 9 -> 16 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_6 .. ")";
end;
v4.UserSubjectKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "GroupSubjectType";
local l_v7_7 = v7 --[[ copy: 9 -> 17 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_7 .. ")";
end;
v4.GroupSubjectKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "RoleSubjectType";
local l_v7_8 = v7 --[[ copy: 9 -> 18 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_8 .. ")";
end;
v4.RoleSubjectKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "Action";
local l_v7_9 = v7 --[[ copy: 9 -> 19 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_9 .. ")";
end;
v4.ActionKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "PermissionLevel";
local l_v7_10 = v7 --[[ copy: 9 -> 20 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_10 .. ")";
end;
v4.PermissionLevelKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "PermissionSource";
local l_v7_11 = v7 --[[ copy: 9 -> 21 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_11 .. ")";
end;
v4.PermissionSourceKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "SubjectId";
local l_v7_12 = v7 --[[ copy: 9 -> 22 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_12 .. ")";
end;
v4.SubjectIdKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "SubjectName";
local l_v7_13 = v7 --[[ copy: 9 -> 23 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_13 .. ")";
end;
v4.SubjectNameKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "SubjectType";
local l_v7_14 = v7 --[[ copy: 9 -> 24 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_14 .. ")";
end;
v4.SubjectTypeKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "SubjectRank";
local l_v7_15 = v7 --[[ copy: 9 -> 25 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_15 .. ")";
end;
v4.SubjectRankKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "GroupId";
local l_v7_16 = v7 --[[ copy: 9 -> 26 ]];
v6.__tostring = function()
    return "Symbol(" .. l_v7_16 .. ")";
end;
v4.GroupIdKey = v5;
v5 = newproxy(true);
v6 = getmetatable(v5);
v7 = "GroupName";
v6.__tostring = function()
    return "Symbol(" .. v7 .. ")";
end;
v4.GroupNameKey = v5;
v4.AccountPermissionLevel = "Account";
v4.UniversePermissionLevel = "Universe";
v4.AssetPermissionLevel = "Asset";
v4.AssetPermissionSource = "Asset";
v4.GroupPermissionSource = "GroupRoleset";
return v0.Dictionary.join(v4, {
    MaxSearchResultsPerSubjectType = 3,
    MaxPackageAssetIdsForHighestPermissionsRequest = 100
});


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.RoactRodux);
local v4 = require(l_Packages_0.Framework);
local l_AssetConfiguration_0 = l_Parent_0.Core.Components.AssetConfiguration;
local v6 = require(l_AssetConfiguration_0.SideTabs);
local v7 = require(l_AssetConfiguration_0.AssetThumbnailPreview);
local v8 = require(l_AssetConfiguration_0.ImagePicker);
local l_Util_0 = l_Parent_0.Core.Util;
local v10 = require(l_Util_0.LayoutOrderIterator);
local v11 = require(l_Util_0.Constants);
local v12 = require(l_Util_0.Urls);
local v13 = require(l_Util_0.AssetConfigConstants);
local v14 = require(l_Parent_0.Core.Localization.getLocalizedAssetStatusMap);
local v15 = require(l_Parent_0.Core.Components.ImageWithDefault);
local v16 = require(l_Parent_0.Core.Networking.Requests.GetAssetConfigThumbnailStatusRequest);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v19 = require(l_Parent_0.Core.ContextServices.NetworkContext);
local v20 = v2.PureComponent:extend("PreviewArea");
local l_UseDefaultThumbnailForAnimation_0 = game:GetFastFlag("UseDefaultThumbnailForAnimation");
local l_EnableUGCBundleUnknownMeshPartFiltering_0 = game:GetFastFlag("EnableUGCBundleUnknownMeshPartFiltering");
local l_ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE_0 = v11.ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE;
v20.init = function(v24, _)
    v24.baseFrameRef = v2.createRef();
    v24.layouterRef = v2.createRef();
end;
v20.didMount = function(v26)
    local l_props_0 = v26.props;
    if l_props_0.ScreenFlowType == v13.FLOW_TYPE.EDIT_FLOW and l_props_0.PreviewType == v13.PreviewTypes.ImagePicker then
        l_props_0.getThumbnailStatus(l_props_0.Network.networkInterface, l_props_0.AssetId);
    end;
end;
v20.render = function(v28)
    local l_props_1 = v28.props;
    local l_Stylizer_0 = l_props_1.Stylizer;
    local l_Localization_0 = l_props_1.Localization;
    local l_TabItems_0 = l_props_1.TabItems;
    local l_CurrentTab_0 = l_props_1.CurrentTab;
    local l_AssetStatus_0 = l_props_1.AssetStatus;
    local l_AssetId_0 = l_props_1.AssetId;
    local l_AssetTypeEnum_0 = l_props_1.AssetTypeEnum;
    local l_TotalWidth_0 = l_props_1.TotalWidth;
    local l_LayoutOrder_0 = l_props_1.LayoutOrder;
    local l_OnTabSelect_0 = l_props_1.OnTabSelect;
    local l_ChooseThumbnail_0 = l_props_1.ChooseThumbnail;
    local l_IconFile_0 = l_props_1.IconFile;
    local l_PreviewType_0 = l_props_1.PreviewType;
    local l_thumbnailStatus_0 = l_props_1.thumbnailStatus;
    local v44 = if not l_EnableUGCBundleUnknownMeshPartFiltering_0 then nil else l_props_1.AllowedBundleTypeSettings;
    local v45;
    if not (not l_OnTabSelect_0 or not l_TabItems_0) then
        v45 = true;
        if not (#l_TabItems_0 <= 1) then
            goto label0;
        end;
    end;
    v45 = false;
    ::label0::;
    local l_previewArea_0 = l_Stylizer_0.previewArea;
    local v47 = nil;
    if l_AssetId_0 and l_PreviewType_0 == v13.PreviewTypes.Thumbnail then
        v47 = v12.constructAssetThumbnailUrl(l_AssetId_0, l_ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE_0, l_ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE_0);
    end;
    local v48 = l_Localization_0:getText("AssetConfigPreview", "MaxSize", {
        maxDimensionsX = tostring(512),
        maxDimensionsY = tostring(512)
    });
    local v49 = v10.new();
    local l_l_UseDefaultThumbnailForAnimation_0_0 = l_UseDefaultThumbnailForAnimation_0;
    if l_l_UseDefaultThumbnailForAnimation_0_0 then
        l_l_UseDefaultThumbnailForAnimation_0_0 = false;
        if l_AssetTypeEnum_0 == Enum.AssetType.Animation then
            l_l_UseDefaultThumbnailForAnimation_0_0 = not v47;
        end;
    end;
    local l_createElement_0 = v2.createElement;
    local v52 = "Frame";
    local v53 = {
        Size = UDim2.new(0, l_TotalWidth_0, 1, 0),
        BackgroundTransparency = 0,
        BackgroundColor3 = l_previewArea_0.backgroundColor,
        BorderSizePixel = 0,
        [v2.Ref] = v28.baseFrameRef,
        LayoutOrder = l_LayoutOrder_0
    };
    local v54 = {
        Padding = v2.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 24),
            PaddingBottom = UDim.new(0, 24),
            PaddingLeft = UDim.new(0, 5),
            PaddingRight = UDim.new(0, 5)
        }),
        UIListLayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 20),
            [v2.Ref] = v28.layouterRef
        })
    };
    local v55 = false;
    if l_PreviewType_0 == v13.PreviewTypes.ImagePicker then
        v55 = v2.createElement(v8, {
            Size = UDim2.new(0, 150, 0, 150),
            AssetId = l_AssetId_0,
            ThumbnailStatus = l_thumbnailStatus_0,
            ChooseThumbnail = l_ChooseThumbnail_0,
            IconFile = l_IconFile_0,
            LayoutOrder = v49:getNextOrder()
        });
    end;
    v54.ImagePicker = v55;
    v55 = false;
    if l_PreviewType_0 == v13.PreviewTypes.Thumbnail then
        v55 = v2.createElement(v15, {
            Size = UDim2.new(0, 150, 0, 150),
            BackgroundTransparency = 1,
            LayoutOrder = v49:getNextOrder(),
            Image = if not l_l_UseDefaultThumbnailForAnimation_0_0 then v47 else "rbxasset://textures/StudioToolbox/Animation.png",
            defaultImage = ""
        });
    end;
    v54.Thumbnail = v55;
    v55 = false;
    if l_PreviewType_0 == v13.PreviewTypes.ModelPreview then
        v55 = v2.createElement(v7, {
            Size = UDim2.new(0, 150, 0, 150),
            ShowTitle = false,
            LayoutOrder = v49:getNextOrder(),
            AssetType = if not l_EnableUGCBundleUnknownMeshPartFiltering_0 then nil else l_AssetTypeEnum_0,
            AllowedBundleTypeSettings = if not l_EnableUGCBundleUnknownMeshPartFiltering_0 then nil else v44
        });
    end;
    v54.AssetThumbnailPreview = v55;
    v55 = false;
    if l_PreviewType_0 ~= v13.PreviewTypes.ImagePicker then
        v55 = v2.createElement;
        local v56 = "Frame";
        local v57 = {
            Size = UDim2.new(1, 0, 0, 50),
            BackgroundTransparency = 1,
            LayoutOrder = v49:getNextOrder()
        };
        local v58 = {};
        local v59 = false;
        if l_AssetId_0 ~= nil then
            v59 = v2.createElement("TextLabel", {
                Size = UDim2.new(1, 0, 0, 25),
                BackgroundTransparency = 1,
                TextColor3 = l_previewArea_0.selectedColor,
                Text = l_Localization_0:getText("General", "PreviewAreaAssetID", {
                    assetId = tostring(l_AssetId_0)
                }),
                Font = v11.FONT,
                TextSize = v11.FONT_SIZE_MEDIUM,
                TextWrapped = false,
                TextTruncate = Enum.TextTruncate.AtEnd,
                TextXAlignment = Enum.TextXAlignment.Center,
                TextYAlignment = Enum.TextYAlignment.Center
            });
        end;
        v58.AssetIdLabel = v59;
        v59 = false;
        if l_AssetStatus_0 ~= nil then
            v59 = false;
            if v13.ASSET_STATUS.Unknown ~= l_AssetStatus_0 then
                v59 = v2.createElement("TextLabel", {
                    Size = UDim2.new(1, 0, 0, 25),
                    Position = UDim2.new(0, 0, 0, 25),
                    BackgroundTransparency = 1,
                    TextColor3 = l_previewArea_0.textColor,
                    Text = l_Localization_0:getText("General", "PreviewAreaStatus", {
                        assetStatus = v14(l_Localization_0)[l_AssetStatus_0]
                    }),
                    Font = v11.FONT,
                    TextSize = v11.FONT_SIZE_MEDIUM,
                    TextWrapped = false,
                    TextTruncate = Enum.TextTruncate.AtEnd,
                    TextXAlignment = Enum.TextXAlignment.Center,
                    TextYAlignment = Enum.TextYAlignment.Top
                });
            end;
        end;
        v58.AssetStatusLabel = v59;
        v55 = v55(v56, v57, v58);
    end;
    v54.AssetInfo = v55;
    v55 = false;
    if l_PreviewType_0 == v13.PreviewTypes.ImagePicker then
        v55 = v2.createElement("Frame", {
            Size = UDim2.new(0, 192, 0, 120),
            BackgroundTransparency = 1,
            LayoutOrder = v49:getNextOrder()
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                VerticalAlignment = Enum.VerticalAlignment.Top,
                SortOrder = Enum.SortOrder.LayoutOrder,
                Padding = UDim.new(0, 8)
            }),
            Container = v2.createElement("Frame", {
                Size = UDim2.new(1, 0, 0, 54),
                BackgroundTransparency = 1,
                LayoutOrder = 1
            }, {
                FormatLabel = v2.createElement("TextLabel", {
                    Size = UDim2.new(0, 176, 0, 54),
                    Position = UDim2.new(0, 10, 0, 0),
                    BackgroundTransparency = 1,
                    Text = v48,
                    Font = v11.FONT,
                    TextSize = v11.FONT_SIZE_MEDIUM,
                    TextColor3 = l_previewArea_0.textColor,
                    TextWrapped = true,
                    TextXAlignment = Enum.TextXAlignment.Center,
                    TextYAlignment = Enum.TextYAlignment.Center
                })
            }),
            Container2 = v2.createElement("Frame", {
                Size = UDim2.new(1, 0, 0, 54),
                BackgroundTransparency = 1,
                LayoutOrder = 2
            }, {
                ProcessLabel = v2.createElement("TextLabel", {
                    Size = UDim2.new(0, 176, 0, 54),
                    Position = UDim2.new(0, 10, 0, 0),
                    BackgroundTransparency = 1,
                    Text = l_Localization_0:getText("AssetConfigPreview", "Process"),
                    Font = v11.FONT,
                    TextSize = v11.FONT_SIZE_MEDIUM,
                    TextColor3 = l_previewArea_0.textColor,
                    TextWrapped = true,
                    TextXAlignment = Enum.TextXAlignment.Center,
                    TextYAlignment = Enum.TextYAlignment.Center,
                    LayoutOrder = 2
                })
            })
        });
    end;
    v54.Guide = v55;
    v54.TabArea = v45 and v2.createElement("Frame", {
        Size = UDim2.new(1, 10, 1, -200),
        BackgroundTransparency = 1,
        LayoutOrder = v49:getNextOrder()
    }, {
        SideTabs = v45 and v2.createElement(v6, {
            Size = UDim2.new(1, 0, 1, 0),
            ItemHeight = 48,
            Items = l_TabItems_0,
            CurrentTab = l_CurrentTab_0,
            ItemClickCallBack = l_OnTabSelect_0,
            SelectParentRef = v28.baseFrameRef
        })
    });
    return l_createElement_0(v52, v53, v54);
end;
return v3.connect(function(v60, _)
    return {
        thumbnailStatus = (v60 or {}).thumbnailStatus
    };
end, function(v62)
    return {
        getThumbnailStatus = function(v63, v64)
            v62(v16(v63, v64));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Network = v19
})(v20)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local l_Packages_0 = l_script_FirstAncestor_0.Packages;
local v2 = require(l_Packages_0.Framework);
local v3 = require(l_Packages_0.Roact);
local v4 = require(l_Packages_0.RoactRodux);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v2.UI;
local l_LoadingBar_0 = l_UI_0.LoadingBar;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Util_0 = l_script_FirstAncestor_0.Core.Util;
local v11 = require(l_Util_0.Colors);
local v12 = require(l_Util_0.Constants);
local v13 = v3.Component:extend("ProgressBarWrapper");
v13.didUpdate = function(v14, v15)
    local l_props_0 = v14.props;
    if l_props_0.uploadSucceeded ~= nil and v15.uploadSucceeded ~= l_props_0.uploadSucceeded then
        l_props_0.onFinish();
    end;
end;
v13.render = function(v17)
    local l_props_1 = v17.props;
    local l_Localization_0 = l_props_1.Localization;
    local l_progress_0 = l_props_1.progress;
    local l_progressText_0 = l_props_1.progressText;
    local l_progressTitle_0 = l_props_1.progressTitle;
    return v3.createElement("Frame", {
        BackgroundTransparency = 1,
        Position = UDim2.new(0.5, -200, 0, 314),
        Size = UDim2.new(0, 400, 0, 6)
    }, {
        ProgressTitle = if not l_progressTitle_0 then nil else v3.createElement(l_TextLabel_0, {
            Position = UDim2.new(0, 0, 0, -54),
            Size = UDim2.new(1, 0, 0, 30),
            Text = l_progressTitle_0,
            TextSize = v12.FONT_SIZE_TITLE,
            TextXAlignment = Enum.TextXAlignment.Center,
            TextYAlignment = Enum.TextYAlignment.Center
        }),
        ProgressMessage = if not l_progressText_0 then nil else v3.createElement(l_TextLabel_0, {
            Position = UDim2.new(0, 0, 0, -32),
            Size = UDim2.new(1, 0, 0, 30),
            Text = l_progressText_0,
            TextSize = v12.FONT_SIZE_TITLE,
            TextXAlignment = Enum.TextXAlignment.Center,
            TextYAlignment = Enum.TextYAlignment.Center
        }),
        LoadingBar = v3.createElement(l_LoadingBar_0, {
            Progress = l_progress_0,
            Size = UDim2.new(1, 0, 1, 0)
        }),
        ProgressPercentText = v3.createElement(l_TextLabel_0, {
            Position = UDim2.new(0, 0, 0, 15),
            Size = UDim2.new(1, 0, 0, 10),
            Text = l_Localization_0:getText("AssetConfig", "ProgressBarProgressText", {
                percent = math.floor(l_progress_0 * 100)
            }),
            TextColor = v11.GRAY_3,
            TextSize = v12.FONT_SIZE_LARGE,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Center
        }),
        TimeWarning = v3.createElement(l_TextLabel_0, {
            Position = UDim2.new(0, 0, 0, 15),
            Size = UDim2.new(1, 0, 0, 10),
            Text = l_Localization_0:getText("AssetConfig", "ProgressUploadWaitTimeWarning"),
            TextColor = v11.GRAY_2,
            TextSize = v12.FONT_SIZE_MEDIUM,
            TextXAlignment = Enum.TextXAlignment.Right,
            TextYAlignment = Enum.TextYAlignment.Center
        })
    });
end;
return v4.connect(function(v23, _)
    v23 = v23 or {};
    return {
        progress = v23.progressPercentage,
        progressText = v23.progressText,
        progressTitle = v23.progressTitle,
        uploadSucceeded = v23.uploadSucceeded
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v13)));