local v0 = require(script.Parent.Parent.Parent.Packages.Framework);
local l_createStyleRule_0 = v0.Styling.createStyleRule;
local l_createStyleSheet_0 = v0.Styling.createStyleSheet;
local v3 = {
    BorderSize = 1,
    ButtonHeight = 36,
    Icon16 = UDim2.fromOffset(16, 16),
    Icon22 = UDim2.fromOffset(22, 22),
    PaddingSm = 5,
    Padding = 10,
    PropertyCellSize = UDim2.new(1, 0, 0, 24),
    SearchBarHeight = 32,
    Spacing = 10,
    TitleTextSize = 24,
    TokenTooltipRowHeight = 20,
    TooltipMaxWidth = 350,
    ColorKeypoint = Color3.fromRGB(252, 116, 116),
    ColorKeypointSelected = Color3.fromRGB(255, 0, 0),
    CursorOpenedHand = "rbxasset://textures/advCursor-openedHand.png"
};
return (l_createStyleSheet_0("StyleEditor", {
    l_createStyleRule_0(".Icon16", {
        Size = "$Icon16"
    }),
    l_createStyleRule_0(".Icon22", {
        Size = "$Icon22"
    }),
    l_createStyleRule_0(".ItemTextSize", {
        TextSize = 18
    }),
    l_createStyleRule_0(".PositionCenter", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        Position = UDim2.fromScale(0.5, 0.5)
    }),
    l_createStyleRule_0(".PositionRight", {
        AnchorPoint = Vector2.new(1, 0),
        Position = UDim2.fromScale(1, 0)
    }),
    l_createStyleRule_0(".PropertyCellSize", {
        Size = "$PropertyCellSize"
    }),
    l_createStyleRule_0(".ScrollingAutomaticSize", {
        AutomaticCanvasSize = Enum.AutomaticSize.Y,
        CanvasSize = UDim2.fromScale(0, 0)
    }),
    l_createStyleRule_0(".TextXAlignLeft", {
        TextXAlignment = Enum.TextXAlignment.Left
    }),
    l_createStyleRule_0(".SearchInput", {}, {
        l_createStyleRule_0(">> UIStroke", {
            Thickness = 0
        }),
        l_createStyleRule_0(">> UICorner", {
            CornerRadius = UDim.new()
        })
    }),
    l_createStyleRule_0(".LeftItems", {
        BackgroundTransparency = 0,
        BackgroundColor3 = "$BackgroundPaper"
    }),
    l_createStyleRule_0(".TokenSource", {}, {
        l_createStyleRule_0("::UIPadding", {
            PaddingLeft = UDim.new(0, 5)
        }),
        l_createStyleRule_0(">> .TokenSourceIcon", {
            Size = UDim2.fromOffset(20, 20)
        })
    }),
    l_createStyleRule_0(".PreviewGrid", {
        BackgroundTransparency = 1,
        ScaleType = Enum.ScaleType.Tile,
        TileSize = UDim2.fromOffset(20, 20)
    }),
    l_createStyleRule_0(".OnboardingPage", {}, {
        l_createStyleRule_0(":: UISizeConstraint", {
            MaxSize = Vector2.new(400, 400),
            MinSize = Vector2.new(180, 180)
        }),
        l_createStyleRule_0("> #StylingImage", {
            Size = UDim2.fromOffset(400, 180)
        }, {
            l_createStyleRule_0(":: UIAspectRatioConstraint", {
                AspectRatio = 3.75,
                AspectType = Enum.AspectType.ScaleWithParentSize
            })
        }),
        l_createStyleRule_0("> #Description", {
            TextSize = 16,
            TextWrapped = true
        }),
        l_createStyleRule_0("> #ButtonContainer", {
            Size = UDim2.new(1, 0, 0, 90)
        }, {
            l_createStyleRule_0(":: UIPadding", {
                PaddingTop = UDim.new(0, 16)
            }),
            l_createStyleRule_0("> #Link", {
                AnchorPoint = Vector2.new(0, 0.5)
            }),
            l_createStyleRule_0("> #BlankButton", {
                AnchorPoint = Vector2.new(1, 0.5)
            })
        })
    }),
    l_createStyleRule_0(".FontStyle", {}, {
        l_createStyleRule_0("Frame", {
            BackgroundColor3 = "$ActionActivated",
            BackgroundTransparency = 0,
            Size = UDim2.fromOffset(24, 24)
        }, {
            l_createStyleRule_0(":hover", {
                BackgroundColor3 = "$ActionHover"
            }),
            l_createStyleRule_0(".Selected", {
                BackgroundColor3 = "$ActionEnabled"
            })
        }),
        l_createStyleRule_0("TextButton", {
            BackgroundTransparency = 1,
            RichText = true,
            TextColor3 = "$TextSecondary"
        }, {
            l_createStyleRule_0(":hover", {
                TextColor3 = "$TextContrast"
            }),
            l_createStyleRule_0(":pressed", {
                TextColor3 = "$TextContrast"
            }),
            l_createStyleRule_0(".Selected", {
                TextColor3 = "$TextDisabled"
            }),
            l_createStyleRule_0("#BoldButton", {
                Text = "B"
            }),
            l_createStyleRule_0("#ItalicButton", {
                Text = "I"
            })
        })
    }),
    l_createStyleRule_0(".SequenceKeypoint", {
        AnchorPoint = Vector2.new(0.5, 0.5),
        BackgroundColor3 = "$ColorKeypoint",
        BackgroundTransparency = 0,
        Text = "",
        ZIndex = 3
    }, {
        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(".NumberSequenceKeypoint", {
        Size = UDim2.fromOffset(8, 8)
    }),
    l_createStyleRule_0(".NumberSequenceLine", {
        BorderSizePixel = 0,
        ZIndex = 2,
        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)
            })
        })
    }),
    l_createStyleRule_0(".ColorSequenceKeypoint", {
        Size = UDim2.fromOffset(8, 16)
    }),
    l_createStyleRule_0(".ColorSequenceLine", {
        AnchorPoint = Vector2.new(0.5, 0),
        BackgroundColor3 = Color3.fromRGB(255, 255, 255),
        BackgroundTransparency = 0.7,
        BorderPixelSize = 0,
        Size = UDim2.new(0, 2, 1, 0),
        ZIndex = 2
    }, {
        l_createStyleRule_0(".Selected", {
            BackgroundTransparency = 0.4
        }, {
            l_createStyleRule_0("::UIStroke", {
                Color = Color3.fromRGB(0, 0, 0),
                Thickness = 2,
                Transparency = 0.75
            })
        })
    }),
    l_createStyleRule_0(".SequencePreviewButton", {
        Size = UDim2.fromOffset(20, 20),
        BackgroundColor3 = Color3.new(1, 1, 1)
    }),
    l_createStyleRule_0(".LabelCell", {}, {
        l_createStyleRule_0("::UIPadding", {
            PaddingLeft = UDim.new(0, 5),
            PaddingRight = UDim.new(0, 5)
        })
    }),
    l_createStyleRule_0(".DropdownItem", {
        Size = UDim2.new(1, 0, 0, 40),
        BackgroundTransparency = 0,
        BackgroundColor3 = "$ForegroundMain"
    }, {
        l_createStyleRule_0(":hover", {
            BackgroundColor3 = "$ActionHover"
        }),
        l_createStyleRule_0(":pressed", {
            BackgroundColor3 = "$ActionActivated"
        })
    }),
    l_createStyleRule_0(".DeriveRenderer", {}, {
        l_createStyleRule_0(">> ImageLabel", {
            ImageTransparency = 1
        }),
        l_createStyleRule_0(":hover >> ImageLabel", {
            ImageTransparency = 0
        })
    }),
    l_createStyleRule_0(".BreadcrumbRadioSize", {
        Size = UDim2.new(1, -80, 1, 0)
    }),
    l_createStyleRule_0(".PropertyCellDisabled >> TextBox", {
        TextTransparency = 0.5
    })
}, v3));


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_t_0 = require(l_Parent_0.Packages.Framework).Util.Typecheck.t;
local v2 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryProtocol);
local l_EventTypes_0 = v2.EventTypes;
local l_Backends_0 = v2.Backends;
local l_StandardizedFields_0 = v2.StandardizedFields;
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local v7 = require(l_Parent_0.Src.Flags.getFFlagStyleEditorEnableTelemetry)();
local v8 = l_t_0.interface({
    path = l_t_0.string,
    data = l_t_0.optional(l_t_0.table)
});
local v9 = {
    eventName = "StyleEditor_ContextMenuItemClicked",
    backends = {
        l_Backends_0.Points
    },
    throttlingPercentage = not v7 and 0 or v2.ONE_HUNDRED_PERCENT,
    lastUpdated = {
        24,
        2,
        22
    },
    description = "Context menu item clicked.",
    links = ""
};
return function(v10)
    assert(v8(v10));
    return {
        eventType = l_EventTypes_0.RobloxTelemetry,
        config = v9,
        data = {
            customFields = v10,
            standardizedFields = {
                l_StandardizedFields_0.addPlaceId,
                l_StandardizedFields_0.addSessionId
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryProtocol);
local l_EventTypes_0 = v1.EventTypes;
local l_Backends_0 = v1.Backends;
local l_StandardizedFields_0 = v1.StandardizedFields;
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local v6 = {
    eventName = "StyleEditor_OnboardingLearnLinkClicked",
    backends = {
        l_Backends_0.Points
    },
    throttlingPercentage = not require(l_Parent_0.Src.Flags.getFFlagStyleEditorEnableTelemetry)() and 0 or v1.ONE_HUNDRED_PERCENT,
    lastUpdated = {
        24,
        2,
        22
    },
    description = "Onboarding \"learn more\" link clicked",
    links = ""
};
return function()
    return {
        eventType = l_EventTypes_0.RobloxTelemetry,
        config = v6,
        data = {
            standardizedFields = {
                l_StandardizedFields_0.addPlaceId,
                l_StandardizedFields_0.addSessionId
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_t_0 = require(l_Parent_0.Packages.Framework).Util.Typecheck.t;
local v2 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryProtocol);
local l_EventTypes_0 = v2.EventTypes;
local l_Backends_0 = v2.Backends;
local l_StandardizedFields_0 = v2.StandardizedFields;
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local v7 = require(l_Parent_0.Src.Flags.getFFlagStyleEditorEnableTelemetry)();
local v8 = l_t_0.interface({
    loadTimeMillis = l_t_0.number
});
local v9 = {
    eventName = "StyleEditor_PluginMounted",
    backends = {
        l_Backends_0.Points
    },
    throttlingPercentage = not v7 and 0 or v2.ONE_HUNDRED_PERCENT,
    lastUpdated = {
        24,
        3,
        11
    },
    description = "Root Roact component mounted.",
    links = ""
};
return function(v10)
    assert(v8(v10));
    return {
        eventType = l_EventTypes_0.RobloxTelemetry,
        config = v9,
        data = {
            customFields = v10,
            standardizedFields = {
                l_StandardizedFields_0.addPlaceId,
                l_StandardizedFields_0.addSessionId
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_t_0 = require(l_Parent_0.Packages.Framework).Util.Typecheck.t;
local v2 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryProtocol);
local l_EventTypes_0 = v2.EventTypes;
local l_Backends_0 = v2.Backends;
local l_StandardizedFields_0 = v2.StandardizedFields;
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local _ = require(l_Parent_0.Src.Types);
local v8 = require(l_Parent_0.Src.Flags.getFFlagStyleEditorEnableTelemetry)();
local v9 = l_t_0.interface({
    sessionLengthSeconds = l_t_0.number,
    focusTimeSeconds = l_t_0.number,
    unmatchedFocusEndCount = l_t_0.number,
    buttonPressCounts = l_t_0.map(l_t_0.string, l_t_0.number)
});
local v10 = {
    eventName = "StyleEditor_PluginUnmounted",
    backends = {
        l_Backends_0.Points
    },
    throttlingPercentage = not v8 and 0 or v2.ONE_HUNDRED_PERCENT,
    lastUpdated = {
        24,
        3,
        20
    },
    description = "Root Roact component unmounted.",
    links = ""
};
return function(v11)
    assert(v9(v11));
    return {
        eventType = l_EventTypes_0.RobloxTelemetry,
        config = v10,
        data = {
            customFields = v11,
            standardizedFields = {
                l_StandardizedFields_0.addPlaceId,
                l_StandardizedFields_0.addSessionId
            }
        }
    };
end;


local l_Signal_0 = require(script.Parent.Parent.Parent.Packages.Framework).Util.Signal;
return function()
    return (setmetatable({
        _screenGui = Instance.new("ScreenGui"),
        _windowFocused = l_Signal_0.new(),
        _windowFocusReleased = l_Signal_0.new()
    }, {
        __index = function(v1, v2)
            if v2 == "WindowFocused" then
                return v1._windowFocused;
            elseif v2 == "WindowFocusReleased" then
                return v1._windowFocusReleased;
            else
                local v3 = v1._screenGui[v2];
                if typeof(v3) == "function" then
                    return function(...)
                        local v4 = {
                            ...
                        };
                        return v3(v1._screenGui, unpack(v4, 2, #v4));
                    end;
                else
                    return v3;
                end;
            end;
        end,
        __newIndex = function(v5, v6, v7)
            v5._screenGui[v6] = v7;
        end
    }));
end;


local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Packages.Rodux);
local _ = require(l_Parent_0.Packages.React);
local v4 = require(l_Parent_0.Packages.Framework);
local l_Networking_0 = v4.Http.Networking;
local l_TestHelpers_0 = v4.TestHelpers;
local l_ContextServices_0 = v4.ContextServices;
local v8 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryContext);
local v9 = require(l_Parent_0.Src.Contexts.Telemetry.TelemetryProtocol);
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local v11 = require(l_Parent_0.Src.Testing.createMockPluginGui);
local v12 = require(l_Parent_0.Src.Util.createStore);
local v13 = require(l_Parent_0.Src.Util.recordChange);
local v14 = require(l_Parent_0.Src.Resources.MakeTheme);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
local v17 = {};
v17.__index = v17;
v17.new = function()
    local v18 = l_TestHelpers_0.Instances.MockPlugin.new("StyleEditor");
    local v19 = l_Networking_0.mock();
    local v20 = v9.new();
    local v21 = l_ContextServices_0.Localization.mock();
    return (setmetatable({
        _destroyed = false,
        plugin = v18,
        localization = v21,
        networking = v19,
        telemetry = v20,
        focus = l_ContextServices_0.Focus.new((v11())),
        store = v12({
            Plugin = v18,
            Localization = v21,
            Networking = v19,
            Telemetry = v20,
            recordChange = v13(l_ChangeHistoryService_0)
        })
    }, v17.__index));
end;
v17.provide = function(v22, v23)
    assert(v22._destroyed == false, "cannot use MockContext after it is destroyed");
    assert(type(v23) == "table", "expected children to be a table");
    return l_TestHelpers_0.provideMockContext({
        l_ContextServices_0.Plugin.new(v22.plugin),
        l_ContextServices_0.Store.new(v22.store),
        l_ContextServices_0.Mouse.new(v22.plugin:GetMouse()),
        v8.new(v22.telemetry),
        v22.localization,
        v22.focus,
        v14(true)
    }, v23);
end;
v17.destroy = function(v24)
    assert(v24._destroyed == false, "cannot use MockContext after it is destroyed");
    v24._destroyed = true;
    v24.focus:get():Destroy();
    v24.plugin:Destroy();
    v24.localization:destroy();
    v24.focus:destroy();
    v24.store:destruct();
end;
return v17;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Dash);
local l_filter_0 = v1.filter;
local l_map_0 = v1.map;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v5 = require(l_Parent_0.Src.Thunks.Asset.LoadFontFamilyInfo);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, _)
        v7:dispatch(v5((l_map_0(l_filter_0(Enum.Font:GetEnumItems(), function(v9)
            return v9 ~= Enum.Font.Unknown;
        end), function(v10)
            return Font.fromEnum(v10).Family;
        end))));
    end;
end;


local l_TextService_0 = game:GetService("TextService");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Promise);
local l_startsWith_0 = require(l_Parent_0.Packages.Dash).startsWith;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v5 = require(l_Parent_0.Src.Actions.Asset.SaveFontMetadata);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v8)
    return function(v9, _)
        local v11 = 0;
        local v12 = #v8;
        local v13 = {};
        for _, v15 in v8, nil, nil do
            v2.new(function(v16, v17)
                local l_status_0, l_result_0 = pcall(function()
                    return l_TextService_0:GetFamilyInfoAsync(v15);
                end);
                if l_status_0 then
                    v16({
                        AssetId = v15,
                        Name = l_result_0.Name,
                        Builtin = l_startsWith_0(v15, "rbxasset://"),
                        Faces = l_result_0.Faces
                    });
                    return ;
                else
                    v17({
                        Error = l_result_0
                    });
                    return ;
                end;
            end):andThen(function(v20)
                v13[v20.AssetId] = v20;
            end):catch(function(v21)
                warn("Failed to load font family info:", v21);
            end):andThen(function()
                v11 = v11 + 1;
                if v12 <= v11 then
                    v9:dispatch(v5(v13));
                end;
            end);
        end;
    end;
end;


local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Dash);
local l_startsWith_0 = v2.startsWith;
local l_filter_0 = v2.filter;
local v5 = require(l_Parent_0.Src.Util.DesignHelpers);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v8)
    return function(v9, v10)
        local l_DesignSheet_0 = v9:getState().Window.DesignSheet;
        if l_DesignSheet_0 then
            assert(l_DesignSheet_0 ~= nil, "expecting valid design sheet");
            v10.recordChange({
                Name = "StyleEditor/ClearStyleSheetCategory",
                DisplayName = "StyleEditor - Clear StyleSheet Category",
                DoChange = function()
                    local l_v8_Attribute_0 = v8:GetAttribute("StyleCategory");
                    if l_v8_Attribute_0 then
                        if l_v8_Attribute_0 == "Themes" then
                            v8:SetDerives((l_filter_0(v8:GetDerives(), function(v13)
                                return not l_startsWith_0(v13:GetAttribute("StyleCategory"), "Tokens");
                            end)));
                            v5.removeDerive(l_DesignSheet_0, v8);
                        elseif l_v8_Attribute_0 == "Tokens" then
                            for _, v15 in l_ReplicatedStorage_0:GetDescendants() do
                                if v15:IsA("StyleSheet") then
                                    local l_v15_Attribute_0 = v15:GetAttribute("StyleCategory");
                                    if not (not l_v15_Attribute_0 or not l_startsWith_0(l_v15_Attribute_0, "Themes")) then
                                        v5.removeDerive(v15, v8);
                                    end;
                                end;
                            end;
                        end;
                        v8:SetAttribute("StyleCategory", nil);
                        return Enum.FinishRecordingOperation.Commit;
                    else
                        return Enum.FinishRecordingOperation.Cancel;
                    end;
                end
            });
            return ;
        else
            return ;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.DesignHelpers);
local v2 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v4 = require(l_Actions_0.Window.SelectItem);
local v5 = require(l_Actions_0.Window.SetDesignSheet);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v8, v9)
        local v10 = nil;
        v9.recordChange({
            Name = "StyleEditor/CreateDesignSheet",
            DisplayName = "StyleEditor - Create Design Sheet",
            DoChange = function()
                v10 = v1.createDesign();
                v8:dispatch(v5(v10));
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if v10 then
            v8:dispatch(v4((v2.createItemId(v10))));
        end;
        return v10;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local v2 = require(l_Parent_0.Src.Actions.Window.SelectItem);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v5, v6, v7)
    return function(v8, v9)
        local v10 = nil;
        v9.recordChange({
            Name = "StyleEditor/CreateStyleRule",
            DisplayName = "StyleEditor - Create StyleRule",
            DoChange = function()
                if not (v6:sub(1, 1) == ",") or not v5:IsA("StyleRule") then
                    v10 = Instance.new("StyleRule");
                    v10.Name = v6;
                    v10.Selector = v6;
                    v10.Parent = v5;
                else
                    v5.Selector = v5.Selector .. v6;
                    v5.Name = v5.Selector;
                    v10 = v5;
                end;
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if not (not v7 or not v10) then
            v8:dispatch(v2((v1.createItemId(v10))));
        end;
        return v10;
    end;
end;


local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local v3 = require(l_Parent_0.Src.Actions.Window.SelectItem);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v6, v7)
        local l_DesignSheet_0 = v6:getState().Window.DesignSheet;
        local v9 = nil;
        v7.recordChange({
            Name = "StyleEditor/CreateThemeCategory",
            DisplayName = "StyleEditor - Create Theme Category",
            DoChange = function()
                v9 = Instance.new("Folder");
                v9.Name = "Folder";
                v9.Parent = if not l_DesignSheet_0 then l_ReplicatedStorage_0 else l_DesignSheet_0.Parent;
                v9:SetAttribute("StyleCategory", "Themes");
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if v9 then
            v6:dispatch(v3((v2.createItemId(v9))));
        end;
        return v9;
    end;
end;


local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Src.Util.DesignHelpers);
local v3 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v5 = require(l_Actions_0.Window.SelectItem);
local v6 = require(l_Actions_0.Window.SetDesignSheet);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v9)
    return function(v10, v11)
        local l_DesignSheet_0 = v10:getState().Window.DesignSheet;
        local v13 = nil;
        v11.recordChange({
            Name = "StyleEditor/CreateThemeSheet",
            DisplayName = "StyleEditor - Create Theme Sheet",
            DoChange = function()
                if not l_DesignSheet_0 then
                    l_DesignSheet_0 = v2.createDesign();
                    v10:dispatch(v6(l_DesignSheet_0));
                end;
                assert(l_DesignSheet_0 ~= nil, "expecting valid design sheet");
                v13 = Instance.new("StyleSheet");
                v13.Name = "StyleSheet";
                v13.Parent = v9 or l_ReplicatedStorage_0;
                v13:SetAttribute("StyleCategory", "Themes");
                v2.setAsTheme(v13, l_DesignSheet_0);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if v13 then
            v10:dispatch(v5((v3.createItemId(v13))));
        end;
        return v13;
    end;
end;


local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Src.Util.DesignHelpers);
local v3 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local v4 = require(l_Parent_0.Src.Actions.Window.SelectItem);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, v8)
        local l_DesignSheet_0 = v7:getState().Window.DesignSheet;
        local v10 = nil;
        v8.recordChange({
            Name = "StyleEditor/CreateTokenSheet",
            DisplayName = "StyleEditor - Create Token Sheet",
            DoChange = function()
                v10 = Instance.new("StyleSheet");
                v10.Name = "StyleSheet";
                v10.Parent = if not l_DesignSheet_0 then l_ReplicatedStorage_0 else l_DesignSheet_0.Parent;
                v10:SetAttribute("StyleCategory", "Tokens");
                v2.setAsToken(v10, l_DesignSheet_0);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if v10 then
            v7:dispatch(v4((v3.createItemId(v10))));
        end;
        return v10;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v3)
    return function(_, v5)
        if v3 then
            v5.recordChange({
                Name = "StyleEditor/DeleteInstance",
                DisplayName = "StyleEditor - Delete Instance",
                DoChange = function()
                    if v3:IsA("Folder") then
                        for _, v7 in v3:GetChildren() do
                            local l_v7_Attribute_0 = v7:GetAttribute("StyleCategory");
                            if not ((l_v7_Attribute_0 and l_v7_Attribute_0 == "Themes") and v7:IsA("StyleSheet")) then
                                v7.Parent = v3.Parent;
                            end;
                        end;
                    end;
                    v3:Remove();
                    return Enum.FinishRecordingOperation.Commit;
                end
            });
            return ;
        else
            return ;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
local function v10(v4, v5)
    for v6 = 0, 2 do
        local v7 = v6 * 1000;
        for v8 = 0, 99 do
            local v9 = ("%*_%*"):format(v5, (tostring((v7 + 2) + v8)));
            if v4:GetAttribute(v9) == nil then
                return v9;
            end;
        end;
    end;
    return nil;
end;
return function(v11, v12)
    return function(_, v14)
        local l_v11_Attribute_0 = v11:GetAttribute(v12);
        if l_v11_Attribute_0 == nil then
            return ;
        else
            local v16 = v10(v11, v12);
            if v16 then
                assert(v16 ~= nil, "expecing valid attribute name");
                v14.recordChange({
                    Name = "StyleEditor/DuplicateAttribute",
                    DisplayName = "StyleEditor - Duplicate Attribute",
                    DoChange = function()
                        v11:SetAttribute(v16, l_v11_Attribute_0);
                        return Enum.FinishRecordingOperation.Commit;
                    end
                });
                return ;
            else
                return ;
            end;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local v2 = require(l_Parent_0.Src.Actions.Window.SelectItem);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v5, v6)
    return function(v7, v8)
        local v9 = nil;
        v8.recordChange({
            Name = "StyleEditor/DuplicateInstance",
            DisplayName = "StyleEditor - Duplicate Instance",
            DoChange = function()
                v9 = v5:Clone();
                v9.Parent = v6;
                return Enum.FinishRecordingOperation.Commit;
            end
        });
        if v9 then
            v7:dispatch(v2((v1.createItemId(v9))));
        end;
        return v9;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local v2 = require(l_Parent_0.Src.Actions.Window.SelectItem);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v5)
    return function(v6, v7)
        local l_Instance_0 = v6:getState().Clipboard.Instance;
        if l_Instance_0 then
            assert(l_Instance_0 ~= nil, "expecting valid instance");
            local v9 = nil;
            v7.recordChange({
                Name = "StyleEditor/PasteInstanceInto",
                DisplayName = "StyleEditor - Paste Instance",
                DoChange = function()
                    v9 = l_Instance_0:Clone();
                    v9.Parent = v5;
                    return Enum.FinishRecordingOperation.Commit;
                end
            });
            if v9 then
                v6:dispatch(v2((v1.createItemId(v9))));
            end;
            return v9;
        else
            return nil;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v3)
    return function(v4, v5)
        local l_Attribute_0 = v4:getState().Clipboard.Attribute;
        if l_Attribute_0 then
            assert(l_Attribute_0 ~= nil, "expecting valid attribute");
            v5.recordChange({
                Name = "StyleEditor/PasteStyleInstanceAttribute",
                DisplayName = "StyleEditor - Paste StyleInstance Token",
                DoChange = function()
                    v3:SetAttribute(l_Attribute_0.Name, l_Attribute_0.Value);
                    return Enum.FinishRecordingOperation.Commit;
                end
            });
            return ;
        else
            return ;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.SelectorHelpers);
local v2 = require(l_Parent_0.Src.Util.StyleSchema);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v5, v6, v7)
    assert(v5 and v5:IsA("StyleRule"), "expecting valid StyleRule");
    return function(_, v9)
        if v6 == v7 then
            return ;
        else
            local v10 = v2.getPropertySchema(v7, (v1.findFirstClassSelector(v5)));
            if v10 then
                local v11 = v10.GetDefaultValue();
                local v12 = if typeof(v11) == typeof((v5:GetPropertyResolved(v6))) then v5:GetProperty(v6) else v11;
                v9.recordChange({
                    Name = "StyleEditor/RenameStyleRuleProperty",
                    DisplayName = "StyleEditor - Rename StyleRule Property",
                    DoChange = function()
                        v5:SetProperty(v6, nil);
                        v5:SetProperty(v7, v12);
                        return Enum.FinishRecordingOperation.Commit;
                    end
                });
                return ;
            else
                return ;
            end;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
return function(v4, v5, v6)
    return function(_, v8)
        v8.recordChange({
            Name = "StyleEditor/SetStyleInstanceAttribute",
            DisplayName = "StyleEditor - Set StyleInstance Token",
            DoChange = function()
                v4:SetAttribute(v5, v6);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
return function(v4, v5, v6)
    assert(v4 and v4:IsA("StyleRule"), "expecting valid StyleRule");
    return function(_, v8)
        v8.recordChange({
            Name = "StyleEditor/SetStyleRuleProperty",
            DisplayName = "StyleEditor - Set StyleRule Property",
            DoChange = function()
                v4:SetProperty(v5, v6);
                local v9 = typeof(v6);
                if not (v9 ~= "Color3") or v9 == "ColorSequence" then
                    return Enum.FinishRecordingOperation.Append;
                else
                    return Enum.FinishRecordingOperation.Commit;
                end;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.StyleSchema);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
return function(v5, v6, v7)
    local v8 = nil;
    if v7 == "TokenReference" then
        v8 = v1.TokenReferenceSchema.GetDefaultValue();
    else
        local v9 = v1.PropertySchemas[v7];
        assert(v9 ~= nil, (("unknown schema for type: %*"):format(v7)));
        v8 = v9.GetDefaultValue();
    end;
    return function(_, v11)
        v11.recordChange({
            Name = "StyleEditor/SetSyleRulePropertyType",
            DisplayName = "StyleEditor - Set StyleRule Property Type",
            DoChange = function()
                v5:SetProperty(v6, v8);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v3, v4)
    return function(_, v6)
        assert(v3 and v3:IsA("StyleRule"), "expecting valid StyleRule");
        v6.recordChange({
            Name = "StyleEditor/SetStyleRuleSelector",
            DisplayName = "StyleEditor - Set StyleRule Selector",
            DoChange = function()
                v3.Selector = v4;
                v3.Name = v4;
                return Enum.FinishRecordingOperation.Commit;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.Window.SetDesignSheet);
local v2 = require(l_Parent_0.Src.Util.DesignHelpers);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v5, v6)
    return function(v7, v8)
        local l_DesignSheet_0 = v7:getState().Window.DesignSheet;
        if l_DesignSheet_0 then
            assert(l_DesignSheet_0 ~= nil, "expecting valid design sheet");
            v8.recordChange({
                Name = "StyleEditor/SetStyleSheetCategory",
                DisplayName = "StyleEditor - Set StyleSheet Category",
                DoChange = function()
                    if v6 == "Designs" then
                        l_DesignSheet_0:SetAttribute("StyleCategory", nil);
                        v7:dispatch(v1(v5));
                    elseif v6 == "Themes" then
                        v2.setAsTheme(v5, l_DesignSheet_0);
                    elseif v6 == "Tokens" then
                        v2.setAsToken(v5, l_DesignSheet_0);
                    else
                        warn("Unknown StyleSheetCategory:", v6);
                    end;
                    v5:SetAttribute("StyleCategory", v6);
                    return Enum.FinishRecordingOperation.Commit;
                end
            });
            return ;
        else
            return ;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.StyleSchema);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
return function(v5, v6, v7)
    local v8 = nil;
    if v7 == "TokenReference" then
        v8 = v1.TokenReferenceSchema.GetDefaultValue();
    else
        local v9 = v1.PropertySchemas[v7];
        assert(v9 ~= nil, (("unknown schema for type: %*"):format(v7)));
        v8 = v9.GetDefaultValue();
    end;
    return function(_, v11)
        v11.recordChange({
            Name = "StyleEditor/SetStyleSheetTokenType",
            DisplayName = "StyleEditor - Set Token Type",
            DoChange = function()
                v5:SetAttribute(v6, v8);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
    end;
end;


local l_Selection_0 = game:GetService("Selection");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v4)
    return function(_, _)
        l_Selection_0:Set({
            v4
        });
    end;
end;


local l_StylingService_0 = game:GetService("StylingService");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Src.Util.SelectorHelpers);
local v3 = require(l_Parent_0.Src.Util.StyleSchema);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
local function _(v7, v8)
    local v9 = nil;
    v9 = if not not v8 and #v8 > 0 then v3.allProperties[v8][v7] else v3.PropertySchemas[v3.getPossiblePropertyTypes(v7)[1]];
    assert(v9 ~= nil, (("unknown schema for: %* (%*)"):format(v7, v8)));
    return v9.GetDefaultValue();
end;
return function(v11, v12)
    return function(_, v14)
        v14.recordChange({
            Name = "StyleEditor/UnlinkStyleRulePropertyTokenReference",
            DisplayName = "StyleEditor - Unlink Token from StyleRule Property",
            DoChange = function()
                local v15 = l_StylingService_0:GetStyleInfo(v11).Properties[v12];
                if v15 then
                    local l_Value_0 = v15.Value;
                    if v15.Error or l_Value_0 == "$" then
                        local v17 = v2.findFirstClassSelector(v11);
                        local l_v12_0 = v12;
                        local v19 = nil;
                        v19 = if not not v17 and #v17 > 0 then v3.allProperties[v17][l_v12_0] else v3.PropertySchemas[v3.getPossiblePropertyTypes(l_v12_0)[1]];
                        assert(v19 ~= nil, (("unknown schema for: %* (%*)"):format(l_v12_0, v17)));
                        l_Value_0 = v19.GetDefaultValue();
                    end;
                    v11:SetProperty(v12, l_Value_0);
                    return Enum.FinishRecordingOperation.Commit;
                else
                    return Enum.FinishRecordingOperation.Cancel;
                end;
            end
        });
    end;
end;


local l_StylingService_0 = game:GetService("StylingService");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local _ = require(l_Parent_0.Src.Types);
return function(v5, v6)
    return function(_, v8)
        v8.recordChange({
            Name = "StyleEditor/UnlinkStyleSheetAttributeTokenReference",
            DisplayName = "StyleEditor - Unlink StyleSheet Token",
            DoChange = function()
                local v9 = l_StylingService_0:GetStyleSheetInfo(v5).Variables[v6];
                if not (v9 ~= nil) or v9 == "$" then
                    v9 = "";
                end;
                v5:SetAttribute(v6, v9);
                return Enum.FinishRecordingOperation.Commit;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v5 = require(l_Thunks_0.Change.CreateStyleRule);
local v6 = require(l_Thunks_0.Change.DeleteInstance);
local v7 = require(l_Thunks_0.Change.PasteInstanceInto);
local v8 = require(l_Thunks_0.Change.ShowInstanceInExplorer);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v11, v12)
    return function(v13, v14)
        local v15 = v13:getState();
        local l_Localization_0 = v14.Localization;
        local v22 = {
            Id = "DesignSheet",
            Children = {
                v2.getNewSelectorAction(v11, function(v17)
                    v13:dispatch(v5(v11, v17.Data.Selector, true));
                end, l_Localization_0),
                v2.getRenameAction(function(_)
                    v12();
                end, l_Localization_0),
                {
                    Id = "Delete",
                    Text = l_Localization_0:getText("ContextMenu", "Delete"),
                    Icon = v3.delete(),
                    OnItemClicked = function(_)
                        v13:dispatch(v6(v11));
                    end
                },
                {
                    Id = "PasteInto",
                    Text = l_Localization_0:getText("ContextMenu", "PasteInto"),
                    Icon = v3.paste(),
                    Enabled = v15.Clipboard.Instance ~= nil,
                    OnItemClicked = function(_)
                        v13:dispatch(v7(v11));
                    end
                },
                {
                    Id = "ShowInExplorer",
                    Text = l_Localization_0:getText("ContextMenu", "ShowInExplorer"),
                    Icon = v2.getClassIcon("ReplicatedStorage"),
                    OnItemClicked = function(_)
                        v13:dispatch(v8(v11));
                    end
                }
            }
        };
        v2.trackClicks(v22, v14.Telemetry);
        v2.showContextMenu(v14.Plugin, v22);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.PasteStyleInstanceAttribute);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v7)
    return function(v8, v9)
        local v11 = {
            Id = "Token_Empty",
            Children = {
                {
                    Id = "Paste",
                    Text = v9.Localization:getText("ContextMenu", "Paste"),
                    Enabled = v8:getState().Clipboard.Attribute ~= nil,
                    Icon = v3.paste(),
                    OnItemClicked = function(_)
                        v8:dispatch(v4(v7));
                    end
                }
            }
        };
        v2.trackClicks(v11, v9.Telemetry);
        v2.showContextMenu(v9.Plugin, v11);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.CreateStyleRule);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v7, v8)
    return function(v9, v10)
        local v12 = {
            Id = "DesignCategory",
            Children = {
                {
                    Id = "New",
                    Text = v10.Localization:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v9:dispatch(v4(v7, v8, true));
                    end
                }
            }
        };
        v2.trackClicks(v12, v10.Telemetry);
        v2.showContextMenu(v10.Plugin, v12);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.CreateDesignSheet);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, v8)
        local v10 = {
            Id = "DesignSheet_Nil",
            Children = {
                {
                    Id = "New",
                    Text = v8.Localization:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v7:dispatch(v4());
                    end
                }
            }
        };
        v2.trackClicks(v10, v8.Telemetry);
        v2.showContextMenu(v8.Plugin, v10);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v6 = require(l_Actions_0.Clipboard.CopyInstanceToClipboard);
local v7 = require(l_Actions_0.Window.SetItemsExpanded);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v9 = require(l_Thunks_0.Change.CreateStyleRule);
local v10 = require(l_Thunks_0.Change.DeleteInstance);
local v11 = require(l_Thunks_0.Change.DuplicateInstance);
local v12 = require(l_Thunks_0.Change.PasteInstanceInto);
local v13 = require(l_Thunks_0.Change.ShowInstanceInExplorer);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v16, v17, v18)
    return function(v19, v20)
        if v16 and v16:IsA("StyleRule") then
            local v21 = v19:getState();
            local l_Localization_0 = v20.Localization;
            local v30 = {
                Id = "StyleRule",
                Children = {
                    v2.getNewSelectorAction(v16, function(v23)
                        v19:dispatch(v9(v16, v23.Data.Selector, v18));
                        v19:dispatch(v7({
                            [v4.createItemId(v16)] = true
                        }));
                    end, l_Localization_0),
                    v2.getRenameAction(function(_)
                        v17();
                    end, l_Localization_0),
                    {
                        Id = "ShowInExplorer",
                        Text = l_Localization_0:getText("ContextMenu", "ShowInExplorer"),
                        Icon = v2.getClassIcon("ReplicatedStorage"),
                        OnItemClicked = function(_)
                            v19:dispatch(v13(v16));
                        end
                    },
                    {
                        Id = "Copy",
                        Text = l_Localization_0:getText("ContextMenu", "Copy"),
                        Icon = v3.copy(),
                        OnItemClicked = function(_)
                            v19:dispatch(v6(v16));
                        end
                    },
                    {
                        Id = "PasteInto",
                        Text = l_Localization_0:getText("ContextMenu", "PasteInto"),
                        Icon = v3.paste(),
                        Enabled = v21.Clipboard.Instance ~= nil,
                        OnItemClicked = function(_)
                            v19:dispatch(v12(v16));
                        end
                    },
                    {
                        Id = "Duplicate",
                        Text = l_Localization_0:getText("ContextMenu", "Duplicate"),
                        Icon = v3.duplicate(),
                        OnItemClicked = function(_)
                            assert(typeof(v16.Parent) == "Instance", "StyleRule expected to have a valid parent");
                            v19:dispatch(v11(v16, v16.Parent));
                        end
                    },
                    {
                        Id = "Delete",
                        Text = l_Localization_0:getText("ContextMenu", "Delete"),
                        Icon = v3.delete(),
                        OnItemClicked = function(_)
                            v19:dispatch(v10(v16));
                        end
                    }
                }
            };
            v2.trackClicks(v30, v20.Telemetry);
            v2.showContextMenu(v20.Plugin, v30);
            return ;
        else
            warn("Selected invalid StyleRule: ", v16);
            return ;
        end;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.DesignHelpers);
local v3 = require(l_Parent_0.Src.Util.MenuHelpers);
local v4 = require(l_Parent_0.Src.Resources.ModernIcons);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v6 = require(l_Thunks_0.Change.ClearStyleSheetCategory);
local v7 = require(l_Thunks_0.Change.CreateStyleRule);
local v8 = require(l_Thunks_0.Change.DeleteInstance);
local v9 = require(l_Thunks_0.Change.DuplicateInstance);
local v10 = require(l_Thunks_0.Change.PasteInstanceInto);
local v11 = require(l_Thunks_0.Change.SetStyleSheetCategory);
local v12 = require(l_Thunks_0.Change.ShowInstanceInExplorer);
local l_join_0 = require(l_Parent_0.Packages.Dash).join;
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v16, v17)
    return function(v18, v19)
        local v20 = v18:getState();
        local l_Localization_0 = v19.Localization;
        local v23 = v3.getNewSelectorAction(v16, function(v22)
            v18:dispatch(v7(v16, v22.Data.Selector, true));
        end, l_Localization_0);
        local v25 = v3.getRenameAction(function(_)
            v17();
        end, l_Localization_0);
        local v28 = v3.getStyleSheetCategoryActions(function(v26)
            local l_Category_0 = v26.Data.Category;
            if l_Category_0 then
                v18:dispatch(v11(v16, l_Category_0));
                return ;
            else
                return ;
            end;
        end, l_Localization_0);
        local v29 = v20.Clipboard.Instance ~= nil;
        local v30 = v16:GetAttribute("StyleCategory") or "";
        local v31 = v2.isTheme(v16);
        local v32 = v30 == "Tokens" or v31;
        local v38 = {
            Id = "StyleSheet",
            Children = {
                l_join_0(v23, {
                    Hidden = v32
                }),
                v25,
                {
                    Id = "Duplicate",
                    Text = l_Localization_0:getText("ContextMenu", "Duplicate"),
                    Icon = v4.duplicate(),
                    OnItemClicked = function(_)
                        v18:dispatch(v9(v16, v16.Parent));
                    end
                },
                {
                    Id = "Delete",
                    Text = l_Localization_0:getText("ContextMenu", "Delete"),
                    Icon = v4.delete(),
                    OnItemClicked = function(_)
                        v18:dispatch(v8(v16));
                    end
                },
                {
                    Id = "PasteInto",
                    Text = l_Localization_0:getText("ContextMenu", "PasteInto"),
                    Icon = v4.paste(),
                    Hidden = v32,
                    Enabled = v29,
                    OnItemClicked = function(_)
                        v18:dispatch(v10(v16));
                    end
                },
                {
                    Id = "ShowInExplorer",
                    Text = l_Localization_0:getText("ContextMenu", "ShowInExplorer"),
                    Icon = v3.getClassIcon("ReplicatedStorage"),
                    OnItemClicked = function(_)
                        v18:dispatch(v12(v16));
                    end
                },
                {
                    Id = "RemoveFromCategory",
                    Text = l_Localization_0:getText("ContextMenu", not v31 and "RemoveFromTokens" or "RemoveFromThemes"),
                    Icon = v4.remove(),
                    Hidden = not v32,
                    OnItemClicked = function(_)
                        v18:dispatch(v6(v16));
                    end,
                    Data = {
                        Category = v30
                    }
                },
                {
                    Id = "SetCategory",
                    Text = l_Localization_0:getText("ContextMenu", "SetCategory"),
                    Icon = v4.set(),
                    Hidden = v32,
                    Children = v28
                }
            }
        };
        v3.trackClicks(v38, v19.Telemetry);
        v3.showContextMenu(v19.Plugin, v38);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.CreateThemeCategory);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, v8)
        local v10 = {
            Id = "ThemeCategory",
            Children = {
                {
                    Id = "New",
                    Text = v8.Localization:getText("ContextMenu", "NewCategory"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v7:dispatch(v4());
                    end
                }
            }
        };
        v2.trackClicks(v10, v8.Telemetry);
        v2.showContextMenu(v8.Plugin, v10);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v5 = require(l_Thunks_0.Change.CreateThemeSheet);
local v6 = require(l_Thunks_0.Change.DeleteInstance);
local v7 = require(l_Thunks_0.Change.ShowInstanceInExplorer);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v10, v11)
    return function(v12, v13)
        local l_Localization_0 = v13.Localization;
        local v19 = {
            Id = "ThemeCategory_Folder",
            Children = {
                {
                    Id = "New",
                    Text = l_Localization_0:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v12:dispatch(v5(v10));
                    end
                },
                {
                    Id = "Delete",
                    Text = l_Localization_0:getText("ContextMenu", "Delete"),
                    Icon = v3.delete(),
                    OnItemClicked = function(_)
                        v12:dispatch(v6(v10));
                    end
                },
                v2.getRenameAction(function(_)
                    v11();
                end, l_Localization_0),
                {
                    Id = "ShowInExplorer",
                    Text = l_Localization_0:getText("ContextMenu", "ShowInExplorer"),
                    Icon = v2.getClassIcon("ReplicatedStorage"),
                    OnItemClicked = function(_)
                        v12:dispatch(v7(v10));
                    end
                }
            }
        };
        v2.trackClicks(v19, v13.Telemetry);
        v2.showContextMenu(v13.Plugin, v19);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.CreateThemeSheet);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, v8)
        local v10 = {
            Id = "ThemeCategory_Other",
            Children = {
                {
                    Id = "New",
                    Text = v8.Localization:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v7:dispatch(v4(nil));
                    end
                }
            }
        };
        v2.trackClicks(v10, v8.Telemetry);
        v2.showContextMenu(v8.Plugin, v10);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local v4 = require(l_Parent_0.Src.Thunks.Change.CreateTokenSheet);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v7, v8)
        local v10 = {
            Id = "TokenCategory",
            Children = {
                {
                    Id = "New",
                    Text = v8.Localization:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    OnItemClicked = function(_)
                        v7:dispatch(v4());
                    end
                }
            }
        };
        v2.trackClicks(v10, v8.Telemetry);
        v2.showContextMenu(v8.Plugin, v10);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Util.TokenHelpers);
local v4 = require(l_Parent_0.Src.Resources.ModernIcons);
local v5 = require(l_Parent_0.Src.Actions.Clipboard.CopyAttributeToClipboard);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v7 = require(l_Thunks_0.Change.DuplicateAttribute);
local v8 = require(l_Thunks_0.Change.PasteStyleInstanceAttribute);
local v9 = require(l_Thunks_0.Change.SetStyleSheetTokenType);
local v10 = require(l_Thunks_0.Change.SetStyleInstanceAttribute);
local v11 = require(l_Thunks_0.Change.UnlinkStyleSheetAttributeTokenReference);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
local function _(v14, v15)
    return v3.parseAttributeName((v14:GetAttribute(v15))) ~= nil;
end;
return function(v17, v18)
    return function(v19, v20)
        local v21 = v19:getState();
        local l_Localization_0 = v20.Localization;
        local l_v17_Attribute_0 = v17:GetAttribute(v18);
        local v32 = {
            Id = "Token",
            Children = {
                {
                    Id = "ChangeType",
                    Text = l_Localization_0:getText("ContextMenu", "ChangeType"),
                    Children = v2.getAttributeTypeActions(v2.AttributeTypes, function(v24)
                        local v25 = if not v24.Data then nil else v24.Data.Type;
                        if v25 then
                            v19:dispatch(v9(v17, v18, v25));
                            return ;
                        else
                            warn("Cannot change to nil type");
                            return ;
                        end;
                    end)
                },
                if not (v3.parseAttributeName((v17:GetAttribute(v18))) ~= nil) then {
                    Id = "LinkToken",
                    Text = l_Localization_0:getText("ContextMenu", "LinkToken"),
                    Icon = v4.Standard.TokenSheet(),
                    OnItemClicked = function(_)
                        v19:dispatch(v9(v17, v18, "TokenReference"));
                    end
                } else {
                    Id = "UnlinkToken",
                    Text = l_Localization_0:getText("ContextMenu", "UnlinkToken"),
                    Icon = v4.Standard.TokenSheet(),
                    OnItemClicked = function(_)
                        v19:dispatch(v11(v17, v18));
                    end
                },
                {
                    Id = "Copy",
                    Text = l_Localization_0:getText("ContextMenu", "Copy"),
                    Icon = v4.copy(),
                    OnItemClicked = function(_)
                        v19:dispatch(v5(v18, l_v17_Attribute_0));
                    end
                },
                {
                    Id = "Paste",
                    Text = l_Localization_0:getText("ContextMenu", "Paste"),
                    Enabled = v21.Clipboard.Attribute ~= nil,
                    Icon = v4.paste(),
                    OnItemClicked = function(_)
                        v19:dispatch(v8(v17));
                    end
                },
                {
                    Id = "Duplicate",
                    Text = l_Localization_0:getText("ContextMenu", "Duplicate"),
                    Icon = v4.duplicate(),
                    OnItemClicked = function(_)
                        v19:dispatch(v7(v17, v18));
                    end
                },
                {
                    Id = "Delete",
                    Text = l_Localization_0:getText("ContextMenu", "Delete"),
                    Icon = v4.delete(),
                    OnItemClicked = function(_)
                        v19:dispatch(v10(v17, v18, nil));
                    end
                }
            }
        };
        v2.trackClicks(v32, v20.Telemetry);
        v2.showContextMenu(v20.Plugin, v32);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local v2 = require(l_Parent_0.Src.Util.MenuHelpers);
local v3 = require(l_Parent_0.Src.Resources.ModernIcons);
local l_Thunks_0 = l_Parent_0.Src.Thunks;
local v5 = require(l_Thunks_0.Change.CreateStyleRule);
local v6 = require(l_Thunks_0.Change.PasteInstanceInto);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v9)
    return function(v10, v11)
        local v12 = v10:getState();
        local l_Localization_0 = v11.Localization;
        local v16 = {
            Id = "DesignCategory_UiElements",
            Children = {
                {
                    Id = "New",
                    Text = l_Localization_0:getText("ContextMenu", "New"),
                    Icon = v3.new(),
                    Children = v2.getClassTypeActions(function(v14)
                        v10:dispatch(v5(v9, v14.Data.Selector, true));
                    end, l_Localization_0)
                },
                {
                    Id = "PasteInto",
                    Text = l_Localization_0:getText("ContextMenu", "PasteInto"),
                    Icon = v3.paste(),
                    Enabled = v12.Clipboard.Instance ~= nil,
                    OnItemClicked = function(_)
                        v10:dispatch(v6(v9));
                    end
                }
            }
        };
        v2.trackClicks(v16, v11.Telemetry);
        v2.showContextMenu(v11.Plugin, v16);
    end;
end;


local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Src.Util.DesignHelpers);
local v3 = require(l_Parent_0.Src.Util.TreeTableHelpers);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v5 = require(l_Actions_0.Window.DeselectItem);
local v6 = require(l_Actions_0.Window.SetDesignSheet);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
local function v16(v9)
    local v10 = false;
    local l_l_ReplicatedStorage_0_0 = l_ReplicatedStorage_0;
    local v12 = v9.Parent == nil;
    local v13 = "Derive from " .. v9.Name;
    for _, v15 in l_l_ReplicatedStorage_0_0:GetDescendants() do
        if not ((not v15:IsA("StyleDerive") or not v15.Parent) or not v2.isPartOfDesignSystem(v15.Parent)) and v15.StyleSheet == v9 then
            if not v12 then
                v15.Name = v13;
            else
                v15.Parent = nil;
            end;
            v10 = true;
        end;
    end;
    return v10;
end;
return function(v17)
    return function(v18, v19)
        local v20 = v18:getState();
        if v17.Parent == nil then
            v18:dispatch(v5((v3.createItemId(v17))));
            if v20.Window.DesignSheet == v17 then
                v18:dispatch(v6(nil));
            end;
        end;
        v19.recordChange({
            Name = "StyleEditor/UpdateStyleSheetReferences",
            DisplayName = "StyleEditor - Update StyleSheet References",
            DoChange = function()
                if not v16(v17) then
                    return Enum.FinishRecordingOperation.Cancel;
                else
                    return Enum.FinishRecordingOperation.Append;
                end;
            end
        });
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Resources.Telemetry.PluginMountedEvent);
local v2 = require(l_Parent_0.Src.Actions.SessionStats.SetSessionStartTimestamp);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v6)
    return function(v7, v8)
        v8.Telemetry:logTelemetryEvent(v1({
            loadTimeMillis = v6
        }));
        v7:dispatch(v2((os.time())));
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Resources.Telemetry.PluginUnmountedEvent);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v5, v6)
        local v7 = v5:getState();
        v6.Telemetry:logTelemetryEvent(v1({
            sessionLengthSeconds = os.time() - v7.SessionStats.SessionStartTimestamp,
            focusTimeSeconds = v7.SessionStats.TotalPluginFocusTimeSeconds,
            unmatchedFocusEndCount = v7.SessionStats.PluginFocusEndWithoutStartCount,
            buttonPressCounts = v7.SessionStats.ButtonPressCounts
        }));
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function(v4)
    return function(_, v6)
        v6.Telemetry:logTelemetryEvent(v4);
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.SessionStats.PluginFocusStart);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v5, _)
        v5:dispatch(v1((os.time())));
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.SessionStats.PluginFocusEnd);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Reducers.RootReducer);
local _ = require(l_Parent_0.Src.Thunks.Types);
return function()
    return function(v5, _)
        v5:dispatch(v1((os.time())));
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Packages.Rodux);
local _ = require(l_Parent_0.Src.Util.recordChange);
local _ = require(l_Parent_0.Src.Types);
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
return {};


local l_Workspace_0 = game:GetService("Workspace");
local l_StudioService_0 = game:GetService("StudioService");
local function v7(v2)
    assert(typeof(v2.Name) == "string", "DebugFlag name must be a string");
    assert(typeof(v2.Default) == "boolean", "DebugFlag default value must be a boolean");
    local v3 = true;
    if v2.DefaultForInternalUsers ~= nil then
        v3 = typeof(v2.DefaultForInternalUsers) == "boolean";
    end;
    assert(v3, "DebugFlag default value for internal users must be either a boolean or nil");
    return function()
        local v4 = if not not l_StudioService_0:HasInternalPermission() and v2.DefaultForInternalUsers ~= nil then v2.DefaultForInternalUsers else v2.Default;
        local l_StyleEditor_0 = l_Workspace_0:FindFirstChild("StyleEditor");
        if l_StyleEditor_0 and l_StyleEditor_0:IsA("Folder") then
            local l_l_StyleEditor_0_FirstChild_0 = l_StyleEditor_0:FindFirstChild(v2.Name);
            if l_l_StyleEditor_0_FirstChild_0 and l_l_StyleEditor_0_FirstChild_0:IsA("BoolValue") then
                return l_l_StyleEditor_0_FirstChild_0.Value;
            else
                return v4;
            end;
        else
            return v4;
        end;
    end;
end;
return {
    LogNetworkErrors = v7({
        Name = "LogNetworkErrors",
        Default = false,
        DefaultForInternalUsers = true
    }),
    LogTelemetry = v7({
        Name = "LogTelemetry",
        Default = false
    })
};


local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_StylingService_0 = game:GetService("StylingService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v4 = require(l_Parent_0.Packages.Framework);
local v5 = require(l_Parent_0.Src.Util.SelectorHelpers);
local v6 = require(l_Parent_0.Src.Util.recordChange)(l_ChangeHistoryService_0);
local v7 = require(l_Parent_0.Packages.Dash);
local l_includes_0 = v7.includes;
local l_startsWith_0 = v7.startsWith;
local l_insert_0 = table.insert;
local l_createStyleSheet_0 = v4.Styling.createStyleSheet;
local v20 = {
    PATHS = {
        DESIGN = {
            1
        },
        UI_ELEMENTS = {
            1,
            1
        },
        THEMES = {
            3
        },
        SELECTOR = {
            1
        }
    },
    getSelectorCategory = function(v12)
        if not l_startsWith_0(v12, ".") then
            if not v5.isElement(v12) then
                return "Other";
            else
                return "UI Elements";
            end;
        else
            return "Tags";
        end;
    end,
    isUnderPath = function(v13, v14)
        if #v13 < #v14 then
            return false;
        else
            for v15, v16 in v14, nil, nil do
                if v16 ~= v13[v15] then
                    return false;
                end;
            end;
            return true;
        end;
    end,
    isPartOfDesignSystem = function(v17)
        local v18 = if not not v17:IsA("StyleDerive") and v17.Parent then v17.Parent:GetAttribute("StyleCategory") else v17:GetAttribute("StyleCategory");
        local l_v18_0 = v18;
        if l_v18_0 then
            l_v18_0 = true;
            if v18 ~= "Themes" then
                l_v18_0 = true;
                if v18 ~= "Tokens" then
                    l_v18_0 = v18 == "Designs";
                end;
            end;
        end;
        return l_v18_0;
    end
};
v20.setAsToken = function(v21, v22)
    local v23 = false;
    for _, v25 in l_ReplicatedStorage_0:GetDescendants() do
        local v26 = v20.isTheme(v25);
        if not (not v25:IsA("StyleSheet") or not v26) then
            v23 = true;
            v20.insertDerive(v25, v21);
        end;
    end;
    if not (not v22 or v23) then
        v20.insertDerive(v22, v21);
    end;
end;
v20.setAsTheme = function(v27, v28)
    local l_v28_Derives_0 = v28:GetDerives();
    local v30 = {};
    for _, v32 in l_ReplicatedStorage_0:GetDescendants() do
        local l_v32_Attribute_0 = v32:GetAttribute("StyleCategory");
        if v32:IsA("StyleSheet") then
            if l_v32_Attribute_0 == "Tokens" then
                if l_includes_0(l_v28_Derives_0, v32) then
                    v20.removeDerive(v28, v32);
                end;
                v20.insertDerive(v27, v32);
            elseif not (not (l_v32_Attribute_0 == "Themes") or v32.Parent:IsA("Folder")) then
                l_insert_0(v30, v32);
            end;
        end;
    end;
    local v34 = if not not v27.Parent and v27.Parent:IsA("Folder") then v27.Parent else nil;
    local v35 = if not v34 then v30 else v34:GetChildren();
    local v36 = false;
    for _, v38 in v35, nil, nil do
        local l_v38_Attribute_0 = v38:GetAttribute("StyleCategory");
        if not (not ((v38:IsA("StyleSheet") and l_v38_Attribute_0 ~= "Tokens") and l_v38_Attribute_0 ~= "Designs") or not l_includes_0(l_v28_Derives_0, v38)) then
            v36 = true;
            break;
        end;
    end;
    if not v36 then
        v20.insertDerive(v28, v27);
    end;
end;
v20.isTheme = function(v40)
    if v40 and v40.Parent then
        assert(v40 ~= nil, "expecting valid stylesheet");
        if v40:GetAttribute("StyleCategory") == "Themes" then
            return true;
        else
            local l_Parent_1 = v40.Parent;
            if l_Parent_1:IsA("Folder") and l_Parent_1:GetAttribute("StyleCategory") == "Themes" then
                return true;
            else
                return false;
            end;
        end;
    else
        return false;
    end;
end;
v20.createDesign = function(v42)
    local v43 = nil;
    v6({
        Name = "StyleEditor.Add Design",
        DisplayName = "Style Editor - Add Design",
        DoChange = function()
            v43 = l_createStyleSheet_0("StyleSheet");
            if not (v42 and v42.Parent) then
                v43:SetAttribute("StyleCategory", "Designs");
                v43.Name = "Design";
            end;
            v43.Parent = l_ReplicatedStorage_0;
            return Enum.FinishRecordingOperation.Commit;
        end
    });
    return v43;
end;
v20.isValidDerive = function(v44, v45)
    local l_status_0, l_result_0 = pcall(function()
        return not l_includes_0(l_StylingService_0:GetStyleSheetDerivesChain(v45), v44) and not l_includes_0(v44:GetDerives(), v45);
    end);
    if l_status_0 and l_result_0 then
        return true;
    else
        return false;
    end;
end;
v20.insertDerive = function(v48, v49)
    if v48 and v49 then
        local l_StyleDerive_0 = Instance.new("StyleDerive");
        l_StyleDerive_0.Name = "Derive from " .. v49.Name;
        l_StyleDerive_0.Parent = v48;
        l_StyleDerive_0.StyleSheet = v49;
        return ;
    else
        return ;
    end;
end;
v20.removeDerive = function(v51, v52)
    if v51 and v52 then
        for _, v54 in v51:GetChildren() do
            if v54:IsA("StyleDerive") and v54.StyleSheet == v52 then
                v54:Remove();
            end;
        end;
        return ;
    else
        return ;
    end;
end;
v20.replaceDerive = function(v55, v56, v57)
    if v55 and v56 then
        for _, v59 in v55:GetChildren() do
            if v59:IsA("StyleDerive") and v59.StyleSheet == v57 then
                v59.StyleSheet = v56;
                local v60, v61 = v59.Name:find(v57.Name);
                if not (not v60 or not v61) then
                    v59.Name = v59.Name:sub(1, v60 - 1) .. v56.Name .. v59.Name:sub(v61 + 1);
                end;
                return ;
            end;
        end;
        v20.insertDerive(v55, v56);
        return ;
    else
        return ;
    end;
end;
return v20;


local l_StudioService_0 = game:GetService("StudioService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.React);
local _ = require(l_Parent_0.Packages.Rodux);
local l_showContextMenu_0 = require(l_Parent_0.Packages.Framework).UI.showContextMenu;
local v5 = require(l_Parent_0.Packages.Dash);
local l_map_0 = v5.map;
local l_filter_0 = v5.filter;
local l_join_0 = v5.join;
local v9 = require(l_Parent_0.Src.Resources.Telemetry.ContextMenuItemClickedEvent);
local _ = require(l_Parent_0.Src.Contexts.Telemetry.Types);
local _ = require(l_Parent_0.Src.Types);
local v12 = require(l_Parent_0.Src.Resources.ModernIcons);
local v16 = {
    Classes = {
        "CanvasGroup",
        "ImageButton",
        "ImageLabel",
        "ScrollingFrame",
        "Frame",
        "TextBox",
        "TextButton",
        "TextLabel"
    },
    PseudoInstances = {
        "UIAspectRatioConstraint",
        "UICorner",
        "UIGradient",
        "UIGridLayout",
        "UIListLayout",
        "UIPadding",
        "UIPageLayout",
        "UIScale",
        "UISizeConstraint",
        "UIStroke",
        "UITableLayout",
        "UITextSizeConstraint"
    },
    GuiStates = {
        "hover",
        "idle",
        "pressed"
    },
    AttributeTypes = {
        "string",
        "boolean",
        "number",
        "UDim",
        "UDim2",
        "BrickColor",
        "Color3",
        "Vector2",
        "Vector3",
        "CFrame",
        "ColorSequence",
        "NumberSequence",
        "NumberRange",
        "Rect",
        "Font"
    },
    getClassIcon = function(v13)
        local l_status_0, l_result_0 = pcall(function()
            return l_StudioService_0:GetClassIcon(v13);
        end);
        if not l_status_0 then
            return nil;
        else
            return l_result_0.Image;
        end;
    end,
    StyleSheetCategories = {
        {
            Name = "Tokens",
            Icon = v12.Standard.TokenSheet()
        },
        {
            Name = "Themes",
            Icon = v12.Standard.ThemeSheet()
        },
        {
            Name = "Designs",
            Icon = v12.Standard.DesignSheet()
        }
    },
    MoreAction = {
        {
            Id = "Menu",
            Icon = {
                Image = v12.more()
            },
            [v2.Tag] = "Contrast IconOnly"
        }
    },
    FullSpanMoreAction = {
        {
            Id = "Menu",
            Icon = {
                Image = v12.more()
            },
            [v2.Tag] = "IconOnly SecondaryHoverBackground"
        }
    }
};
v16.getStyleSheetCategoryActions = function(v17, v18)
    return l_map_0(v16.StyleSheetCategories, function(v19)
        return {
            Id = v19.Name,
            Text = v18:getText("Category", v19.Name),
            Icon = v19.Icon,
            OnItemClicked = v17,
            Data = {
                Category = v19.Name
            }
        };
    end);
end;
v16.getAttributeTypeActions = function(v20, v21)
    return l_map_0(v20, function(v22)
        return {
            Id = v22,
            Text = v22,
            OnItemClicked = v21,
            Data = {
                Type = v22
            }
        };
    end);
end;
v16.getClassTypeActions = function(v23, _)
    return l_map_0(v16.Classes, function(v25)
        return {
            Id = v25,
            Text = v25,
            Icon = v16.getClassIcon(v25),
            OnItemClicked = v23,
            Data = {
                Selector = v25
            }
        };
    end);
end;
v16.getNewSelectorAction = function(v26, v27, v28)
    local function v29(v30, v31)
        return l_map_0(v31, function(v32)
            if not v32.Children then
                return l_join_0(v32, {
                    Data = {
                        Selector = v30 .. v32.Data.Selector
                    }
                });
            else
                return l_join_0(v32, {
                    Children = v29(v30, v32.Children)
                });
            end;
        end);
    end;
    local v33 = v26:IsA("StyleRule");
    local v35 = l_map_0(v16.PseudoInstances, function(v34)
        return {
            Id = v34,
            Text = v34,
            Icon = v16.getClassIcon(v34),
            OnItemClicked = v27,
            Data = {
                Selector = "::" .. v34
            }
        };
    end);
    local v37 = l_map_0(v16.GuiStates, function(v36)
        return {
            Id = v36,
            Text = v36,
            Icon = v12.Selectors.GuiState(),
            OnItemClicked = v27,
            Data = {
                Selector = ":" .. v36
            }
        };
    end);
    local v38 = {
        Id = "Name",
        Icon = v12.Selectors.Name(),
        Text = v28:getText("ContextMenu", "New.Name"),
        OnItemClicked = v27,
        Data = {
            Selector = "#Name"
        }
    };
    local v39 = {
        Id = "Tag",
        Text = v28:getText("ContextMenu", "New.Tag"),
        Icon = v12.Selectors.Tag(),
        OnItemClicked = v27,
        Data = {
            Selector = ".Tag"
        }
    };
    local v40 = {
        Id = "Class",
        Icon = v12.Selectors.Class(),
        Text = v28:getText("ContextMenu", "New.Class"),
        OnItemClicked = v5.noop,
        Children = v16.getClassTypeActions(v27, v28)
    };
    local v41 = {
        Id = "Empty",
        Text = v28:getText("ContextMenu", "New.Empty"),
        OnItemClicked = v27,
        Data = {
            Selector = ""
        }
    };
    local v42 = {
        Id = "New",
        Text = v28:getText("ContextMenu", "New"),
        Icon = v12.new()
    };
    local v43 = {};
    local l_v38_0 = v38;
    local l_v39_0 = v39;
    local l_v40_0 = v40;
    local v47 = {
        Id = "PseudoInstance",
        Icon = v12.Selectors.PseudoInstance(),
        Text = v28:getText("ContextMenu", "New.PseudoInstance"),
        Children = v35
    };
    local v48 = {
        Id = "GuiState",
        Icon = v12.Selectors.GuiState(),
        Text = v28:getText("ContextMenu", "New.GuiState"),
        Children = v37
    };
    local v49 = {
        Id = "Enumerator",
        Icon = v12.Selectors.Enumerator(),
        Enabled = v33,
        Text = v28:getText("ContextMenu", "New.Enumerator")
    };
    local v50;
    if not v33 then
        v50 = nil;
    else
        local v51 = {
            v38,
            v39,
            v40,
            v41
        };
        local l_l_map_0_0 = l_map_0;
        local l_v51_0 = v51;
        local v54 = ",";
        local l_v54_0 = v54 --[[ copy: 24 -> 27 ]];
        v50 = l_l_map_0_0(l_v51_0, function(v56)
            if not v56.Children then
                return l_join_0(v56, {
                    Data = {
                        Selector = l_v54_0 .. v56.Data.Selector
                    }
                });
            else
                return l_join_0(v56, {
                    Children = v29(l_v54_0, v56.Children)
                });
            end;
        end);
    end;
    v49.Children = v50;
    v50 = {
        Id = "Child",
        Icon = v12.Selectors.Child(),
        Text = v28:getText("ContextMenu", "New.Child")
    };
    local v57 = {
        v38,
        v39,
        v40,
        v41
    };
    local l_l_map_0_1 = l_map_0;
    local l_v57_0 = v57;
    local v60 = ">";
    v50.Children = l_l_map_0_1(l_v57_0, function(v61)
        if not v61.Children then
            return l_join_0(v61, {
                Data = {
                    Selector = v60 .. v61.Data.Selector
                }
            });
        else
            return l_join_0(v61, {
                Children = v29(v60, v61.Children)
            });
        end;
    end);
    local v62 = {
        Id = "Descendant",
        Icon = v12.Selectors.Descendant(),
        Text = v28:getText("ContextMenu", "New.Descendant")
    };
    l_l_map_0_1 = {
        v38,
        v39,
        v40,
        v41
    };
    l_v57_0 = l_map_0;
    local l_l_l_map_0_1_0 = l_l_map_0_1;
    local v64 = ">>";
    v62.Children = l_v57_0(l_l_l_map_0_1_0, function(v65)
        if not v65.Children then
            return l_join_0(v65, {
                Data = {
                    Selector = v64 .. v65.Data.Selector
                }
            });
        else
            return l_join_0(v65, {
                Children = v29(v64, v65.Children)
            });
        end;
    end);
    v57 = v41;
    setlist { ['R012[1 to 9]'] = 'R013 to R021' };
    v42.Children = v43;
    return v42;
end;
v16.getRenameAction = function(v66, v67)
    return {
        Id = "Rename",
        Text = v67:getText("ContextMenu", "Rename"),
        Icon = v12.edit(),
        OnItemClicked = v66
    };
end;
v16.buildMenu = function(v68)
    local v70 = l_join_0(v68, (l_map_0(v16.filterHiddenActions(v68.Children or {}), function(v69)
        v69.Id = v68.Id .. "/" .. v69.Id;
        return (v16.buildMenu(v69));
    end)));
    v70.Children = nil;
    return v70;
end;
v16.decorateClickHandlers = function(v71, v72)
    local l_OnItemClicked_0 = v71.OnItemClicked;
    if l_OnItemClicked_0 then
        v71.OnItemClicked = function(v74)
            v72(v74);
            l_OnItemClicked_0(v74);
        end;
    end;
    if v71.Children then
        for _, v76 in v71.Children, nil, nil do
            v16.decorateClickHandlers(v76, v72);
        end;
    end;
end;
v16.trackClicks = function(v77, v78)
    v16.decorateClickHandlers(v77, function(v79)
        v78:logTelemetryEvent(v9({
            path = v79.Id,
            data = v79.Data
        }));
    end);
end;
v16.showContextMenu = function(v80, v81)
    l_showContextMenu_0(v80, (v16.buildMenu(v81)));
end;
v16.filterHiddenActions = function(v82)
    return l_filter_0(v82, function(v83)
        return v83.Hidden ~= true;
    end);
end;
return v16;


local l_StylingService_0 = game:GetService("StylingService");
local l_Parent_0 = script.Parent.Parent.Parent;
local l_createStyleLink_0 = require(l_Parent_0.Packages.Framework).Styling.createStyleLink;
local v3 = require(l_Parent_0.Src.Util.MenuHelpers);
local v4 = require(l_Parent_0.Src.Enums.InstancesHaveVariant);
local l_mapOne_0 = require(l_Parent_0.Packages.Dash).mapOne;
local v6 = {
    SelectorSyntax = {
        Blank = "",
        Child = ">",
        Descendant = ">>",
        GuiStateModifier = ":",
        Name = "#",
        PseudoInstance = "::",
        Tag = "."
    }
};
v6.isElement = function(v7)
    return l_mapOne_0(v3.Classes, function(v8)
        v7 = v7:gsub("%s+", "");
        local v9, v10 = v7:find(v8);
        if v9 then
            if v9 == 1 then
                return v8;
            elseif not (v7:sub(math.max(v9 - #v6.SelectorSyntax.Child, 1), v10) == v6.SelectorSyntax.Child .. v8) then
                if v7:sub(math.max(v9 - #v6.SelectorSyntax.Descendant, 1), v10) == v6.SelectorSyntax.Descendant .. v8 then
                    return v8;
                end;
            else
                return v8;
            end;
        end;
        return nil;
    end);
end;
v6.findFirstClassSelector = function(v11)
    if v11 and v11:IsA("StyleRule") then
        local v12 = false;
        if v11 ~= nil then
            v12 = v11:IsA("StyleRule");
        end;
        assert(v12, "style cannot be nil");
        local v13 = v6.getSelectorChain(v11);
        if v13 and v13.Class ~= "" then
            return v13.Class;
        else
            return "";
        end;
    else
        return "";
    end;
end;
v6.getSelectorChain = function(v14)
    if v14 ~= nil and v14:IsA("StyleRule") then
        local l_status_0, l_result_0 = pcall(function()
            return game:GetService("StylingService"):GetStyleInfo(v14).SelectorChains;
        end);
        if not l_status_0 then
            return nil;
        else
            return l_result_0[1][#l_result_0[1]];
        end;
    else
        return nil;
    end;
end;
v6.instancesHaveVariant = function(v17, v18)
    if not (v17 ~= nil) or #v17 == 0 then
        return v4.None;
    else
        local v19 = 0;
        for _, v21 in pairs(v17) do
            local l_status_1, l_result_1 = pcall(function()
                return l_StylingService_0:GetAppliedStyles(v21);
            end);
            if l_status_1 then
                for _, v25 in pairs(l_result_1) do
                    if v25.Instance == v18 then
                        v19 = v19 + 1;
                        break;
                    end;
                end;
            end;
        end;
        if #v17 <= v19 then
            return v4.All;
        elseif v19 <= 0 then
            return v4.None;
        else
            return v4.Mixed;
        end;
    end;
end;
v6.ruleHasTags = function(v26)
    if v26 == nil then
        return false;
    else
        local v27 = v6.getSelectorChain(v26);
        if v27 and #v27.Tags > 0 then
            return true;
        else
            return false;
        end;
    end;
end;
v6.canApplyVariant = function(v28, v29)
    if not (v28 ~= nil and v29 ~= nil) or #v29 == 0 then
        return false;
    else
        local v30 = v6.getSelectorChain(v28);
        if v30 then
            if v30.Name and v30.Name ~= "" then
                return false;
            elseif not v30.Class or v30.Class == "" then
                return true;
            else
                for _, v32 in pairs(v29) do
                    if v30.Class ~= v32.ClassName then
                        return false;
                    end;
                end;
                return true;
            end;
        else
            return false;
        end;
    end;
end;
v6.applyVariant = function(v33, v34)
    if not (v33 ~= nil) or v34 == nil then
        return ;
    else
        local v35 = v6.getSelectorChain(v33);
        if v35 == nil then
            return ;
        else
            for _, v37 in v35.Tags, nil, nil do
                v34:AddTag(v37);
            end;
            return ;
        end;
    end;
end;
v6.removeVariant = function(v38, v39)
    if not (v38 ~= nil) or v39 == nil then
        return ;
    else
        local v40 = v6.getSelectorChain(v38);
        if v40 == nil then
            return ;
        else
            for _, v42 in v40.Tags, nil, nil do
                v39:RemoveTag(v42);
            end;
            return ;
        end;
    end;
end;
v6.getStyleLinkRoot = function(v43)
    for _, v45 in {
        "ScreenGui",
        "SurfaceGui",
        "BillboardGui",
        "StarterGui",
        "Workspace",
        "PluginGuiService"
    }, nil, nil do
        if not v43:IsA(v45) then
            local l_v43_FirstAncestorWhichIsA_0 = v43:FindFirstAncestorWhichIsA(v45);
            if l_v43_FirstAncestorWhichIsA_0 then
                return l_v43_FirstAncestorWhichIsA_0;
            end;
        else
            return v43;
        end;
    end;
    return nil;
end;
v6.addStyleLinkToRoot = function(v47, v48)
    if v47 and v48 then
        if not v48:IsA("StyleRule") then
            if v48:IsA("StyleSheet") then
                local v49 = v6.getStyleLinkRoot(v47);
                if (not v49 or v49:FindFirstChildWhichIsA("StyleLink")) or not v48 then
                    return nil;
                else
                    return l_createStyleLink_0(v49, v48);
                end;
            else
                return nil;
            end;
        else
            return v6.addStyleLinkToRoot(v47, v48:FindFirstAncestorWhichIsA("StyleSheet"));
        end;
    else
        return nil;
    end;
end;
return v6;