local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useState_0 = v2.useState;
local l_Pane_0 = require(l_script_FirstAncestor_0.Packages.Framework).UI.Pane;
local v6 = require(l_Parent_0.CurveRenderer.useCurve);
local v7 = require(l_Parent_0.CurveRenderer.CurvePlot);
local v8 = require(l_Parent_0.KeypointControls);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v10 = require(l_script_FirstAncestor_0.Src.Util.SerializationUtil);
local v11 = Vector2.new(540, 300);
local v12 = Vector2.new(2000, 2000);
return function(v13)
    local v14, v15 = l_useState_0(Vector2.one);
    local v16 = v6(v10.tableToCurve(v13.CurveData));
    local v18 = l_useCallback_0(function(v17)
        if v17 then
            v15(v17.AbsoluteSize);
        end;
    end, {});
    local v21 = l_useCallback_0(function()
        v16.save(function(v19)
            local v20 = v10.curveToTable(v19);
            if v20 ~= v13.CurveData then
                v13.OnChanged(v20);
            end;
        end);
    end, {
        v13.CurveData,
        v13.OnChanged,
        v16
    });
    return v13.Enabled and v2.createElement(l_Pane_0, {
        [v2.Tag] = "X-Pad X-ColumnM X-FitY"
    }, {
        UISizeConstraint = v2.createElement("UISizeConstraint", {
            MinSize = v11,
            MaxSize = v12
        }),
        Plot = v2.createElement(v7, {
            CurveHook = v16,
            PlotAbsoluteSize = v14,
            OnSizeChanged = v18,
            OnChanged = v21
        }),
        KeypointControls = v2.createElement(v8, {
            Keypoint = v16.getSelectedKeypoint(),
            OnEdit = l_useCallback_0(function(v22)
                v16.update(v22, true);
                v21();
            end, {
                v16
            }),
            OnDelete = l_useCallback_0(function()
                v16.remove();
                v21();
            end, {
                v16
            }),
            OnReset = l_useCallback_0(function()
                v16.reset(v10.tableToCurve(v13.CurveData));
                v16.select(-1);
                v13.OnChanged(v13.CurveData);
            end, {
                v13.CurveData,
                v13.OnChanged,
                v16
            }),
            OnSave = l_useCallback_0(function()
                v21();
                v16.select(1);
                v13.OnSave();
            end, {
                v13.OnSave,
                v16
            })
        })
    });
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useMemo_0 = v2.useMemo;
local l_joinTags_0 = require(l_script_FirstAncestor_0.Packages.Framework).Styling.joinTags;
local v5 = require(l_Parent_0.PlotRectUtil);
return function(v6)
    local v14 = l_useMemo_0(function()
        local v7 = v5.clampLineToRect(v6.StartPoint, v6.EndPoint, v6.PlotRect);
        if v7 then
            local v8 = v5.plotToAbsolutePosition(v7[1], v6.PlotRect, v6.PlotAbsoluteSize);
            local v9 = v5.plotToAbsolutePosition(v7[2], v6.PlotRect, v6.PlotAbsoluteSize);
            local v10 = (v8 + v9) / 2;
            local v11 = v9 - v8;
            local v12 = math.atan2(v11.Y, v11.X);
            local v13 = 4;
            if v6.IsEndLine then
                v13 = 2;
            end;
            return {
                Position = UDim2.fromOffset(v10.X, v10.Y),
                Rotation = math.deg(v12),
                Size = UDim2.fromOffset(v11.Magnitude, v13)
            };
        else
            return nil;
        end;
    end, {
        v6.StartPoint,
        v6.EndPoint,
        v6.PlotRect,
        v6.PlotAbsoluteSize,
        v6.IsEndLine
    });
    return v14 and v2.createElement("Frame", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        Position = v14.Position,
        Rotation = v14.Rotation,
        Size = v14.Size,
        [v2.Tag] = l_joinTags_0("CurveLine", if not v6.StartPointSelected then nil else "SelectedStart", if not v6.EndPointSelected then nil else "SelectedEnd")
    });
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useMemo_0 = v2.useMemo;
local l_useState_0 = v2.useState;
local l_useRef_0 = v2.useRef;
local l_Pane_0 = require(l_script_FirstAncestor_0.Packages.Framework).UI.Pane;
local v8 = require(l_script_FirstAncestor_0.Packages.Dash);
local _ = v8.join;
local _ = v8.map;
local v11 = require(l_Parent_0.CurveLine);
local v12 = require(l_Parent_0.GridLine);
local v13 = require(l_Parent_0.Keypoint);
local v14 = require(l_Parent_0.PlotRectUtil);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local function v27(v16, v17)
    local v18 = {};
    local v19 = math.log10(v16.Width) - 0.3010299956639812;
    local v20 = 10 ^ math.floor(v19);
    local v21 = v20 / 10;
    for v22 = v16.Min.X - v16.Min.X % v20, v16.Max.X - v16.Max.X % v20, v20 do
        v18["GridLine_V_" .. v22] = v2.createElement(v12, {
            Position = v22,
            PlotRect = v16,
            PlotAbsoluteSize = v17,
            PlotFramePadding = 50,
            Orientation = "Vertical"
        });
        local v23 = math.clamp(1 - (v19 - math.floor(v19)) / 0.39794000867203766, 0, 1);
        if v23 > 0 then
            for v24 = 1, 9 do
                local v25 = v22 + v21 * v24;
                v18["GridLine_Inner_V_" .. v25] = v2.createElement(v12, {
                    Position = v25,
                    PlotRect = v16,
                    PlotAbsoluteSize = v17,
                    PlotFramePadding = 50,
                    Orientation = "Vertical",
                    InnerAlpha = v23
                });
            end;
        end;
    end;
    for v26 = v16.Min.Y, v16.Max.Y, v16.Height / 5 do
        v18["GridLine_H_" .. v26] = v2.createElement(v12, {
            Position = v26,
            PlotRect = v16,
            PlotAbsoluteSize = v17,
            PlotFramePadding = 50,
            Orientation = "Horizontal"
        });
    end;
    return v18;
end;
return function(v28)
    local v29 = l_useRef_0(nil);
    local l_PlotAbsoluteSize_0 = v28.PlotAbsoluteSize;
    local l_CurveHook_0 = v28.CurveHook;
    local v32, v33 = l_useState_0(false);
    local v34 = 100;
    if #l_CurveHook_0.keypoints > 0 then
        v34 = math.max(100, l_CurveHook_0.keypoints[#l_CurveHook_0.keypoints].X * 1.1);
    end;
    local v35, v36 = l_useState_0(v34);
    local v37 = l_useMemo_0(function()
        return Rect.new(0, 0, v35, 1);
    end, {
        v35
    });
    local v39 = l_useCallback_0(function(v38)
        if not v32 then
            l_CurveHook_0.select(v38);
            return ;
        else
            return ;
        end;
    end, {
        l_CurveHook_0,
        v32
    });
    local v40 = l_useCallback_0(function()
        v33(true);
    end, {});
    local v43 = l_useCallback_0(function(v41)
        if v29.current then
            local v42 = v14.mouseCoordsToPlotPosition(v41, v37, v29.current);
            l_CurveHook_0.update(Vector2.new(math.clamp(v42.X, v37.Min.X, v37.Max.X), (math.clamp(v42.Y, v37.Min.Y, v37.Max.Y))), false);
            return ;
        else
            return ;
        end;
    end, {
        v29,
        v37,
        l_CurveHook_0
    });
    local v45 = l_useCallback_0(function()
        local v44 = l_CurveHook_0.getSelectedKeypoint();
        if v44 then
            l_CurveHook_0.update(v44, true);
        end;
        v33(false);
        if v28.OnChanged then
            v28.OnChanged();
        end;
    end, {
        v28,
        l_CurveHook_0
    });
    local v47 = l_useCallback_0(function(v46)
        if v29.current then
            if not (not (v46.UserInputType == Enum.UserInputType.MouseButton1) or not l_CurveHook_0.add((v14.mouseCoordsToPlotPosition(Vector2.new(v46.Position.X, v46.Position.Y), v37, v29.current)))) then
                v33(true);
            end;
            return ;
        else
            return ;
        end;
    end, {
        v29,
        v37,
        l_CurveHook_0
    });
    local v48 = l_useCallback_0(function()
        v33(false);
        l_CurveHook_0.remove();
        l_CurveHook_0.select(-1);
        if v28.OnChanged then
            v28.OnChanged();
        end;
    end, {
        v28,
        l_CurveHook_0
    });
    local v50 = l_useCallback_0(function(v49)
        v36((math.clamp(v35 * 1.15 ^ v49, 1, 4294967296)));
    end, {
        v37
    });
    return v2.createElement(l_Pane_0, {
        Active = true,
        LayoutOrder = 1,
        Size = UDim2.new(1, 0, 1, -60),
        [v2.Tag] = "Contrast X-Clip",
        [v2.Event.InputChanged] = function(_, v52)
            if v52.UserInputType == Enum.UserInputType.MouseWheel then
                v50(v52.Position.Z);
            end;
        end
    }, {
        CurveContainer = v2.createElement(l_Pane_0, {
            Active = true,
            LayoutOrder = 2,
            Position = UDim2.new(0, 50, 0, 50),
            Size = UDim2.new(1, -100, 1, -100),
            BackgroundTransparency = 1,
            ForwardRef = v29,
            [v2.Change.AbsoluteSize] = v28.OnSizeChanged,
            [v2.Event.InputBegan] = function(_, v54)
                if v54.UserInputType == Enum.UserInputType.MouseButton1 then
                    v47(v54);
                end;
            end
        }, (l_useMemo_0(function()
            local v55 = {};
            for v56, v57 in l_CurveHook_0.keypoints, nil, nil do
                local v58 = "Keypoint_" .. v56;
                local v59 = v56 == l_CurveHook_0.selectedIndex;
                v55[v58] = v2.createElement(v13, {
                    Position = v57,
                    PlotRect = v37,
                    Selected = v59,
                    IsDragging = v32 and v59,
                    OnHoverStart = function()
                        v39(v56);
                    end,
                    OnDragStart = v40,
                    OnMoved = v43,
                    OnDragEnd = v45,
                    OnRightClick = v48
                });
            end;
            for v60 = 1, #l_CurveHook_0.keypoints - 1 do
                v55["CurveLine_" .. v60 .. "_" .. v60 + 1] = v2.createElement(v11, {
                    StartPoint = l_CurveHook_0.keypoints[v60],
                    EndPoint = l_CurveHook_0.keypoints[v60 + 1],
                    PlotRect = v37,
                    PlotAbsoluteSize = l_PlotAbsoluteSize_0,
                    StartPointSelected = l_CurveHook_0.selectedIndex == v60,
                    EndPointSelected = l_CurveHook_0.selectedIndex == v60 + 1
                });
            end;
            if #l_CurveHook_0.keypoints >= 1 then
                v55.EndLine_1 = v2.createElement(v11, {
                    StartPoint = l_CurveHook_0.keypoints[1],
                    EndPoint = Vector2.new(v37.Min.X, l_CurveHook_0.keypoints[1].Y),
                    PlotRect = v37,
                    PlotAbsoluteSize = l_PlotAbsoluteSize_0,
                    IsEndLine = true
                });
                v55.EndLine_2 = v2.createElement(v11, {
                    StartPoint = l_CurveHook_0.keypoints[#l_CurveHook_0.keypoints],
                    EndPoint = Vector2.new(v37.Max.X, l_CurveHook_0.keypoints[#l_CurveHook_0.keypoints].Y),
                    PlotRect = v37,
                    PlotAbsoluteSize = l_PlotAbsoluteSize_0,
                    IsEndLine = true
                });
            end;
            return v55;
        end, {
            l_CurveHook_0,
            v37,
            v28.PlotAbsoluteSize,
            v32
        }))),
        GridLineContainer = v2.createElement(l_Pane_0, {
            Active = true,
            LayoutOrder = 1,
            Position = UDim2.new(0, 0, 0, 0),
            Size = UDim2.new(1, 0, 1, 0),
            BackgroundTransparency = 1
        }, (l_useMemo_0(function()
            return (v27(v37, l_PlotAbsoluteSize_0));
        end, {
            v28.PlotAbsoluteSize,
            v37
        })))
    });
end;


local _ = script.Parent;
local v1 = require(script:FindFirstAncestor("AttenuationCurveEditor").Packages.React);
local l_useMemo_0 = v1.useMemo;
return function(v3)
    local v10 = l_useMemo_0(function()
        local v4 = Vector2.new(-1, -1);
        local v5 = Vector2.new(-1, -1);
        local v6 = UDim2.fromOffset(0, 0);
        if v3.Orientation == "Vertical" then
            local v7 = (v3.Position - v3.PlotRect.Min.X) / v3.PlotRect.Width;
            if not (v7 >= 0) or v7 > 1 then
                return nil;
            else
                v4 = v3.PlotAbsoluteSize * Vector2.new(v7, 0);
                v5 = v3.PlotAbsoluteSize * Vector2.new(v7, 1);
                v6 = UDim2.fromOffset(2, (v5 - v4).Magnitude);
            end;
        elseif v3.Orientation == "Horizontal" then
            local v8 = 1 - (v3.Position - v3.PlotRect.Min.Y) / v3.PlotRect.Height;
            if not (v8 >= 0) or v8 > 1 then
                return nil;
            else
                v4 = v3.PlotAbsoluteSize * Vector2.new(0, v8);
                v5 = v3.PlotAbsoluteSize * Vector2.new(1, v8);
                v6 = UDim2.fromOffset((v5 - v4).Magnitude, 2);
            end;
        end;
        local v9 = (v4 + v5) / 2;
        return {
            Position = UDim2.fromOffset(v9.X + v3.PlotFramePadding, v9.Y + v3.PlotFramePadding),
            Size = v6
        };
    end, {
        v3
    });
    local v14 = l_useMemo_0(function()
        local v11 = UDim2.fromOffset(0, 0);
        local l_Center_0 = Enum.TextXAlignment.Center;
        local l_Center_1 = Enum.TextYAlignment.Center;
        if v3.Orientation == "Vertical" then
            v11 = UDim2.new(0.5, 0, 1, 5);
            l_Center_1 = Enum.TextYAlignment.Top;
        elseif v3.Orientation == "Horizontal" then
            v11 = UDim2.new(0, -5, 0.5, 0);
            l_Center_0 = Enum.TextXAlignment.Right;
        end;
        return {
            Position = v11,
            XAlignment = l_Center_0,
            YAlignment = l_Center_1
        };
    end, {
        v3.Orientation
    });
    local v15 = l_useMemo_0(function()
        if v3.InnerAlpha then
            return 1 - 0.4 * v3.InnerAlpha;
        else
            return 0.6;
        end;
    end, {
        v3.InnerAlpha
    });
    if v10 then
        local v16 = {};
        if not v3.InnerAlpha then
            v16.Label = v1.createElement("TextLabel", {
                Position = v14.Position,
                Size = UDim2.fromOffset(0, 0),
                Text = string.format("%.1f", v3.Position),
                TextXAlignment = v14.XAlignment,
                TextYAlignment = v14.YAlignment,
                [v1.Tag] = "GridLabel"
            });
        end;
        return v1.createElement("Frame", {
            AnchorPoint = Vector2.new(0.5, 0.5),
            Position = v10.Position,
            Size = v10.Size,
            BackgroundTransparency = v15,
            [v1.Tag] = "GridLine"
        }, v16);
    else
        return nil;
    end;
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useMemo_0 = v2.useMemo;
local v5 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_joinTags_0 = v5.Styling.joinTags;
local l_DragListener_0 = v5.UI.DragListener;
local l_HoverArea_0 = v5.UI.HoverArea;
local l_isInputMainPress_0 = v5.Util.isInputMainPress;
local l_Attribute_0 = require(l_script_FirstAncestor_0.Src.Resources.PluginStyles):GetAttribute("CursorOpenedHand");
local v11 = require(l_Parent_0.PlotRectUtil);
return function(v12)
    local v13 = l_useMemo_0(function()
        return v11.plotToViewPosition(v12.Position, v12.PlotRect);
    end, {
        v12.Position,
        v12.PlotRect
    });
    local v14 = l_useMemo_0(function()
        return v11.rectContains(v13, Rect.new(0, 0, 1, 1), 0.001);
    end, {
        v13
    });
    local v15 = l_useCallback_0(function()
        if v12.OnHoverStart then
            v12.OnHoverStart();
        end;
    end, {
        v12.OnHoverStart
    });
    local v16 = l_useCallback_0(function()
        if v12.OnHoverEnd then
            v12.OnHoverEnd();
        end;
    end, {
        v12.OnHoverEnd
    });
    local v18 = l_useCallback_0(function(v17)
        if v12.OnMoved then
            v12.OnMoved((Vector2.new(v17.Position.X, v17.Position.Y)));
        end;
    end, {
        v12.OnMoved
    });
    local v19 = l_useCallback_0(function()
        if v12.OnDragEnd then
            v12.OnDragEnd();
        end;
    end, {
        v12.OnDragEnd
    });
    local v22 = l_useCallback_0(function(_, v21)
        if not l_isInputMainPress_0(v21) then
            if not (not (v21.UserInputType == Enum.UserInputType.MouseButton2) or not v12.OnRightClick) then
                v12.OnRightClick();
            end;
        elseif v12.OnDragStart then
            v12.OnDragStart();
            return ;
        end;
    end, {
        v12.OnDragStart,
        v12.OnRightClick
    });
    local v23 = {
        HoverArea = v2.createElement(l_HoverArea_0, {
            Cursor = l_Attribute_0,
            MouseEnter = v15,
            MouseLeave = v16
        })
    };
    if v12.IsDragging then
        v23.DragListener = v2.createElement(l_DragListener_0, {
            OnDragMoved = v18,
            OnDragEnded = v19
        });
    end;
    return (v14 or v12.IsDragging) and v2.createElement("TextButton", {
        Position = UDim2.fromScale(v13.X, v13.Y),
        [v2.Tag] = l_joinTags_0("SequenceKeypoint", not v12.Selected and "" or "Selected"),
        [v2.Event.InputBegan] = v22
    }, v23);
end;


local v4 = {
    plotToViewPosition = function(v0, v1)
        return Vector2.new((v0.X - v1.Min.X) / v1.Width, 1 - (v0.Y - v1.Min.Y) / v1.Height);
    end,
    viewToPlotPosition = function(v2, v3)
        return Vector2.new(v3.Min.X + v3.Width * v2.X, v3.Min.Y + v3.Height * (1 - v2.Y));
    end
};
v4.plotToAbsolutePosition = function(v5, v6, v7)
    return v7 * v4.plotToViewPosition(v5, v6);
end;
v4.absoluteToPlotPosition = function(v8, v9, v10)
    return v4.viewToPlotPosition(v8 / v10, v9);
end;
v4.mouseCoordsToPlotPosition = function(v11, v12, v13)
    if v13 then
        return v4.absoluteToPlotPosition(v11 - v13.AbsolutePosition, v12, v13.AbsoluteSize);
    else
        return v12.Min;
    end;
end;
v4.rectContains = function(v14, v15, v16)
    v16 = v16 or 0.001;
    local v17 = false;
    if v15.Min.X - v16 <= v14.X then
        v17 = false;
        if v14.X <= v15.Max.X + v16 then
            v17 = false;
            if v15.Min.Y - v16 <= v14.Y then
                v17 = v14.Y <= v15.Max.Y + v16;
            end;
        end;
    end;
    return v17;
end;
v4.clampLineToRect = function(v18, v19, v20)
    local v21 = Vector2.new(math.min(v18.X, v19.X), (math.min(v18.Y, v19.Y)));
    local v22 = Vector2.new(math.max(v18.X, v19.X), (math.max(v18.Y, v19.Y)));
    if not v4.rectContains(v18, v20, 0.001) or not v4.rectContains(v19, v20, 0.001) then
        if not ((v22.X >= v20.Min.X and v22.Y >= v20.Min.Y) and v20.Max.X >= v21.X) or v20.Max.Y < v21.Y then
            return nil;
        else
            local v23 = v19 - v18;
            local v24 = Vector2.new(0, 0);
            local v25 = Vector2.new(1, 1);
            if v23.X ~= 0 then
                v24 = Vector2.new((v20.Min.X - v18.X) / v23.X, v24.Y);
                v25 = Vector2.new((v20.Max.X - v18.X) / v23.X, v25.Y);
            end;
            if v23.Y ~= 0 then
                v24 = Vector2.new(v24.X, (v20.Min.Y - v18.Y) / v23.Y);
                v25 = Vector2.new(v25.X, (v20.Max.Y - v18.Y) / v23.Y);
            end;
            local v26 = math.max(0, math.min(v24.X, v25.X), (math.min(v24.Y, v25.Y)));
            local v27 = math.min(1, math.max(v24.X, v25.X), (math.max(v24.Y, v25.Y)));
            if v27 <= v26 then
                return nil;
            else
                return {
                    v18:Lerp(v19, v26),
                    v18:Lerp(v19, v27)
                };
            end;
        end;
    else
        return {
            v18,
            v19
        };
    end;
end;
return v4;


local _ = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local l_join_0 = v2.join;
local l_copy_0 = v2.copy;
local v5 = require(l_script_FirstAncestor_0.Packages.React);
local l_useState_0 = v5.useState;
local l_useCallback_0 = v5.useCallback;
local v8 = require(l_script_FirstAncestor_0.Src.Util.roundDecimal);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_game_FastInt_0 = game:GetFastInt("AudioEmitterDistanceAttenuationMaxPoints");
return function(v11)
    local v12, v13 = l_useState_0(v11.Keypoints);
    local v14, v15 = l_useState_0(1);
    local v17 = l_useCallback_0(function(v16)
        v13(v16.Keypoints);
        v15(1);
    end, {});
    local v40 = l_useCallback_0(function(v18, v19)
        local l_v19_0 = v19;
        if not (l_v19_0 >= 1) or #v18 < l_v19_0 then
            return l_v19_0;
        else
            local function _(v21, v22)
                local l_v18_0 = v18;
                local l_v18_1 = v18;
                local v25 = v18[v22];
                local v26 = v18[v21];
                l_v18_0[v21] = v25;
                l_v18_1[v22] = v26;
            end;
            for _ = 0, l_game_FastInt_0 do
                local v29 = v18[l_v19_0];
                local v30 = v18[l_v19_0 - 1];
                if v30 and v29.X < v30.X then
                    local v31 = l_v19_0 - 1;
                    local l_l_v19_0_0 = l_v19_0;
                    local v33 = v18[l_l_v19_0_0];
                    local v34 = v18[v31];
                    v18[v31] = v33;
                    v18[l_l_v19_0_0] = v34;
                    l_v19_0 = l_v19_0 - 1;
                else
                    local v35 = v18[l_v19_0 + 1];
                    if v35 and v35.X < v29.X then
                        local l_l_v19_0_1 = l_v19_0;
                        local v37 = l_v19_0 + 1;
                        local v38 = v18[v37];
                        local v39 = v18[l_l_v19_0_1];
                        v18[l_l_v19_0_1] = v38;
                        v18[v37] = v39;
                        l_v19_0 = l_v19_0 + 1;
                    else
                        break;
                    end;
                end;
            end;
            return l_v19_0;
        end;
    end, {});
    local v44 = l_useCallback_0(function(v41, v42)
        local v43 = v8(v41[v42].X, 3);
        if v42 >= 2 and v8(v41[v42 - 1].X, 3) == v43 then
            table.remove(v41, v42 - 1);
            return v42 - 1;
        elseif v42 <= #v41 - 1 and v8(v41[v42 + 1].X, 3) == v43 then
            table.remove(v41, v42 + 1);
            return v42;
        else
            return v42;
        end;
    end, {});
    return {
        keypoints = v12,
        selectedIndex = v14,
        reset = v17,
        update = l_useCallback_0(function(v45, v46)
            local v47 = l_join_0(v12, {
                [v14] = Vector2.new(math.clamp(v8(v45.X, 3), 0, math.huge), (math.clamp(v8(v45.Y, 3), 0, 1)))
            });
            local v48 = v40(v47, v14);
            if v46 then
                v48 = v44(v47, v48);
            end;
            v15(v48);
            v13(v47);
        end, {
            v12,
            v14
        }),
        add = l_useCallback_0(function(v49)
            if l_game_FastInt_0 <= #v12 then
                return false;
            else
                local v50 = l_copy_0(v12);
                local v51 = 1;
                local v52 = #v50;
                while v51 <= v52 do
                    local v53 = math.floor((v51 + v52) / 2);
                    if v50[v53].X == v49.X then
                        v51 = v53;
                        break;
                    elseif v49.X < v50[v53].X then
                        v52 = v53 - 1;
                    else
                        v51 = v53 + 1;
                    end;
                end;
                if v51 <= #v50 and v50[v51].X == v49.X then
                    v50[v51] = v49;
                else
                    table.insert(v50, v51, v49);
                end;
                v13(v50);
                v15(v51);
                return true;
            end;
        end, {
            v12,
            v14
        }),
        remove = l_useCallback_0(function()
            local v54 = l_copy_0(v12);
            table.remove(v54, v14);
            v13(v54);
            if #v54 < v14 then
                v15(#v54);
            end;
        end, {
            v12,
            v14
        }),
        select = l_useCallback_0(function(v55)
            v15(v55);
        end, {}),
        save = l_useCallback_0(function(v56)
            v13(function(v57)
                v56({
                    Keypoints = v57
                });
                return v57;
            end);
        end, {}),
        getSelectedKeypoint = l_useCallback_0(function()
            if not (v14 > 0) or #v12 < v14 then
                return nil;
            else
                return v12[v14];
            end;
        end, {
            v12,
            v14
        })
    };
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v1.useCallback;
local l_useContext_0 = v1.useContext;
local _ = require(l_script_FirstAncestor_0.Packages.Dash).join;
local v5 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v5.ContextServices;
local l_IconButton_0 = v5.UI.IconButton;
local l_Pane_0 = v5.UI.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v10 = require(l_script_FirstAncestor_0.Src.Components.LabelCell);
local v11 = {
    Type = "Number",
    Min = 0
};
local v12 = {
    Type = "Number",
    Min = 0,
    Max = 1
};
return function(v13)
    local v14 = l_useContext_0(l_ContextServices_0.Context.Consumer)[l_ContextServices_0.Localization.Key];
    local v19 = l_useCallback_0(function(v15)
        if v13.Keypoint then
            return function(v16)
                local l_Keypoint_0 = v13.Keypoint;
                if v15 == "X" then
                    l_Keypoint_0 = Vector2.new(v16, l_Keypoint_0.Y);
                end;
                if v15 == "Y" then
                    l_Keypoint_0 = Vector2.new(l_Keypoint_0.X, v16);
                end;
                if v13.OnEdit then
                    v13.OnEdit(l_Keypoint_0);
                end;
            end;
        else
            return function(_)
            end;
        end;
    end, {
        v13.Keypoint,
        v13.OnEdit
    });
    local v20 = nil;
    local v21 = nil;
    if v13.Keypoint then
        v20 = v13.Keypoint.X;
        v21 = v13.Keypoint.Y;
    end;
    return v1.createElement(l_Pane_0, {
        LayoutOrder = 2,
        Size = UDim2.fromScale(1, 0),
        [v1.Tag] = "X-Center X-Middle X-RowM X-Fit"
    }, {
        SequenceButtonsContainer = v1.createElement(l_Pane_0, {
            LayoutOrder = 1,
            [v1.Tag] = "X-Left X-Pad X-RowM X-Fit"
        }, {
            X = v1.createElement(v10, {
                LayoutOrder = 1,
                Text = v14:getText("Label", "Distance"),
                Schema = v11,
                Value = v20,
                OnChanged = v19("X")
            }),
            Y = v1.createElement(v10, {
                LayoutOrder = 2,
                Text = v14:getText("Label", "Volume"),
                Schema = v12,
                Value = v21,
                OnChanged = v19("Y")
            })
        }),
        CommitButtonsContainer = v1.createElement(l_Pane_0, {
            LayoutOrder = 3,
            [v1.Tag] = "X-Right X-Pad X-RowM X-Fit"
        }, {
            Delete = v1.createElement(l_IconButton_0, {
                LayoutOrder = 1,
                Text = v14:getText("Control", "Delete"),
                OnClick = v13.OnDelete
            }),
            Cancel = v1.createElement(l_IconButton_0, {
                LayoutOrder = 2,
                Text = v14:getText("Control", "Reset"),
                OnClick = v13.OnReset
            }),
            Save = v1.createElement(l_IconButton_0, {
                LayoutOrder = 3,
                Text = v14:getText("Control", "Save"),
                OnClick = v13.OnSave
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_TextLabel_0 = v2.UI.TextLabel;
local l_PropertyCell_0 = v2.UI.PropertyCell;
local l_Pane_0 = v2.UI.Pane;
return function(v6)
    local _ = nil;
    return v1.createElement(l_Pane_0, {
        LayoutOrder = v6.LayoutOrder,
        [v1.Tag] = "X-RowM X-FitX X-Middle X-Stroke LabelCell"
    }, {
        Label = v1.createElement(l_TextLabel_0, {
            LayoutOrder = 1,
            Text = v6.Text,
            [v1.Tag] = "X-Fit"
        }),
        Cell = if v6.Value ~= nil then v1.createElement(l_PropertyCell_0, {
            LayoutOrder = 2,
            Size = UDim2.fromOffset(100, 30),
            Disabled = v6.Disabled,
            Schema = v6.Schema,
            Value = v6.Value,
            OnChanged = v6.OnChanged
        }) else v1.createElement(l_Pane_0, {
            LayoutOrder = 2,
            Size = UDim2.fromOffset(100, 30)
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_UI_0 = v3.UI;
local l_DockWidget_0 = l_UI_0.DockWidget;
local l_Pane_0 = l_UI_0.Pane;
local l_ContextServices_0 = v3.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 _ = require(l_script_FirstAncestor_0.Src.Types);
local v12 = require(l_script_FirstAncestor_0.Src.Reducers.MainReducer);
local v13 = require(l_script_FirstAncestor_0.Src.Util.SerializationUtil);
local l_StudioTheme_0 = v3.Style.Themes.StudioTheme;
local l_registerPluginStyles_0 = v3.Styling.registerPluginStyles;
local l_SourceStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.LocalizedStrings;
local v18 = require(l_script_FirstAncestor_0.Src.Components.AttenuationCurveRenderer);
local v19 = v1.PureComponent:extend("MainPlugin");
v19.init = function(v20, v21)
    v20.state = {
        enabled = false,
        instanceId = -1,
        instanceName = "",
        initialCurveData = {},
        currentCurveData = {},
        closeDMConnection = nil,
        forceRerender = false
    };
    v20.setDisabled = function()
        if v20.state.closeDMConnection then
            v20.state.closeDMConnection:Disconnect();
        end;
        v21.Plugin:Invoke("OnStopEditing");
        v20:setState({
            enabled = false,
            initialCurveData = {},
            currentCurveData = {},
            instanceId = -1,
            instanceName = "",
            closeDMConnection = nil
        });
    end;
    v20.onChanged = function(v22)
        v21.Plugin:Invoke("OnEdit", v13.stringifyCurveTable(v22));
        v20:setState({
            currentCurveData = v22
        });
    end;
    v20.onWidgetEnabledChanged = function(_)
        v20.setDisabled();
        v20:setState({
            forceRerender = not v20.state.forceRerender
        });
    end;
    v21.Plugin:OnInvoke("OnOpen", function(v24, v25, v26)
        local l_FocusedDataModelSession_0 = v21.Plugin.MultipleDocumentInterfaceInstance.FocusedDataModelSession;
        if l_FocusedDataModelSession_0 then
            v20:setState({
                closeDMConnection = l_FocusedDataModelSession_0.CurrentDataModelTypeAboutToChange:Connect(function()
                    v20.setDisabled();
                end)
            });
        end;
        local v28 = v13.destringifyCurveTable(v24);
        v20:setState({
            enabled = true,
            instanceId = v25,
            instanceName = v26,
            initialCurveData = v28,
            currentCurveData = v28
        });
    end);
    v20.store = v2.Store.new(v12, nil, {
        v2.thunkMiddleware
    }, nil);
    v20.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "AttenuationCurveEditor"
    });
    v20.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
    v20.DEPRECATED_stylizer = l_StudioTheme_0.new();
    v20.design = l_registerPluginStyles_0(v21.Plugin);
end;
v19.didUpdate = function(_)
end;
v19.render = function(v30)
    local l_props_0 = v30.props;
    local l_state_0 = v30.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(v30.store),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        v30.localization,
        v30.analytics
    }, {
        MainWidget = v1.createElement(l_DockWidget_0, {
            Id = "AttenuationCurveEditor",
            Enabled = l_enabled_0,
            Title = v30.localization:getText("Plugin", "Name") .. " - " .. l_state_0.instanceName,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Float,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(540, 300),
            OnClose = v30.setDisabled,
            Widget = l_props_0.PluginLoaderContext.mainDockWidget,
            OnWidgetCreated = v30.onDockWidgetCreated,
            ShouldRestore = false,
            [v1.Change.Enabled] = v30.onWidgetEnabledChanged
        }, {
            Wrapper = v1.createElement(l_Pane_0, {
                [v1.Tag] = "X-Fill X-Column"
            }, {
                ["AttenuationCurveEditor_" .. l_state_0.instanceId] = v1.createElement(v18, {
                    CurveData = l_state_0.initialCurveData,
                    Enabled = l_enabled_0,
                    OnChanged = v30.onChanged,
                    OnSave = v30.setDisabled
                })
            }),
            StyleLink = v1.createElement("StyleLink", {
                StyleSheet = v30.design
            })
        })
    });
end;
return v19;


local v0 = require(script:FindFirstAncestor("AttenuationCurveEditor").Packages.Framework);
local l_createStyleRule_0 = v0.Styling.createStyleRule;
local l_createStyleSheet_0 = v0.Styling.createStyleSheet;
local v3 = {
    ColorGridLine = Color3.fromRGB(155, 155, 155),
    ColorKeypoint = Color3.fromRGB(252, 116, 116),
    ColorKeypointSelected = Color3.fromRGB(255, 0, 0),
    CursorOpenedHand = "rbxasset://textures/advCursor-openedHand.png"
};
return l_createStyleSheet_0("AttenuationCurveEditor", {
    l_createStyleRule_0(".GridLine", {
        BorderSizePixel = 0,
        ZIndex = 2,
        BackgroundColor3 = "$ColorGridLine"
    }),
    l_createStyleRule_0(".GridLabel", {
        BackgroundTransparency = 1,
        TextColor3 = "$ColorGridLine"
    }),
    l_createStyleRule_0(".SequenceKeypoint", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        BackgroundColor3 = "$ColorKeypoint",
        BackgroundTransparency = 0,
        Size = UDim2.fromOffset(8, 8),
        Text = "",
        ZIndex = 4
    }, {
        l_createStyleRule_0(".Selected", {
            BackgroundColor3 = "$ColorKeypointSelected"
        }, {
            l_createStyleRule_0("::UIStroke", {
                ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
                Color = Color3.fromRGB(0, 0, 0),
                Thickness = 2,
                Transparency = 0.6
            })
        })
    }),
    l_createStyleRule_0(".CurveLine", {
        BorderSizePixel = 0,
        ZIndex = 3,
        BackgroundTransparency = 0.6,
        BackgroundColor3 = "$ColorKeypoint"
    }, {
        l_createStyleRule_0(".SelectedStart", {
            BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        }, {
            l_createStyleRule_0("::UIGradient", {
                Color = ColorSequence.new(v3.ColorKeypointSelected, v3.ColorKeypoint)
            })
        }),
        l_createStyleRule_0(".SelectedEnd", {
            BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        }, {
            l_createStyleRule_0("::UIGradient", {
                Color = ColorSequence.new(v3.ColorKeypoint, v3.ColorKeypointSelected)
            })
        })
    })
}, v3);


local _ = require(script:FindFirstAncestor("AttenuationCurveEditor").Src.Types);
return {
    setDistanceAttenuation = function(v1, v2)
        v1:SetDistanceAttenuation(v2);
    end,
    getDistanceAttenuation = function(v3)
        return v3:GetDistanceAttenuation();
    end
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AttenuationCurveEditor");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Src.Util.roundDecimal);
return {
    stringifyCurveTable = function(v3)
        local v4 = {};
        for v5, v6 in v3, nil, nil do
            local v7 = tostring(v5);
            if v7 then
                v4[v7] = v6;
            else
                print((("%* couldn't be converted to a stringformat(v5)));
            end;
        end;
        return v4;
    end,
    destringifyCurveTable = function(v8)
        local v9 = {};
        for v10, v11 in v8, nil, nil do
            local v12 = tonumber(v10);
            if v12 then
                v9[v12] = v11;
            else
                print((("%* couldn't be converted to a numberformat(v10)));
            end;
        end;
        return v9;
    end,
    curveToTable = function(v13)
        local v14 = {};
        for _, v16 in v13.Keypoints, nil, nil do
            v14[v2(v16.X, 3)] = v2(v16.Y, 3);
        end;
        return v14;
    end,
    tableToCurve = function(v17)
        local v18 = {};
        for v19, v20 in v17, nil, nil do
            table.insert(v18, Vector2.new(v19, v20));
        end;
        table.sort(v18, function(v21, v22)
            return v21.X < v22.X;
        end);
        return {
            Keypoints = v18
        };
    end
};


local v0 = require(script:FindFirstAncestor("AttenuationCurveEditor").Packages.Framework);
local l_TestHelpers_0 = v0.TestHelpers;
local l_ContextServices_0 = v0.ContextServices;
local v3 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock()
};
return function(v4)
    assert(type(v4) == "table", "Expected children to be a table");
    return l_TestHelpers_0.provideMockContext(v3, v4);
end;


if plugin then
    local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
    local v1 = require(l_script_FirstAncestor_0.Packages.TestLoader);
    v1.launch("AudioEqualizerEditor", l_script_FirstAncestor_0.Src);
    if not v1.isCli() then
        if require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags).getFFlagEnableAudioEqualizerEditor() then
            local v2 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
            local v3 = require(l_script_FirstAncestor_0.Src.Util.AnalyzerUtil);
            v3.setPlugin(plugin);
            local _ = require(l_script_FirstAncestor_0.Src.Types);
            local v5 = {};
            local v6 = nil;
            local v7 = 0;
            local v8 = nil;
            local l_GuiService_0 = game:GetService("GuiService");
            local _ = game:GetService("SoundService").OpenAudioEqualizerEditorSignal:Connect(function(v10)
                for v11 = #v10, 1, -1 do
                    local v12 = v10[v11];
                    if not (v12 and v12:IsA("AudioEqualizer")) then
                        table.remove(v10, v11);
                    end;
                end;
                if #v10 == 0 then
                    return ;
                else
                    v5 = v10;
                    local v13 = v10[1];
                    v8 = {
                        LowGain = v13.LowGain,
                        MidGain = v13.MidGain,
                        HighGain = v13.HighGain,
                        MidRange = v13.MidRange,
                        Bypass = v13.Bypass
                    };
                    local v14 = ("%* \"%*\""):format(v13.ClassName, v13.Name);
                    if #v10 > 1 then
                        v14 = ("%* (%* items)"):format(v13.ClassName, #v10);
                    end;
                    v3.createInstances(v13, l_GuiService_0);
                    plugin:Invoke("OnOpen", v8, v7, v14);
                    if v6 then
                        v6:Disconnect();
                    end;
                    v6 = v13.Changed:Connect(function(v15)
                        local l_v13_0 = v13;
                        if not v8 or v8[v15] ~= l_v13_0[v15] then
                            v8 = {
                                LowGain = v13.LowGain,
                                MidGain = v13.MidGain,
                                HighGain = v13.HighGain,
                                MidRange = v13.MidRange,
                                Bypass = v13.Bypass
                            };
                            plugin:Invoke("OnInstanceChanged", v8);
                        end;
                    end);
                    v7 = v7 + 1;
                    return ;
                end;
            end);
            plugin:OnInvoke("OnEdit", function(v18)
                v8 = v18;
                for _, v20 in v5, nil, nil do
                    if not (not v20 or not v20:IsA("AudioEqualizer")) then
                        v20.LowGain = v18.LowGain;
                        v20.MidGain = v18.MidGain;
                        v20.HighGain = v18.HighGain;
                        v20.MidRange = v18.MidRange;
                        v20.Bypass = v18.Bypass;
                    end;
                end;
            end);
            plugin:OnInvoke("OnStopEditing", function()
                v5 = {};
                if v6 then
                    v6:Disconnect();
                    v6 = nil;
                end;
                v8 = nil;
                v3.destroyInstances(l_GuiService_0);
            end);
            if v2.get() ~= v2.Asset then
                return ;
            else
                require(l_script_FirstAncestor_0.Bin.Common.setup)(plugin, (require(l_script_FirstAncestor_0.Bin.Common.setupMain)));
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


game:DefineFastFlag("EnableAudioEqualizerEditor", false);
game:DefineFastInt("AudioEqualizerEditorAnalyzerResolution", 100);
game:DefineFastFlag("LoadAudioEqualizerEditorInAssetDM", false);
game:DefineFastFlag("Path2DControlPointAtomicClass4", false);
game:DefineFastFlag("Path2DEnabled15", false);
game:DefineFastInt("Path2DMaxControlPointLimit", 50);
return {
    getFFlagEnableAudioEqualizerEditor = function()
        return game:GetFastFlag("EnableAudioEqualizerEditor");
    end,
    getFIntAudioEqualizerEditorAnalyzerResolution = function()
        return game:GetFastInt("AudioEqualizerEditorAnalyzerResolution");
    end,
    getFFlagLoadAudioEqualizerEditorInAssetDM = function()
        return game:GetFastFlag("LoadAudioEqualizerEditorInAssetDM");
    end,
    getFFlagPath2DEnabled = function()
        return game:GetFastFlag("Path2DControlPointAtomicClass4") and game:GetFastFlag("Path2DEnabled15");
    end,
    getFIntPath2DMaxControlPointLimit = function()
        return game:GetFastInt("Path2DMaxControlPointLimit");
    end
};


local v0 = require(script:FindFirstAncestor("AudioEqualizerEditor").Bin.Common.defineLuaFlags);
return {
    Asset = "Asset",
    Standalone = "Standalone",
    get = function()
        if not v0.getFFlagLoadAudioEqualizerEditorInAssetDM() then
            return "Standalone";
        else
            return "Asset";
        end;
    end
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.PluginLoader.PluginLoaderBuilder);
local l_SourceStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.LocalizedStrings;
local v4 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
return function(v5, v6)
    v5.Name = l_script_FirstAncestor_0.Name;
    local v10 = {
        plugin = v5,
        pluginName = "AudioEqualizerEditor",
        translationResourceTable = l_LocalizedStrings_0,
        fallbackResourceTable = l_SourceStrings_0,
        getToolbarName = function(v7, v8, v9)
            return v7(v8, v9, "Plugin", "Toolbar");
        end,
        noToolbar = true
    };
    local l_RunService_0 = game:GetService("RunService");
    local v12 = v4.get() == v4.Standalone;
    local v13 = l_RunService_0:IsEdit();
    local v14 = v1.build(v10);
    if not (not v12 and not v13) then
        v6(v5, v14);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
return function(v1, v2)
    local v3 = require(l_script_FirstAncestor_0.Packages.React);
    local v4 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
    local v5 = v3.createElement(require(l_script_FirstAncestor_0.Src.MainPlugin), {
        Plugin = v1,
        PluginLoaderContext = v2
    });
    local v6 = v4.createRoot((Instance.new("Frame")));
    assert(v6);
    v6:render(v5);
    v1.Unloading:Connect(function()
        v1:Invoke("OnStopEditing");
        if v6 then
            v6:render(nil);
            v6 = nil;
        end;
    end);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
if require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags).getFFlagEnableAudioEqualizerEditor() then
    if not require(l_script_FirstAncestor_0.Packages.TestLoader).isCli() then
        local v1 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
        require(l_script_FirstAncestor_0.Src.Util.AnalyzerUtil).setPlugin(plugin);
        if v1.get() ~= v1.Standalone then
            return ;
        else
            require(l_script_FirstAncestor_0.Bin.Common.setup)(plugin, (require(l_script_FirstAncestor_0.Bin.Common.setupMain)));
            return ;
        end;
    else
        error("roblox-cli should not be loading standalone plugins");
        return ;
    end;
else
    return ;
end;


local l_Parent_0 = script.Parent;
local l_l_Parent_0_FirstAncestor_0 = l_Parent_0:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_l_Parent_0_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useContext_0 = v2.useContext;
local l_useEffect_0 = v2.useEffect;
local _ = v2.useRef;
local l_useState_0 = v2.useState;
local v8 = require(l_l_Parent_0_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v8.ContextServices;
local l_Pane_0 = v8.UI.Pane;
local l_Checkbox_0 = v8.UI.Checkbox;
local _ = require(l_l_Parent_0_FirstAncestor_0.Src.Types);
local v13 = require(l_Parent_0.EqAnalyzerCurve);
local v14 = require(l_Parent_0.EqPlot);
local v15 = require(l_Parent_0.useEq);
local v16 = Vector2.new(540, 300);
local v17 = Vector2.new(2000, 2000);
return function(v18)
    local v19 = l_useContext_0(l_ContextServices_0.Context.Consumer)[l_ContextServices_0.Localization.Key];
    local v20, v21 = l_useState_0(Vector2.one);
    local v23 = v15(v18.EqData, (l_useCallback_0(function(v22)
        if v22 ~= v18.EqData then
            v18.OnChanged(v22);
        end;
    end, {
        v18.OnChanged
    })));
    l_useEffect_0(function()
        v23.reset(v18.EqData);
    end, {
        v18.EqData
    });
    return v18.Enabled and v2.createElement(l_Pane_0, {
        Size = UDim2.fromScale(1, 1),
        [v2.Tag] = "X-Pad X-ColumnM X-FitY"
    }, {
        UISizeConstraint = v2.createElement("UISizeConstraint", {
            MinSize = v16,
            MaxSize = v17
        }),
        Controls = v2.createElement(l_Pane_0, {
            Size = UDim2.new(1, 0, 0, 50),
            LayoutOrder = 1,
            [v2.Tag] = "X-RowM"
        }, {
            Bypass = v2.createElement(l_Checkbox_0, {
                Text = v19:getText("Label", "Bypass"),
                Checked = v23.bypass,
                OnClick = l_useCallback_0(function()
                    v23.setBypass(not v23.bypass);
                end, {
                    v23
                })
            }),
            AnalysisEnabled = v2.createElement(l_Checkbox_0, {
                Text = v19:getText("Label", "EnableAnalyzer"),
                Checked = v18.AnalysisEnabled,
                OnClick = l_useCallback_0(function()
                    v18.SetAnalysisEnabled(not v18.AnalysisEnabled);
                end, {
                    v18.AnalysisEnabled,
                    v18.SetAnalysisEnabled
                })
            })
        }),
        Canvas = v2.createElement(l_Pane_0, {
            Size = UDim2.new(1, 0, 1, -60),
            LayoutOrder = 2
        }, {
            Plot = v2.createElement(v14, {
                EqHook = v23,
                PlotAbsoluteSize = v20,
                OnSizeChanged = l_useCallback_0(function(v24)
                    if v24 then
                        v21(v24.AbsoluteSize);
                    end;
                end, {})
            }),
            Analyzer = v2.createElement(v13, {
                Enabled = v18.AnalysisEnabled,
                PlotAbsoluteSize = v20
            })
        })
    });
end;


local _ = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useContext_0 = v2.useContext;
local l_useMemo_0 = v2.useMemo;
local l_useState_0 = v2.useState;
local v7 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v7.ContextServices;
local l_joinTags_0 = v7.Styling.joinTags;
local l_DragListener_0 = v7.UI.DragListener;
local l_HoverArea_0 = v7.UI.HoverArea;
local l_isInputMainPress_0 = v7.Util.isInputMainPress;
local l_Attribute_0 = require(l_script_FirstAncestor_0.Src.Resources.PluginStyles):GetAttribute("CursorOpenedHand");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v15 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
return function(v16)
    local v17 = l_useContext_0(l_ContextServices_0.Context.Consumer)[l_ContextServices_0.Localization.Key];
    local v18, v19 = l_useState_0(false);
    local v20 = v16.DragTarget == v16.Label;
    local v21 = l_useMemo_0(function()
        return v15.plotToView(v16.Position);
    end, {
        v16.Position
    });
    local v22 = l_useCallback_0(function()
        v19(true);
    end, {});
    local v23 = l_useCallback_0(function()
        v19(false);
    end, {});
    local v25 = l_useCallback_0(function(v24)
        if v16.OnMoved then
            v16.OnMoved((Vector2.new(v24.Position.X, v24.Position.Y)));
        end;
    end, {
        v16.OnMoved
    });
    local v26 = l_useCallback_0(function()
        if v16.OnDragEnd then
            v16.OnDragEnd();
        end;
    end, {
        v16.OnDragEnd
    });
    local v29 = l_useCallback_0(function(_, v28)
        if not (not l_isInputMainPress_0(v28) or not v16.OnDragStart) then
            v16.OnDragStart(v16.Label);
        end;
    end, {
        v16.OnDragStart,
        v16.Label
    });
    local v30 = "";
    if not v20 then
        if v18 then
            v30 = "Hovered";
        end;
    else
        v30 = "Pressed";
    end;
    return v2.createElement("ImageButton", {
        Position = UDim2.fromScale(v21.X, v21.Y),
        [v2.Tag] = l_joinTags_0("ControlPoint", v30),
        [v2.Event.InputBegan] = v29
    }, {
        Inner = v2.createElement("ImageLabel"),
        Text = v2.createElement("TextLabel", {
            Text = v17:getText("Label", "ControlPoint_" .. v16.Label)
        }),
        HoverArea = v2.createElement(l_HoverArea_0, {
            Cursor = l_Attribute_0,
            MouseEnter = v22,
            MouseLeave = v23
        }),
        DragListener = v20 and v2.createElement(l_DragListener_0, {
            OnDragMoved = v25,
            OnDragEnded = v26
        })
    });
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useEffect_0 = v2.useEffect;
local l_useMemo_0 = v2.useMemo;
local l_useState_0 = v2.useState;
local l_Pane_0 = require(l_script_FirstAncestor_0.Packages.Framework).UI.Pane;
local v7 = require(l_Parent_0.Path2DWrapper);
local v8 = require(l_script_FirstAncestor_0.Src.Util.AnalyzerUtil);
local v9 = require(l_script_FirstAncestor_0.Src.Util.Path2DUtil);
local v10 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
local v11 = require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags).getFIntAudioEqualizerEditorAnalyzerResolution();
local function _(v12)
    if v12 < 1.0E-4 then
        return -80;
    else
        return (20 * math.log(v12)) * 0.4342944819;
    end;
end;
local function v16(v14, v15)
    return v9.makeControlPoint((v10.plotToAbs(v14, v15)));
end;
return function(v17)
    local v18, v19 = l_useState_0({});
    l_useEffect_0(function()
        if v17.Enabled then
            v8.startAnalyzing(v19);
            return function()
                v8.stopAnalyzing();
            end;
        else
            return ;
        end;
    end, {
        v17.Enabled
    });
    return v17.Enabled and v2.createElement(l_Pane_0, {
        Position = UDim2.new(0, 50, 0, 50),
        Size = UDim2.new(1, -100, 1, -100),
        BackgroundTransparency = 1
    }, {
        Curve = v2.createElement(v7, {
            ControlPoints = not not v17.Enabled and l_useMemo_0(function()
                local v20 = {};
                local v21 = #v18;
                for v22 = 0, v11 do
                    local l_X_0 = v10.viewToPlot(Vector2.new(v22 / v11, 0)).X;
                    local v24 = (v21 * l_X_0) / 24000;
                    local v25 = 0;
                    if v21 > 0 then
                        v25 = v18[v21];
                        if v24 < v21 then
                            v25 = v18[math.floor(v24) + 1] * (1 - v24 % 1) + v18[math.floor(v24) + 2] * (v24 % 1);
                        end;
                        v25 = v25 * 3;
                    end;
                    local l_v25_0 = v25;
                    v25 = l_v25_0 < 1.0E-4 and -80 or (20 * math.log(l_v25_0)) * 0.4342944819;
                    if v10.X_MIN <= l_X_0 and l_X_0 <= v10.X_MAX then
                        table.insert(v20, v16(Vector2.new(l_X_0, v25), v17.PlotAbsoluteSize));
                    end;
                end;
                return v20;
            end, {
                v18
            }) or l_useMemo_0(function()
                return {
                    v9.makeControlPoint((v10.plotToAbs(Vector2.new(v10.X_MIN, v10.Y_MIN), v17.PlotAbsoluteSize))),
                    v16(Vector2.new(v10.X_MAX, v10.Y_MIN), v17.PlotAbsoluteSize)
                };
            end, {}),
            Tag = "AnalyzerCurve"
        })
    });
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useMemo_0 = v2.useMemo;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_Parent_0.Path2DWrapper);
local v6 = require(l_script_FirstAncestor_0.Src.Util.Path2DUtil);
local v7 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
return function(v8)
    return v2.createElement("CanvasGroup", {
        Size = UDim2.fromScale(1, 1),
        BackgroundTransparency = 1
    }, {
        Curve = v2.createElement(v5, {
            ControlPoints = l_useMemo_0(function()
                local v9 = {};
                local function _(v10, v11)
                    return v7.plotToAbs(Vector2.new(v10, v11), v8.PlotAbsoluteSize);
                end;
                local function _(v13, v14, v15)
                    table.insert(v9, v6.makeControlPoint(v13, v14, v15));
                end;
                local v17 = v7.plotToAbs(Vector2.new(v7.X_MIN, v8.EqHook.lowGain), v8.PlotAbsoluteSize);
                local v18 = v7.plotToAbs(Vector2.new(v8.EqHook.lowThreshold / 1.5, v8.EqHook.lowGain), v8.PlotAbsoluteSize);
                local v19 = v7.plotToAbs(Vector2.new(v8.EqHook.lowThreshold * 1.5, v8.EqHook.midGain), v8.PlotAbsoluteSize);
                local v20 = v7.plotToAbs(Vector2.new(v8.EqHook.highThreshold / 1.5, v8.EqHook.midGain), v8.PlotAbsoluteSize);
                local v21 = v7.plotToAbs(Vector2.new(v8.EqHook.highThreshold * 1.5, v8.EqHook.highGain), v8.PlotAbsoluteSize);
                local v22 = v7.plotToAbs(Vector2.new(v7.X_MAX, v8.EqHook.highGain), v8.PlotAbsoluteSize);
                local v23 = Vector2.new((v19.X - v18.X) / 2, 0);
                local v24 = Vector2.new(-(v19.X - v18.X) / 2, 0);
                local v25 = Vector2.new((v21.X - v20.X) / 2, 0);
                local v26 = Vector2.new(-(v21.X - v20.X) / 2, 0);
                if v17.X < v18.X then
                    table.insert(v9, v6.makeControlPoint(v17, nil, nil));
                end;
                table.insert(v9, v6.makeControlPoint(v18, Vector2.new(0, 0), v23));
                if v20.X < v19.X then
                    local v27 = (v19.X - v20.X) / (v19.X - v18.X);
                    local v28 = (v18 + v21) / 2;
                    local v29 = 0.25 * ((v21 + v26) - v28);
                    local v30 = Vector2.new(v28.X, v19.Y) * (1 - v27) + v28 * v27;
                    local v31 = v25 * (1 - v27) + v29 * v27;
                    table.insert(v9, v6.makeControlPoint(v30, -v31, v31));
                else
                    table.insert(v9, v6.makeControlPoint(v19, v24, (Vector2.new(0, 0))));
                    table.insert(v9, v6.makeControlPoint(v20, Vector2.new(0, 0), v25));
                end;
                table.insert(v9, v6.makeControlPoint(v21, v26, (Vector2.new(0, 0))));
                if v21.X < v22.X then
                    table.insert(v9, v6.makeControlPoint(v22, nil, nil));
                end;
                return v9;
            end, {
                v8.EqHook,
                v8.PlotAbsoluteSize
            }),
            Tag = not v8.Enabled and "FullCurveDisabled" or "FullCurve"
        })
    });
end;


local l_Parent_0 = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useMemo_0 = v2.useMemo;
local l_useRef_0 = v2.useRef;
local l_useState_0 = v2.useState;
local l_Pane_0 = require(l_script_FirstAncestor_0.Packages.Framework).UI.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v9 = require(l_Parent_0.ControlPoint);
local _ = require(l_Parent_0.EqAnalyzerCurve);
local v11 = require(l_Parent_0.EqFullCurve);
local v12 = require(l_Parent_0.GridLine);
local v13 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
return function(v14)
    local v15 = l_useRef_0(nil);
    local v16 = not v14.EqHook.bypass;
    local v17, v18 = l_useState_0(0);
    local v19, v20 = l_useState_0("");
    local v22 = l_useCallback_0(function(v21)
        v20(v21);
    end, {});
    local v23 = l_useCallback_0(function()
        v20("");
    end, {});
    return v2.createElement(l_Pane_0, {
        Active = true,
        LayoutOrder = 1,
        Size = UDim2.new(1, 0, 1, 0),
        [v2.Tag] = "Contrast X-Clip"
    }, {
        CurveContainer = v2.createElement(l_Pane_0, {
            Active = true,
            LayoutOrder = 2,
            Position = UDim2.new(0, 50, 0, 50),
            Size = UDim2.new(1, -100, 1, -100),
            BackgroundTransparency = 1,
            ForwardRef = v15,
            [v2.Change.AbsoluteSize] = v14.OnSizeChanged
        }, (l_useMemo_0(function()
            local v24 = {
                FullCurve = v2.createElement(v11, {
                    EqHook = v14.EqHook,
                    Enabled = v16,
                    PlotAbsoluteSize = v14.PlotAbsoluteSize
                })
            };
            if v16 then
                v24["Control_" .. "L"] = v2.createElement(v9, {
                    Position = Vector2.new(v14.EqHook.lowThreshold, v14.EqHook.lowGain),
                    Label = "L",
                    DragTarget = v19,
                    OnDragStart = v22,
                    OnMoved = function(v25)
                        v25 = v13.mouseToPlot(v25, v15.current);
                        v14.EqHook.setLowGain(v25.Y);
                        v14.EqHook.setLowThreshold(v25.X);
                        if v14.EqHook.highThreshold < v25.X then
                            v14.EqHook.setHighThreshold(v25.X);
                        end;
                    end,
                    OnDragEnd = v23
                });
                v24["Control_" .. "M"] = v2.createElement(v9, {
                    Position = Vector2.new(math.sqrt(v14.EqHook.lowThreshold * v14.EqHook.highThreshold), v14.EqHook.midGain),
                    Label = "M",
                    DragTarget = v19,
                    OnDragStart = function(v26)
                        v18((math.sqrt(v14.EqHook.highThreshold / v14.EqHook.lowThreshold)));
                        v22(v26);
                    end,
                    OnMoved = function(v27)
                        v27 = v13.mouseToPlot(v27, v15.current);
                        v14.EqHook.setMidGain(v27.Y);
                        local v28 = v27.X / v17;
                        local v29 = v27.X * v17;
                        v14.EqHook.setLowThreshold((math.max(v28, v13.X_MIN)));
                        v14.EqHook.setHighThreshold((math.min(v29, v13.X_MAX)));
                    end,
                    OnDragEnd = v23
                });
                v24["Control_" .. "H"] = v2.createElement(v9, {
                    Position = Vector2.new(v14.EqHook.highThreshold, v14.EqHook.highGain),
                    Label = "H",
                    DragTarget = v19,
                    OnDragStart = v22,
                    OnMoved = function(v30)
                        v30 = v13.mouseToPlot(v30, v15.current);
                        v14.EqHook.setHighGain(v30.Y);
                        v14.EqHook.setHighThreshold(v30.X);
                        if v30.X < v14.EqHook.lowThreshold then
                            v14.EqHook.setLowThreshold(v30.X);
                        end;
                    end,
                    OnDragEnd = v23
                });
            end;
            return v24;
        end, {
            v14.EqHook,
            v14.PlotAbsoluteSize,
            v15,
            v19,
            v22,
            v23
        }))),
        GridContainer = v2.createElement(l_Pane_0, {
            Active = true,
            LayoutOrder = 1,
            Position = UDim2.new(0, 0, 0, 0),
            Size = UDim2.new(1, 0, 1, 0),
            BackgroundTransparency = 1
        }, (l_useMemo_0(function()
            local v31 = {};
            for v32 = 2, 4 do
                for v33 = 1, 9 do
                    local v34 = v33 * 10 ^ v32;
                    if v34 >= v13.X_MIN and v13.X_MAX >= v34 then
                        local v35 = "GridLine_V_" .. v34;
                        local l_createElement_0 = v2.createElement;
                        local l_v12_0 = v12;
                        local v38 = {
                            Position = v34,
                            PlotAbsoluteSize = v14.PlotAbsoluteSize,
                            PlotFramePadding = 50,
                            Orientation = "Vertical"
                        };
                        local v39 = true;
                        if v33 ~= 1 then
                            v39 = true;
                            if v34 ~= v13.X_MIN then
                                v39 = v34 == v13.X_MAX;
                            end;
                        end;
                        v38.IsMinor = not v39;
                        v31[v35] = l_createElement_0(l_v12_0, v38);
                    end;
                end;
            end;
            for _, v41 in {
                -80,
                -40,
                -20,
                -10,
                0,
                5,
                10
            }, nil, nil do
                v31["GridLine_H_" .. v41] = v2.createElement(v12, {
                    Position = v41,
                    PlotAbsoluteSize = v14.PlotAbsoluteSize,
                    PlotFramePadding = 50,
                    Orientation = "Horizontal"
                });
            end;
            return v31;
        end, {
            v14.PlotAbsoluteSize
        })))
    });
end;


local _ = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useMemo_0 = v2.useMemo;
local v4 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
return function(v5)
    local v11 = l_useMemo_0(function()
        local v6 = Vector2.new(-1, -1);
        local v7 = Vector2.new(-1, -1);
        if v5.Orientation == "Vertical" then
            v6 = Vector2.new(v5.Position, v4.Y_MIN);
            v7 = Vector2.new(v5.Position, v4.Y_MAX);
        elseif v5.Orientation == "Horizontal" then
            v6 = Vector2.new(v4.X_MIN, v5.Position);
            v7 = Vector2.new(v4.X_MAX, v5.Position);
        end;
        v6 = v4.plotToAbs(v6, v5.PlotAbsoluteSize);
        v7 = v4.plotToAbs(v7, v5.PlotAbsoluteSize);
        local v8 = (v6 + v7) / 2;
        local v9 = UDim2.fromOffset(v8.X + v5.PlotFramePadding, v8.Y + v5.PlotFramePadding);
        local v10 = UDim2.fromOffset(0, 0);
        if v5.Orientation == "Vertical" then
            v10 = UDim2.fromOffset(2, (v7 - v6).Magnitude);
        elseif v5.Orientation == "Horizontal" then
            v10 = UDim2.fromOffset((v7 - v6).Magnitude, 2);
        end;
        return {
            Position = v9,
            Size = v10
        };
    end, {
        v5
    });
    local v15 = l_useMemo_0(function()
        local v12 = UDim2.fromOffset(0, 0);
        local l_Center_0 = Enum.TextXAlignment.Center;
        local l_Center_1 = Enum.TextYAlignment.Center;
        if v5.Orientation == "Vertical" then
            v12 = UDim2.new(0.5, 0, 1, 5);
            l_Center_1 = Enum.TextYAlignment.Top;
        elseif v5.Orientation == "Horizontal" then
            v12 = UDim2.new(0, -5, 0.5, 0);
            l_Center_0 = Enum.TextXAlignment.Right;
        end;
        return {
            Position = v12,
            XAlignment = l_Center_0,
            YAlignment = l_Center_1
        };
    end, {
        v5.Orientation
    });
    return v2.createElement("Frame", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        Position = v11.Position,
        Size = v11.Size,
        BackgroundTransparency = l_useMemo_0(function()
            if not v5.IsMinor then
                return 0.5;
            else
                return 0.75;
            end;
        end, {
            v5.IsMinor
        }),
        [v2.Tag] = "GridLine"
    }, {
        Label = not v5.IsMinor and v2.createElement("TextLabel", {
            Position = v15.Position,
            Size = UDim2.fromOffset(0, 0),
            Text = tostring(v5.Position),
            TextXAlignment = v15.XAlignment,
            TextYAlignment = v15.YAlignment,
            [v2.Tag] = "GridLabel"
        })
    });
end;


local _ = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Pane_0 = v3.UI.Pane;
local _ = v3.Styling.joinTags;
local v6 = require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags);
local _ = require(l_script_FirstAncestor_0.Src.Util.Path2DUtil);
local v8 = v2.Component:extend("Path2DWrapper");
v8.init = function(v9)
    v9.pathContainerRef = v2.createRef();
    v9.setControlPoints = function()
        if v6.getFFlagPath2DEnabled() then
            local v10 = v6.getFIntPath2DMaxControlPointLimit() - 1;
            local v11 = v9.pathContainerRef:getValue();
            if v11 then
                local v12 = 1;
                for _, v14 in v11:GetChildren() do
                    local v15 = {};
                    local v16 = #v9.props.ControlPoints;
                    for v17 = v12, (v12 + v10) - 1 do
                        if v16 >= v17 then
                            table.insert(v15, v9.props.ControlPoints[v17]);
                        else
                            break;
                        end;
                    end;
                    v14:SetControlPoints(v15);
                    v12 = v12 + (v10 - 1);
                end;
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
end;
v8.render = function(v18)
    local v19 = v6.getFIntPath2DMaxControlPointLimit() - 1;
    local v20 = "";
    if v18.props.Tag then
        v20 = v18.props.Tag;
    end;
    local v21 = {};
    for _ = 2, #v18.props.ControlPoints, v19 - 1 do
        table.insert(v21, v2.createElement("Path2D", {
            [v2.Tag] = v20
        }));
    end;
    return v6.getFFlagPath2DEnabled() and v2.createElement(l_Pane_0, {
        ref = v18.pathContainerRef,
        Size = UDim2.fromScale(1, 1)
    }, v21);
end;
v8.didMount = function(v23)
    v23.setControlPoints();
end;
v8.didUpdate = function(v24)
    v24.setControlPoints();
end;
return v8;


local _ = script.Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local _ = v2.join;
local _ = v2.copy;
local v5 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v5.useCallback;
local l_useEffect_0 = v5.useEffect;
local _ = v5.useRef;
local l_useState_0 = v5.useState;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v11 = require(l_script_FirstAncestor_0.Src.Util.PlotUtil);
local l_X_MIN_0 = v11.X_MIN;
local l_X_MAX_0 = v11.X_MAX;
local l_Y_MIN_0 = v11.Y_MIN;
local l_Y_MAX_0 = v11.Y_MAX;
return function(v16, v17)
    local v18, v19 = l_useState_0(v16.LowGain);
    local v20, v21 = l_useState_0(v16.MidGain);
    local v22, v23 = l_useState_0(v16.HighGain);
    local v24, v25 = l_useState_0(v16.MidRange.Min);
    local v26, v27 = l_useState_0(v16.MidRange.Max);
    local v28, v29 = l_useState_0(v16.Bypass);
    local v30, v31 = l_useState_0(false);
    l_useEffect_0(function()
        if v30 then
            v17({
                LowGain = v18,
                MidGain = v20,
                HighGain = v22,
                MidRange = NumberRange.new(v24, v26),
                Bypass = v28
            });
            return ;
        else
            v31(true);
            return ;
        end;
    end, {
        v18,
        v20,
        v22,
        v24,
        v26,
        v28
    });
    return {
        lowGain = v18,
        midGain = v20,
        highGain = v22,
        lowThreshold = v24,
        highThreshold = v26,
        bypass = v28,
        setLowGain = l_useCallback_0(function(v32)
            v19((math.clamp(v32, l_Y_MIN_0, l_Y_MAX_0)));
        end, {}),
        setMidGain = l_useCallback_0(function(v33)
            v21((math.clamp(v33, l_Y_MIN_0, l_Y_MAX_0)));
        end, {}),
        setHighGain = l_useCallback_0(function(v34)
            v23((math.clamp(v34, l_Y_MIN_0, l_Y_MAX_0)));
        end, {}),
        setLowThreshold = l_useCallback_0(function(v35)
            v25((math.clamp(v35, l_X_MIN_0, l_X_MAX_0)));
        end, {}),
        setHighThreshold = l_useCallback_0(function(v36)
            v27((math.clamp(v36, l_X_MIN_0, l_X_MAX_0)));
        end, {}),
        setBypass = l_useCallback_0(function(v37)
            v29(v37);
        end, {}),
        reset = l_useCallback_0(function(v38)
            v19(v38.LowGain);
            v21(v38.MidGain);
            v23(v38.HighGain);
            v25(v38.MidRange.Min);
            v27(v38.MidRange.Max);
            v29(v38.Bypass);
        end, {})
    };
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AudioEqualizerEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_DockWidget_0 = v2.UI.DockWidget;
local l_Pane_0 = v2.UI.Pane;
local l_ContextServices_0 = v2.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_StudioTheme_0 = v2.Style.Themes.StudioTheme;
local l_registerPluginStyles_0 = v2.Styling.registerPluginStyles;
local l_SourceStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.LocalizedStrings;
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v13 = require(l_script_FirstAncestor_0.Src.Components.AudioEqualizerEditor);
local v14 = v1.PureComponent:extend("MainPlugin");
v14.init = function(v15, v16)
    local v17 = {
        LowGain = 0,
        MidGain = 0,
        HighGain = 0,
        MidRange = NumberRange.new(200, 20000)
    };
    v15.state = {
        enabled = false,
        instanceId = -1,
        instanceName = "",
        initialEqData = v17,
        analysisEnabled = true,
        closeDMConnection = nil,
        forceRerender = false
    };
    v15.setDisabled = function()
        if v15.state.closeDMConnection then
            v15.state.closeDMConnection:Disconnect();
        end;
        v16.Plugin:Invoke("OnStopEditing");
        v15:setState({
            enabled = false,
            initialEqData = v17,
            instanceId = -1,
            instanceName = "",
            closeDMConnection = nil
        });
    end;
    v15.onChanged = function(v18)
        v16.Plugin:Invoke("OnEdit", v18);
    end;
    v15.onAttachAnalyzer = function(v19)
        v16.Plugin:Invoke("OnAttachAnalyzer", v19);
    end;
    v15.setAnalysisEnabled = function(v20)
        v15:setState({
            analysisEnabled = v20
        });
    end;
    v15.onWidgetEnabledChanged = function(_)
        v15.setDisabled();
        v15:setState({
            forceRerender = not v15.state.forceRerender
        });
    end;
    v16.Plugin:OnInvoke("OnOpen", function(v22, v23, v24)
        local l_FocusedDataModelSession_0 = v16.Plugin.MultipleDocumentInterfaceInstance.FocusedDataModelSession;
        if l_FocusedDataModelSession_0 then
            v15:setState({
                closeDMConnection = l_FocusedDataModelSession_0.CurrentDataModelTypeAboutToChange:Connect(function()
                    v15.setDisabled();
                end)
            });
        end;
        v15:setState({
            enabled = true,
            instanceId = v23,
            instanceName = v24,
            initialEqData = v22
        });
    end);
    v16.Plugin:OnInvoke("OnInstanceChanged", function(v26)
        v15:setState({
            initialEqData = v26
        });
    end);
    v15.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "AudioEqualizerEditor"
    });
    v15.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
    v15.DEPRECATED_stylizer = l_StudioTheme_0.new();
    v15.design = l_registerPluginStyles_0(v16.Plugin);
end;
v14.didUpdate = function(_)
end;
v14.render = function(v28)
    local l_props_0 = v28.props;
    local l_state_0 = v28.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_Mouse_0.new(l_Plugin_1:getMouse()),
        v28.localization,
        v28.analytics
    }, {
        MainWidget = v1.createElement(l_DockWidget_0, {
            Id = "AudioEqualizerEditor",
            Enabled = l_enabled_0,
            Title = v28.localization:getText("Plugin", "Name") .. " - " .. l_state_0.instanceName,
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Float,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(250, 200),
            OnClose = v28.setDisabled,
            Widget = l_props_0.PluginLoaderContext.mainDockWidget,
            OnWidgetCreated = v28.onDockWidgetCreated,
            ShouldRestore = false,
            [v1.Change.Enabled] = v28.onWidgetEnabledChanged
        }, {
            Wrapper = v1.createElement(l_Pane_0, {
                [v1.Tag] = "X-Fill X-Column"
            }, {
                {
                    ["AudioEqualizerEditor_" .. l_state_0.instanceId] = v1.createElement(v13, {
                        Enabled = l_enabled_0,
                        EqData = l_state_0.initialEqData,
                        OnChanged = v28.onChanged,
                        AnalysisEnabled = v28.state.analysisEnabled,
                        SetAnalysisEnabled = v28.setAnalysisEnabled
                    })
                }
            }),
            StyleLink = v1.createElement("StyleLink", {
                StyleSheet = v28.design
            })
        })
    });
end;
return v14;


local v0 = require(script:FindFirstAncestor("AudioEqualizerEditor").Packages.Framework);
local l_createStyleRule_0 = v0.Styling.createStyleRule;
return v0.Styling.createStyleSheet("AudioEqualizerEditor", {
    l_createStyleRule_0(".GridLine", {
        BorderSizePixel = 0,
        ZIndex = 2,
        BackgroundColor3 = "$ColorGridLine"
    }),
    l_createStyleRule_0(".GridLabel", {
        BackgroundTransparency = 1,
        TextColor3 = "$ColorGridLine"
    }),
    l_createStyleRule_0(".AnalyzerCurve", {
        ZIndex = 10,
        Color3 = "$ColorAnalyzerCurve",
        Thickness = 1
    }),
    l_createStyleRule_0(".FullCurve", {
        ZIndex = 10,
        Color3 = "$ColorFullCurve",
        Thickness = 2
    }),
    l_createStyleRule_0(".FullCurveDisabled", {
        ZIndex = 10,
        Color3 = "$ColorFullCurveDisabled",
        Thickness = 2
    }),
    l_createStyleRule_0(".Curve", {
        ZIndex = 9,
        Color3 = "$ColorCurve",
        Thickness = 1
    }),
    l_createStyleRule_0(".ControlPoint", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        BackgroundTransparency = 1,
        Image = "rbxasset://textures/smallWhiteCircle.png",
        ImageColor3 = "$ColorControlPoint",
        Size = UDim2.fromOffset(24, 24),
        ZIndex = 20
    }, {
        l_createStyleRule_0("> ImageLabel", {
            BackgroundTransparency = 1,
            Image = "rbxasset://textures/smallWhiteCircle.png",
            ImageTransparency = 0.6,
            Position = UDim2.fromScale(0.1, 0.1),
            Size = UDim2.fromScale(0.8, 0.8),
            ZIndex = 21
        }),
        l_createStyleRule_0("> TextLabel", {
            BackgroundTransparency = 1,
            FontFace = Font.new("rbxasset://fonts/families/Montserrat.json", Enum.FontWeight.Bold),
            Position = UDim2.fromScale(0.1, 0.1),
            Size = UDim2.fromScale(0.8, 0.8),
            TextSize = 18,
            ZIndex = 22
        }),
        l_createStyleRule_0(".Hovered", {
            ImageColor3 = "$ColorControlPointHovered"
        }),
        l_createStyleRule_0(".Pressed", {
            ImageColor3 = "$ColorControlPointPressed"
        })
    })
}, {
    ColorControlPoint = Color3.fromRGB(255, 100, 100),
    ColorControlPointHovered = Color3.fromRGB(175, 70, 75),
    ColorControlPointPressed = Color3.fromRGB(100, 30, 50),
    ColorAnalyzerCurve = Color3.fromRGB(200, 150, 75),
    ColorFullCurve = Color3.fromRGB(255, 100, 100),
    ColorFullCurveDisabled = Color3.fromRGB(155, 100, 100),
    ColorCurve = Color3.fromRGB(155, 155, 155),
    ColorGridLine = Color3.fromRGB(155, 155, 155),
    CursorOpenedHand = "rbxasset://textures/advCursor-openedHand.png"
});


local _ = script:FindFirstAncestor("AudioEqualizerEditor");
local v1 = {
    OnStartAnalyzing = "OnStartAnalyzing",
    OnSpectrumChanged = "OnSpectrumChanged",
    IsAnalyzing = "IsAnalyzing",
    InstanceContainer = "AudioEqualizerEditor_Container",
    Frame = "Frame",
    Analyzer = "AudioAnalyzer",
    Wire = "Wire"
};
local v2 = {};
local v3 = nil;
v2.setPlugin = function(v4)
    assert(v4, "Plugin doesn't exist");
    v3 = v4;
end;
local v5 = nil;
v2.disconnectStartAnalyzing = function()
    if v5 then
        v5:Disconnect();
        v5 = nil;
    end;
end;
local v6 = nil;
v2.disconnectRunService = function()
    if v6 then
        v6:Disconnect();
        v6 = nil;
    end;
end;
v2.createInstances = function(v7, v8)
    if v3 then
        local l_v8_FirstChild_0 = v8:FindFirstChild(v1.InstanceContainer);
        if not l_v8_FirstChild_0 then
            local v10 = Instance.new(v1.Frame);
            v10.Name = v1.InstanceContainer;
            v10.Parent = v8;
            l_v8_FirstChild_0 = v10;
        end;
        local l_l_v8_FirstChild_0_0 = l_v8_FirstChild_0;
        local l_l_l_v8_FirstChild_0_0_FirstChild_0 = l_l_v8_FirstChild_0_0:FindFirstChild(v1.Analyzer);
        if not (not l_l_l_v8_FirstChild_0_0_FirstChild_0 or l_l_l_v8_FirstChild_0_0_FirstChild_0:IsA(v1.Analyzer)) then
            l_l_l_v8_FirstChild_0_0_FirstChild_0:Destroy();
            l_l_l_v8_FirstChild_0_0_FirstChild_0 = nil;
        end;
        if not l_l_l_v8_FirstChild_0_0_FirstChild_0 then
            local v13 = Instance.new(v1.Analyzer);
            v13.Parent = l_l_v8_FirstChild_0_0;
            l_l_l_v8_FirstChild_0_0_FirstChild_0 = v13;
        end;
        local l_l_l_l_v8_FirstChild_0_0_FirstChild_0_0 = l_l_l_v8_FirstChild_0_0_FirstChild_0;
        local l_l_l_v8_FirstChild_0_0_FirstChild_1 = l_l_v8_FirstChild_0_0:FindFirstChild(v1.Wire);
        if not (not l_l_l_v8_FirstChild_0_0_FirstChild_1 or l_l_l_v8_FirstChild_0_0_FirstChild_1:IsA(v1.Wire)) then
            l_l_l_v8_FirstChild_0_0_FirstChild_1:Destroy();
            l_l_l_v8_FirstChild_0_0_FirstChild_1 = nil;
        end;
        if not l_l_l_v8_FirstChild_0_0_FirstChild_1 then
            local v16 = Instance.new(v1.Wire);
            v16.Parent = l_l_v8_FirstChild_0_0;
            v16.TargetInstance = l_l_l_l_v8_FirstChild_0_0_FirstChild_0_0;
            l_l_l_v8_FirstChild_0_0_FirstChild_1 = v16;
        end;
        l_l_l_v8_FirstChild_0_0_FirstChild_1.SourceInstance = v7;
        v2.disconnectStartAnalyzing();
        v5 = v3:OnInvoke(v1.OnStartAnalyzing, function()
            v3:SetItem(v1.IsAnalyzing, true);
            v2.disconnectRunService();
            v6 = game:GetService("RunService").Heartbeat:Connect(function()
                if v3:GetItem(v1.IsAnalyzing) then
                    v3:Invoke(v1.OnSpectrumChanged, (l_l_l_l_v8_FirstChild_0_0_FirstChild_0_0:GetSpectrum()));
                    return ;
                else
                    v2.disconnectRunService();
                    return ;
                end;
            end);
        end);
        return ;
    else
        return ;
    end;
end;
v2.destroyInstances = function(v17)
    if v3 then
        v2.disconnectSpectrumChanged();
        v3:SetItem(v1.IsAnalyzing, false);
        local l_v17_FirstChild_0 = v17:FindFirstChild(v1.InstanceContainer);
        if l_v17_FirstChild_0 then
            l_v17_FirstChild_0:Destroy();
        end;
        return ;
    else
        return ;
    end;
end;
local v19 = nil;
v2.disconnectSpectrumChanged = function()
    if v19 then
        v19:Disconnect();
        v19 = nil;
    end;
end;
v2.startAnalyzing = function(v20)
    if v3 then
        v3:Invoke(v1.OnStartAnalyzing);
        v2.disconnectSpectrumChanged();
        v19 = v3:OnInvoke(v1.OnSpectrumChanged, v20);
        return ;
    else
        return ;
    end;
end;
v2.stopAnalyzing = function()
    if v3 then
        v2.disconnectSpectrumChanged();
        v3:SetItem(v1.IsAnalyzing, false);
        return ;
    else
        return ;
    end;
end;
return v2;


local v0 = require(script:FindFirstAncestor("AudioEqualizerEditor").Bin.Common.defineLuaFlags).getFFlagPath2DEnabled();
return {
    makeControlPoint = function(v1, v2, v3)
        if v0 then
            if v1 then
                if v2 and v3 then
                    return Path2DControlPoint.new(UDim2.fromOffset(v1.X, v1.Y), UDim2.fromOffset(v2.X, v2.Y), UDim2.fromOffset(v3.X, v3.Y));
                else
                    return Path2DControlPoint.new(UDim2.fromOffset(v1.X, v1.Y));
                end;
            else
                return Path2DControlPoint.new();
            end;
        else
            return {};
        end;
    end
};


local _ = script:FindFirstAncestor("AudioEqualizerEditor");
local v2 = {
    Y_EXPONENT = 3,
    X_MIN = 200,
    X_MAX = 20000,
    Y_MIN = -80,
    Y_MAX = 10,
    log2 = function(v1)
        return math.log(v1) * 1.44269504089;
    end
};
v2.plotToView = function(v3)
    local v4 = v2.log2(v2.X_MIN);
    local v5 = (v2.log2(v3.X) - v4) / (v2.log2(v2.X_MAX) - v4);
    local _ = (v2.log2(v3.X) - v2.log2(v2.X_MIN)) / (v2.log2(v2.X_MAX) - v2.log2(v2.X_MIN));
    return Vector2.new(v5, 1 - ((math.clamp(v3.Y, v2.Y_MIN, v2.Y_MAX) - v2.Y_MIN) / (v2.Y_MAX - v2.Y_MIN)) ^ v2.Y_EXPONENT);
end;
v2.viewToPlot = function(v7)
    local _ = v2.log2(v2.X_MIN);
    local _ = v2.log2(v2.X_MAX);
    return Vector2.new(2 ^ (v7.X * v2.log2(v2.X_MAX) + (1 - v7.X) * v2.log2(v2.X_MIN)), math.clamp(1 - v7.Y, 0, 1) ^ (1 / v2.Y_EXPONENT) * (v2.Y_MAX - v2.Y_MIN) + v2.Y_MIN);
end;
v2.plotToAbs = function(v10, v11)
    return v2.plotToView(v10) * v11;
end;
v2.absToPlot = function(v12, v13)
    return v2.viewToPlot(v12 / v13);
end;
v2.mouseToPlot = function(v14, v15)
    if v15 then
        return v2.absToPlot(v14 - v15.AbsolutePosition, v15.AbsoluteSize);
    else
        return Vector2.new(v2.X_MIN, v2.Y_MIN);
    end;
end;
return v2;


local v0 = require(script:FindFirstAncestor("AudioEqualizerEditor").Packages.Framework);
local l_TestHelpers_0 = v0.TestHelpers;
local l_ContextServices_0 = v0.ContextServices;
local v3 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock()
};
return function(v4)
    assert(type(v4) == "table", "Expected children to be a table");
    return l_TestHelpers_0.provideMockContext(v3, v4);
end;


if plugin then
    local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
    local v1 = require(l_script_FirstAncestor_0.Packages.TestLoader);
    v1.launch("CancellableDialog", l_script_FirstAncestor_0.Src);
    if not v1.isCli() then
        if require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags).getFFlagEnableCancellableDialog() then
            local v2 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
            if v2.get() ~= v2.Asset then
                return ;
            else
                require(l_script_FirstAncestor_0.Bin.Common.setup)(plugin, (require(l_script_FirstAncestor_0.Bin.Common.setupMain)));
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


game:DefineFastFlag("EnableCancellableDialog", false);
return {
    getFFlagEnableCancellableDialog = function()
        return game:GetFastFlag("EnableCancellableDialog");
    end
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
local v1 = require(l_script_FirstAncestor_0.Packages.PluginLoader.PluginLoaderBuilder);
local l_SourceStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.LocalizedStrings;
local v4 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
return function(v5, v6)
    v5.Name = l_script_FirstAncestor_0.Name;
    local v13 = {
        getName = function(v7, v8, v9)
            return v7(v8, v9, "Plugin", "Button");
        end,
        getDescription = function(v10, v11, v12)
            return v10(v11, v12, "Plugin", "Description");
        end,
        icon = "rbxlocaltheme://GameSettings",
        enabled = false
    };
    local v17 = {
        plugin = v5,
        pluginName = "CancellableDialog",
        translationResourceTable = l_LocalizedStrings_0,
        fallbackResourceTable = l_SourceStrings_0,
        getToolbarName = function(v14, v15, v16)
            return v14(v15, v16, "Plugin", "Toolbar");
        end,
        buttonInfo = v13
    };
    local l_RunService_0 = game:GetService("RunService");
    local v19 = v4.get() == v4.Standalone;
    local v20 = l_RunService_0:IsEdit();
    if not v19 and not v20 then
        v1.build(v17);
        return ;
    else
        v13.enabled = true;
        v17.dockWidgetInfo = {
            id = "CancellableDialog",
            dockWidgetPluginGuiInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Bottom, false, false, 640, 480, 250, 200),
            getDockTitle = function(v21, v22, v23)
                return v21(v22, v23, "Plugin", "Name");
            end,
            zIndexBehavior = Enum.ZIndexBehavior.Sibling
        };
        local v24 = v1.build(v17);
        if v24.pluginLoader:waitForUserInteraction() then
            v6(v5, v24);
            return ;
        else
            return ;
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
return function(v1, v2)
    local v3 = require(l_script_FirstAncestor_0.Packages.React);
    local v4 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
    local v5 = v3.createElement(require(l_script_FirstAncestor_0.Src.MainPlugin), {
        Plugin = v1,
        PluginLoaderContext = v2
    });
    local v6 = v4.createRoot((Instance.new("Frame")));
    assert(v6);
    v6:render(v5);
    v1.Unloading:Connect(function()
        if v6 then
            v6:render(nil);
            v6 = nil;
        end;
    end);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
if require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags).getFFlagEnableCancellableDialog() then
    if not require(l_script_FirstAncestor_0.Packages.TestLoader).isCli() then
        local v1 = require(l_script_FirstAncestor_0.Bin.Common.pluginType);
        if v1.get() ~= v1.Standalone then
            return ;
        else
            require(l_script_FirstAncestor_0.Bin.Common.setup)(plugin, (require(l_script_FirstAncestor_0.Bin.Common.setupMain)));
            return ;
        end;
    else
        error("roblox-cli should not be loading standalone plugins");
        return ;
    end;
else
    return ;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local l_Localization_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices.Localization;
return function(v3)
    return v1.createElement("Frame", {
        [v1.Tag] = "Component-BasicExample X-Fit"
    }, {
        OptionalContent = if not v3.showContent then nil else v1.createElement("TextLabel", {
            Text = l_Localization_0:use():getText("BasicExample", "Text")
        })
    });
end;


local l_createStyleRule_0 = require(script:FindFirstAncestor("CancellableDialog").Packages.Framework).Styling.createStyleRule;
return l_createStyleRule_0(".Component-BasicExample", {
    BackgroundColor3 = "$BackgroundPaper",
    BorderSizePixel = 0
}, {
    l_createStyleRule_0("::UICorner", {
        CornerRadius = UDim.new(0, 10)
    }),
    l_createStyleRule_0(":hover", {
        BackgroundColor3 = "$BackgroundHover"
    }),
    l_createStyleRule_0("> #OptionalContent", {
        TextSize = 24,
        Font = Enum.Font.Gotham,
        TextColor3 = "$TextPrimary",
        Size = UDim2.new(1, 0, 0, 50),
        BackgroundTransparency = 1,
        TextXAlignment = Enum.TextXAlignment.Center,
        TextYAlignment = Enum.TextYAlignment.Center
    })
});


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local l_Localization_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices.Localization;
return function(_)
    local v4 = l_Localization_0:use();
    local v5, v6 = v1.useState(0);
    return v1.createElement("Frame", {
        [v1.Tag] = "Component-CounterExample X-Fit X-Column"
    }, {
        Label = v1.createElement("TextLabel", {
            Text = v4:getText("CounterExample", "CounterLabel", {
                counter = v5
            })
        }),
        Button = v1.createElement("TextButton", {
            Text = v4:getText("CounterExample", "Button"),
            [v1.Event.Activated] = function()
                v6(v5 + 1);
            end
        })
    });
end;


local l_createStyleRule_0 = require(script:FindFirstAncestor("CancellableDialog").Packages.Framework).Styling.createStyleRule;
return l_createStyleRule_0(".Component-CounterExample", {
    BackgroundColor3 = "$BackgroundPaper",
    BorderSizePixel = 0
}, {
    l_createStyleRule_0("::UICorner", {
        CornerRadius = UDim.new(0, 10)
    }),
    l_createStyleRule_0(":hover", {
        BackgroundColor3 = "$BackgroundHover"
    }),
    l_createStyleRule_0("> TextLabel", {
        TextSize = 24,
        Font = Enum.Font.Gotham,
        TextColor3 = "$TextPrimary",
        Size = UDim2.new(1, 0, 0, 50),
        BackgroundTransparency = 1,
        TextXAlignment = Enum.TextXAlignment.Center,
        TextYAlignment = Enum.TextYAlignment.Center
    }),
    l_createStyleRule_0("> TextButton", {
        TextSize = 50,
        Font = Enum.Font.Gotham,
        TextColor3 = "$TextPrimary",
        Size = UDim2.new(1, 0, 0, 100),
        BackgroundTransparency = 1,
        TextXAlignment = Enum.TextXAlignment.Center,
        TextYAlignment = Enum.TextYAlignment.Center
    })
});


local l_script_FirstAncestor_0 = script:FindFirstAncestor("CancellableDialog");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_DockWidget_0 = v2.UI.DockWidget;
local l_ContextServices_0 = v2.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_StudioTheme_0 = v2.Style.Themes.StudioTheme;
local l_registerPluginStyles_0 = v2.Styling.registerPluginStyles;
local l_SourceStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_script_FirstAncestor_0.Src.Resources.Localization.LocalizedStrings;
local v11 = require(l_script_FirstAncestor_0.Src.Components.BasicExample);
local v12 = v1.PureComponent:extend("MainPlugin");
v12.init = function(v13, v14)
    v13.state = {
        enabled = false
    };
    v13.toggleEnabled = function()
        v13:setState(function(v15)
            return {
                enabled = not v15.enabled
            };
        end);
    end;
    v13.onClose = function()
        v13:setState({
            enabled = false
        });
    end;
    v13.onRestore = function(v16)
        v13:setState({
            enabled = v16
        });
    end;
    v13.onWidgetEnabledChanged = function(v17)
        v13:setState({
            enabled = v17.Enabled
        });
    end;
    v13.onDockWidgetCreated = function()
        v13.props.PluginLoaderContext.mainButtonClickedSignal:Connect(v13.toggleEnabled);
    end;
    v13.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "CancellableDialog"
    });
    v13.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
    v13.DEPRECATED_stylizer = l_StudioTheme_0.new();
    v13.design = l_registerPluginStyles_0(v14.Plugin);
end;
v12.didUpdate = function(v18)
    v18.props.PluginLoaderContext.mainButton:SetActive(v18.state.enabled);
end;
v12.render = function(v19)
    local l_props_0 = v19.props;
    local l_state_0 = v19.state;
    local l_Plugin_1 = l_props_0.Plugin;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_Plugin_1),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        v19.localization,
        v19.analytics
    }, {
        MainWidget = v1.createElement(l_DockWidget_0, {
            Id = "CancellableDialog",
            Enabled = l_state_0.enabled,
            Title = v19.localization:getText("Plugin", "Name"),
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Bottom,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(250, 200),
            OnClose = v19.onClose,
            Widget = l_props_0.PluginLoaderContext.mainDockWidget,
            OnWidgetCreated = v19.onDockWidgetCreated,
            [v1.Change.Enabled] = v19.onWidgetEnabledChanged
        }, {
            Wrapper = v1.createElement("Frame", {
                [v1.Tag] = "X-Fill X-Column"
            }, {
                BasicExample = v1.createElement(v11, {
                    showContent = true
                })
            }),
            StyleLink = v1.createElement("StyleLink", {
                StyleSheet = v19.design
            })
        })
    });
end;
return v12;


local v0 = require(script:FindFirstAncestor("CancellableDialog").Packages.Framework);
local l_TestHelpers_0 = v0.TestHelpers;
local l_ContextServices_0 = v0.ContextServices;
local v3 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock()
};
return function(v4)
    assert(type(v4) == "table", "Expected children to be a table");
    return l_TestHelpers_0.provideMockContext(v3, v4);
end;