local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local _ = require(l_script_FirstAncestor_0.Src.DataTypes.QueuedSession);
return v1.Util.Action(script.Name, function(v3)
    return {
        queueItem = v3
    };
end);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = l_ContextServices_0.Stylizer;
local l_UI_0 = v1.UI;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_CheckboxTreeView_0 = l_UI_0.CheckboxTreeView;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_Separator_0 = l_UI_0.Separator;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_showContextMenu_0 = l_UI_0.showContextMenu;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local v17 = require(l_script_FirstAncestor_0.Src.Components.TreeViewToolbar);
local v18 = require(l_script_FirstAncestor_0.Src.Actions.SetSelectedImportItem);
local v19 = require(l_script_FirstAncestor_0.Src.Actions.SetTreeExpansion);
local v20 = require(l_script_FirstAncestor_0.Src.Thunks.UpdateChecked);
local v21 = require(l_script_FirstAncestor_0.Src.Thunks.UpdatePreviewInstance);
local v22 = require(l_script_FirstAncestor_0.Src.Resources.StatusLevel);
local v23 = require(l_script_FirstAncestor_0.Src.Utility.Status.countStatusLevelsForTree);
local v24 = require(l_script_FirstAncestor_0.Src.Utility.trimFilename);
local v25 = require(l_script_FirstAncestor_0.Src.Controllers.PresetController);
local v26 = require(l_script_FirstAncestor_0.Src.Utility.DebugFlags);
local v27 = require(l_script_FirstAncestor_0.Src.Utility.createCalloutComponents);
local v28 = game:DefineFastFlag("UseImportNameForRoot", false);
local v29 = v2.PureComponent:extend("AssetImportTree");
local _ = function(v30)
    local v31 = {};
    local function v32(v33)
        for _, v35 in pairs(v33) do
            v31[v35] = true;
            local l_v35_Children_0 = v35:GetChildren();
            if #l_v35_Children_0 > 0 then
                v32(l_v35_Children_0);
            end;
        end;
    end;
    v32(v30);
    return v31;
end;
local function v48(v38, v39, v40, v41, v42)
    local v43 = nil;
    local v44 = nil;
    local v45 = nil;
    local v46 = nil;
    if v39 == v22.Error then
        v43 = "rbxasset://textures/StudioSharedUI/alert_error@2x.png";
        v44 = v42:getText("AssetImportTree", "Errors");
        v45 = v38.errors;
        v46 = v38.descErrors;
    elseif v39 == v22.Warning then
        v43 = "rbxasset://textures/StudioSharedUI/alert_warning@2x.png";
        v44 = v42:getText("AssetImportTree", "Warnings");
        v45 = v38.warnings;
        v46 = v38.descWarnings;
    end;
    local v47 = nil;
    if v45 > 0 then
        v47 = string.format(v42:getText("AssetImportTree", "Contains"), v45, v44);
    elseif not (v46 > 0) or v40 then
        return nil;
    else
        v47 = string.format(v42:getText("AssetImportTree", "Descendants"), v46, v44);
    end;
    return v2.createElement(l_Image_0, {
        LayoutOrder = v41:getNextOrder(),
        Style = {
            Image = v43
        },
        Size = UDim2.new(0, 20, 0, 20)
    }, {
        Tooltip = v2.createElement(l_Tooltip_0, {
            Text = v47
        })
    });
end;
local function v63(v49, v50, v51, v52, v53)
    local function v54(v55)
        local v56 = v51[v55];
        if not v56 or v53[v55] == nil then
            return ;
        else
            local v57 = true;
            local v58 = false;
            for _, v60 in ipairs(v52(v56)) do
                local v61 = v53[v60];
                if v61 == nil then
                    v61 = v50[v60] or false;
                end;
                local l_v57_0 = v57;
                if l_v57_0 then
                    l_v57_0 = false;
                    if v61 ~= l_Checkbox_0.Indeterminate then
                        l_v57_0 = v61;
                    end;
                end;
                v57 = l_v57_0;
                l_v57_0 = v58;
                if not l_v57_0 then
                    l_v57_0 = true;
                    if v61 ~= l_Checkbox_0.Indeterminate then
                        l_v57_0 = v61;
                    end;
                end;
                v58 = l_v57_0;
            end;
            if not v57 then
                if not v58 then
                    if v50[v56] == false then
                        return ;
                    elseif not (not v56:IsA("GroupImportData") and not v56:IsA("RootImportData")) then
                        v53[v56] = false;
                    end;
                end;
            elseif v50[v56] == true then
                return ;
            elseif not (not v56:IsA("GroupImportData") and not v56:IsA("RootImportData")) then
                v53[v56] = true;
            end;
            v54(v56);
            return ;
        end;
    end;
    v54(v49);
end;
local function v64()
    return {
        {
            Name = "ApplyToAllCallout",
            ShouldShow = function()
                return not v26.RunningUnderCLI();
            end
        }
    };
end;
v29.init = function(v65)
    v65.getChildren = function(v66)
        return v66:GetChildren();
    end;
    v65.getContents = function(v67)
        if not v28 and v67.ClassName == "RootImportData" then
            return v24(v65.props.FileName), nil;
        else
            return v67.ImportName, nil;
        end;
    end;
    v65.setChecked = function(v68)
        local l_props_0 = v65.props;
        l_props_0.SetChecked(v68);
        if l_props_0.SelectedImportItem then
            l_props_0.UpdatePreviewInstance((l_props_0.SelectedImportItem:GetPreview()));
        end;
    end;
    v65.SelectItem = function(v70)
        local v71 = next(v70);
        if v65.props.SelectedImportItem == v71 then
            return ;
        else
            v65.props.SetSelectedImportItem(v71);
            if not v71 then
                v65.props.UpdatePreviewInstance(nil);
                return ;
            else
                v65.props.UpdatePreviewInstance(v71:GetPreview());
                return ;
            end;
        end;
    end;
    v65.statusCounts = {};
    v65.afterItem = function(v72)
        local v73 = v65.statusCounts[v72.Item];
        if v73 then
            local v74 = l_LayoutOrderIterator_0.new();
            local v75 = v48(v73, v22.Error, v72.Expanded, v74, v65.props.Localization) or v48(v73, v22.Warning, v72.Expanded, v74, v65.props.Localization);
            return v2.createElement(l_Pane_0, {
                Size = UDim2.new(0, not v75 and 0 or 20, 0, 20),
                LayoutOrder = v72.LayoutOrder,
                Layout = Enum.FillDirection.Horizontal
            }, {
                StatusCount = v75
            });
        else
            return nil;
        end;
    end;
    v65.createContextMenu = function(v76)
        local v77 = v65.props.Plugin:get();
        local l_Localization_1 = v65.props.Localization;
        local l_PresetController_0 = v65.props.PresetController;
        l_showContextMenu_0(v77, {
            {
                Text = l_Localization_1:getText("AssetImportTree", "RightClickApplyToAll1", {
                    nodeName = v76.ImportName
                }),
                OnItemClicked = function()
                    l_PresetController_0:applyImportDataToSession(v76);
                end
            }
        });
    end;
end;
v29.render = function(v80)
    local l_props_1 = v80.props;
    local v82 = l_props_1.Stylizer.Sizes.ToolbarHeight + 1;
    local l_Checked_0 = l_props_1.Checked;
    if not l_Checked_0 then
        local l_Instances_0 = l_props_1.Instances;
        local v85 = {};
        local function v86(v87)
            for _, v89 in pairs(v87) do
                v85[v89] = true;
                local l_v89_Children_0 = v89:GetChildren();
                if #l_v89_Children_0 > 0 then
                    v86(l_v89_Children_0);
                end;
            end;
        end;
        v86(l_Instances_0);
        l_Checked_0 = v85;
    end;
    local v91 = l_LayoutOrderIterator_0.new();
    v80.statusCounts = v23(l_props_1.ImportTree);
    return v2.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Vertical
    }, {
        Toolbar = v2.createElement(v17, {
            Expansion = l_props_1.Expansion,
            LayoutOrder = v91:getNextOrder(),
            OnExpansionChange = l_props_1.SetExpansion,
            Size = UDim2.new(1, 0, 0, v82)
        }),
        Callout = v2.createElement(l_Pane_0, {
            LayoutOrder = v91:getNextOrder(),
            Size = UDim2.fromScale(1, 0)
        }, (v27(v64(), "AssetImportTree", l_props_1.AssetImportSession))),
        Separator = v2.createElement(l_Separator_0, {
            DominantAxis = Enum.DominantAxis.Width,
            LayoutOrder = v91:getNextOrder()
        }),
        TreeView = v2.createElement(l_CheckboxTreeView_0, {
            RootItems = l_props_1.Instances or {},
            Selection = not not l_props_1.SelectedImportItem and {
                [l_props_1.SelectedImportItem] = true
            } or {},
            Expansion = l_props_1.Expansion,
            Checked = l_Checked_0,
            LayoutOrder = v91:getNextOrder(),
            Size = UDim2.new(1, 0, 1, -v82),
            OnSelectionChange = v80.SelectItem,
            OnExpansionChange = l_props_1.SetExpansion,
            OnCheck = v80.setChecked,
            GetChildren = v80.getChildren,
            GetContents = v80.getContents,
            ExpandableRoot = false,
            AfterItem = v80.afterItem,
            ToggleAncestors = v63,
            ToggleDescendants = l_CheckboxTreeView_0.DownPropagators.toggleAllChildren,
            OnRightClick = function(v92)
                v80.createContextMenu(v92.Item);
            end
        })
    });
end;
return v3.connect(function(v93)
    return {
        AssetImportSession = v93.Preview.assetImportSession,
        ImportTree = v93.Preview.importTree,
        SelectedImportItem = v93.Preview.selectedImportItem,
        Expansion = v93.Preview.importDataExpansion or {},
        Checked = v93.Preview.importDataChecked or {}
    };
end, function(v94)
    return {
        SetSelectedImportItem = function(v95)
            v94(v18(v95));
        end,
        SetExpansion = function(v96)
            v94(v19(v96));
        end,
        SetChecked = function(v97)
            v94(v20(v97));
        end,
        UpdatePreviewInstance = function(v98)
            v94(v21(v98));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0,
    Plugin = l_ContextServices_0.Plugin,
    PresetController = v25
})(v29)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Separator_0 = l_UI_0.Separator;
local v11 = require(l_script_FirstAncestor_0.Src.Controllers.PresetController);
local v12 = require(l_script_FirstAncestor_0.Src.Components.AssetImportTree);
local v13 = require(l_script_FirstAncestor_0.Src.Components.Properties.ImportConfiguration);
local v14 = require(l_script_FirstAncestor_0.Src.Components.TopBar);
local v15 = require(l_script_FirstAncestor_0.Src.Components.Preview.PreviewContainer);
local v16 = v1.PureComponent:extend("AssetImporterUI");
v16.render = function(v17)
    local l_props_0 = v17.props;
    local l_Stylizer_1 = l_props_0.Stylizer;
    local l_Sizes_0 = l_Stylizer_1.Sizes;
    return v1.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Vertical
    }, {
        TopBar = v1.createElement(v14, {
            LayoutOrder = 1,
            Padding = l_Stylizer_1.TopBarPadding,
            Size = UDim2.new(1, 0, 0, l_Sizes_0.TopBarHeight),
            FileName = l_props_0.Filename or ""
        }),
        TopSeparator = v1.createElement(l_Separator_0, {
            DominantAxis = Enum.DominantAxis.Width,
            LayoutOrder = 2
        }),
        BottomPanel = v1.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = 3,
            Position = UDim2.new(1, 0, 0, l_Sizes_0.TopBarHeight),
            Size = UDim2.new(1, 0, 1, -(l_Sizes_0.TopBarHeight + 2))
        }, {
            LeftPanel = v1.createElement(l_Pane_0, {
                LayoutOrder = 1,
                Layout = Enum.FillDirection.Vertical,
                Size = UDim2.new(0.5, 0, 1, 0)
            }, {
                PreviewContainer = v1.createElement(v15, {
                    LayoutOrder = 1
                }),
                Separator = v1.createElement(l_Separator_0, {
                    DominantAxis = Enum.DominantAxis.Width,
                    LayoutOrder = 2
                }),
                TreeContainer = v1.createElement(l_Pane_0, {
                    LayoutOrder = 3,
                    Size = UDim2.new(1, 0, l_Sizes_0.PreviewRatio, -1)
                }, {
                    TreeView = v1.createElement(v12, {
                        Instances = {
                            l_props_0.ImportTree
                        },
                        FileName = l_props_0.Filename or ""
                    })
                })
            }),
            Separator = v1.createElement(l_Separator_0, {
                DominantAxis = Enum.DominantAxis.Height,
                LayoutOrder = 2
            }),
            RightPanel = v1.createElement(l_Pane_0, {
                LayoutOrder = 3,
                Size = UDim2.new(0.5, -1, 1, 0)
            }, {
                ImportConfiguration = v1.createElement(v13, {
                    ImportItem = l_props_0.SelectedImportItem,
                    AssetImportSession = l_props_0.AssetImportSession
                })
            })
        })
    });
end;
return v2.connect(function(v21)
    return {
        AssetImportSession = v21.Preview.assetImportSession,
        ImportTree = v21.Preview.importTree,
        Filename = v21.Preview.filename,
        SelectedImportItem = v21.Preview.selectedImportItem
    };
end, nil)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0,
    PresetController = v11
})(v16)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_Dash_0 = v1.Dash;
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v1.Style.Stylizer;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local v13 = require(l_script_FirstAncestor_0.Src.Actions.SetShowError);
local v14 = v2.PureComponent:extend("ErrorWidget");
local function _(v15, v16)
    if v16 then
        local v17 = l_Dash_0.values(v16:GetStatuses());
        if #v17 >= 1 then
            return v15:getText("Error", v17[1].Type);
        else
            return v15:getText("Error", "DefaultNoStatus");
        end;
    else
        return "";
    end;
end;
v14.init = function(v19)
    v19.onClose = function()
        v19.props.SetShowError(false);
    end;
end;
v14.render = function(v20)
    local l_Localization_1 = v20.props.Localization;
    local l_props_0 = v20.props;
    local l_Stylizer_1 = l_props_0.Stylizer;
    local l_ErrorWidget_0 = l_Stylizer_1.ErrorWidget;
    local l_createElement_0 = v2.createElement;
    local l_l_StyledDialog_0_0 = l_StyledDialog_0;
    local v27 = {
        Buttons = {
            {
                Key = "ok",
                Text = l_Localization_1:getText("Error", "OK")
            }
        },
        Enabled = l_props_0.ShowError,
        MinContentSize = Vector2.new(l_ErrorWidget_0.Width, l_ErrorWidget_0.Height),
        Modal = true,
        OnButtonPressed = v20.onClose,
        OnClose = v20.onClose,
        Resizable = false,
        Style = "Alert",
        Title = l_props_0.Title
    };
    local v28 = {};
    local l_createElement_1 = v2.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v31 = {
        Layout = Enum.FillDirection.Horizontal,
        Size = UDim2.new(1, 0, 1, 0),
        Spacing = l_ErrorWidget_0.IconSpacing
    };
    local v32 = {
        Image = v2.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Image = l_Stylizer_1.ErrorIcon.Image,
            Size = UDim2.fromOffset(l_ErrorWidget_0.IconSize, l_ErrorWidget_0.IconSize),
            LayoutOrder = 1
        })
    };
    local l_createElement_2 = v2.createElement;
    local l_l_Pane_0_1 = l_Pane_0;
    local v35 = {
        Layout = Enum.FillDirection.Vertical,
        Size = UDim2.new(0.6, 0, 1, 0),
        LayoutOrder = 2
    };
    local v36 = {
        Header = v2.createElement(l_TextLabel_0, {
            Text = l_Localization_1:getText("Error", "Header"),
            TextSize = l_ErrorWidget_0.TextSize,
            TextXAlignment = Enum.TextXAlignment.Left,
            Size = UDim2.new(1, 0, 0.35, 0),
            LayoutOrder = 1
        })
    };
    local l_createElement_3 = v2.createElement;
    local l_l_TextLabel_0_0 = l_TextLabel_0;
    local v39 = {};
    local l_AssetImportSession_0 = l_props_0.AssetImportSession;
    local v41;
    if l_AssetImportSession_0 then
        local v42 = l_Dash_0.values(l_AssetImportSession_0:GetStatuses());
        v41 = if #v42 >= 1 then l_Localization_1:getText("Error", v42[1].Type) else l_Localization_1:getText("Error", "DefaultNoStatus");
    else
        v41 = "";
    end;
    v39.Text = v41;
    v39.TextSize = l_ErrorWidget_0.SubtextSize;
    v39.TextXAlignment = Enum.TextXAlignment.Left;
    v39.Size = UDim2.new(1, 0, 0.35, 0);
    v39.LayoutOrder = 2;
    v36.SubtextSize = l_createElement_3(l_l_TextLabel_0_0, v39);
    v32.TextPane = l_createElement_2(l_l_Pane_0_1, v35, v36);
    v28.Content = l_createElement_1(l_l_Pane_0_0, v31, v32);
    return l_createElement_0(l_l_StyledDialog_0_0, v27, v28);
end;
return v3.connect(function(v43)
    return {
        ImportTree = v43.Preview.importTree,
        AssetImportSession = v43.Preview.assetImportSession,
        ImportDataCheckedCount = v43.Preview.importDataCheckedCount,
        ErrorNodeChecked = v43.Preview.errorNodeChecked,
        HasInvalidPackageId = v43.Preview.hasInvalidPackageId,
        ShowError = v43.Dialogs.showError
    };
end, function(v44)
    return {
        SetShowError = function(v45)
            v44(v13(v45));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v14)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Src.Thunks.ShowImportPrompt);
local v4 = v1.PureComponent:extend("ImportPrompt");
v4.init = function(v5)
    v5.promptClosed = function(v6, v7)
        if v5.props.OnPromptClosed then
            v5.props.OnPromptClosed(v6, v7);
        end;
    end;
end;
v4.render = function(v8)
    v8.props.showImportPrompt(v8.promptClosed);
end;
return v2.connect(nil, function(v9)
    return {
        showImportPrompt = function(v10)
            v9(v3(v10));
        end
    };
end)(v4);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_DockWidget_0 = l_UI_0.DockWidget;
local l_Pane_0 = l_UI_0.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_Components_0 = l_script_FirstAncestor_0.Src.Components;
local v13 = require(l_Components_0.ImportQueue.AssetList);
local v14 = require(l_Components_0.ImportQueue.QueueControls);
local v15 = require(l_Components_0.ImportQueue.ImportProgressBar);
local v16 = require(l_script_FirstAncestor_0.Src.Actions.SetShowQueue);
local v17 = require(l_script_FirstAncestor_0.Src.Controllers.FileController);
local v18 = v1.PureComponent:extend("ImportQueue");
v18.init = function(v19)
    v19.onClose = function()
        v19.props.SetShowQueue(false);
    end;
end;
v18.render = function(v20)
    local l_props_0 = v20.props;
    local l_ImportQueue_0 = l_props_0.Stylizer.ImportQueue;
    local l_ControlsHeight_0 = l_ImportQueue_0.ControlsHeight;
    local l_ProgressBarHeight_0 = l_ImportQueue_0.ProgressBarHeight;
    return v1.createElement(l_DockWidget_0, {
        Title = l_props_0.Title,
        Enabled = l_props_0.ShowQueue,
        Size = l_ImportQueue_0.WindowSize,
        InitialDockState = Enum.InitialDockState.Bottom,
        MinSize = l_ImportQueue_0.WindowSize,
        OnClose = v20.onClose
    }, {
        Queue = v1.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            VerticalAlignment = Enum.VerticalAlignment.Top
        }, {
            Controls = v1.createElement(v14, {
                LayoutOrder = 1,
                Size = UDim2.new(1, 0, 0, l_ControlsHeight_0)
            }),
            AssetList = v1.createElement(v13, {
                LayoutOrder = 2,
                Size = UDim2.new(1, 0, 1, -if not l_props_0.Uploading then l_ControlsHeight_0 else l_ControlsHeight_0 + l_ProgressBarHeight_0)
            }),
            ImportProgressBar = if not l_props_0.Uploading then nil else v1.createElement(v15, {
                LayoutOrder = 3,
                Size = UDim2.new(1, 0, 0, l_ProgressBarHeight_0)
            })
        })
    });
end;
return v2.connect(function(v25)
    return {
        ShowQueue = v25.Dialogs.showQueue,
        Uploading = v25.Dialogs.uploading
    };
end, function(v26)
    return {
        SetShowQueue = function(v27)
            v26(v16(v27));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0,
    FileController = v17
})(v18)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_StyleModifier_0 = v3.Util.StyleModifier;
local l_UI_0 = v3.UI;
local l_Separator_0 = l_UI_0.Separator;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local v12 = require(l_script_FirstAncestor_0.Src.Components.AssetImporterUI);
local v13 = require(l_script_FirstAncestor_0.Src.Controllers.FileController);
local v14 = require(l_script_FirstAncestor_0.Src.Controllers.QueueController);
local v15 = require(l_script_FirstAncestor_0.Src.Thunks.ClosePreview);
local v16 = require(l_script_FirstAncestor_0.Src.Actions.SetUploading);
local v17 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAssetImportEnableMultipleFiles);
local v18 = v1.PureComponent:extend("MeshImportDialog");
local function _(v19)
    local v20 = not v19.HasInvalidPackageId;
    if v20 then
        v20 = false;
        if v19.ImportDataCheckedCount ~= 0 then
            v20 = not v19.ErrorNodeChecked;
        end;
    end;
    return v20;
end;
v18.init = function(v22)
    v22.onClose = function()
        v22.props.ClosePreview();
    end;
    v22.onImport = function()
        local l_props_0 = v22.props;
        local v24 = l_props_0.SessionQueue[l_props_0.Filename];
        l_props_0.ClosePreview();
        l_props_0.SetUploading(true);
        l_props_0.QueueController:uploadItem(v24);
        l_props_0.SetUploading(false);
    end;
    v22.onButtonPressed = function(v25)
        if not v17() then
            local l_props_1 = v22.props;
            if v25 == "Cancel" then
                l_props_1.FileController:DEPRECATED_onSessionCanceled(l_props_1.AssetImportSession);
                return ;
            elseif v25 == "Import" then
                local v27 = not l_props_1.HasInvalidPackageId;
                if v27 then
                    v27 = false;
                    if l_props_1.ImportDataCheckedCount ~= 0 then
                        v27 = not l_props_1.ErrorNodeChecked;
                    end;
                end;
                if v27 then
                    l_props_1.FileController:DEPRECATED_onImport(l_props_1.AssetImportSession);
                end;
            end;
        elseif v25 == "Close" then
            v22.onClose();
            return ;
        elseif v25 == "Import" then
            v22.onImport();
            return ;
        end;
    end;
end;
v18.render = function(v28)
    local l_props_2 = v28.props;
    local l_Localization_1 = l_props_2.Localization;
    local v31 = not l_props_2.HasInvalidPackageId;
    if v31 then
        v31 = false;
        if l_props_2.ImportDataCheckedCount ~= 0 then
            v31 = not l_props_2.ErrorNodeChecked;
        end;
    end;
    local v32 = nil;
    v32 = if not v17() then {
        {
            Key = "Cancel",
            Text = l_Localization_1:getText("Plugin", "Cancel")
        },
        {
            Key = "Import",
            Text = l_Localization_1:getText("Plugin", "Import"),
            Style = "RoundPrimary",
            StyleModifier = not v31 and l_StyleModifier_0.Disabled or nil
        }
    } else {
        {
            Key = "Close",
            Text = l_Localization_1:getText("Plugin", "Close")
        },
        {
            Key = "Import",
            Text = l_Localization_1:getText("Plugin", "Import"),
            Style = "RoundPrimary",
            StyleModifier = not v31 and l_StyleModifier_0.Disabled or nil
        }
    };
    local _ = nil;
    return v1.createElement(l_StyledDialog_0, {
        Enabled = l_props_2.ShowPreview,
        MinContentSize = Vector2.new(800, 650),
        Modal = false,
        Resizable = true,
        Title = l_props_2.Title,
        Buttons = v32,
        OnClose = not v17() and function()
            l_props_2.FileController:DEPRECATED_onSessionCanceled(l_props_2.AssetImportSession);
        end or v28.onClose,
        OnButtonPressed = v28.onButtonPressed,
        Style = "FullBleed"
    }, {
        Layout = v1.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical
        }),
        AssetImporterUI = if not l_props_2.ShowPreview then nil else v1.createElement(v12, {
            LayoutOrder = 1
        }),
        Separator = v1.createElement(l_Separator_0, {
            DominantAxis = Enum.DominantAxis.Width,
            LayoutOrder = 2
        })
    });
end;
return v2.connect(function(v34)
    return {
        ImportTree = v34.Preview.importTree,
        AssetImportSession = v34.Preview.assetImportSession,
        ImportDataCheckedCount = v34.Preview.importDataCheckedCount,
        ErrorNodeChecked = v34.Preview.errorNodeChecked,
        HasInvalidPackageId = v34.Preview.hasInvalidPackageId,
        ShowPreview = v34.Dialogs.showPreview,
        SessionQueue = if not v17() then nil else v34.Sessions.sessionQueue,
        Filename = if not v17() then nil else v34.Preview.filename
    };
end, function(v35)
    return {
        ClosePreview = function()
            v35(v15());
        end,
        SetUploading = function(v36)
            v35(v16(v36));
        end
    };
end)((l_withContext_0({
    FileController = v13,
    QueueController = if not v17() then nil else v14,
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v18)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Stylizer_0 = l_ContextServices_0.Stylizer;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextInput_0 = l_UI_0.TextInput;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_StyleModifier_0 = v1.Util.StyleModifier;
local v13 = require(l_script_FirstAncestor_0.Src.Controllers.PresetController);
local v14 = require(l_script_FirstAncestor_0.Src.Flags.getFIntAssetImportMaxPresetNameLength);
local v15 = require(l_script_FirstAncestor_0.Src.Flags.getFIntAssetImportMaxPresetCount);
local v16 = v2.PureComponent:extend("PresetNamePrompt");
v16.init = function(v17)
    v17.state = {
        currentText = v17:_getInitialPresetName(),
        title = ""
    };
    v17.onTextChanged = function(v18)
        v17:setState({
            currentText = v18
        });
    end;
    v17.onButtonPressed = function(v19)
        v17.props.OnButtonPressed(v19, v17.state.currentText);
    end;
end;
v16._getInitialPresetName = function(v20)
    local l_props_0 = v20.props;
    if l_props_0.Intent == "Rename" then
        return l_props_0.CurrentPreset;
    else
        local v22 = l_props_0.PresetController:getAllPresets();
        local v23 = l_props_0.Localization:getText("Templates", "NewPreset");
        if v22[v23] == nil then
            return v23;
        else
            for v24 = 1, v15() + 1 do
                local v25 = ("%* %*"):format(v23, v24);
                if v22[v25] == nil then
                    return v25;
                end;
            end;
            return ;
        end;
    end;
end;
v16._createMessage = function(v26)
    local l_props_1 = v26.props;
    local l_Localization_1 = l_props_1.Localization;
    local l_PresetController_0 = l_props_1.PresetController;
    local l_PresetNamePrompt_0 = l_props_1.Stylizer.PresetNamePrompt;
    local v31 = (l_PresetNamePrompt_0.LabelSize.X.Offset + l_PresetNamePrompt_0.TextboxSize.X.Offset) + l_PresetNamePrompt_0.Padding;
    local l_currentText_0 = v26.state.currentText;
    local v33 = l_PresetController_0:getNumPresetsRemaining();
    local v34 = l_props_1.Intent == "Create";
    local v35 = v33 <= 0;
    local v36 = l_PresetController_0:isLastImport(l_currentText_0) or l_PresetController_0:isStudioDefault(l_currentText_0);
    local v37 = false;
    if l_PresetController_0:getAllPresets()[l_currentText_0] ~= nil then
        v37 = v34 or l_currentText_0 ~= l_props_1.CurrentPreset;
    end;
    local v38 = "";
    local v39 = false;
    local v40 = false;
    if not v36 then
        if not v37 then
            if not v35 or not v34 then
                if v34 then
                    v38 = l_Localization_1:getText("Templates", "PresetsRemaining1", {
                        presetsRemaining = tostring(v33)
                    });
                end;
            else
                v38 = l_Localization_1:getText("Templates", "TooManyPresets");
                v39 = true;
            end;
        else
            v38 = l_Localization_1:getText("Templates", "PresetNameOverwriteWarning");
            v40 = true;
        end;
    else
        v38 = l_Localization_1:getText("Templates", "OverwritingReservedName");
        v39 = true;
    end;
    local v41 = nil;
    if not v39 then
        if v40 then
            v41 = "Warning";
        end;
    else
        v41 = "Error";
    end;
    return v2.createElement(l_TextLabel_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Size = UDim2.new(0, v31, 0, 0),
        Text = v38,
        Style = v41,
        LayoutOrder = 2,
        TextWrapped = true,
        TextXAlignment = Enum.TextXAlignment.Left,
        TextYAlignment = Enum.TextYAlignment.Top
    });
end;
v16.render = function(v42)
    local l_props_2 = v42.props;
    local l_Localization_2 = l_props_2.Localization;
    local l_PresetController_1 = l_props_2.PresetController;
    local l_PresetNamePrompt_1 = l_props_2.Stylizer.PresetNamePrompt;
    local l_RenameMinContentSize_0 = l_PresetNamePrompt_1.RenameMinContentSize;
    local l_Intent_0 = l_props_2.Intent;
    local v49 = if l_Intent_0 == "Create" then l_Localization_2:getText("Templates", "WindowTitleNewPreset") else if l_Intent_0 == "Rename" then l_Localization_2:getText("Templates", "WindowTitleRenamePreset") else nil;
    local l_currentText_1 = v42.state.currentText;
    local v51 = l_PresetController_1:getNumPresetsRemaining() <= 0;
    local v52 = l_PresetController_1:getAllPresets()[l_currentText_1] ~= nil;
    local v53 = false;
    if l_Intent_0 == "Create" then
        v53 = v51;
    end;
    if not ((not (l_Intent_0 == "Create") or not v51) or not v52) then
        v53 = false;
    end;
    if not (not l_PresetController_1:isLastImport(l_currentText_1) and not l_PresetController_1:isStudioDefault(l_currentText_1)) then
        v53 = true;
    end;
    if not (v14() >= utf8.len(l_currentText_1)) or utf8.len(l_currentText_1) < 1 then
        v53 = true;
    end;
    return v2.createElement(l_StyledDialog_0, {
        Title = v49,
        MinContentSize = l_RenameMinContentSize_0,
        Buttons = {
            {
                Key = "Cancel",
                Text = l_Localization_2:getText("Plugin", "Cancel")
            },
            {
                Key = "Save",
                Text = l_Localization_2:getText("Plugin", "Save"),
                StyleModifier = if not v53 then nil else l_StyleModifier_0.Disabled
            }
        },
        OnButtonPressed = v42.onButtonPressed,
        OnClose = l_props_2.OnClose,
        ButtonHorizontalAlignment = Enum.HorizontalAlignment.Center,
        Modal = true
    }, {
        Pane = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            Spacing = l_PresetNamePrompt_1.Padding,
            Size = UDim2.fromScale(1, 1)
        }, {
            TextBox = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                Layout = Enum.FillDirection.Horizontal,
                VerticalAlignment = Enum.VerticalAlignment.Top,
                Size = l_PresetNamePrompt_1.TextboxSize,
                LayoutOrder = 1,
                Spacing = l_PresetNamePrompt_1.Padding
            }, {
                Label = v2.createElement(l_TextLabel_0, {
                    Text = v42.props.Localization:getText("Properties", "ImportName"),
                    TextXAlignment = Enum.TextXAlignment.Left,
                    Size = l_PresetNamePrompt_1.LabelSize,
                    LayoutOrder = 1
                }),
                Input = v2.createElement(l_TextInput_0, {
                    Text = v42.state.currentText,
                    MaxLength = v14(),
                    LayoutOrder = 2,
                    OnTextChanged = v42.onTextChanged,
                    Size = l_PresetNamePrompt_1.TextboxSize
                })
            }),
            Message = v42:_createMessage()
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_Localization_0,
    PresetController = v13
})(v16));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_StyledDialog_0 = v3.UI.StyledDialog;
local l_UploadWidgets_0 = l_script_FirstAncestor_0.Src.Components.Dialogs.UploadWidgets;
local v10 = require(l_UploadWidgets_0.SuccessWidget);
local v11 = require(l_UploadWidgets_0.FailureWidget);
local v12 = require(l_UploadWidgets_0.UploadStatus);
local v13 = require(l_script_FirstAncestor_0.Src.Controllers.FileController);
local v14 = require(l_script_FirstAncestor_0.Src.Actions.SetShowProgress);
local v15 = require(l_script_FirstAncestor_0.Src.Actions.SetUploading);
local v16 = v1.PureComponent:extend("ProgressWidget");
v16.init = function(v17)
    v17.state = {
        uploadResults = {},
        progressValue = 0,
        errorMap = {}
    };
    v17.onClose = function()
        local l_props_0 = v17.props;
        l_props_0.SetShowProgress(false);
        l_props_0.FileController:DEPRECATED_cleanupPreview();
    end;
    v17.onButtonPressed = function(v19)
        if v19 == "Close" then
            v17.onClose();
        end;
    end;
    v17.onImportCompleted = function(v20)
        v17:setState({
            uploadResults = v20
        });
        v17.props.SetUploading(false);
    end;
    v17.getWidgetContent = function()
        local l_props_1 = v17.props;
        local l_state_0 = v17.state;
        if l_props_1.ShowProgress then
            if not l_props_1.Uploading then
                if not l_state_0.uploadResults.Succeeded then
                    if not (not (l_state_0.uploadResults.Succeeded ~= nil) or l_state_0.uploadResults.Succeeded) then
                        return v1.createElement(v11, {
                            LayoutOrder = 1,
                            ErrorMap = l_state_0.uploadResults.ErrorMessages
                        });
                    end;
                else
                    return v1.createElement(v10, {
                        AddedToInventory = l_props_1.RootImportData.AddModelToInventory
                    });
                end;
            else
                return v1.createElement(v12, {
                    OnImportCompleted = v17.onImportCompleted
                });
            end;
        end;
        return nil;
    end;
end;
v16.render = function(v23)
    local l_props_2 = v23.props;
    local l_Localization_1 = l_props_2.Localization;
    local l_UploadWidget_0 = l_props_2.Stylizer.UploadWidget;
    return v1.createElement(l_StyledDialog_0, {
        Enabled = l_props_2.ShowProgress,
        MinContentSize = Vector2.new(l_UploadWidget_0.Width, l_UploadWidget_0.Height),
        Modal = false,
        Resizable = true,
        Title = l_props_2.Title,
        Buttons = if not l_props_2.Uploading then {
            {
                Key = "Close",
                Text = l_Localization_1:getText("Plugin", "Close")
            }
        } else {},
        OnClose = v23.onClose,
        OnButtonPressed = v23.onButtonPressed,
        ButtonHorizontalAlignment = Enum.HorizontalAlignment.Center
    }, {
        ContentInfo = v23.getWidgetContent()
    });
end;
return v2.connect(function(v27)
    return {
        RootImportData = v27.Preview.importTree,
        ShowProgress = v27.Dialogs.showProgress,
        Uploading = v27.Dialogs.uploading
    };
end, function(v28)
    return {
        SetShowProgress = function(v29)
            v28(v14(v29));
        end,
        SetUploading = function(v30)
            v28(v15(v30));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0,
    FileController = v13
})(v16)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_withContext_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices.withContext;
local v3 = require(l_script_FirstAncestor_0.Src.Controllers.CalloutController);
local v4 = v1.PureComponent:extend("TeachingCallout");
v4.init = function(v5)
    v5.targetRef = v1.createRef();
end;
v4.didMount = function(v6)
    v6._isMounted = true;
    spawn(function()
        if not (not v6._isMounted or not v6.targetRef) and v6.targetRef.current then
            v6._attachedDefinitionId = v6.props.DefinitionId;
            v6.props.CalloutController:attachCallout(v6._attachedDefinitionId, v6.props.LocationId, v6.targetRef.current);
            return ;
        else
            return ;
        end;
    end);
end;
v4.willUnmount = function(v7)
    v7._isMounted = false;
    if v7._attachedDefinitionId then
        v7.props.CalloutController:detachCalloutsByDefinitionId(v7._attachedDefinitionId);
    end;
end;
v4.render = function(v8)
    local v9 = v8.props.Offset or Vector2.new(0, 0);
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Position = UDim2.new(0, v9.X, 0, v9.Y),
        Size = UDim2.new(1, 0, 1, 0),
        [v1.Ref] = v8.targetRef
    });
end;
return (l_withContext_0({
    CalloutController = v3
})(v4));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v4 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v5 = require(l_script_FirstAncestor_0.Src.Utility.GetLocalizedString);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v1.Style.Stylizer;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v14 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAssetImportEnableMultipleFiles);
local v15 = v2.PureComponent:extend("FailureWidget");
local function v25(v16, v17, v18, v19)
    local v20 = {};
    for v21, v22 in pairs(v16) do
        local _ = nil;
        local _ = nil;
        table.insert(v20, (v2.createElement(l_TextLabel_0, {
            LayoutOrder = #v20 + 1,
            Text = ("%*: %*"):format(v21, if v22 == "500" and v18:GetImportTree().ExistingPackageId ~= "" then v5(v19, "HttpError", "PackageError") else v5(v19, "HttpError", v22) or string.format("%s %s", v19:getText("HttpError", "UnknownStatusCode"), v22)),
            TextSize = v17.SubtextSize,
            TextXAlignment = Enum.TextXAlignment.Center,
            AutomaticSize = Enum.AutomaticSize.Y,
            Size = UDim2.fromScale(1, 0),
            HorizontalAlignment = if not v14() then Enum.HorizontalAlignment.Center else nil
        })));
    end;
    return v20;
end;
v15.render = function(v26)
    local l_props_0 = v26.props;
    local l_Localization_1 = v26.props.Localization;
    local l_UploadWidget_0 = l_props_0.Stylizer.UploadWidget;
    local l_ErrorMap_0 = l_props_0.ErrorMap;
    local v31 = not not v4.isEmpty(l_ErrorMap_0) and l_Localization_1:getText("Upload", "FailureDescriptionNoError") or l_Localization_1:getText("Upload", "FailureDescription");
    local v32 = v25(l_ErrorMap_0, l_UploadWidget_0, l_props_0.AssetImportSession, l_Localization_1);
    local v33 = (l_UploadWidget_0.TextSize + l_UploadWidget_0.SubtextSize) + 10;
    return v2.createElement(l_Pane_0, {
        LayoutOrder = 1,
        Layout = Enum.FillDirection.Vertical,
        VerticalAlignment = Enum.VerticalAlignment.Top
    }, {
        Title = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            Size = UDim2.new(1, 0, 0, v33),
            LayoutOrder = 1
        }, {
            Text = v2.createElement(l_TextLabel_0, {
                LayoutOrder = 1,
                Size = l_UploadWidget_0.TextLabelSize,
                Text = l_Localization_1:getText("Upload", "Failure"),
                TextSize = l_UploadWidget_0.TextSize,
                TextXAlignment = l_UploadWidget_0.TextAlignment,
                TextColor = l_UploadWidget_0.FailureColor
            }),
            Description = v2.createElement(l_TextLabel_0, {
                LayoutOrder = 2,
                Size = l_UploadWidget_0.TextLabelSize,
                Text = v31,
                TextSize = l_UploadWidget_0.SubtextSize,
                TextXAlignment = l_UploadWidget_0.TextAlignment
            })
        }),
        ErrorMap = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = 2,
            Size = UDim2.new(1, -40, 1, -v33),
            HorizontalAlignment = Enum.HorizontalAlignment.Center
        }, {
            ScrollingFrame = v2.createElement(l_ScrollingFrame_0, {
                LayoutOrder = 1,
                Size = UDim2.new(1, 0, 1, 0),
                CanvasSize = UDim2.fromScale(1, 0),
                OnCanvasResize = v26.onContentResize,
                ScrollingDirection = Enum.ScrollingDirection.Y,
                AutomaticCanvasSize = Enum.AutomaticSize.Y,
                Layout = Enum.FillDirection.Vertical
            }, {
                Pane = v2.createElement(l_Pane_0, {
                    Size = l_UploadWidget_0.TextLabelSize,
                    Layout = Enum.FillDirection.Vertical,
                    VerticalAlignment = Enum.VerticalAlignment.Top,
                    LayoutOrder = 1,
                    HorizontalAlignment = Enum.HorizontalAlignment.Center
                }, v32)
            })
        })
    });
end;
return v3.connect(function(v34)
    return {
        AssetImportSession = v34.Preview.assetImportSession
    };
end, function(_)
    return {};
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v15)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v1.Style.Stylizer;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v10 = v2.PureComponent:extend("SuccessWidget");
v10.render = function(v11)
    local l_props_0 = v11.props;
    local l_Localization_1 = v11.props.Localization;
    local l_UploadWidget_0 = l_props_0.Stylizer.UploadWidget;
    return v2.createElement(l_Pane_0, {
        LayoutOrder = 1,
        Layout = Enum.FillDirection.Vertical,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        Size = UDim2.new(0, l_UploadWidget_0.Width, 0, l_UploadWidget_0.Height)
    }, {
        Title = v2.createElement(l_TextLabel_0, {
            LayoutOrder = 1,
            Size = l_UploadWidget_0.TextLabelSize,
            Text = l_Localization_1:getText("Upload", "Success"),
            TextSize = l_UploadWidget_0.TextSize,
            TextXAlignment = l_UploadWidget_0.TextAlignment,
            TextColor = l_UploadWidget_0.SuccessColor
        }),
        Description = if not l_props_0.AddedToInventory then nil else v2.createElement(l_TextLabel_0, {
            LayoutOrder = 2,
            Size = l_UploadWidget_0.TextLabelSize,
            Text = l_Localization_1:getText("Upload", "SuccessDescription"),
            TextSize = l_UploadWidget_0.SubtextSize,
            TextXAlignment = l_UploadWidget_0.TextAlignment
        })
    });
end;
return (l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v10));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v1.Style.Stylizer;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Container_0 = l_UI_0.Container;
local l_LoadingBar_0 = l_UI_0.LoadingBar;
local v13 = require(l_script_FirstAncestor_0.Src.Utility.trimFilename);
local v14 = require(l_script_FirstAncestor_0.Src.Utility.openInAvatarPreviewer);
local v15 = require(l_script_FirstAncestor_0.Src.Thunks.InsertModelInWorkspace);
local v16 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagImporterOpensAvatarPreviewerBetaCheck);
local v17 = v2.PureComponent:extend("UploadStatus");
v17.init = function(v18)
    v18.state = {
        progressValue = 0
    };
end;
v17.didMount = function(v19)
    v19._updateImportProgress = function(v20)
        if v19.state.progressValue < v20 then
            v19:setState({
                progressValue = v20
            });
        end;
    end;
    v19._updateImportComplete = function(v21)
        if v21.Succeeded then
            v19.props.InsertModelInWorkspace(v21, v19.props.RootImportData);
            if v16() then
                v14(v21, v19.props.RootImportData, v19.props.AssetImportSession);
            end;
        end;
        v19.props.OnImportCompleted(v21);
    end;
    v19._updateImportProgressConnection = v19.props.AssetImportSession.UploadProgress:Connect(v19._updateImportProgress);
    v19._updateImportCompleteConnection = v19.props.AssetImportSession.UploadComplete:Connect(v19._updateImportComplete);
end;
v17.willUnmount = function(v22)
    v22._updateImportProgressConnection:Disconnect();
    v22._updateImportCompleteConnection:Disconnect();
end;
v17.render = function(v23)
    local l_props_0 = v23.props;
    local l_state_0 = v23.state;
    local v26 = l_props_0.Localization:getText("Upload", "Uploading");
    local l_UploadWidget_0 = l_props_0.Stylizer.UploadWidget;
    local v28 = v13(l_props_0.Filename);
    local v29 = l_state_0.progressValue or 0;
    return v2.createElement(l_Pane_0, {
        LayoutOrder = 1,
        Layout = Enum.FillDirection.Vertical,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        Padding = l_UploadWidget_0.TopPadding
    }, {
        LoadingText = v2.createElement(l_TextLabel_0, {
            LayoutOrder = 1,
            Size = UDim2.new(1, 0, 0, 30),
            Text = ("%* %* %*%%"):format(v26, v28, (tostring((math.floor(v29 * 100))))),
            TextSize = l_UploadWidget_0.SubtextSize,
            TextXAlignment = l_UploadWidget_0.TextAlignment,
            TextTruncate = Enum.TextTruncate.AtEnd
        }),
        LoadingBarContainer = v2.createElement(l_Container_0, {
            LayoutOrder = 2,
            Size = UDim2.new(1, 0, 0, l_UploadWidget_0.LoadingBarHeight)
        }, {
            LoadingBar = v2.createElement(l_LoadingBar_0, {
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = UDim2.new(0.5, 0, 0.5, 10),
                Size = l_UploadWidget_0.LoadingBarContainerSize,
                Progress = v29
            })
        })
    });
end;
return v3.connect(function(v30)
    return {
        AssetImportSession = v30.Preview.assetImportSession,
        Filename = v30.Preview.filename,
        RootImportData = v30.Preview.importTree
    };
end, function(v31)
    return {
        InsertModelInWorkspace = function(v32, v33)
            v31(v15(v32, v33));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v17)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_copy_0 = v3.Dash.copy;
local l_values_0 = v3.Dash.values;
local l_UI_0 = v3.UI;
local l_Table_0 = l_UI_0.Table;
local l_Pane_0 = l_UI_0.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v14 = require(l_script_FirstAncestor_0.Src.Actions.UpdateQueueItem);
local v15 = require(l_script_FirstAncestor_0.Src.Components.ImportQueue.AssetListCell);
local v16 = require(l_script_FirstAncestor_0.Src.DataTypes.QueuedSession);
local v17 = v1.PureComponent:extend("AssetList");
v17.init = function(v18)
    v18.columnDefaults = {
        {
            Name = "",
            Key = "Checkbox",
            Width = UDim.new(0, 28)
        },
        {
            Name = "Asset",
            Key = "Asset",
            Width = UDim.new(0.5, -84)
        },
        {
            Name = "Preset",
            Key = "Preset",
            Width = UDim.new(0, 140)
        },
        {
            Name = "Path",
            Key = "Path",
            Width = UDim.new(0.5, -84)
        }
    };
    v18.state = {
        columns = v18.columnDefaults
    };
    v18.onColumnSizesChange = function(v19)
        local v20 = l_copy_0(v18.state.columns);
        for v21 = 1, #v18.state.columns do
            v20.Width = v19[v21];
        end;
        v18:setState({
            columns = v20
        });
    end;
    v18.getRows = function()
        local v22 = l_values_0(v18.props.SessionQueue) or {};
        table.sort(v22, v16.compare);
        return v22;
    end;
    v18.onCheckboxToggle = function(v23)
        local l_props_0 = v18.props;
        local v25 = l_copy_0(l_props_0.SessionQueue);
        l_props_0.UpdateQueueItem(v16.update(v25[v23], {
            enabled = not v25[v23].enabled
        }));
    end;
end;
v17.render = function(v26)
    local l_props_1 = v26.props;
    local l_LayoutOrder_0 = v26.props.LayoutOrder;
    local l_Stylizer_1 = l_props_1.Stylizer;
    return v1.createElement(l_Pane_0, {
        Size = l_props_1.Size,
        Padding = l_Stylizer_1.AssetList.Padding,
        LayoutOrder = l_LayoutOrder_0
    }, {
        Inner = v1.createElement(l_Table_0, {
            Rows = v26.getRows(),
            Columns = v26.state.columns,
            Size = UDim2.fromScale(1, 1),
            Scroll = true,
            CellComponent = v15,
            CellProps = {
                OnCheckboxToggle = v26.onCheckboxToggle,
                StatusIconSize = l_Stylizer_1.PropertyView.IconSize
            },
            RowHeight = l_Stylizer_1.AssetList.RowHeight
        })
    });
end;
return v2.connect(function(v30)
    return {
        SessionQueue = v30.Sessions.sessionQueue
    };
end, function(v31)
    return {
        UpdateQueueItem = function(v32)
            v31(v14(v32));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v17)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_LinkText_0 = l_UI_0.LinkText;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_Image_0 = l_UI_0.Image;
local l_Tooltip_0 = l_UI_0.Tooltip;
local v11 = require(l_script_FirstAncestor_0.Src.Components.Presets.PresetSelector);
local v12 = require(l_script_FirstAncestor_0.Src.Controllers.FileController);
local v13 = v1.PureComponent:extend("AssetListCell");
v13.init = function(v14)
    v14.openImportPreview = function()
        v14.props.FileController:requestPreview(v14.props.Row);
    end;
    v14.reopenFileSelection = function()
        v14.props.FileController:requestFileSwap(v14.props.Row.filepath);
    end;
    v14.getModelIcon = function()
        local l_status_0, l_result_0 = pcall(function()
            return game:GetService("StudioService"):GetClassIcon("Model");
        end);
        if not l_status_0 then
            return {
                Image = "rbxasset://textures/ClassImages.png",
                ImageRectOffset = Vector2.new(0, 0),
                ImageRectSize = Vector2.new(16, 16)
            };
        else
            return l_result_0;
        end;
    end;
    v14.toggleCheckbox = function()
        local l_props_0 = v14.props;
        l_props_0.CellProps.OnCheckboxToggle(l_props_0.Row.filepath);
    end;
end;
v13.renderCheckboxCell = function(v18)
    local l_props_1 = v18.props;
    if not (l_props_1.Row.validSession and not l_props_1.Row.uploaded) then
        return nil;
    else
        return (v1.createFragment({
            Layout = v1.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Horizontal,
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                VerticalAlignment = Enum.VerticalAlignment.Center
            }),
            Checkbox = v1.createElement(l_Checkbox_0, {
                OnClick = v18.toggleCheckbox,
                Key = l_props_1.RowIndex,
                Checked = l_props_1.Row.enabled
            })
        }));
    end;
end;
v13.renderAssetCell = function(v20)
    local l_props_2 = v20.props;
    local l_Localization_1 = l_props_2.Localization;
    local l_Style_0 = l_props_2.Style;
    local l_ImportQueue_0 = l_Style_0.ImportQueue;
    local l_Padding_0 = l_ImportQueue_0.Padding;
    local l_DisabledTransparancy_0 = l_ImportQueue_0.DisabledTransparancy;
    local l_Row_0 = l_props_2.Row;
    local v28 = not l_Row_0.enabled or l_Row_0.uploaded;
    local v29 = l_Row_0.errors + l_Row_0.warnings;
    local v30 = v20.getModelIcon();
    local l_X_0 = v30.ImageRectSize.X;
    local v32 = if v29 > 0 then l_props_2.CellProps.StatusIconSize + l_Padding_0 else 0;
    local v33 = if l_Row_0.errors > 0 then l_Style_0.ErrorIcon else l_Style_0.WarningIcon;
    return v1.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Horizontal,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Padding = {
            Left = l_Padding_0,
            Right = l_Padding_0
        },
        Spacing = l_Padding_0
    }, {
        Icon = v1.createElement(l_Pane_0, {
            Size = UDim2.fromOffset(v30.ImageRectSize.X, v30.ImageRectSize.Y),
            Image = v30.Image,
            ImageTransparency = not v28 and 0 or l_DisabledTransparancy_0
        }),
        AssetName = v1.createElement(l_LinkText_0, {
            LayoutOrder = 2,
            TextXAlignment = Enum.TextXAlignment.Left,
            OnClick = v20.openImportPreview,
            Text = l_Row_0.assetName,
            Size = UDim2.new(1, -((l_X_0 + l_Padding_0) + v32), 1, 0),
            TextTruncate = Enum.TextTruncate.SplitWord,
            Style = if not v28 then nil else "Disabled"
        }),
        Status = if v29 > 0 then v1.createElement(l_Image_0, {
            LayoutOrder = 3,
            Style = {
                Image = v33.Image
            },
            Size = v33.Size
        }, {
            Tooltip = v1.createElement(l_Tooltip_0, {
                Text = l_Localization_1:getText("AssetImportTree", "DescendantsContain2", {
                    statusCount = tostring(if l_Row_0.errors > 0 then l_Row_0.errors else l_Row_0.warnings),
                    statusType = if l_Row_0.errors > 0 then l_Localization_1:getText("AssetImportTree", "Errors") else l_Localization_1:getText("AssetImportTree", "Warnings")
                })
            })
        }) else nil
    });
end;
v13.renderPresetCell = function(v34)
    local l_props_3 = v34.props;
    local l_Row_1 = l_props_3.Row;
    return v1.createFragment({
        PresetSelector = v1.createElement(v11, {
            ActiveQueueItem = l_Row_1,
            Enabled = l_Row_1.enabled
        }),
        Padding = v1.createElement("UIPadding", l_props_3.Style.AssetListCell.Padding)
    });
end;
v13.renderPathCell = function(v37)
    local l_props_4 = v37.props;
    local l_Padding_1 = l_props_4.Style.ImportQueue.Padding;
    local v40 = l_props_4.Width or UDim.new(1 / #l_props_4.Columns, 0);
    return v1.createFragment({
        Padding = v1.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, l_Padding_1),
            PaddingRight = UDim.new(0, l_Padding_1)
        }),
        Path = v1.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Horizontal,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Spacing = l_Padding_1,
            ClipsDescendants = true
        }, {
            PathText = v1.createElement(l_LinkText_0, {
                LayoutOrder = 1,
                Size = UDim2.new(v40.Scale, v40.Offset, 1, 0),
                AutomaticSize = Enum.AutomaticSize.Y,
                Text = l_props_4.Row.filepath,
                TextWrapped = false,
                OnClick = v37.reopenFileSelection
            })
        })
    });
end;
v13.getContent = function(v41)
    local l_props_5 = v41.props;
    local l_Key_0 = l_props_5.Columns[l_props_5.ColumnIndex].Key;
    if l_Key_0 == "Checkbox" then
        return v41:renderCheckboxCell();
    elseif l_Key_0 == "Asset" then
        return v41:renderAssetCell();
    elseif l_Key_0 == "Preset" then
        return v41:renderPresetCell();
    elseif l_Key_0 == "Path" then
        return v41:renderPathCell();
    else
        return nil;
    end;
end;
v13.render = function(v44)
    local l_props_6 = v44.props;
    local l_Style_1 = l_props_6.Style;
    local v47 = l_props_6.Width or UDim.new(1 / #l_props_6.Columns, 0);
    return v1.createElement(l_Pane_0, {
        LayoutOrder = l_props_6.ColumnIndex,
        BackgroundColor3 = l_Style_1.BackgroundOdd,
        BorderSizePixel = 1,
        BorderColor3 = l_Style_1.Border,
        Size = UDim2.new(v47.Scale, v47.Offset, 1, 0),
        ClipsDescendants = true
    }, {
        Content = v44:getContent()
    });
end;
return (l_ContextServices_0.withContext({
    Localization = l_Localization_0,
    FileController = v12
})(v13));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_LoadingBar_0 = l_UI_0.LoadingBar;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v12 = v1.PureComponent:extend("ImportProgressBar");
v12.render = function(v13)
    local l_props_0 = v13.props;
    local l_Localization_1 = l_props_0.Localization;
    local v16 = ("%* - %*"):format(l_Localization_1:getText("ImportQueue", "FilesRemaining2", {
        currentFileIndex = tostring(0),
        totalFiles = tostring(0)
    }), (l_Localization_1:getText("ImportQueue", "Complete")));
    local l_ImportQueue_0 = l_props_0.Stylizer.ImportQueue;
    local l_Padding_0 = l_ImportQueue_0.Padding;
    return v1.createElement(l_Pane_0, {
        Size = l_props_0.Size,
        LayoutOrder = l_props_0.LayoutOrder,
        Layout = Enum.FillDirection.Vertical,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        Padding = l_Padding_0,
        Spacing = l_Padding_0
    }, {
        LoadingText = v1.createElement(l_TextLabel_0, {
            LayoutOrder = 1,
            Size = UDim2.new(1, 0, 0, 0),
            AutomaticSize = Enum.AutomaticSize.Y,
            Text = v16,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextWrapped = true
        }),
        LoadingBar = v1.createElement(l_LoadingBar_0, {
            Size = UDim2.new(1, 0, 0, l_ImportQueue_0.LoadingBarWidth),
            Progress = 1
        })
    });
end;
return v2.connect(function(v19)
    return {
        SessionQueue = v19.Sessions.sessionQueue
    };
end, nil)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v12)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_SearchBar_0 = l_UI_0.SearchBar;
local l_Button_0 = l_UI_0.Button;
local l_IconButton_0 = l_UI_0.IconButton;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_StyleModifier_0 = v3.Util.StyleModifier;
local v15 = require(l_script_FirstAncestor_0.Src.Controllers.FileController);
local v16 = require(l_script_FirstAncestor_0.Src.Controllers.QueueController);
local v17 = require(l_script_FirstAncestor_0.Src.Actions.SetShowWarning);
local v18 = v1.PureComponent:extend("QueueControls");
v18.init = function(v19)
    v19.openFile = function()
        v19.props.FileController:requestFilePicker();
    end;
    v19.cleanUp = function()
        v19.props.QueueController:removeAllQueuedFiles();
    end;
    v19.startImport = function()
        v19.props.QueueController:beginImportQueue();
    end;
    v19.onSearchRequested = function(_)
    end;
end;
v18._createIconButton = function(v21, v22, v23, v24)
    local l_props_0 = v21.props;
    local l_IconButtonSize_0 = l_props_0.Stylizer.ImportQueue.IconButtonSize;
    return v1.createElement(l_IconButton_0, {
        OnClick = v23,
        LeftIcon = v22,
        Size = UDim2.fromOffset(l_IconButtonSize_0, l_IconButtonSize_0),
        LayoutOrder = 2,
        Disabled = l_props_0.Uploading,
        TooltipText = v24 or nil,
        Style = "IconOnly"
    });
end;
v18.render = function(v27)
    local l_props_1 = v27.props;
    local v29 = #l_props_1.SessionQueue;
    local l_ImportQueue_0 = l_props_1.Stylizer.ImportQueue;
    local l_Padding_0 = l_ImportQueue_0.Padding;
    local l_ImportButtonWidth_0 = l_ImportQueue_0.ImportButtonWidth;
    local l_IconButtonSize_1 = l_ImportQueue_0.IconButtonSize;
    local v34 = UDim2.new(0, l_ImportButtonWidth_0, 1, 0);
    local v35 = (l_Padding_0 * 4 + l_IconButtonSize_1 * 2) + l_ImportButtonWidth_0;
    local l_Uploading_0 = l_props_1.Uploading;
    local l_Localization_1 = l_props_1.Localization;
    return v1.createElement(l_Pane_0, {
        Size = l_props_1.Size,
        LayoutOrder = l_props_1.LayoutOrder,
        Layout = Enum.FillDirection.Horizontal,
        Spacing = l_Padding_0,
        Padding = l_Padding_0,
        Style = "SubtleBox"
    }, {
        OpenFileButton = v27:_createIconButton(l_ImportQueue_0.OpenImage, v27.openFile, (l_Localization_1:getText("ImportQueue", "AddFile"))),
        CleanupButton = v27:_createIconButton(l_ImportQueue_0.CleanupImage, v27.cleanUp, (l_Localization_1:getText("ImportQueue", "ClearQueue"))),
        SearchBar = v1.createElement(l_SearchBar_0, {
            Size = UDim2.new(1, -v35, 1, 0),
            OnSearchRequested = v27.onSearchRequested,
            LayoutOrder = 3,
            ShowSearchIcon = true,
            ShowSearchButton = false,
            IncrementalTextSearch = true
        }),
        StartImportButton = v1.createElement(l_Button_0, {
            OnClick = v27.startImport,
            Style = "RoundPrimary",
            Text = if not l_Uploading_0 then l_Localization_1:getText("Plugin", "Import") else l_Localization_1:getText("ImportQueue", "StopQueue"),
            Size = v34,
            LayoutOrder = 4,
            StyleModifier = if not l_Uploading_0 then nil else l_StyleModifier_0.Disabled
        }, {
            Tooltip = v1.createElement(l_Tooltip_0, {
                Text = l_Localization_1:getText("ImportQueue", "StartQueue2", {
                    filesImporting = tostring(0),
                    totalFiles = tostring(v29)
                })
            })
        })
    });
end;
return v2.connect(function(v38)
    return {
        SessionQueue = v38.Sessions.sessionQueue,
        Uploading = v38.Dialogs.uploading
    };
end, function(v39)
    return {
        SetShowWarning = function(v40)
            v39(v17(v40));
        end
    };
end)((l_withContext_0({
    FileController = v15,
    QueueController = v16,
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v18)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Stylizer_0 = l_ContextServices_0.Stylizer;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_StyleModifier_0 = v1.Util.StyleModifier;
local l_UI_0 = v1.UI;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_Button_0 = l_UI_0.Button;
local l_Pane_0 = l_UI_0.Pane;
local v14 = require(l_script_FirstAncestor_0.Src.Components.Dialogs.PresetNamePrompt);
local v15 = require(l_script_FirstAncestor_0.Src.Controllers.PresetController);
local v16 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAssetImportEnableMultipleFiles);
local v17 = v2.PureComponent:extend("PresetMenu");
v17.init = function(v18)
    local l_Localization_1 = v18.props.Localization;
    local v20 = l_Localization_1:getText("Templates", "Reset");
    local v21 = l_Localization_1:getText("Templates", "Rename");
    local v22 = l_Localization_1:getText("Templates", "Delete");
    local v23 = l_Localization_1:getText("Templates", "SaveChanges");
    local v24 = l_Localization_1:getText("Templates", "SaveNewPreset");
    local v25 = l_Localization_1:getText("Templates", "SetAsDefault");
    v18.dropdownItems = {
        v20,
        v23,
        v24,
        v25,
        v21,
        v22
    };
    v18.state = {
        isFocused = not not v16() and nil,
        isHovered = not not v16() and nil,
        showNameDialog = false,
        promptIntent = 0
    };
    if not v16() then
        v18.focused = function()
            v18:setState({
                isFocused = true
            });
        end;
        v18.unfocused = function()
            v18:setState({
                isFocused = false
            });
        end;
        v18.onHoveredItemChanged = function(_)
            v18:setState({
                isHovered = true
            });
        end;
    end;
    v18.onItemActivated = function(v27, _)
        local l_props_0 = v18.props;
        local v30 = if not v16() then l_props_0.CurrentPreset else l_props_0.ActiveQueueItem.currentPreset;
        local l_PresetController_0 = l_props_0.PresetController;
        if v27 == v20 then
            if not v16() then
                l_PresetController_0:DEPRECATED_resolvePreset(v30);
                return ;
            else
                l_PresetController_0:resolvePreset(v30, l_props_0.ActiveQueueItem);
                return ;
            end;
        elseif v27 == v21 then
            v18:setState({
                showNameDialog = true,
                promptIntent = "Rename"
            });
            return ;
        elseif v27 == v22 then
            l_props_0.PresetController:delete(v30);
            return ;
        elseif v27 == v23 then
            l_PresetController_0:save(v30);
            return ;
        elseif v27 == v24 then
            v18:setState({
                showNameDialog = true,
                promptIntent = "Create"
            });
            return ;
        else
            if v27 == v25 then
                l_props_0.PresetController:setDefault(v30);
            end;
            return ;
        end;
    end;
    v18.isItemEnabled = function(v32)
        local l_props_1 = v18.props;
        local v34 = if not v16() then l_props_1.CurrentPreset else l_props_1.ActiveQueueItem.currentPreset;
        local v35 = l_props_1.PresetController:isStudioDefault(v34);
        local v36 = l_props_1.PresetController:isLastImport(v34);
        local v37 = l_props_1.PresetController:isDefault(v34);
        local v38 = not v35 and not v36;
        if v32 == v20 then
            return l_props_1.SettingsChanged;
        elseif v32 == v21 then
            return v38;
        elseif v32 == v22 then
            return v38;
        elseif v32 == v23 then
            return l_props_1.SettingsChanged and v38;
        elseif v32 == v24 then
            return not v35 or l_props_1.SettingsChanged;
        elseif v32 == v25 then
            return not v37;
        else
            return false;
        end;
    end;
    v18.onRenderItem = function(v39, v40, v41, v42)
        local l_TopBar_0 = v18.props.Stylizer.TopBar;
        local v44 = if v18.isItemEnabled(v39) then if v42 then l_StyleModifier_0.Hover else nil else l_StyleModifier_0.Disabled;
        return v2.createElement(l_Button_0, {
            LayoutOrder = v40,
            OnClick = v41,
            OnMouseEnter = if v16() then nil else function()
                v18.onHoveredItemChanged(v40);
            end,
            Size = l_TopBar_0.MenuItemSize,
            StyleModifier = v44,
            AutomaticSize = Enum.AutomaticSize.X
        }, {
            TextLabel = v2.createElement(l_TextLabel_0, {
                Text = v39,
                TextXAlignment = Enum.TextXAlignment.Left,
                Size = UDim2.fromScale(1, 1),
                StyleModifier = v44,
                AutomaticSize = Enum.AutomaticSize.X
            }, {
                Padding = v2.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, l_TopBar_0.Padding.Left),
                    PaddingRight = UDim.new(0, l_TopBar_0.Padding.Right)
                })
            })
        });
    end;
    v18.onNameDialogClose = function()
        v18:setState({
            showNameDialog = false
        });
    end;
    v18.onNameDialogButtonPressed = function(v45, v46)
        local l_PresetController_1 = v18.props.PresetController;
        if v45 == "Save" then
            if v18.state.promptIntent == "Create" then
                l_PresetController_1:save(v46);
            elseif v18.state.promptIntent == "Rename" then
                if not v16() then
                    l_PresetController_1:DEPRECATED_rename(v46);
                else
                    l_PresetController_1:rename(v46, v18.props.ActiveQueueItem.currentPreset);
                end;
            end;
        end;
        v18:setState({
            showNameDialog = false
        });
    end;
end;
v17.render = function(v48)
    local l_props_2 = v48.props;
    local l_state_0 = v48.state;
    local l_TopBar_1 = l_props_2.Stylizer.TopBar;
    return v2.createElement(l_Pane_0, {
        Size = l_TopBar_1.MenuButtonSize,
        LayoutOrder = l_props_2.LayoutOrder
    }, {
        PresetMenu = v2.createElement(l_SelectInput_0, {
            Items = v48.dropdownItems,
            HideText = true,
            OnItemActivated = v48.onItemActivated,
            OnRenderItem = v48.onRenderItem,
            OnMouseEnter = v48.focused,
            OnMouseLeave = v48.unfocused,
            Size = UDim2.new(1, 0, 1, 0),
            ExpandIcon = l_TopBar_1.MenuImage,
            ShowSelection = false,
            UseAutoWidth = true
        }),
        PresetNamePrompt = if not l_state_0.showNameDialog then nil else v2.createElement(v14, {
            CurrentPreset = if not v16() then v48.props.CurrentPreset else l_props_2.ActiveQueueItem.currentPreset,
            Intent = l_state_0.promptIntent,
            IsHintError = false,
            OnClose = v48.onNameDialogClose,
            OnButtonPressed = v48.onNameDialogButtonPressed
        })
    });
end;
return v3.connect(function(v52)
    return {
        ActiveQueueItem = if not v16() then nil else v52.Preview.activeQueueItem,
        AssetImportSession = if not v16() then nil else v52.Preview.assetImportSession,
        CurrentPreset = if not v16() then v52.Preview.currentPreset else nil,
        SettingsChanged = v52.Preview.settingsChanged
    };
end, nil)((l_withContext_0({
    Stylizer = l_Stylizer_0,
    Localization = l_Localization_0,
    PresetController = v15
})(v17)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Button_0 = l_UI_0.Button;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_findIndex_0 = v3.Dash.findIndex;
local l_StyleModifier_0 = v3.Util.StyleModifier;
local v16 = require(l_script_FirstAncestor_0.Src.Controllers.PresetController);
local v17 = require(l_script_FirstAncestor_0.Src.Actions.SetCurrentPreset);
local v18 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAssetImportEnableMultipleFiles);
local v19 = v1.PureComponent:extend("PresetSelector");
local function _(v20)
    if string.sub(v20, -1) == "*" then
        v20 = string.sub(v20, 1, -2);
    end;
    return v20;
end;
if v18() then
    v19.defaultProps = {
        Enabled = true
    };
end;
v19.init = function(v22)
    v22.renderDropdownItem = function(v23, v24, v25, v26)
        local l_TopBar_0 = v22.props.Stylizer.TopBar;
        local l_PresetController_0 = v22.props.PresetController;
        local v29 = nil;
        local l_v23_0 = v23;
        if string.sub(l_v23_0, -1) == "*" then
            l_v23_0 = string.sub(l_v23_0, 1, -2);
        end;
        local l_l_v23_0_0 = l_v23_0;
        v29 = if not l_PresetController_0:isStudioDefault(l_l_v23_0_0) then l_PresetController_0:isLastImport(l_l_v23_0_0) and 2 or 2 + v24 else 1;
        l_v23_0 = if not v26 then nil else l_StyleModifier_0.Hover;
        return v1.createElement(l_Button_0, {
            LayoutOrder = v29,
            OnClick = v25,
            Size = l_TopBar_0.MenuItemSize,
            StyleModifier = l_v23_0
        }, {
            TextLabel = v1.createElement(l_TextLabel_0, {
                Text = l_l_v23_0_0,
                TextXAlignment = Enum.TextXAlignment.Left,
                Size = UDim2.fromScale(1, 1),
                TextTruncate = Enum.TextTruncate.AtEnd,
                StyleModifier = l_v23_0
            }, {
                Padding = v1.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, l_TopBar_0.Padding.Left),
                    PaddingRight = UDim.new(0, l_TopBar_0.Padding.Right)
                })
            })
        });
    end;
    v22.onItemActivated = function(v32, _)
        if not v18() then
            v22.props.SetCurrentPreset(v32);
            v22.props.PresetController:DEPRECATED_resolvePreset(v32);
            return ;
        else
            local l_props_0 = v22.props;
            l_props_0.PresetController:resolvePreset(v32, l_props_0.ActiveQueueItem);
            return ;
        end;
    end;
end;
v19.render = function(v35)
    local l_props_1 = v35.props;
    local l_TopBar_1 = l_props_1.Stylizer.TopBar;
    local v38 = if not v18() then l_props_1.CurrentPreset else l_props_1.ActiveQueueItem.currentPreset;
    local v39 = l_props_1.PresetController:getNameList(v38);
    local v40 = l_props_1.PresetController:isLastImport(v38);
    local v41 = nil;
    if v40 then
        v41 = l_props_1.Localization:getText("Templates", "LastImportTooltip");
    end;
    if l_props_1.SettingsChanged then
        v41 = l_props_1.Localization:getText("Templates", "ModifiedTemplateTooltip");
    end;
    local v44 = v1.createElement(l_SelectInput_0, {
        Items = v39,
        LayoutOrder = l_props_1.LayoutOrder,
        OnRenderItem = v35.renderDropdownItem,
        OnItemActivated = v35.onItemActivated,
        SelectedIndex = l_findIndex_0(v39, function(v42)
            local l_v42_0 = v42;
            if string.sub(l_v42_0, -1) == "*" then
                l_v42_0 = string.sub(l_v42_0, 1, -2);
            end;
            return l_v42_0 == v38;
        end),
        Size = if not v18() then nil else if not l_props_1.Size then UDim2.fromScale(1, 1) else l_props_1.Size,
        Width = if v18() then nil else l_TopBar_1.TemplateDropDown.X.Offset,
        Enabled = if not v18() then nil else l_props_1.Enabled,
        TextTruncate = Enum.TextTruncate.AtEnd
    });
    if v18() or not v41 then
        return v44;
    else
        return v1.createElement(l_Pane_0, {
            LayoutOrder = 3,
            Size = l_TopBar_1.TemplateDropDown
        }, {
            v1.createElement(l_Tooltip_0, {
                Text = v41,
                Child = v44
            })
        });
    end;
end;
return v2.connect(function(v45)
    return {
        CurrentPreset = if v18() then nil else v45.Preview.currentPreset,
        SettingsChanged = if v18() then nil else v45.Preview.settingsChanged,
        Checked = if v18() then nil else v45.Preview.importDataChecked or {}
    };
end, function(v46)
    return {
        SetCurrentPreset = if v18() then nil else function(v47)
            v46(v17(v47));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0,
    PresetController = v16
})(v19)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Src.Utility.createAxisIndicator);
local v3 = v1.PureComponent:extend("AxisIndicator");
local v4 = CFrame.new(0, 0, 6);
v3.init = function(v5)
    v5.isOrbitDragging = false;
    v5.isPanDragging = false;
    v5.lastClickTime = 0;
    v5.initialCenter = false;
    v5.props.Model = v2();
    v5.viewportFrameRef = v1.createRef();
    local l_Camera_0 = Instance.new("Camera");
    l_Camera_0.Name = "AxisCamera";
    local l_ReferenceCamera_0 = v5.props.ReferenceCamera;
    l_Camera_0.CFrame = (l_ReferenceCamera_0.CFrame - l_ReferenceCamera_0.CFrame.Position):ToWorldSpace(v4);
    v5.refCamCFrameChangedConnection = l_ReferenceCamera_0:GetPropertyChangedSignal("CFrame"):Connect(function()
        l_Camera_0.CFrame = (l_ReferenceCamera_0.CFrame - l_ReferenceCamera_0.CFrame.Position):ToWorldSpace(v4);
    end);
    v5.camera = l_Camera_0;
    v5.viewportFrameModel = nil;
end;
v3.updateViewportModel = function(v8)
    v8.viewportFrameModel = v8.props.Model:Clone();
    local v9 = v8.viewportFrameRef:getValue();
    if v9 then
        v9:ClearAllChildren();
        v8.viewportFrameModel.Parent = v9;
    end;
end;
v3.didMount = function(v10)
    v10:updateViewportModel();
end;
v3.willUnmount = function(v11)
    if v11.viewportFrameModel then
        v11.viewportFrameModel:Destroy();
        v11.viewportFrameModel = nil;
    end;
    if v11.camera then
        v11.camera:Destroy();
        v11.camera = nil;
    end;
    v11.refCamCFrameChangedConnection:Disconnect();
end;
v3.render = function(v12)
    local l_props_0 = v12.props;
    return v1.createElement("ViewportFrame", {
        LayoutOrder = l_props_0.LayoutOrder,
        Position = l_props_0.Position,
        Size = l_props_0.Size or UDim2.new(1, 0, 1, 0),
        BorderSizePixel = 0,
        BackgroundTransparency = 1,
        CurrentCamera = v12.camera,
        [v1.Ref] = v12.viewportFrameRef
    });
end;
return v3;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_withContext_0 = v3.ContextServices.withContext;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_AssetRenderModel_0 = l_UI_0.AssetRenderModel;
local v9 = require(l_script_FirstAncestor_0.Src.Components.Preview.WorkspacePreview);
local v10 = require(l_script_FirstAncestor_0.Src.Components.Preview.AxisIndicator);
local v11 = require(l_script_FirstAncestor_0.Src.Components.Preview.PreviewControls);
local v12 = require(l_script_FirstAncestor_0.Src.Components.Preview.RigVisualization);
local v13 = require(l_script_FirstAncestor_0.Src.Actions.SetSettingsChanged);
local v14 = require(l_script_FirstAncestor_0.Src.Thunks.UpdatePreviewInstance);
local v15 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagDevFrameworkRenderModelLoadedSignal);
local v16 = require(l_script_FirstAncestor_0.Src.Utility.getAssetPreviewProps);
local v17 = require(l_script_FirstAncestor_0.Src.Utility.getAssetRenderModel);
local v18 = require(l_script_FirstAncestor_0.Src.Utility.loadAnimation);
local v19 = Vector3.new(-1, 1, -1);
local v20 = v1.PureComponent:extend("PreviewContainer");
v20.init = function(v21)
    local l_props_0 = v21.props;
    v21:setState({
        showContext = false
    });
    v21.recenterCamera = false;
    v21.recenterModel = true;
    v21.lastCamCFrame = CFrame.identity;
    v21.previewProps = v16(l_props_0.PreviewInstance, l_props_0.ImportTree, l_props_0.SelectedImportItem.Id == "0", v21.state.showContext);
    v21.camera = Instance.new("Camera");
    v21.onClickCenterCamera = function()
        local v23 = v17(v21.props.PreviewInstance):GetExtentsSize().Magnitude * 0.8;
        local l_Unit_0 = v19.Unit;
        v21.camera.Focus = CFrame.identity;
        v21.camera.CFrame = CFrame.new(v23 * l_Unit_0, v21.camera.Focus.Position);
    end;
    v21.onClickToggleContext = function()
        v21:setState({
            showContext = not v21.state.showContext
        });
    end;
    v21.onClickRigVisualization = function()
        local l_props_1 = v21.props;
        l_props_1.ImportTree.RigVisualization = not l_props_1.ImportTree.RigVisualization;
        if l_props_1.SelectedImportItem then
            l_props_1.UpdatePreviewInstance((l_props_1.SelectedImportItem:GetPreview()));
        end;
    end;
    v21.isRigVisualized = function()
        local l_props_2 = v21.props;
        return not not l_props_2.ImportTree.RigVisualization and l_props_2.SelectedImportItem:IsA("RootImportData") or l_props_2.SelectedImportItem:IsA("JointImportData");
    end;
    v21.loadAnimationIntoViewport = function(v27)
        if v21.props.SelectedImportItem:IsA("AnimationImportData") then
            local v28 = nil;
            do
                local l_v28_0 = v28;
                l_v28_0 = v27.AncestryChanged:connect(function(_, v31)
                    if not (not v31 or not v31:IsDescendantOf(game)) then
                        l_v28_0:Disconnect();
                        local l_v27_FirstChildWhichIsA_0 = v27:FindFirstChildWhichIsA("KeyframeSequence", true);
                        if l_v27_FirstChildWhichIsA_0 then
                            v18(v27, l_v27_FirstChildWhichIsA_0);
                        end;
                    end;
                end);
            end;
        end;
    end;
end;
v20.handleCameraTransition = function(v33, v34, v35)
    local l_SelectedImportItem_0 = v33.props.SelectedImportItem;
    local l_SelectedImportItem_1 = v34.SelectedImportItem;
    if not (not (l_SelectedImportItem_0:IsA("RootImportData") or l_SelectedImportItem_0:IsA("MeshImportData")) and not l_SelectedImportItem_0:IsA("GroupImportData")) then
        v33.lastCamCFrame = v33.camera.CFrame;
    end;
    v33.previewProps = v16(v34.PreviewInstance, v34.ImportTree, v34.SelectedImportItem.Id == "0", v35.showContext);
    if not (l_SelectedImportItem_1:IsA("RootImportData") or l_SelectedImportItem_1:IsA("MeshImportData")) and not l_SelectedImportItem_1:IsA("GroupImportData") then
        v33.recenterCamera = true;
        return ;
    else
        v33.camera.CFrame = v33.lastCamCFrame;
        v33.recenterCamera = false;
        return ;
    end;
end;
v20.willUpdate = function(v38, v39, v40)
    v38:handleCameraTransition(v39, v40);
end;
v20.didUpdate = function(v41, v42)
    if v41.props.SelectedImportItem ~= v42.SelectedImportItem then
        v41.onClickCenterCamera();
    end;
end;
v20.render = function(v43)
    local l_props_3 = v43.props;
    local l_Stylizer_1 = l_props_3.Stylizer;
    local l_Sizes_0 = l_Stylizer_1.Sizes;
    return v1.createElement(l_Pane_0, {
        LayoutOrder = l_props_3.LayoutOrder,
        Size = UDim2.new(1, 0, l_Sizes_0.PreviewRatio, 0)
    }, {
        WorkspacePreviewContainer = v1.createElement(l_Pane_0, {
            ZIndex = 1
        }, {
            WorkspacePreview = v1.createElement(v9, {
                Model = v43.previewProps.workspacePreview,
                ReferenceCamera = v43.camera,
                Offset = v43.previewProps.insertContextOffset
            })
        }),
        PreviewControls = v1.createElement(v11, {
            InsertContextCallback = v43.onClickToggleContext,
            ResetCameraCallback = v43.onClickCenterCamera,
            ShouldShowWorkspaceToggle = l_props_3.SelectedImportItem:IsA("RootImportData") and l_props_3.SelectedImportItem.InsertInWorkspace,
            ShouldShowRigVisualizationToggle = l_props_3.SelectedImportItem:IsA("RootImportData") and l_props_3.AssetImportSession:isAvatar(),
            VisualizeRigCallback = v43.onClickRigVisualization
        }),
        PreviewRenderContainer = v1.createElement(l_Pane_0, {
            ZIndex = 2
        }, {
            PreviewRender = v1.createElement(l_AssetRenderModel_0, {
                Model = v43.previewProps.model,
                InitialDistance = v43.previewProps.initDist,
                Camera = v43.camera,
                FocusDirection = v19,
                RecenterCameraOnUpdate = v43.recenterCamera,
                RecenterModelOnUpdate = v43.recenterModel,
                OnViewModelLoaded = if not v15() then nil else v43.loadAnimationIntoViewport,
                Ambient = l_Stylizer_1.PreviewWindow.Lighting.Ambient,
                LightColor = l_Stylizer_1.PreviewWindow.Lighting.Color,
                LightDirection = l_Stylizer_1.PreviewWindow.Lighting.Direction
            })
        }),
        RigVisualization = if not v43.isRigVisualized() then nil else v1.createElement(l_Pane_0, {
            ZIndex = 3
        }, {
            v1.createElement(v12, {
                PreviewInstance = l_props_3.PreviewInstance,
                Camera = v43.camera,
                AssetImportSession = l_props_3.AssetImportSession,
                SelectedImportItem = l_props_3.SelectedImportItem
            })
        }),
        AxisIndicatorContainer = v1.createElement(l_Pane_0, {
            Size = UDim2.new(0, l_Sizes_0.IndicatorSize, 0, l_Sizes_0.IndicatorSize),
            Position = UDim2.new(1, l_Sizes_0.IndicatorOffset, 1, l_Sizes_0.IndicatorOffset),
            AnchorPoint = Vector2.new(1, 1),
            ZIndex = 4
        }, {
            AxisIndicator = v1.createElement(v10, {
                ReferenceCamera = v43.camera
            })
        })
    });
end;
return v2.connect(function(v47)
    return {
        AssetImportSession = v47.Preview.assetImportSession,
        ImportTree = v47.Preview.importTree,
        PreviewInstance = v47.Preview.previewInstance,
        SelectedImportItem = v47.Preview.selectedImportItem
    };
end, function(v48)
    return {
        SetSettingsChanged = function(v49)
            v48(v13(v49));
        end,
        UpdatePreviewInstance = function(v50)
            v48(v14(v50));
        end
    };
end)((l_withContext_0({
    Stylizer = l_Stylizer_0
})(v20)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AssetImporter");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Button_0 = l_UI_0.Button;
local l_Image_0 = l_UI_0.Image;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v2.Style.Stylizer;
local v12 = require(l_script_FirstAncestor_0.Src.Utility.GetLocalizedString);
local v13 = v1.PureComponent:extend("PreviewControls");
v13.init = function(_)
end;
v13.render = function(v15)
    local l_props_0 = v15.props;
    local l_Stylizer_1 = l_props_0.Stylizer;
    local l_Localization_1 = l_props_0.Localization;
    return v1.createElement(l_Pane_0, {
        VerticalAlignment = Enum.VerticalAlignment.Top,
        Layout = Enum.FillDirection.Vertical,
        Size = l_Stylizer_1.PreviewWindow.PreviewButtonBar.Size,
        Position = l_Stylizer_1.PreviewWindow.PreviewButtonBar.Position,
        Spacing = l_Stylizer_1.PreviewWindow.PreviewButtonBar.Spacing,
        ZIndex = 4
    }, {
        CameraResetButtonContainer = v1.createElement(l_Pane_0, {
            LayoutOrder = 1,
            Size = l_Stylizer_1.PreviewWindow.OptionIconSize,
            AnchorPoint = Vector2.new(1, 0)
        }, {
            CameraResetButton = v1.createElement(l_Button_0, {
                OnClick = v15.props.ResetCameraCallback,
                Style = "RoundSubtle"
            }, {
                Icon = v1.createElement(l_Image_0, {
                    Image = l_Stylizer_1.PreviewWindow.ResetCameraImage
                }, {
                    Tooltip = v1.createElement(l_Tooltip_0, {
                        Text = v12(l_Localization_1, "PreviewTooltip", "ResetCam")
                    })
                })
            })
        }),
        InsertContextToggleButtonContainer = if not l_props_0.ShouldShowWorkspaceToggle then nil else v1.createElement(l_Pane_0, {
            LayoutOrder = 2,
            Size = l_Stylizer_1.PreviewWindow.OptionIconSize,
            AnchorPoint = Vector2.new(1, 0)
        }, {
            InsertContextToggleButton = v1.createElement(l_Button_0, {
                OnClick = v15.props.InsertContextCallback,
                Style = "RoundSubtle"
            }, {
                Icon = v1.createElement(l_Image_0, {
                    Image = l_Stylizer_1.PreviewWindow.ShowWorkspaceImage
                }, {
                    Tooltip = v1.createElement(l_Tooltip_0, {
                        Text = v12(l_Localization_1, "PreviewTooltip", "ToggleInsertContext")
                    })
                })
            })
        }),
        RigVisualizationButtonContainer = if not l_props_0.ShouldShowRigVisualizationToggle then nil else v1.createElement(l_Pane_0, {
            LayoutOrder = 3,
            Size = l_Stylizer_1.PreviewWindow.OptionIconSize,
            AnchorPoint = Vector2.new(1, 0)
        }, {
            RigVisualizationButton = v1.createElement(l_Button_0, {
                OnClick = v15.props.VisualizeRigCallback,
                Style = "RoundSubtle"
            }, {
                Icon = v1.createElement(l_Image_0, {
                    Image = l_Stylizer_1.PreviewWindow.ShowRigVisualizationImage
                }, {
                    Tooltip = v1.createElement(l_Tooltip_0, {
                        Text = v12(l_Localization_1, "PreviewTooltip", "RigVisualization")
                    })
                })
            })
        })
    });
end;
return (l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v13));


local v0 = require(script:FindFirstAncestor("AssetImporter").Packages.Roact);
local v1 = v0.PureComponent:extend("RigVisualization");
v1.init = function(v2)
    v2.viewportFrameRef = v0.createRef();
    v2.camera = v2.props.Camera;
    v2.viewportFrameModel = nil;
    v2.centerModel = function(v3)
        local l_viewportFrameModel_0 = v2.viewportFrameModel;
        local _ = nil;
        l_viewportFrameModel_0:TranslateBy(if not v3:IsA("Model") then -v3.CFrame.Position else -v3:GetBoundingBox().Position);
    end;
end;
v1.addViewportModel = function(v6)
    v6.viewportFrameModel = v6.props.AssetImportSession:GetRigVisualization(v6.props.SelectedImportItem):Clone();
    v6.centerModel(v6.props.PreviewInstance);
    local v7 = v6.viewportFrameRef:getValue();
    if v7 then
        v6.viewportFrameModel.Parent = v7;
    end;
end;
v1.didUpdate = function(v8)
    if v8.viewportFrameModel then
        v8.viewportFrameModel:Destroy();
        v8.viewportFrameModel = nil;
    end;
    v8:addViewportModel();
end;
v1.didMount = function(v9)
    v9:addViewportModel();
end;
v1.willUnmount = function(v10)
    if v10.viewportFrameModel then
        v10.viewportFrameModel:Destroy();
        v10.viewportFrameModel = nil;
    end;
end;
v1.render = function(v11)
    local l_props_0 = v11.props;
    return v0.createElement("ViewportFrame", {
        LayoutOrder = l_props_0.LayoutOrder,
        Position = l_props_0.Position or UDim2.new(0, 0, 0, 0),
        Size = l_props_0.Size or UDim2.new(1, 0, 1, 0),
        BorderSizePixel = 0,
        BackgroundTransparency = 1,
        CurrentCamera = v11.camera,
        [v0.Ref] = v11.viewportFrameRef
    });
end;
return v1;


local v0 = require(script:FindFirstAncestor("AssetImporter").Packages.Roact);
local v1 = v0.PureComponent:extend("WorkspacePreview");
v1.updateViewportModel = function(v2, v3)
    local v4 = v2.viewportFrameRef:getValue();
    if v4 then
        v2.viewportFrameModel = v3.Model:Clone();
        v2.viewportFrameModel:PivotTo(v3.Offset);
        v4:ClearAllChildren();
        v2.viewportFrameModel.Parent = v4;
    end;
end;
v1.init = function(v5)
    local l_props_0 = v5.props;
    v5.viewportFrameRef = v0.createRef();
    v5.camera = l_props_0.ReferenceCamera;
    v5.viewportFrameModel = nil;
    if l_props_0.Model then
        v5:updateViewportModel(l_props_0);
    end;
end;
v1.willUnmount = function(v7)
    if v7.viewportFrameModel then
        v7.viewportFrameModel:Destroy();
        v7.viewportFrameModel = nil;
    end;
end;
v1.willUpdate = function(v8, v9)
    local v10 = v8.viewportFrameRef:getValue();
    if not v9.Model then
        v8.viewportFrameModel:Destroy();
        v8.viewportFrameModel = nil;
        v10:ClearAllChildren();
        return ;
    else
        v8:updateViewportModel(v9);
        return ;
    end;
end;
v1.render = function(v11)
    local l_props_1 = v11.props;
    return v0.createElement("ViewportFrame", {
        LayoutOrder = l_props_1.LayoutOrder,
        Position = l_props_1.Position,
        Size = l_props_1.Size or UDim2.new(1, 0, 1, 0),
        BorderSizePixel = 0,
        BackgroundTransparency = 1,
        ImageTransparency = 0.7,
        CurrentCamera = v11.camera,
        [v0.Ref] = v11.viewportFrameRef
    });
end;
return v1;