local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
local l_Http_0 = require(l_Parent_0.Packages.Framework).Http;
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
local l_Url_0 = require(l_Parent_0.Packages.Framework).RobloxAPI.Url;
local v5 = require(l_Parent_0.Src.Util.tablesDeepEqual);
local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_HttpService_0 = game:GetService("HttpService");
local v8 = {
    "GET",
    "POST",
    "PUT",
    "PATCH",
    "DELETE"
};
local _, _, v18 = (function(v9)
    if v9:sub(#v9) ~= "/" then
        v9 = v9 .. "/";
    end;
    local _, v11 = v9:find("://");
    local v12, v13 = v9:find("%.", v11 + 1);
    local v14 = v9:sub(v11 + 1, v12 - 1);
    local v15 = v9:sub(v13 + 1);
    if v15[#v15] == "/" then
        v15 = v15:sub(1, #v15 - 1);
    end;
    return v9, v14, v15;
end)(l_ContentProvider_0.BaseUrl);
local function _(v19, v20, v21)
    assert(v20:sub(1, 1) == "/", "Path must begin with '/'");
    return (l_Url_0.composeUrl("https://" .. v19 .. "." .. v18, v20:sub(2, -1), v21));
end;
local function _(v23)
    local v24 = true;
    if v23 ~= "GET" then
        v24 = v23 == "PATCH";
    end;
    return v24;
end;
local function v26(v27, v28)
    local v29 = {};
    for v30, v31 in pairs(v28) do
        if typeof(v31) == "table" and typeof(v27[v30]) == "table" then
            v29[v30] = v26(v27[v30], v31);
        else
            v29[v30] = v31;
        end;
    end;
    return v1.Dictionary.join(v27, v29);
end;
local v32 = {};
v32.__index = v32;
v32.new = function(v33)
    v33 = v1.Dictionary.join({
        isInternal = true,
        retryAmount = 3
    }, v33 or {});
    local v34 = {
        __retryAmount = v33.retryAmount,
        __baseImpl = l_Http_0.Networking.new(v33),
        __coalescedRequests = {}
    };
    for _, v36 in ipairs(v8) do
        v34.__coalescedRequests[v36] = {};
    end;
    return (setmetatable(v34, v32));
end;
v32.request = function(v37, v38, v39, v40)
    local l_Params_0 = v40.Params;
    assert(v39:sub(1, 1) == "/", "Path must begin with '/'");
    v40 = v1.Dictionary.join(v40, {
        Params = v1.None,
        Url = l_Url_0.composeUrl("https://" .. v38 .. "." .. v18, v39:sub(2, -1), l_Params_0)
    });
    l_Params_0 = v40.Method;
    local v42 = true;
    if l_Params_0 ~= "GET" then
        v42 = l_Params_0 == "PATCH";
    end;
    if not v42 then
        return v37:__requestWithoutCoalesce(v40);
    else
        return v37:__requestWithCoalesce(v40);
    end;
end;
for _, v44 in pairs(v8) do
    v32[v44:lower()] = function(v45, v46, v47, v48)
        return v45:request(v46, v47, v1.Dictionary.join(v48 or {}, {
            Method = v44
        }));
    end;
end;
v32.__requestWithoutCoalesce = function(v49, v50)
    if v50.Body ~= nil then
        local _ = nil;
        local v52 = true;
        local l_Headers_0 = v50.Headers;
        if typeof(l_Headers_0) == "table" then
            local v54 = l_Headers_0["Content-Type"];
            if not (not v54 or not string.find(v54, "multipart/form")) then
                v52 = false;
            end;
        end;
        v50 = v1.Dictionary.join(v50, {
            Body = not not v52 and l_HttpService_0:JSONEncode(v50.Body) or v50.Body,
            Headers = v1.Dictionary.join({
                ["Content-Type"] = "application/json"
            }, v50.Headers or {})
        });
    end;
    return v49.__baseImpl:parseJson(v49.__baseImpl:handleRetry(v49.__baseImpl:request(v50), v49.__retryAmount));
end;
v32.__requestWithCoalesce = function(v55, v56)
    local l_Method_0 = v56.Method;
    local l_Url_1 = v56.Url;
    local v59 = v55:__getExistingRequest(v56);
    if not v59 then
        local v60 = l_HttpService_0:GenerateGUID();
        local v61 = nil;
        local function v62()
            v55.__coalescedRequests[l_Method_0][l_Url_1][v60] = nil;
        end;
        if l_Method_0 == "GET" then
            v61 = v55:__requestWithoutCoalesce(v56);
            v61:andThen(v62, v62);
        elseif l_Method_0 == "PATCH" then
            v61 = l_Promise_0.new(function(v63, v64)
                spawn(function()
                    v55:__requestWithoutCoalesce(v1.Dictionary.join(v56, {
                        Body = v55.__coalescedRequests[l_Method_0][l_Url_1][v60].options.Body
                    })):andThen(v63, v64);
                    v55.__coalescedRequests[l_Method_0][l_Url_1][v60] = nil;
                end);
            end);
        else
            assert(false);
        end;
        v55.__coalescedRequests[l_Method_0][l_Url_1] = v55.__coalescedRequests[l_Method_0][l_Url_1] or {};
        v55.__coalescedRequests[l_Method_0][l_Url_1][v60] = {
            promise = v61,
            options = v56
        };
        return v61;
    else
        if l_Method_0 == "PATCH" then
            v59.options = v26(v59.options, {
                Body = v56.Body
            });
        end;
        return v59.promise;
    end;
end;
v32.__getExistingRequest = function(v65, v66)
    local v67 = v65.__coalescedRequests[v66.Method][v66.Url];
    if v67 then
        local v68 = v1.Dictionary.join(v66, {
            Body = v1.None
        });
        local v69 = nil;
        for _, v71 in pairs(v67) do
            if v5(v68, (v1.Dictionary.join(v71.options, {
                Body = v1.None
            }))) then
                v69 = v71;
                break;
            end;
        end;
        if v69 then
            return v69;
        else
            return nil;
        end;
    else
        return nil;
    end;
end;
return v32;


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


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.DEPRECATED_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
};


return {
    webKeys = {
        UserId = "userId",
        UserName = "userName",
        GroupId = "groupId",
        GroupName = "groupName",
        RoleId = "rolesetId",
        RoleName = "rolesetName",
        RoleRank = "rank",
        Action = "action",
        AllowedPermissions = "allowedPermissions",
        PlayAction = "Play",
        EditAction = "Edit",
        AdminAction = "Admin",
        SubjectType = "subjectType",
        SubjectId = "subjectId",
        UserSubject = "User",
        GroupSubject = "Group",
        RoleSubject = "Roleset"
    }
};


local l_HttpService_0 = game:GetService("HttpService");
local v1 = require(script.Parent.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_Promise_0 = require(script.Parent.Parent.Parent.Packages.Framework).Util.Promise;
local v1 = {};
v1.__index = v1;
v1.new = function()
    return (setmetatable({}, v1));
end;
v1.GetUserId = function(_)
    return 0;
end;
v1.GetSettings = function(_)
    return l_Promise_0.resolve({});
end;
v1.SaveAll = function(_)
    return l_Promise_0.resolve();
end;
return v1;


return function(v0, v1)
    if v0.Changed[v1] ~= nil then
        return v0.Changed[v1];
    else
        return v0.Current[v1];
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
return require(l_Parent_0.Packages.Rodux).createReducer({}, {
    SetComponentLoadState = function(v2, v3)
        return v1.Dictionary.join(v2, {
            [v3.componentName] = v3.loadState
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
local v2 = require(l_Parent_0.Packages.Rodux);
local v3 = {
    editPlaceId = 0,
    editDevProductId = nil
};
return v2.createReducer(v3, {
    ResetStore = function(_, _)
        return v3;
    end,
    SetEditPlaceId = function(v6, v7)
        return v1.Dictionary.join(v6, {
            editPlaceId = v7.editPlaceId
        });
    end,
    SetEditDevProductId = function(v8, v9)
        return v1.Dictionary.join(v8, {
            editDevProductId = v9.editDevProductId ~= nil and v9.editDevProductId or v1.None
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
return require(l_Parent_0.Packages.Rodux).createReducer({
    game = nil,
    gameId = nil
}, {
    ResetStore = function(_, _)
        return {};
    end,
    SetGameId = function(v4, v5)
        return v1.Dictionary.join(v4, {
            gameId = v5.gameId
        });
    end,
    SetGame = function(v6, v7)
        return v1.Dictionary.join(v6, {
            game = v7.game
        });
    end
});


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


local l_Parent_0 = script.Parent.Parent.Parent;
return require(l_Parent_0.Packages.Rodux).combineReducers({
    Settings = require(l_Parent_0.Src.Reducers.Settings),
    Status = require(l_Parent_0.Src.Reducers.Status),
    MorpherEditorRoot = require(l_Parent_0.Pages.AvatarPage.Reducers.MorpherEditorRoot),
    CollaboratorSearch = require(l_Parent_0.Pages.PermissionsPage.Reducers.CollaboratorSearch),
    PageLoadState = require(l_Parent_0.Src.Reducers.PageLoadState),
    PageSaveState = require(l_Parent_0.Src.Reducers.PageSaveState),
    Metadata = require(l_Parent_0.Src.Reducers.GameMetadata),
    GameOwnerMetadata = require(l_Parent_0.Src.Reducers.GameOwnerMetadata),
    EditAsset = require(l_Parent_0.Src.Reducers.EditAsset),
    ComponentLoadState = require(l_Parent_0.Src.Reducers.ComponentLoadState)
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
return require(l_Parent_0.Packages.Rodux).createReducer({}, {
    ResetStore = function(_, _)
        return {};
    end,
    SetPageLoadState = function(v4, v5)
        return v1.Dictionary.join(v4, {
            [v5.pageId] = v5.loadState
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
return require(l_Parent_0.Packages.Rodux).createReducer({}, {
    ResetStore = function(_, _)
        return {};
    end,
    SetPageSaveState = function(v4, v5)
        return v1.Dictionary.join(v4, {
            [v5.pageId] = v5.saveState
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
local v2 = require(l_Parent_0.Packages.Rodux);
local l_deepEqual_0 = require(l_Parent_0.Packages.Framework).Util.deepEqual;
local v4 = require(l_Parent_0.Src.Util.isEmpty);
local v5 = require(l_Parent_0.Src.Util.AssetOverrides);
local v6 = require(l_Parent_0.Src.Util.Float);
local v7 = require(l_Parent_0.Src.Util.Scales);
local v8 = {
    universeAvatarAssetOverrides = v5.isEqual,
    universeAvatarMinScales = v7.isEqual,
    universeAvatarMaxScales = v7.isEqual,
    OptInLocations = l_deepEqual_0,
    thumbnails = l_deepEqual_0,
    workspaceGravity = v6.createIsEqualWithTolerance(0.001),
    workspaceJumpHeight = v6.createIsEqualWithTolerance(0.001),
    workspaceJumpPower = v6.createIsEqualWithTolerance(0.001)
};
local function v16(v9, v10)
    if not (v9 ~= nil) or v10 == nil then
        return v9 == v10;
    elseif v4(v9) ~= v4(v10) then
        return false;
    else
        local v11 = true;
        for v12, v13 in pairs(v9) do
            if v10[v12] ~= v13 then
                v11 = false;
                break;
            end;
        end;
        for v14, v15 in pairs(v10) do
            if v9[v14] ~= v15 then
                return false;
            end;
        end;
        return v11;
    end;
end;
local function v17()
    return {
        Current = {},
        Changed = {},
        Errors = {},
        Warnings = {}
    };
end;
return v2.createReducer(v17(), {
    ResetStore = function(_, _)
        return (v17());
    end,
    AddChange = function(v20, v21)
        local l_value_0 = v21.value;
        if (if not v8[v21.setting] then if type(l_value_0) == "table" then v16 else function(v23, v24)
            return v23 == v24;
        end else v8[v21.setting])(v20.Current[v21.setting], l_value_0) then
            l_value_0 = v1.None;
        end;
        return v1.Dictionary.join(v20, {
            Changed = v1.Dictionary.join(v20.Changed, {
                [v21.setting] = l_value_0
            }),
            Errors = v1.Dictionary.join(v20.Errors, {
                [v21.setting] = v1.None
            })
        });
    end,
    AddErrors = function(v25, v26)
        return v1.Dictionary.join(v25, {
            Errors = v1.Dictionary.join(v25.Errors, v26.errors)
        });
    end,
    DiscardError = function(v27, v28)
        return v1.Dictionary.join(v27, {
            Errors = v1.Dictionary.join(v27.Errors, {
                [v28.error] = v1.None
            })
        });
    end,
    DiscardChanges = function(v29, _)
        return v1.Dictionary.join(v29, {
            Changed = {}
        });
    end,
    DiscardErrors = function(v31, _)
        return v1.Dictionary.join(v31, {
            Errors = {},
            Warnings = {}
        });
    end,
    SetCurrentSettings = function(v33, v34)
        return v1.Dictionary.join(v33, {
            Current = v34.settings
        });
    end,
    AppendSettings = function(v35, v36)
        return v1.Dictionary.join(v35, {
            Current = v1.Dictionary.join(v35.Current, v36.settings)
        });
    end,
    AddWarning = function(v37, v38)
        if v1.List.find(v37.Warnings, v38.key) then
            return v37;
        else
            return v1.Dictionary.join(v37, {
                Warnings = v1.List.join(v37.Warnings, {
                    v38.key
                })
            });
        end;
    end,
    DiscardWarning = function(v39, v40)
        return v1.Dictionary.join(v39, {
            Warnings = v1.List.removeValue(v39.Warnings, v40.key)
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local l_Closed_0 = require(l_Parent_0.Src.Util.CurrentStatus).Closed;
return v1.createReducer(l_Closed_0, {
    ResetStore = function(_, _)
        return l_Closed_0;
    end,
    SetCurrentStatus = function(_, v6)
        return v6.currentStatus;
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Thunks.SaveChanges);
local v2 = require(l_Parent_0.Src.Components.Dialog.WarningDialog);
local v3 = require(l_Parent_0.Src.Components.Dialog.SimpleDialog);
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
return function(v5, v6)
    return function(v7)
        local v8 = v7:getState();
        local l_v5_0 = v5;
        local v10 = {
            isActive = {
                Title = l_v5_0:getText("General", "PrivateDialogHeader"),
                Header = l_v5_0:getText("General", "PrivateDialogPrompt"),
                Description = l_v5_0:getText("General", "PrivateDialogBody"),
                Buttons = {
                    l_v5_0:getText("General", "ButtonCancel"),
                    l_v5_0:getText("General", "ButtonSave")
                }
            },
            universeAvatarType = {
                Title = l_v5_0:getText("General", "AvatarDialogHeader"),
                Header = l_v5_0:getText("General", "AvatarDialogPrompt"),
                Description = l_v5_0:getText("General", "AvatarDialogBody"),
                Buttons = {
                    l_v5_0:getText("General", "ReplyNo"),
                    l_v5_0:getText("General", "ReplyYes")
                }
            }
        };
        local v11 = {
            Size = Vector2.new(343, 145),
            Title = l_v5_0:getText("General", "ErrorsOnSaveHeader"),
            Header = l_v5_0:getText("General", "ErrorsOnSaveBody"),
            Buttons = {
                l_v5_0:getText("General", "ReplyOK")
            }
        };
        return l_Promise_0.new(function(v12, v13)
            spawn(function()
                for _, v15 in pairs(v8.Settings.Warnings) do
                    if not v6.showDialog(v2, v10[v15]):await() then
                        v13();
                    end;
                end;
                v12();
            end);
        end):andThen(function()
            return v7:dispatch(v1()):catch(function(_)
                v6.showDialog(v3, v11):catch(function()
                end);
            end);
        end):andThen(function(v17)
            return v17;
        end);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.AppendSettings);
local v2 = require(l_Parent_0.Src.Actions.SetPageLoadState);
local v3 = require(l_Parent_0.Src.Util.Analytics);
local v4 = require(l_Parent_0.Src.Util.LoadState);
return function(v5, v6)
    return function(v7, v8)
        local v9 = v6(v7, v8);
        v7:dispatch(v2(v5, v4.Loading));
        v3.onPageLoadAttempt(v5);
        local v10 = tick();
        local v11 = 0;
        local v12 = false;
        local v13 = {};
        for _, v15 in ipairs(v9) do
            coroutine.wrap(function()
                local l_status_0, l_result_0 = pcall(v15, v13);
                if not (l_status_0 or v12) then
                    warn("Failed", l_result_0);
                    v12 = true;
                    v7:dispatch(v2(v5, v4.LoadFailed));
                end;
                v11 = v11 + 1;
                if v11 == #v9 then
                    if v12 then
                        v3.onPageLoadError(v5, tick() - v10);
                    else
                        v7:dispatch(v1(v13));
                        v7:dispatch(v2(v5, v4.Loaded));
                        v3.onPageLoadSuccess(v5, tick() - v10);
                        return ;
                    end;
                end;
            end)();
        end;
    end;
end;


return function(v0)
    return function(_, v2)
        return v2.policyInfoController:postContactEmail(game.GameId, v0);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.Analytics);
local v2 = require(l_Parent_0.Src.Actions.SetCurrentStatus);
local v3 = require(l_Parent_0.Src.Actions.SetPageSaveState);
local v4 = require(l_Parent_0.Src.Util.CurrentStatus);
local v5 = require(l_Parent_0.Src.Util.SaveState);
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
return function()
    return function(v7)
        local v8 = tick();
        v1.onSaveAttempt();
        v7:dispatch(v2(v4.Working));
        local v9 = v7:getState();
        for v10, _ in pairs(v9.PageSaveState) do
            v7:dispatch(v3(v10, v5.Pending));
        end;
        for v12, v13 in pairs(v9.Settings.Changed) do
            v1.onSettingSaved(v12, v13);
        end;
        return l_Promise_0.new(function(v14, v15)
            spawn(function()
                local v16 = nil;
                local v17 = nil;
                while wait() do
                    v16 = true;
                    v17 = true;
                    for _, v19 in pairs(v7:getState().PageSaveState) do
                        if v19 == v5.SaveFailed then
                            v17 = false;
                        end;
                        if v19 == v5.Saving then
                            v16 = false;
                        end;
                    end;
                    if v16 then
                        break;
                    end;
                end;
                for v20, v21 in pairs(v7:getState().PageSaveState) do
                    if v21 == v5.SaveFailed then
                        v1.onPageSaveError(v20);
                    end;
                    v7:dispatch(v3(v20, v5.Unsaved));
                end;
                if not v17 then
                    v1.onSaveError(tick() - v8);
                    v7:dispatch(v2(v4.Error));
                    v15({});
                    return ;
                else
                    v1.onSaveSuccess(tick() - v8);
                    v14();
                    return ;
                end;
            end);
        end);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.SetPageSaveState);
local v2 = require(l_Parent_0.Src.Util.SaveState);
return function(v3, v4)
    return function(v5, v6)
        local v7 = v4(v5, v6);
        v5:dispatch(v1(v3, v2.Saving));
        local v8 = 0;
        local v9 = false;
        for _, v11 in ipairs(v7) do
            coroutine.wrap(function()
                local l_status_0, l_result_0 = pcall(v11);
                if not (l_status_0 or v9) then
                    warn("Failed", l_result_0);
                    v9 = true;
                    v5:dispatch(v1(v3, v2.SaveFailed));
                end;
                v8 = v8 + 1;
                if not (not (v8 == #v7) or v9) then
                    v5:dispatch(v1(v3, v2.Saved));
                end;
            end)();
        end;
    end;
end;


local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_HttpService_0 = game:GetService("HttpService");
local v2 = require(script.Parent.Parent.Parent.Packages.Cryo);
local v3 = game:DefineFastInt("MaxAccessPermissionsCollaborators", 200);
local function _()
    local v4 = nil;
    pcall(function()
        v4 = l_RbxAnalyticsService_0:GetSessionId();
    end);
    return v4;
end;
local function _()
    local v6 = nil;
    pcall(function()
        v6 = l_RbxAnalyticsService_0:GetClientId();
    end);
    return v6;
end;
local v14 = {
    print = function(_, _, _)
    end,
    printTable = function(_, _, _)
    end
};
v14.reportCounter = function(v15, v16)
    v14.print("reportCounter", v15, v16 or 1);
    l_RbxAnalyticsService_0:ReportCounter(v15, v16 or 1);
end;
v14.reportStats = function(v17, v18)
    v14.print("reportStats", v17, v18);
    l_RbxAnalyticsService_0:ReportStats(v17, v18);
end;
v14.sendEventDeferred = function(v19, v20)
    v14.printTable("sendEventDeferred", v19, l_HttpService_0:JSONEncode(v20));
    local l_join_0 = v2.Dictionary.join;
    local l_v20_0 = v20;
    local v23 = {};
    local v24 = nil;
    local v25;
    do
        local l_v24_0 = v24;
        pcall(function()
            l_v24_0 = l_RbxAnalyticsService_0:GetClientId();
        end);
        v25 = l_v24_0;
    end;
    v23.uid = v25;
    v24 = nil;
    do
        local l_v24_1 = v24;
        pcall(function()
            l_v24_1 = l_RbxAnalyticsService_0:GetSessionId();
        end);
        v25 = l_v24_1;
    end;
    v23.sid = v25;
    v23.pid = game.PlaceId;
    l_RbxAnalyticsService_0:SendEventDeferred("studio", "gameSettings", v19, (l_join_0(l_v20_0, v23)));
end;
v14.onSettingSaved = function(v28, v29)
    v14.reportCounter(string.format("GameSettings_SettingSaved_%s", v28));
    if typeof(v29) == "boolean" then
        v14.reportCounter(string.format("GameSettings_Setting%s_%s", not v29 and "Disabled" or "Enabled", v28));
        return ;
    else
        if typeof(v29) == "string" then
            v14.reportStats(string.format("GameSettings_StringSettingLength_%s", v28), v29:len());
        end;
        return ;
    end;
end;
v14.onPageLoadAttempt = function(v30)
    v14.reportCounter(string.format("GameSettings_PageLoadAttempt_%s", v30));
end;
v14.onPageLoadSuccess = function(v31, v32)
    v14.reportCounter(string.format("GameSettings_PageLoadSuccess_%s", v31));
    v14.reportStats(string.format("GameSettings_PageLoadTime_Success_%s", v31), v32);
end;
v14.onPageLoadError = function(v33, v34)
    v14.reportCounter(string.format("GameSettings_PageLoadError_%s", v33));
    v14.reportStats(string.format("GameSettings_PageLoadTime_Error_%s", v33), v34);
end;
v14.onSaveAttempt = function()
    v14.reportCounter("GameSettings_SaveAttempt");
end;
v14.onSaveSuccess = function(v35)
    v14.reportCounter("GameSettings_SaveSuccess");
    v14.reportStats("GameSettings_SaveTime_Success", v35);
end;
v14.onSaveError = function(v36)
    v14.reportCounter("GameSettings_SaveError");
    v14.reportStats("GameSettings_SaveTime_Error", v36);
end;
v14.onPageSaveError = function(v37)
    v14.reportCounter(string.format("GameSettings_PageSaveError_%s", v37));
end;
v14.onOpenEvent = function(v38, v39)
    v14.sendEventDeferred("gameSettingsOpen", {});
    v14.sendEventDeferred("toolOpened", {
        method = 1,
        uid = v38,
        gameId = v39
    });
end;
v14.onCloseEvent = function(v40, v41)
    v14.sendEventDeferred("gameSettingsClose", {
        buttonSelected = v40,
        timeOpen = string.format("%f", v41)
    });
end;
v14.onTabChangeEvent = function(v42, v43)
    if not (not v42 or not v43) then
        v14.sendEventDeferred("gameSettingsTabChange", {
            oldTab = v42,
            newTab = v43
        });
    end;
end;
v14.numberOfUsers = function(v44, v45)
    v14.sendEventDeferred(string.format("GameSettings_%s_UserCount", v45), {
        uid = v44,
        gameId = game.GameId
    });
end;
v14.onPermissionGiven = function(v46, v47, v48)
    v14.sendEventDeferred(string.format("GameSettings_%s%sGiven", v47, v48), {
        uid = v46,
        gameId = game.GameId
    });
end;
v14.onPermissionRemoved = function(v49, v50, v51)
    v14.sendEventDeferred(string.format("GameSettings_%s%sRemoved", v50, v51), {
        uid = v49,
        gameId = game.GameId
    });
end;
v14.onUserAdded = function()
    v14.reportCounter("GameSettings_AccessPermissions_UserAdded");
end;
v14.onUserRemoved = function()
    v14.reportCounter("GameSettings_AccessPermissions_UserRemoved");
end;
v14.onGroupAdded = function()
    v14.reportCounter("GameSettings_AccessPermissions_GroupAdded");
end;
v14.onGroupRemoved = function()
    v14.reportCounter("GameSettings_AccessPermissions_GroupRemoved");
end;
v14.onPermissionFailed = function()
    v14.reportCounter("GameSettings_AccessPermissions_Failed");
end;
v14.onNumCollaboratorsChanged = function(v52)
    for _, v54 in pairs({
        1,
        0.75,
        0.5,
        0.25
    }) do
        if v54 * v3 <= v52 then
            v14.reportCounter("GameSettings_AccessPermissions_NumCollaboratorThreshold_" .. math.floor(v54 * 100));
            break;
        end;
    end;
    v14.sendEventDeferred("GameSettings_AccessPermissions_NumCollaborators", {
        gameId = game.GameId,
        numCollaborators = v52
    });
end;
v14.onSecuritySettingChange = function(v55, v56)
    v14.sendEventDeferred("GameSettings_SecuritySettingChange", {
        settingName = v55,
        settingValue = v56
    });
end;
return v14;


local v0 = {};
local _ = function(v1)
    local v2 = {};
    if v1 ~= nil then
        for _, v4 in pairs(v1) do
            v2[v4.assetTypeID] = v4;
        end;
    end;
    return v2;
end;
local function v19(v6, v7, v8)
    local v9 = {};
    if v6 ~= nil then
        for _, v11 in pairs(v6) do
            v9[v11.assetTypeID] = v11;
        end;
    end;
    local l_v9_0 = v9;
    local v13 = {};
    if v7 ~= nil then
        for _, v15 in pairs(v7) do
            v13[v15.assetTypeID] = v15;
        end;
    end;
    v9 = v13;
    v13 = {
        assetID = 0,
        isPlayerChoice = true
    };
    for _, v17 in pairs(v9) do
        local v18 = l_v9_0[v17.assetTypeID] or v13;
        if not (not (not (v17.assetID == v18.assetID) or v17.isPlayerChoice ~= v18.isPlayerChoice) or v8(v17)) then
            return ;
        end;
    end;
end;
v0.isEqual = function(v20, v21)
    local v22 = true;
    v19(v20, v21, function()
        v22 = false;
        return false;
    end);
    return v22;
end;
v0.processSaveData = function(v23, v24)
    local v25 = {};
    v19(v23, v24, function(v26)
        v25[#v25 + 1] = v26;
        return true;
    end);
    return v25;
end;
v0.getErrors = function(v27)
    local v28 = nil;
    for _, v30 in pairs(v27) do
        if not v30.isPlayerChoice then
            local v31 = false;
            if v30.assetID ~= nil then
                v31 = false;
                if v30.assetID ~= 0 then
                    v31 = false;
                    if v30.assetID ~= "0" then
                        v31 = string.len((string.gsub(v30.assetID, " ", ""))) > 0;
                    end;
                end;
            end;
            if not v31 then
                v28 = v28 or {};
                v28[v30.assetTypeID] = "OverrideEmpty";
            end;
        end;
    end;
    return v28;
end;
return v0;


local l_GameSettingsExperienceGuidelines_0 = game:GetFastFlag("GameSettingsExperienceGuidelines");
local l_StudioService_0 = game:GetService("StudioService");
local l_GuiService_0 = game:GetService("GuiService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v4 = require(l_Parent_0.Src.Networking.Http);
local v5 = require(l_Parent_0.Src.Util.Analytics);
local v8 = {
    BuildWatchUrl = function(v6)
        return "https://" .. "www.youtube.com" .. string.format("/watch?v=%s", v6);
    end,
    BuildPlaceSettingsUrl = function(v7)
        return v4.BuildRobloxUrl("www", "places/%d/update#", v7);
    end
};
v8.OpenVideo = function(v9)
    l_GuiService_0:OpenBrowserWindow((v8.BuildWatchUrl(v9)));
end;
v8.OpenPlaceSettings = function(v10)
    l_GuiService_0:OpenBrowserWindow((v8.BuildPlaceSettingsUrl(v10)));
end;
v8.OpenLocalizationSettings = function(v11)
    return function()
        l_GuiService_0:OpenBrowserWindow((v4.BuildRobloxUrl("www", "localization/games/%d/configure", v11)));
    end;
end;
getAdditionalArgs = function()
    return {
        userId = l_StudioService_0:GetUserId(),
        machineTimeStamp = os.time()
    };
end;
v8.OpenExperienceGuidelines = function()
    assert(l_GameSettingsExperienceGuidelines_0);
    return function()
        v5.sendEventDeferred("click_learn_more", getAdditionalArgs());
        l_GuiService_0:OpenBrowserWindow((v4.BuildRobloxUrl("create", "docs/production/promotion/experience-guidelines")));
    end;
end;
v8.OpenExperienceQuestionnaire = function(v12)
    assert(l_GameSettingsExperienceGuidelines_0);
    return function()
        v5.sendEventDeferred("click_experience_questionnaire", getAdditionalArgs());
        l_GuiService_0:OpenBrowserWindow((v4.BuildRobloxUrl("create", "dashboard/creations/experiences/%d/experience-questionnaire", v12)));
    end;
end;
return v8;


return {
    Closed = "Closed",
    Open = "Open",
    Working = "Working",
    Error = "Error"
};


THUMBNAIL_WIDTH = 267;
THUMBNAIL_HEIGHT = 150;
return {
    MENU_BAR_WIDTH = 192,
    MENU_ENTRY_HEIGHT = 42,
    FRAME_PADDING = 36,
    CENTER_GUTTER = 180,
    ELEMENT_PADDING = 32,
    RADIO_BUTTON_SIZE = 20,
    RADIO_BUTTON_PADDING = 10,
    CHECKBOX_SIZE = 20,
    CHECKBOX_PADDING = 8,
    BUTTON_WIDTH = 125,
    BUTTON_HEIGHT = 35,
    HEADER_HEIGHT = 45,
    BLUE = Color3.fromRGB(0, 162, 255),
    BLUE_DISABLED = Color3.fromRGB(153, 218, 255),
    BLACK = Color3.new(0, 0, 0),
    WHITE = Color3.new(1, 1, 1),
    ROUNDED_BACKGROUND_IMAGE = "rbxasset://textures/StudioToolbox/RoundedBackground.png",
    ROUNDED_BORDER_IMAGE = "rbxasset://textures/StudioToolbox/RoundedBorder.png",
    ROUNDED_FRAME_SLICE = Rect.new(3, 3, 13, 13),
    ROUND_TEXT_BOX_DEFAULT_HEIGHT = 42,
    GRADIENT_IMAGE = "rbxasset://textures/gradient.png",
    GRADIENT_RECT_SIZE = Vector2.new(512, 256),
    ERROR_IMAGE = "rbxasset://textures/GameSettings/ErrorIcon.png",
    ERROR_COLOR = Color3.new(1, 0.266, 0.266),
    WARNING_IMAGE = "rbxasset://textures/GameSettings/Warning.png",
    MAX_THUMBNAILS = 10,
    VIDEO_PLACEHOLDER = "rbxasset://textures/GameSettings/placeholder.png",
    THUMBNAIL_PREVIEW_SIZE = UDim2.new(0, THUMBNAIL_WIDTH * 2, 0, THUMBNAIL_HEIGHT * 2),
    THUMBNAIL_SIZE = UDim2.new(0, THUMBNAIL_WIDTH, 0, THUMBNAIL_HEIGHT),
    BAD_REQUEST = 400,
    IMAGE_TYPES = {
        "jpg",
        "jpeg",
        "png"
    },
    TEXT_SIZE = 22
};


local l_Workspace_0 = game:GetService("Workspace");
local function _(v1, v2)
    v2 = v2 or false;
    return function()
        local l_GameSettingsFlags_0 = l_Workspace_0:FindFirstChild("GameSettingsFlags");
        if l_GameSettingsFlags_0 and l_GameSettingsFlags_0:FindFirstChild(v1) then
            return l_GameSettingsFlags_0[v1].Value;
        else
            return v2;
        end;
    end;
end;
local v5 = {};
local v6 = nil or false;
local v7 = "EnableRoactConfigs";
local l_v7_0 = v7 --[[ copy: 5 -> 6 ]];
local v9;
do
    local l_v6_0 = v6;
    v9 = function()
        local l_GameSettingsFlags_1 = l_Workspace_0:FindFirstChild("GameSettingsFlags");
        if l_GameSettingsFlags_1 and l_GameSettingsFlags_1:FindFirstChild(l_v7_0) then
            return l_GameSettingsFlags_1[l_v7_0].Value;
        else
            return l_v6_0;
        end;
    end;
end;
v5.EnableRoactConfigs = v9;
v6 = nil or false;
v7 = "RunningUnderCLI";
local l_v7_1 = v7 --[[ copy: 5 -> 7 ]];
do
    local l_v6_1 = v6;
    v9 = function()
        local l_GameSettingsFlags_2 = l_Workspace_0:FindFirstChild("GameSettingsFlags");
        if l_GameSettingsFlags_2 and l_GameSettingsFlags_2:FindFirstChild(l_v7_1) then
            return l_GameSettingsFlags_2[l_v7_1].Value;
        else
            return l_v6_1;
        end;
    end;
end;
v5.RunningUnderCLI = v9;
v6 = nil or false;
v7 = "RunTests";
do
    local l_v6_2 = v6;
    v9 = function()
        local l_GameSettingsFlags_3 = l_Workspace_0:FindFirstChild("GameSettingsFlags");
        if l_GameSettingsFlags_3 and l_GameSettingsFlags_3:FindFirstChild(v7) then
            return l_GameSettingsFlags_3[v7].Value;
        else
            return l_v6_2;
        end;
    end;
end;
v5.RunTests = v9;
return v5;


local v0 = require(script.Parent.Parent.Parent.Packages.Cryo);
local v1 = {};
v1.Merge = function(v2, v3)
    v2 = v2 or {};
    v3 = v3 or {};
    local v4 = {};
    for v5, v6 in pairs(v2) do
        if v3[v5] == nil then
            v4[v5] = v6;
        end;
    end;
    for v7, v8 in pairs(v3) do
        if type(v8) == "table" then
            if v2[v7] ~= nil and type(v2[v7]) == "table" then
                v4[v7] = v1.Merge(v2[v7], v8);
            else
                v4[v7] = v1.Merge(nil, v8);
            end;
        elseif v8 == v0.None then
            v4[v7] = nil;
        else
            v4[v7] = v8;
        end;
    end;
    if next(v4) == nil then
        return nil;
    else
        return v4;
    end;
end;
return v1;


local v0 = tonumber(settings():GetFVariable("FileMaxSizeBytes"));
local l_StudioService_0 = game:GetService("StudioService");
local l_HttpService_0 = game:GetService("HttpService");
local v3 = "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E\r\n" .. "Content-Type: image/%s\r\n" .. "Content-Disposition: form-data; filename=\"%s\"; name=\"request.files\"\r\n" .. "\r\n" .. "%s\r\n" .. "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E--\r\n";
local l_Parent_0 = script.Parent.Parent.Parent;
local v5 = require(l_Parent_0.Src.Components.Dialog.SimpleDialog);
local v6 = require(l_Parent_0.Src.Components.Dialog.ListDialog);
local v7 = require(l_Parent_0.Src.Util.DEPRECATED_Constants);
local v8 = {};
local function v12(_, v10, v11)
    v11(v5, {
        Size = Vector2.new(343, 145),
        Title = v10:getText("General", "SingleImageDialogHeader"),
        Header = v10:getText("General", "SingleImageDialogBody"),
        Buttons = {
            v10:getText("General", "ReplyOK")
        }
    }):await();
end;
local function v17(_, v14, v15, v16)
    v15(v6, {
        Size = Vector2.new(460, 200 + #v16 * 22),
        Title = v14:getText("General", "MultiImageDialogHeader"),
        Header = v14:getText("General", "MultiImageDialogBody", {
            maxThumbnailSize = v0 / 1000000
        }),
        Entries = v16,
        Buttons = {
            v14:getText("General", "ReplyOK")
        },
        Wrapped = false,
        Truncate = Enum.TextTruncate.AtEnd
    }):await();
end;
local function _(v18, v19, v20)
    return {
        [v18] = {
            type = v19.Name,
            name = v18,
            description = v20
        }
    };
end;
local function _(v22, v23, v24, v25)
    return "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E\r\n" .. "Content-Type: application/json\r\n" .. "Content-Disposition: form-data; name=\"config\"; filename=\"config.json\"\r\n" .. "\r\n" .. v22 .. "\r\n" .. "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E\r\n" .. "Content-Disposition: form-data; name=\"" .. v23 .. "\"; filename=\"" .. v23 .. "." .. v24 .. "\"\r\n" .. "Content-Type: application/octet-stream\r\n" .. "\r\n" .. v25 .. "\r\n" .. "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E--\r\n";
end;
v8.PromptForGameIcon = function(v27, v28)
    assert(v28);
    local v29 = l_StudioService_0:PromptImportFile(v7.IMAGE_TYPES);
    if not v29 then
        return ;
    elseif v0 < v29.Size then
        v12(v27, v28);
        return ;
    else
        return v29;
    end;
end;
v8.PromptForThumbnails = function(v30, v31, v32)
    assert(v31 and v32);
    local v33 = l_StudioService_0:PromptImportFiles(v7.IMAGE_TYPES);
    local v34 = {};
    local v35 = {};
    if v33 and #v33 > 0 then
        for _, v37 in ipairs(v33) do
            if v0 < v37.Size then
                table.insert(v34, v37.Name);
            else
                table.insert(v35, v37);
            end;
        end;
        if next(v34) ~= nil then
            v17(v30, v31, v32, v34);
        end;
        return v35;
    else
        return ;
    end;
end;
v8.GetAssetPublishRequestInfo = function(v38, v39)
    local l_v38_BinaryContents_0 = v38:GetBinaryContents();
    local v41 = string.lower(v38.Name);
    return {
        Url = v39,
        Method = "POST",
        Body = string.format(v3, string.sub(v41, string.find(v41, ".", 1, true) + 1), v41, l_v38_BinaryContents_0),
        CachePolicy = Enum.HttpCachePolicy.None,
        Headers = {
            ["Content-Type"] = "multipart/form-data; boundary=EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E"
        }
    };
end;
v8.CreatePostV1AssetsUpload = function(v42, v43, _)
    local l_v42_BinaryContents_0 = v42:GetBinaryContents();
    local v46 = string.lower(v42.Name);
    local v47 = string.find(v46, ".", 1, true);
    local v48 = string.sub(v46, v47 + 1);
    local v49 = string.sub(v42.Name, 1, v47 - 1);
    local v50 = "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E\r\n" .. "Content-Type: application/json\r\n" .. "Content-Disposition: form-data; name=\"config\"; filename=\"config.json\"\r\n" .. "\r\n" .. l_HttpService_0:JSONEncode({
        [v49] = {
            type = Enum.AssetType.Image.Name,
            name = v49,
            description = ""
        }
    }) .. "\r\n" .. "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E\r\n" .. "Content-Disposition: form-data; name=\"" .. v49 .. "\"; filename=\"" .. v49 .. "." .. v48 .. "\"\r\n" .. "Content-Type: application/octet-stream\r\n" .. "\r\n" .. l_v42_BinaryContents_0 .. "\r\n" .. "--EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E--\r\n";
    print(v50);
    return {
        Url = v43,
        Method = "POST",
        Body = v50,
        Headers = {
            ["Content-Type"] = "multipart/form-data; boundary=EA0A21C3-8388-4038-9BD5-92C8B1B7BF8E"
        }
    };
end;
return v8;


return {
    createIsEqualWithTolerance = function(v0)
        return function(v1, v2)
            if not (v1 ~= nil) or v2 == nil then
                return v1 == v2;
            else
                return math.abs(v1 - v2) <= v0;
            end;
        end;
    end
};


local l_game_FastString_0 = game:GetFastString("DevPublishChinaRequirementsLink");
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_RunService_0 = game:GetService("RunService");
local v3 = game:GetService("PluginPolicyService"):getPluginPolicy("GameSettings");
local l_Parent_0 = script.Parent.Parent.Parent;
local v5 = require(l_Parent_0.Packages.Cryo);
local v6 = require(l_Parent_0.Src.Util.KeyProvider);
local v7 = v6.getContextKeyName();
local v8 = v6.getPluginKeyName();
local v9 = v6.getGameSettingsKeyName();
local v12 = {
    getAutoTranslationAllowed = function()
        return v3.AutoTranslationAllowed;
    end,
    getAutoTranslatedLanguages = function()
        return v3.AutoTranslationTargetLanguages;
    end,
    getSocialMediaReferencesAllowed = function()
        return v3.SocialMediaReferencesAllowed;
    end,
    shouldDisablePrivateServersAndPaidAccess = function()
        return v3.DisablePrivateServersAndPaidAccess;
    end,
    shouldAllowBadges = function()
        return v3.ShowBadges;
    end,
    shouldShowDevPublishLocations = function()
        return v3.ShowOptInLocations;
    end,
    getPlayerAppDownloadLink = function(v10)
        return v3.PlayerAppDownloadLink[v10];
    end,
    getOptInLocationsRequirementsLink = function(_)
        return l_game_FastString_0;
    end
};
local function _(v13, v14)
    return {
        [v8] = v13,
        [v7] = v14
    };
end;
v12.sendAnalyticsToKibana = function(v16, v17, v18, v19)
    l_RbxAnalyticsService_0:reportInfluxSeries(v16, v5.Dictionary.join({
        [v8] = v9,
        [v7] = v18
    }, v19), v17);
end;
v12.isTeamCreateEnabled = function()
    return l_RunService_0:IsEdit() and not l_RunService_0:IsServer();
end;
v12.calculateTextSize = function(v20, v21, v22)
    return game:GetService("TextService"):GetTextSize(v20, v21, v22, (Vector2.new(5000, 5000)));
end;
return v12;


return {
    getCopyIdKeyName = function()
        return "CopyIDToClipboard";
    end,
    getConfigureKeyName = function()
        return "Configure";
    end,
    getIsFriendOnlyKeyName = function()
        return "isFriendsOnly";
    end,
    getIsActiveKeyName = function()
        return "isActive";
    end,
    getIsForSaleKeyName = function()
        return "isForSale";
    end,
    getVipServersIsEnabledKeyName = function()
        return "vipServersIsEnabled";
    end,
    getEditKeyName = function()
        return "Edit";
    end,
    getVersionHistoryKeyName = function()
        return "VersionHistory";
    end,
    getOptInLocationsKeyName = function()
        return "OptInLocations";
    end,
    getChinaKeyName = function()
        return "China";
    end,
    getSelectedKeyName = function()
        return "selected";
    end,
    getVoiceChatEnabledKeyName = function()
        return "VoiceChatEnabled";
    end,
    getAvatarChatAudioEnabledKeyName = function()
        return "AvatarChatAudioEnabled";
    end,
    getAvatarChatVideoEnabledKeyName = function()
        return "AvatarChatVideoEnabled";
    end,
    getApprovedKeyName = function()
        return "Approved";
    end,
    getInReviewKeyName = function()
        return "InReview";
    end,
    getRejectedKeyName = function()
        return "Rejected";
    end,
    getPlayerAcceptanceKeyName = function()
        return "PlayerAcceptance";
    end,
    getGameSettingsKeyName = function()
        return "GameSettings";
    end,
    getPluginKeyName = function()
        return "plugin";
    end,
    getContextKeyName = function()
        return "context";
    end,
    getLuobuStudioDevPublishKeyName = function()
        return "LuobuStudioDevPublish";
    end,
    getTermsOfUseDialogKeyName = function()
        return "TermsOfUseDialog";
    end,
    getCheckboxToggleKeyName = function()
        return "CheckboxToggle";
    end,
    getButtonClickedKeyName = function()
        return "buttonClicked";
    end,
    getFooterKeyName = function()
        return "Footer";
    end,
    getScriptCollaborationEnabledOnServerKeyName = function()
        return "ScriptCollaborationEnabledOnServer";
    end,
    getTeamCreateEnabledKeyName = function()
        return "TeamCreateEnabled";
    end
};


return {
    Unloaded = 0,
    Loading = 1,
    LoadFailed = 2,
    Loaded = 3
};


return {
    Unsaved = 0,
    Pending = 1,
    Saving = 2,
    SaveFailed = 3,
    Saved = 4
};


local v0 = {};
local v1 = nil;
v0.isEqual = function(v2, v3)
    if not (v2 ~= nil) or v3 == nil then
        local v4 = false;
        if v2 == nil then
            v4 = v3 == nil;
        end;
        return v4;
    else
        for v5, v6 in pairs(v2) do
            if v6 ~= v3[v5] then
                return false;
            end;
        end;
        return v1(v2) == v1(v3);
    end;
end;
v1 = function(v7)
    local v8 = 0;
    for _, _ in pairs(v7) do
        v8 = v8 + 1;
    end;
    return v8;
end;
return v0;


local v0 = {};
v0.__index = v0;
v0.new = function(v1)
    return (setmetatable({
        __running = false,
        __finished = false,
        __success = nil,
        __results = nil,
        __callback = v1,
        __event = Instance.new("BindableEvent")
    }, v0));
end;
v0.start = function(v2, ...)
    if not v2.__running and not v2.__finished then
        v2.__running = true;
        local v3 = {
            ...
        };
        coroutine.wrap(function()
            local v4 = {
                pcall(v2.__callback, unpack(v3))
            };
            v2.__success = v4[1];
            v2.__results = table.move(v4, 2, #v4, 1, {});
            v2.__running = false;
            v2.__finished = true;
            v2.__event:Fire();
        end)();
        if not (not v2.__finished or v2.__success) then
            error(v2.__results[1], 2);
        end;
        return ;
    else
        return ;
    end;
end;
v0.join = function(v5)
    if not (v5.__finished or v5.__running) then
        error("Attempt to join on unstarted thread", 2);
    end;
    if not v5.__finished then
        v5.__event.Event:Wait();
    end;
    if not v5.__success then
        error(v5.__results[1], 2);
        return ;
    else
        return unpack(v5.__results);
    end;
end;
v0.isAlive = function(v6)
    return v6.__running;
end;
return v0;


local function v0(v1, v2)
    if typeof(v1) ~= typeof(v2) then
        return false;
    elseif #v1 ~= #v2 then
        return false;
    else
        for v3, v4 in pairs(v2) do
            if typeof(v4) ~= typeof(v1[v3]) then
                return false;
            end;
        end;
        for v5, v6 in pairs(v1) do
            if typeof(v6) ~= typeof(v2[v5]) then
                return false;
            elseif typeof(v6) == "table" then
                if not v0(v6, v2[v5]) then
                    return false;
                end;
            elseif v6 ~= v2[v5] then
                return false;
            end;
        end;
        return true;
    end;
end;
return v0;


local v0 = false;
return function()
    if not v0 then
        v0 = true;
        local _ = script.Parent.Parent;
        return ;
    else
        return ;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local l_EnableGuiDevEnv_0 = game:GetFastFlag("EnableGuiDevEnv");
if game:GetService("StudioService"):HasInternalPermission() then
    if l_EnableGuiDevEnv_0 then
        require(script.Parent.commonInit)();
        local v2 = require(l_Parent_0.Packages.Roact);
        local v3 = require(l_Parent_0.Src.MainPlugin);
        local v4 = nil;
        local function _()
            plugin.Name = "Guide";
            v4 = v2.mount((v2.createElement(v3, {
                plugin = plugin
            })));
        end;
        plugin.Unloading:Connect(function()
            if v4 then
                v2.unmount(v4);
                v4 = nil;
            end;
        end);
        plugin.Name = "Guide";
        v4 = v2.mount((v2.createElement(v3, {
            plugin = plugin
        })));
        return ;
    else
        return ;
    end;
else
    return ;
end;


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_Parent_0 = script.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_DockWidget_0 = v3.UI.DockWidget;
local v7 = v2.PureComponent:extend("MainPlugin");
v7.init = function(v8, _)
    v8.onClose = function()
    end;
    v8.onRestore = function(_)
    end;
    v8.mouse = v8.props.plugin:GetMouse();
end;
v7.render = function(v11)
    local l_plugin_0 = v11.props.plugin;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_plugin_0)
    }, {
        MainWidget = v2.createElement(l_DockWidget_0, {
            Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "GuiDevEnv",
            Enabled = false,
            Title = l_plugin_0.Name,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Float,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(250, 200),
            OnClose = v11.onClose,
            ShouldRestore = true,
            OnWidgetRestored = v11.onRestore
        })
    });
end;
return v7;


local l_Workspace_0 = game:GetService("Workspace");
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioService"):HasInternalPermission();
end);
local function _(v3, v4)
    v4 = v4 or false;
    return function()
        local l_PluginTemplateFlags_0 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_0 and l_PluginTemplateFlags_0:FindFirstChild(v3) then
            return l_PluginTemplateFlags_0[v3].Value;
        else
            return v4;
        end;
    end;
end;
local v7 = {};
local v8 = nil or false;
local v9 = "RunningUnderCLI";
local l_v9_0 = v9 --[[ copy: 7 -> 8 ]];
local v11;
do
    local l_v8_0 = v8;
    v11 = function()
        local l_PluginTemplateFlags_1 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_1 and l_PluginTemplateFlags_1:FindFirstChild(l_v9_0) then
            return l_PluginTemplateFlags_1[l_v9_0].Value;
        else
            return l_v8_0;
        end;
    end;
end;
v7.RunningUnderCLI = v11;
v8 = false or false;
v9 = "RunTests";
local l_v9_1 = v9 --[[ copy: 7 -> 9 ]];
do
    local l_v8_1 = v8;
    v11 = function()
        local l_PluginTemplateFlags_2 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_2 and l_PluginTemplateFlags_2:FindFirstChild(l_v9_1) then
            return l_PluginTemplateFlags_2[l_v9_1].Value;
        else
            return l_v8_1;
        end;
    end;
end;
v7.RunTests = v11;
v8 = nil or false;
v9 = "LogTestsQuiet";
local l_v9_2 = v9 --[[ copy: 7 -> 10 ]];
do
    local l_v8_2 = v8;
    v11 = function()
        local l_PluginTemplateFlags_3 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_3 and l_PluginTemplateFlags_3:FindFirstChild(l_v9_2) then
            return l_PluginTemplateFlags_3[l_v9_2].Value;
        else
            return l_v8_2;
        end;
    end;
end;
v7.LogTestsQuiet = v11;
v8 = nil or false;
v9 = "LogAnalytics";
local l_v9_3 = v9 --[[ copy: 7 -> 11 ]];
do
    local l_v8_3 = v8;
    v11 = function()
        local l_PluginTemplateFlags_4 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_4 and l_PluginTemplateFlags_4:FindFirstChild(l_v9_3) then
            return l_PluginTemplateFlags_4[l_v9_3].Value;
        else
            return l_v8_3;
        end;
    end;
end;
v7.LogAnalytics = v11;
v8 = nil or false;
v9 = "RunDeveloperFrameworkTests";
local l_v9_4 = v9 --[[ copy: 7 -> 12 ]];
do
    local l_v8_4 = v8;
    v11 = function()
        local l_PluginTemplateFlags_5 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_5 and l_PluginTemplateFlags_5:FindFirstChild(l_v9_4) then
            return l_PluginTemplateFlags_5[l_v9_4].Value;
        else
            return l_v8_4;
        end;
    end;
end;
v7.RunDeveloperFrameworkTests = v11;
v8 = l_status_0 and l_result_0 or false;
v9 = "EnableRoactConfigs";
do
    local l_v8_5 = v8;
    v11 = function()
        local l_PluginTemplateFlags_6 = l_Workspace_0:FindFirstChild("PluginTemplateFlags");
        if l_PluginTemplateFlags_6 and l_PluginTemplateFlags_6:FindFirstChild(v9) then
            return l_PluginTemplateFlags_6[v9].Value;
        else
            return l_v8_5;
        end;
    end;
end;
v7.EnableRoactConfigs = v11;
return v7;


if plugin then
    require(script.Parent.defineLuaFlags);
    if game:GetFastFlag("DebugAvatarInternalToolsPlugin") then
        local l_status_0, l_result_0 = pcall(function()
            return game:GetService("StudioService"):HasInternalPermission();
        end);
        if l_status_0 and l_result_0 then
            local l_Parent_0 = script.Parent.Parent;
            if not require(l_Parent_0.Src.Util.DebugFlags).RunTests() then
                require(script.Parent.commonInit)();
                local v3 = require(l_Parent_0.Packages.Roact);
                local v4 = require(l_Parent_0.Packages.Framework);
                local v5 = require(l_Parent_0.Src.MainPlugin);
                local v6 = nil;
                local v7 = nil;
                if l_result_0 then
                    v7 = v4.DeveloperTools.forPlugin(l_Parent_0.Name, plugin);
                end;
                local function v8()
                    plugin.Name = l_Parent_0.Name;
                    v6 = v3.mount((v3.createElement(v5, {
                        Plugin = plugin
                    })));
                    if v7 then
                        v7:addRoactTree("Roact tree", v6);
                    end;
                end;
                plugin.Unloading:Connect(function()
                    if v7 then
                        v7:destroy();
                    end;
                    if v6 then
                        v3.unmount(v6);
                        v6 = nil;
                    end;
                end);
                v8();
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


local l_Parent_0 = script.Parent.Parent;
require(script.Parent.commonInit)();
local v1 = require(l_Parent_0.Src.Util.DebugFlags);
if not (not v1.RunningUnderCLI() and not v1.RunTests()) then
    local v2 = require(l_Parent_0.Packages.Dev.TestEZ);
    local l_TestBootstrap_0 = v2.TestBootstrap;
    local v4 = not not _G.TEAMCITY and v2.Reporters.TeamCityReporter or v2.Reporters.TextReporter;
    local l_Src_0 = l_Parent_0.Src;
    local v6 = {
        showTimingInfo = false,
        testNamePattern = nil,
        extraEnvironment = {}
    };
    print("----- All " .. l_Parent_0.Name .. " Tests ------");
    require(script.Parent.defineLuaFlags);
    l_TestBootstrap_0:run({
        l_Src_0
    }, v4, v6);
    print("----------------------------------");
end;
if v1.RunningUnderCLI() then
    pcall(function()
        game:GetService("ProcessService"):ExitAsync(0);
    end);
end;


local l_rhodium_0 = script.Parent.Parent._Index.roblox_rhodium.rhodium;
if l_rhodium_0.ClassName == "ModuleScript" then
    return require(l_rhodium_0);
else
    return l_rhodium_0;
end;


local l_rodux_0 = script.Parent._Index["roblox_rodux-3.0.0"].rodux;
if l_rodux_0.ClassName == "ModuleScript" then
    return require(l_rodux_0);
else
    return l_rodux_0;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_StyledDialog_0 = v2.UI.StyledDialog;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Localization_0 = l_ContextServices_0.Localization;
local v8 = v1.PureComponent:extend("PromptExportNonAccessory");
v8.init = function(v9)
    v9.onClose = function()
        v9.props.onCancel();
    end;
end;
v8.render = function(v10)
    return v1.createElement(l_StyledDialog_0, {
        Title = v10.props.Localization:getText("DialogTitle", "ExportNonAccessory"),
        Buttons = {
            {
                Key = "Export",
                Text = v10.props.Localization:getText("Dialog", "Export"),
                Style = "RoundPrimary"
            },
            {
                Key = "Cancel",
                Text = v10.props.Localization:getText("Dialog", "Cancel"),
                Style = "Round"
            }
        },
        Resizable = false,
        MinContentSize = Vector2.new(0, 0),
        OnButtonPressed = function(v11)
            if v11 == "Export" then
                v10.props.onConfirm();
                return ;
            else
                v10.props.onCancel();
                return ;
            end;
        end,
        OnClose = v10.props.onCancel
    });
end;
return (l_withContext_0({
    Plugin = l_Plugin_0,
    Localization = l_Localization_0
})(v8));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_UI_0 = v2.UI;
local l_PluginButton_0 = l_UI_0.PluginButton;
local l_PluginToolbar_0 = l_UI_0.PluginToolbar;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Localization_0 = l_ContextServices_0.Localization;
local v10 = v1.PureComponent:extend("Toolbar");
v10.renderButtons = function(v11, v12)
    return {
        Export = v1.createElement(l_PluginButton_0, {
            Active = false,
            Toolbar = v12,
            Title = v11.props.Localization:getText("Plugin", "Export"),
            Tooltip = v11.props.Localization:getText("Plugin", "ExportTip"),
            OnClick = v11.props.onExportClicked,
            ClickableWhenViewportHidden = true
        })
    };
end;
v10.render = function(v13)
    return v1.createElement(l_PluginToolbar_0, {
        Title = v13.props.Localization:getText("Plugin", "Name"),
        RenderButtons = function(v14)
            return v13:renderButtons(v14);
        end
    });
end;
return (l_withContext_0({
    Plugin = l_Plugin_0,
    Localization = l_Localization_0
})(v10));


local l_Selection_0 = game:GetService("Selection");
local l_PublishService_0 = game:GetService("PublishService");
return function(v2)
    local v3 = l_Selection_0:Get();
    if v3 then
        for _, v5 in ipairs(v3) do
            l_PublishService_0:PublishDescendantAssets(v5);
            l_Selection_0:Set({
                v5
            });
            v2:PromptSaveSelection(v5.Name);
        end;
        return ;
    else
        return ;
    end;
end;


local l_Selection_0 = game:GetService("Selection");
return function()
    local v1 = l_Selection_0:Get();
    if v1 then
        for _, v3 in ipairs(v1) do
            if not v3:IsA("Accessory") then
                return true;
            end;
        end;
        return false;
    else
        return false;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local v5 = require(l_Parent_0.Src.Resources.MakeTheme);
local v6 = require(l_Parent_0.Src.Components.Toolbar);
local v7 = require(l_Parent_0.Src.Components.PromptExportNonAccessory);
local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
local v10 = require(l_Parent_0.Src.Functions.NonAccessoriesSelected);
local v11 = require(l_Parent_0.Src.Functions.Export);
local v12 = v1.PureComponent:extend("MainPlugin");
v12.init = function(v13, _)
    v13.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "InternalAvatarTools"
    });
    v13:setState({
        promptExportNonAccessoryOpen = false
    });
end;
v12.render = function(v15)
    local l_Plugin_1 = v15.props.Plugin;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_Plugin_1),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        v5(),
        v15.localization
    }, {
        Toolbar = v1.createElement(v6, {
            onExportClicked = function()
                if not v10() then
                    v11(l_Plugin_1);
                    return ;
                else
                    v15:setState({
                        promptExportNonAccessoryOpen = true
                    });
                    return ;
                end;
            end
        }),
        PromptExportNonAccessory = v15.state.promptExportNonAccessoryOpen and v1.createElement(v7, {
            onConfirm = function()
                v11(l_Plugin_1);
                v15:setState({
                    promptExportNonAccessoryOpen = false
                });
            end,
            onCancel = function()
                v15:setState({
                    promptExportNonAccessoryOpen = false
                });
            end
        })
    });
end;
return v12;


local l_Workspace_0 = game:GetService("Workspace");
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioService"):HasInternalPermission();
end);
local function _(v3, v4)
    v4 = v4 or false;
    return function()
        local l_InternalAvatarTools_0 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_0 and l_InternalAvatarTools_0:FindFirstChild(v3) then
            return l_InternalAvatarTools_0[v3].Value;
        else
            return v4;
        end;
    end;
end;
local v7 = {};
local v8 = nil or false;
local v9 = "RunningUnderCLI";
local l_v9_0 = v9 --[[ copy: 7 -> 8 ]];
local v11;
do
    local l_v8_0 = v8;
    v11 = function()
        local l_InternalAvatarTools_1 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_1 and l_InternalAvatarTools_1:FindFirstChild(l_v9_0) then
            return l_InternalAvatarTools_1[l_v9_0].Value;
        else
            return l_v8_0;
        end;
    end;
end;
v7.RunningUnderCLI = v11;
v8 = false or false;
v9 = "RunTests";
local l_v9_1 = v9 --[[ copy: 7 -> 9 ]];
do
    local l_v8_1 = v8;
    v11 = function()
        local l_InternalAvatarTools_2 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_2 and l_InternalAvatarTools_2:FindFirstChild(l_v9_1) then
            return l_InternalAvatarTools_2[l_v9_1].Value;
        else
            return l_v8_1;
        end;
    end;
end;
v7.RunTests = v11;
v8 = nil or false;
v9 = "LogTestsQuiet";
local l_v9_2 = v9 --[[ copy: 7 -> 10 ]];
do
    local l_v8_2 = v8;
    v11 = function()
        local l_InternalAvatarTools_3 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_3 and l_InternalAvatarTools_3:FindFirstChild(l_v9_2) then
            return l_InternalAvatarTools_3[l_v9_2].Value;
        else
            return l_v8_2;
        end;
    end;
end;
v7.LogTestsQuiet = v11;
v8 = nil or false;
v9 = "LogAnalytics";
local l_v9_3 = v9 --[[ copy: 7 -> 11 ]];
do
    local l_v8_3 = v8;
    v11 = function()
        local l_InternalAvatarTools_4 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_4 and l_InternalAvatarTools_4:FindFirstChild(l_v9_3) then
            return l_InternalAvatarTools_4[l_v9_3].Value;
        else
            return l_v8_3;
        end;
    end;
end;
v7.LogAnalytics = v11;
v8 = false or false;
v9 = "RunDeveloperFrameworkTests";
local l_v9_4 = v9 --[[ copy: 7 -> 12 ]];
do
    local l_v8_4 = v8;
    v11 = function()
        local l_InternalAvatarTools_5 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_5 and l_InternalAvatarTools_5:FindFirstChild(l_v9_4) then
            return l_InternalAvatarTools_5[l_v9_4].Value;
        else
            return l_v8_4;
        end;
    end;
end;
v7.RunDeveloperFrameworkTests = v11;
v8 = l_status_0 and l_result_0 or false;
v9 = "EnableRoactConfigs";
do
    local l_v8_5 = v8;
    v11 = function()
        local l_InternalAvatarTools_6 = l_Workspace_0:FindFirstChild("InternalAvatarTools");
        if l_InternalAvatarTools_6 and l_InternalAvatarTools_6:FindFirstChild(v9) then
            return l_InternalAvatarTools_6[v9].Value;
        else
            return l_v8_5;
        end;
    end;
end;
v7.EnableRoactConfigs = v11;
return v7;


local _ = game:GetService("ChangeHistoryService");
local l_Selection_0 = game:GetService("Selection");
local l_Parent_0 = script.Parent.Parent;
local l_ConfirmDialog_0 = require(l_Parent_0.Packages.AvatarToolsShared).Components.ConfirmDialog;
local l_FixAvatarTabPluginsNotLoadingOnNonEnglishBuilds_0 = game:GetFastFlag("FixAvatarTabPluginsNotLoadingOnNonEnglishBuilds");
local v5 = require(l_Parent_0.Src.Util.ShowDialog);
local function _(v6, v7)
    local v8 = true;
    if v7 ~= "" then
        v8 = v6:sub(-#v7) == v7;
    end;
    return v8;
end;
local function _(v10)
    if not (v10.Name:sub(-10) == "Attachment") then
        v10.Name = tostring(v10.Name) .. "Attachment";
    end;
end;
local function v27(v12, v13)
    local v14 = 0;
    if v12:IsA("Model") then
        local v15 = {};
        for _, v17 in pairs(v12:GetDescendants()) do
            if v17:IsA("WrapLayer") then
                table.insert(v15, v17);
            end;
        end;
        if #v15 == 0 then
            table.insert(v13.NoWrapLayerError, v12.Name);
            return v14;
        else
            for _, v19 in ipairs(v15) do
                local l_Parent_1 = v19.Parent;
                if not (not l_Parent_1 or not l_Parent_1:IsA("MeshPart")) then
                    local l_Accessory_0 = Instance.new("Accessory");
                    local v22 = string.lower(l_Parent_1.Name);
                    if not string.match(v22, "left") then
                        if not string.match(v22, "right") then
                            l_Accessory_0.Name = v12.Name;
                        else
                            l_Accessory_0.Name = v12.Name .. "_Right";
                        end;
                    else
                        l_Accessory_0.Name = v12.Name .. "_Left";
                    end;
                    local v23 = l_Parent_1:Clone();
                    local v24 = 0;
                    for _, v26 in pairs(v23:GetDescendants()) do
                        if not ((v26:IsA("WrapLayer") or v26:IsA("SurfaceAppearance")) or v26:IsA("Attachment")) then
                            v26:Destroy();
                        end;
                        if v26:IsA("Attachment") then
                            v24 = v24 + 1;
                            if not (v26.Name:sub(-10) == "Attachment") then
                                v26.Name = tostring(v26.Name) .. "Attachment";
                            end;
                        end;
                    end;
                    v23.Name = "Handle";
                    v23.Parent = l_Accessory_0;
                    l_Accessory_0.Parent = v12.Parent;
                    if v24 == 0 then
                        table.insert(v13.NoAttachmentsError, l_Parent_1.Name);
                        l_Accessory_0:Destroy();
                    else
                        v14 = v14 + 1;
                    end;
                end;
            end;
            return v14;
        end;
    else
        table.insert(v13.IncorrectTypeError, v12.Name);
        return v14;
    end;
end;
local function v32(v28)
    if not v28 or #v28 == 0 then
        return "";
    else
        local v29 = ":\n";
        for v30, v31 in ipairs(v28) do
            v29 = v29 .. v31;
            if v30 ~= #v28 then
                v29 = v29 .. ",\n";
            end;
        end;
        return v29;
    end;
end;
local function v37(v33, v34, v35, v36)
    if not v36 or #v36 > 0 then
        v5(v33, v34, l_ConfirmDialog_0, {
            Text = v35 .. v32(v36),
            Resizable = true
        });
    end;
end;
local function v48(v38, v39, v40)
    local v41 = l_Selection_0:Get();
    if #v41 == 0 then
        v37(v38, v39, v39:getText("ClothesHelper", "NoSelectionError"));
        return ;
    else
        local v42 = {
            NoAttachmentsError = {},
            NoWrapLayerError = {},
            IncorrectTypeError = {}
        };
        local v43 = 0;
        for _, v45 in ipairs(v41) do
            v43 = v43 + v27(v45, v42);
        end;
        v40:getHandler("CreateAccessory")(v43);
        for v46, v47 in pairs(v42) do
            v37(v38, v39, v39:getText("ClothesHelper", v46), v47);
        end;
        return ;
    end;
end;
return {
    init = function(_, v50, v51, v52, v53)
        local l_v51_Button_0 = v51:CreateButton(if not l_FixAvatarTabPluginsNotLoadingOnNonEnglishBuilds_0 then v52:getText("ClothesHelper", "CreateAccessory") else "CreateAccessory", v52:getText("ClothesHelper", "CreateAccessoryTooltip"), "rbxlocaltheme://CreateAccessory");
        l_v51_Button_0.ClickableWhenViewportHidden = true;
        l_v51_Button_0.Click:connect(function()
            v48(v50, v52, v53);
        end);
    end
};


local l_RunService_0 = game:GetService("RunService");
local l_StudioService_0 = game:GetService("StudioService");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
require(script.Parent.defineLuaFlags);
local l_Parent_0 = script.Parent.Parent;
local v4 = require(l_Parent_0.Src.Components.InExperiencePreviewer.InExperiencePreviewerClient);
local v5 = require(l_Parent_0.Src.Components.InExperiencePreviewer.InExperiencePreviewerServer);
local v6 = require(l_Parent_0.Packages.Roact);
local v7 = require(l_Parent_0.Src.Util.DebugFlags);
if require(l_Parent_0.Src.Flags.GetAccessoryToolEngineFeature)() then
    local v8 = v7.RunTests() or v7.RunRhodiumTests();
    v6.setGlobalConfig({});
    if not v8 then
        local v9 = require(l_Parent_0.Src.Components.LayeredClothingEditorPlugin);
        local v10 = nil;
        local function _()
            local l_LayeredClothingEditorPreview_0 = l_ReplicatedStorage_0:FindFirstChild("LayeredClothingEditorPreview");
            if l_LayeredClothingEditorPreview_0 then
                local l_l_LayeredClothingEditorPreview_0_FirstChild_0 = l_LayeredClothingEditorPreview_0:FindFirstChild((tostring(l_StudioService_0:GetUserId())));
                if l_l_LayeredClothingEditorPreview_0_FirstChild_0 then
                    l_l_LayeredClothingEditorPreview_0_FirstChild_0:Destroy();
                end;
                return ;
            else
                return ;
            end;
        end;
        local function v16()
            if not l_RunService_0:IsRunning() then
                if l_RunService_0:IsEdit() then
                    local l_LayeredClothingEditorPreview_1 = l_ReplicatedStorage_0:FindFirstChild("LayeredClothingEditorPreview");
                    if l_LayeredClothingEditorPreview_1 then
                        local l_l_LayeredClothingEditorPreview_1_FirstChild_0 = l_LayeredClothingEditorPreview_1:FindFirstChild((tostring(l_StudioService_0:GetUserId())));
                        if l_l_LayeredClothingEditorPreview_1_FirstChild_0 then
                            l_l_LayeredClothingEditorPreview_1_FirstChild_0:Destroy();
                        end;
                    end;
                end;
                v10 = v6.mount((v6.createElement(v9, {
                    plugin = plugin
                })));
                return ;
            elseif not l_RunService_0:IsClient() then
                v5:init();
                return ;
            else
                v4:init();
                return ;
            end;
        end;
        plugin.Unloading:Connect(function()
            if not l_RunService_0:IsRunning() then
                if v10 then
                    v6.unmount(v10);
                end;
                return ;
            elseif not l_RunService_0:IsClient() then
                v5:shutdown();
                return ;
            else
                v4:shutdown();
                return ;
            end;
        end);
        v16();
        return ;
    else
        return ;
    end;
else
    return ;
end;


local l_ImprovePluginSpeed_LayeredClothingEditor_0 = game:GetFastFlag("ImprovePluginSpeed_LayeredClothingEditor");
local l_Parent_0 = script.Parent.Parent;
local v2 = nil;
local v3 = nil;
if not l_ImprovePluginSpeed_LayeredClothingEditor_0 then
    v2 = require(l_Parent_0.Packages.AvatarToolsShared);
    v3 = l_Parent_0.Packages.LuaMeshEditingModule;
end;
local v4 = require(l_Parent_0.Src.Util.DebugFlags);
local function _()
    local v5 = require(l_Parent_0.Packages.Dev.TestEZ);
    v2.Util.runAvatarToolsSharedTests(v5, not not _G.TEAMCITY and v5.Reporters.TeamCityReporter or v5.Reporters.TextReporter);
end;
local function _()
    local v7 = require(l_Parent_0.Packages.Dev.TestEZ);
    require(v3.Util.runLuaMeshEditingModuleTests)(v7, not not _G.TEAMCITY and v7.Reporters.TeamCityReporter or v7.Reporters.TextReporter);
end;
local function _()
    local v9 = require(l_Parent_0.Packages.Dev.TestEZ);
    v9.TestBootstrap:run({
        l_Parent_0.Src
    }, v9.Reporters.TextReporter);
end;
local function v12()
    local v11 = require(l_Parent_0.Packages.Dev.TestEZ);
    v11.TestBootstrap:run({
        l_Parent_0.RhodiumTests
    }, v11.Reporters.TextReporter, false, true);
end;
local v13 = v4.RunTests();
local v14 = v4.RunRhodiumTests();
if v13 then
    if l_ImprovePluginSpeed_LayeredClothingEditor_0 then
        v2 = require(l_Parent_0.Packages.AvatarToolsShared);
        v3 = l_Parent_0.Packages.LuaMeshEditingModule;
    end;
    print("----- All " .. script.Parent.Parent.Name .. " Tests ------");
    require(script.Parent.defineLuaFlags);
    local v15 = require(l_Parent_0.Packages.Dev.TestEZ);
    v15.TestBootstrap:run({
        l_Parent_0.Src
    }, v15.Reporters.TextReporter);
    print("----------------------------------");
    print("----- All AvatarToolsShared Tests ------");
    v15 = require(l_Parent_0.Packages.Dev.TestEZ);
    v2.Util.runAvatarToolsSharedTests(v15, not not _G.TEAMCITY and v15.Reporters.TeamCityReporter or v15.Reporters.TextReporter);
    print("----------------------------------");
    print("----- All LuaMeshEditingModule Tests ------");
    v15 = require(l_Parent_0.Packages.Dev.TestEZ);
    require(v3.Util.runLuaMeshEditingModuleTests)(v15, not not _G.TEAMCITY and v15.Reporters.TeamCityReporter or v15.Reporters.TextReporter);
    print("----------------------------------");
end;
if v14 then
    print("----- All " .. script.Parent.Parent.Name .. " Rhodium Tests ------");
    v12();
    print("----------------------------------");
end;
if not (not v13 and not v14) then
    game:GetService("ProcessService"):ExitAsync(0);
end;


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        selectedTab = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        accessoryTypeInfo = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        attachmentPoint = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        cagesTransparency = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        categoryFilter = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        isActive = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        message = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        docked = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        draggerType = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        editingCage = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        editingItem = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        inBounds = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        isPlaying = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        size = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        meshScale = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        playhead = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        prebuiltAssetsInfo = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        selectedAssets = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        searchFilter = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        sliderPlayhead = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        toolMode = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        trackLength = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        userAddedAssets = v0
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    return {
        workspacePreviewSelectionEnabled = v0
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Packages.AvatarToolsShared);
local l_PreviewingInfo_0 = v3.Util.AccessoryAndBodyToolShared.PreviewingInfo;
local l_PreviewAnimationPlayback_0 = v3.Components.PreviewAnimationPlayback;
local l_EditingItemContext_0 = v3.Contexts.EditingItemContext;
local l_PreviewContext_0 = v3.Contexts.PreviewContext;
local v8 = require(l_Parent_0.Packages.Framework);
local l_withContext_0 = v8.ContextServices.withContext;
local v10 = v1.PureComponent:extend("AnimationPlaybackWrapper");
local v11 = require(l_Parent_0.Src.Actions.SetPlayhead);
local v12 = require(l_Parent_0.Src.Actions.SetTrackLength);
local v13 = require(l_Parent_0.Src.Actions.SetIsPlaying);
v8.Util.Typecheck.wrap(v10, script);
v10.init = function(v14)
    v14.previewAvatar = {};
end;
v10.updatePreviewAvatar = function(v15)
    local l_PreviewContext_1 = v15.props.PreviewContext;
    local v17 = {
        l_PreviewContext_1:getAvatars()[l_PreviewContext_1:getCurrentPreviewAvatarIndex()]
    };
    if v17 ~= v15.previewAvatar then
        v15.previewAvatar = v17;
        v15:setState({
            temp = {}
        });
    end;
end;
v10.didMount = function(v18)
    v18.previewModelChangedConnection = v18.props.PreviewContext:getAnimationTargetChangedSignal():Connect(function()
        v18:updatePreviewAvatar();
    end);
    v18:updatePreviewAvatar();
end;
v10.render = function(v19)
    local l_props_0 = v19.props;
    return v1.createElement(l_PreviewAnimationPlayback_0, {
        AnimationId = l_props_0.AnimationId,
        IsPlayingOverride = l_props_0.IsPlaying,
        PreviewAvatars = v19.previewAvatar,
        PlayheadOverride = l_props_0.SliderPlayhead,
        OnPlayheadChanged = l_props_0.SetPlayhead,
        OnIsPlayingChanged = l_props_0.SetIsPlaying,
        OnTrackLengthChanged = l_props_0.SetTrackLength
    });
end;
v10.willUnmount = function(v21)
    if v21.previewModelChangedConnection then
        v21.previewModelChangedConnection:Disconnect();
        v21.previewModelChangedConnection = nil;
    end;
end;
return v2.connect(function(v22, _)
    local l_animation_0 = v22.animation;
    return {
        AnimationId = l_PreviewingInfo_0.getPreviewingAnimationId(v22),
        IsPlaying = l_animation_0.IsPlaying,
        Playhead = l_animation_0.Playhead,
        SliderPlayhead = l_animation_0.SliderPlayhead
    };
end, function(v25)
    return {
        SetPlayhead = function(v26)
            v25(v11(v26));
        end,
        SetTrackLength = function(v27)
            v25(v12(v27));
        end,
        SetIsPlaying = function(v28)
            v25(v13(v28));
        end
    };
end)((l_withContext_0({
    EditingItemContext = l_EditingItemContext_0,
    PreviewContext = l_PreviewContext_0
})(v10)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Packages.Cryo);
local v4 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v7 = require(l_Parent_0.Packages.AvatarToolsShared);
local l_Components_0 = v7.Components;
local _ = l_Components_0.FlowScreenLayout;
local l_RadioButtonListDropdown_0 = l_Components_0.RadioButtonListDropdown;
local l_AccessoryAndBodyToolShared_0 = v7.Util.AccessoryAndBodyToolShared;
local l_AssetTypeAttachmentInfo_0 = l_AccessoryAndBodyToolShared_0.AssetTypeAttachmentInfo;
local l_AccessoryUtil_0 = l_AccessoryAndBodyToolShared_0.AccessoryUtil;
local _ = l_AccessoryAndBodyToolShared_0.Constants;
local l_UI_0 = v4.UI;
local _ = l_UI_0.Pane;
local _ = l_UI_0.SelectInput;
local _ = l_UI_0.TextLabel;
local v19 = require(l_Parent_0.Src.Actions.SetAccessoryTypeInfo);
local v20 = require(l_Parent_0.Src.Actions.SetAttachmentPoint);
local v21 = require(l_Parent_0.Src.Util.findLocalizedStringKey);
local v22 = require(l_Parent_0.Src.Util.makeDropdownList);
local v23 = require(l_Parent_0.Src.Util.makeRadioButtonList);
local l_EditingItemContext_0 = v7.Contexts.EditingItemContext;
local l_Util_0 = v4.Util;
local l_Typecheck_0 = l_Util_0.Typecheck;
local l_LayoutOrderIterator_0 = l_Util_0.LayoutOrderIterator;
local _ = l_Util_0.StyleModifier;
local v29 = v1.PureComponent:extend("AssetTypeSelector");
l_Typecheck_0.wrap(v29, script);
local function _(v30)
    return #v3.Dictionary.values(v30.Attachments) > 1;
end;
v29.getInitialRadioButtonListKey = function(v32)
    local l_AccessoryTypeInfo_0 = v32.props.AccessoryTypeInfo;
    if l_AccessoryTypeInfo_0 then
        local l_AssetType_0 = l_AccessoryTypeInfo_0.AssetType;
        if not l_AssetTypeAttachmentInfo_0.Accessory[l_AssetType_0] then
            if l_AssetTypeAttachmentInfo_0.Clothing[l_AssetType_0] then
                v32.initialRadioButtonListKey = "Clothing";
            end;
            return ;
        else
            v32.initialRadioButtonListKey = "Accessory";
            return ;
        end;
    else
        return ;
    end;
end;
v29.setInitialSelectionInfo = function(v35, v36, v37)
    local l_Localization_0 = v35.props.Localization;
    if #v3.Dictionary.values(v37.Attachments) > 1 then
        v35.attachmentListItems = v22(l_Localization_0, "AssetType", v37.Attachments);
        v35.initialMultiAttachmentAsset = {
            [v36] = v37
        };
    end;
end;
v29.initWithPreviousAssetTypeInfo = function(v39)
    local l_props_0 = v39.props;
    local l_AccessoryTypeInfo_1 = l_props_0.AccessoryTypeInfo;
    if l_AccessoryTypeInfo_1 then
        local l_AssetType_1 = l_AccessoryTypeInfo_1.AssetType;
        local v43 = l_props_0.Localization:getText("AssetType", l_AssetType_1);
        local v44 = l_AssetTypeAttachmentInfo_0.Accessory[l_AssetType_1];
        local v45 = l_AssetTypeAttachmentInfo_0.Clothing[l_AssetType_1];
        if not v44 then
            if v45 then
                v39:setInitialSelectionInfo(l_AssetType_1, v45);
                v39.initialSelectedClothingIndex = v3.List.find(v39.clothingItemList, v43);
            end;
        else
            v39:setInitialSelectionInfo(l_AssetType_1, v44);
            v39.initialSelectedAccessoryIndex = v3.List.find(v39.accessoryItemList, v43);
        end;
        if v39.attachmentListItems then
            v39.initialSelectedAttachmentIndex = v3.List.find(v39.attachmentListItems, (l_props_0.Localization:getText("AssetType", l_AccessoryTypeInfo_1.AssetSubType)));
        end;
        return ;
    else
        return ;
    end;
end;
v29.getAssetTypeDropdownProps = function(v46)
    local l_state_0 = v46.state;
    local v48 = {};
    local l_radioButtonListKey_0 = l_state_0.radioButtonListKey;
    local l_selectedAccessoryIndex_0 = l_state_0.selectedAccessoryIndex;
    local l_selectedClothingIndex_0 = l_state_0.selectedClothingIndex;
    if l_radioButtonListKey_0 == "Accessory" then
        v48.Items = v46.accessoryItemList;
        v48.OnItemActivated = v46.onClickAccessoryType;
        v48.SelectedIndex = l_selectedAccessoryIndex_0;
        return v48;
    else
        if l_radioButtonListKey_0 == "Clothing" then
            v48.Items = v46.clothingItemList;
            v48.OnItemActivated = v46.onClickClothingType;
            v48.SelectedIndex = l_selectedClothingIndex_0;
        end;
        return v48;
    end;
end;
v29.getAttachmentDropdownProps = function(v52)
    local l_state_1 = v52.state;
    local l_multiAttachmentAsset_0 = l_state_1.multiAttachmentAsset;
    local l_selectedAttachmentIndex_0 = l_state_1.selectedAttachmentIndex;
    local v56 = {};
    if l_multiAttachmentAsset_0 then
        local v57, v58 = next(l_multiAttachmentAsset_0);
        v56.SubListItems = v52.attachmentListItems;
        v56.OnSubListItemActivated = function(v59, v60)
            v52.onClickAttachment(v57, v59, v58);
            v52:setState({
                selectedAttachmentIndex = v60
            });
        end;
        v56.SubListSelectedIndex = l_selectedAttachmentIndex_0;
    end;
    return v56;
end;
v29.didMount = function(v61)
    local l_Localization_1 = v61.props.Localization;
    v61.accessoryItemList = v22(l_Localization_1, "AssetType", l_AssetTypeAttachmentInfo_0.Accessory);
    v61.clothingItemList = v22(l_Localization_1, "AssetType", l_AssetTypeAttachmentInfo_0.Clothing);
    v61:initWithPreviousAssetTypeInfo();
    v61:setState({
        multiAttachmentAsset = v61.initialMultiAttachmentAsset,
        selectedAttachmentIndex = v61.initialSelectedAttachmentIndex,
        selectedAccessoryIndex = v61.initialSelectedAccessoryIndex,
        selectedClothingIndex = v61.initialSelectedClothingIndex
    });
end;
v29.init = function(v63)
    v63:getInitialRadioButtonListKey();
    v63.state = {
        multiAttachmentAsset = nil,
        radioButtonListKey = v63.initialRadioButtonListKey,
        selectedAttachmentIndex = nil,
        selectedAccessoryIndex = nil,
        selectedClothingIndex = nil
    };
    v63.onRadioButtonClick = function(v64)
        local l_state_2 = v63.state;
        local l_selectedAccessoryIndex_1 = l_state_2.selectedAccessoryIndex;
        local l_selectedClothingIndex_1 = l_state_2.selectedClothingIndex;
        v63:setState({
            radioButtonListKey = v64 or v1.None,
            multiAttachmentAsset = v1.None
        });
        if not (v64 == "Accessory") or not l_selectedAccessoryIndex_1 then
            if not (not (v64 == "Clothing") or not l_selectedClothingIndex_1) then
                v63.onClickClothingType(v63.clothingItemList[l_selectedClothingIndex_1], l_selectedClothingIndex_1);
            end;
            return ;
        else
            v63.onClickAccessoryType(v63.accessoryItemList[l_selectedAccessoryIndex_1], l_selectedAccessoryIndex_1);
            return ;
        end;
    end;
    v63.setAttachment = function(v68, v69, v70)
        if v69 then
            local v71 = v63.props.EditingItemContext:getItem();
            if v71 then
                local v72 = v70[v69];
                v63.props.SetAccessoryTypeInfo(v3.Dictionary.join(v72, {
                    AssetType = v68,
                    AssetSubType = v69
                }));
                local v73 = l_AccessoryUtil_0:getExistingAttachmentPoint(v71, v71.Parent, v72.Name);
                if v73 then
                    v63.props.SetAttachmentPoint(v73);
                end;
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
    v63.onClickAttachment = function(v74, v75, v76)
        local l_props_1 = v63.props;
        if v76 then
            v63.setAttachment(v74, v21(l_props_1.Localization, "AssetType", v75, v76.Attachments), v76.Attachments);
            return ;
        else
            return ;
        end;
    end;
    v63.onClickAssetType = function(v78, v79)
        local l_props_2 = v63.props;
        local l_state_3 = v63.state;
        local l_Localization_2 = l_props_2.Localization;
        if v78 and v79 then
            local v83 = v79[v78];
            if #v3.Dictionary.values(v83.Attachments) > 1 then
                local l_selectedAttachmentIndex_1 = l_state_3.selectedAttachmentIndex;
                v63.attachmentListItems = v22(l_Localization_2, "AssetType", v83.Attachments);
                v63:setState({
                    multiAttachmentAsset = {
                        [v78] = v83
                    }
                });
                if l_selectedAttachmentIndex_1 then
                    v63.onClickAttachment(v78, v63.attachmentListItems[l_selectedAttachmentIndex_1], v83);
                end;
                return ;
            else
                v63.setAttachment(v78, next(v83.Attachments), v83.Attachments);
                v63:setState({
                    multiAttachmentAsset = v1.None
                });
                return ;
            end;
        else
            return ;
        end;
    end;
    v63.onClickAccessoryType = function(v85, v86)
        v63.onClickAssetType(v21(v63.props.Localization, "AssetType", v85, l_AssetTypeAttachmentInfo_0.Accessory), l_AssetTypeAttachmentInfo_0.Accessory);
        v63:setState({
            selectedAccessoryIndex = v86
        });
    end;
    v63.onClickClothingType = function(v87, v88)
        v63.onClickAssetType(v21(v63.props.Localization, "AssetType", v87, l_AssetTypeAttachmentInfo_0.Clothing), l_AssetTypeAttachmentInfo_0.Clothing);
        v63:setState({
            selectedClothingIndex = v88
        });
    end;
end;
v29.render = function(v89)
    local l_props_3 = v89.props;
    local l_state_4 = v89.state;
    local l_LayoutOrder_0 = l_props_3.LayoutOrder;
    local l_Localization_3 = l_props_3.Localization;
    local l_radioButtonListKey_1 = l_state_4.radioButtonListKey;
    local _ = l_LayoutOrderIterator_0.new();
    return v1.createElement(l_RadioButtonListDropdown_0, (v3.Dictionary.join({
        LayoutOrder = l_LayoutOrder_0,
        Buttons = v23(l_Localization_3, "AssetType", l_AssetTypeAttachmentInfo_0),
        OnRadioButtonClick = v89.onRadioButtonClick,
        InitialSelectedKey = l_radioButtonListKey_1
    }, v89:getAssetTypeDropdownProps(), (v89:getAttachmentDropdownProps()))));
end;
return v2.connect(function(v96, _)
    return {
        AccessoryTypeInfo = v96.selectItem.accessoryTypeInfo
    };
end, function(v98)
    return {
        SetAccessoryTypeInfo = function(v99)
            v98(v19(v99));
        end,
        SetAttachmentPoint = function(v100)
            v98(v20(v100));
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    EditingItemContext = l_EditingItemContext_0
})(v29)));