return require(script.Parent.Action)(script.Name, function(v0)
    assert(typeof(v0) == "EnumItem", ("Expected SourceMaterial to be a EnumItem, received %s"):format((typeof(v0))));
    return {
        SourceMaterial = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(typeof(v0) == "EnumItem", ("Expected TargetMaterial to be a EnumItem, received %s"):format((typeof(v0))));
    return {
        TargetMaterial = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    return {
        TerrainRegion = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0, v1, v2)
    return {
        TerrainRegionCopyBuffer = v0,
        TerrainRegionCopyTransform = v1,
        TerrainRegionCopySize = v2
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(typeof(v0) == "string", ("Expected TransformMode to be a EnumItem, received %s"):format((typeof(v0))));
    return {
        TransformMode = v0
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v8 = v2.PureComponent:extend("ApplyTransformNote");
v8.render = function(v9)
    local l_props_0 = v9.props;
    local l_Localization_0 = l_props_0.Localization;
    local l_ApplyTransformNote_0 = l_props_0.Stylizer.ApplyTransformNote;
    return v2.createElement(v2.Portal, {
        target = game:GetService("CoreGui")
    }, {
        ApplyTransformNote = v2.createElement("ScreenGui", {}, {
            Frame = v2.createElement(l_Pane_0, {
                AnchorPoint = Vector2.new(0.5, 0),
                AutomaticSize = Enum.AutomaticSize.X,
                BackgroundColor = l_ApplyTransformNote_0.Background,
                Layout = Enum.FillDirection.Horizontal,
                Spacing = l_ApplyTransformNote_0.FramePadding,
                Padding = l_ApplyTransformNote_0.FramePadding,
                Position = UDim2.new(0.5, 0, 0, l_ApplyTransformNote_0.EdgePadding),
                Size = UDim2.fromOffset(0, 25)
            }, {
                Enter = v2.createElement(l_Pane_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    BackgroundColor = l_ApplyTransformNote_0.KeyBackground,
                    Padding = l_ApplyTransformNote_0.TextMargin,
                    LayoutOrder = 1
                }, {
                    Corner = v2.createElement("UICorner", {
                        CornerRadius = UDim.new(0, 4)
                    }),
                    Text = v2.createElement(l_TextLabel_0, {
                        Text = l_Localization_0:getText("TransformAction", "PressEnter")
                    })
                }),
                Apply = v2.createElement(l_Pane_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    Padding = l_ApplyTransformNote_0.TextMargin,
                    LayoutOrder = 2
                }, {
                    Text = v2.createElement(l_TextLabel_0, {
                        Text = l_Localization_0:getText("TransformAction", "ApplyStatusTip")
                    })
                })
            })
        })
    });
end;
return l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v8);


local _ = game:GetService("LocalizationService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v6 = require(l_Parent_0.Src.Util.ConvertTransformToRegion);
local v7 = require(l_Parent_0.Src.Components.ProgressDialog);
local v8 = require(l_Parent_0.Src.Util.CreateSubRegions);
local v9 = require(l_Parent_0.Src.Util.LongOperation);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local v11 = v2.Component:extend("FillDialog");
v11.init = function(v12)
    v12.operation = v9.new({
        onStart = function(v13)
            local l_props_0 = v12.props;
            local l_Terrain_0 = l_props_0.Terrain;
            v13.regions = v8(l_props_0.Transform, l_props_0.Size);
            v13.currentIndex = 1;
            local v16 = v6(l_props_0.Transform, l_props_0.Size);
            v13.backup = l_Terrain_0:CopyRegion(v16);
            v13.backupRegion = v16;
        end,
        onStep = function(v17)
            local l_props_1 = v12.props;
            local l_Replace_0 = l_props_1.Replace;
            local l_Terrain_1 = l_props_1.Terrain;
            local v21 = v17.regions[v17.currentIndex];
            if not l_Replace_0 then
                l_Terrain_1:SetMaterialInTransformSubregion(l_props_1.Transform, l_props_1.Size, l_props_1.Material, v21);
            else
                l_Terrain_1:ReplaceMaterialInTransformSubregion(l_props_1.Transform, l_props_1.Size, l_props_1.SourceMaterial, l_props_1.TargetMaterial, v21);
            end;
            if v17.currentIndex == #v17.regions then
                return false, 0;
            else
                v17.currentIndex = v17.currentIndex + 1;
                return true, v17.currentIndex / #v17.regions;
            end;
        end,
        onCancel = function(v22)
            local l_props_2 = v12.props;
            l_props_2.Terrain:PasteRegion(v22.backup, v22.backupRegion.Min, true);
            l_props_2.OnFinish();
        end,
        onError = function(_)
            print(v12.operation._errorMessage);
        end,
        onFinish = function()
            local l_props_3 = v12.props;
            l_ChangeHistoryService_0:SetWaypoint("TransformAction");
            l_props_3.OnFinish();
        end
    });
    v12.state = {
        paused = false,
        progress = 0,
        running = false
    };
end;
v11.didMount = function(v26)
    v26.pauseChangedConnection = v26.operation.PausedChanged:Connect(function(v27)
        v26:setState({
            paused = v27
        });
    end);
    v26.runningChangedConnection = v26.operation.RunningChanged:Connect(function(v28)
        v26:setState({
            running = v28
        });
    end);
    v26.progressChangedConnection = v26.operation.ProgressChanged:Connect(function(v29)
        v26:setState({
            progress = v29
        });
    end);
    v26.operation:start();
end;
v11.willUnmount = function(v30)
    if v30.pauseChangedConnection then
        v30.pauseChangedConnection:Disconnect();
    end;
    if v30.runningChangedConnection then
        v30.runningChangedConnection:Disconnect();
    end;
    if v30.progressChangedConnection then
        v30.progressChangedConnection:Disconnect();
    end;
    v30.operation:destroy();
end;
v11.render = function(v31)
    local l_props_4 = v31.props;
    local l_Localization_1 = l_props_4.Localization;
    return v2.createElement(v7, {
        Title = if not l_props_4.Replace then l_Localization_1:getText("Fill", "Title") else l_Localization_1:getText("Replace", "Title"),
        SubText = if not l_props_4.Replace then l_Localization_1:getText("Fill", "Description"):format(l_Localization_1:getText("Materials", l_props_4.Material.Name)) else l_Localization_1:getText("Replace", "Description"):format(l_Localization_1:getText("Materials", l_props_4.SourceMaterial.Name), l_Localization_1:getText("Materials", l_props_4.TargetMaterial.Name)),
        Progress = v31.state.progress,
        OnCancelButtonClicked = function()
            v31.operation:cancel();
        end
    });
end;
return l_withContext_0({
    Localization = l_Localization_0
})(v11);


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_ToolId_0 = require(l_Parent_0.Src.Util.TerrainEnums).ToolId;
local v2 = {};
local l_CoreGui_0 = game:GetService("CoreGui");
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_Selection_0 = game:GetService("Selection");
local v6 = require(l_Parent_0.Src.Util.getTerrain);
local v7 = false;
local v8 = nil;
local v9 = nil;
local v10 = nil;
local v11 = nil;
local v12 = nil;
local v13 = nil;
local _ = Color3.fromRGB(72, 145, 212);
local _ = Color3.fromRGB(238, 238, 238);
local v16 = {
    [Enum.NormalId.Top] = Vector3.new(0, 1, 0),
    [Enum.NormalId.Bottom] = Vector3.new(0, -1, 0),
    [Enum.NormalId.Left] = Vector3.new(-1, 0, 0),
    [Enum.NormalId.Right] = Vector3.new(1, 0, 0),
    [Enum.NormalId.Front] = Vector3.new(0, 0, -1),
    [Enum.NormalId.Back] = Vector3.new(0, 0, 1)
};
local v17 = nil;
local v18 = nil;
local v19 = nil;
local v20 = nil;
local v21 = nil;
local v22 = nil;
local v23 = Vector3.new(0, 0, 0);
local v24 = nil;
local v25 = true;
local v26 = nil;
local v27 = nil;
local v28 = nil;
local v29 = nil;
local v30 = "X";
local l_Air_0 = Enum.Material.Air;
local _ = Enum.Material.Water;
local l_floor_0 = math.floor;
local l_ceil_0 = math.ceil;
local v35 = nil;
local v36 = nil;
local v37 = nil;
local v38 = nil;
local v39 = nil;
local v40 = nil;
local v41 = nil;
local v42 = nil;
local v43 = nil;
local v44 = nil;
local v45 = nil;
local function v46()
    if not v7 or not v17 then
        l_Selection_0:ClearTerrainSelectionHack();
        return ;
    else
        l_Selection_0:SetTerrainSelectionHack((((v17 + v18) - Vector3.new(1, 1, 1)) * 0.5) * 4, ((v18 - v17) + Vector3.new(1, 1, 1)) * 4 + Vector3.new(0.21, 0.21, 0.21));
        return ;
    end;
end;
local function _()
    if not (v35 and v35.Parent) then
        v35 = Instance.new("ScreenGui");
        v35.Name = "TerrainRegionEditor";
        v35.Parent = l_CoreGui_0;
    end;
    return v35;
end;
local function v57(v48, v49)
    local v50 = v48 or Vector3.new(1, 1, 1);
    local v51 = {};
    for v52 = 1, v50.x do
        local v53 = {};
        for v54 = 1, v50.y do
            local v55 = {};
            for v56 = 1, v50.z do
                v55[v56] = v49;
            end;
            v53[v54] = v55;
        end;
        v51[v52] = v53;
    end;
    return v51;
end;
v43 = function(_)
    lockInMap();
    renderSelection();
end;
lockInMap = function()
    if not (not v17 or not v18) then
        local v59 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
        v28 = v59;
        local v60, v61 = v12:ReadVoxels(v59, 4);
        v26 = v60;
        v27 = v61;
    end;
end;
renderSelection = function(v62, v63, v64)
    local v65 = v62 or v17;
    local v66 = v63 or v18;
    local v67 = false;
    if not ((not v65 or not v66) or not v19) then
        v67 = true;
        local v68 = ((v66 - v65) + Vector3.new(1, 1, 1)) * 4 + Vector3.new(0.2, 0.2, 0.2);
        if v64 then
            local v69 = v64 * v68;
            v68 = Vector3.new(math.abs(v69.x), math.abs(v69.y), (math.abs(v69.z)));
        end;
        v19.Size = v68;
        v19.CFrame = CFrame.new((((v65 + v66) - Vector3.new(1, 1, 1)) * 0.5) * 4) * (v64 or CFrame.new(0, 0, 0));
    end;
    if v20 then
        v20.Visible = v67;
        v20.Color = BrickColor.new(v39 == l_ToolId_0.Select and "Toothpaste" or "Institutional white");
        v20.SurfaceColor = BrickColor.new(v39 == l_ToolId_0.Select and "Toothpaste" or "Institutional white");
    end;
    if v21 then
        local l_v21_0 = v21;
        local l_v67_0 = v67;
        if l_v67_0 then
            l_v67_0 = true;
            if v40 ~= l_ToolId_0.Move then
                l_v67_0 = v40 == l_ToolId_0.Resize;
            end;
        end;
        l_v21_0.Visible = l_v67_0;
        v21.Color = BrickColor.new(v39 == l_ToolId_0.Select and "Cyan" or "Light stone grey");
        v21.Style = v40 == l_ToolId_0.Move and Enum.HandlesStyle.Movement or Enum.HandlesStyle.Resize;
    end;
    if v13 then
        v13.Visible = v67 and v40 == l_ToolId_0.Rotate;
        v13.Color = BrickColor.new(v39 == l_ToolId_0.Select and "Cyan" or "Light stone grey");
    end;
end;
local function _(v72)
    return (v72 + 0.5) - (v72 + 0.5) % 1;
end;
FirstTimeSetup = function()
    local function _(v74)
        return (Vector3.new(l_ceil_0(v74.x / 4), l_ceil_0(v74.y / 4), (l_ceil_0(v74.z / 4))));
    end;
    local function v85(v76, v77)
        local v78 = v76 or Vector3.new(1, 1, 1);
        local v79 = {};
        for v80 = 1, v78.x do
            local v81 = {};
            for v82 = 1, v78.y do
                local v83 = {};
                for v84 = 1, v78.z do
                    v83[v84] = v77;
                end;
                v81[v82] = v83;
            end;
            v79[v80] = v81;
        end;
        return v79;
    end;
    local function _(v86, v87, v88)
        return v86 + (v87 - v86) * v88;
    end;
    local function _(v90, v91)
        return (v90 - 0.5) * v91 + 0.5;
    end;
    local function _(v93, v94, v95, v96)
        local v97 = ((v93 + (v94 - v93) * v95) - 0.5) * v96 + 0.5;
        if v97 < 0 then
            return 0;
        elseif v97 > 1 then
            return 1;
        else
            return v97;
        end;
    end;
    v42 = function()
        local v99 = v24 or Vector3.new(0, 0, 0);
        local l_v17_0 = v17;
        local l_v18_0 = v18;
        if v40 == l_ToolId_0.Resize then
            if not v25 then
                l_v18_0 = Vector3.new(math.max(math.min(l_v18_0.x + v99.x, l_v17_0.x + 125), l_v17_0.x), math.max(math.min(l_v18_0.y + v99.y, l_v17_0.y + 125), l_v17_0.y), (math.max(math.min(l_v18_0.z + v99.z, l_v17_0.z + 125), l_v17_0.z)));
            else
                l_v17_0 = Vector3.new(math.min(math.max(l_v17_0.x + v99.x, l_v18_0.x - 125), l_v18_0.x), math.min(math.max(l_v17_0.y + v99.y, l_v18_0.y - 125), l_v18_0.y), (math.min(math.max(l_v17_0.z + v99.z, l_v18_0.z - 125), l_v18_0.z)));
            end;
            if v39 == "Edit" then
                local v102 = Region3.new((l_v17_0 - Vector3.new(1, 1, 1)) * 4, l_v18_0 * 4);
                if not v29 then
                    if not (not v17 or not v18) then
                        local v103 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
                        local v104 = v103.Size / 4;
                        v12:WriteVoxels(v103, 4, v85(v104, l_Air_0), (v85(v104, 0)));
                    end;
                else
                    v12:WriteVoxels(v29.region, 4, v29.materials, v29.occupancies);
                end;
                v29 = {};
                v29.region = v102;
                local l_v29_0 = v29;
                local l_v29_1 = v29;
                local v107, v108 = v12:ReadVoxels(v102, 4);
                l_v29_0.materials = v107;
                l_v29_1.occupancies = v108;
                l_v29_0 = v29.materials;
                l_v29_1 = v29.occupancies;
                v107 = #v26 - 1;
                v108 = #v26[1] - 1;
                local v109 = #v26[1][1] - 1;
                local v110 = (Vector3.new(1, 1, 1) + l_v18_0) - l_v17_0;
                local l_x_0 = v110.x;
                local l_y_0 = v110.y;
                local l_z_0 = v110.z;
                local v114 = {};
                local v115 = {};
                for v116 = 1, l_x_0 do
                    local v117 = ((v116 - 1) / (l_x_0 - 1)) * v107;
                    if v117 ~= v117 then
                        v117 = 0;
                    end;
                    local v118 = l_floor_0(v117) + 1;
                    local v119 = v118 + 1;
                    local v120 = (v117 - v118) + 1;
                    if v107 < v118 then
                        v119 = v118;
                    end;
                    local v121 = {};
                    local v122 = {};
                    for v123 = 1, l_y_0 do
                        local v124 = ((v123 - 1) / (l_y_0 - 1)) * v108;
                        if v124 ~= v124 then
                            v124 = 0;
                        end;
                        local v125 = l_floor_0(v124) + 1;
                        local v126 = v125 + 1;
                        local v127 = (v124 - v125) + 1;
                        if v108 < v125 then
                            v126 = v125;
                        end;
                        local v128 = {};
                        local v129 = {};
                        for v130 = 1, l_z_0 do
                            local v131 = l_v29_0[v116][v123][v130];
                            local v132 = l_v29_1[v116][v123][v130];
                            if not (v11 and v131 ~= l_Air_0) or v132 == 0 then
                                local v133 = ((v130 - 1) / (l_z_0 - 1)) * v109;
                                if v133 ~= v133 then
                                    v133 = 0;
                                end;
                                local v134 = l_floor_0(v133) + 1;
                                local v135 = v134 + 1;
                                local v136 = (v133 - v134) + 1;
                                if v109 < v134 then
                                    v135 = v134;
                                end;
                                local v137 = l_x_0 / (v107 + 1);
                                local v138 = l_y_0 / (v108 + 1);
                                local v139 = l_z_0 / (v109 + 1);
                                local v140 = v27[v118][v125][v134];
                                local v141 = ((v140 + (v27[v118][v125][v135] - v140) * v136) - 0.5) * v139 + 0.5;
                                local v142 = v141 < 0 and 0 or (v141 > 1 and 1 or v141);
                                local v143 = v27[v118][v126][v134];
                                local v144 = ((v143 + (v27[v118][v126][v135] - v143) * v136) - 0.5) * v139 + 0.5;
                                v140 = v144 < 0 and 0 or (v144 > 1 and 1 or v144);
                                v141 = v27[v119][v125][v134];
                                local v145 = ((v141 + (v27[v119][v125][v135] - v141) * v136) - 0.5) * v139 + 0.5;
                                v143 = v145 < 0 and 0 or (v145 > 1 and 1 or v145);
                                v144 = v27[v119][v126][v134];
                                local v146 = ((v144 + (v27[v119][v126][v135] - v144) * v136) - 0.5) * v139 + 0.5;
                                v141 = v146 < 0 and 0 or (v146 > 1 and 1 or v146);
                                v145 = ((v142 + (v140 - v142) * v127) - 0.5) * v138 + 0.5;
                                v144 = v145 < 0 and 0 or (v145 > 1 and 1 or v145);
                                v146 = ((v143 + (v141 - v143) * v127) - 0.5) * v138 + 0.5;
                                local v147 = ((v144 + ((v146 < 0 and 0 or (v146 > 1 and 1 or v146)) - v144) * v120) - 0.5) * v137 + 0.5;
                                v146 = v147 < 0 and 0 or (v147 > 1 and 1 or v147);
                                local l_v26_0 = v26;
                                local l_v117_0 = v117;
                                local v150 = l_v26_0[((l_v117_0 + 0.5) - (l_v117_0 + 0.5) % 1) + 1];
                                local l_v124_0 = v124;
                                local v152 = v150[((l_v124_0 + 0.5) - (l_v124_0 + 0.5) % 1) + 1];
                                local l_v133_0 = v133;
                                v128[v130] = v152[((l_v133_0 + 0.5) - (l_v133_0 + 0.5) % 1) + 1];
                                v129[v130] = v146;
                            else
                                v128[v130] = v131;
                                v129[v130] = v132;
                            end;
                        end;
                        v121[v123] = v128;
                        v122[v123] = v129;
                    end;
                    v114[v116] = v121;
                    v115[v116] = v122;
                end;
                v12:WriteVoxels(v102, 4, v114, v115);
            else
                v29 = nil;
            end;
        elseif v40 == l_ToolId_0.Move then
            l_v17_0 = l_v17_0 + v99;
            l_v18_0 = l_v18_0 + v99;
            if v39 == "Edit" then
                local v154 = Region3.new((l_v17_0 - Vector3.new(1, 1, 1)) * 4, l_v18_0 * 4);
                if not v29 then
                    if not (not v17 or not v18) then
                        local v155 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
                        local v156 = v155.Size / 4;
                        v12:WriteVoxels(v155, 4, v85(v156, l_Air_0), (v85(v156, 0)));
                    end;
                else
                    v12:WriteVoxels(v29.region, 4, v29.materials, v29.occupancies);
                end;
                v29 = {};
                v29.region = v154;
                local l_v29_2 = v29;
                local l_v29_3 = v29;
                local v159, v160 = v12:ReadVoxels(v154, 4);
                l_v29_2.materials = v159;
                l_v29_3.occupancies = v160;
                l_v29_2 = v29.materials;
                l_v29_3 = v29.occupancies;
                if v11 then
                    v159 = {};
                    v160 = {};
                    for v161, v162 in ipairs(v26) do
                        local v163 = {};
                        local v164 = {};
                        for v165, v166 in ipairs(v162) do
                            local v167 = {};
                            local v168 = {};
                            for v169, _ in ipairs(v166) do
                                local v171 = l_v29_2[v161][v165][v169];
                                local v172 = l_v29_3[v161][v165][v169];
                                if not (v171 ~= l_Air_0) or v172 == 0 then
                                    v167[v169] = v26[v161][v165][v169];
                                    v168[v169] = v27[v161][v165][v169];
                                else
                                    v167[v169] = v171;
                                    v168[v169] = v172;
                                end;
                            end;
                            v163[v165] = v167;
                            v164[v165] = v168;
                        end;
                        v159[v161] = v163;
                        v160[v161] = v164;
                    end;
                    v12:WriteVoxels(v154, 4, v159, v160);
                else
                    v12:WriteVoxels(v154, 4, v26, v27);
                end;
            end;
        end;
        renderSelection(l_v17_0, l_v18_0);
    end;
    local function _(v173, v174, v175, v176, v177)
        if v177 == 1 then
            return (v175 + 1) - v176, v174;
        elseif v177 == 2 then
            return (v173 + 1) - v174, (v175 + 1) - v176;
        elseif v177 == 3 then
            return v176, (v173 + 1) - v174;
        else
            return v174, v176;
        end;
    end;
    v41 = function()
        local v179 = v44 or 0;
        local v180 = CFrame.Angles(v30 ~= "X" and 0 or v179 * 1.5707963267948966, v30 ~= "Y" and 0 or v179 * 1.5707963267948966, v30 ~= "Z" and 0 or v179 * 1.5707963267948966);
        local v181 = (Vector3.new(1, 1, 1) + v18) - v17;
        local v182 = Vector3.new(l_ceil_0(v181.x * 0.5), l_ceil_0(v181.y * 0.5), (l_ceil_0(v181.z * 0.5)));
        v181 = v180 * v181;
        local v183 = math.abs(v181.x);
        local v184 = (v183 + 0.5) - (v183 + 0.5) % 1;
        local v185 = math.abs(v181.y);
        v183 = (v185 + 0.5) - (v185 + 0.5) % 1;
        local v186 = math.abs(v181.z);
        v185 = (v186 + 0.5) - (v186 + 0.5) % 1;
        v182 = v182 - Vector3.new(l_ceil_0(v184 * 0.5), l_ceil_0(v183 * 0.5), (l_ceil_0(v185 * 0.5)));
        v186 = ((v17 + v182) + Vector3.new(v184, v183, v185)) - Vector3.new(1, 1, 1);
        local v187 = v17 + v182;
        if v39 == "Edit" then
            local v188 = Region3.new((v187 - Vector3.new(1, 1, 1)) * 4, v186 * 4);
            if not v29 then
                if not (not v17 or not v18) then
                    local v189 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
                    local v190 = v189.Size / 4;
                    v12:WriteVoxels(v189, 4, v85(v190, l_Air_0), (v85(v190, 0)));
                end;
            else
                v12:WriteVoxels(v29.region, 4, v29.materials, v29.occupancies);
            end;
            v29 = {};
            v29.region = v188;
            local l_v29_4 = v29;
            local l_v29_5 = v29;
            local v193, v194 = v12:ReadVoxels(v188, 4);
            l_v29_4.materials = v193;
            l_v29_5.occupancies = v194;
            l_v29_4 = {};
            l_v29_5 = {};
            for v195 = 1, v184 do
                local v196 = {};
                local v197 = {};
                for v198 = 1, v183 do
                    local v199 = {};
                    local v200 = {};
                    for v201 = 1, v185 do
                        local v202 = v29.materials[v195][v198][v201];
                        local v203 = v29.occupancies[v195][v198][v201];
                        if not (v11 and v202 ~= l_Air_0) or v203 == 0 then
                            local l_v195_0 = v195;
                            local l_v198_0 = v198;
                            local l_v201_0 = v201;
                            if v30 == "Y" then
                                local v207, v208;
                                if v179 == 1 then
                                    v207 = (v185 + 1) - v201;
                                    v208 = v195;
                                elseif v179 == 2 then
                                    v207 = (v184 + 1) - v195;
                                    v208 = (v185 + 1) - v201;
                                elseif v179 == 3 then
                                    v207 = v201;
                                    v208 = (v184 + 1) - v195;
                                else
                                    v207 = v195;
                                    v208 = v201;
                                end;
                                l_v195_0 = v207;
                                l_v201_0 = v208;
                            elseif v30 == "X" then
                                local v209, v210;
                                if v179 == 1 then
                                    v209 = (v183 + 1) - v198;
                                    v210 = v201;
                                elseif v179 == 2 then
                                    v209 = (v185 + 1) - v201;
                                    v210 = (v183 + 1) - v198;
                                elseif v179 == 3 then
                                    v209 = v198;
                                    v210 = (v185 + 1) - v201;
                                else
                                    v209 = v201;
                                    v210 = v198;
                                end;
                                l_v201_0 = v209;
                                l_v198_0 = v210;
                            elseif v30 == "Z" then
                                local v211, v212;
                                if v179 == 1 then
                                    v211 = (v184 + 1) - v195;
                                    v212 = v198;
                                elseif v179 == 2 then
                                    v211 = (v183 + 1) - v198;
                                    v212 = (v184 + 1) - v195;
                                elseif v179 == 3 then
                                    v211 = v195;
                                    v212 = (v183 + 1) - v198;
                                else
                                    v211 = v198;
                                    v212 = v195;
                                end;
                                l_v198_0 = v211;
                                l_v195_0 = v212;
                            end;
                            v199[v201] = v26[l_v195_0][l_v198_0][l_v201_0];
                            v200[v201] = v27[l_v195_0][l_v198_0][l_v201_0];
                        else
                            v199[v201] = v202;
                            v200[v201] = v203;
                        end;
                    end;
                    v196[v198] = v199;
                    v197[v198] = v200;
                end;
                l_v29_4[v195] = v196;
                l_v29_5[v195] = v197;
            end;
            v12:WriteVoxels(v188, 4, l_v29_4, l_v29_5);
        end;
        renderSelection(v187, v186, v180);
    end;
    v36 = function(v213, v214, v215, v216, v217, v218)
        local v219 = v213 or v17;
        local v220 = v214 or v18;
        local l_Part_0 = Instance.new("Part");
        l_Part_0.Name = "EffectPart";
        l_Part_0.Transparency = 1;
        l_Part_0.TopSurface = "Smooth";
        l_Part_0.BottomSurface = "Smooth";
        l_Part_0.Anchored = true;
        l_Part_0.CanCollide = false;
        if not (v35 and v35.Parent) then
            v35 = Instance.new("ScreenGui");
            v35.Name = "TerrainRegionEditor";
            v35.Parent = l_CoreGui_0;
        end;
        l_Part_0.Parent = v35;
        local l_SelectionBox_0 = Instance.new("SelectionBox");
        l_SelectionBox_0.Name = "SelectionObject";
        l_SelectionBox_0.Transparency = 1;
        l_SelectionBox_0.SurfaceTransparency = 0.75;
        l_SelectionBox_0.SurfaceColor = BrickColor.new(v215);
        l_SelectionBox_0.Adornee = l_Part_0;
        l_SelectionBox_0.Parent = l_Part_0;
        l_SelectionBox_0.StudioSelectionBox = true;
        local v223 = ((v220 - v219) + Vector3.new(1, 1, 1)) * 4 + Vector3.new(0.21, 0.21, 0.21);
        l_Part_0.CFrame = CFrame.new((((v219 + v220) - Vector3.new(1, 1, 1)) * 0.5) * 4);
        l_Part_0.Size = v223 * v216;
        local v224 = tick() + v218;
        while tick() < v224 do
            local v225 = 1 - (v224 - tick()) / v218;
            l_SelectionBox_0.SurfaceTransparency = 0.75 + v225 * 0.25;
            l_Part_0.Size = v223 * (v216 + (v217 - v216) * v225);
            wait();
        end;
        l_Part_0:Destroy();
    end;
    v8.Button1Down:connect(function()
        if v7 and v39 == l_ToolId_0.Select then
            v45 = true;
            v29 = nil;
            local v226 = v8.Hit.p + v8.UnitRay.Direction * 0.05;
            if v8.Target == nil then
                v226 = game.Workspace.CurrentCamera.CoordinateFrame.p + v8.UnitRay.Direction * 100;
            end;
            local l_v226_0 = v226;
            v23 = Vector3.new(l_ceil_0(l_v226_0.x / 4), l_ceil_0(l_v226_0.y / 4), (l_ceil_0(l_v226_0.z / 4)));
            local v228 = {};
            v22 = v228;
            while not ((not (v228 == v22) or not v45) or not v7) and v39 == "Select" do
                l_v226_0 = v8.Hit.p + v8.UnitRay.Direction * 0.05;
                if v8.Target == nil then
                    l_v226_0 = game.Workspace.CurrentCamera.CoordinateFrame.p + v8.UnitRay.Direction * 100;
                end;
                local l_l_v226_0_0 = l_v226_0;
                local v230 = Vector3.new(l_ceil_0(l_l_v226_0_0.x / 4), l_ceil_0(l_l_v226_0_0.y / 4), (l_ceil_0(l_l_v226_0_0.z / 4)));
                v230 = Vector3.new(math.max(math.min(v230.x, v23.x + 125), v23.x - 125), math.max(math.min(v230.y, v23.y + 125), v23.y - 125), (math.max(math.min(v230.z, v23.z + 125), v23.z - 125)));
                v17 = Vector3.new(math.min(v23.x, v230.x), math.min(v23.y, v230.y), (math.min(v23.z, v230.z)));
                v18 = Vector3.new(math.max(v23.x, v230.x), math.max(v23.y, v230.y), (math.max(v23.z, v230.z)));
                v46();
                renderSelection();
                game:GetService("RunService").RenderStepped:wait();
            end;
        end;
    end);
    v8.Button1Up:connect(function()
        v45 = false;
        if v24 and v24.magnitude > 0 then
            if v40 == l_ToolId_0.Resize then
                if not v25 then
                    v18 = Vector3.new(math.max(math.min(v18.x + v24.x, v17.x + 125), v17.x), math.max(math.min(v18.y + v24.y, v17.y + 125), v17.y), (math.max(math.min(v18.z + v24.z, v17.z + 125), v17.z)));
                else
                    v17 = Vector3.new(math.min(math.max(v17.x + v24.x, v18.x - 125), v18.x), math.min(math.max(v17.y + v24.y, v18.y - 125), v18.y), (math.min(math.max(v17.z + v24.z, v18.z - 125), v18.z)));
                end;
            elseif v40 == l_ToolId_0.Move then
                v17 = v17 + v24;
                v18 = v18 + v24;
            end;
            v46();
            l_ChangeHistoryService_0:SetWaypoint("Terrain " .. v9);
        end;
        if v44 and v44 ~= 0 then
            local v231 = CFrame.Angles(v30 ~= "X" and 0 or v44 * 1.5707963267948966, v30 ~= "Y" and 0 or v44 * 1.5707963267948966, v30 ~= "Z" and 0 or v44 * 1.5707963267948966);
            local v232 = (Vector3.new(1, 1, 1) + v18) - v17;
            local v233 = Vector3.new(l_ceil_0(v232.x * 0.5), l_ceil_0(v232.y * 0.5), (l_ceil_0(v232.z * 0.5)));
            v232 = v231 * v232;
            local v234 = math.abs(v232.x);
            local v235 = (v234 + 0.5) - (v234 + 0.5) % 1;
            local v236 = math.abs(v232.y);
            v234 = (v236 + 0.5) - (v236 + 0.5) % 1;
            local v237 = math.abs(v232.z);
            v236 = (v237 + 0.5) - (v237 + 0.5) % 1;
            v233 = v233 - Vector3.new(l_ceil_0(v235 * 0.5), l_ceil_0(v234 * 0.5), (l_ceil_0(v236 * 0.5)));
            v18 = ((v17 + v233) + Vector3.new(v235, v234, v236)) - Vector3.new(1, 1, 1);
            v17 = v17 + v233;
            v46();
            lockInMap();
            l_ChangeHistoryService_0:SetWaypoint("Terrain " .. v9);
        end;
        v24 = nil;
        v44 = nil;
        renderSelection();
    end);
    local function v238()
        v17 = nil;
        v18 = nil;
        v46();
        v26 = nil;
        v27 = nil;
        v43(l_ToolId_0.Select);
    end;
    l_ChangeHistoryService_0.OnUndo:connect(v238);
    l_ChangeHistoryService_0.OnRedo:connect(v238);
end;
createSelectionPart = function()
    if not v19 then
        v19 = Instance.new("Part");
        v19.Name = "SelectionPart";
        v19.Transparency = 1;
        v19.TopSurface = "Smooth";
        v19.BottomSurface = "Smooth";
        v19.Anchored = true;
        v19.CanCollide = false;
        local l_v19_0 = v19;
        if not (v35 and v35.Parent) then
            v35 = Instance.new("ScreenGui");
            v35.Name = "TerrainRegionEditor";
            v35.Parent = l_CoreGui_0;
        end;
        l_v19_0.Parent = v35;
    end;
    if not v20 then
        v20 = Instance.new("SelectionBox");
        v20.Name = "SelectionObject";
        v20.Color = BrickColor.new(v9 == "Select" and "Toothpaste" or "Institutional white");
        v20.SurfaceTransparency = 0.85;
        v20.SurfaceColor = BrickColor.new(v9 == "Select" and "Toothpaste" or "Institutional white");
        v20.Adornee = v19;
        v20.Visible = false;
        v20.Parent = v19;
    end;
    if not v21 then
        v21 = Instance.new("Handles");
        v21.Name = "SelectionHandles";
        v21.Color = BrickColor.new(v9 == "Select" and "Toothpaste" or "Light stone grey");
        v21.Adornee = v19;
        v21.Visible = false;
        v21.Parent = v20;
        v21.MouseDrag:connect(function(v240, v241)
            local v242 = v16[v240];
            local v243 = v242 * l_floor_0((v241 + 0.5) / 4);
            local v244 = true;
            if v242.x >= 0 then
                v244 = true;
                if v242.y >= 0 then
                    v244 = v242.z < 0;
                end;
            end;
            v25 = v244;
            if v243 ~= v24 then
                v24 = v243;
                v42();
            end;
        end);
    end;
    if not v13 then
        v13 = Instance.new("ArcHandles");
        v13.Name = "SelectionArcHandles";
        v13.Color = BrickColor.new(v9 == "Select" and "Toothpaste" or "Light stone grey");
        v13.Adornee = v19;
        v13.Visible = false;
        v13.Parent = v21;
        v13.MouseDrag:connect(function(v245, v246, _)
            v30 = v245.Name;
            local v248 = v246 / 1.5707963267948966;
            local v249 = ((v248 + 0.5) - (v248 + 0.5) % 1) % 4;
            if v249 ~= v44 then
                v44 = v249;
                v41();
            end;
        end);
    end;
end;
clearSelection = function()
    if v13 then
        v13:Destroy();
        v13 = nil;
    end;
    if v21 then
        v21:Destroy();
        v21 = nil;
    end;
    if v20 then
        v20:Destroy();
        v20 = nil;
    end;
    if v19 then
        v19:Destroy();
        v19 = nil;
    end;
    if v35 then
        v35:Destroy();
        v35 = nil;
    end;
end;
v38 = {
    [l_ToolId_0.Select] = function()
        v43(l_ToolId_0.Select);
    end,
    [l_ToolId_0.Move] = function()
        v43(l_ToolId_0.Move);
    end,
    [l_ToolId_0.Resize] = function()
        v43(l_ToolId_0.Resize);
    end,
    [l_ToolId_0.Rotate] = function()
        v43(l_ToolId_0.Rotate);
    end,
    [l_ToolId_0.Delete] = function()
        if not (not v17 or not v18) then
            local v250 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
            local v251 = v250.Size / 4;
            local v252 = v57(v251, l_Air_0);
            local v253 = v57(v251, 0);
            if not v29 then
                if not (not v17 or not v18) then
                    v12:WriteVoxels(v250, 4, v252, v253);
                end;
            else
                v12:WriteVoxels(v29.region, 4, v29.materials, v29.occupancies);
            end;
            v29 = {};
            v29.region = v250;
            local l_v29_6 = v29;
            local l_v29_7 = v29;
            local v256, v257 = v12:ReadVoxels(v250, 4);
            l_v29_6.materials = v256;
            l_v29_7.occupancies = v257;
            l_v29_6 = v17;
            l_v29_7 = v18;
            v43(l_ToolId_0.Select);
            l_ChangeHistoryService_0:SetWaypoint("Terrain Delete");
            v36(l_v29_6, l_v29_7, "Really red", 1, 1.2, 0.5);
        end;
    end,
    [l_ToolId_0.Paste] = function()
        if v37 then
            v18 = (v17 + v37.SizeInCells) - Vector3.new(1, 1, 1);
            local v258 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
            v29 = {};
            v29.region = v258;
            local l_v29_8 = v29;
            local l_v29_9 = v29;
            local v261, v262 = v12:ReadVoxels(v258, 4);
            l_v29_8.materials = v261;
            l_v29_9.occupancies = v262;
            v12.LastUsedModificationMethod = Enum.TerrainAcquisitionMethod.RegionPasteTool;
            v12:PasteRegion(v37, Vector3int16.new(v17.x - 1, v17.y - 1, v17.z - 1), true);
            v43(l_ToolId_0.Move);
            l_ChangeHistoryService_0:SetWaypoint("Terrain Paste");
            v36(nil, nil, "Lime green", 1.2, 1, 0.5);
        end;
    end,
    [l_ToolId_0.Copy] = function()
        if not (not v17 or not v18) then
            v37 = v12:CopyRegion((Region3int16.new(Vector3int16.new(v17.x - 1, v17.y - 1, v17.z - 1), (Vector3int16.new(v18.x - 1, v18.y - 1, v18.z - 1)))));
            v36(nil, nil, "New Yeller", 1, 1.2, 0.5);
        end;
    end,
    [l_ToolId_0.Fill] = function()
        v43(l_ToolId_0.Fill);
    end
};
v2.Init = function(v263, v264)
    v12 = v6();
    v8 = v264;
    v9 = v263;
    if v263 == l_ToolId_0.Select then
        v39 = "Select";
        v40 = l_ToolId_0.Resize;
    elseif not (v263 ~= l_ToolId_0.Move and v263 ~= l_ToolId_0.Resize) or v263 == l_ToolId_0.Rotate then
        v39 = "Edit";
        v40 = v263;
    end;
    FirstTimeSetup();
    v7 = true;
    if not (v35 and v35.Parent) then
        v35 = Instance.new("ScreenGui");
        v35.Name = "TerrainRegionEditor";
        v35.Parent = l_CoreGui_0;
    end;
    createSelectionPart();
    renderSelection();
    if v12 or v9 == l_ToolId_0.Select then
        v38[v9]();
    end;
    v46();
end;
v2.ChangeProperties = function(v265)
    v10 = v265.material;
    v11 = v265.mergeEmpty;
    if ((not (v40 ~= l_ToolId_0.Move) or v40 == l_ToolId_0.Resize) and v39 == "Edit") and v17 ~= nil then
        v42();
    end;
end;
v2.OnButtonClick = function()
    if not ((not (v9 == l_ToolId_0.Fill) or not v17) or not v18) then
        local v266 = Region3.new((v17 - Vector3.new(1, 1, 1)) * 4, v18 * 4);
        local v267 = v266.Size / 4;
        local v268 = v57(v267, l_Air_0);
        local v269 = v57(v267, 0);
        local v270, v271 = v12:ReadVoxels(v266, 4);
        local v272 = {};
        local v273 = {};
        for v274 = 1, v267.x do
            local v275 = {};
            local v276 = {};
            for v277 = 1, v267.y do
                local v278 = {};
                local v279 = {};
                for v280 = 1, v267.z do
                    local v281 = v270[v274][v277][v280];
                    if (v281 ~= l_Air_0 and v271[v274][v277][v280] ~= 0) and v11 then
                        v278[v280] = v281;
                    else
                        v278[v280] = v10;
                    end;
                    v279[v280] = 1;
                end;
                v275[v277] = v278;
                v276[v277] = v279;
            end;
            v272[v274] = v275;
            v273[v274] = v276;
        end;
        v12.LastUsedModificationMethod = Enum.TerrainAcquisitionMethod.RegionFillTool;
        v12:WriteVoxels(v266, 4, v272, v273);
        v29 = {};
        v29.region = v266;
        local l_v29_10 = v29;
        local l_v29_11 = v29;
        l_v29_10.materials = v268;
        l_v29_11.occupancies = v269;
        lockInMap();
        l_ChangeHistoryService_0:SetWaypoint("Terrain Fill");
        v36(nil, nil, "Lime green", 1.2, 1, 0.5);
    end;
end;
v2.Close = function()
    clearSelection();
    v29 = nil;
    v7 = false;
    v9 = nil;
    v8 = nil;
    v40 = nil;
    v39 = "Select";
    v46();
end;
return v2;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Container_0 = v1.UI.Container;
local l_UI_0 = v1.UI;
local l_LinkText_0 = l_UI_0.LinkText;
local l_Image_0 = l_UI_0.Image;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v11 = v2.PureComponent:extend(script.Name);
local l_TextService_0 = game:GetService("TextService");
v11.init = function(v13)
    v13.state = {
        showingDialog = false
    };
    v13.close = function()
        v13:setState({
            showingDialog = false
        });
        v13.props.OnClose();
    end;
end;
v11.didMount = function(v14)
    spawn(function()
        v14:setState({
            showingDialog = true
        });
    end);
end;
v11.render = function(v15)
    local l_Localization_0 = v15.props.Localization;
    local l_Title_0 = v15.props.Title;
    local l_MainText_0 = v15.props.MainText;
    local l_SubText_0 = v15.props.SubText;
    local l_LinkInfo_0 = v15.props.LinkInfo;
    local v21 = not not l_LinkInfo_0 and l_LinkInfo_0.Text or "";
    local l_Image_1 = v15.props.Image;
    local l_SourceSansBold_0 = Enum.Font.SourceSansBold;
    local l_SourceSans_0 = Enum.Font.SourceSans;
    local l_l_TextService_0_TextSize_0 = l_TextService_0:GetTextSize(l_MainText_0, 20, l_SourceSansBold_0, Vector2.new(400, math.huge));
    local l_l_TextService_0_TextSize_1 = l_TextService_0:GetTextSize(l_SubText_0, 20, l_SourceSans_0, Vector2.new(400, math.huge));
    local v27 = not not l_LinkInfo_0 and l_TextService_0:GetTextSize(v21, 20, l_SourceSans_0, Vector2.new(400, math.huge)) or Vector2.new(0, 0);
    return v15.state.showingDialog and v2.createElement(l_StyledDialog_0, {
        Enabled = true,
        Modal = false,
        Title = l_Title_0,
        OnClose = v15.close,
        OnButtonPressed = v15.close,
        Buttons = {
            {
                Key = "OK",
                Text = l_Localization_0:getText("Action", "OK"),
                Style = "RoundPrimary"
            }
        },
        MinContentSize = Vector2.new(64 + math.max(l_l_TextService_0_TextSize_0.X, (math.max(l_l_TextService_0_TextSize_1.X, v27.X))), ((l_l_TextService_0_TextSize_0.Y + 8) + l_l_TextService_0_TextSize_1.Y) + (not not l_LinkInfo_0 and 8 + v27.Y or 0))
    }, {
        Icon = v2.createElement(l_Container_0, {
            Size = UDim2.new(0, 44, 0, 44)
        }, {
            Decoration = v2.createElement(l_Image_0, {
                Style = {
                    Image = l_Image_1
                }
            })
        }),
        TextSection = v2.createElement(l_Container_0, {
            Position = UDim2.new(0, 64, 0, 0),
            Size = UDim2.new(1, -64, 1, 0)
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                SortOrder = Enum.SortOrder.LayoutOrder,
                Padding = UDim.new(0, 8)
            }),
            MainText = v2.createElement(l_TextLabel_0, {
                LayoutOrder = 1,
                Size = UDim2.new(1, 0, 0, l_l_TextService_0_TextSize_0.Y),
                Text = l_MainText_0,
                Font = l_SourceSansBold_0,
                TextSize = 20,
                TextXAlignment = Enum.TextXAlignment.Left
            }),
            SubText = v2.createElement(l_TextLabel_0, {
                LayoutOrder = 2,
                Size = UDim2.new(1, 0, 0, l_l_TextService_0_TextSize_1.Y),
                Text = l_SubText_0,
                TextWrapped = true,
                Font = l_SourceSans_0,
                TextSize = 20,
                TextXAlignment = Enum.TextXAlignment.Left
            }),
            Link = l_LinkInfo_0 and v2.createElement(l_LinkText_0, {
                LayoutOrder = 3,
                Size = UDim2.new(1, 0, 0, v27.Y),
                Text = v21,
                TextWrapped = true,
                TextSize = 20,
                TextXAlignment = Enum.TextXAlignment.Left,
                OnClick = l_LinkInfo_0.OnClick
            })
        })
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v11));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Cryo);
local l_withContext_0 = v1.ContextServices.withContext;
local v5 = require(l_Parent_0.Src.ContextItems);
local v6 = require(l_Parent_0.Src.Components.Spinner);
local v7 = v2.PureComponent:extend("LoadingImage");
v7.init = function(v8)
    v8.state = {
        currentImageLoaded = false
    };
    v8.mostRecentRequestedImage = nil;
    v8.requestLoadImage = function(v9)
        if v9 == v8.mostRecentRequestedImage then
            return ;
        else
            v8:setState({
                currentImageLoaded = false
            });
            v8.mostRecentRequestedImage = v9;
            if v9 ~= nil and v9 ~= "" then
                v8.props.ImageLoader:loadImage(v9);
            end;
            return ;
        end;
    end;
    v8.onImageLoaded = function(v10)
        if v8.isMounted then
            if v10 == v8.mostRecentRequestedImage then
                v8:setState({
                    currentImageLoaded = true
                });
            end;
            return ;
        else
            return ;
        end;
    end;
end;
v7.didMount = function(v11)
    v11.isMounted = true;
    v11.onImageLoaderConnection = v11.props.ImageLoader.ImageLoaded:Connect(v11.onImageLoaded);
    v11.requestLoadImage(v11.props.Image);
end;
v7.willUnmount = function(v12)
    if v12.onImageLoaderConnection then
        v12.onImageLoaderConnection:Disconnect();
        v12.onImageLoaderConnection = nil;
    end;
    v12.isMounted = false;
end;
v7.didUpdate = function(v13, v14, _)
    if v14.Image ~= v13.props.Image then
        v13.requestLoadImage(v13.props.Image);
    end;
end;
v7.render = function(v16)
    local l_props_0 = v16.props;
    local l_currentImageLoaded_0 = v16.state.currentImageLoaded;
    return v2.createElement("Frame", {
        LayoutOrder = l_props_0.LayoutOrder,
        AnchorPoint = l_props_0.AnchorPoint,
        Position = l_props_0.Position,
        Size = l_props_0.Size,
        ZIndex = l_props_0.ZIndex,
        BackgroundTransparency = 1
    }, {
        Image = l_currentImageLoaded_0 and v2.createElement("ImageLabel", not not l_currentImageLoaded_0 and v3.Dictionary.join(l_props_0, {
            Size = UDim2.new(1, 0, 1, 0),
            LayoutOrder = v3.None,
            AnchorPoint = v3.None,
            Position = v3.None,
            ZIndex = v3.None,
            ImageLoader = v3.None
        }) or {}),
        LoadingSpinner = not l_currentImageLoaded_0 and v2.createElement(v6, {
            AnchorPoint = Vector2.new(0.5, 0.5),
            Position = UDim2.new(0.5, 0, 0.5, 0)
        })
    });
end;
return (l_withContext_0({
    ImageLoader = v5.ImageLoader
})(v7));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Components.ProgressWidget);
local l_CoreGui_0 = game:GetService("CoreGui");
return function(v5)
    return v1.createElement(v1.Portal, {
        target = l_CoreGui_0
    }, {
        ProgressDialog = v1.createElement("ScreenGui", {
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling
        }, {
            ProgressWidget = v1.createElement(v3, (v2.Dictionary.join({
                AnchorPoint = Vector2.new(0.5, 0),
                Position = UDim2.new(0.5, 0, 0, 0)
            }, v5)))
        })
    });
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v1.UI;
local l_Container_0 = l_UI_0.Container;
local l_Button_0 = l_UI_0.Button;
local l_HoverArea_0 = l_UI_0.HoverArea;
local l_LoadingBar_0 = l_UI_0.LoadingBar;
local l_Box_0 = l_UI_0.Box;
local l_TextLabel_0 = l_UI_0.TextLabel;
local function v13(v12)
    return v2.createElement(l_Button_0, {
        LayoutOrder = v12.LayoutOrder,
        Size = UDim2.new(0, 96, 0, 28),
        Text = v12.Text,
        Style = v12.Style,
        OnClick = v12.OnClick
    }, {
        HoverArea = v2.createElement(l_HoverArea_0, {
            Cursor = "PointingHand"
        })
    });
end;
local v14 = v2.PureComponent:extend("ProgressWidget");
v14.render = function(v15)
    local l_props_0 = v15.props;
    local l_Localization_0 = l_props_0.Localization;
    local l_AnchorPoint_0 = l_props_0.AnchorPoint;
    local l_Position_0 = l_props_0.Position;
    local v20 = l_props_0.Title or "";
    local l_SubText_0 = l_props_0.SubText;
    local v22 = l_SubText_0 and #l_SubText_0 > 0;
    local v23 = l_props_0.Progress or 0;
    local l_IsPaused_0 = l_props_0.IsPaused;
    local l_OnPauseButtonClicked_0 = l_props_0.OnPauseButtonClicked;
    local l_OnCancelButtonClicked_0 = l_props_0.OnCancelButtonClicked;
    local v27 = l_OnPauseButtonClicked_0 ~= nil;
    local v28 = l_OnCancelButtonClicked_0 ~= nil;
    local v29 = v27 or v28;
    return v2.createElement(l_Container_0, {
        AnchorPoint = l_AnchorPoint_0,
        Position = l_Position_0,
        Size = UDim2.new(0, 406, 0, (77 + (not v22 and 0 or 27)) + (not v29 and 0 or 48)),
        Background = l_Box_0
    }, {
        UIPadding = v2.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 20),
            PaddingLeft = UDim.new(0, 20),
            PaddingRight = UDim.new(0, 20),
            PaddingBottom = UDim.new(0, 20)
        }),
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 8)
        }),
        Title = v2.createElement(l_TextLabel_0, {
            LayoutOrder = 1,
            Size = UDim2.new(1, 0, 0, 19),
            Text = v20,
            Font = Enum.Font.SourceSansBold,
            TextSize = 20,
            TextXAlignment = Enum.TextXAlignment.Left
        }),
        LoadingBarContainer = v2.createElement(l_Container_0, {
            LayoutOrder = 2,
            Size = UDim2.new(1, 0, 0, 10)
        }, {
            LoadingBar = v2.createElement(l_LoadingBar_0, {
                AnchorPoint = Vector2.new(0, 1),
                Position = UDim2.new(0, 0, 1, 0),
                Size = UDim2.new(1, 0, 0, 6),
                Progress = v23
            })
        }),
        SubText = v22 and v2.createElement(l_TextLabel_0, {
            LayoutOrder = 3,
            Size = UDim2.new(1, 0, 0, 19),
            Text = l_SubText_0,
            TextSize = 20,
            TextXAlignment = Enum.TextXAlignment.Left
        }),
        ButtonRow = v29 and v2.createElement(l_Container_0, {
            LayoutOrder = 4,
            Size = UDim2.new(1, 0, 0, 40)
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                Padding = UDim.new(0, 8),
                SortOrder = Enum.SortOrder.LayoutOrder,
                FillDirection = Enum.FillDirection.Horizontal,
                HorizontalAlignment = Enum.HorizontalAlignment.Right,
                VerticalAlignment = Enum.VerticalAlignment.Bottom
            }),
            PauseButton = v27 and v2.createElement(v13, {
                LayoutOrder = 1,
                Text = l_Localization_0:getText("Action", not l_IsPaused_0 and "Pause" or "Resume"),
                Style = "RoundPrimary",
                OnClick = l_OnPauseButtonClicked_0
            }),
            CancelButton = v28 and v2.createElement(v13, {
                LayoutOrder = 2,
                Text = l_Localization_0:getText("Action", "Cancel"),
                Style = "RoundPrimary",
                OnClick = l_OnCancelButtonClicked_0
            })
        })
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v14));


local v0 = require(script.Parent.Parent.Parent.Parent.Packages.Roact);
return function(v1)
    local l_Adornee_0 = v1.Adornee;
    local l_AlwaysOnTop_0 = v1.AlwaysOnTop;
    return v0.createElement("BoxHandleAdornment", {
        Adornee = l_Adornee_0,
        Color3 = v1.Color,
        Transparency = if not l_AlwaysOnTop_0 then nil else v1.Transparency,
        AlwaysOnTop = l_AlwaysOnTop_0,
        Size = v1.Size,
        CFrame = v1.CFrame,
        ZIndex = 0
    });
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Src.Components.RegionVisual.Border);
local v3 = require(l_Parent_0.Src.Util.getBoxBorderDimensions);
local v4 = v1.PureComponent:extend("Box");
v4.init = function(v5)
    v5.wireframeRef = v1.createRef();
end;
v4.didUpdate = function(v6, v7)
    v6:setLines(v7.Lines ~= v6.props.Lines);
end;
v4.didMount = function(v8)
    v8:setLines(v8.props.Lines);
end;
v4.setLines = function(v9, v10)
    local l_props_0 = v9.props;
    if not (not l_props_0.Wireframe or not v10) then
        local l_current_0 = v9.wireframeRef.current;
        if l_current_0 then
            l_current_0:clear();
            if l_props_0.Lines then
                l_current_0:addLines(l_props_0.Lines);
            end;
        end;
    end;
end;
v4.render = function(v13)
    local l_props_1 = v13.props;
    local l_Adornee_0 = l_props_1.Adornee;
    local l_AlwaysOnTop_0 = l_props_1.AlwaysOnTop;
    local l_CFrame_0 = l_props_1.CFrame;
    local l_Color_0 = l_props_1.Color;
    local l_LineThickness_0 = l_props_1.LineThickness;
    local l_Lines_0 = l_props_1.Lines;
    local l_Scale_0 = l_props_1.Scale;
    local l_Size_0 = l_props_1.Size;
    local l_Transparency_0 = l_props_1.Transparency;
    local v24 = v3(l_CFrame_0, l_Size_0, l_LineThickness_0);
    local v25 = {};
    for v26, v27 in v24, nil, nil do
        v25[v26] = v1.createElement(v2, {
            Adornee = l_Adornee_0,
            AlwaysOnTop = l_AlwaysOnTop_0,
            CFrame = v27.CFrame,
            Color = l_Color_0,
            Size = v27.Size,
            Transparency = l_Transparency_0
        });
    end;
    return v1.createElement("Folder", {}, {
        Borders = v1.createElement("Folder", {}, v25),
        Main = v1.createElement("BoxHandleAdornment", {
            AlwaysOnTop = l_AlwaysOnTop_0,
            Adornee = l_Adornee_0,
            Color3 = l_Color_0,
            Transparency = l_Transparency_0,
            Size = l_Size_0,
            CFrame = l_CFrame_0,
            ZIndex = 0
        }),
        Lines = if not l_Lines_0 then nil else v1.createElement("WireframeHandleAdornment", {
            AlwaysOnTop = l_AlwaysOnTop_0,
            Adornee = l_Adornee_0,
            Color3 = l_Color_0,
            Transparency = not l_AlwaysOnTop_0 and 0.5 or 0.92,
            CFrame = l_CFrame_0,
            Scale = l_Scale_0,
            ZIndex = 0,
            [v1.Ref] = v13.wireframeRef
        })
    });
end;
return v4;


local v0 = require(script.Parent.Parent.Parent.Packages.Roact);
local v1 = require(script.Box);
return function(v2)
    local l_Adornee_0 = v2.Adornee;
    local l_Color_0 = v2.Color;
    local l_LineThickness_0 = v2.LineThickness;
    local l_Lines_0 = v2.Lines;
    local l_Transform_0 = v2.Transform;
    local l_Scale_0 = v2.Scale;
    local l_Size_0 = v2.Size;
    local l_Transparency_0 = v2.Transparency;
    local l_Wireframe_0 = v2.Wireframe;
    return v0.createElement(v0.Portal, {
        target = game:GetService("CoreGui")
    }, {
        RegionVisual = v0.createElement("Folder", {}, {
            OnTopBox = v0.createElement(v1, {
                Adornee = l_Adornee_0,
                AlwaysOnTop = true,
                CFrame = l_Transform_0,
                Color = l_Color_0,
                LineThickness = l_LineThickness_0,
                Lines = l_Lines_0,
                Scale = l_Scale_0,
                Size = l_Size_0,
                Transparency = l_Transparency_0,
                Wireframe = l_Wireframe_0
            }),
            InTopBox = v0.createElement(v1, {
                Adornee = l_Adornee_0,
                AlwaysOnTop = false,
                CFrame = l_Transform_0,
                Color = l_Color_0,
                LineThickness = l_LineThickness_0,
                Lines = l_Lines_0,
                Scale = l_Scale_0,
                Size = l_Size_0,
                Transparency = l_Transparency_0,
                Wireframe = l_Wireframe_0
            })
        })
    });
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.RoactRodux);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v5 = require(l_Parent_0.Src.Components.ProgressDialog);
local v6 = require(l_Parent_0.Src.Components.SuggestionDialog);
local v7 = require(l_Parent_0.Src.Util.ShorelineController);
local l_ShorelinesRemoveDialog_0 = game:GetFastFlag("ShorelinesRemoveDialog");
local v9 = v2.PureComponent:extend("ShorelineDialog");
v9.render = function(v10)
    local l_props_0 = v10.props;
    local l_Localization_0 = l_props_0.Localization;
    local l_ShorelineController_0 = l_props_0.ShorelineController;
    local l_ShorelinesUpgradePercent_0 = l_props_0.ShorelinesUpgradePercent;
    local l_ShorelinesUpgradeSuggestion_0 = l_props_0.ShorelinesUpgradeSuggestion;
    local v16 = false;
    if l_ShorelinesUpgradePercent_0 >= 0 then
        v16 = l_ShorelinesUpgradePercent_0 < 1;
    end;
    return v2.createFragment({
        ShoresUpdater = if not l_ShorelinesRemoveDialog_0 and l_ShorelinesUpgradeSuggestion_0 then v2.createElement(v6, {
            Title = l_Localization_0:getText("UpgradeShorelines", "SuggestionTitle"),
            SubText = l_Localization_0:getText("UpgradeShorelines", "SuggestionDescription"),
            ActionText = l_Localization_0:getText("UpgradeShorelines", "ActionButton"),
            OnActionButtonClicked = function()
                l_ShorelineController_0:start("Suggestion");
            end,
            OnDismissButtonClicked = function(v17)
                l_ShorelineController_0:dismiss(v17);
            end
        }) else nil,
        ProgressDialog = if not v16 then nil else v2.createElement(v5, {
            Title = l_Localization_0:getText("UpgradeShorelines", "Title"),
            SubText = l_Localization_0:getText("Replace", "Replacing"),
            Progress = l_ShorelinesUpgradePercent_0,
            OnCancelButtonClicked = function()
                l_ShorelineController_0:cancel();
            end
        })
    });
end;
return v1.connect(function(v18)
    return {
        ShorelinesUpgradePercent = v18.Tools.ShorelinesUpgradePercent,
        ShorelinesUpgradeSuggestion = v18.Tools.ShorelinesUpgradeSuggestion
    };
end, function()
end)((l_withContext_0({
    Analytics = l_ContextServices_0.Analytics,
    Localization = l_ContextServices_0.Localization,
    ShorelineController = v7
})(v9)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.RoactRodux);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v5 = require(l_Parent_0.Src.Components.ProgressDialog);
local v6 = require(l_Parent_0.Src.Components.SuggestionDialog);
local v7 = require(l_Parent_0.Src.Util.SmoothVoxelsController);
local v8 = v2.PureComponent:extend("SmoothVoxelsDialog");
v8.render = function(v9)
    local l_props_0 = v9.props;
    local l_Localization_0 = l_props_0.Localization;
    local l_SmoothVoxelsController_0 = l_props_0.SmoothVoxelsController;
    local l_SmoothVoxelsUpgradePercent_0 = l_props_0.SmoothVoxelsUpgradePercent;
    local l_SmoothVoxelsUpgradeSuggestion_0 = l_props_0.SmoothVoxelsUpgradeSuggestion;
    local v15 = false;
    if l_SmoothVoxelsUpgradePercent_0 >= 0 then
        v15 = l_SmoothVoxelsUpgradePercent_0 < 1;
    end;
    return v2.createFragment({
        SmoothVoxelsUpdater = if not l_SmoothVoxelsUpgradeSuggestion_0 then nil else v2.createElement(v6, {
            Title = l_Localization_0:getText("UpgradeSmoothVoxels", "SuggestionTitle"),
            SubText = l_Localization_0:getText("UpgradeSmoothVoxels", "SuggestionDescription"),
            ActionText = l_Localization_0:getText("UpgradeSmoothVoxels", "ActionButton"),
            OnActionButtonClicked = function()
                l_SmoothVoxelsController_0:start("Suggestion");
            end,
            OnDismissButtonClicked = function(v16)
                l_SmoothVoxelsController_0:dismiss(v16);
            end
        }),
        ProgressDialog = if not v15 then nil else v2.createElement(v5, {
            Title = l_Localization_0:getText("UpgradeSmoothVoxels", "Title"),
            SubText = l_Localization_0:getText("Replace", "Replacing"),
            Progress = l_SmoothVoxelsUpgradePercent_0,
            OnCancelButtonClicked = function()
                l_SmoothVoxelsController_0:cancel();
            end
        })
    });
end;
return v1.connect(function(v17)
    return {
        SmoothVoxelsUpgradePercent = v17.Tools.SmoothVoxelsUpgradePercent,
        SmoothVoxelsUpgradeSuggestion = v17.Tools.SmoothVoxelsUpgradeSuggestion
    };
end, function()
end)((l_withContext_0({
    Analytics = l_ContextServices_0.Analytics,
    Localization = l_ContextServices_0.Localization,
    SmoothVoxelsController = v7
})(v8)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Container_0 = v1.UI.Container;
local l_RunService_0 = game:GetService("RunService");
local v7 = v2.PureComponent:extend("Spinner");
v7.defaultProps = {
    Size = 28
};
v7.init = function(v8)
    v8.state = {
        leadingBlock = 0
    };
    v8.getStyle = function()
        return v8.props.Stylizer.Spinner;
    end;
    v8.moveToNext = function()
        if v8.isMounted then
            v8:setState(function(v9)
                return {
                    leadingBlock = (v9.leadingBlock + 1) % #v8.getStyle().Colors
                };
            end);
            return ;
        else
            return ;
        end;
    end;
    v8.time = 0;
    v8.onHeartbeat = function(v10)
        v8.time = v8.time + v10;
        local l_TimeBetweenBlocks_0 = v8.getStyle().TimeBetweenBlocks;
        while l_TimeBetweenBlocks_0 < v8.time do
            v8.time = v8.time - l_TimeBetweenBlocks_0;
            v8.moveToNext();
        end;
    end;
end;
v7.didMount = function(v12)
    v12.isMounted = true;
    v12.heartbeatConnection = l_RunService_0.Heartbeat:Connect(v12.onHeartbeat);
end;
v7.willUnmount = function(v13)
    if v13.heartbeatConnection then
        v13.heartbeatConnection:Disconnect();
        v13.heartbeatConnection = nil;
    end;
    v13.isMounted = false;
end;
v7.render = function(v14)
    local l_props_0 = v14.props;
    local l_Size_0 = v14.props.Size;
    local v17 = v14.getStyle();
    local l_BlockWidth_0 = v17.BlockWidth;
    local l_InnerRadius_0 = v17.InnerRadius;
    assert(2 * l_InnerRadius_0 < l_Size_0, "Spinner size is too small for inner radius from theme");
    local v20 = math.floor(l_Size_0 / 2 - l_InnerRadius_0);
    local l_Colors_0 = v17.Colors;
    local v22 = #l_Colors_0;
    local v23 = 360 / v22;
    local v24 = v14.state.leadingBlock * v23;
    local v25 = {};
    for v26 = 1, v22 do
        v25["Block_" .. tostring(v26)] = v2.createElement("Frame", {
            Position = UDim2.new(0.5, 0, 0.5, 0),
            Size = UDim2.new(0, 0, 0, 0),
            Rotation = -v23 * (v26 - 1),
            BackgroundTransparency = 1
        }, {
            Block = v2.createElement("Frame", {
                AnchorPoint = Vector2.new(0.5, 1),
                Position = UDim2.new(0, 0, 0, -l_InnerRadius_0),
                Size = UDim2.fromOffset(l_BlockWidth_0, v20),
                BorderSizePixel = 0,
                BackgroundColor3 = l_Colors_0[v26]
            })
        });
    end;
    return v2.createElement(l_Container_0, {
        LayoutOrder = l_props_0.LayoutOrder,
        AnchorPoint = l_props_0.AnchorPoint,
        Position = l_props_0.Position,
        ZIndex = l_props_0.ZIndex,
        Size = UDim2.fromOffset(l_Size_0, l_Size_0)
    }, {
        Center = v2.createElement("Frame", {
            Position = UDim2.new(0.5, 0, 0.5, 0),
            Size = UDim2.new(0, 0, 0, 0),
            Rotation = v24,
            BackgroundTransparency = 1
        }, v25)
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v7));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Cryo);
local l_UI_0 = v1.UI;
local l_Container_0 = l_UI_0.Container;
local l_Tooltip_0 = v1.UI.Tooltip;
local l_Image_0 = l_UI_0.Image;
local function v10(v8)
    local l_Message_0 = v8.Message;
    return v2.createElement(l_Container_0, {
        AnchorPoint = v8.AnchorPoint,
        Position = v8.Position,
        LayoutOrder = v8.LayoutOrder,
        Size = UDim2.new(0, 18, 0, 18)
    }, {
        Decoration = v2.createElement(l_Image_0, {
            Style = {
                Image = v8.Icon
            }
        }),
        Tooltip = v2.createElement(l_Tooltip_0, {
            Text = l_Message_0 or "",
            Enabled = l_Message_0 ~= nil
        })
    });
end;
return function(v11)
    local l_ErrorMessage_0 = v11.ErrorMessage;
    local l_WarningMessage_0 = v11.WarningMessage;
    local l_InfoMessage_0 = v11.InfoMessage;
    local v15 = nil;
    local v16 = nil;
    if l_ErrorMessage_0 and #l_ErrorMessage_0 > 0 then
        v15 = "rbxasset://textures/StudioSharedUI/alert_error@2x.png";
        v16 = l_ErrorMessage_0;
    elseif l_WarningMessage_0 and #l_WarningMessage_0 > 0 then
        v15 = "rbxasset://textures/StudioSharedUI/alert_warning@2x.png";
        v16 = l_WarningMessage_0;
    elseif l_InfoMessage_0 and #l_InfoMessage_0 > 0 then
        v15 = "rbxasset://textures/StudioSharedUI/alert_info@2x.png";
        v16 = l_InfoMessage_0;
    end;
    if v15 then
        return v2.createElement(v10, (v3.Dictionary.join(v11, {
            Icon = v15,
            Message = v16,
            ErrorMessage = v3.None,
            WarningMessage = v3.None,
            InfoMessage = v3.None
        })));
    else
        return nil;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_UI_0 = v2.UI;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_Parent_0.Src.ContextItems);
local l_Button_0 = l_UI_0.Button;
local _ = l_UI_0.HoverArea;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_Pane_0 = l_UI_0.Pane;
local _ = l_UI_0.Box;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_CoreGui_0 = game:GetService("CoreGui");
local v14 = v1.PureComponent:extend("SuggestionDialog");
v14.defaultProps = {
    Enabled = true
};
v14.init = function(v15)
    v15.state = {
        DontAsk = false
    };
    v15.onCheckboxClicked = function(v16)
        v15:setState({
            [v16] = not v15.state[v16]
        });
    end;
end;
v14.render = function(v17)
    local l_props_0 = v17.props;
    local l_Localization_0 = l_props_0.Localization;
    local v20 = Vector2.new(0.5, 0);
    local v21 = UDim2.new(0.5, 0, 0, 50);
    local v22 = l_props_0.Title or "";
    local l_SubText_0 = l_props_0.SubText;
    local v24 = l_SubText_0 and #l_SubText_0 > 0;
    local v25 = l_props_0.ActionText or l_Localization_0:getText("Action", "Update");
    local l_OnDismissButtonClicked_0 = l_props_0.OnDismissButtonClicked;
    return v1.createElement(v1.Portal, {
        target = l_CoreGui_0
    }, {
        ProgressDialog = v1.createElement("ScreenGui", {
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling
        }, {
            v1.createElement(l_Pane_0, {
                AnchorPoint = v20,
                Position = v21,
                Size = UDim2.new(0, 460, 0, 10),
                AutomaticSize = Enum.AutomaticSize.Y,
                Layout = Enum.FillDirection.Vertical,
                Spacing = 8,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                Padding = 20,
                Style = "RoundBox",
                Transparency = 0.5
            }, {
                Title = v1.createElement(l_TextLabel_0, {
                    LayoutOrder = 1,
                    Size = UDim2.new(1, 0, 0, 0),
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Text = v22,
                    Font = Enum.Font.SourceSansBold,
                    TextSize = 20,
                    TextXAlignment = Enum.TextXAlignment.Left,
                    TextWrapped = true
                }),
                SubText = v24 and v1.createElement(l_TextLabel_0, {
                    LayoutOrder = 2,
                    Size = UDim2.new(1, 0, 0, 0),
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Text = l_SubText_0,
                    TextSize = 20,
                    TextXAlignment = Enum.TextXAlignment.Left,
                    TextWrapped = true
                }),
                DontAsk = v1.createElement(l_Checkbox_0, {
                    LayoutOrder = 3,
                    Size = UDim2.new(1, 0, 0, 0),
                    Text = l_Localization_0:getText("Action", "DontAskAgain"),
                    Checked = v17.state.DontAsk,
                    Key = "DontAsk",
                    OnClick = v17.onCheckboxClicked
                }),
                ButtonRow = v1.createElement(l_Pane_0, {
                    LayoutOrder = 4,
                    Size = UDim2.new(1, 0, 0, 0),
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Layout = Enum.FillDirection.Horizontal,
                    HorizontalAlignment = Enum.HorizontalAlignment.Right,
                    Spacing = 8
                }, {
                    DismissButton = v1.createElement(l_Button_0, {
                        LayoutOrder = 1,
                        Text = l_Localization_0:getText("Action", "Dismiss"),
                        Size = UDim2.fromOffset(120, 32),
                        Style = "Round",
                        OnClick = function()
                            l_OnDismissButtonClicked_0(v17.state.DontAsk);
                        end
                    }),
                    ActionButton = v1.createElement(l_Button_0, {
                        LayoutOrder = 2,
                        Text = v25,
                        Size = UDim2.fromOffset(120, 32),
                        Style = "RoundPrimary",
                        OnClick = l_props_0.OnActionButtonClicked
                    })
                })
            })
        })
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Terrain = v6.Terrain
})(v14));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v5 = require(l_Parent_0.Src.ContextItems);
local v6 = v2.PureComponent:extend(script.Name);
v6.init = function(v7)
    v7.onClick = function()
        v7.props.OnClick(v7.props.TabId);
    end;
end;
v6.render = function(v8)
    local v9 = v8.props.Theme:get();
    local v10 = v8.props.Localization:getText("Tab", v8.props.TabId);
    local l_LayoutOrder_0 = v8.props.LayoutOrder;
    local l_Size_0 = v8.props.Size;
    local l_IsCurrent_0 = v8.props.IsCurrent;
    local v14 = nil;
    local v15 = nil;
    if not l_IsCurrent_0 then
        v14 = v9.tabTheme.otherTabSize;
        v15 = v9.tabTheme.otherTabOffset;
    else
        v14 = v9.tabTheme.currentTabSize;
        v15 = v9.tabTheme.currentTabOffset;
    end;
    return v2.createElement("Frame", {
        Size = l_Size_0,
        BackgroundColor3 = v9.borderColor,
        LayoutOrder = l_LayoutOrder_0,
        BorderSizePixel = 0
    }, {
        TabButton = v2.createElement("TextButton", {
            Text = v10,
            Font = v9.font,
            TextSize = v9.textSize,
            TextColor3 = v9.textColor,
            Size = v14,
            Position = v15,
            BackgroundColor3 = v9.backgroundColor,
            BorderSizePixel = 0,
            [v2.Event.Activated] = v8.onClick
        })
    });
end;
return (l_withContext_0({
    Theme = v5.DEPRECATED_Theme,
    Localization = l_ContextServices_0.Localization
})(v6));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local l_withContext_0 = require(l_Parent_0.Packages.Framework).ContextServices.withContext;
local v3 = require(l_Parent_0.Src.ContextItems);
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.CalloutController
})(v4));


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_Parent_0 = script.Parent.Parent.Parent;
local l_Shorelines_Tooling_0 = game:GetFastFlag("Shorelines_Tooling");
local l_SmoothVoxels_Tooling_0 = game:GetFastFlag("SmoothVoxels_Tooling");
local v4 = require(l_Parent_0.Packages.Framework);
local v5 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v4.ContextServices;
local l_DockWidget_0 = v4.UI.DockWidget;
local v8 = require(l_Parent_0.Src.Components.Manager);
local v9 = require(l_Parent_0.Src.Components.ShorelineDialog);
local v10 = require(l_Parent_0.Src.Components.SmoothVoxelsDialog);
local v11 = require(l_Parent_0.Src.Components.ToolSelectionListener);
local l_RunService_0 = game:GetService("RunService");
local v13 = not not l_RunService_0 and l_RunService_0:IsEdit();
local v14 = require(l_Parent_0.Src.Util.Constants);
local v15 = Vector2.new(300, 600);
local v16 = v5.PureComponent:extend("TerrainTools");
v16.init = function(v17)
    local v18 = true;
    if not (not l_Shorelines_Tooling_0 or not v17.props.pluginLoaderContext) then
        local l_mainDockWidget_0 = v17.props.pluginLoaderContext.mainDockWidget;
        v18 = l_mainDockWidget_0 and l_mainDockWidget_0.Enabled;
    end;
    v17.state = {
        enabled = v18
    };
    v17.toggleEnabled = function()
        v17:setState(function(v20)
            local v21 = not v20.enabled;
            v17:sendWindowEnabledAnalytics(v21);
            return {
                enabled = v21
            };
        end);
    end;
    v17.onClose = function()
        v17:setEnabled(false, true);
    end;
    v17.onRestore = function(v22)
        v17:setEnabled(v22, false);
    end;
    v17.onDockWidgetCreated = function(v23)
        v17.props.pluginLoaderContext.mainButton:SetActive(v23);
        v17.props.pluginLoaderContext.mainButtonClickedSignal:Connect(v17.toggleEnabled);
    end;
    v17.onWidgetEnabledChanged = function(v24)
        v17:setEnabled(v24.Enabled, true);
    end;
    v17.onFocused = function()
        v17.props.pluginActivationController:restoreSelectedTool();
    end;
    v17.button = not not v17.props.pluginLoaderContext and v17.props.pluginLoaderContext.mainButton or nil;
end;
v16.sendWindowEnabledAnalytics = function(v25, v26)
    if v25.props.analytics then
        v25.props.analytics:report("toggleWidget");
        v25.props.analytics:report(not v26 and "closeWidget" or "openWidget");
        return ;
    else
        return ;
    end;
end;
v16.setEnabled = function(v27, v28, v29)
    v27:setState(function(v30)
        if v30.enabled == v28 then
            return nil;
        else
            if v29 then
                v27:sendWindowEnabledAnalytics(v28);
            end;
            return {
                enabled = v28
            };
        end;
    end);
end;
v16.didUpdate = function(v31, _, v33)
    if v33.enabled ~= v31.state.enabled then
        if not v31.state.enabled then
            v31.props.pluginActivationController:pauseActivatedTool();
        else
            v31.props.pluginActivationController:restoreSelectedTool();
        end;
    end;
    v31.button:SetActive(v31.state.enabled);
end;
v16.render = function(v34)
    local l_enabled_0 = v34.state.enabled;
    local l_plugin_0 = v34.props.plugin;
    local l_mouse_0 = v34.props.mouse;
    local l_store_0 = v34.props.store;
    local l_theme_0 = v34.props.theme;
    local l_devFrameworkThemeItem_0 = v34.props.devFrameworkThemeItem;
    local l_localization_0 = v34.props.localization;
    local l_analytics_0 = v34.props.analytics;
    local l_terrain_0 = v34.props.terrain;
    local l_pluginActivationController_0 = v34.props.pluginActivationController;
    local l_pluginActionsController_0 = v34.props.pluginActionsController;
    local l_terrainImporter_0 = v34.props.terrainImporter;
    local l_terrainGeneration_0 = v34.props.terrainGeneration;
    local l_seaLevel_0 = v34.props.seaLevel;
    local _ = v34.props.partConverter;
    return l_ContextServices_0.provide({
        l_plugin_0,
        l_mouse_0,
        l_store_0,
        l_theme_0,
        l_devFrameworkThemeItem_0,
        l_localization_0,
        l_analytics_0,
        l_terrain_0,
        l_pluginActivationController_0,
        l_pluginActionsController_0,
        l_terrainImporter_0,
        l_terrainGeneration_0,
        l_seaLevel_0,
        v34.props.imageLoader,
        v34.props.calloutController,
        v34.props.shorelineController,
        v34.props.smoothVoxelsController
    }, {
        TerrainTools = v5.createElement(l_DockWidget_0, {
            Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "TerrainTools",
            Title = l_localization_0:getText("Main", "Title"),
            Enabled = l_enabled_0,
            Widget = not not v34.props.pluginLoaderContext and v34.props.pluginLoaderContext.mainDockWidget or nil,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Left,
            Size = v15,
            MinSize = v14.MIN_WIDGET_SIZE,
            OnClose = v34.onClose,
            ShouldRestore = true,
            OnWidgetRestored = v34.onRestore,
            OnWidgetCreated = v34.onDockWidgetCreated,
            OnWidgetFocused = v34.onFocused,
            [v5.Change.Enabled] = v34.onWidgetEnabledChanged
        }, not not l_enabled_0 and {
            UIManager = v5.createElement(v8),
            ToolSelectionListener = v5.createElement(v11)
        } or nil),
        ShorelineDialog = if not not l_Shorelines_Tooling_0 and v13 then v5.createElement(v9) else nil,
        SmoothVoxelsDialog = if not not l_SmoothVoxels_Tooling_0 and v13 then v5.createElement(v10) else nil
    });
end;
return v16;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v5 = require(l_Parent_0.Src.ContextItems);
local _ = require(l_Parent_0.Src.Util.Constants);
local v7 = game:DefineFastFlag("FFlagTerrainEditorFixToolOverlap", false);
local l_TextService_0 = game:GetService("TextService");
local v9 = v2.PureComponent:extend(script.Name);
v9.init = function(v10)
    v10.state = {
        isHovered = false
    };
    v10.mouseEnter = function()
        v10:setState({
            isHovered = true
        });
    end;
    v10.mouseLeave = function()
        v10:setState({
            isHovered = false
        });
    end;
    v10.onClick = function()
        if v10.props.OnClick then
            v10.props.OnClick(v10.props.ToolId);
        end;
    end;
end;
v9.render = function(v11)
    local v12 = v11.props.Theme:get();
    local l_Localization_0 = v11.props.Localization;
    local l_ToolId_0 = v11.props.ToolId;
    local v15 = l_Localization_0:getText("ToolName", l_ToolId_0);
    local l_LayoutOrder_0 = v11.props.LayoutOrder;
    local _ = v11.props.IsUnitTest or false;
    local v18 = v11.props.Stylizer.ToolButton.ToolIcons[l_ToolId_0];
    local l_IsCurrentTool_0 = v11.props.IsCurrentTool;
    local l_isHovered_0 = v11.state.isHovered;
    local v21 = not l_IsCurrentTool_0 and 1 or 0.5;
    if l_isHovered_0 then
        v21 = 0.75;
    end;
    local l_textSize_0 = v12.textSize;
    if v7 and l_TextService_0:GetTextSize(v15, l_textSize_0, v12.font, Vector2.new(0, 0)).X > 75 then
        l_textSize_0 = v12.textSize - 2;
    end;
    return v2.createElement("ImageButton", {
        BorderSizePixel = 1,
        BackgroundTransparency = v21,
        LayoutOrder = l_LayoutOrder_0,
        [v2.Event.MouseEnter] = v11.mouseEnter,
        [v2.Event.MouseLeave] = v11.mouseLeave,
        [v2.Event.Activated] = v11.onClick
    }, {
        Image = v2.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Image = v18,
            ScaleType = Enum.ScaleType.Fit,
            Size = UDim2.new(0, 26, 0, 27),
            AnchorPoint = Vector2.new(0.5, 0),
            Position = UDim2.new(0.5, 0, 0, 0)
        }),
        Text = v2.createElement("TextLabel", {
            BackgroundTransparency = 1,
            Text = v15,
            Font = v12.font,
            TextSize = if not v7 then v12.textSize else l_textSize_0,
            TextXAlignment = Enum.TextXAlignment.Center,
            TextColor3 = v12.textColor,
            Size = UDim2.new(1, 0, 0, 15),
            Position = UDim2.new(0, 0, 1, -15)
        })
    });
end;
return (l_withContext_0({
    Theme = v5.DEPRECATED_Theme,
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v9));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Src.Util.TerrainEnums);
local l_TabId_0 = v3.TabId;
local l_ToolId_0 = v3.ToolId;
local v6 = require(l_Parent_0.Src.Components.ToolButton);
local v7 = require(l_Parent_0.Src.Actions.ChangeTool);
local v8 = v1.PureComponent:extend(script.Name);
local l_TerrainEditorOverhaul_0 = game:GetFastFlag("TerrainEditorOverhaul");
local l_FFlagTerrainEditorFixToolOverlap_0 = game:GetFastFlag("FFlagTerrainEditorFixToolOverlap");
local v11 = if not l_TerrainEditorOverhaul_0 then {
    [l_TabId_0.Create] = {
        l_ToolId_0.Generate,
        l_ToolId_0.ImportLocal,
        l_ToolId_0.Clear
    },
    [l_TabId_0.Region] = {
        l_ToolId_0.Select,
        l_ToolId_0.Move,
        l_ToolId_0.Resize,
        l_ToolId_0.Rotate,
        l_ToolId_0.Copy,
        l_ToolId_0.Paste,
        l_ToolId_0.Delete,
        l_ToolId_0.Fill
    },
    [l_TabId_0.Edit] = {
        l_ToolId_0.Add,
        l_ToolId_0.Subtract,
        l_ToolId_0.Grow,
        l_ToolId_0.Erode,
        l_ToolId_0.Smooth,
        l_ToolId_0.Flatten,
        l_ToolId_0.Paint,
        l_ToolId_0.SeaLevel,
        l_ToolId_0.Replace
    }
} else {
    [l_TabId_0.Create] = {
        l_ToolId_0.Generate,
        l_ToolId_0.ImportLocal,
        l_ToolId_0.Clear
    },
    [l_TabId_0.Edit] = {
        l_ToolId_0.Select,
        l_ToolId_0.Transform,
        l_ToolId_0.Material,
        l_ToolId_0.Draw,
        l_ToolId_0.Sculpt,
        l_ToolId_0.Smooth,
        l_ToolId_0.Flatten,
        l_ToolId_0.Paint,
        l_ToolId_0.SeaLevel
    }
};
v8.init = function(v12)
    v12.layoutRef = v1.createRef();
    v12.mainFrameRef = v1.createRef();
    v12.onContentSizeChanged = function()
        local l_current_0 = v12.mainFrameRef.current;
        local l_current_1 = v12.layoutRef.current;
        if not (not l_current_0 or not l_current_1) then
            l_current_0.Size = UDim2.new(1, 0, 0, l_current_1.AbsoluteContentSize.Y);
        end;
    end;
end;
v8.render = function(v15)
    local v16 = v15.props.CurrentTab or l_TabId_0.Create;
    local l_currentTool_0 = v15.props.currentTool;
    local l_LayoutOrder_0 = v15.props.LayoutOrder;
    local v19 = {};
    for v20, v21 in ipairs(v11[v16]) do
        v19[v21] = v1.createElement(v6, {
            ToolId = v21,
            LayoutOrder = v20,
            OnClick = v15.props.dispatchChangeTool,
            IsCurrentTool = l_currentTool_0 == v21
        });
    end;
    table.insert(v19, v1.createElement("UIGridLayout", {
        SortOrder = Enum.SortOrder.LayoutOrder,
        CellSize = if not l_TerrainEditorOverhaul_0 then UDim2.fromOffset(55, 55) else if l_FFlagTerrainEditorFixToolOverlap_0 then UDim2.fromOffset(72, 55) else UDim2.fromOffset(64, 55),
        CellPadding = if not l_TerrainEditorOverhaul_0 then nil else UDim2.fromOffset(3, 5),
        [v1.Ref] = v15.layoutRef,
        [v1.Change.AbsoluteContentSize] = v15.onContentSizeChanged
    }));
    table.insert(v19, v1.createElement("UIPadding", {
        PaddingLeft = UDim.new(0, not l_TerrainEditorOverhaul_0 and 4 or 3)
    }));
    return v1.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, 55),
        BackgroundTransparency = 1,
        LayoutOrder = l_LayoutOrder_0,
        [v1.Ref] = v15.mainFrameRef
    }, v19);
end;
return v2.connect(function(v22, _)
    return {
        currentTool = v22.Tools.currentTool
    };
end, function(v24)
    return {
        dispatchChangeTool = function(v25)
            v24(v7(v25));
        end
    };
end)(v8);


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local v4 = require(l_Parent_0.Src.Util.PluginActivationController);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v7 = require(l_Parent_0.Src.ContextItems);
local l_Tools_0 = script.Parent.Tools;
local v9 = require(l_Tools_0.Add);
local v10 = require(l_Tools_0.Clear);
local v11 = require(l_Tools_0.Draw);
local v12 = require(l_Tools_0.Erode);
local v13 = require(l_Tools_0.Fill);
local v14 = require(l_Tools_0.Flatten);
local v15 = require(l_Tools_0.Generate);
local v16 = require(l_Tools_0.Grow);
local v17 = require(l_Tools_0.ImportLocal);
local v18 = require(l_Tools_0.Material);
local v19 = require(l_Tools_0.Paint);
local v20 = require(l_Tools_0.Region);
local v21 = require(l_Tools_0.SeaLevel);
local v22 = require(l_Tools_0.Select);
local v23 = require(l_Tools_0.Replace);
local v24 = require(l_Tools_0.Sculpt);
local v25 = require(l_Tools_0.Smooth);
local v26 = require(l_Tools_0.Subtract);
local v27 = require(l_Tools_0.Transform);
local v28 = require(l_Parent_0.Src.Actions.ChangeTool);
local v29 = require(l_Parent_0.Src.Components.Functions.TerrainRegionEditor);
local l_ToolId_0 = require(l_Parent_0.Src.Util.TerrainEnums).ToolId;
local l_TerrainEditorOverhaul_0 = game:GetFastFlag("TerrainEditorOverhaul");
local v32 = {
    [l_ToolId_0.Select] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Move] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Resize] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Rotate] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Copy] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Paste] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Delete] = if not l_TerrainEditorOverhaul_0 then v29 else nil,
    [l_ToolId_0.Fill] = if not l_TerrainEditorOverhaul_0 then v29 else nil
};
local v33 = {
    [l_ToolId_0.Generate] = v15,
    [l_ToolId_0.ImportLocal] = v17,
    [l_ToolId_0.Clear] = v10,
    [l_ToolId_0.Select] = if not l_TerrainEditorOverhaul_0 then v20 else v22,
    [l_ToolId_0.Transform] = if not l_TerrainEditorOverhaul_0 then nil else v27,
    [l_ToolId_0.Move] = if not l_TerrainEditorOverhaul_0 then v20 else nil,
    [l_ToolId_0.Resize] = if not l_TerrainEditorOverhaul_0 then v20 else nil,
    [l_ToolId_0.Rotate] = if not l_TerrainEditorOverhaul_0 then v20 else nil,
    [l_ToolId_0.Copy] = if not l_TerrainEditorOverhaul_0 then v20 else nil,
    [l_ToolId_0.Paste] = if not l_TerrainEditorOverhaul_0 then v20 else nil,
    [l_ToolId_0.Material] = v18,
    [l_ToolId_0.Delete] = v20,
    [l_ToolId_0.Fill] = v13,
    [l_ToolId_0.Add] = v9,
    [l_ToolId_0.Subtract] = v26,
    [l_ToolId_0.Draw] = v11,
    [l_ToolId_0.Grow] = v16,
    [l_ToolId_0.Erode] = v12,
    [l_ToolId_0.Sculpt] = v24,
    [l_ToolId_0.Smooth] = v25,
    [l_ToolId_0.Flatten] = v14,
    [l_ToolId_0.SeaLevel] = v21,
    [l_ToolId_0.Replace] = v23,
    [l_ToolId_0.Paint] = v19
};
local function v37(v34, v35)
    local v36 = v32[v34];
    if v36 ~= v29 then
        v29.Close();
    end;
    if not (not (v34 and v34 ~= l_ToolId_0.None) or not v36) then
        coroutine.wrap(function()
            v36.Init(v34, v35);
        end)();
    end;
end;
local v38 = v2.PureComponent:extend(script.Name);
v38.init = function(v39)
    v39.scrollingRef = v2.createRef();
    v39.layoutRef = v2.createRef();
    v39.onContentSizeChanged = function()
        local l_current_0 = v39.scrollingRef.current;
        local l_current_1 = v39.layoutRef.current;
        if not (not l_current_0 or not l_current_1) then
            l_current_0.CanvasSize = UDim2.new(0, 0, 0, l_current_1.AbsoluteContentSize.Y);
        end;
    end;
end;
v38.didMount = function(v42)
    local l_PluginActivationController_0 = v42.props.PluginActivationController;
    v42.onToolActivatedConnection = l_PluginActivationController_0:subscribeToToolActivated(function()
        if v32[v42.props.currentTool] == v29 then
            v29.Init(v42.props.currentTool, v42.props.Mouse:get());
        end;
    end);
    v42.onToolDeactivatedConnection = l_PluginActivationController_0:subscribeToToolDeactivated(function()
        if v32[v42.props.currentTool] == v29 then
            v29.Close();
        end;
    end);
end;
v38.willUnmount = function(v44)
    if v32[v44.props.currentTool] == v29 then
        v29.Close();
    end;
    if v44.onToolActivatedConnection then
        v44.onToolActivatedConnection:Disconnect();
        v44.onToolActivatedConnection = nil;
    end;
    if v44.onToolDeactivatedConnection then
        v44.onToolDeactivatedConnection:Disconnect();
        v44.onToolDeactivatedConnection = nil;
    end;
end;
v38.willUpdate = function(v45, v46, _)
    v37(v46.currentTool, v45.props.Mouse:get());
end;
v38.didUpdate = function(v48, v49, _)
    if not (v48.props.currentTool ~= l_ToolId_0.Delete and v48.props.currentTool ~= l_ToolId_0.Paste) or v48.props.currentTool == l_ToolId_0.Copy then
        v48.props.dispatchChangeTool(v49.currentTool);
    end;
end;
v38.render = function(v51)
    local v52 = v51.props.Theme:get();
    local l_currentTool_0 = v51.props.currentTool;
    local l_LayoutOrder_0 = v51.props.LayoutOrder;
    local v55 = v33[l_currentTool_0];
    local v56 = v51.props.UpperContentYSize or 0;
    local l_toolRenderTheme_0 = v52.toolRenderTheme;
    return v2.createElement("ScrollingFrame", {
        Size = UDim2.new(1, 0, 1, -v56),
        CanvasSize = UDim2.new(),
        BackgroundTransparency = 1,
        LayoutOrder = l_LayoutOrder_0,
        TopImage = l_toolRenderTheme_0.scrollTopImage,
        MidImage = l_toolRenderTheme_0.scrollMidImage,
        BottomImage = l_toolRenderTheme_0.scrollBotImage,
        VerticalScrollBarInset = l_toolRenderTheme_0.verticalScrollBarInset,
        BorderSizePixel = 0,
        [v2.Ref] = v51.scrollingRef
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            [v2.Ref] = v51.layoutRef,
            [v2.Change.AbsoluteContentSize] = v51.onContentSizeChanged,
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        Tool = v55 and v2.createElement(v55)
    });
end;
return v3.connect(function(v58, _)
    return {
        currentTool = v58.Tools.currentTool
    };
end, function(v60)
    return {
        dispatchChangeTool = function(v61)
            v60(v28(v61));
        end
    };
end)((l_withContext_0({
    Theme = v7.DEPRECATED_Theme,
    Mouse = l_ContextServices_0.Mouse,
    PluginActivationController = v4
})(v38)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_Parent_0.Src.ContextItems);
local l_ToolId_0 = require(l_Parent_0.Src.Util.TerrainEnums).ToolId;
local v8 = v2.PureComponent:extend(script.Name);
v8.didUpdate = function(v9, v10, _)
    if v10.currentTab ~= v9.props.currentTab then
        v9.props.Analytics:report("changeTab", v9.props.currentTab);
    end;
    if v10.currentTool ~= v9.props.currentTool and v9.props.currentTool ~= l_ToolId_0.None then
        v9.props.Analytics:report("changeTool", v9.props.currentTool);
    end;
    if v9.props.currentTool == l_ToolId_0.None then
        v9.props.PluginActivationController:deselectTool();
        return ;
    else
        v9.props.PluginActivationController:activateTool(v9.props.currentTool);
        return ;
    end;
end;
v8.render = function(v12)
    assert(not v12.props[v2.Children], "ToolSelectionListener can't have children");
    return nil;
end;
return v3.connect(function(v13, _)
    return {
        currentTab = v13.Tools.currentTab,
        currentTool = v13.Tools.currentTool
    };
end, nil)((l_withContext_0({
    Analytics = l_ContextServices_0.Analytics,
    PluginActivationController = v6.PluginActivationController
})(v8)));