local l_Workspace_0 = game:GetService("Workspace");
local v1 = require(script.Parent.Parent.Parent.Packages.TestLoader);
local v2 = v1.hasInternalPermission();
local v3 = v1.isCli();
local function _(v4, v5)
    local v6 = v5 or false;
    return function()
        local l_MaterialPickerFlags_0 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
        if l_MaterialPickerFlags_0 and l_MaterialPickerFlags_0:FindFirstChild(v4) then
            return l_MaterialPickerFlags_0[v4].Value;
        else
            return v6;
        end;
    end;
end;
local v9 = {};
local v10 = v3 or false;
local v11 = "RunningUnderCLI";
local l_v11_0 = v11 --[[ copy: 9 -> 11 ]];
local l_v10_0 = v10 --[[ copy: 8 -> 12 ]];
v9.RunningUnderCLI = function()
    local l_MaterialPickerFlags_1 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_1 and l_MaterialPickerFlags_1:FindFirstChild(l_v11_0) then
        return l_MaterialPickerFlags_1[l_v11_0].Value;
    else
        return l_v10_0;
    end;
end;
v10 = "RunTests";
v11 = false;
local l_v10_1 = v10 --[[ copy: 8 -> 13 ]];
local l_v11_1 = v11 --[[ copy: 9 -> 14 ]];
v9.RunTests = function()
    local l_MaterialPickerFlags_2 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_2 and l_MaterialPickerFlags_2:FindFirstChild(l_v10_1) then
        return l_MaterialPickerFlags_2[l_v10_1].Value;
    else
        return l_v11_1;
    end;
end;
v10 = "LogTestsQuiet";
v11 = false;
local l_v10_2 = v10 --[[ copy: 8 -> 15 ]];
local l_v11_2 = v11 --[[ copy: 9 -> 16 ]];
v9.LogTestsQuiet = function()
    local l_MaterialPickerFlags_3 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_3 and l_MaterialPickerFlags_3:FindFirstChild(l_v10_2) then
        return l_MaterialPickerFlags_3[l_v10_2].Value;
    else
        return l_v11_2;
    end;
end;
v10 = "LogAnalytics";
v11 = false;
local l_v10_3 = v10 --[[ copy: 8 -> 17 ]];
local l_v11_3 = v11 --[[ copy: 9 -> 18 ]];
v9.LogAnalytics = function()
    local l_MaterialPickerFlags_4 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_4 and l_MaterialPickerFlags_4:FindFirstChild(l_v10_3) then
        return l_MaterialPickerFlags_4[l_v10_3].Value;
    else
        return l_v11_3;
    end;
end;
v10 = "RunDeveloperFrameworkTests";
v11 = false;
local l_v11_4 = v11 --[[ copy: 9 -> 19 ]];
v9.RunDeveloperFrameworkTests = function()
    local l_MaterialPickerFlags_5 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_5 and l_MaterialPickerFlags_5:FindFirstChild(v10) then
        return l_MaterialPickerFlags_5[v10].Value;
    else
        return l_v11_4;
    end;
end;
v11 = (v3 or v2) or false;
local v26 = "EnableRoactConfigs";
v9.EnableRoactConfigs = function()
    local l_MaterialPickerFlags_6 = l_Workspace_0:FindFirstChild("MaterialPickerFlags");
    if l_MaterialPickerFlags_6 and l_MaterialPickerFlags_6:FindFirstChild(v26) then
        return l_MaterialPickerFlags_6[v26].Value;
    else
        return v11;
    end;
end;
return v9;


local l_applyToInstances_0 = require(script:FindFirstAncestor("MaterialPicker").Packages.MaterialFramework).Util.applyToInstances;
return function(v1, v2)
    local v3 = nil;
    local v4 = nil;
    if not (typeof(v1) == "Instance") or not v1:IsA("MaterialVariant") then
        v4 = v1;
    else
        v4 = v1.BaseMaterial;
        v3 = v1.Name;
    end;
    l_applyToInstances_0(v2:Get(), v4, v3);
end;


local l_applyToInstances_0 = require(script:FindFirstAncestor("MaterialPicker").Packages.MaterialFramework).Util.applyToInstances;
applyToSelectionByIdentifier = function(v1, v2)
    local v3 = string.split(v1, "__");
    local v4 = v2:Get();
    if #v3 == 2 then
        l_applyToInstances_0(v4, v3[2], v3[1]);
        return ;
    else
        l_applyToInstances_0(v4, v1);
        return ;
    end;
end;
return applyToSelectionByIdentifier;


isMaterialVariantByIdentifier = function(v0)
    return #string.split(v0, "__") == 2;
end;
return isMaterialVariantByIdentifier;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.MaterialFramework);
local l_ContextServices_0 = v1.ContextServices;
local l_TestHelpers_0 = v1.TestHelpers;
local l_Resources_0 = v2.Resources;
local v6 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock({
        libraries = {
            [l_Resources_0.LOCALIZATION_PROJECT_NAME] = {
                stringResourceTable = l_Resources_0.SourceStrings,
                translationResourceTable = l_Resources_0.LocalizedStrings
            }
        }
    }),
    l_ContextServices_0.Store.new(require(l_Parent_0.Src.TestHelpers.createEmptyStore)()),
    require(l_Parent_0.Src.Resources.createThemeTable)(true).createTheme(),
    v2.Context.StudioServices.mock()
};
return function(v7)
    assert(type(v7) == "table", "Expected story to be a table");
    return l_TestHelpers_0.provideMockContext(v6, v7);
end;


local l_parseMaterial_0 = require(script:FindFirstAncestor("MaterialPicker").Packages.MaterialFramework).Util.parseMaterial;
return function(v1, v2)
    local v3, v4 = l_parseMaterial_0(v1);
    if not v4 then
        v2:SetCurrentMaterial(v3, "");
        return ;
    else
        v2:SetCurrentMaterial(v3, (tostring(v4)));
        return ;
    end;
end;


local l_getSerializedMaterialIdentifier_0 = require(script:FindFirstAncestor("MaterialPicker").Packages.MaterialFramework).Util.getSerializedMaterialIdentifier;
return function(v1, v2)
    local v3 = v1:GetSetting("RecentlyUsed") or {
        "Plastic"
    };
    local v4 = l_getSerializedMaterialIdentifier_0(v2);
    local v5 = table.find(v3, v4);
    if v5 then
        table.remove(v3, v5);
    end;
    table.insert(v3, v4);
    if #v3 > 9999 then
        table.remove(v3, 1);
    end;
    v1:SetSetting("RecentlyUsed", v3);
end;


return function(v0, v1)
    local l_Parent_0 = script.Parent.Parent;
    local l_DraggerFramework_0 = l_Parent_0.Packages.DraggerFramework;
    local v4 = require(l_Parent_0.Packages.Roact);
    local v5 = require(l_Parent_0.Packages.DraggerSchemaCore.DraggerSchema);
    local v6 = require(l_DraggerFramework_0.Implementation.DraggerContext_PluginImpl);
    local v7 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
    local v8 = require(l_DraggerFramework_0.Flags.getFFlagDraggerHandlesIsEnabledFunction);
    local v9 = require(l_DraggerFramework_0.Handles.MoveHandles);
    local v10 = nil;
    local v11 = false;
    local v12 = nil;
    local function v19()
        if not v12 then
            v11 = true;
            v0:Activate(true);
            v1.mainButton:SetActive(true);
            local function v16(v13, v14, v15)
                return v13:moveToWithIk(v14, v15);
            end;
            local v17 = nil;
            if v8() then
                v17 = function(v18)
                    if not v18 or not v18.basisObject then
                        return false;
                    else
                        return true;
                    end;
                end;
            end;
            v12 = v4.mount(v4.createElement(v7, {
                Mouse = v0:GetMouse(),
                DraggerContext = v10,
                DraggerSchema = v5,
                DraggerSettings = {
                    AnalyticsName = "Move",
                    AllowDragSelect = true,
                    AllowFreeformDrag = true,
                    ShowLocalSpaceIndicator = true,
                    ShowPivotIndicator = true,
                    HandlesList = {
                        v9.new(v10, {
                            ShowBoundingBox = false,
                            Summonable = true,
                            Outset = 0.3,
                            IsEnabledFunction = not not v8() and v17 or nil
                        }, v5.TransformHandlesImplementation.new(v10, v16))
                    }
                }
            }));
            return ;
        else
            warn("Plugin handle already exists");
            return ;
        end;
    end;
    local function _()
        v11 = false;
        v1.mainButton:SetActive(false);
        if v12 then
            v4.unmount(v12);
            v12 = nil;
        end;
    end;
    (function()
        v0.Name = "MoveDragger";
        v10 = v6.new(v0, game, settings(), v5.Selection.new());
        v0.Deactivation:Connect(function()
            if v11 then
                v11 = false;
                v1.mainButton:SetActive(false);
                if v12 then
                    v4.unmount(v12);
                    v12 = nil;
                end;
            end;
        end);
        v1.mainButtonClickedSignal:Connect(function()
            if not v11 then
                v19();
            else
                v11 = false;
                v1.mainButton:SetActive(false);
                if v12 then
                    v4.unmount(v12);
                    v12 = nil;
                    return ;
                end;
            end;
        end);
    end)();
end;


return function(v0, v1)
    if v0 then
        require(script.Parent.commonInit)();
        local l_Parent_0 = script.Parent.Parent;
        local v3 = require(l_Parent_0.Packages.Roact);
        local v4 = require(l_Parent_0.Packages.Framework);
        local v5 = require(l_Parent_0.Src.MainPlugin);
        local v6 = require(l_Parent_0.Src.Util.hasInternalPermission)();
        local v7 = nil;
        local v8 = nil;
        if v6 then
            v8 = v4.DeveloperTools.forPlugin(l_Parent_0.Name, v0);
        end;
        local function v9()
            v0.Name = l_Parent_0.Name;
            v7 = v3.mount((v3.createElement(v5, {
                Plugin = v0,
                pluginLoaderContext = v1
            })));
            if v8 then
                v8:addRoactTree("Roact tree", v7);
            end;
        end;
        v0.Unloading:Connect(function()
            if v8 then
                v8:destroy();
            end;
            if v7 then
                v3.unmount(v7);
                v7 = nil;
            end;
        end);
        v9();
        return ;
    else
        return ;
    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.RoactRodux);
local v3 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Analytics_0 = l_ContextServices_0.Analytics;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v3.Style.Stylizer;
local l_Pane_0 = v3.UI.Pane;
local v10 = require(l_Parent_0.Src.Actions.ExampleAction);
local _ = require(l_Parent_0.Src.Reducers.ExampleReducer);
local v12 = v1.PureComponent:extend("ExampleRoactRoduxComponent");
v12.render = function(_)
    return v1.createElement(l_Pane_0);
end;
return v2.connect(function(v14, _)
    return {
        DefaultStateObject = v14.DefaultStateObject
    };
end, function(v16)
    return {
        dispatchExampleAction = function(v17)
            v16(v10(v17));
        end
    };
end)((l_withContext_0({
    Analytics = l_Analytics_0,
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v12)));


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_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Analytics_0 = l_ContextServices_0.Analytics;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = v2.Style.Stylizer;
local l_Promise_0 = v2.Util.Promise;
local l_Pane_0 = v2.UI.Pane;
local l_Button_0 = v2.UI.Button;
local l_game_FastFlag_0 = game:GetFastFlag("TurnOffNPPThrottling", false);
local v12 = v1.PureComponent:extend("PublishFrame");
local _, l_result_0 = pcall(function()
    return game:GetService("PackageUIService");
end);
local l_Selection_0 = game:GetService("Selection");
local l_game_FastInt_0 = game:GetFastInt("PackageUploadThrottleTimeMin", 2);
local l_game_FastInt_1 = game:GetFastInt("PackageUploadThrottleAllowedPackages", 180);
local v18 = {
    PackagePublishSuccess = "Package published {%s, %s}",
    PackagePublishFailure = "Failed to publish package. Retrying... {%s, %s}",
    PackagePublishSkipped = "Package skipped due to no changes detected. {%s, %s}",
    TempContainerName = "NPP_Cloned_Instances",
    UpToDateString = "Up To Date",
    NewVersionString = "New Version Available",
    OperationEnded = "Hierarchical Publish Operation completed",
    OperationCancelled = "Hierarchal Publish Operation cancelled.",
    LatestVersionFailure = "There was an issue getting the latest version of a package. Ending process."
};
local v19 = {
    Ready = 0,
    Pending = 1,
    Updating = 2,
    Failed = 3,
    Success = 4,
    Skipped = 5
};
local v20 = {
    [v19.Updating] = 0.3,
    [v19.Pending] = 0.7,
    [v19.Failed] = 0.7,
    [v19.Success] = 1,
    [v19.Skipped] = 1
};
local v21 = {
    [v19.Updating] = Color3.fromRGB(145, 50, 235),
    [v19.Pending] = Color3.fromRGB(255, 185, 0),
    [v19.Failed] = Color3.fromRGB(225, 50, 25),
    [v19.Success] = Color3.fromRGB(25, 225, 40),
    [v19.Skipped] = Color3.fromRGB(44, 101, 29)
};
local function _(v22)
    if v22 then
        return v22:FindFirstChildOfClass("PackageLink");
    else
        return ;
    end;
end;
local function v25(v24)
    return v24.Name;
end;
local function _(v26)
    return not pcall(v25, v26);
end;
local function v28(v29, v30, v31)
    if pcall(v25, v30) then
        local v32 = if v30 then v30:FindFirstChildOfClass("PackageLink") else nil;
        if v32 then
            local v33 = v31[v32.PackageId];
            if v33 and v33.oldVersionId == v32.VersionNumber then
                table.insert(v29, v30);
                return ;
            end;
        end;
        for _, v35 in v30:GetChildren() do
            v28(v29, v35, v31);
        end;
        return ;
    else
        return ;
    end;
end;
local function _(v36, v37)
    local v38 = {};
    v28(v38, v36, v37);
    return v38;
end;
local function v40(v41, v42, v43)
    if pcall(v25, v42) then
        local v44 = if v42 then v42:FindFirstChildOfClass("PackageLink") else nil;
        if v44 then
            if not v41[v44.PackageId] then
                v41[v44.PackageId] = {
                    instance = v42,
                    parents = {}
                };
            end;
            if v43 then
                v41[v44.PackageId].parents[v43] = v41[v43];
            end;
            v43 = v44.PackageId;
        end;
        for _, v46 in v42:GetChildren() do
            v40(v41, v46, v43);
        end;
        return ;
    else
        return ;
    end;
end;
local function _(v47)
    local v48 = {};
    v40(v48, v47, nil);
    return v48;
end;
local function v54(v50, v51)
    if if v50 then v50:FindFirstChildOfClass("PackageLink") else nil then
        if typeof(v51) ~= "number" then
            return ;
        else
            local l_status_1, l_result_1 = pcall(function()
                return l_result_0:SetPackageVersion(v50, v51);
            end);
            if l_status_1 and l_result_1 then
                return l_result_1;
            else
                warn(l_result_1);
                return ;
            end;
        end;
    else
        return ;
    end;
end;
local function v55(v56)
    if v56 then
        local l_Parent_1 = v56.Parent;
        if l_Parent_1 then
            if not if l_Parent_1 then l_Parent_1:FindFirstChildOfClass("PackageLink") else nil then
                return v55(l_Parent_1);
            else
                return l_Parent_1;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
local function v60(v58, v59)
    if v58.Depth == v59.Depth then
        return v58.PackageId < v59.PackageId;
    else
        return v58.Depth < v59.Depth;
    end;
end;
local function v78(v61, v62)
    assert(v61);
    assert(v62);
    local v63 = if v61 then v61:FindFirstChildOfClass("PackageLink") else nil;
    assert(v63);
    local v64 = {};
    v40(v64, v62, nil);
    local l_v64_0 = v64;
    v64 = {};
    local v66 = {};
    local function v67(v68, v69, v70)
        local v71 = l_v64_0[v68];
        if not v70[v71] then
            v70[v71] = true;
            for v72, _ in pairs(v71.parents) do
                v67(v72, v69 + 1, table.clone(v70));
            end;
            if not v64[v68] then
                local l_status_2, l_result_2 = pcall(function()
                    return l_result_0:GetPackageInfo((string.match(v68, "%d+")));
                end);
                if not l_status_2 then
                    error(l_result_2);
                end;
                local v76 = v69 == 0;
                local v77 = {
                    PackageId = v68,
                    FoundInstance = if not v76 then v71.instance else v61,
                    Depth = v69,
                    Changed = v76,
                    IsSelected = v76,
                    LatestVersionNumber = l_result_2.LatestVersionNumber,
                    PackageAssetName = l_result_2.PackageAssetName,
                    HasEditPermission = Enum.PackagePermission.Edit.Value <= l_result_2.PermissionLevel.Value
                };
                v64[v68] = v77;
                table.insert(v66, v77);
                return ;
            else
                v64[v68].Depth = math.max(v64[v68].Depth, v69);
                return ;
            end;
        else
            return ;
        end;
    end;
    v67(v63.PackageId, 0, {});
    return v66;
end;
v12.runScopedMassUpdate = function(v79, v80, v81, v82)
    local v83 = {};
    v28(v83, v81, v82);
    local l_v83_0 = v83;
    if #l_v83_0 > 0 then
        v80.PublishStatus = v19.Updating;
        v79:setState({});
        for _, v86 in ipairs(l_v83_0) do
            local v87 = v82[(if v86 then v86:FindFirstChildOfClass("PackageLink") else nil).PackageId];
            local v88 = 0;
            while true do
                if not v79.state.isCancelling then
                    if not v54(v86, v87.newVersionId) then
                        v79:setState({
                            canCancel = v88 >= 3
                        });
                        v88 = v88 + 1;
                        task.wait(0.5);
                    else
                        v80.Changed = true;
                        break;
                    end;
                else
                    return ;
                end;
            end;
        end;
    end;
end;
v12.getLatestVersionClone = function(v89, v90)
    local l_FoundInstance_0 = v90.FoundInstance;
    if l_FoundInstance_0 then
        l_FoundInstance_0 = l_FoundInstance_0:Clone();
        l_FoundInstance_0.Parent = v89.state.tempContainer;
        if not v90.IsSelected then
            local v92 = 0;
            local v93 = nil;
            while true do
                if not v89.state.isCancelling then
                    v93 = v54(l_FoundInstance_0, v90.LatestVersionNumber);
                    if not v93 then
                        local v94 = v92 >= 3;
                        if v89.state.canCancel ~= v94 then
                            v89:setState({
                                canCancel = v94
                            });
                        end;
                        warn(string.format(v18.PackagePublishFailure, v90.PackageAssetName, v90.PackageId));
                        task.wait(2 ^ math.min(v92, 2));
                        v92 = v92 + 1;
                    end;
                    if v93 then
                        return v93;
                    end;
                else
                    return ;
                end;
            end;
        else
            return l_FoundInstance_0;
        end;
    else
        warn(v18.LatestVersionFailure);
        return ;
    end;
end;
v12.promiseToPublishPackage = function(v95, v96, v97)
    return l_Promise_0.new(function(v98, v99)
        task.spawn(function()
            if not v95.state.isCancelling then
                v95:setState({
                    canCancel = false
                });
                local v100 = v95:getLatestVersionClone(v96);
                if v100 then
                    if not v96.IsSelected then
                        v95:runScopedMassUpdate(v96, v100, v97);
                    end;
                    if v96.Changed then
                        local v101 = v100:Clone();
                        v101.Archivable = false;
                        v101.Parent = v100.Parent;
                        local v102 = if v101 then v101:FindFirstChildOfClass("PackageLink") else nil;
                        local v103 = if v100 then v100:FindFirstChildOfClass("PackageLink") else nil;
                        if v103.Status == v18.UpToDateString then
                            v103:GetPropertyChangedSignal("Status"):Wait();
                        end;
                        v96.PublishStatus = v19.Pending;
                        v95:setState({});
                        local v104 = 0;
                        local v105 = nil;
                        local v106 = nil;
                        while true do
                            if not v95.state.isCancelling then
                                local l_status_3, l_result_3 = pcall(function()
                                    l_result_0:PublishPackage(v100, false);
                                end);
                                v105 = l_status_3;
                                v106 = l_result_3;
                                if not v105 then
                                    warn(v106);
                                    v96.PublishStatus = v19.Failed;
                                    v95:setState({
                                        canCancel = v104 >= 3
                                    });
                                    warn(string.format(v18.PackagePublishFailure, v96.PackageAssetName, v96.PackageId));
                                    task.wait(2 ^ math.min(v104, 2));
                                    v104 = v104 + 1;
                                    v96.PublishStatus = v19.Pending;
                                    v95:setState({});
                                else
                                    warn(string.format(v18.PackagePublishSuccess, v96.PackageAssetName, v96.PackageId));
                                    if not string.find(v102.Status, v18.NewVersionString) then
                                        v102:GetPropertyChangedSignal("Status"):Wait();
                                    end;
                                    v97[v96.PackageId] = {
                                        oldVersionId = v96.LatestVersionNumber,
                                        newVersionId = (if v100 then v100:FindFirstChildOfClass("PackageLink") else nil).VersionNumber
                                    };
                                    v96.PublishStatus = v19.Success;
                                    v95:setState({});
                                end;
                                if v105 then
                                    v100:Destroy();
                                    v101:Destroy();
                                    return v98();
                                end;
                            else
                                return v99();
                            end;
                        end;
                    else
                        v96.PublishStatus = v19.Skipped;
                        v95:setState({});
                        warn(string.format(v18.PackagePublishSkipped, v96.PackageAssetName, v96.PackageId));
                        return v98();
                    end;
                else
                    return v99();
                end;
            else
                return v99();
            end;
        end);
    end);
end;
v12.waitForPromises = function(v109, v110, v111)
    if not v110 or #v110 == 0 then
        return true, nil;
    else
        local l_BindableEvent_0 = Instance.new("BindableEvent");
        local v113 = 0;
        for _, v115 in v110, nil, nil do
            if not (not l_game_FastFlag_0 and v113 >= 5) or l_BindableEvent_0.Event:Wait() then
                if not l_game_FastFlag_0 then
                    local v116 = os.clock() - (v109.PublishStartTime + v109.NumPromised * 2);
                    if v116 < 2 then
                        task.wait(2 - v116);
                    end;
                    v109.NumPromised = v109.NumPromised + 1;
                else
                    local v117 = os.clock();
                    local v118 = l_game_FastInt_0 * 60;
                    if v109.NumPromised == l_game_FastInt_1 and v117 < v109.PublishStartTime + v118 then
                        task.wait(((v109.PublishStartTime + v118) - v117) + 5);
                        v109.NumPromised = 0;
                        v109.PublishStartTime = os.clock();
                    end;
                    v109.NumPromised = v109.NumPromised + 1;
                end;
                v113 = v113 + 1;
                v109:promiseToPublishPackage(v115, v111):andThen(function()
                    v113 = v113 - 1;
                    l_BindableEvent_0:Fire(true);
                end):catch(function()
                    l_BindableEvent_0:Fire(false);
                end);
            else
                return ;
            end;
        end;
        while true do
            if v113 > 0 then
                if not l_BindableEvent_0.Event:Wait() then
                    return ;
                end;
            else
                l_BindableEvent_0:Destroy();
                return true;
            end;
        end;
    end;
end;
v12.doPackagePublishing = function(v119, v120)
    local v121 = {};
    local v122 = nil;
    local v123 = nil;
    v119.PublishStartTime = os.clock();
    v119.NumPromised = 0;
    for v124 = 1, #v120 do
        local v125 = v120[v124];
        if v122 ~= v125.Depth then
            if v119:waitForPromises(v123, v121) then
                v122 = v125.Depth;
                v123 = {};
            else
                return ;
            end;
        end;
        table.insert(v123, v125);
    end;
    v119:waitForPromises(v123, v121);
end;
v12.publishSelectedPackageHierarchy = function(v126)
    if v126.state.canPublish then
        local l_Folder_0 = Instance.new("Folder");
        l_Folder_0.Archivable = false;
        l_Folder_0.Name = v18.TempContainerName;
        l_Folder_0.Parent = game:GetService("ServerStorage");
        v126:setState({
            isPublishing = true,
            canPublish = false,
            isCancelling = false,
            canCancel = false,
            tempContainer = l_Folder_0
        });
        v126:doPackagePublishing(v126.state.packageLists);
        if v126.state.isCancelling then
            warn(v18.OperationCancelled);
        else
            local l_selectedInstance_0 = v126.state.selectedInstance;
            local v129 = table.find(l_Selection_0:Get(), l_selectedInstance_0);
            while true do
                local l_l_selectedInstance_0_0 = l_selectedInstance_0;
                local v131;
                if l_l_selectedInstance_0_0 then
                    local l_Parent_2 = l_l_selectedInstance_0_0.Parent;
                    v131 = if l_Parent_2 then if if l_Parent_2 then l_Parent_2:FindFirstChildOfClass("PackageLink") else nil then l_Parent_2 else v55(l_Parent_2) else nil;
                else
                    v131 = nil;
                end;
                if not (not v131 or not string.find((if v131 then v131:FindFirstChildOfClass("PackageLink") else nil).Status, v18.NewVersionString)) then
                    l_selectedInstance_0 = v131;
                else
                    break;
                end;
            end;
            local v133 = v54(l_selectedInstance_0, 0);
            if v129 then
                l_Selection_0:Add({
                    v133
                });
            end;
            warn(v18.OperationEnded);
        end;
        l_Folder_0:Destroy();
        v126:setState({
            isPublishing = false,
            isCancelling = false,
            canCancel = false,
            tempContainer = v1.None
        });
        v126:onChangeSelection();
        return ;
    else
        return ;
    end;
end;
v12.onChangeSelection = function(v134)
    if v134.props.Enabled then
        if not v134.state.isPublishing then
            local v135 = l_Selection_0:Get();
            if #v135 ~= 1 then
                v134:setState({
                    selectedInstance = v1.None,
                    packageLists = v1.None,
                    canPublish = false
                });
                return ;
            else
                local v136 = v135[1];
                local v137 = if v136 then v136:FindFirstChildOfClass("PackageLink") else nil;
                if not v137 or v137.Status == v18.UpToDateString then
                    v134:setState({
                        selectedInstance = v1.None,
                        packageLists = v1.None,
                        canPublish = false
                    });
                    return ;
                else
                    local v138 = v78(v136, game);
                    table.sort(v138, v60);
                    for _, v140 in ipairs(v138) do
                        v140.PublishStatus = v19.Ready;
                    end;
                    v134:setState({
                        selectedInstance = v136,
                        packageLists = v138,
                        canPublish = true
                    });
                    return ;
                end;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v12.didMount = function(v141)
    l_Selection_0.SelectionChanged:Connect(function()
        v141:onChangeSelection();
    end);
end;
v12.didUpdate = function(v142, v143)
    if v143.Enabled == v142.props.Enabled then
        return ;
    else
        if v142.props.Enabled then
            v142:onChangeSelection();
        end;
        return ;
    end;
end;
local v144 = v1.PureComponent:extend("ProgressBar");
v144.render = function(v145)
    local l_publishStatus_0 = v145.props.publishStatus;
    local v147 = v20[l_publishStatus_0];
    return v147 and v1.createElement("Frame", {
        AnchorPoint = Vector2.new(0.5, 1),
        BackgroundColor3 = Color3.new(0, 0, 0),
        Size = UDim2.new(0.9, 0, 0.1, 0),
        Position = UDim2.new(0.5, 0, 1, -3)
    }, {
        uiCorner = v1.createElement("UICorner", {
            CornerRadius = UDim.new(0.5, 0.5)
        }),
        uiStroke = v1.createElement("UIStroke", {
            Thickness = 2
        }),
        progressBar = v1.createElement("Frame", {
            AnchorPoint = Vector2.new(0, 0.5),
            BackgroundColor3 = v21[l_publishStatus_0],
            Size = UDim2.new(v147, 0, 1, 0),
            Position = UDim2.new(0, 0, 0.5, 0)
        }, {
            uiCorner = v1.createElement("UICorner", {
                CornerRadius = UDim.new(0.5, 0.5)
            })
        })
    });
end;
local v148 = v1.PureComponent:extend("PackageBoxItem");
v148.render = function(v149)
    local l_props_0 = v149.props;
    return v1.createElement("Frame", {
        BackgroundColor3 = if not l_props_0.hasEditPermission then Color3.fromRGB(100, 100, 100) else Color3.fromRGB(200, 200, 200),
        Size = UDim2.new(0, 80, 0, 80),
        Position = UDim2.new(0, 84 * l_props_0.row, 0, 84 * l_props_0.column)
    }, {
        packageName = v1.createElement("TextLabel", {
            BackgroundTransparency = 1,
            Text = l_props_0.packageAssetName,
            TextWrapped = true,
            TextSize = 16,
            AnchorPoint = Vector2.new(0.5, 0.5),
            Size = UDim2.new(1, 0, 1, 0),
            Position = UDim2.new(0.5, 0, 0.5, 0)
        }),
        progressBar = v1.createElement(v144, {
            publishStatus = l_props_0.publishStatus
        })
    });
end;
v12.render = function(v151)
    local l_Localization_1 = v151.props.Localization;
    local l_mainWindow_0 = v151.props.Stylizer.mainWindow;
    local l_canPublish_0 = v151.state.canPublish;
    local l_isPublishing_0 = v151.state.isPublishing;
    local l_canCancel_0 = v151.state.canCancel;
    local l_isCancelling_0 = v151.state.isCancelling;
    local v158 = {};
    local v159 = 0;
    local v160 = 0;
    if not (not ((l_canPublish_0 or l_isPublishing_0) or l_canCancel_0) and not l_isCancelling_0) then
        local v161 = nil;
        local v162 = -1;
        local v163 = 0;
        for _, v165 in ipairs(v151.state.packageLists) do
            if v161 ~= v165.Depth then
                v161 = v165.Depth;
                v162 = v162 + 1;
                v160 = math.max(v160, v163 + 1);
                v163 = 0;
            else
                v163 = v163 + 1;
            end;
            v158[v165.PackageId] = v1.createElement(v148, {
                row = v162,
                column = v163,
                packageAssetName = v165.PackageAssetName,
                publishStatus = v165.PublishStatus,
                hasEditPermission = v165.HasEditPermission
            });
        end;
        v159 = math.max(0, v162 + 1);
        v160 = math.max(v160, v163 + 1);
    end;
    return v1.createElement(l_Pane_0, {
        BackgroundColor = l_mainWindow_0.backgroundColor
    }, {
        mainDisplay = v1.createElement("Frame", {
            BackgroundTransparency = 1,
            AnchorPoint = Vector2.new(0.5, 0),
            Size = UDim2.new(1, 0, 1, -100),
            Position = UDim2.new(0.5, 0, 0, 0)
        }, {
            scrollFrame = v1.createElement("ScrollingFrame", {
                ScrollingDirection = Enum.ScrollingDirection.XY,
                BackgroundTransparency = 1,
                AnchorPoint = Vector2.new(0.5, 0.5),
                Size = UDim2.new(1, -8, 1, -8),
                Position = UDim2.new(0.5, 0, 0.5, 0),
                CanvasSize = UDim2.new(0, 80 * v159 + 4 * math.max(0, v159 - 1), 0, 80 * v160 + 4 * math.max(0, v160 - 1))
            }, v158)
        }),
        bottomBar = v1.createElement("Frame", {
            BackgroundTransparency = 1,
            AnchorPoint = Vector2.new(0.5, 1),
            Size = UDim2.new(1, 0, 0, 100),
            Position = UDim2.new(0.5, 0, 1, 0)
        }, {
            cancelButton = l_canCancel_0 and v1.createElement(l_Button_0, {
                Text = l_Localization_1:getText("Action", "Cancel"),
                AnchorPoint = Vector2.new(0, 0.5),
                Size = UDim2.new(0.3, 0, 1, -8),
                Position = UDim2.new(0, 4, 0.5, 0),
                OnClick = function()
                    v151:setState({
                        canCancel = false,
                        isCancelling = true
                    });
                end
            }),
            publishHierarchyButton = l_canPublish_0 and v1.createElement(l_Button_0, {
                Text = l_Localization_1:getText("Action", "Publish"),
                AnchorPoint = Vector2.new(1, 0.5),
                Size = UDim2.new(0.3, 0, 1, -8),
                Position = UDim2.new(1, -4, 0.5, 0),
                OnClick = function()
                    v151:publishSelectedPackageHierarchy();
                end
            })
        })
    });
end;
return (l_withContext_0({
    Analytics = l_Analytics_0,
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v12));


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_Parent_0 = script.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Rodux);
local v4 = require(l_Parent_0.Packages.Framework);
local l_DockWidget_0 = v4.UI.DockWidget;
local l_ContextServices_0 = v4.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_Store_0 = l_ContextServices_0.Store;
local v10 = require(l_Parent_0.Src.Reducers.MainReducer);
local v11 = require(l_Parent_0.Src.Resources.MakeTheme);
local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
local l_Components_0 = l_Parent_0.Src.Components;
local v15 = require(l_Components_0.PublishFrame);
local v16 = require(l_Components_0.ExampleRoactRoduxComponent);
local v17 = v2.PureComponent:extend("MainPlugin");
v17.init = function(v18, _)
    v18.state = {
        enabled = false
    };
    v18.toggleEnabled = function()
        v18:setState(function(v20)
            return {
                enabled = not v20.enabled
            };
        end);
    end;
    v18.onClose = function()
        v18:setState({
            enabled = false
        });
    end;
    v18.onRestore = function(v21)
        v18:setState({
            enabled = v21
        });
    end;
    v18.onDockWidgetCreated = function()
        v18.props.pluginLoaderContext.mainButtonClickedSignal:Connect(v18.toggleEnabled);
    end;
    v18.onWidgetEnabledChanged = function(v22)
        v18:setState({
            enabled = v22.Enabled
        });
    end;
    v18.store = v3.Store.new(v10, nil, {
        v3.thunkMiddleware
    }, nil);
    v18.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "NestedPackagePublisher"
    });
    v18.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
end;
v17.didUpdate = function(v23)
    v23.props.pluginLoaderContext.mainButton:SetActive(v23.state.enabled);
end;
v17.render = function(v24)
    local l_props_0 = v24.props;
    local l_state_0 = v24.state;
    local l_Plugin_1 = l_props_0.Plugin;
    local l_enabled_0 = l_state_0.enabled;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_Plugin_1),
        l_Store_0.new(v24.store),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        v11(),
        v24.localization,
        v24.analytics
    }, {
        MainWidget = v2.createElement(l_DockWidget_0, {
            Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "NestedPackagePublisher",
            Enabled = l_enabled_0,
            Widget = l_props_0.pluginLoaderContext.mainDockWidget,
            Title = v24.localization:getText("Plugin", "Name"),
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Bottom,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(250, 200),
            OnClose = v24.onClose,
            ShouldRestore = true,
            OnWidgetRestored = v24.onRestore,
            OnWidgetCreated = v24.onDockWidgetCreated,
            [v2.Change.Enabled] = v24.onWidgetEnabledChanged
        }, {
            PublishFrame = v2.createElement(v15, {
                Enabled = l_enabled_0
            }),
            ExampleRoactRoduxComponent = v2.createElement(v16)
        })
    });
end;
return v17;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return v1.createReducer({
    DefaultStateObject = ""
}, {
    [require(l_Parent_0.Src.Actions.ExampleAction).name] = function(v3, v4)
        return v2.Dictionary.join(v3, {
            DefaultStateObject = v4.something
        });
    end
});


local l_Style_0 = require(script.Parent.Parent.Parent.Packages.Framework).Style;
local l_StudioTheme_0 = l_Style_0.Themes.StudioTheme;
local l_StyleKey_0 = l_Style_0.StyleKey;
local v3 = {
    mainWindow = {
        backgroundColor = l_StyleKey_0.MainBackground
    }
};
local v4 = {
    mainWindow = {
        backgroundColor = l_StyleKey_0.MainBackground
    }
};
local v5 = {};
return function(v6)
    local _ = nil;
    return (if not v6 then l_StudioTheme_0.new(v3, v4) else l_StudioTheme_0.mock(v3, v4)):extend(v5);
end;


local l_Workspace_0 = game:GetService("Workspace");
local v1 = require(script.Parent.hasInternalPermission)();
local v2 = pcall(function()
    return game:GetService("ProcessService");
end);
local function _(v3, v4)
    v4 = v4 or false;
    return function()
        local l_NestedPackagePublisherFlags_0 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_0 and l_NestedPackagePublisherFlags_0:FindFirstChild(v3) then
            return l_NestedPackagePublisherFlags_0[v3].Value;
        else
            return v4;
        end;
    end;
end;
local v7 = {};
local v8 = v2 or false;
local v9 = "RunningUnderCLI";
local l_v9_0 = v9 --[[ copy: 7 -> 8 ]];
local v11;
do
    local l_v8_0 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_1 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_1 and l_NestedPackagePublisherFlags_1:FindFirstChild(l_v9_0) then
            return l_NestedPackagePublisherFlags_1[l_v9_0].Value;
        else
            return l_v8_0;
        end;
    end;
end;
v7.RunningUnderCLI = v11;
v8 = nil or false;
v9 = "RunTests";
local l_v9_1 = v9 --[[ copy: 7 -> 9 ]];
do
    local l_v8_1 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_2 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_2 and l_NestedPackagePublisherFlags_2:FindFirstChild(l_v9_1) then
            return l_NestedPackagePublisherFlags_2[l_v9_1].Value;
        else
            return l_v8_1;
        end;
    end;
end;
v7.RunTests = v11;
v8 = nil or false;
v9 = "LogTestsQuiet";
local l_v9_2 = v9 --[[ copy: 7 -> 10 ]];
do
    local l_v8_2 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_3 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_3 and l_NestedPackagePublisherFlags_3:FindFirstChild(l_v9_2) then
            return l_NestedPackagePublisherFlags_3[l_v9_2].Value;
        else
            return l_v8_2;
        end;
    end;
end;
v7.LogTestsQuiet = v11;
v8 = nil or false;
v9 = "LogAnalytics";
local l_v9_3 = v9 --[[ copy: 7 -> 11 ]];
do
    local l_v8_3 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_4 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_4 and l_NestedPackagePublisherFlags_4:FindFirstChild(l_v9_3) then
            return l_NestedPackagePublisherFlags_4[l_v9_3].Value;
        else
            return l_v8_3;
        end;
    end;
end;
v7.LogAnalytics = v11;
v8 = nil or false;
v9 = "RunDeveloperFrameworkTests";
local l_v9_4 = v9 --[[ copy: 7 -> 12 ]];
do
    local l_v8_4 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_5 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_5 and l_NestedPackagePublisherFlags_5:FindFirstChild(l_v9_4) then
            return l_NestedPackagePublisherFlags_5[l_v9_4].Value;
        else
            return l_v8_4;
        end;
    end;
end;
v7.RunDeveloperFrameworkTests = v11;
v8 = (v7.RunTests() or v1) or false;
v9 = "EnableRoactConfigs";
do
    local l_v8_5 = v8;
    v11 = function()
        local l_NestedPackagePublisherFlags_6 = l_Workspace_0:FindFirstChild("NestedPackagePublisherFlags");
        if l_NestedPackagePublisherFlags_6 and l_NestedPackagePublisherFlags_6:FindFirstChild(v9) then
            return l_NestedPackagePublisherFlags_6[v9].Value;
        else
            return l_v8_5;
        end;
    end;
end;
v7.EnableRoactConfigs = v11;
return v7;


return function()
    if not require(script.Parent.DebugFlags).RunningUnderCLI() then
        if require(script.Parent.hasInternalPermission)() then
            if game:GetFastFlag("NestedPackagePublisherPlugin") then
                return true;
            else
                return false;
            end;
        else
            return false;
        end;
    else
        return false;
    end;
end;


game:DefineFastFlag("PathEditorRBXTelemetry", false);
game:DefineFastFlag("PathEditorSurfaceGui", false);
game:DefineFastFlag("PathEditorRotation", false);
game:DefineFastFlag("PathEditorHierarchyValidCheckFixes", false);
game:DefineFastFlag("PathEditorMaxControlPointDisableAdd", false);
game:DefineFastFlag("PathEditorUsePerformantAPICalls", false);
game:DefineFastFlag("PathEditorCustomBindings", false);
return nil;


require(script.Parent.defineLuaFlags);
if plugin then
    local l_Parent_0 = script.Parent.Parent;
    local v1 = require(l_Parent_0.Packages.TestLoader);
    v1.launch("PathEditor", l_Parent_0.Src);
    if not v1.isCli() then
        if require(l_Parent_0.Src.Util.shouldPluginRun)() then
            local v2 = require(l_Parent_0.Packages.React);
            local v3 = require(l_Parent_0.Packages.ReactRoblox);
            local v4 = require(l_Parent_0.Src.MainPlugin);
            local v5 = nil;
            local function v7()
                plugin.Name = l_Parent_0.Name;
                local v6 = v2.createElement(v4, {
                    Plugin = plugin
                });
                v5 = v3.createRoot(Instance.new("Frame"));
                v5:render(v6);
            end;
            plugin.Unloading:Connect(function()
                if v5 then
                    v5:render(nil);
                    v5 = nil;
                end;
            end);
            v7();
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
return require(l_Parent_0.Packages.Framework).Util.Action(script.Name, function(v2, v3)
    return {
        Index = v2,
        Side = v3
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Action_0 = require(l_Parent_0.Packages.Framework).Util.Action;
local _ = require(l_Parent_0.Src.Types);
return l_Action_0(script.Name, function(v3, v4)
    return {
        Index = v3,
        State = v4
    };
end);


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


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


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


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


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
return require(l_Parent_0.Packages.Framework).Util.Action(script.Name, function(v2)
    return {
        Side = v2
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
return require(l_Parent_0.Packages.Framework).Util.Action(script.Name, function(v2)
    return {
        SubMode = v2
    };
end);


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


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


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


if not game:GetFastFlag("PathEditorRotation") then
    local l_Parent_0 = script.Parent.Parent.Parent;
    local _ = require(l_Parent_0.Src.Types);
    local v2 = require(l_Parent_0.Packages.React);
    local v3 = require(l_Parent_0.Packages.RoactRodux);
    local v4 = require(l_Parent_0.Packages.Framework);
    local l_Actions_0 = l_Parent_0.Src.Actions;
    local v6 = require(l_Actions_0.SetIsDraggingPoint);
    local v7 = require(l_Actions_0.SetAddPointSubMode);
    local l_Thunks_0 = l_Parent_0.Src.Thunks;
    local v9 = require(l_Thunks_0.AddControlPoint);
    local v10 = require(l_Thunks_0.SetControlPointTangent);
    local v11 = require(l_Thunks_0.SelectControlPoint);
    local l_Components_0 = l_Parent_0.Src.Components;
    local v13 = require(l_Components_0.DraggablePoint);
    local v14 = require(l_Components_0.GuiShim);
    local v15 = require(l_Components_0.Line);
    local l_Image_0 = v4.UI.Image;
    local v17 = require(l_Parent_0.Src.Resources.Constants);
    local l_Util_0 = l_Parent_0.Src.Util;
    local v19 = require(l_Util_0.getAbsolutePosition);
    local v20 = require(l_Util_0.makeNewPath2DControlPoint);
    local v21 = require(l_Util_0.getSnapToControlPoint);
    local v22 = require(l_Util_0.getUDim2FromVector2);
    local v23 = require(l_Util_0.getUDim2OffsetFromScale);
    local v24 = require(l_Util_0.getPositionMatchesControlPoint);
    local v25 = require(l_Util_0.getPosOnCurveOffset);
    local v26 = require(l_Util_0.getClosestControlPointToPosition);
    local v27 = game:defineFastFlag("PathEditorInsertPointSnappingFix", false);
    local v28 = v2.Component:extend("AddPointComponent");
    v28.init = function(v29)
        v29.onDragAreaClicked = function(v30)
            local l_props_0 = v29.props;
            local v32 = v19(l_props_0.SelectedObject);
            local l_ParentAbsPos_0 = l_props_0.ParentAbsPos;
            local l_ParentAbsSize_0 = l_props_0.ParentAbsSize;
            local v35 = v22(v30 - v32);
            if l_props_0.AddPointSubMode == "Append" then
                l_props_0.dispatchAddControlPoint(v21(v35, l_props_0.ControlPoints, l_ParentAbsPos_0, l_ParentAbsSize_0), #l_props_0.ControlPoints + 1);
                return ;
            elseif l_props_0.AddPointSubMode == "Prepend" then
                l_props_0.dispatchAddControlPoint(v21(v35, l_props_0.ControlPoints, l_ParentAbsPos_0, l_ParentAbsSize_0), 1);
                return ;
            else
                local v36 = v24(v35, l_props_0.ControlPoints[1], l_ParentAbsPos_0, l_ParentAbsSize_0);
                local v37 = v24(v35, l_props_0.ControlPoints[#l_props_0.ControlPoints], l_ParentAbsPos_0, l_ParentAbsSize_0);
                if not v36 then
                    if not v37 then
                        if #l_props_0.ControlPoints > 1 then
                            local v38 = if not v27 then v26(l_props_0.SelectedObject, v30) else v26(l_props_0.SelectedObject, v30 - v32);
                            local v39 = v38[1] + 2;
                            local v40 = v38[2];
                            local v41 = v38[3];
                            if v40 ~= nil and v40 < v17.SnapToSegmentEpsilon then
                                l_props_0.dispatchAddControlPoint(v25(l_props_0.SelectedObject, v41) + (v22(l_ParentAbsPos_0) - v22(v32)), v39);
                            end;
                        end;
                        return ;
                    else
                        l_props_0.dispatchSetAddPointSubMode("Append");
                        return ;
                    end;
                else
                    l_props_0.dispatchSetAddPointSubMode("Prepend");
                    return ;
                end;
            end;
        end;
        v29.onDragAreaHoverMoved = function(v42)
            v29:setState({
                dragLocation = v42
            });
            local l_props_1 = v29.props;
            if (#l_props_1.ControlPoints > 0 and l_props_1.SelectedObject ~= nil) and l_props_1.AddPointSubMode == "Unselected" then
                local v44 = v22(v42 - v19(l_props_1.SelectedObject));
                if not v24(v44, l_props_1.ControlPoints[1], l_props_1.ParentAbsPos, l_props_1.ParentAbsSize) then
                    if not v24(v44, l_props_1.ControlPoints[#l_props_1.ControlPoints], l_props_1.ParentAbsPos, l_props_1.ParentAbsSize) then
                        if l_props_1.SelectedControlPointIndex ~= 0 then
                            l_props_1.dispatchSelectControlPoint(0);
                            v29:setState({
                                hoveringSelectablePoint = false
                            });
                        end;
                    else
                        l_props_1.dispatchSelectControlPoint(#l_props_1.ControlPoints);
                        v29:setState({
                            hoveringSelectablePoint = true
                        });
                        return ;
                    end;
                else
                    l_props_1.dispatchSelectControlPoint(1);
                    v29:setState({
                        hoveringSelectablePoint = true
                    });
                    return ;
                end;
            end;
        end;
        v29.onDragAreaDragged = function(_, v46)
            local l_props_2 = v29.props;
            local l_SelectedObject_0 = l_props_2.SelectedObject;
            local v49 = l_props_2.AddPointSubMode == "Append" and "Right" or "Left";
            if (#l_props_2.ControlPoints > 0 and l_SelectedObject_0 ~= nil) and l_props_2.AddPointSubMode ~= "Unselected" then
                l_props_2.dispatchSetControlPointTangent(l_SelectedObject_0.SelectedControlPoint, v49, v46, false, false);
            end;
        end;
        v29:setState({
            hoveringSelectablePoint = false
        });
    end;
    v28.render = function(v50)
        local l_props_3 = v50.props;
        local l_state_0 = v50.state;
        if not l_props_3.SelectedObject or l_props_3.Path2DToolMode ~= "AddPoint" then
            return nil;
        else
            local v53 = v19(l_props_3.SelectedObject);
            local v54 = #l_props_3.ControlPoints == 0;
            if #l_props_3.ControlPoints < 2 and l_props_3.AddPointSubMode ~= "Append" then
                l_props_3.dispatchSetAddPointSubMode("Append");
            end;
            local v55 = nil;
            local v56 = nil;
            if v54 or l_props_3.AddPointSubMode == "Unselected" then
                v55 = UDim2.new();
            else
                if l_props_3.AddPointSubMode == "Append" then
                    v56 = l_props_3.ControlPoints[#l_props_3.ControlPoints];
                elseif l_props_3.AddPointSubMode == "Prepend" then
                    v56 = l_props_3.ControlPoints[1];
                end;
                if v56 ~= nil and l_props_3.SelectedObject ~= nil then
                    v55 = v23(v56.Position, l_props_3.SelectedObject.Parent) + v22(v53);
                end;
            end;
            local v57 = if l_state_0.dragLocation ~= nil then v22(l_state_0.dragLocation) else UDim2.new();
            local v58 = (not l_props_3.ToolbarHovered and not l_props_3.IsDraggingPoint) and l_state_0.dragLocation ~= nil;
            local l_v58_0 = v58;
            if l_v58_0 then
                l_v58_0 = not v54;
                if l_v58_0 then
                    l_v58_0 = false;
                    if v56 ~= nil then
                        l_v58_0 = l_props_3.AddPointSubMode ~= "Unselected";
                    end;
                end;
            end;
            local v60 = false;
            if not (not (l_props_3.AddPointSubMode ~= "Unselected") or not v58) and l_props_3.SelectedObject ~= nil then
                v57 = v23(v21(v22(l_state_0.dragLocation - v53), l_props_3.ControlPoints, l_props_3.ParentAbsPos, l_props_3.ParentAbsSize) + v22(v53), l_props_3.SelectedObject.Parent);
                v60 = true;
            elseif (not (not (l_props_3.AddPointSubMode == "Unselected") or not v58) and #l_props_3.ControlPoints > 1) and l_props_3.SelectedObject ~= nil then
                local v61 = v19(l_props_3.SelectedObject.Parent);
                local v62 = if not v27 then v26(l_props_3.SelectedObject, l_state_0.dragLocation) else v26(l_props_3.SelectedObject, l_state_0.dragLocation - v61);
                local v63 = v62[2];
                local v64 = v62[3];
                if v63 ~= nil and v63 < v17.SnapToSegmentEpsilon then
                    v57 = v25(l_props_3.SelectedObject, v64) + v22(v61);
                    v60 = not l_state_0.hoveringSelectablePoint;
                end;
            end;
            local v65 = nil;
            if (l_v58_0 and v56 ~= nil) and l_props_3.SelectedObject ~= nil then
                local v66 = v23(if l_props_3.AddPointSubMode == "Append" then v56.RightTangent else v56.LeftTangent, l_props_3.SelectedObject.Parent);
                v65 = {
                    v20(v55, v66, v66),
                    v20(v57)
                };
            end;
            return v2.createElement(not game:GetFastFlag("PathEditorSurfaceGui") and "ScreenGui" or v14, {
                DisplayOrder = 3,
                ZIndexBehavior = Enum.ZIndexBehavior.Sibling
            }, {
                v2.createElement(v13, {
                    Style = "AddPoint",
                    Size = UDim2.fromScale(1, 1),
                    FollowCursorOnDrag = false,
                    OnSelected = v50.onDragAreaClicked,
                    OnDragStart = function(_)
                        l_props_3.dispatchSetIsDraggingPoint(true);
                    end,
                    OnDragMoved = v50.onDragAreaDragged,
                    OnDragEnd = function()
                        l_props_3.dispatchSetIsDraggingPoint(false);
                    end,
                    OnHoverMoved = v50.onDragAreaHoverMoved
                }, {
                    Line = if not l_v58_0 then nil else v2.createElement(v15, {
                        Color = if not l_props_3.SelectedObject then nil else l_props_3.SelectedObject.Color3,
                        Style = "Tangent",
                        Thickness = if not l_props_3.SelectedObject then nil else l_props_3.SelectedObject.Thickness,
                        ControlPoints = v65
                    }),
                    ControlPoint = if not v60 then nil else v2.createElement(l_Image_0, {
                        Style = "ControlPoint",
                        Position = v57,
                        ZIndex = 1
                    })
                })
            });
        end;
    end;
    return v3.connect(function(v68, _)
        return {
            Refreshed = v68.PathReducer.Refreshed,
            SelectedObject = v68.PathReducer.SelectedObject,
            ParentAbsPos = v68.PathReducer.ParentAbsPos,
            ParentAbsSize = v68.PathReducer.ParentAbsSize,
            Path2DToolMode = v68.PathReducer.Path2DToolMode,
            ControlPoints = v68.PathReducer.ControlPoints,
            ToolbarHovered = v68.PathReducer.ToolbarHovered,
            IsDraggingPoint = v68.PathReducer.IsDraggingPoint,
            AddPointSubMode = v68.PathReducer.AddPointSubMode
        };
    end, function(v70)
        return {
            dispatchAddControlPoint = function(v71, v72)
                v70(v9(v71, v72));
            end,
            dispatchSelectControlPoint = function(v73)
                v70(v11(v73));
            end,
            dispatchSetControlPointTangent = function(v74, v75, v76, v77, v78)
                v70(v10(v74, v75, v76, v77, v78));
            end,
            dispatchSetIsDraggingPoint = function(v79)
                v70(v6(v79));
            end,
            dispatchSetAddPointSubMode = function(v80)
                v70(v7(v80));
            end
        };
    end)(v28);
else
    local l_Parent_1 = script.Parent.Parent.Parent;
    local _ = require(l_Parent_1.Src.Types);
    local v83 = require(l_Parent_1.Packages.React);
    local v84 = require(l_Parent_1.Packages.RoactRodux);
    local v85 = require(l_Parent_1.Packages.Framework);
    local l_Actions_1 = l_Parent_1.Src.Actions;
    local v87 = require(l_Actions_1.SetIsDraggingPoint);
    local v88 = require(l_Actions_1.SetAddPointSubMode);
    local l_Thunks_1 = l_Parent_1.Src.Thunks;
    local v90 = require(l_Thunks_1.AddControlPoint);
    local v91 = require(l_Thunks_1.SetControlPointTangent);
    local v92 = require(l_Thunks_1.SelectControlPoint);
    local l_Components_1 = l_Parent_1.Src.Components;
    local v94 = require(l_Components_1.DraggablePoint);
    local v95 = require(l_Components_1.GuiShim);
    local v96 = require(l_Components_1.Line);
    local l_Image_1 = v85.UI.Image;
    local v98 = require(l_Parent_1.Src.Resources.Constants);
    local l_Util_1 = l_Parent_1.Src.Util;
    local v100 = require(l_Util_1.getClosestControlPointToPosition);
    local v101 = require(l_Util_1.getPositionMatchesControlPoint);
    local v102 = require(l_Util_1.getSnapToControlPoint);
    local v103 = require(l_Util_1.getUDim2FromVector2);
    local v104 = require(l_Util_1.makeNewPath2DControlPoint);
    local v105 = require(l_Util_1.getRelativePosFromAbsPos);
    local v106 = require(l_Util_1.getAbsPosFromRelative);
    local v107 = game:DefineFastFlag("PathEditorShowInsertDragTangents", false);
    local v108 = v83.Component:extend("AddPointComponent");
    v108.init = function(v109)
        v109.onDragAreaClicked = function(v110)
            if v109.props.SelectedObject == nil then
                return ;
            else
                local l_props_4 = v109.props;
                local l_Parent_2 = l_props_4.SelectedObject.Parent;
                v110 = v105(v110, l_Parent_2);
                if l_props_4.AddPointSubMode == "Append" then
                    l_props_4.dispatchAddControlPoint(v102(v110, l_props_4.ControlPoints, l_Parent_2), #l_props_4.ControlPoints + 1);
                    return ;
                elseif l_props_4.AddPointSubMode == "Prepend" then
                    l_props_4.dispatchAddControlPoint(v102(v110, l_props_4.ControlPoints, l_Parent_2), 1);
                    return ;
                else
                    local v113 = v101(v110, l_props_4.ControlPoints[1], l_Parent_2);
                    local v114 = v101(v110, l_props_4.ControlPoints[#l_props_4.ControlPoints], l_Parent_2);
                    if not v113 then
                        if not v114 then
                            if #l_props_4.ControlPoints > 1 then
                                local v115 = v100(l_props_4.SelectedObject, v110);
                                local v116 = v115[1] + 2;
                                local v117 = v115[2];
                                local v118 = v115[3];
                                if v117 ~= nil and v117 < v98.SnapToSegmentEpsilon then
                                    l_props_4.dispatchAddControlPoint(l_props_4.SelectedObject:GetPositionOnCurve(v118), if not v107 then v116 else math.floor(v116));
                                end;
                            end;
                            return ;
                        else
                            l_props_4.dispatchSetAddPointSubMode("Append");
                            return ;
                        end;
                    else
                        l_props_4.dispatchSetAddPointSubMode("Prepend");
                        return ;
                    end;
                end;
            end;
        end;
        v109.onDragAreaHoverMoved = function(v119, v120)
            if v120 or v109.props.SelectedObject == nil then
                return ;
            else
                local l_props_5 = v109.props;
                local l_Parent_3 = l_props_5.SelectedObject.Parent;
                local v123 = v105(v119, l_Parent_3);
                v109:setState({
                    dragLocationAbs = v119,
                    dragLocationRelative = v123
                });
                if (#l_props_5.ControlPoints > 0 and l_props_5.SelectedObject ~= nil) and l_props_5.AddPointSubMode == "Unselected" then
                    if not v101(v123, l_props_5.ControlPoints[1], l_Parent_3) then
                        if not v101(v123, l_props_5.ControlPoints[#l_props_5.ControlPoints], l_Parent_3) then
                            if l_props_5.SelectedControlPointIndex ~= 0 then
                                l_props_5.dispatchSelectControlPoint(0);
                                v109:setState({
                                    hoveringSelectablePoint = false
                                });
                            end;
                        else
                            l_props_5.dispatchSelectControlPoint(#l_props_5.ControlPoints);
                            v109:setState({
                                hoveringSelectablePoint = true
                            });
                            return ;
                        end;
                    else
                        l_props_5.dispatchSelectControlPoint(1);
                        v109:setState({
                            hoveringSelectablePoint = true
                        });
                        return ;
                    end;
                end;
                return ;
            end;
        end;
        v109.onDragAreaDragged = function(_, v125)
            if v109.props.SelectedObject == nil then
                return ;
            else
                local l_props_6 = v109.props;
                local l_SelectedObject_1 = l_props_6.SelectedObject;
                local v128 = l_props_6.AddPointSubMode == "Append" and "Right" or "Left";
                if (#l_props_6.ControlPoints > 0 and l_SelectedObject_1 ~= nil) and (not (l_props_6.AddPointSubMode == "Unselected") or l_props_6.SelectedControlPointIndex ~= 0) then
                    l_props_6.dispatchSetControlPointTangent(l_SelectedObject_1.SelectedControlPoint, v128, v125, false, false);
                end;
                return ;
            end;
        end;
        v109:setState({
            hoveringSelectablePoint = false
        });
    end;
    v108.render = function(v129)
        local l_props_7 = v129.props;
        local l_state_1 = v129.state;
        if l_props_7.SelectedObject == nil then
            return nil;
        else
            local l_SelectedObject_2 = l_props_7.SelectedObject;
            if not (l_props_7.Path2DToolMode == "AddPoint") or l_SelectedObject_2.Parent == nil then
                return nil;
            else
                local l_Parent_4 = l_SelectedObject_2.Parent;
                local v134 = #l_props_7.ControlPoints == 0;
                if #l_props_7.ControlPoints < 2 and l_props_7.AddPointSubMode ~= "Append" then
                    l_props_7.dispatchSetAddPointSubMode("Append");
                end;
                local v135 = nil;
                local v136 = nil;
                if v134 or l_props_7.AddPointSubMode == "Unselected" then
                    v135 = UDim2.new();
                else
                    if l_props_7.AddPointSubMode == "Append" then
                        v136 = l_props_7.ControlPoints[#l_props_7.ControlPoints];
                    elseif l_props_7.AddPointSubMode == "Prepend" then
                        v136 = l_props_7.ControlPoints[1];
                    end;
                    if v136 ~= nil then
                        v135 = v103(v106(v136.Position, l_Parent_4), l_Parent_4);
                    end;
                end;
                local v137 = if l_state_1.dragLocationAbs ~= nil then v103(l_state_1.dragLocationAbs) else UDim2.new();
                local v138 = (not l_props_7.ToolbarHovered and not l_props_7.IsDraggingPoint) and l_state_1.dragLocationAbs ~= nil;
                local l_v138_0 = v138;
                if l_v138_0 then
                    l_v138_0 = not v134;
                    if l_v138_0 then
                        l_v138_0 = false;
                        if v136 ~= nil then
                            l_v138_0 = l_props_7.AddPointSubMode ~= "Unselected";
                        end;
                    end;
                end;
                local v140 = false;
                if not (l_props_7.AddPointSubMode ~= "Unselected") or not v138 then
                    if not (not (l_props_7.AddPointSubMode == "Unselected") or not v138) and #l_props_7.ControlPoints > 1 then
                        local v141 = v100(l_SelectedObject_2, l_state_1.dragLocationRelative);
                        local v142 = v141[2];
                        local v143 = v141[3];
                        if v142 ~= nil and v142 < v98.SnapToSegmentEpsilon then
                            v137 = v103(v106(l_SelectedObject_2:GetPositionOnCurve(v143), l_Parent_4));
                            v140 = not l_state_1.hoveringSelectablePoint;
                        end;
                    end;
                else
                    v137 = v103(v106(v102(l_state_1.dragLocationRelative, l_props_7.ControlPoints, l_Parent_4), l_Parent_4), l_Parent_4);
                    v140 = true;
                end;
                local v144 = nil;
                if (l_v138_0 and v136 ~= nil) and l_SelectedObject_2 ~= nil then
                    local v145 = if l_props_7.AddPointSubMode == "Append" then v136.RightTangent else v136.LeftTangent;
                    v144 = {
                        v104(v135, v145, v145),
                        v104(v137)
                    };
                end;
                return v83.createElement(not game:GetFastFlag("PathEditorSurfaceGui") and "ScreenGui" or v95, {
                    DisplayOrder = 3,
                    ZIndexBehavior = Enum.ZIndexBehavior.Sibling
                }, {
                    v83.createElement(v94, {
                        Style = "AddPoint",
                        Size = UDim2.fromScale(1, 1),
                        FollowCursorOnDrag = false,
                        OnSelected = v129.onDragAreaClicked,
                        OnDragStart = function(_)
                            l_props_7.dispatchSetIsDraggingPoint(true);
                        end,
                        OnDragMoved = v129.onDragAreaDragged,
                        OnDragEnd = function()
                            l_props_7.dispatchSetIsDraggingPoint(false);
                        end,
                        OnHoverMoved = v129.onDragAreaHoverMoved
                    }, {
                        Line = if not l_v138_0 then nil else v83.createElement(v96, {
                            Color = l_SelectedObject_2.Color3,
                            Style = "Tangent",
                            Thickness = l_SelectedObject_2.Thickness,
                            ControlPoints = v144
                        }),
                        ControlPoint = if not v140 then nil else v83.createElement(l_Image_1, {
                            Style = "ControlPoint",
                            Position = v137,
                            ZIndex = 1
                        })
                    })
                });
            end;
        end;
    end;
    return v84.connect(function(v147, _)
        return {
            Refreshed = v147.PathReducer.Refreshed,
            SelectedObject = v147.PathReducer.SelectedObject,
            ParentAbsPos = v147.PathReducer.ParentAbsPos,
            ParentAbsSize = v147.PathReducer.ParentAbsSize,
            ParentAbsRotation = v147.PathReducer.ParentAbsRotation,
            Path2DToolMode = v147.PathReducer.Path2DToolMode,
            ControlPoints = v147.PathReducer.ControlPoints,
            ToolbarHovered = v147.PathReducer.ToolbarHovered,
            IsDraggingPoint = v147.PathReducer.IsDraggingPoint,
            AddPointSubMode = v147.PathReducer.AddPointSubMode,
            SelectedControlPointIndex = v147.PathReducer.SelectedControlPointIndex
        };
    end, function(v149)
        return {
            dispatchAddControlPoint = function(v150, v151)
                v149(v90(v150, v151));
            end,
            dispatchSelectControlPoint = function(v152)
                v149(v92(v152));
            end,
            dispatchSetControlPointTangent = function(v153, v154, v155, v156, v157)
                v149(v91(v153, v154, v155, v156, v157));
            end,
            dispatchSetIsDraggingPoint = function(v158)
                v149(v87(v158));
            end,
            dispatchSetAddPointSubMode = function(v159)
                v149(v88(v159));
            end
        };
    end)(v108);
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
local v2 = require(l_Parent_0.Packages.React);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Actions_0 = l_Parent_0.Src.Actions;
local v9 = require(l_Actions_0.DeselectControlPoint);
local v10 = require(l_Actions_0.LockSelectedControlPoint);
local v11 = require(l_Actions_0.SelectTangentSide);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v13 = require(l_Thunks_0.OnControlPointDoubleClicked);
local v14 = require(l_Thunks_0.OnControlPointDragged);
local v15 = require(l_Thunks_0.OpenContextMenu);
local v16 = require(l_Thunks_0.RecordChangeHistory);
local v17 = require(l_Thunks_0.RemoveControlPoint);
local v18 = require(l_Thunks_0.SelectControlPoint);
local _ = require(l_Thunks_0.SetControlPointTangent);
local _ = require(l_Parent_0.Src.Resources.Constants);
local l_Util_0 = l_Parent_0.Src.Util;
local v22 = require(l_Util_0.getAbsolutePosition);
local v23 = require(l_Util_0.getAbsPosFromRelative);
local v24 = require(l_Util_0.getAbsPosFromUDim2);
local v25 = require(l_Util_0.getTangentNameForSide);
local v26 = require(l_Util_0.getVector2FromUDim2Scale);
local v27 = require(l_Util_0.makeNewPath2DControlPoint);
local v28 = require(l_Util_0.rotatePoint);
local l_Components_0 = l_Parent_0.Src.Components;
local v30 = require(l_Components_0.DraggablePoint);
local v31 = require(l_Components_0.Line);
local v32 = require(l_Components_0.TangentPoint);
local l_PathEditorRotation_0 = game:GetFastFlag("PathEditorRotation");
local v34 = v2.Component:extend("ControlPoint");
v34.init = function(v35)
    v35.tangentPoints = {};
end;
v34.renderTangent = function(v36, v37, v38)
    local l_props_0 = v36.props;
    if v37 ~= "Left" and v37 ~= "Right" then
        error("invalid tangent side: " .. v37);
        return ;
    elseif l_props_0.showTangents or l_props_0.showTangentsPhantom then
        local l_showTangentsPhantom_0 = l_props_0.showTangentsPhantom;
        local v41 = v25(v37);
        local v42 = nil;
        v42 = if not l_PathEditorRotation_0 then v26(l_props_0.point[v41], l_props_0.SelectedObject.Parent) else v28(v26(l_props_0.point[v41], l_props_0.SelectedObject.Parent), Vector2.new(), l_props_0.ParentAbsRotation);
        if v42 == Vector2.zero then
            return nil;
        else
            local _ = #l_props_0.ControlPoints;
            return v2.createElement(v2.Fragment, {}, {
                [v41 .. "Point"] = v2.createElement(v32, {
                    index = l_props_0.index,
                    absolutePosition = v38 + v42,
                    position = v42,
                    side = v37,
                    isPhantom = l_showTangentsPhantom_0,
                    Disabled = l_props_0.Disabled
                }),
                [v41 .. "Line"] = v2.createElement(v31, {
                    ZIndex = -1,
                    Style = not l_showTangentsPhantom_0 and "Tangent" or "PhantomTangent",
                    Position = UDim2.fromOffset(v38.X, v38.Y),
                    ControlPoints = {
                        v27(UDim2.new(), UDim2.new(), UDim2.new()),
                        v27(UDim2.fromOffset(v42.X, v42.Y), UDim2.new(), UDim2.new())
                    }
                })
            });
        end;
    else
        return nil;
    end;
end;
v34.render = function(v44)
    local l_props_1 = v44.props;
    local _ = v44.state;
    local v47 = nil;
    v47 = if not l_PathEditorRotation_0 then v24(l_props_1.point.Position, v22(l_props_1.SelectedObject), l_props_1.ParentAbsSize) else v23(l_props_1.point.Position, l_props_1.SelectedObject.Parent);
    local v48 = "ControlPoint";
    if ((l_props_1.Path2DToolMode == "AddPoint" and l_props_1.AddPointSubMode == "Unselected") and l_props_1.index ~= 1) and l_props_1.index ~= #l_props_1.ControlPoints then
        v48 = "PhantomControlPoint";
    end;
    return v2.createElement(v2.Fragment, {}, {
        Point = v2.createElement(v30, {
            ZIndex = if not l_props_1.LockSelectedControlPoint then l_props_1.DeselectedControlPointIndex == l_props_1.index and -1 or 0 else 1,
            AbsolutePosition = v47,
            Style = v48,
            IsSelected = l_props_1.isSelected,
            FollowCursorOnDrag = false,
            Disabled = l_props_1.Disabled,
            OnDoubleClicked = function()
                l_props_1.dispatchOnControlPointDoubleClicked(l_props_1.index);
            end,
            OnSelected = function()
                l_props_1.dispatchSelectControlPoint(l_props_1.index);
            end,
            OnDeselected = function()
                l_props_1.dispatchSelectControlPoint(0);
            end,
            OnDragStart = function()
                l_props_1.dispatchRecordChangeHistory("Move Control Point");
                l_props_1.dispatchLockSelectedControlPoint(true);
                if l_props_1.Path2DToolMode == "AddTangent" then
                    local l_ControlPoints_0 = l_props_1.ControlPoints;
                    local v50 = l_props_1.index == #l_ControlPoints_0 and "Left" or "Right";
                    local v51 = v50 == "Right" and "Left" or "Right";
                    local v52 = l_ControlPoints_0[l_props_1.index];
                    local v53 = v25(v50);
                    local v54 = v25(v51);
                    local v55 = if v52[v53] ~= nil then v52[v53] else UDim2.new();
                    local v56 = if v52[v54] ~= nil then v52[v54] else UDim2.new();
                    if v55 == UDim2.new() and v56 == UDim2.new() then
                        v50 = v51;
                    end;
                    l_props_1.dispatchSelectControlPoint(l_props_1.index);
                    l_props_1.dispatchSelectTangentSide(v50);
                end;
            end,
            OnDragMoved = function(v57, v58)
                l_props_1.dispatchOnControlPointDragged(l_props_1.index, v57, v58);
            end,
            OnDragEnd = function(_, _)
                l_props_1.dispatchLockSelectedControlPoint(false);
                l_props_1.dispatchRecordChangeHistory();
            end,
            OnRightClicked = function()
                l_props_1.dispatchSelectControlPoint(l_props_1.index);
                l_props_1.dispatchOpenContextMenu(l_props_1.PluginContext, l_props_1.Localization);
            end
        }),
        LeftTangent = v44:renderTangent("Left", v47),
        RightTangent = v44:renderTangent("Right", v47)
    });
end;
return v3.connect(function(v61, _)
    return {
        Path2DToolMode = v61.PathReducer.Path2DToolMode,
        AddPointSubMode = v61.PathReducer.AddPointSubMode,
        ControlPoints = v61.PathReducer.ControlPoints,
        SelectedObject = v61.PathReducer.SelectedObject,
        ParentAbsPos = v61.PathReducer.ParentAbsPos,
        ParentAbsSize = v61.PathReducer.ParentAbsSize,
        ParentAbsRotation = v61.PathReducer.ParentAbsRotation,
        LockSelectedControlPoint = v61.PathReducer.LockSelectedControlPoint,
        DeselectedControlPointIndex = v61.PathReducer.DeselectedControlPointIndex
    };
end, function(v63)
    return {
        dispatchOnControlPointDragged = function(v64, v65, v66)
            v63(v14(v64, v65, v66));
        end,
        dispatchOnControlPointDoubleClicked = function(v67)
            v63(v13(v67));
        end,
        dispatchRemoveControlPoint = function(v68)
            v63(v17(v68));
        end,
        dispatchSelectControlPoint = function(v69)
            v63(v18(v69));
            v63(v11(nil));
        end,
        dispatchDeselectControlPoint = function()
            v63(v9());
        end,
        dispatchSelectTangentSide = function(v70)
            v63(v11(v70));
        end,
        dispatchLockSelectedControlPoint = function(v71)
            v63(v10(v71));
        end,
        dispatchOpenContextMenu = function(v72, v73)
            v63(v15(v72, v73));
        end,
        dispatchRecordChangeHistory = function(v74)
            v63(v16(v74));
        end
    };
end)((l_withContext_0({
    PluginContext = l_Plugin_0,
    Localization = l_Localization_0
})(v34)));


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
local v2 = require(l_Parent_0.Packages.React);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_withContext_0 = require(l_Parent_0.Packages.Framework).ContextServices.withContext;
local v5 = require(l_Parent_0.Src.Thunks.AddControlPoint);
local l_Components_0 = l_Parent_0.Src.Components;
local v7 = require(l_Components_0.ControlPoint);
local v8 = require(l_Components_0.GuiShim);
local v9 = v2.PureComponent:extend("ControlPointEditGui");
v9.render = function(v10)
    local l_props_0 = v10.props;
    local v12 = {};
    if not (l_props_0.SelectedObject and l_props_0.Path2DToolMode ~= "DoneEditing") or l_props_0.Path2DToolMode == "AddPoint" then
        return nil;
    else
        for v13, v14 in pairs(l_props_0.ControlPoints) do
            local v15 = l_props_0.SelectedControlPointIndex == v13;
            local v16 = false;
            if l_props_0.SelectedControlPointIndex > 0 then
                v16 = l_props_0.SelectedControlPointIndex <= #l_props_0.ControlPoints;
            end;
            local l_v16_0 = v16;
            if l_v16_0 then
                l_v16_0 = true;
                if l_props_0.SelectedControlPointIndex - 1 ~= v13 then
                    l_v16_0 = l_props_0.SelectedControlPointIndex + 1 == v13;
                end;
            end;
            v12[v13] = v2.createElement(v7, {
                index = v13,
                point = v14,
                showTangents = v15,
                showTangentsPhantom = l_v16_0,
                isSelected = l_props_0.SelectedControlPointIndex == v13
            });
        end;
        return v2.createElement(not game:GetFastFlag("PathEditorSurfaceGui") and "ScreenGui" or v8, {
            DisplayOrder = 2,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling
        }, v12);
    end;
end;
return v3.connect(function(v18, _)
    return {
        Refreshed = v18.PathReducer.Refreshed,
        SelectedObject = v18.PathReducer.SelectedObject,
        Path2DToolMode = v18.PathReducer.Path2DToolMode,
        ControlPoints = v18.PathReducer.ControlPoints,
        SelectedControlPointIndex = v18.PathReducer.SelectedControlPointIndex
    };
end, function(v20)
    return {
        dispatchAddControlPoint = function(v21)
            v20(v5(v21));
        end
    };
end)((l_withContext_0({})(v9)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.React);
local v2 = require(l_Parent_0.Packages.Framework);
local v3 = require(l_Parent_0.Packages.Dash);
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local _ = v2.Util.StyleModifier;
local _ = require(l_Parent_0.Src.Resources.MakeTheme);
return function(v7)
    local v8 = l_Stylizer_0:use("ControlPointVisual");
    local l_StyleModifier_1 = v7.StyleModifier;
    if v7.Style ~= nil and v8[v7.Style] ~= nil then
        v8 = v3.join(v8, v8[v7.Style]);
    end;
    if l_StyleModifier_1 ~= nil and v8[l_StyleModifier_1] ~= nil then
        v8 = v3.join(v8, v8[l_StyleModifier_1]);
    end;
    return v1.createElement("Frame", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        Position = UDim2.fromScale(0.5, 0.5),
        Size = v8.PointSize,
        BackgroundColor3 = v8.BackgroundColor3,
        Rotation = not v8.Rotation and 0 or v8.Rotation
    }, {
        Corner = v1.createElement("UICorner", {
            CornerRadius = v8.CornerRadius
        }),
        Stroke = v1.createElement("UIStroke", {
            Color = v8.StrokeColor,
            Thickness = v8.StrokeWidth,
            LineJoinMode = v8.LineJoinMode
        })
    });
end;


local l_UserInputService_0 = game:GetService("UserInputService");
local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
local v3 = require(l_Parent_0.Packages.React);
local v4 = require(l_Parent_0.Packages.RoactRodux);
local v5 = require(l_Parent_0.Packages.Framework);
local v6 = require(l_Parent_0.Packages.Dash);
local l_withContext_0 = v5.ContextServices.withContext;
local l_Stylizer_0 = v5.Style.Stylizer;
local v9 = require(l_Parent_0.Src.Thunks.MapScreenToSurfacePos);
local l_Util_0 = v5.Util;
local l_DoubleClickDetector_0 = l_Util_0.DoubleClickDetector;
local l_prioritize_0 = l_Util_0.prioritize;
local l_StyleModifier_0 = l_Util_0.StyleModifier;
local v14 = require(l_Parent_0.Src.Resources.Constants);
local l_Components_0 = l_Parent_0.Src.Components;
local v16 = require(l_Components_0.SignalListener);
local v17 = require(l_Components_0.ControlPointVisual);
local v18 = game:DefineFastFlag("PathEditorControlPointVisualImprovements2", false);
local l_PathEditorRotation_0 = game:GetFastFlag("PathEditorRotation");
local v20 = game:DefineFastFlag("PathEditorSurfaceGuiInput", false);
local v21 = v3.Component:extend("DraggablePoint");
v21.defaultProps = {
    Style = "ControlPoint",
    ZIndex = 0,
    AbsolutePosition = Vector2.new(0, 0),
    FollowCursorOnDrag = true,
    OnSelected = function()
    end,
    OnMouse1Down = function()
    end,
    OnHover = function()
    end,
    OnHoverMoved = nil,
    OnHoverEnd = function()
    end,
    OnDeselected = function()
    end,
    OnDragStart = function()
    end,
    OnDragMoved = function()
    end,
    OnDragEnd = function()
    end,
    OnDoubleClicked = function()
    end,
    OnRightClicked = function()
    end
};
v21.init = function(v22)
    v22.state = {
        isHovered = false,
        isDragging = false,
        isDragStarting = false,
        mouseStart = Vector2.zero,
        mousePos = Vector2.zero,
        mouseOffset = Vector2.zero
    };
    v22.DoubleClickDetector = l_DoubleClickDetector_0.new();
    v22.onMouseEnter = function()
        local l_props_0 = v22.props;
        local l_state_0 = v22.state;
        if not l_state_0.isDragging and not l_state_0.isDragStarting then
            v22:setState({
                isHovered = true
            });
            l_props_0.OnHover();
            return ;
        else
            return ;
        end;
    end;
    v22.onMouseLeave = function()
        local l_props_1 = v22.props;
        local l_state_1 = v22.state;
        if not l_state_1.isDragging and not l_state_1.isDragStarting then
            v22:setState({
                isHovered = false
            });
            l_props_1.OnHoverEnd();
            return ;
        else
            return ;
        end;
    end;
    v22.onInputBegan = function(_, v28)
        local l_props_2 = v22.props;
        local l_state_2 = v22.state;
        local v31 = if not l_state_2.isDragging then l_props_2.AbsolutePosition else l_state_2.mousePos + l_state_2.mouseOffset;
        if v28.UserInputType == Enum.UserInputType.MouseButton1 then
            if not l_state_2.isDragging and not l_state_2.isDragStarting then
                v28.UserInputState = Enum.UserInputState.Cancel;
                if not v22.DoubleClickDetector:isDoubleClick() then
                    local v32 = Vector2.new(v28.Position.X, v28.Position.Y);
                    v22:setState({
                        isDragStarting = true,
                        mouseStart = v32,
                        mouseOffset = v31 - v32,
                        mousePos = v32
                    });
                    l_props_2.OnSelected(v32);
                    return ;
                else
                    l_props_2.OnDoubleClicked();
                    return ;
                end;
            else
                return ;
            end;
        elseif v28.UserInputType == Enum.UserInputType.MouseButton2 then
            l_props_2.OnRightClicked();
            v28.UserInputState = Enum.UserInputState.Cancel;
            return ;
        else
            v22:setState({
                mousePos = Vector2.new(v28.Position.X, v28.Position.Y)
            });
            return ;
        end;
    end;
    v22.onInputEnded = function(_, v34)
        local l_props_3 = v22.props;
        local l_state_3 = v22.state;
        local v37 = if not l_state_3.isDragging then l_props_3.AbsolutePosition else l_state_3.mousePos + l_state_3.mouseOffset;
        if v34.UserInputType == Enum.UserInputType.MouseButton1 then
            if l_state_3.isDragging or l_state_3.isDragStarting then
                local _ = Vector2.new(v34.Position.X, v34.Position.Y);
                v22:setState({
                    isDragging = false,
                    isDragStarting = false,
                    mouseStart = Vector2.zero,
                    mouseOffset = Vector2.zero,
                    mousePos = Vector2.zero
                });
                l_props_3.OnDragEnd(l_props_3.AbsolutePosition, v37);
            else
                return ;
            end;
        end;
    end;
    v22.onInputChanged = function(v39)
        local l_props_4 = v22.props;
        local l_state_4 = v22.state;
        if v39.UserInputType == Enum.UserInputType.MouseMovement then
            local v42 = if not v20 then Vector2.new(v39.Position.X, v39.Position.Y) else l_props_4.dispatchMapScreenToSurfacePos(Vector2.new(v39.Position.X, v39.Position.Y));
            if v42 == nil then
                return ;
            else
                v22:setState({
                    mousePos = v42
                });
                if l_props_4.OnHoverMoved then
                    if not l_PathEditorRotation_0 then
                        l_props_4.OnHoverMoved(v42, false);
                    else
                        l_props_4.OnHoverMoved(v42, l_state_4.isDragging or l_state_4.isDragStarting);
                        return ;
                    end;
                end;
            end;
        end;
    end;
end;
v21.didUpdate = function(v43)
    local l_props_5 = v43.props;
    local l_state_5 = v43.state;
    if l_state_5.isDragStarting and v14.DragEpsilon < (l_state_5.mouseStart - l_state_5.mousePos).Magnitude then
        l_props_5.OnDragStart(l_state_5.mousePos);
        v43:setState({
            isDragStarting = false,
            isDragging = true
        });
    end;
end;
v21.render = function(v46)
    local l_props_6 = v46.props;
    local l_state_6 = v46.state;
    local l_Stylizer_1 = v46.props.Stylizer;
    local v50 = if not l_state_6.isDragging then if l_props_6.IsSelected then l_StyleModifier_0.Selected else if l_state_6.isHovered then l_StyleModifier_0.Hover else nil else l_StyleModifier_0.Selected;
    if v50 ~= nil and l_Stylizer_1[v50] ~= nil then
        l_Stylizer_1 = v6.join(l_Stylizer_1, l_Stylizer_1[v50]);
    end;
    local v51 = l_prioritize_0(l_Stylizer_1.Disabled, l_props_6.Disabled);
    local l_BackgroundColor_0 = l_Stylizer_1.BackgroundColor;
    local l_AbsolutePosition_0 = l_props_6.AbsolutePosition;
    local l_BackgroundImage_0 = l_Stylizer_1.BackgroundImage;
    local v55 = l_prioritize_0(l_props_6.AbsoluteSize, l_Stylizer_1.PointSize);
    local v56 = l_prioritize_0(l_props_6.Size, UDim2.fromOffset(v55.X, v55.Y));
    local l_StrokeWidth_0 = l_Stylizer_1.StrokeWidth;
    local _ = l_StrokeWidth_0 ~= nil;
    if l_props_6.IsSelected and l_Stylizer_1.SelectedColor ~= nil then
        l_BackgroundColor_0 = l_Stylizer_1.SelectedColor;
    end;
    if l_state_6.isDragging then
        if l_Stylizer_1.DragColor ~= nil then
            l_BackgroundColor_0 = l_Stylizer_1.DragColor;
        end;
        local v59 = l_state_6.mousePos + l_state_6.mouseOffset;
        if l_props_6.FollowCursorOnDrag then
            l_AbsolutePosition_0 = v59;
        end;
        l_props_6.OnDragMoved(l_props_6.AbsolutePosition, v59);
    end;
    local v60 = {};
    if l_props_6.children ~= nil then
        v60 = l_props_6.children;
    end;
    if l_StrokeWidth_0 ~= nil then
        table.insert(v60, v3.createElement("Frame", {
            BackgroundTransparency = 1,
            Size = v56
        }, {
            v3.createElement("UIStroke", {
                Thickness = l_Stylizer_1.StrokeWidth,
                Color = l_Stylizer_1.StrokeColor
            })
        }));
    end;
    local l_Padding_0 = l_Stylizer_1.Padding;
    local l_v56_0 = v56;
    local v63 = UDim2.new(0, l_AbsolutePosition_0.X, 0, l_AbsolutePosition_0.Y);
    if l_Padding_0 ~= nil then
        l_v56_0 = v56 - UDim2.fromOffset(l_Padding_0, l_Padding_0);
    end;
    if not (not v18 or not l_Stylizer_1.HasControlPointVisual) then
        l_BackgroundImage_0 = nil;
        table.insert(v60, v3.createElement(v17, {
            Style = l_props_6.Style,
            StyleModifier = v50
        }));
    end;
    if not (not (l_BackgroundImage_0 ~= nil) or v51) then
        table.insert(v60, v3.createElement("ImageLabel", {
            AnchorPoint = Vector2.new(0.5, 0.5),
            Position = UDim2.fromScale(0.5, 0.5),
            Size = l_v56_0,
            Image = l_BackgroundImage_0,
            BackgroundTransparency = l_Stylizer_1.BackgroundTransparency,
            ImageTransparency = l_Stylizer_1.ImageTransparency,
            ScaleType = Enum.ScaleType.Crop
        }));
    end;
    local _ = nil;
    if not v51 then
        return (v3.createElement(v3.Fragment, {}, {
            Point = v3.createElement("ImageButton", {
                AnchorPoint = l_Stylizer_1.AnchorPoint,
                Position = v63,
                Size = v56,
                BackgroundColor3 = l_BackgroundColor_0,
                Active = true,
                ZIndex = l_props_6.ZIndex,
                BackgroundTransparency = l_Stylizer_1.BackgroundTransparency,
                [v3.Event.MouseEnter] = v46.onMouseEnter,
                [v3.Event.MouseLeave] = v46.onMouseLeave,
                [v3.Event.InputBegan] = v46.onInputBegan,
                [v3.Event.InputEnded] = v46.onInputEnded
            }, v60),
            InputListener = ((l_state_6.isDragging or l_state_6.isDragStarting) or l_props_6.OnHoverMoved) and v3.createElement(v16, {
                signal = l_UserInputService_0.InputChanged,
                callback = v46.onInputChanged
            })
        }));
    elseif l_BackgroundImage_0 then
        return (v3.createElement("ImageLabel", {
            AnchorPoint = l_Stylizer_1.AnchorPoint,
            Position = v63,
            Size = l_v56_0 or v56,
            BackgroundColor3 = l_BackgroundColor_0,
            Image = l_BackgroundImage_0,
            Active = true,
            ZIndex = l_props_6.ZIndex,
            BackgroundTransparency = l_Stylizer_1.BackgroundTransparency,
            ImageTransparency = l_Stylizer_1.ImageTransparency,
            ScaleType = Enum.ScaleType.Crop
        }, v60));
    else
        return (v3.createElement("Frame", {
            AnchorPoint = l_Stylizer_1.AnchorPoint,
            Position = v63,
            Size = v56,
            BackgroundColor3 = l_BackgroundColor_0,
            Active = true,
            ZIndex = l_props_6.ZIndex,
            BackgroundTransparency = if not v18 then nil else l_Stylizer_1.BackgroundTransparency
        }, v60));
    end;
end;
v21 = l_withContext_0({
    Stylizer = l_Stylizer_0
})(v21);
if not v20 then
    return v21;
else
    return v4.connect(nil, function(v65)
        return {
            dispatchMapScreenToSurfacePos = function(v66)
                return v65(v9(v66));
            end
        };
    end)(v21);
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
local v2 = require(l_Parent_0.Packages.React);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_PathEditorRotation_0 = game:GetFastFlag("PathEditorRotation");
return v3.connect(function(v5, _)
    return {
        SelectedObjectGui = v5.PathReducer.SelectedObjectGui
    };
end)(function(v7)
    if v7.SelectedObjectGui == nil then
        return nil;
    else
        local v8 = nil;
        if not v7.SelectedObjectGui:IsA("ScreenGui") then
            if v7.SelectedObjectGui:IsA("SurfaceGui") then
                v8 = v2.createElement("SurfaceGui", {
                    ZIndexBehavior = v7.ZIndexBehavior,
                    ZOffset = if not l_PathEditorRotation_0 then v7.SelectedObjectGui.ZOffset + (not v7.DisplayOrder and 0 or v7.DisplayOrder) else nil,
                    AlwaysOnTop = true,
                    Face = v7.SelectedObjectGui.Face,
                    SizingMode = if not l_PathEditorRotation_0 then nil else v7.SelectedObjectGui.SizingMode,
                    PixelsPerStud = if not l_PathEditorRotation_0 then nil else v7.SelectedObjectGui.PixelsPerStud,
                    CanvasSize = if not l_PathEditorRotation_0 then nil else v7.SelectedObjectGui.CanvasSize,
                    Adornee = if not v7.SelectedObjectGui.Adornee then v7.SelectedObjectGui.Parent else v7.SelectedObjectGui.Adornee
                }, v7.children);
            end;
            return v8;
        else
            return (v2.createElement("ScreenGui", {
                ZIndexBehavior = v7.ZIndexBehavior,
                DisplayOrder = v7.DisplayOrder
            }, v7.children));
        end;
    end;
end);