local l_Parent_0 = script.Parent.Parent.Parent;
local l_Util_0 = l_Parent_0.Core.Util;
local v2 = require(l_Parent_0.Libs.Http.Url);
local v3 = require(l_Util_0.Urls);
local v4 = require(l_Util_0.DebugFlags);
local v5 = require(l_Util_0.Analytics.Analytics);
local v6 = require(l_Util_0.AssetConfigConstants);
local v7 = require(l_Util_0.EnumConvert);
local v8 = require(l_Util_0.ToolboxUtilities);
local v9 = require(l_Util_0.getReportUrl);
local l_StudioService_0 = game:GetService("StudioService");
local l_GuiService_0 = game:GetService("GuiService");
local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_HttpService_0 = game:GetService("HttpService");
local v14 = require(script.Parent.isCli);
local v15 = nil;
v15 = if not v14() then game:GetService("AssetManagerService") else {
    GetMeshIdFromAssetId = function(_)
        return 1;
    end,
    GetTextureIdFromAssetId = function(_)
        return 1;
    end
};
local v18 = {};
local _ = function(v19)
    local v20 = nil;
    local l_status_0, _ = pcall(function()
        local v21 = v3.constructAssetIdString(v19);
        if v4.shouldDebugUrls() then
            print(("Inserting decal %s"):format(v21));
        end;
        v20 = game:GetObjects(v21);
    end);
    if (not l_status_0 or not v20) or not v20[1] then
        return 0;
    else
        return v20[1].Texture:match("%d+");
    end;
end;
v18.tryCreateContextMenu = function(v25, v26, v27, v28, v29, v30, v31, v32, v33, v34)
    local v35 = l_HttpService_0:GenerateGUID();
    local l_v25_PluginMenu_0 = v25:CreatePluginMenu((string.format("ToolboxAssetMenu-%s", v35)));
    l_v25_PluginMenu_0:AddNewAction(string.format("OpenInBrowser-%s", v35), v29:getText("General", "RightClickMenuViewInBrowser")).Triggered:connect(function()
        local v37 = nil;
        local v38 = v8.getCreatorMarketplaceWebBaseUrl();
        if not v38 then
            v37 = string.format("%slibrary/%s/asset", l_ContentProvider_0.BaseUrl, l_HttpService_0:urlEncode(v26));
            if v33 then
                v37 = v37 .. "?" .. v2.makeQueryString(v33);
            end;
        else
            v37 = string.format("%sasset/%s", v38, l_HttpService_0:urlEncode(v26));
            if v33 then
                v37 = v37 .. "?" .. v2.makeQueryString({
                    keyword = v33.SearchKeyword,
                    searchId = v33.SearchId,
                    viewFromStudio = true
                });
            end;
        end;
        l_GuiService_0:OpenBrowserWindow(v37);
    end);
    if not v28 and v34 ~= 1 then
        l_v25_PluginMenu_0:AddNewAction(string.format("Report-%s", v35), v29:getText("General", "RightClickMenuReport")).Triggered:connect(function()
            v5.reportAssetClicked(v26, v27);
            local _ = l_ContentProvider_0.BaseUrl;
            l_GuiService_0:OpenBrowserWindow((v9(v26, v27)));
        end);
    end;
    if v27 ~= Enum.AssetType.Plugin.Value then
        local l_v26_0 = v26;
        do
            local l_l_v26_0_0 = l_v26_0;
            if v27 == Enum.AssetType.Decal.Value then
                local v42 = nil;
                local l_status_1, _ = pcall(function()
                    local v43 = v3.constructAssetIdString(v26);
                    if v4.shouldDebugUrls() then
                        print(("Inserting decal %s"):format(v43));
                    end;
                    v42 = game:GetObjects(v43);
                end);
                if (not l_status_1 or not v42) or not v42[1] then
                    l_l_v26_0_0 = 0;
                    --[[ close >= 14 ]]
                else
                    l_l_v26_0_0 = v42[1].Texture:match("%d+");
                    --[[ close >= 14 ]]
                end;
            end;
            l_v25_PluginMenu_0:AddNewAction(string.format("CopyAssetIdToClipboard-%s", v35), v29:getText("General", "RightClickMenuCopyAssetID")).Triggered:connect(function()
                v5.onContextMenuClicked("CopyAssetId", v26, v27, v32);
                l_StudioService_0:CopyToClipboard(l_l_v26_0_0);
            end);
            if v27 == Enum.AssetType.MeshPart.Value then
                local l_status_2, l_result_2 = pcall(v15.GetMeshIdFromAssetId, v15, l_l_v26_0_0);
                local l_status_3, l_result_3 = pcall(v15.GetTextureIdFromAssetId, v15, l_l_v26_0_0);
                if not l_status_2 then
                    warn("Failed to get mesh id for asset id " .. l_l_v26_0_0);
                else
                    l_v25_PluginMenu_0:AddNewAction(string.format("CopyMeshIdToClipboard-%s", v35), v29:getText("General", "RightClickMenuCopyMeshID")).Triggered:connect(function()
                        v5.onContextMenuClicked("CopyMeshId", v26, v27, v32);
                        l_StudioService_0:CopyToClipboard(l_result_2);
                    end);
                end;
                if l_status_3 then
                    l_v25_PluginMenu_0:AddNewAction(string.format("CopyTextureIdToClipboard-%s", v35), v29:getText("General", "RightClickMenuCopyTextureID")).Triggered:connect(function()
                        v5.onContextMenuClicked("CopyTextureId", v26, v27, v32);
                        l_StudioService_0:CopyToClipboard(l_result_3);
                    end);
                end;
            end;
        end;
    end;
    if not (not v28 or not v30) then
        if not v31 then
            l_v25_PluginMenu_0:AddNewAction(string.format("EditAsset-%s", v35), v29:getText("General", "RightClickMenuEditAsset")).Triggered:connect(function()
                v30(v26, v6.FLOW_TYPE.EDIT_FLOW, nil, v7.convertAssetTypeValueToEnum(v27));
            end);
        else
            l_v25_PluginMenu_0:AddNewAction(string.format("PackageDetails-%s", v35), v29:getText("AssetConfigPackagePermissions", "PackageDetails")).Triggered:connect(function()
                v30(v26, v6.FLOW_TYPE.EDIT_FLOW, nil, v7.convertAssetTypeValueToEnum(v27));
            end);
        end;
    end;
    l_v25_PluginMenu_0:ShowAsync();
    l_v25_PluginMenu_0:Destroy();
    return l_v25_PluginMenu_0;
end;
return v18;


local l_Workspace_0 = game:GetService("Workspace");
local function _()
    return l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
end;
local function _()
    local l_ToolboxDebugFlags_0 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
    if not l_ToolboxDebugFlags_0 then
        l_ToolboxDebugFlags_0 = Instance.new("Folder");
        l_ToolboxDebugFlags_0.Name = "ToolboxDebugFlags";
        l_ToolboxDebugFlags_0.Parent = l_Workspace_0;
    end;
    return l_ToolboxDebugFlags_0;
end;
local function _(v4)
    local l_ToolboxDebugFlags_1 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
    if l_ToolboxDebugFlags_1 then
        local l_l_ToolboxDebugFlags_1_FirstChild_0 = l_ToolboxDebugFlags_1:FindFirstChild(v4);
        if not l_l_ToolboxDebugFlags_1_FirstChild_0 then
            return nil;
        else
            return l_l_ToolboxDebugFlags_1_FirstChild_0.Value;
        end;
    else
        return nil;
    end;
end;
local v8 = {};
game:DefineFastFlag("DebugToolboxRunTests", false);
v8.shouldRunTests = function()
    local l_DebugToolboxRunTests_0 = game:GetFastFlag("DebugToolboxRunTests");
    if not l_DebugToolboxRunTests_0 then
        local l_ToolboxDebugFlags_2 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_2 then
            local l_RunTests_0 = l_ToolboxDebugFlags_2:FindFirstChild("RunTests");
            if not l_RunTests_0 then
                l_DebugToolboxRunTests_0 = nil;
            else
                return l_RunTests_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxRunTests_0;
end;
game:DefineFastFlag("DebugToolboxRunRhodiumTests", false);
v8.shouldRunRhodiumTests = function()
    local l_DebugToolboxRunRhodiumTests_0 = game:GetFastFlag("DebugToolboxRunRhodiumTests");
    if not l_DebugToolboxRunRhodiumTests_0 then
        local l_ToolboxDebugFlags_3 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_3 then
            local l_RunRhodiumTests_0 = l_ToolboxDebugFlags_3:FindFirstChild("RunRhodiumTests");
            if not l_RunRhodiumTests_0 then
                l_DebugToolboxRunRhodiumTests_0 = nil;
            else
                return l_RunRhodiumTests_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxRunRhodiumTests_0;
end;
game:DefineFastFlag("DebugToolboxRunJest3Tests", false);
v8.shouldRunJest3Tests = function()
    local l_DebugToolboxRunJest3Tests_0 = game:GetFastFlag("DebugToolboxRunJest3Tests");
    if not l_DebugToolboxRunJest3Tests_0 then
        local l_ToolboxDebugFlags_4 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_4 then
            local l_RunJest3Tests_0 = l_ToolboxDebugFlags_4:FindFirstChild("RunJest3Tests");
            if not l_RunJest3Tests_0 then
                l_DebugToolboxRunJest3Tests_0 = nil;
            else
                return l_RunJest3Tests_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxRunJest3Tests_0;
end;
game:DefineFastFlag("DebugToolboxLogTestsQuiet", false);
v8.logTestsQuiet = function()
    local l_DebugToolboxLogTestsQuiet_0 = game:GetFastFlag("DebugToolboxLogTestsQuiet");
    if not l_DebugToolboxLogTestsQuiet_0 then
        local l_ToolboxDebugFlags_5 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_5 then
            local l_LogTestsQuiet_0 = l_ToolboxDebugFlags_5:FindFirstChild("LogTestsQuiet");
            if not l_LogTestsQuiet_0 then
                l_DebugToolboxLogTestsQuiet_0 = nil;
            else
                return l_LogTestsQuiet_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxLogTestsQuiet_0;
end;
game:DefineFastFlag("DebugToolboxDisableTooltips", false);
v8.shouldDisableTooltips = function()
    local l_DebugToolboxDisableTooltips_0 = game:GetFastFlag("DebugToolboxDisableTooltips");
    if not l_DebugToolboxDisableTooltips_0 then
        local l_ToolboxDebugFlags_6 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_6 then
            local l_ToolboxDisableTooltips_0 = l_ToolboxDebugFlags_6:FindFirstChild("ToolboxDisableTooltips");
            if not l_ToolboxDisableTooltips_0 then
                l_DebugToolboxDisableTooltips_0 = nil;
            else
                return l_ToolboxDisableTooltips_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxDisableTooltips_0;
end;
game:DefineFastFlag("DebugToolboxDebugUrls", false);
v8.shouldDebugUrls = function()
    local l_DebugToolboxDebugUrls_0 = game:GetFastFlag("DebugToolboxDebugUrls");
    if not l_DebugToolboxDebugUrls_0 then
        local l_ToolboxDebugFlags_7 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_7 then
            local l_ToolboxDebugUrls_0 = l_ToolboxDebugFlags_7:FindFirstChild("ToolboxDebugUrls");
            if not l_ToolboxDebugUrls_0 then
                l_DebugToolboxDebugUrls_0 = nil;
            else
                return l_ToolboxDebugUrls_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxDebugUrls_0;
end;
game:DefineFastFlag("DebugToolboxDebugState", false);
v8.shouldDebugState = function()
    local l_DebugToolboxDebugState_0 = game:GetFastFlag("DebugToolboxDebugState");
    if not l_DebugToolboxDebugState_0 then
        local l_ToolboxDebugFlags_8 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_8 then
            local l_ToolboxDebugState_0 = l_ToolboxDebugFlags_8:FindFirstChild("ToolboxDebugState");
            if not l_ToolboxDebugState_0 then
                l_DebugToolboxDebugState_0 = nil;
            else
                return l_ToolboxDebugState_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxDebugState_0;
end;
game:DefineFastFlag("DebugToolboxLogAnalytics", false);
v8.shouldLogAnalytics = function()
    local l_DebugToolboxLogAnalytics_0 = game:GetFastFlag("DebugToolboxLogAnalytics");
    if not l_DebugToolboxLogAnalytics_0 then
        local l_ToolboxDebugFlags_9 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_9 then
            local l_ToolboxLogAnalytics_0 = l_ToolboxDebugFlags_9:FindFirstChild("ToolboxLogAnalytics");
            if not l_ToolboxLogAnalytics_0 then
                l_DebugToolboxLogAnalytics_0 = nil;
            else
                return l_ToolboxLogAnalytics_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxLogAnalytics_0;
end;
game:DefineFastFlag("DebugToolboxDebugWarnings", false);
v8.shouldDebugWarnings = function()
    local l_DebugToolboxDebugWarnings_0 = game:GetFastFlag("DebugToolboxDebugWarnings");
    if not l_DebugToolboxDebugWarnings_0 then
        local l_ToolboxDebugFlags_10 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_10 then
            local l_ToolboxDebugWarnings_0 = l_ToolboxDebugFlags_10:FindFirstChild("ToolboxDebugWarnings");
            if not l_ToolboxDebugWarnings_0 then
                l_DebugToolboxDebugWarnings_0 = nil;
            else
                return l_ToolboxDebugWarnings_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxDebugWarnings_0;
end;
game:DefineFastFlag("DebugToolboxLogSettings", false);
v8.shouldLogSettings = function()
    local l_DebugToolboxLogSettings_0 = game:GetFastFlag("DebugToolboxLogSettings");
    if not l_DebugToolboxLogSettings_0 then
        local l_ToolboxDebugFlags_11 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_11 then
            local l_ToolboxLogSettings_0 = l_ToolboxDebugFlags_11:FindFirstChild("ToolboxLogSettings");
            if not l_ToolboxLogSettings_0 then
                l_DebugToolboxLogSettings_0 = nil;
            else
                return l_ToolboxLogSettings_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxLogSettings_0;
end;
game:DefineFastFlag("DebugToolboxUseTestCustomLocale", false);
v8.shouldUseTestCustomLocale = function()
    local l_DebugToolboxUseTestCustomLocale_0 = game:GetFastFlag("DebugToolboxUseTestCustomLocale");
    if not l_DebugToolboxUseTestCustomLocale_0 then
        local l_ToolboxDebugFlags_12 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_12 then
            local l_ToolboxUseTestCustomLocale_0 = l_ToolboxDebugFlags_12:FindFirstChild("ToolboxUseTestCustomLocale");
            if not l_ToolboxUseTestCustomLocale_0 then
                l_DebugToolboxUseTestCustomLocale_0 = nil;
            else
                return l_ToolboxUseTestCustomLocale_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxUseTestCustomLocale_0;
end;
game:DefineFastFlag("DebugToolboxUseTestRealLocaleId", false);
v8.shouldUseTestRealLocale = function()
    local l_DebugToolboxUseTestRealLocaleId_0 = game:GetFastFlag("DebugToolboxUseTestRealLocaleId");
    if not l_DebugToolboxUseTestRealLocaleId_0 then
        local l_ToolboxDebugFlags_13 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_13 then
            local l_ToolboxUseTestRealLocaleId_0 = l_ToolboxDebugFlags_13:FindFirstChild("ToolboxUseTestRealLocaleId");
            if not l_ToolboxUseTestRealLocaleId_0 then
                l_DebugToolboxUseTestRealLocaleId_0 = nil;
            else
                return l_ToolboxUseTestRealLocaleId_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxUseTestRealLocaleId_0;
end;
game:DefineFastFlag("DebugToolboxDebugOverrideAssetLoading", false);
v8.shouldDebugOverrideAssetLoading = function()
    local l_DebugToolboxDebugOverrideAssetLoading_0 = game:GetFastFlag("DebugToolboxDebugOverrideAssetLoading");
    if not l_DebugToolboxDebugOverrideAssetLoading_0 then
        local l_ToolboxDebugFlags_14 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
        if l_ToolboxDebugFlags_14 then
            local l_ToolboxDebugOverrideAssetLoading_0 = l_ToolboxDebugFlags_14:FindFirstChild("ToolboxDebugOverrideAssetLoading");
            if not l_ToolboxDebugOverrideAssetLoading_0 then
                l_DebugToolboxDebugOverrideAssetLoading_0 = nil;
            else
                return l_ToolboxDebugOverrideAssetLoading_0.Value;
            end;
        else
            return nil;
        end;
    end;
    return l_DebugToolboxDebugOverrideAssetLoading_0;
end;
v8.getOrCreateTestCustomLocale = function()
    local l_ToolboxDebugFlags_15 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
    if not l_ToolboxDebugFlags_15 then
        l_ToolboxDebugFlags_15 = Instance.new("Folder");
        l_ToolboxDebugFlags_15.Name = "ToolboxDebugFlags";
        l_ToolboxDebugFlags_15.Parent = l_Workspace_0;
    end;
    local l_l_ToolboxDebugFlags_15_0 = l_ToolboxDebugFlags_15;
    l_ToolboxDebugFlags_15 = l_l_ToolboxDebugFlags_15_0:FindFirstChild("ToolboxCustomLocale");
    if not l_ToolboxDebugFlags_15 then
        l_ToolboxDebugFlags_15 = Instance.new("StringValue");
        l_ToolboxDebugFlags_15.Name = "ToolboxCustomLocale";
        l_ToolboxDebugFlags_15.Value = "CustomLocale";
        l_ToolboxDebugFlags_15.Parent = l_l_ToolboxDebugFlags_15_0;
    end;
    return l_ToolboxDebugFlags_15;
end;
v8.getOrCreateTestRealLocale = function()
    local l_ToolboxDebugFlags_16 = l_Workspace_0:FindFirstChild("ToolboxDebugFlags");
    if not l_ToolboxDebugFlags_16 then
        l_ToolboxDebugFlags_16 = Instance.new("Folder");
        l_ToolboxDebugFlags_16.Name = "ToolboxDebugFlags";
        l_ToolboxDebugFlags_16.Parent = l_Workspace_0;
    end;
    local l_l_ToolboxDebugFlags_16_0 = l_ToolboxDebugFlags_16;
    l_ToolboxDebugFlags_16 = l_l_ToolboxDebugFlags_16_0:FindFirstChild("ToolboxRealLocale");
    if not l_ToolboxDebugFlags_16 then
        l_ToolboxDebugFlags_16 = Instance.new("StringValue");
        l_ToolboxDebugFlags_16.Name = "ToolboxRealLocale";
        l_ToolboxDebugFlags_16.Value = "en-us";
        l_ToolboxDebugFlags_16.Parent = l_l_ToolboxDebugFlags_16_0;
    end;
    return l_ToolboxDebugFlags_16;
end;
return v8;


local v0 = {
    valueToEnum = {}
};
local function v5(v1)
    if not v0.valueToEnum[v1] then
        local v2 = {};
        for _, v4 in pairs(v1:GetEnumItems()) do
            v2[v4.Value] = v4;
        end;
        v0.valueToEnum[v1] = v2;
    end;
end;
v5(Enum.AssetType);
v0.convertValueToEnum = function(v6, v7)
    v5(v7);
    return v0.valueToEnum[v7][v6];
end;
v0.convertAssetTypeValueToEnum = function(v8)
    return v0.convertValueToEnum(v8, Enum.AssetType);
end;
return v0;


return {
    basePrices = {
        {
            BasePriceId = "Free",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 0,
                    exponent = 0
                }
            }
        },
        {
            BasePriceId = "1",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 4990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "2",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 5990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "3",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 9990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "4",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 10990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "5",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 15990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "6",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 49990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "7",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 79990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "8",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 99990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "9",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 149990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "10",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 199990000000,
                    exponent = -9
                }
            }
        },
        {
            BasePriceId = "11",
            BasePriceMoney = {
                currencyCode = "USD",
                quantity = {
                    significand = 249990000000,
                    exponent = -9
                }
            }
        }
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local v1 = require(l_script_FirstAncestor_0.Core.Util.DebugFlags);
local _ = require(l_script_FirstAncestor_0.Core.Types.MarketplaceFiatServiceTypes);
local v3 = require(l_script_FirstAncestor_0.Packages.Dash);
local v4 = require(l_script_FirstAncestor_0.Core.Util.SharedFlags.getFStringToolboxFiatMonetizableAssetTypesCSV);
local v5 = require(l_script_FirstAncestor_0.Core.Util.SharedFlags.getFFlagToolboxAssetConfigOnboardingLink);
local l_game_EngineFeature_0 = game:GetEngineFeature("ToolboxSampleProductMUS418");
local v7 = {
    ENABLED_ASSET_TYPES = if not v5() then {} else nil,
    MONETIZABLE_ASSET_TYPES = if not v5() then nil else {}
};
local v8 = v4();
local l_status_0, l_result_0 = pcall(function()
    for v9 in v8:gmatch("([^,]+),?") do
        local v10 = Enum.AssetType[v9];
        if not v5() then
            v7.ENABLED_ASSET_TYPES[v10.Name] = true;
        else
            v7.MONETIZABLE_ASSET_TYPES[v10.Name] = true;
        end;
    end;
end);
if not (l_status_0 or not v1.shouldDebugWarnings()) then
    warn(("Fiat error: Asset Type was not found for getFStringToolboxFiatMonetizableAssetTypesCSV: %s"):format(l_result_0));
end;
v7.isFree = function(v13)
    if not l_game_EngineFeature_0 then
        return (v13 and v13.quantity) and v13.quantity.significand == 0;
    elseif v13 and v13.quantity then
        local v14 = true;
        if v13.quantity.significand ~= 0 then
            v14 = v13.quantity.significand == nil;
        end;
        return v14;
    else
        return false;
    end;
end;
v7.calculateQuantity = function(v15)
    if v15 and v15.quantity then
        return v15.quantity.significand * 10 ^ v15.quantity.exponent;
    else
        return ;
    end;
end;
v7.stringFromCurrencyCode = function(v16)
    if v16 == "USD" then
        return "$";
    else
        return v16;
    end;
end;
v7.displayStringFromMoney = function(v17, v18)
    if not v7.isFree(v17) then
        return string.format("%s%.2f", v7.stringFromCurrencyCode(v17.currencyCode), v17.quantity.significand * 10 ^ v17.quantity.exponent);
    elseif not v18 then
        return "Free";
    else
        return (v18:getText("General", "Free"));
    end;
end;
local v19 = {
    [Enum.AssetType.Audio.Value] = "PRODUCT_TYPE_AUDIO",
    [Enum.AssetType.Decal.Value] = "PRODUCT_TYPE_DECAL",
    [Enum.AssetType.FontFamily.Value] = "PRODUCT_TYPE_FONT_FAMILY",
    [Enum.AssetType.MeshPart.Value] = "PRODUCT_TYPE_MESH_PART",
    [Enum.AssetType.Model.Value] = "PRODUCT_TYPE_MODEL",
    [Enum.AssetType.Plugin.Value] = "PRODUCT_TYPE_PLUGIN",
    [Enum.AssetType.Video.Value] = "PRODUCT_TYPE_VIDEO",
    [Enum.AssetType.Package.Value] = "PRODUCT_TYPE_MODEL"
};
v7.convertAssetTypeToProductType = function(v20)
    local v21 = v19[v20];
    if v21 then
        return v21;
    else
        warn(("No product type for asset type %s"):format((tostring(v20))));
        return "PRODUCT_TYPE_INVALID";
    end;
end;
v7.getDefaultFiatProduct = function()
    return {
        basePrice = {
            currencyCode = "USD",
            quantity = {
                significand = 0,
                exponent = 0
            }
        },
        published = false,
        purchasable = false
    };
end;
v7.createPartialFiatProductWithOnlyAssetId = function(v22, v23)
    return {
        audioAssetId = if v23 == Enum.AssetType.Audio then tostring(v22) else nil,
        decalAssetId = if v23 == Enum.AssetType.Decal then tostring(v22) else nil,
        meshPartAssetId = if v23 == Enum.AssetType.MeshPart then tostring(v22) else nil,
        modelAssetId = if not (v23 ~= Enum.AssetType.Model) or v23 == Enum.AssetType.Package then tostring(v22) else nil,
        pluginAssetId = if v23 == Enum.AssetType.Plugin then tostring(v22) else nil,
        videoAssetId = if v23 == Enum.AssetType.Video then tostring(v22) else nil
    };
end;
v7.createFiatProduct = function(v24, v25, v26, v27, v28, v29)
    if v25 and v19[v25.Value] then
        return v3.join(v7.createPartialFiatProductWithOnlyAssetId(v24, v25), {
            basePrice = v26,
            description = v27,
            displayName = v28,
            published = v29
        });
    else
        return nil;
    end;
end;
return v7;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local v1 = require(l_script_FirstAncestor_0.Core.Util.wrapStrictTable);
local v2 = require(l_script_FirstAncestor_0.Core.Util.AssetConfigConstants);
local v3 = require(l_script_FirstAncestor_0.Core.Util.SharedFlags.getFFlagToolboxEnableAssetRows);
return v1({
    ROUNDED_BACKGROUND_IMAGE = "rbxasset://textures/StudioToolbox/RoundedBackground.png",
    ROUNDED_BORDER_IMAGE = "rbxasset://textures/StudioToolbox/RoundedBorder.png",
    ARROW_DOWN_ICON = "rbxasset://textures/StudioToolbox/ArrowDownIconWhite.png",
    SEARCH_ICON = "rbxasset://textures/StudioToolbox/Search.png",
    CLEAR_ICON_HOVER = "rbxasset://textures/StudioToolbox/ClearHover.png",
    CLEAR_ICON = "rbxasset://textures/StudioToolbox/Clear.png",
    WARNING_ICON_SMALL = "rbxasset://textures/StudioToolbox/alert-icon-small.png",
    SCROLLBAR_TOP_IMAGE = "rbxasset://textures/StudioToolbox/ScrollBarTop.png",
    SCROLLBAR_MIDDLE_IMAGE = "rbxasset://textures/StudioToolbox/ScrollBarMiddle.png",
    SCROLLBAR_BOTTOM_IMAGE = "rbxasset://textures/StudioToolbox/ScrollBarBottom.png",
    THUMB = "rbxasset://textures/StudioToolbox/Voting/Thumb.png",
    THUMB_UP_WHITE = "rbxasset://textures/StudioToolbox/Voting/thumbs-up-white.png",
    THUMB_UP_DARK_GRAY = "rbxasset://textures/StudioToolbox/Voting/thumbs-up-dark-gray.png",
    THUMB_UP_GREY = "rbxasset://textures/StudioToolbox/Voting/thumbup.png",
    THUMB_DOWN_GREY = "rbxasset://textures/StudioToolbox/Voting/thumb-down.png",
    THUMB_UP_GREEN = "rbxasset://textures/DeveloperFramework/Votes/rating_up_green.png",
    THUMB_UP_RED = "rbxasset://textures/DeveloperFramework/Votes/rating_up_red.png",
    THUMB_DOWN_RED = "rbxasset://textures/StudioToolbox/Voting/thumbs-down-filled.png",
    AUDIO_PREVIEW_PLAY = "rbxasset://textures/StudioToolbox/AssetPreview/play_button.png",
    AUDIO_PREVIEW_PAUSE = "rbxasset://textures/StudioToolbox/AssetPreview/pause_button.png",
    DROP_SHADOW_IMAGE = "rbxasset://textures/StudioUIEditor/resizeHandleDropShadow.png",
    NO_BACKGROUND_ICON = "rbxasset://textures/StudioToolbox/NoBackgroundIcon.png",
    ENDORSED_BADGE_ICON = "rbxasset://textures/StudioToolbox/EndorsedBadge.png",
    DEPRECATED_TOOLBOX_ICON = "rbxasset://textures/StudioToolbox/ToolboxIcon.png",
    TOOLBOX_ICON = "rbxlocaltheme://Toolbox",
    INFO_ICON = "rbxasset://textures/DevConsole/Info.png",
    ARROW_EXPANDED = "rbxasset://textures/StudioToolbox/ArrowExpanded.png",
    ARROW_COLLAPSED = "rbxasset://textures/StudioToolbox/ArrowCollapsed.png",
    DELETE_BUTTON = "rbxasset://textures/StudioToolbox/DeleteButton.png",
    ROBUX_SMALL = "rbxasset://textures/ui/common/robux_small.png",
    RODUX_GREEN = "rbxasset://textures/ui/RobuxIcon.png",
    LIKES_GREY = "rbxasset://textures/StudioToolbox/AssetPreview/Likes_Grey.png",
    LINK_ARROW = "rbxasset://textures/StudioToolbox/AssetPreview/Link_Arrow.png",
    CLOSE_BUTTON = "rbxasset://textures/StudioToolbox/AssetPreview/close.png",
    SHOW_MORE = "rbxasset://textures/StudioToolbox/AssetPreview/more.png",
    SCRIPT = "rbxasset://textures/StudioToolbox/script.png",
    PACKAGE_DARK = "rbxasset://textures/StudioToolbox/package_dark.png",
    PACKAGE_LIGHT = "rbxasset://textures/StudioToolbox/package_light.png",
    MAGNIFIER_PH = "rbxasset://textures/StudioToolbox/AssetPreview/MAGNIFIER_PH.png",
    SEARCH_OPTIONS = "rbxasset://textures/StudioToolbox/SearchOptions.png",
    RADIO_BUTTON_BACKGROUND = "rbxasset://textures/GameSettings/RadioButton.png",
    RADIO_BUTTON_HIGHLIGHT = "rbxasset://textures/ui/LuaApp/icons/ic-blue-dot.png",
    THUMB_UP = "rbxasset://textures/StudioToolbox/AssetPreview/rating_large.png",
    THUMB_UP_SMALL = "rbxasset://textures/StudioToolbox/AssetPreview/rating_small.png",
    VOTE_DOWN = "rbxasset://textures/StudioToolbox/AssetPreview/vote_down.png",
    VOTE_UP = "rbxasset://textures/StudioToolbox/AssetPreview/vote_up.png",
    Unfavorited = "rbxasset://textures/StudioToolbox/AssetPreview/star_stroke.png",
    Favorited = "rbxasset://textures/StudioToolbox/AssetPreview/star_filled.png",
    HIERARCHY = "rbxasset://textures/StudioToolbox/AssetPreview/hierarchy.png",
    FULLSCREEN = "rbxasset://textures/StudioToolbox/AssetPreview/fullscreen.png",
    FULLSCREEN_EXIT = "rbxasset://textures/StudioToolbox/AssetPreview/fullscreen_exit.png",
    MAKE_CURRENT_VERSION = "rbxasset://textures/StudioToolbox/AssetConfig/selected@2x.png",
    MARKETPLACE_TAB = "rbxasset://textures/StudioToolbox/Tabs/Shop.png",
    INVENTORY_TAB = "rbxasset://textures/StudioToolbox/Tabs/Inventory.png",
    RECENT_TAB = "rbxasset://textures/StudioToolbox/Tabs/Recent.png",
    CREATIONS_TAB = "rbxasset://textures/StudioToolbox/Tabs/MyCreations.png",
    MUSIC_ICON = "rbxasset://textures/StudioToolbox/AudioMusic.png",
    SOUND_EFFECT_ICON = "rbxasset://textures/StudioToolbox/AudioSoundEffect.png",
    MONSTER_CAT_BANNER = "rbxasset://textures/StudioToolbox/Banners/MonsterCat.png",
    OWNED_ICON = "rbxasset://textures/StudioToolbox/ProductOwned.png",
    GENERAL_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/editlisting.png",
    VERSIONS_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/version.png",
    CENTER_PLUS = "rbxasset://textures/StudioToolbox/AssetConfig/CenterPlus.png",
    GRADIENT = "rbxasset://textures/gradient.png",
    WARNING_ICON = "rbxasset://textures/StudioToolbox/AssetConfig/alert-icon-dialog.png",
    TOGGLE_ON_DARK = "rbxasset://textures/RoactStudioWidgets/toggle_on_dark.png",
    TOGGLE_ON_LIGHT = "rbxasset://textures/RoactStudioWidgets/toggle_on_light.png",
    TOGGLE_OFF_DARK = "rbxasset://textures/RoactStudioWidgets/toggle_off_dark.png",
    TOGGLE_OFF_LIGHT = "rbxasset://textures/RoactStudioWidgets/toggle_off_light.png",
    TOGGLE_DISABLE_DARK = "rbxasset://textures/RoactStudioWidgets/toggle_disable_dark.png",
    TOGGLE_DISABLE_LIGHT = "rbxasset://textures/RoactStudioWidgets/toggle_disable_light.png",
    GENERAL_SIDE_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/editlisting.png",
    VERSIONS_SIDE_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/version.png",
    SALES_SIDE_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/creations.png",
    PERMISSIONS_SIDE_TAB = "rbxasset://textures/StudioToolbox/AssetConfig/menu_friends.png",
    SELECTED_CHECK = "rbxasset://textures/StudioToolbox/AssetConfig/readyforsale@2x.png",
    CLOSE_ICON = "rbxasset://textures/StudioSharedUI/close.png",
    CLOSE_ICON_LARGE = "rbxasset://textures/DeveloperFramework/AssetPreview/close_button.png",
    GALLERY_ICON = if not v3() then nil else "rbxasset://textures/StudioToolbox/Gallery.png",
    LIST_ICON = if not v3() then nil else "rbxasset://textures/StudioToolbox/List.png",
    PLACEHOLDER_ICON = "rbxasset://textures/StudioSharedUI/TransparentWhiteImagePlaceholder.png",
    AssetStatus = {
        [v2.ASSET_STATUS.ReviewPending] = "rbxasset://textures/StudioToolbox/AssetPreview/Pending.png",
        [v2.ASSET_STATUS.Moderated] = "rbxasset://textures/StudioToolbox/AssetPreview/Rejected.png",
        [v2.ASSET_STATUS.ReviewApproved] = "rbxasset://textures/StudioToolbox/AssetPreview/ReadyforSale.png",
        [v2.ASSET_STATUS.OnSale] = "rbxasset://textures/StudioToolbox/AssetPreview/OnSale.png",
        [v2.ASSET_STATUS.OffSale] = "rbxasset://textures/StudioToolbox/AssetPreview/OffSale.png",
        [v2.ASSET_STATUS.Free] = "rbxasset://textures/StudioToolbox/AssetPreview/OnSale.png"
    },
    UGCValidationStatus = {
        error = "rbxasset://textures/StudioToolbox/AssetConfig/rejected@2x.png",
        pending = "rbxasset://textures/StudioToolbox/AssetConfig/recent@2x.png",
        success = "rbxasset://textures/StudioToolbox/AssetConfig/selected@2x.png"
    },
    PLUGIN_TEMP = "rbxasset://textures/StudioToolbox/AssetConfig/plugin_temp.png",
    ARROW_SPRITESHEET = "rbxasset://textures/StudioSharedUI/arrowSpritesheet.png",
    AVATAR_MASK = "rbxasset://textures/StudioSharedUI/avatarMask.png",
    DEFAULT_USER_THUMBNAIL = "rbxasset://textures/StudioSharedUI/default_user.png",
    DEFAULT_GROUP_THUMBNAIL = "rbxasset://textures/StudioSharedUI/default_group.png",
    ERROR_ICON = "rbxasset://textures/GameSettings/ErrorIcon.png"
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Core.Util.Analytics.Analytics);
local v2 = require(l_Parent_0.Core.Util.DebugFlags);
local v3 = require(l_Parent_0.Core.Util.InsertToolPromise);
local _ = require(l_Parent_0.Core.Util.isCli);
local _ = require(l_Parent_0.Core.Networking.NetworkInterface);
local v6 = require(l_Parent_0.Core.Util.Urls);
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
local v8 = require(l_Parent_0.Core.Types.Category);
local v9 = require(l_Parent_0.Core.Types.AssetSubTypes);
local l_webKeys_0 = require(l_Parent_0.Core.Util.Permissions.Constants).webKeys;
local l_ToolboxEnableAudioGrantDialog_0 = game:GetFastFlag("ToolboxEnableAudioGrantDialog");
local v12 = game:DefineFastFlag("ToolboxUnifyModelPackageInsertion2", false);
local l_ToolboxSetMarketplaceModelsAsPackagesForIXP3_0 = game:GetFastFlag("ToolboxSetMarketplaceModelsAsPackagesForIXP3");
local l_ToolboxSetMarketplaceModelsAsPackagesForAll_0 = game:GetFastFlag("ToolboxSetMarketplaceModelsAsPackagesForAll");
local l_ToolboxDeleteTempModelFix_0 = game:GetFastFlag("ToolboxDeleteTempModelFix");
local v16 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxListviewAnalytics);
local l_ToolboxVideoUsePermissionInsertion_0 = game:GetFastFlag("ToolboxVideoUsePermissionInsertion");
local l_ToolboxVideoTestUseLocalAudioFile_0 = game:GetFastFlag("ToolboxVideoTestUseLocalAudioFile");
local l_SourceAssetIdInModelChildren_0 = game:GetFastFlag("SourceAssetIdInModelChildren");
local v20 = require(l_Parent_0.Core.Flags.getFFlagToolboxSetParentFix);
local v21 = require(l_Parent_0.Core.Util.ToolboxCommunication);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_InsertService_0 = game:GetService("InsertService");
local l_Selection_0 = game:GetService("Selection");
local l_StarterPack_0 = game:GetService("StarterPack");
local l_Workspace_0 = game:GetService("Workspace");
local l_StudioService_0 = game:GetService("StudioService");
local l_Lighting_0 = game:GetService("Lighting");
local l_MaterialService_0 = game:GetService("MaterialService");
local l_MarketplaceService_0 = game:GetService("MarketplaceService");
local v31 = {
    [Enum.RibbonTool.Move] = true,
    [Enum.RibbonTool.Rotate] = true,
    [Enum.RibbonTool.Scale] = true,
    [Enum.RibbonTool.Select] = true
};
local function v38()
    local l_CurrentCamera_0 = l_Workspace_0.CurrentCamera;
    local v33 = l_CurrentCamera_0.ViewportSize / 2;
    local v34 = l_CurrentCamera_0:ViewportPointToRay(v33.X, v33.Y, 0);
    local v35 = Ray.new(v34.Origin, v34.Direction * 2048);
    local v36 = RaycastParams.new();
    v36.BruteForceAllSlow = true;
    local v37 = l_Workspace_0:Raycast(v35.Origin, v35.Direction, v36);
    if not v37 then
        return l_CurrentCamera_0.CFrame.p + v34.Direction * 64;
    else
        return v37.Position;
    end;
end;
local function v43(v39, v40)
    if not ((not v39 or not v40) or not v39:IsA("Folder")) then
        for _, v42 in ipairs(v39:GetChildren()) do
            if v42:IsA("Model") then
                v42.SourceAssetId = v40;
            end;
        end;
    end;
end;
local function v47(v44, v45)
    if game.GameId == 0 then
        return ;
    else
        return v45:grantAssetPermissionWithTimeout(v44, {
            requests = {
                {
                    action = l_webKeys_0.UseAction,
                    subjectId = game.GameId,
                    subjectType = l_webKeys_0.Universe
                }
            }
        }):catch(function(v46)
            return v46;
        end):await();
    end;
end;
local function v55(v48, v49, v50, v51, v52, v53)
    if game.GameId == 0 then
        return ;
    elseif v51 then
        if not l_MarketplaceService_0:GetProductInfo(v49, Enum.InfoType.Asset).IsPublicDomain then
            if v50 ~= Enum.AssetType.Audio.Value then
                error("Only support for fetching permissions on Audio is implemented at this time.");
            end;
            if v51:promptPermissionsGrantAndWait({
                assetName = v48,
                assetId = v49,
                assetType = v52:getText("General", "AssetTypeAudio")
            }) then
                local v54 = v47(v49, v53);
                if (((v54 ~= nil and v54.Body ~= nil) and v54.Body.Error ~= nil) and v54.Body.Error.Code ~= nil) and v54.Body.Error.Code ~= 4 then
                    warn(v52:getText("GrantAssetPermission", "Failure", {
                        assetId = v49
                    }));
                    return ;
                else
                    print(v52:getText("GrantAssetPermission", "Success", {
                        assetId = v49
                    }));
                end;
            end;
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
end;
local function v63(v56, v57, v58, v59, v60)
    local v61 = v6.constructAssetIdString(v56);
    if v2.shouldDebugUrls() then
        print(("Inserting sound %s"):format(v61));
    end;
    v47(v56, v60);
    local l_Sound_0 = Instance.new("Sound");
    l_Sound_0.SourceAssetId = v56;
    l_Sound_0.SoundId = v61;
    l_Sound_0.Name = v57;
    l_Sound_0.Parent = (l_Selection_0:Get() or {})[1] or l_Workspace_0;
    l_Selection_0:Set({
        l_Sound_0
    });
    if l_ToolboxEnableAudioGrantDialog_0 then
        v55(v57, v56, Enum.AssetType.Audio.Value, v58, v59, v60);
    end;
    return l_Sound_0;
end;
local function v71(v64, v65, v66)
    local v67 = false;
    local v68 = {};
    for _, v70 in ipairs(v65) do
        if not v70:IsA("MeshPart") then
            v70:Destroy();
            v67 = true;
        else
            if #v70:GetChildren() > 0 then
                v70:ClearAllChildren();
                v67 = true;
            end;
            table.insert(v68, v70);
        end;
    end;
    if v67 then
        v1.reportMeshPartFiltered(v64);
    end;
    if #v68 == 0 then
        warn(v66:getText("Common", "InsertAborted", {
            assetId = v64
        }));
    end;
    return v68;
end;
local _ = function(v72, v73, v74)
    return l_Promise_0.new(function(v75, _)
        local function v79()
            for _, v78 in ipairs(v73) do
                v78:Destroy();
            end;
            v75(false);
        end;
        local function v80()
            v75(true);
        end;
        if not v73 then
            v75(true);
        end;
        if not v74 then
            v75(true);
        end;
        local v81 = 0;
        for _, v83 in ipairs(v73) do
            if v83:IsA("Script") then
                v81 = v81 + 1;
            end;
            for _, v85 in ipairs(v83:GetDescendants()) do
                if v85:IsA("Script") then
                    v81 = v81 + 1;
                end;
            end;
        end;
        if v81 < 1 then
            v75(true);
        end;
        if v81 >= 1 then
            v74:promptScriptWarningAndWait({
                assetName = v72,
                numScripts = v81,
                cancel = v79,
                insert = v80
            });
        end;
        if l_ToolboxDeleteTempModelFix_0 then
            v75(true);
        end;
    end);
end;
local function v97(v87, v88, v89, v90, v91)
    for _, v93 in ipairs(v89) do
        if not v93:IsA("Sky") and not v93:IsA("Atmosphere") then
            if not v9.contains(v90, v9.MaterialPack) then
                local l_v88_0 = v88;
                if not (not v93:IsA("Tool") and not v93:IsA("HopperBin")) then
                    local v95 = v87:promptAndWait();
                    if v95 == v3.INSERT_TO_WORKSPACE then
                        l_v88_0 = v88;
                    elseif v95 == v3.INSERT_TO_STARTER_PACK then
                        l_v88_0 = l_StarterPack_0;
                    elseif v95 == v3.INSERT_CANCELLED then
                        l_v88_0 = nil;
                    end;
                end;
                do
                    local l_l_v88_0_0 = l_v88_0;
                    if not v20() then
                        v93.Parent = l_l_v88_0_0;
                        if not v93.Parent then
                            v93:Destroy();
                        end;
                    else
                        xpcall(function()
                            if not game:GetService(v93.ClassName) then
                                v93.Parent = l_l_v88_0_0;
                                if not v93.Parent then
                                    v93:Destroy();
                                end;
                                return ;
                            else
                                if v2.shouldDebugWarnings() then
                                    warn((("Attempted to insert unsupported service type: %*"):format(v93.ClassName)));
                                end;
                                return ;
                            end;
                        end, function()
                            if not (not v93 or not v2.shouldDebugWarnings()) then
                                warn((("Attempted to insert unsupported instance type: %*"):format(v93.ClassName)));
                            end;
                        end);
                    end;
                end;
            else
                v93.Parent = l_MaterialService_0;
            end;
        else
            v93.Parent = l_Lighting_0;
        end;
        v91[#v91 + 1] = v93;
    end;
end;
local function v105(v98, v99)
    if v98 then
        if #v98:GetChildren() > 0 then
            v98:MoveTo(v99);
            local l_v98_BoundingBox_0, v101 = v98:GetBoundingBox();
            if v101.Magnitude > 0 then
                local l_CurrentCamera_1 = l_Workspace_0.CurrentCamera;
                l_CurrentCamera_1.CFrame = CFrame.new(l_v98_BoundingBox_0.p + (v101.Magnitude * 1.2) * (l_CurrentCamera_1.CFrame.p - l_v98_BoundingBox_0.p).unit);
                l_CurrentCamera_1.Focus = CFrame.new(l_v98_BoundingBox_0.p);
            end;
            for _, v104 in ipairs(v98:GetChildren()) do
                v104.Parent = v98.Parent;
            end;
        end;
        v98:Destroy();
    end;
end;
local function v114(v106, v107, v108, v109, v110, v111, v112)
    local v113 = {};
    if not v107 then
        if v2.shouldDebugWarnings() then
            print("destroying temp model insert");
        end;
        v109:Destroy();
    else
        v97(v108, v109, v110, v111, v113);
        v105(v109, v112);
        v21:fire("AssetInserted", {
            assetId = v106,
            assetInstance = v110
        });
    end;
    l_Selection_0:Set(v113);
    return v113;
end;
local function v145(v115, v116, v117, v118, v119, v120, v121, v122, v123)
    local l_l_Workspace_0_0 = l_Workspace_0;
    local v125 = if (v12 or l_ToolboxSetMarketplaceModelsAsPackagesForAll_0) or v122 then (v9.contains(v120, v9.Package) or v121 ~= nil and v8.categoryIsPackage(v121)) or v122 and v8.getCategoryByName(v121) == v8.FREE_MODELS else nil;
    local v126 = nil;
    local l_status_0, l_result_0 = pcall(function()
        local v127 = v6.constructAssetIdString(v115);
        if not (v12 or l_ToolboxSetMarketplaceModelsAsPackagesForAll_0) and not v122 then
            if v2.shouldDebugUrls() then
                print(("Inserting asset %s"):format(v127));
            end;
            v126 = game:InsertObjectsAndJoinIfLegacyAsync(v127);
            return ;
        elseif not v125 then
            if v2.shouldDebugUrls() then
                print(("Inserting asset %s"):format(v127));
            end;
            v126 = game:InsertObjectsAndJoinIfLegacyAsync(v127);
            return ;
        else
            if v2.shouldDebugUrls() then
                print(("Inserting package %s"):format(v127));
            end;
            v126 = l_InsertService_0:LoadPackageAssetAsync(v127);
            return ;
        end;
    end);
    if not l_status_0 or not v126 then
        return nil, l_result_0;
    else
        if not ((not v12 and not v122 or not v125) or not v126[1]) then
            v126[1].SourceAssetId = v115;
        end;
        if not ((not l_SourceAssetIdInModelChildren_0 or not v126[1]) or not v126[1].SourceAssetId) then
            v43(v126[1], v115);
        end;
        local v130 = if not (v123 and v123.positionOverride) then v38() else v123.positionOverride;
        local l_Model_0 = Instance.new("Model");
        l_Model_0.Name = "ToolboxTemporaryInsertModel";
        l_Model_0.Parent = l_l_Workspace_0_0;
        if v118 == Enum.AssetType.MeshPart.Value then
            v126 = v71(v115, v126, v119);
        end;
        local l_v126_0 = v126;
        return l_Promise_0.new(function(v133, _)
            local function v137()
                for _, v136 in ipairs(l_v126_0) do
                    v136:Destroy();
                end;
                v133(false);
            end;
            local function v138()
                v133(true);
            end;
            if not l_v126_0 then
                v133(true);
            end;
            if not v117 then
                v133(true);
            end;
            local v139 = 0;
            for _, v141 in ipairs(l_v126_0) do
                if v141:IsA("Script") then
                    v139 = v139 + 1;
                end;
                for _, v143 in ipairs(v141:GetDescendants()) do
                    if v143:IsA("Script") then
                        v139 = v139 + 1;
                    end;
                end;
            end;
            if v139 < 1 then
                v133(true);
            end;
            if v139 >= 1 then
                v117:promptScriptWarningAndWait({
                    assetName = v116,
                    numScripts = v139,
                    cancel = v137,
                    insert = v138
                });
            end;
            if l_ToolboxDeleteTempModelFix_0 then
                v133(true);
            end;
        end):andThen(function(v144)
            if v2.shouldDebugWarnings() then
                print(("assetWasInserted: %s"):format((tostring(v144))));
            end;
            return (v114(v115, v144, v117, l_Model_0, v126, v120, v130));
        end):await();
    end;
end;
local function v154(_, v147, v148)
    local v149 = nil;
    local l_status_1, l_result_1 = pcall(function()
        local v150 = v6.constructAssetIdString(v147);
        if v2.shouldDebugUrls() then
            print(("Inserting decal %s"):format(v150));
        end;
        v149 = game:GetObjectsAsync(v150);
    end);
    if (not l_status_1 or not v149) or not v149[1] then
        return nil, l_result_1;
    else
        local v153 = v149[1];
        v153.Name = v148;
        v153.SourceAssetId = v147;
        v153.Parent = (l_Selection_0:Get() or {})[1] or l_Workspace_0;
        l_Selection_0:Set({
            v153
        });
        return v153;
    end;
end;
local function v160(v155)
    local v156 = nil;
    local l_status_2, l_result_2 = pcall(function()
        local v157 = v6.constructAssetIdString(v155);
        if v2.shouldDebugUrls() then
            print(("Inserting package %s"):format(v157));
        end;
        v156 = l_InsertService_0:LoadPackageAssetAsync(v157);
    end);
    if (not l_status_2 or not v156) or not v156[1] then
        return nil, l_result_2;
    else
        v156[1].SourceAssetId = v155;
        v156[1].Parent = (l_Selection_0:Get() or {})[1] or l_Workspace_0;
        l_Selection_0:set(v156);
        return v156[1];
    end;
end;
local v161 = nil;
v161 = l_ToolboxVideoUsePermissionInsertion_0 and function(v162, v163, v164)
    local v165 = v6.constructAssetIdString(v162);
    if v2.shouldDebugUrls() then
        print(("Inserting video %s"):format(v165));
    end;
    v47(v162, v164);
    local v166 = l_Selection_0:Get()[1];
    local l_VideoFrame_0 = Instance.new("VideoFrame");
    l_VideoFrame_0.SourceAssetId = v162;
    l_VideoFrame_0.Video = v165;
    l_VideoFrame_0.Name = v163;
    l_VideoFrame_0.Parent = v166 or l_Workspace_0;
    l_VideoFrame_0.Size = UDim2.new(1, 0, 1, 0);
    l_Selection_0:Set({
        l_VideoFrame_0
    });
    return l_VideoFrame_0;
end or function(v168, v169)
    local v170 = v6.constructAssetIdString(v168);
    if v2.shouldDebugUrls() then
        print(("Inserting video %s"):format(v170));
    end;
    local l_VideoFrame_1 = Instance.new("VideoFrame");
    l_VideoFrame_1.SourceAssetId = v168;
    l_VideoFrame_1.Video = v170;
    l_VideoFrame_1.Name = v169;
    l_VideoFrame_1.Parent = (l_Selection_0:Get() or {})[1] or l_Workspace_0;
    l_VideoFrame_1.Size = UDim2.new(1, 0, 1, 0);
    l_Selection_0:Set({
        l_VideoFrame_1
    });
    return l_VideoFrame_1;
end;
local function v176(_, _)
    local l_status_3, l_result_3 = pcall(function()
    end);
    return l_status_3, l_result_3;
end;
local function v182(v177, v178, _)
    local l_status_4, l_result_4 = pcall(function()
        if v2.shouldDebugUrls() then
            print(("Installing plugin %s"):format((tostring(v177))));
        end;
        if not l_StudioService_0 then
            warn("StudioService not found");
            return ;
        else
            l_StudioService_0:TryInstallPlugin(v177, v178);
            return ;
        end;
    end);
    return l_status_4, l_result_4;
end;
local function v184(v183)
    if v183 == Enum.AssetType.Model.Value then
        return "Model";
    elseif v183 == Enum.AssetType.Decal.Value then
        return "Decal";
    elseif v183 == Enum.AssetType.Audio.Value then
        return "Audio";
    elseif v183 == Enum.AssetType.FontFamily.Value then
        return "FontFamily";
    elseif v183 == Enum.AssetType.MeshPart.Value then
        return "Mesh";
    elseif v183 == Enum.AssetType.Plugin.Value then
        return "Plugin";
    elseif v183 == Enum.AssetType.Video.Value then
        return "Video";
    elseif v183 == Enum.AssetType.Animation.Value then
        return "Animation";
    else
        if v2.shouldDebugWarnings() then
            warn(("Missing name for assetTypeId %s"):format((tostring(v183))));
        end;
        return "Unknown";
    end;
end;
local function v190(v185, v186, v187)
    local v188 = if v185.assetSubTypes ~= nil then v9.contains(v185.assetSubTypes, v9.Package) else v8.categoryIsPackage(v185.categoryName);
    local v189 = l_ToolboxSetMarketplaceModelsAsPackagesForAll_0 or (l_ToolboxSetMarketplaceModelsAsPackagesForIXP3_0 and v185.getIsIXPVariableEnabled) and v185.getIsIXPVariableEnabled("MarketplaceModelsAsPackages", "MarketplaceModelsAsPackagesEnabled");
    if (v12 or v189) or not v188 then
        if v185.assetTypeId == Enum.AssetType.Audio.Value then
            return (v63(v185.assetId, v185.assetName, v186, v185.localization, v187));
        elseif v185.assetTypeId == Enum.AssetType.Decal.Value then
            return v154(v185.plugin, v185.assetId, v185.assetName);
        elseif v185.assetTypeId == Enum.AssetType.Plugin.Value then
            return v182(v185.assetId, v185.assetVersionId, v185.assetName);
        elseif v185.assetTypeId == Enum.AssetType.Video.Value then
            if not l_ToolboxVideoUsePermissionInsertion_0 then
                return v161(v185.assetId, v185.assetName);
            else
                return v161(v185.assetId, v185.assetName, v187);
            end;
        elseif v185.assetTypeId == Enum.AssetType.FontFamily.Value then
            return v176(v185.assetId, v185.assetName);
        elseif not l_ToolboxSetMarketplaceModelsAsPackagesForIXP3_0 then
            return v145(v185.assetId, v185.assetName, v186, v185.assetTypeId, v185.localization, v185.assetSubTypes, v185.categoryName, nil, v185.tutorialLimits);
        else
            return v145(v185.assetId, v185.assetName, v186, v185.assetTypeId, v185.localization, v185.assetSubTypes, v185.categoryName, v189, v185.tutorialLimits);
        end;
    else
        return v160(v185.assetId);
    end;
end;
local function v194(v191, v192)
    v1.incrementToolboxInsertCounter((v184(v191.assetTypeId)));
    local l_categoryName_0 = v191.categoryName;
    v1.incrementToolboxCategoryInsertCounter(l_categoryName_0);
    if v192 then
        v1.onAssetDragInserted(v191.assetId, v191.searchTerm, v191.assetIndex, l_categoryName_0);
    elseif not v16() then
        v1.onAssetInserted(v191.assetId, v191.searchTerm, v191.assetIndex, l_categoryName_0);
    else
        v1.onAssetInserted(v191.assetId, v191.searchTerm, v191.assetIndex, l_categoryName_0, v191.layoutMode);
    end;
    v1.incrementWorkspaceInsertCounter();
end;
local v195 = {
    _localization = nil,
    registerLocalization = nil,
    registerProcessDragHandler = nil
};
local v196 = nil;
v195.tryInsert = function(v197, v198, v199, v200)
    if not v199 then
        local v201, v202 = v195.doInsertAsset(v197, v198, v200);
        return v201, v202;
    else
        if not v31[v197.plugin:GetSelectedRibbonTool()] then
            v197.plugin:SelectRibbonTool(Enum.RibbonTool.Select, UDim2.new());
        end;
        v196 = {
            assetName = v197.assetName,
            assetId = v197.assetId,
            assetTypeId = if not l_ToolboxEnableAudioGrantDialog_0 then nil else v197.assetTypeId,
            assetSubTypes = v197.assetSubTypes,
            localization = if not l_ToolboxEnableAudioGrantDialog_0 then nil else v195._localization,
            insertToolPromise = v198,
            onSuccess = v197.onSuccess
        };
        v195.doDragInsertAsset(v197);
        return ;
    end;
end;
v195.doInsertAsset = function(v203, v204, v205)
    local l_assetId_0 = v203.assetId;
    local l_assetName_0 = v203.assetName;
    local l_assetTypeId_0 = v203.assetTypeId;
    if v2.shouldDebugWarnings() then
        print(("Inserting asset %s %s"):format(tostring(l_assetId_0), (tostring(l_assetName_0))));
    end;
    if not l_ToolboxVideoTestUseLocalAudioFile_0 then
        l_ChangeHistoryService_0:SetWaypoint(("Before insert asset %d"):format(l_assetId_0));
    else
        l_ChangeHistoryService_0:SetWaypoint(("Before insert asset %s"):format((tostring(l_assetId_0))));
    end;
    v203.localization = v195._localization;
    local v209, v210 = v190(v203, v204, v205);
    if l_assetTypeId_0 == Enum.AssetType.Plugin.Value then
        if not l_ToolboxVideoTestUseLocalAudioFile_0 then
            l_ChangeHistoryService_0:SetWaypoint(("After attempt to install plugin %d"):format(l_assetId_0));
        else
            l_ChangeHistoryService_0:SetWaypoint(("After attempt to install plugin %s"):format((tostring(l_assetId_0))));
        end;
        v194(v203, false);
        if v203.onSuccess then
            v203.onSuccess(l_assetId_0, nil);
            return v209, v210;
        end;
    elseif not v209 then
        if not l_ToolboxVideoTestUseLocalAudioFile_0 then
            warn(("Toolbox failed to insert asset %d %s: %s"):format(l_assetId_0, l_assetName_0, v210 or ""));
        else
            warn(("Toolbox failed to insert asset %s %s: %s"):format(tostring(l_assetId_0), l_assetName_0, v210 or ""));
            return v209, v210;
        end;
    else
        if not l_ToolboxVideoTestUseLocalAudioFile_0 then
            l_ChangeHistoryService_0:SetWaypoint(("After insert asset %d"):format(l_assetId_0));
        else
            l_ChangeHistoryService_0:SetWaypoint(("After insert asset %s"):format((tostring(l_assetId_0))));
        end;
        v194(v203, false);
        if v203.onSuccess then
            v203.onSuccess(l_assetId_0, v209);
            return v209, v210;
        end;
    end;
    return v209, v210;
end;
v195.doDragInsertAsset = function(v211)
    local l_assetId_1 = v211.assetId;
    local l_assetName_1 = v211.assetName;
    if v211.assetTypeId == Enum.AssetType.Plugin.Value then
        return ;
    else
        if v2.shouldDebugWarnings() then
            print(("Inserting asset %s %s"):format(tostring(l_assetId_1), (tostring(l_assetName_1))));
        end;
        if not l_ToolboxVideoTestUseLocalAudioFile_0 then
            l_ChangeHistoryService_0:SetWaypoint(("Before insert asset %d"):format(l_assetId_1));
        else
            l_ChangeHistoryService_0:SetWaypoint(("Before insert asset %s"):format((tostring(l_assetId_1))));
        end;
        local l_status_5, l_result_5 = pcall(function()
            v211.plugin.UsesAssetInsertionDrag = true;
            local v214 = l_ToolboxSetMarketplaceModelsAsPackagesForAll_0 or (l_ToolboxSetMarketplaceModelsAsPackagesForIXP3_0 and v211.getIsIXPVariableEnabled) and v211.getIsIXPVariableEnabled("MarketplaceModelsAsPackages", "MarketplaceModelsAsPackagesEnabled");
            local _ = nil;
            local v216 = v6.constructAssetGameAssetIdUrl(l_assetId_1, v211.assetTypeId, if not v214 then if v211.assetSubTypes ~= nil then v9.contains(v211.assetSubTypes, v9.Package) else v8.categoryIsPackage(v211.categoryName) else (v8.categoryIsPackage(v211.categoryName) or v211.assetSubTypes and v9.contains(v211.assetSubTypes, v9.Package)) or v8.getCategoryByName(v211.categoryName) == v8.FREE_MODELS, l_assetName_1);
            if v2.shouldDebugUrls() then
                print(("Dragging asset url %s"):format(v216));
            end;
            v211.plugin:StartDrag({
                Sender = "LuaToolbox",
                MimeType = "text/plain",
                Data = v216
            });
        end);
        if not l_status_5 then
            if not l_ToolboxVideoTestUseLocalAudioFile_0 then
                warn(("Toolbox failed to drag asset %d %s: %s"):format(l_assetId_1, l_assetName_1, l_result_5 or ""));
                return l_status_5;
            else
                warn(("Toolbox failed to drag asset %s %s: %s"):format(tostring(l_assetId_1), l_assetName_1, l_result_5 or ""));
                return l_status_5;
            end;
        else
            v194(v211, true);
            return l_status_5;
        end;
    end;
end;
local function v223(v219, v220)
    for _, v222 in ipairs(v220) do
        v222.SourceAssetId = v219;
        if l_SourceAssetIdInModelChildren_0 then
            v43(v222, v219);
        end;
    end;
end;
v195.registerLocalization = function(v224)
    v195._localization = v224;
end;
v195.registerProcessDragHandler = function(v225)
    v225.ProcessAssetInsertionDrag = function(v226, v227, v228)
        v223(v226, v228);
        spawn(function()
            v1.reportDragInsertFinished(v226, v227);
        end);
        if v227 == Enum.AssetType.MeshPart.Value then
            return (v71(v226, v228, v195._localization));
        else
            v196.instances = v228;
            return v228;
        end;
    end;
    v225.ProcessAssetInsertionDrop = function()
        spawn(function()
            if v196 then
                if l_ToolboxEnableAudioGrantDialog_0 and v196.assetTypeId == Enum.AssetType.Audio.Value then
                    v55(v196.assetName, v196.assetId, v196.assetTypeId, v196.insertToolPromise, v196.localization);
                end;
                local l_assetName_2 = v196.assetName;
                local l_instances_0 = v196.instances;
                local l_insertToolPromise_0 = v196.insertToolPromise;
                local _ = l_Promise_0.new(function(v232, _)
                    local function v236()
                        for _, v235 in ipairs(l_instances_0) do
                            v235:Destroy();
                        end;
                        v232(false);
                    end;
                    local function v237()
                        v232(true);
                    end;
                    if not l_instances_0 then
                        v232(true);
                    end;
                    if not l_insertToolPromise_0 then
                        v232(true);
                    end;
                    local v238 = 0;
                    for _, v240 in ipairs(l_instances_0) do
                        if v240:IsA("Script") then
                            v238 = v238 + 1;
                        end;
                        for _, v242 in ipairs(v240:GetDescendants()) do
                            if v242:IsA("Script") then
                                v238 = v238 + 1;
                            end;
                        end;
                    end;
                    if v238 < 1 then
                        v232(true);
                    end;
                    if v238 >= 1 then
                        l_insertToolPromise_0:promptScriptWarningAndWait({
                            assetName = l_assetName_2,
                            numScripts = v238,
                            cancel = v236,
                            insert = v237
                        });
                    end;
                    if l_ToolboxDeleteTempModelFix_0 then
                        v232(true);
                    end;
                end);
                if v9.contains(v196.assetSubTypes, v9.MaterialPack) then
                    for _, v245 in v196.instances, nil, nil do
                        v245.Parent = l_MaterialService_0;
                    end;
                end;
                if v196.onSuccess then
                    v196.onSuccess(v196.assetId, v196.instances);
                end;
                v196 = nil;
            end;
        end);
    end;
end;
return v195;


local _ = script.Parent.Parent.Parent;
local l_ToolboxEnableAudioGrantDialog_0 = game:GetFastFlag("ToolboxEnableAudioGrantDialog");
local v2 = {};
v2.__index = v2;
v2.INSERT_TO_WORKSPACE = 0;
v2.INSERT_TO_STARTER_PACK = 1;
v2.INSERT_CANCELLED = 2;
v2.new = function(v3, v4, v5)
    local v6 = {
        _onPromptCallback = v3,
        _onScriptWarningCallback = v4,
        _onPermissionsGrantCallback = v5,
        _bindable = Instance.new("BindableEvent"),
        _waiting = false
    };
    setmetatable(v6, v2);
    return v6;
end;
v2.isWaiting = function(v7)
    return v7._waiting;
end;
v2.destroy = function(v8)
    v8:cancel();
    v8._bindable:Destroy();
end;
v2.insertToWorkspace = function(v9)
    v9._bindable:Fire(v2.INSERT_TO_WORKSPACE);
end;
v2.insertToStarterPack = function(v10)
    v10._bindable:Fire(v2.INSERT_TO_STARTER_PACK);
end;
v2.cancel = function(v11)
    v11._bindable:Fire(v2.INSERT_CANCELLED);
end;
v2.dismissWarningPrompt = function(v12)
    v12._bindable:Fire();
end;
v2.returnResult = function(v13, v14)
    v13._bindable:Fire(v14);
end;
v2.promptPermissionsGrantAndWait = function(v15, v16)
    if l_ToolboxEnableAudioGrantDialog_0 then
        v15._waiting = true;
        v15._onPermissionsGrantCallback(v16);
        local v17 = v15._bindable.Event:Wait();
        v15._waiting = false;
        return v17;
    else
        return false;
    end;
end;
v2.promptScriptWarningAndWait = function(v18, v19)
    v18._waiting = true;
    if v18._onScriptWarningCallback(v19) then
        v18._bindable.Event:Wait();
    end;
    v18._waiting = false;
end;
v2.promptAndWait = function(v20)
    if not v20._waiting then
        v20._waiting = true;
        v20._onPromptCallback();
        local v21 = v20._bindable.Event:Wait();
        v20._waiting = false;
        return v21;
    else
        return v2.INSERT_CANCELLED;
    end;
end;
return v2;


local v0 = require(script.Parent.Parent.Parent.Core.Util.wrapStrictTable);
local function _(v1)
    local v2 = newproxy(true);
    local v3 = ("Symbol(%s)"):format((tostring(v1)));
    getmetatable(v2).__tostring = function()
        return v3;
    end;
    return v2;
end;
local v5 = {};
local v6 = newproxy(true);
local v7 = ("Symbol(%s)"):format((tostring("Localization")));
local l_v7_0 = v7 --[[ copy: 6 -> 7 ]];
getmetatable(v6).__tostring = function()
    return l_v7_0;
end;
v5.localization = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("NetworkInterface")));
local l_v7_1 = v7 --[[ copy: 6 -> 8 ]];
getmetatable(v6).__tostring = function()
    return l_v7_1;
end;
v5.networkInterface = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("PluginGui")));
local l_v7_2 = v7 --[[ copy: 6 -> 9 ]];
getmetatable(v6).__tostring = function()
    return l_v7_2;
end;
v5.pluginGui = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("Plugin")));
local l_v7_3 = v7 --[[ copy: 6 -> 10 ]];
getmetatable(v6).__tostring = function()
    return l_v7_3;
end;
v5.plugin = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("Settings")));
local l_v7_4 = v7 --[[ copy: 6 -> 11 ]];
getmetatable(v6).__tostring = function()
    return l_v7_4;
end;
v5.settings = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("Theme")));
local l_v7_5 = v7 --[[ copy: 6 -> 12 ]];
getmetatable(v6).__tostring = function()
    return l_v7_5;
end;
v5.theme = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("MarketplaceCamera")));
local l_v7_6 = v7 --[[ copy: 6 -> 13 ]];
getmetatable(v6).__tostring = function()
    return l_v7_6;
end;
v5.camera = v6;
v6 = newproxy(true);
v7 = ("Symbol(%s)"):format((tostring("LoadingInProgress")));
getmetatable(v6).__tostring = function()
    return v7;
end;
v5.LoadingInProgress = v6;
return v0(v5, "Keys");


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Core.Util.Constants);
local v3 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxAddAutocorrect);
local v5 = {
    getAssetsPerRow = function(v4)
        return (math.floor((v4 + v2.BETWEEN_ASSETS_HORIZONTAL_PADDING) / (v2.ASSET_WIDTH_NO_PADDING + v2.BETWEEN_ASSETS_HORIZONTAL_PADDING)));
    end
};
v5.getSwimlaneWidth = function(v6)
    return v5.getAssetsPerRow((v6 - 2 * v2.MAIN_VIEW_PADDING) - v2.SCROLLBAR_PADDING) * (v2.ASSET_WIDTH_NO_PADDING + v2.BETWEEN_ASSETS_HORIZONTAL_PADDING) - v2.BETWEEN_ASSETS_HORIZONTAL_PADDING;
end;
v5.getAssetCellHeightWithPadding = function(v7)
    local l_ASSET_HEIGHT_0 = v2.ASSET_HEIGHT;
    if v7 then
        l_ASSET_HEIGHT_0 = l_ASSET_HEIGHT_0 + v2.PRICE_HEIGHT;
    end;
    return l_ASSET_HEIGHT_0 + v2.BETWEEN_ASSETS_VERTICAL_PADDING;
end;
v5.calculateAssetsHeight = function(v9, v10, v11)
    if not (v9 ~= 0) or v10 == 0 then
        return 0;
    else
        local v12 = v5.getAssetsPerRow(v10);
        if v12 == 0 then
            return 0;
        else
            return (v5.getAssetCellHeightWithPadding(v11) * math.ceil(v9 / v12) - v2.BETWEEN_ASSETS_VERTICAL_PADDING) + v2.ASSET_VOTING_HEIGHT;
        end;
    end;
end;
v5.sliceAssetsFromBounds = function(v13, v14, v15)
    local v16 = {};
    v14 = v14 or 1;
    v15 = math.min(v15 or #v13, #v13);
    if v14 > 0 and v14 <= v15 then
        for v17 = v14, v15 do
            v16[#v16 + 1] = {
                v13[v17],
                v17
            };
        end;
    end;
    return v16;
end;
v5.calculateRenderBoundsForScrollingFrame = function(v18, v19, v20, v21)
    if v18 then
        local v22 = v5.getAssetsPerRow(v19);
        local v23 = v5.getAssetCellHeightWithPadding(v21);
        local v24 = v18.CanvasPosition.Y - v20;
        local l_Y_0 = v18.AbsoluteSize.Y;
        local l_SCROLLING_FRAME_VIEW_PADDING_0 = v2.SCROLLING_FRAME_VIEW_PADDING;
        v24 = v24 - l_SCROLLING_FRAME_VIEW_PADDING_0;
        l_Y_0 = l_Y_0 + 2 * l_SCROLLING_FRAME_VIEW_PADDING_0;
        local v27 = math.max(math.floor(v24 / v23), 0);
        return v27 * v22 + 1, ((v27 + math.ceil(l_Y_0 / v23)) + 1) * v22;
    else
        return 0, 0;
    end;
end;
v5.calculateMainViewHeaderHeight = function(v28, _, _, _, v32, v33)
    local v34 = 0;
    local v35 = 0;
    if not v3() then
        if v28 then
            v35 = v2.MAIN_VIEW_VERTICAL_PADDING;
            v34 = v34 + v2.SEARCH_TERMS_HEIGHT;
        end;
        return math.max(v34, v2.MAIN_VIEW_NO_HEADER_HEIGHT), v35;
    else
        if not (not v32 and not v28) then
            v34 = v34 + v2.SEARCH_TERMS_HEIGHT;
        end;
        if not (not v28 or not v33) then
            v34 = v34 + v2.MAIN_VIEW_VERTICAL_PADDING;
            v35 = v2.MAIN_VIEW_VERTICAL_PADDING;
        end;
        return math.max(v34, v2.MAIN_VIEW_NO_HEADER_HEIGHT), v35;
    end;
end;
return v5;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Rodux);
local l_provideMockContext_0 = require(l_Packages_0.Framework).TestHelpers.provideMockContext;
local v5 = require(l_Parent_0.Core.Util.Settings);
local v6 = require(l_Parent_0.Core.Util.ToolboxTheme);
local v7 = require(l_Parent_0.Core.Reducers.ToolboxReducer);
local v8 = require(l_Parent_0.Core.Networking.NetworkInterfaceMock);
local v9 = require(l_Parent_0.Core.Util.Analytics.AssetAnalyticsContextItem);
local v10 = require(l_Parent_0.Core.Util.Analytics.AssetAnalytics);
local v11 = require(l_Parent_0.Core.Components.ExternalServicesWrapper);
local v12 = require(l_Parent_0.Core.Util.makeTheme);
local v13 = require(l_Packages_0.Framework);
local l_Networking_0 = v13.Http.Networking;
local l_ContextServices_0 = v13.ContextServices;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_Signal_0 = v13.Util.Signal;
local v18 = require(l_Parent_0.Core.ContextServices.Settings);
local v19 = require(l_Parent_0.Core.ContextServices.IXPContext);
local v20 = require(l_Parent_0.Core.ContextServices.NavigationContext);
local v21 = require(l_Parent_0.Core.Themes.getAssetConfigTheme);
local v22 = require(l_Parent_0.Core.ContextServices.NetworkContext);
local v23 = require(l_Parent_0.TestUtils.CoreTestUtils);
local l_MockPlugin_0 = v13.TestHelpers.Instances.MockPlugin;
local v25 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxAddRecentSearchesToAutoComplete);
return function(v26)
    local v27 = v26.store or v3.Store.new(v7, nil, (v23.createThunkMiddleware()));
    if v26.storeSetup then
        v26.storeSetup(v27);
    end;
    local v28 = if not v25() then v26.plugin or nil else v26.plugin or l_MockPlugin_0.new();
    local v29 = v26.pluginGui or nil;
    local v30 = v26.settings or v5.new(v28);
    local v31 = v26.theme or v6.createDummyThemeManager();
    local v32 = v26.networkInterface or v8.new();
    return v2.createElement(v11, {
        store = v27,
        plugin = v28,
        pluginGui = v29,
        settings = v30,
        theme = v31,
        networkInterface = v32
    }, {
        MockContextProvider = l_provideMockContext_0({
            l_ContextServices_0.Store.new(v27),
            l_ContextServices_0.Focus.new(v26.focus or Instance.new("ScreenGui")),
            l_Mouse_0.new({
                Icon = "rbxasset://SystemCursors/Arrow"
            }),
            l_ContextServices_0.Plugin.new(v28),
            v18.new(v30),
            v12(v21()),
            l_ContextServices_0.API.new({
                networking = l_Networking_0.mock()
            }),
            v9.new(v26.assetAnalytics or v10.mock()),
            l_ContextServices_0.Analytics.mock(),
            l_ContextServices_0.Localization.new({
                stringResourceTable = l_Parent_0.LocalizationSource.SourceStrings,
                translationResourceTable = l_Parent_0.LocalizationSource.LocalizedStrings,
                pluginName = "Toolbox",
                libraries = {
                    [v13.Resources.LOCALIZATION_PROJECT_NAME] = {
                        stringResourceTable = v13.Resources.SourceStrings,
                        translationResourceTable = v13.Resources.LocalizedStrings
                    }
                },
                overrideGetLocale = function()
                    return "en-us";
                end,
                overrideLocaleId = "en-us",
                overrideLocaleChangedSignal = l_Signal_0.new()
            }),
            v26.ixpContext or v19.createMock(),
            v20.new(),
            (v22.new(v32))
        }, v26[v2.Children])
    });
end;


local v0 = require(script.Parent.Parent.Parent.Core.Util.createSignal);
local v1 = {};
v1.__index = v1;
v1.new = function()
    return (setmetatable({
        _signal = v0(),
        _currentTooltipAssetId = 0,
        _currentTooltipTypeId = 0,
        _isDropdownShown = false,
        _isMouseInSearchOptions = false,
        _isSearchOptionsShown = false,
        _isAssetPreviewing = false
    }, v1));
end;
v1.subscribe = function(v2, ...)
    return v2._signal:subscribe(...);
end;
v1.isShowingModal = function(v3)
    return v3._isDropdownShown;
end;
v1.isShowingSearchOptions = function(v4)
    return v4._isSearchOptionsShown;
end;
v1.isMouseInSearchOptions = function(v5)
    return v5._isMouseInSearchOptions;
end;
v1.isAssetPreviewing = function(v6)
    return v6._isAssetPreviewing;
end;
v1.onTooltipTriggered = function(v7, v8, v9)
    v7._currentTooltipAssetId = v8;
    v7._currentTooltipTypeId = v9;
    v7._signal:fire();
end;
v1.onDropdownToggled = function(v10, v11)
    v10._isDropdownShown = v11;
    v10._signal:fire();
end;
v1.onSearchOptionsToggled = function(v12, v13)
    v12._isSearchOptionsShown = v13;
    v12._signal:fire();
end;
v1.onSearchOptionsMouse = function(v14, v15)
    v14._isMouseInSearchOptions = v15;
    v14._signal:fire();
end;
v1.onAssetPreviewToggled = function(v16, v17)
    v16._isAssetPreviewing = v17;
    v16._signal:fire();
end;
v1.isCurrentTooltip = function(v18, v19, v20)
    local v21 = false;
    if v18._currentTooltipAssetId == v19 then
        v21 = v18._currentTooltipTypeId == v20;
    end;
    return v21;
end;
v1.canHoverAsset = function(v22)
    return (not v22._isDropdownShown and not v22._isAssetPreviewing) and not (v22._isSearchOptionsShown and v22._isMouseInSearchOptions);
end;
v1.canShowCurrentTooltip = function(v23, v24, v25)
    return ((not v23._isDropdownShown and v23:isCurrentTooltip(v24, v25)) and not v23._isAssetPreviewing) and not (v23._isSearchOptionsShown and v23._isMouseInSearchOptions);
end;
return v1;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_deepEqual_0 = require(l_Parent_0.Packages.Framework).Util.deepEqual;
local v2 = require(l_Parent_0.Core.Util.DebugFlags);
local v3 = require(l_Parent_0.Core.Util.AssetConfigConstants);
local v4 = require(l_Parent_0.Core.Types.Category);
local _ = require(l_Parent_0.Core.Util.Constants);
local v9 = {
    getCurrentTab = function(v6)
        return (v4.getTabKeyForCategoryName(v6.categoryName));
    end,
    getCategory = function(v7)
        local v8 = v4.getCategoryByName(v7);
        if v8 and v8.category then
            return v8.category;
        else
            if v2.shouldDebugWarnings() then
                warn(("Lua toolbox: No category for category name %s"):format((tostring(v7))));
            end;
            return "";
        end;
    end
};
v9.getCategoryForPageInfo = function(v10)
    return v9.getCategory(v10.categoryName);
end;
v9.getSortType = function(v11, v12)
    if v11 and v12 then
        local v13 = v11[v12];
        if v13 and v13.sort then
            return v13.sort;
        else
            if v2.shouldDebugWarnings() then
                warn(("Lua Toolbox: no sort for sort index %s"):format((tostring(v12))));
            end;
            return "";
        end;
    else
        return nil;
    end;
end;
v9.getSortTypeForPageInfo = function(v14)
    return v9.getSortType(v14.sorts, v14.sortIndex);
end;
v9.getGroupId = function(v15, v16)
    if v16 == 0 then
        return 0;
    elseif (v16 >= 1 and #v15 >= v16) and v15[v16].id then
        return v15[v16].id;
    else
        if v2.shouldDebugWarnings() then
            warn(("Lua Toolbox: no group for group index %s"):format((tostring(v16))));
        end;
        return 0;
    end;
end;
v9.getGroupIdForPageInfo = function(v17)
    return v9.getGroupId(v17.groups, v17.groupIndex);
end;
v9.getEngineAssetTypeForPageInfoCategory = function(v18)
    local v19 = v4.getCategoryByName(v18.categoryName);
    if v19 and v19.assetType then
        return v4.getEngineAssetType(v19.assetType);
    else
        if v2.shouldDebugWarnings() then
            warn(("Lua toolbox: No assetType for category name %s"):format((tostring(v18.categoryName))));
        end;
        return nil;
    end;
end;
v9.getBackendNameForPageInfoCategory = function(v20)
    local v21 = v9.getEngineAssetTypeForPageInfoCategory(v20);
    return not not v21 and v21.Name or nil;
end;
v9.isDeveloperCategory = function(v22)
    return v3.developCategoryType[v9.getCategoryForPageInfo(v22)];
end;
v9.isPackagesCategory = function(v23)
    return v3.packagesCategoryType[v9.getCategoryForPageInfo(v23)];
end;
v9.getRequestInfo = function(v24)
    return {
        category = v9.getCategoryForPageInfo(v24) or "",
        creatorId = not not v24.creator and v24.creator.Id or "",
        creatorType = not not v24.creator and v24.creator.Type or 1,
        groupId = not not v4.categoryIsGroupAsset(v24.categoryName) and v9.getGroupIdForPageInfo(v24) or 0,
        searchTerm = v24.searchTerm or "",
        sortType = v9.getSortTypeForPageInfo(v24) or "",
        targetPage = v24.targetPage or 1
    };
end;
v9.isPageInfoStale = function(v25, v26)
    return not l_deepEqual_0(v9.getRequestInfo(v25), (v9.getRequestInfo(v26:getState().pageInfo)));
end;
return v9;


return {
    createDefaultCursor = function()
        return {
            begin = true
        };
    end,
    createCursor = function(v0)
        if not v0 then
            return {};
        else
            return {
                nextPageCursor = v0.nextPageCursor
            };
        end;
    end,
    isNextPageAvailable = function(v1)
        if not v1.begin and not v1.nextPageCursor then
            return false;
        else
            return true;
        end;
    end,
    getNextPageCursor = function(v2)
        return v2.nextPageCursor;
    end
};


local _ = game:GetFastFlag("ToolboxEnableAudioGrantDialog");
return {
    webKeys = {
        All = "All",
        UserId = "userId",
        UserName = "userName",
        GroupId = "groupId",
        GroupName = "groupName",
        RoleId = "rolesetId",
        RoleName = "rolesetName",
        RoleRank = "rank",
        UpToVersion = "upToVersion",
        Action = "action",
        UseViewAction = "UseView",
        EditAction = "Edit",
        RevokedAction = "Revoked",
        UseAction = "Use",
        GrantAssetPermissionsAction = "GrantAssetPermissions",
        SubjectType = "subjectType",
        SubjectId = "subjectId",
        PermissionLevel = "permissionLevel",
        PermissionSource = "permissionSource",
        UserSubject = "User",
        GroupSubject = "Group",
        RoleSubject = "Roleset",
        GroupRolesetSubject = "GroupRoleset",
        Requests = "requests",
        Universe = "Universe",
        UnknownError = "UnknownError",
        HasPermission = "HasPermission",
        NoPermission = "NoPermission",
        AssetNotFound = "AssetNotFound"
    },
    webValues = {
        AccountPermissionLevel = "Account",
        UniversePermissionLevel = "Universe",
        AssetPermissionLevel = "Asset",
        AssetPermissionSource = "AssetPermissions",
        GroupPermissionSource = "GroupRolesetPermissions"
    }
};


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Core.Components.AssetConfiguration.Permissions.PermissionsConstants);
local v2 = require(l_Parent_0.Core.Util.Permissions.Constants);
local l_webKeys_0 = v2.webKeys;
local l_webValues_0 = v2.webValues;
local v5 = {};
local v6 = require(l_Parent_0.Core.Util.DebugFlags);
v5.getInternalSubjectType = function(v7)
    if v7 == l_webKeys_0.UserSubject then
        return v1.UserSubjectKey;
    elseif v7 == l_webKeys_0.RoleSubject then
        return v1.RoleSubjectKey;
    elseif v7 == l_webKeys_0.GroupSubject then
        return v1.GroupSubjectKey;
    else
        error("Could not determine subject type");
        return ;
    end;
end;
v5.getInternalAction = function(v8)
    if v8 == l_webKeys_0.GrantAssetPermissionsAction then
        return v1.OwnKey;
    elseif v8 == l_webKeys_0.UseAction then
        return v1.UseViewKey;
    elseif v8 == l_webKeys_0.EditAction then
        return v1.EditKey;
    elseif v8 == l_webKeys_0.UseViewAction then
        return v1.UseViewKey;
    elseif v8 == l_webKeys_0.RevokedAction then
        return v1.NoAccessKey;
    elseif v8 == nil then
        return v1.NoAccessKey;
    else
        error("Unsupported Action: " .. tostring(v8));
        return ;
    end;
end;
v5.getPermissionLevel = function(v9)
    if v9 == l_webValues_0.AccountPermissionLevel then
        return v1.AccountPermissionLevel;
    elseif v9 == l_webValues_0.UniversePermissionLevel then
        return v1.UniversePermissionLevel;
    elseif v9 == l_webValues_0.AssetPermissionLevel then
        return v1.AssetPermissionLevel;
    else
        error("Unsupported PermissionLevel: " .. tostring(v9));
        return ;
    end;
end;
v5.getPermissionSource = function(v10)
    if v10 == l_webValues_0.AssetPermissionSource then
        return v1.AssetPermissionSource;
    elseif v10 == l_webValues_0.GroupPermissionSource then
        return v1.GroupPermissionSource;
    else
        error("Unsupported PermissionSource: " .. tostring(v10));
        return ;
    end;
end;
v5.getWebSubjectType = function(v11)
    if v11 == v1.UserSubjectKey then
        return l_webKeys_0.UserSubject;
    elseif v11 == v1.GroupSubjectKey then
        return l_webKeys_0.GroupSubject;
    elseif v11 == v1.RoleSubjectKey then
        return l_webKeys_0.RoleSubject;
    else
        error("Invalid SubjectType: " .. tostring(v11));
        return ;
    end;
end;
v5.getWebAction = function(v12)
    if v12 == v1.UseViewKey then
        return l_webKeys_0.UseViewAction;
    elseif v12 == v1.EditKey then
        return l_webKeys_0.EditAction;
    elseif v12 == v1.NoAccessKey then
        return l_webKeys_0.RevokedAction;
    elseif v12 == v1.RevokedKey then
        return l_webKeys_0.RevokedAction;
    else
        error("Invalid Action: " .. tostring(v12));
        return ;
    end;
end;
v5.getAssetPermissionAction = function(v13)
    if v13 == l_webKeys_0.UseViewAction then
        return l_webKeys_0.UseAction;
    elseif v13 == l_webKeys_0.OwnAction then
        return l_webKeys_0.EditAction;
    else
        return v13;
    end;
end;
v5.getAssetPermissionSubjectType = function(v14)
    if v14 == l_webKeys_0.RoleSubject then
        return l_webKeys_0.GroupRolesetSubject;
    else
        return v14;
    end;
end;
v5.resolveActionPermission = function(v15, v16, v17)
    if v16 == l_webKeys_0.UnknownError then
        if v6.shouldDebugWarnings() then
            warn(string.format("Ignoring %s for assetId: %s, webKey: %s", tostring(v16), tostring(v17), (tostring(v15))));
        end;
        return v1.NoneKey;
    elseif v16 == l_webKeys_0.HasPermission then
        return v5.getInternalAction(v15);
    elseif v16 == l_webKeys_0.NoPermission then
        return v1.NoAccessKey;
    elseif v16 == l_webKeys_0.AssetNotFound then
        error("Permissions Error: " .. tostring(v16) .. ", assetId: " .. tostring(v17));
        return ;
    else
        error("Permissions Error: " .. tostring(v16) .. ", assetId: " .. tostring(v17));
        return ;
    end;
end;
return v5;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Promise_0 = require(l_Parent_0.Packages.Framework).Util.Promise;
local v2 = require(l_Parent_0.Core.Util.Urls);
local l_VideoStudioPreviewPermissionFix_0 = game:GetFastFlag("VideoStudioPreviewPermissionFix");
local function v7(v4)
    for _, v6 in pairs(v4:GetDescendants()) do
        if v6:IsA("Script") then
            v6.Disabled = true;
        end;
    end;
end;
local function v15(v8)
    local v9 = nil;
    local l_status_0, l_result_0 = pcall(function()
        v9 = game:GetObjectsAsync((v2.constructAssetIdString(v8)));
    end);
    if l_status_0 then
        local v12 = nil;
        if #v9 == 1 then
            v12 = v9[1];
        else
            v12 = Instance.new("Model");
            v12.Name = "Preview";
            for _, v14 in ipairs(v9) do
                v14.Parent = v12;
                if not v14.Parent then
                    v14:Destroy();
                end;
            end;
        end;
        v7(v12);
        return l_status_0, v12;
    else
        return l_status_0, l_result_0;
    end;
end;
return function(v16, v17)
    return (l_Promise_0.new(function(v18, v19)
        spawn(function()
            local v20 = nil;
            local v21 = true;
            if v17 == Enum.AssetType.Audio.Value then
                local l_Sound_0 = Instance.new("Sound");
                l_Sound_0.SoundId = ("rbxassetid://%d"):format(v16);
                v20 = l_Sound_0;
            elseif v17 == Enum.AssetType.Video.Value then
                local l_VideoFrame_0 = Instance.new("VideoFrame");
                if l_VideoStudioPreviewPermissionFix_0 then
                    l_VideoFrame_0:SetStudioPreview(true);
                end;
                l_VideoFrame_0.Video = v2.constructAssetIdString(v16);
                v20 = l_VideoFrame_0;
            else
                local v24, v25 = v15(v16);
                v21 = v24;
                v20 = v25;
            end;
            if v21 then
                v18(v20);
                return ;
            else
                v19(v20);
                return ;
            end;
        end);
    end));
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Util_0 = l_Parent_0.Core.Util;
local v2 = require(l_Parent_0.Packages.Dash);
local v3 = require(l_Util_0.AssetConfigConstants);
local v4 = require(l_Parent_0.Core.Util.AssetConfigUtil);
local v5 = require(l_Parent_0.Core.Types.ConfigTypes);
local _ = require(l_Parent_0.Core.Types.AssetMediaTypes);
local _ = require(l_Parent_0.Core.Types.PublishingRequirementsType);
local v8 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxRestrictAssetConfig);
local l_DisableUGCBodyUploadValidation1_0 = game:GetFastFlag("DisableUGCBodyUploadValidation1");
local v11 = {
    isValidAssetMedia = function(v10)
        if not (v10 ~= nil) or v10.ThumbnailOrderToChange == nil then
            return true;
        else
            return #v10.ThumbnailOrderToChange <= v3.additionalImages.MaxThumbnails;
        end;
    end
};
v11.checkCanSave = function(v12, v13, v14, v15, v16, v17, v18, v19, v20, v21)
    if not v5:isOverride(v16) then
        if not v5:isPermissions(v16) then
            local v22 = v12 and next(v12) ~= nil;
            local v23 = false;
            if #v13 <= v3.NAME_CHARACTER_LIMIT then
                v23 = tostring(v13) ~= "";
            end;
            local v24 = #v14 <= v3.DESCRIPTION_CHARACTER_LIMIT;
            if not (not v4.isCatalogAsset(v18) and not v4.isUGCBundleType(v18)) then
                v24 = v24 and tostring(v14) ~= "";
            end;
            local v25 = (((v23 and v24) and v15) and v11.isValidAssetMedia(v19)) and v21;
            if v17 == v3.FLOW_TYPE.UPLOAD_FLOW then
                if v18 == nil then
                    return false;
                else
                    if not (not v4.isCatalogAsset(v18) and not v4.isUGCBundleType(v18)) then
                        v25 = v25 and (v20 or l_DisableUGCBodyUploadValidation1_0);
                    end;
                    return v25;
                end;
            else
                return v25 and v22;
            end;
        else
            return (v12 and next(v12) ~= nil) and (v12.permissions and next(v12.permissions) ~= nil);
        end;
    else
        return v12 and v12.OverrideAssetId;
    end;
end;
if v8() then
    v11.isRestrictionAppealable = function(v26)
        if v26 == "SafetyStatus" then
            return true;
        else
            return false;
        end;
    end;
    v11.getDisplayTextForRestriction = function(v27, v28)
        if v28 == nil then
            return nil;
        elseif v27 == v3.RESTRICTION_TYPE.SafetyStatus then
            return v28:getText("AssetConfigCopy", "AssetMayViolateCommunityStandards");
        elseif v27 == v3.RESTRICTION_TYPE.AssetType then
            return v28:getText("AssetConfigCopy", "AssetTypeNotAvailable");
        elseif v27 == v3.RESTRICTION_TYPE.Authorization then
            return v28:getText("AssetConfigCopy", "NoPermissionToDistributeAsset");
        else
            return nil;
        end;
    end;
    v11.getRestrictionThatAppliesToAsset = function(v29)
        if not (v29 ~= nil) or #v29 == 0 then
            return nil;
        elseif not v2.includes(v29, v3.RESTRICTION_TYPE.SafetyStatus) then
            if not v2.includes(v29, v3.RESTRICTION_TYPE.AssetType) then
                if not v2.includes(v29, v3.RESTRICTION_TYPE.Authorization) then
                    return nil;
                else
                    return v3.RESTRICTION_TYPE.Authorization;
                end;
            else
                return v3.RESTRICTION_TYPE.AssetType;
            end;
        else
            return v3.RESTRICTION_TYPE.SafetyStatus;
        end;
    end;
end;
return v11;


local v0 = require(script:FindFirstAncestor("Toolbox").Core.Util.findParentModelWithSourceAssetID);
return {
    raycastObjectsInSphere = function(v1)
        if v1 then
            local v2 = {};
            local v3 = 0;
            for v4 = 1, 256 do
                local v5 = math.acos(1 - (2 * v4 - 1) / 256);
                local v6 = 3.8832220774509327 * v4;
                local v7 = Ray.new(v1.CFrame.Position, Vector3.new(math.sin(v5) * math.cos(v6), math.sin(v5) * math.sin(v6), (math.cos(v5))) * 500);
                local v8 = workspace:Raycast(v7.Origin, v7.Direction * 500);
                if not (not v8 or not v8.Instance) then
                    local v9 = v0(v8.Instance);
                    if v9 then
                        local l_SourceAssetId_0 = v9.SourceAssetId;
                        if not (not (l_SourceAssetId_0 and l_SourceAssetId_0 ~= -1) or v2[l_SourceAssetId_0]) then
                            v3 = v3 + 1;
                            v2[l_SourceAssetId_0] = v8.Distance;
                            if not (v3 < 10) then
                                break;
                            end;
                        end;
                    end;
                end;
            end;
            return v2;
        else
            return {};
        end;
    end,
    raycastObjectsVisibleInViewport = function(v11)
        if v11 then
            local l_ViewportSize_0 = v11.ViewportSize;
            local v13 = {};
            local v14 = 0;
            local v15 = 0;
            local v16 = 1;
            local v17 = 0;
            local v18 = 0;
            local v19 = 1;
            local v20 = 0;
            for _ = 1, 256 do
                local v22 = Vector2.new(((v15 + 0.5) + 7) * (l_ViewportSize_0.X / 16), ((v17 + 0.5) + 7) * (l_ViewportSize_0.Y / 16));
                local v23 = v11:ScreenPointToRay(v22.X, v22.Y);
                local v24 = workspace:Raycast(v23.Origin, v23.Direction * 500);
                if not (not v24 or not v24.Instance) then
                    local v25 = v0(v24.Instance);
                    if v25 then
                        local l_SourceAssetId_1 = v25.SourceAssetId;
                        if not (not (l_SourceAssetId_1 and l_SourceAssetId_1 ~= -1) or v13[l_SourceAssetId_1]) then
                            v14 = v14 + 1;
                            v13[l_SourceAssetId_1] = v24.Distance;
                            if not (v14 < 10) then
                                break;
                            end;
                        end;
                    end;
                end;
                v15 = v15 + v16;
                v17 = v17 + v18;
                v20 = v20 + 1;
                if v20 == v19 then
                    v20 = 0;
                    local l_v16_0 = v16;
                    v16 = -v18;
                    v18 = l_v16_0;
                    if v18 == 0 then
                        v19 = v19 + 1;
                    end;
                end;
            end;
            return v13;
        else
            return {};
        end;
    end
};