local v0 = require(script.Parent.RegEx);
local v1 = {};
local v3 = {
    __index = v1,
    __tostring = function(v2)
        return (tostring(v2._innerRegEx));
    end
};
v1.exec = function(v4, v5)
    local v6 = v4._innerRegEx:match(v5);
    if v6 then
        local v7 = v6:span();
        local v8 = v6:grouparr();
        local v9 = {
            v8[0]
        };
        for v10 = 1, v8.n do
            v9[v10 + 1] = v8[v10];
        end;
        v9.n = v8.n + 1;
        v9.index = v7;
        v9.input = v5;
        return v9;
    else
        return nil;
    end;
end;
v1.test = function(v11, v12)
    return v11:exec(v12) ~= nil;
end;
return (setmetatable(v1, {
    __call = function(_, v14, v15)
        v15 = v15 or "";
        return (setmetatable({
            source = v14,
            ignoreCase = v15:find("i") ~= nil,
            global = v15:find("g") ~= nil,
            multiline = v15:find("m") ~= nil,
            _innerRegEx = v0.new(v14, v15)
        }, v3));
    end
}));


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.HttpServiceMock);
local v2 = require(l_Parent_0.Expect);
local v3 = require(l_Parent_0.JestDiff);
local function v4()
    return true;
end;
local function v6(v5)
    return v5;
end;
local v7 = {};
local v8 = {
    __index = v7
};
v7.fromFilter = function(v9)
    return (setmetatable({
        name = "Anonymous matcher",
        _filter = v9
    }, v8));
end;
v7.all = function()
    return v7.fromFilter(v4);
end;
v7.matching = function(v10)
    local v11 = v2.objectContaining(v10);
    v11.getExpectedType = function(_)
        return "table";
    end;
    return v7.fromFilter(function(v13)
        if not v11:asymmetricMatch(v13) then
            return false, v3.diff(v11, v13, {
                aAnnotation = "Expected a request that matches",
                aColor = v6,
                aIndicator = "-",
                bAnnotation = "Received request",
                bColor = v6,
                bIndicator = "+",
                changeColor = v6,
                changeLineTrailingSpaceColor = v6,
                commonColor = v6,
                commonLineTrailingSpaceColor = v6,
                patchColor = v6
            });
        else
            return true;
        end;
    end);
end;
v7.matches = function(v14, v15)
    local v16, v17 = v14._filter(v15);
    if not v16 then
        return {
            success = v16,
            reason = v17
        };
    else
        return {
            success = v16
        };
    end;
end;
return v7;


local l_Parent_0 = script.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local _ = require(l_Parent_1.HttpServiceMock);
local l_LineWriter_0 = require(l_Parent_1.SharedUtils).LineWriter;
local v4 = require(l_Parent_0.Matcher);
local v5 = {};
local v6 = {
    __index = v5
};
v5.new = function()
    return (setmetatable({
        _processors = {}
    }, v6));
end;
v5.appendOptionalProcessor = function(v7, v8)
    table.insert(v7._processors, {
        matcher = nil,
        mapper = v8
    });
    return v7;
end;
v5.appendProcessor = function(v9, v10, v11)
    table.insert(v9._processors, {
        matcher = if typeof(v10) == "function" then v4.fromFilter(v10) else v10,
        mapper = v11
    });
    return v9;
end;
v5.process = function(v12, v13)
    local v14 = {};
    if #v12._processors == 0 then
        error("RequestPipeline does not contain any processor. Make sure to " .. "insert one with `appendProcessor` or `appendOptionalProcessor`", 2);
    end;
    for _, v16 in ipairs(v12._processors) do
        if not v16.matcher then
            local v17, v18 = v16.mapper(v13);
            if not v17 then
                table.insert(v14, v18 or "unspecified");
            else
                return v17;
            end;
        else
            local v19 = v16.matcher:matches(v13);
            if not v19.success then
                table.insert(v14, v19.reason or "unspecified");
            else
                return v16.mapper(v13);
            end;
        end;
    end;
    local v20 = l_LineWriter_0.new():write("The request pipeline was unable to process a request because " .. "it did not match with any matcher. Here is why each matcher failed:"):write("");
    for v21, v22 in ipairs(v12._processors) do
        local v23 = v14[v21];
        local v24 = v23:find("\n") ~= nil;
        v20:write("%4d. %s%s%s%s", v21, not v22.matcher and "" or v22.matcher.name .. ":", (not not v24 and v22.matcher) and "\n" or " ", v23, not v24 and "" or "\n");
    end;
    return {
        type = "internal-error",
        error = v20:toString()
    };
end;
return v5;


local l_script_0 = script;
return {
    RequestPipeline = require(l_script_0.RequestPipeline),
    Matcher = require(l_script_0.Matcher),
    createPassthrough = require(l_script_0.createPassthrough)
};


return {
    TAGS = "tags",
    TAGS_ANY = "tags_any",
    TAGS_ALL = "tags_all",
    XPATH = "xpath"
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Rhodium");
local v1 = require(l_script_FirstAncestor_0.VirtualInput);
local v2 = require(l_script_FirstAncestor_0.VirtualInputUtils);
local v3 = require(l_script_FirstAncestor_0.XPath);
local v4 = require(l_script_FirstAncestor_0.validateInputReceived);
local function v6(v5)
    return string.format("%s (%s)", v5:GetFullName(), v5.ClassName);
end;
local function v9(v7)
    local l_AbsolutePosition_0 = v7.AbsolutePosition;
    return string.format("(%s) (%s)", tostring(l_AbsolutePosition_0), (tostring(v7.AbsoluteSize + l_AbsolutePosition_0)));
end;
local function v11(v10)
    return string.format("%s\n\telement bounds: %s", string.format("%s (%s)", v10:GetFullName(), v10.ClassName), v9(v10));
end;
local function v15(v12, v13)
    local v14 = {};
    if v12.Y < v13.AbsolutePosition.Y then
        table.insert(v14, "top");
    end;
    if v13.AbsolutePosition.Y + v13.AbsoluteSize.Y < v12.Y then
        table.insert(v14, "bottom");
    end;
    if v12.X < v13.AbsolutePosition.X then
        table.insert(v14, "left");
    end;
    if v13.AbsolutePosition.X + v13.AbsoluteSize.X < v12.X then
        table.insert(v14, "right");
    end;
    if #v14 > 0 then
        return true, table.concat(v14, "-");
    else
        return false;
    end;
end;
local function v22(v16, v17)
    local l_Parent_0 = v16.Parent;
    while true do
        if l_Parent_0 ~= nil then
            if l_Parent_0:IsA("GuiBase2d") then
                local v19 = not l_Parent_0:IsA("GuiObject") and true or l_Parent_0.ClipsDescendants;
                local v20, v21 = v15(v17, l_Parent_0);
                if not (not v19 or not v20) then
                    return true, l_Parent_0, v21;
                end;
            end;
            l_Parent_0 = l_Parent_0.Parent;
        else
            return false;
        end;
    end;
end;
local function v30(v23, v24)
    local v25 = {};
    if not v23.Active then
        if not (v23:IsA("GuiButton") or v23:IsA("TextBox")) then
            local v26 = {};
            local l_v23_FullName_0 = v23:GetFullName();
            for _, v29 in v23:GetDescendants() do
                if not (not v29:IsA("GuiButton") and not v29:IsA("TextBox")) then
                    table.insert(v26, string.format("%s%s", v23.Name, (string.sub(string.format("%s (%s)", v29:GetFullName(), v29.ClassName), #l_v23_FullName_0 + 1))));
                end;
            end;
            table.insert(v25, string.format("target is not a GuiButton or TextBox, so it will not sink inputs unless `Active` is true.\n" .. "\tThe target instance has the following descendants that may be better click targets:%s\n\n" .. "\tIf you are intentionally simulating clicks on a GUI element that is not typically interactive\n" .. "\t(like a Frame or an ImageLabel), consider using `element:clickWithoutValidation` instead.", if #v26 > 0 then "\n\t\t* " .. table.concat(v26, "\n\t\t* ") else " <none>"));
        end;
        if not v24 then
            table.insert(v25, "target is not Active");
        end;
    end;
    if not v23.Visible then
        table.insert(v25, "target is not Visible");
    end;
    if v23.AbsoluteSize.X <= 0 then
        table.insert(v25, string.format("target has 0 width; element bounds: %s", v9(v23)));
    end;
    if v23.AbsoluteSize.Y <= 0 then
        table.insert(v25, string.format("target has 0 height; element bounds: %s", v9(v23)));
    end;
    if not v23:FindFirstAncestorWhichIsA("LayerCollector") then
        table.insert(v25, "target is not a descendant of a LayerCollector, like a ScreenGui or a SurfaceGui");
    end;
    return #v25 == 0, v25;
end;
local function v31(v32)
    if v32 and v32 ~= game then
        local v33 = v31(v32.Parent);
        if v32:IsA("ScrollingFrame") then
            v33 = v33 + 1;
        end;
        return v33;
    else
        return 0;
    end;
end;
local v34 = {};
v34.__index = v34;
v34.new = function(v35)
    local v36 = nil;
    local v37 = nil;
    if type(v35) == "string" then
        v36 = v3.new(v35);
    elseif type(v35) == "table" and v35.__type == "XPath" then
        v36 = v35;
    elseif type(v35) == "userdata" then
        v36 = v3.new(v35);
        v37 = v35;
    else
        error(string.format("invalid parameter for element: %s", (typeof(v35))));
    end;
    local v38 = {
        path = v36,
        rbxInstance = v37
    };
    local l_v37_0 = v37;
    local v40;
    if l_v37_0 and l_v37_0 ~= game then
        local v41 = v31(l_v37_0.Parent);
        if l_v37_0:IsA("ScrollingFrame") then
            v41 = v41 + 1;
        end;
        v40 = v41;
    else
        v40 = 0;
    end;
    v38.isInScrollingFrame = v40 ~= 0;
    v38.anchor = nil;
    return (setmetatable(v38, v34));
end;
v34.assertInteractable = function(v42)
    local v43 = v42:getRbxInstance();
    if v43 == nil then
        error(string.format("%s: element with XPath %s does not describe any existing Instance", "[Rhodium] input validation", v42.path:toString()));
    end;
    if not v43:IsA("GuiObject") then
        error(string.format("%s: %s is not a GuiObject", "[Rhodium] input validation", v6(v43)));
    end;
    if not v43:FindFirstAncestorOfClass("DataModel") then
        error(string.format("%s: %s is not mounted into the DataModel", "[Rhodium] input validation", v6(v43)));
    end;
end;
v34.assertClickable = function(v44, v45)
    local v46 = v44:_getGuiObject();
    local v47, v48 = v30(v46, v45);
    if not v47 then
        error(string.format("%s: %s was not clickable for the following reason(s):\n* %s", "[Rhodium] input validation", string.format("%s (%s)", v46:GetFullName(), v46.ClassName), table.concat(v48, "\n* ")));
    end;
end;
v34.assertVisibleWithinAncestors = function(v49)
    local v50 = v49:_getGuiObject();
    local v51 = v49:getAnchor();
    local v52, v53, v54 = v22(v50, v51);
    if v52 then
        error(string.format("%s: %s is outside bounds of ancestor %s (%s)\n\nclick at: (%s)\ntarget:   %s\nancestor: %s", "[Rhodium] input validation", v50.Name, v53.Name, v54, tostring(v51), string.format("%s\n\telement bounds: %s", string.format("%s (%s)", v50:GetFullName(), v50.ClassName), v9(v50)), v11(v53)));
    end;
end;
v34.assertFirstClickTarget = function(v55)
    local v56 = v55:_getGuiObject();
    local v57 = v55:getAnchor();
    local l_v56_FirstAncestorWhichIsA_0 = v56:FindFirstAncestorWhichIsA("BasePlayerGui");
    if not l_v56_FirstAncestorWhichIsA_0 then
        error(string.format("%s: %s is not a descendant of a BasePlayerGui (like CoreGui or LocalPlayer.PlayerGui)", "[Rhodium] input validation", v11(v56)));
    end;
    v1.Mouse.SendMouseMoveEvent(v57.X, v57.Y);
    v2.waitForInputEventsProcessed();
    for _, v60 in (l_v56_FirstAncestorWhichIsA_0:GetGuiObjectsAtPosition(v57.X, v57.Y)), nil, nil do
        if v60 ~= v56 then
            if not (not v30(v60, true) or v22(v60, v57)) then
                error(string.format("%s: element is obscured by another clickable GuiObject at the target click location\n\n click at: (%s)\n   target: %s\nobscuring: %s", "[Rhodium] input validation", tostring(v57), string.format("%s\n\telement bounds: %s", string.format("%s (%s)", v56:GetFullName(), v56.ClassName), v9(v56)), v11(v60)));
            end;
        else
            break;
        end;
    end;
end;
v34.getAttribute = function(v61, v62)
    return v61:getRbxInstance()[v62];
end;
v34.getLocation = function(v63)
    return v63:_getGuiBase2d().AbsolutePosition;
end;
v34.getRect = function(v64)
    local v65 = v64:getSize();
    local v66 = v64:getLocation();
    local v67 = v65 + v66;
    return Rect.new(v66.X, v66.Y, v67.X, v67.Y);
end;
v34.getSize = function(v68)
    return v68:_getGuiBase2d().AbsoluteSize;
end;
v34.getCenter = function(v69)
    return v69:getLocation() + v69:getSize() / 2;
end;
v34.getText = function(v70)
    local v71 = v70:getRbxInstanceOrThrow();
    if not (v71:IsA("TextLabel") or v71:IsA("TextButton")) and not v71:IsA("TextBox") then
        error(("expected element to have text, but got `%s`"):format(v71.ClassName));
        return ;
    else
        return v71.Text;
    end;
end;
v34.getAnchor = function(v72)
    if v72.anchor ~= nil then
        return v72:getLocation() + v72.anchor;
    else
        return v72:getCenter();
    end;
end;
v34.setAnchor = function(v73, v74, v75)
    local v76 = v73:getSize();
    if not ((v76.X >= v74 and v76.Y >= v75) and v74 >= 0) or v75 < 0 then
        error("Attempt to set anchor beyond element's bounds");
        return ;
    else
        v73.anchor = Vector2.new(v74, v75);
        return ;
    end;
end;
v34.unsetAnchor = function(v77)
    v77.anchor = nil;
end;
v34.isDisplayed = function(v78)
    return v78:_getGuiObject().Visible;
end;
v34.isSelected = function(v79)
    return v79:_getGuiButton().Selected;
end;
v34.getRbxInstance = function(v80)
    return v80:waitForRbxInstance(v80.path.waitDelay, v80.path.waitTimeOut);
end;
v34.getRbxInstanceOrThrow = function(v81)
    local v82 = v81:getRbxInstance();
    if v82 == nil then
        error(string.format("Failed to get instance for element with path %s", v81.path:toString()));
    end;
    return v82;
end;
v34._getGuiObject = function(v83)
    return (v83:_getInstanceOfClass("GuiObject"));
end;
v34._getGuiButton = function(v84)
    return (v84:_getInstanceOfClass("GuiButton"));
end;
v34._getGuiBase2d = function(v85)
    return (v85:_getInstanceOfClass("GuiBase2d"));
end;
v34._getInstanceOfClass = function(v86, v87)
    local v88 = v86:getRbxInstanceOrThrow();
    if not v88:IsA(v87) then
        error(("expected element to be a %s, but got `%s`"):format(v87, v88.ClassName));
        return ;
    else
        return v88;
    end;
end;
v34.waitForRbxInstance = function(v89, v90, v91)
    local l_rbxInstance_0 = v89.rbxInstance;
    if l_rbxInstance_0 == nil and v89.path ~= nil then
        v89.path:setWait(v90, v91);
        l_rbxInstance_0 = v89.path:waitForFirstInstance();
        v89.rbxInstance = l_rbxInstance_0;
    end;
    return l_rbxInstance_0;
end;
v34.centralizeInstance = function(v93)
    v93:_centralizeInScrollingFrame((v93:_getInstanceOfClass("GuiObject")));
end;
v34.centralize = function(v94)
    if not v94:getRbxInstance() then
        v94:centralizeWithInfiniteScrolling();
        return ;
    else
        v94:centralizeInstance();
        return ;
    end;
end;
v34._centralizeInScrollingFrame = function(v95, v96, v97)
    if v96 == game then
        return ;
    else
        local v98 = v97 or v96.Parent;
        if v98 == game then
            return ;
        else
            if not v98:IsA("ScrollingFrame") then
                v95:_centralizeInScrollingFrame(v96, v98.Parent);
            else
                v95:_centralizeInScrollingFrame(v98, v98.Parent);
                local v99 = false;
                while not v99 do
                    local l_AbsolutePosition_1 = v96.AbsolutePosition;
                    local l_CanvasPosition_0 = v98.CanvasPosition;
                    v98.CanvasPosition = v98.CanvasPosition + Vector2.new(math.min(300, v98.AbsoluteSize.X), (math.min(300, v98.AbsoluteSize.Y)));
                    task.wait();
                    v99 = (v98.CanvasPosition - l_CanvasPosition_0).Magnitude <= 2 or (v96.AbsolutePosition - l_AbsolutePosition_1).Magnitude > 2;
                end;
                for _ = 1, 2 do
                    local v103 = (v96.AbsolutePosition + v96.AbsoluteSize / 2) - (v98.AbsolutePosition + v98.AbsoluteSize / 2);
                    if v103.Magnitude > 2 then
                        v98.CanvasPosition = v98.CanvasPosition + v103;
                        task.wait();
                    else
                        goto label0;
                    end;
                end;
                return ;
            end;
            ::label0::;
            return ;
        end;
    end;
end;
v34._scrollToFindInstance = function(_, v105, v106)
    v105.CanvasPosition = Vector2.new(0, 0);
    local l_X_0 = v105.AbsoluteSize.X;
    local l_Y_0 = v105.AbsoluteSize.Y;
    local v109 = false;
    local v110 = nil;
    while true do
        if v109 then
            return nil;
        else
            task.wait(0.1);
            v110 = v106:getFirstInstance();
            if not v110 then
                local l_CanvasPosition_1 = v105.CanvasPosition;
                v105.CanvasPosition = v105.CanvasPosition + Vector2.new(math.min(l_X_0, 300), (math.min(l_Y_0, 300)));
                if (v105.CanvasPosition - l_CanvasPosition_1).Magnitude >= 2 then
                    v109 = false;
                else
                    v109 = true;
                end;
            else
                return v110;
            end;
        end;
    end;
end;
v34.centralizeWithInfiniteScrolling = function(v112)
    local v113, v114 = v112.path:getInstances();
    if #v113 > 0 then
        v112:centralizeInstance();
    end;
    local v115 = v112.path:copy();
    while v114 < v115:size() do
        v115 = v115:parent();
    end;
    local v116 = v115:getFirstInstance();
    local v117 = nil;
    while true do
        assert(v116 ~= nil, "Rhodium encountered an internal error");
        if not v116:IsA("ScrollingFrame") then
            v116 = v116.Parent;
            if not (v116 ~= game) then
                break;
            end;
        else
            v117 = v116;
            break;
        end;
    end;
    if v117 == nil then
        return ;
    elseif v112:_scrollToFindInstance(v117, v112.path) == nil then
        return ;
    else
        v112:_centralizeInScrollingFrame((v112:_getInstanceOfClass("GuiObject")));
        return ;
    end;
end;
v34.setPluginWindow = function(v118)
    v1.setCurrentWindow((v118:getRbxInstanceOrThrow():FindFirstAncestorWhichIsA("PluginGui")));
end;
v34._validateInput = function(v119, v120)
    v119:assertInteractable();
    local v121 = v119:_getGuiObject();
    v2.waitForInputEventsProcessed();
    if not v4(v121, v120) then
        v119:assertClickable();
        v119:assertVisibleWithinAncestors();
        v119:assertFirstClickTarget();
        error(string.format("%s: failed to click %s - reason unknown\n%s", "[Rhodium] input validation", v121.Name, v11(v121)));
    end;
end;
v34.clickWithoutValidation = function(v122, v123)
    v122:centralize();
    v122:setPluginWindow();
    v1.Mouse.multiClick(v122:getAnchor(), v123 or 1);
end;
v34.click = function(v124, v125)
    v124:_validateInput(function()
        v124:clickWithoutValidation(v125);
    end);
end;
v34.rightClick = function(v126)
    v126:centralize();
    v126:setPluginWindow();
    v1.Mouse.rightClick(v126:getAnchor());
end;
v34.mouseWheel = function(v127, v128)
    v127:centralize();
    v1.Mouse.mouseWheel(v127:getAnchor(), v128);
end;
v34.mouseDrag = function(v129, v130, v131, v132)
    v129:centralize();
    v1.Mouse.mouseDrag(v129:getAnchor(), v129:getAnchor() + Vector2.new(v130, v131), v132);
end;
v34.mouseDragTo = function(v133, v134, v135)
    v133:centralize();
    v1.Mouse.mouseDrag(v133:getAnchor(), v134, v135);
end;
v34.sendKey = function(v136, v137)
    v136:setPluginWindow();
    v1.Keyboard.hitKey(v137);
end;
v34.sendText = function(v138, v139)
    v138:clickWithoutValidation();
    task.wait(0);
    v1.Text.sendText(v139);
end;
v34.tapWithoutValidation = function(v140)
    v140:centralize();
    v1.Touch.tap(v140:getAnchor());
end;
v34.tap = function(v141)
    v141:_validateInput(function()
        v141:tapWithoutValidation();
    end);
end;
v34.touchScroll = function(v142, v143, v144, v145, v146)
    v142:centralize();
    v1.Touch.touchScroll(v142:getAnchor(), v143, v144, v145, true, v146);
end;
return v34;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Rhodium");
local v1 = require(l_script_FirstAncestor_0.Parent.LuauTagUtils);
local v2 = require(l_script_FirstAncestor_0.XPath);
local v3 = require(l_script_FirstAncestor_0.By);
return function(v4, ...)
    if v4 == v3.TAGS then
        return (v1.getUnique(...));
    elseif v4 == v3.TAGS_ANY then
        return (v1.getAny(...));
    elseif v4 == v3.TAGS_ALL then
        return (v1.getAll(...));
    elseif v4 == v3.XPATH then
        return (v2.new((...)):getFirstInstance());
    else
        error(string.format("Invalid locator type: %s", v4));
        return ;
    end;
end;


local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local v1 = require(script:FindFirstAncestor("Rhodium").VirtualInputUtils);
local v2 = {};
v2.__index = v2;
local v3 = 123;
v2.KeyCode = {
    ButtonX = Enum.KeyCode.ButtonX,
    ButtonY = Enum.KeyCode.ButtonY,
    ButtonA = Enum.KeyCode.ButtonA,
    ButtonB = Enum.KeyCode.ButtonB,
    ButtonR1 = Enum.KeyCode.ButtonR1,
    ButtonL1 = Enum.KeyCode.ButtonL1,
    ButtonR2 = Enum.KeyCode.ButtonR2,
    ButtonL2 = Enum.KeyCode.ButtonL2,
    ButtonR3 = Enum.KeyCode.ButtonR3,
    ButtonL3 = Enum.KeyCode.ButtonL3,
    ButtonStart = Enum.KeyCode.ButtonStart,
    ButtonSelect = Enum.KeyCode.ButtonSelect,
    DPadLeft = Enum.KeyCode.DPadLeft,
    DPadRight = Enum.KeyCode.DPadRight,
    DPadUp = Enum.KeyCode.DPadUp,
    DPadDown = Enum.KeyCode.DPadDown,
    Thumbstick1 = Enum.KeyCode.Thumbstick1,
    Thumbstick2 = Enum.KeyCode.Thumbstick2
};
v2.new = function()
    local v4 = {
        deviceId = v3
    };
    v3 = v3 + 1;
    setmetatable(v4, v2);
    l_VirtualInputManager_0:HandleGamepadConnect(v4.deviceId);
    return v4;
end;
v2.disconnect = function(v5)
    l_VirtualInputManager_0:HandleGamepadDisconnect(v5.deviceId);
end;
v2.pressButton = function(v6, v7)
    l_VirtualInputManager_0:HandleGamepadButtonInput(v6.deviceId, v7, 1);
end;
v2.releaseButton = function(v8, v9)
    l_VirtualInputManager_0:HandleGamepadButtonInput(v8.deviceId, v9, 0);
end;
v2.hitButton = function(v10, v11)
    v10:pressButton(v11);
    v10:releaseButton(v11);
    v1.waitForInputEventsProcessed();
end;
v2.moveStickTo = function(v12, v13, v14)
    l_VirtualInputManager_0:HandleGamepadAxisInput(v12.deviceId, v13, v14.X, v14.Y, 0);
end;
v2.smoothMoveStickTo = function(v15, v16, v17, v18, v19)
    v19 = v19 or 0;
    if v19 == 0 then
        v15:moveStickTo(v16, v18);
        return ;
    else
        local v20 = 0;
        v1.__syncRun(function(v21)
            local v22 = v20 / v19;
            v20 = v20 + v21;
            if v22 < 1 then
                v15:moveStickTo(v16, v17 + (v18 - v17) * v22);
                return false;
            else
                v15:moveStickTo(v16, v18);
                return true;
            end;
        end);
        return ;
    end;
end;
v2.swingStick = function(v23, v24, v25, v26)
    v26 = v26 or 0;
    assert(v26);
    local v27 = Vector2.new(0, 0);
    v23:moveStickTo(v24, v27);
    v23:smoothMoveStickTo(v24, v27, v25, v26 / 2);
    v23:smoothMoveStickTo(v24, v25, v27, v26 / 2);
end;
v2.swingLeft = function(v28, v29, v30)
    v28:swingStick(v29, Vector2.new(-1, 0), v30);
end;
v2.swingRight = function(v31, v32, v33)
    v31:swingStick(v32, Vector2.new(1, 0), v33);
end;
v2.swingTop = function(v34, v35, v36)
    v34:swingStick(v35, Vector2.new(0, 1), v36);
end;
v2.swingDown = function(v37, v38, v39)
    v37:swingStick(v38, Vector2.new(0, -1), v39);
end;
return v2;


local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local v1 = require(script:FindFirstAncestor("Rhodium").VirtualInputUtils);
local v5 = {
    SendKeyEvent = function(v2, v3, v4)
        l_VirtualInputManager_0:SendKeyEvent(v2, v3, v4, (v1.getCurrentWindow()));
    end
};
v5.pressKey = function(v6)
    v5.SendKeyEvent(true, v6, false);
end;
v5.releaseKey = function(v7)
    v5.SendKeyEvent(false, v7, false);
end;
v5.hitKey = function(v8)
    v5.pressKey(v8);
    v5.releaseKey(v8);
    v1.waitForInputEventsProcessed();
end;
return v5;


local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("Rhodium");
local v2 = require(l_script_FirstAncestor_0.VirtualInputUtils);
local v3 = require(l_script_FirstAncestor_0.InputVisualizer).new();
local v20 = {
    sendMouseButtonEvent = function(v4, v5, v6, v7, v8)
        local v9, v10 = v2.__handleGuiInset(v4, v5);
        l_VirtualInputManager_0:SendMouseButtonEvent(v9, v10, v6, v7, v2.getCurrentWindow(), v8 or 0);
    end,
    SendMouseMoveEvent = function(v11, v12)
        local v13, v14 = v2.__handleGuiInset(v11, v12);
        l_VirtualInputManager_0:SendMouseMoveEvent(v13, v14, (v2.getCurrentWindow()));
    end,
    SendMouseWheelEvent = function(v15, v16, v17)
        local v18, v19 = v2.__handleGuiInset(v15, v16);
        l_VirtualInputManager_0:SendMouseWheelEvent(v18, v19, v17, (v2.getCurrentWindow()));
    end
};
v20.mouseWheel = function(v21, v22)
    local v23 = false;
    if v22 < 0 then
        v23 = true;
        v22 = -v22;
    end;
    for _ = 1, v22 do
        v20.SendMouseWheelEvent(v21.X, v21.Y, v23);
    end;
end;
local function v28(v25, v26, v27)
    v3:click(v25, v2.getCurrentWindow());
    v20.sendMouseButtonEvent(v25.X, v25.Y, v27, true, v26);
    v20.sendMouseButtonEvent(v25.X, v25.Y, v27, false, v26);
    v2.waitForInputEventsProcessed();
end;
local function _(v29, v30, v31)
    local v32 = true;
    local v33 = 0;
    return function()
        if not v32 then
            if v30 >= 1 then
                v28(v29, v33, v31);
                v30 = v30 - 1;
                v33 = v33 + 1;
                v32 = true;
                return false;
            elseif v30 == 0 then
                return true;
            else
                return false;
            end;
        else
            v32 = false;
            return false;
        end;
    end;
end;
v20.click = function(v35)
    local l___syncRun_0 = v2.__syncRun;
    local v37 = 1;
    local v38 = true;
    local v39 = 0;
    local v40 = 0;
    local v41;
    do
        local l_v37_0, l_v38_0, l_v39_0 = v37, v38, v39;
        v41 = function()
            if not l_v38_0 then
                if l_v37_0 >= 1 then
                    v28(v35, l_v39_0, v40);
                    l_v37_0 = l_v37_0 - 1;
                    l_v39_0 = l_v39_0 + 1;
                    l_v38_0 = true;
                    return false;
                elseif l_v37_0 == 0 then
                    return true;
                else
                    return false;
                end;
            else
                l_v38_0 = false;
                return false;
            end;
        end;
    end;
    l___syncRun_0(v41);
end;
v20.multiClick = function(v45, v46)
    local l___syncRun_1 = v2.__syncRun;
    local l_v46_0 = v46;
    local v49 = true;
    local v50 = 0;
    local v51 = 0;
    local v52;
    do
        local l_l_v46_0_0, l_v49_0, l_v50_0 = l_v46_0, v49, v50;
        v52 = function()
            if not l_v49_0 then
                if l_l_v46_0_0 >= 1 then
                    v28(v45, l_v50_0, v51);
                    l_l_v46_0_0 = l_l_v46_0_0 - 1;
                    l_v50_0 = l_v50_0 + 1;
                    l_v49_0 = true;
                    return false;
                elseif l_l_v46_0_0 == 0 then
                    return true;
                else
                    return false;
                end;
            else
                l_v49_0 = false;
                return false;
            end;
        end;
    end;
    l___syncRun_1(v52);
end;
v20.rightClick = function(v56)
    local l___syncRun_2 = v2.__syncRun;
    local v58 = 1;
    local v59 = true;
    local v60 = 0;
    local v61 = 1;
    local v62;
    do
        local l_v58_0, l_v59_0, l_v60_0 = v58, v59, v60;
        v62 = function()
            if not l_v59_0 then
                if l_v58_0 >= 1 then
                    v28(v56, l_v60_0, v61);
                    l_v58_0 = l_v58_0 - 1;
                    l_v60_0 = l_v60_0 + 1;
                    l_v59_0 = true;
                    return false;
                elseif l_v58_0 == 0 then
                    return true;
                else
                    return false;
                end;
            else
                l_v59_0 = false;
                return false;
            end;
        end;
    end;
    l___syncRun_2(v62);
end;
v20.mouseLeftDown = function(v66)
    v20.sendMouseButtonEvent(v66.X, v66.Y, 0, true);
end;
v20.mouseLeftUp = function(v67)
    v20.sendMouseButtonEvent(v67.X, v67.Y, 0, false);
end;
v20.mouseRightDown = function(v68)
    v20.sendMouseButtonEvent(v68.X, v68.Y, 1, true);
end;
v20.mouseRightUp = function(v69)
    v20.sendMouseButtonEvent(v69.X, v69.Y, 1, false);
end;
v20.mouseMove = function(v70)
    v20.SendMouseMoveEvent(v70.X, v70.Y);
end;
local function _(v71, v72, v73)
    local v74 = 0;
    local v75 = false;
    return function(v76)
        if v75 then
            v74 = v74 + v76;
            if v73 and v74 < v73 then
                v20.mouseMove((v72 - v71) * (v74 / v73) + v71);
            else
                v20.mouseMove(v72);
                v20.mouseLeftUp(v72);
                return true;
            end;
        else
            v20.mouseLeftDown(v71);
            v75 = true;
        end;
        return false;
    end;
end;
v20.mouseDrag = function(v78, v79, v80)
    local l___syncRun_3 = v2.__syncRun;
    local v82 = 0;
    local v83 = false;
    local v84;
    do
        local l_v82_0, l_v83_0 = v82, v83;
        v84 = function(v87)
            if l_v83_0 then
                l_v82_0 = l_v82_0 + v87;
                if v80 and l_v82_0 < v80 then
                    v20.mouseMove((v79 - v78) * (l_v82_0 / v80) + v78);
                else
                    v20.mouseMove(v79);
                    v20.mouseLeftUp(v79);
                    return true;
                end;
            else
                v20.mouseLeftDown(v78);
                l_v83_0 = true;
            end;
            return false;
        end;
    end;
    l___syncRun_3(v84);
end;
v20.__setInputVisualizerEnabled = function(v88)
    if not v88 then
        v3:disable();
        return ;
    else
        v3:enable();
        return ;
    end;
end;
return v20;


local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local v1 = require(script:FindFirstAncestor("Rhodium").VirtualInputUtils);
return {
    sendText = function(v2)
        l_VirtualInputManager_0:SendTextInputCharacterEvent(v2, (v1.getCurrentWindow()));
    end
};


local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local v1 = require(script:FindFirstAncestor("Rhodium").VirtualInputUtils);
local v8 = {
    SendTouchEvent = function(v2, v3, v4, v5)
        local v6, v7 = v1.__handleGuiInset(v4, v5);
        l_VirtualInputManager_0:SendTouchEvent(v2, v3, v6, v7);
    end
};
v8.touchStart = function(v9, v10)
    v8.SendTouchEvent(123456 + (v10 or 0), 0, v9.X, v9.Y);
end;
v8.touchMove = function(v11, v12)
    v8.SendTouchEvent(123456 + (v12 or 0), 1, v11.X, v11.Y);
end;
v8.touchStop = function(v13, v14)
    v8.SendTouchEvent(123456 + (v14 or 0), 2, v13.X, v13.Y);
end;
local function _(v15, v16, v17, v18)
    local v19 = 0;
    local v20 = false;
    local v21 = 123456 + (v18 or 0);
    return function(v22)
        if v20 then
            v19 = v19 + v22;
            if v17 and v19 < v17 then
                v8.touchMove((v16 - v15) * (v19 / v17) + v15, v21);
            else
                v8.touchMove(v16, v21);
                v8.touchStop(v16, v21);
                return true;
            end;
        else
            v8.touchStart(v15, v21);
            v20 = true;
        end;
        return false;
    end;
end;
v8.swipe = function(v24, v25, v26, v27, v28)
    local v29 = 123456 + (v28 or 0);
    if v27 == true then
        local l___asyncRun_0 = v1.__asyncRun;
        local v31 = 0;
        local v32 = false;
        local v33 = 123456 + (v29 or 0);
        local v34;
        do
            local l_v31_0, l_v32_0 = v31, v32;
            v34 = function(v37)
                if l_v32_0 then
                    l_v31_0 = l_v31_0 + v37;
                    if v26 and l_v31_0 < v26 then
                        v8.touchMove((v25 - v24) * (l_v31_0 / v26) + v24, v33);
                    else
                        v8.touchMove(v25, v33);
                        v8.touchStop(v25, v33);
                        return true;
                    end;
                else
                    v8.touchStart(v24, v33);
                    l_v32_0 = true;
                end;
                return false;
            end;
        end;
        l___asyncRun_0(v34);
        return ;
    else
        local l___syncRun_0 = v1.__syncRun;
        local v39 = 0;
        local v40 = false;
        local v41 = 123456 + (v29 or 0);
        local v42;
        do
            local l_v39_0, l_v40_0 = v39, v40;
            v42 = function(v45)
                if l_v40_0 then
                    l_v39_0 = l_v39_0 + v45;
                    if v26 and l_v39_0 < v26 then
                        v8.touchMove((v25 - v24) * (l_v39_0 / v26) + v24, v41);
                    else
                        v8.touchMove(v25, v41);
                        v8.touchStop(v25, v41);
                        return true;
                    end;
                else
                    v8.touchStart(v24, v41);
                    l_v40_0 = true;
                end;
                return false;
            end;
        end;
        l___syncRun_0(v42);
        return ;
    end;
end;
v8.touchScroll = function(v46, v47, v48, v49, v50, v51)
    v8.swipe(v46, v46 + Vector2.new(v47, v48), v49, v50, v51);
end;
v8.tap = function(v52)
    v8.touchStart(v52);
    v8.touchStop(v52);
    v1.waitForInputEventsProcessed();
end;
return v8;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_Players_0 = game:GetService("Players");
local l_TweenService_0 = game:GetService("TweenService");
local l_Debris_0 = game:GetService("Debris");
local l_UserInputService_0 = game:GetService("UserInputService");
local v5 = {};
v5.__index = v5;
v5.new = function()
    local v6 = {};
    local l_status_0, l_result_0 = pcall(function()
        return l_CoreGui_0.Parent.CoreGui;
    end);
    if l_status_0 == false then
        while true do
            task.wait();
            if l_Players_0.LocalPlayer then
                break;
            end;
        end;
        l_result_0 = l_Players_0.LocalPlayer:WaitForChild("PlayerGui");
    end;
    local l_InputVisualizer_0 = l_result_0:FindFirstChild("InputVisualizer");
    if not l_InputVisualizer_0 then
        local l_ScreenGui_0 = Instance.new("ScreenGui");
        l_ScreenGui_0.Name = "InputVisualizer";
        l_ScreenGui_0.DisplayOrder = 1000000;
        l_ScreenGui_0.Parent = l_result_0;
        l_InputVisualizer_0 = l_ScreenGui_0;
    end;
    v6.guiRoot = l_InputVisualizer_0;
    setmetatable(v6, v5);
    return v6;
end;
v5.onInputBegan = function(v11, v12)
    if not (v12.UserInputType ~= Enum.UserInputType.MouseButton1) or v12.UserInputType == Enum.UserInputType.Touch then
        v11:click(Vector2.new(v12.Position.X, v12.Position.Y));
    end;
end;
v5.click = function(v13, v14, v15)
    if v13.handler == nil then
        return ;
    else
        local v16 = nil;
        if v16 == nil then
            v16 = Instance.new("ImageLabel");
            v16.Image = "rbxassetid://1549893588";
            v16.BackgroundTransparency = 1;
            v16.Parent = v15 or v13.guiRoot;
            v16.Size = UDim2.new(0, 20, 0, 20);
            v16.Name = "MouseClick";
            v16.ZIndex = 10;
        end;
        v16.Visible = true;
        v16.Position = UDim2.new(0, v14.X - v16.Size.X.Offset / 2, 0, v14.Y - v16.Size.Y.Offset / 2);
        v16.ImageTransparency = 0;
        l_TweenService_0:Create(v16, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false), {
            ImageTransparency = 1
        }):Play();
        l_Debris_0:AddItem(v16, 0.5);
        return ;
    end;
end;
v5.enable = function(v17)
    v17.handler = l_UserInputService_0.InputBegan:Connect(function(v18, _)
        v17:onInputBegan(v18);
    end);
end;
v5.disable = function(v20)
    local l_handler_0 = v20.handler;
    if l_handler_0 then
        l_handler_0:Disconnect();
        v20.handler = nil;
    end;
end;
return v5;


local l_HttpService_0 = game:GetService("HttpService");
local v1 = nil;
local v2 = {};
local function v13(v3)
    local v4 = v3:find("(", 1, true);
    local v5 = v3:reverse():find(")", 1, true);
    if v5 ~= nil then
        v5 = (#v3 - v5) + 1;
    end;
    local v6 = {};
    if v4 then
        assert(v5, "invalid syntex, expecting \")\"");
        local v7 = v3:sub(v4 + 1, v5 - 1);
        if #v7 > 0 then
            v6 = l_HttpService_0:JSONDecode("[" .. v7 .. "]");
        end;
        v3 = v3:sub(1, v4 - 1);
    end;
    local v8 = v3:split(".");
    local l_v1_0 = v1;
    for v10 = 1, #v8 do
        local v11 = v8[v10];
        l_v1_0 = l_v1_0:FindFirstChild(v11);
        assert(l_v1_0, "can not find " .. v11);
        if not (not l_v1_0 or not l_v1_0:IsA("ModuleScript")) then
            local v12 = require(l_v1_0);
            assert(typeof(v12) == "function", "target is not a function");
            return v12(unpack(v6));
        end;
    end;
    return nil;
end;
v2.setCommandPath = function(v14)
    v1 = v14;
end;
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("RhodiumService");
end);
if l_status_0 then
    l_result_0.onCommand = v13;
end;
return v2;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Rhodium");
local v1 = require(l_script_FirstAncestor_0.InputTypes.Keyboard);
local v2 = require(l_script_FirstAncestor_0.InputTypes.Mouse);
local v3 = require(l_script_FirstAncestor_0.InputTypes.Touch);
local v4 = require(l_script_FirstAncestor_0.InputTypes.Text);
local v5 = require(l_script_FirstAncestor_0.InputTypes.GamePad);
local v6 = require(l_script_FirstAncestor_0.VirtualInputUtils);
return {
    Keyboard = v1,
    Mouse = v2,
    Touch = v3,
    Text = v4,
    GamePad = v5,
    setCurrentWindow = v6.setCurrentWindow,
    getCurrentWindow = v6.getCurrentWindow,
    waitForInputEventsProcessed = v6.waitForInputEventsProcessed
};


local l_RunService_0 = game:GetService("RunService");
local l_GuiService_0 = game:GetService("GuiService");
local l_VirtualInputManager_0 = game:GetService("VirtualInputManager");
local v3 = {};
local v4 = {};
l_RunService_0.Heartbeat:Connect(function(v5)
    local v6 = {};
    for v7, _ in pairs(v3) do
        if v7(v5) then
            table.insert(v6, v7);
        end;
    end;
    for _, v10 in ipairs(v6) do
        v3[v10] = nil;
    end;
    for v11, _ in pairs(v4) do
        if v4[v11] == false then
            v4[v11] = nil;
        else
            v11:Fire(v5);
        end;
    end;
end);
local v13 = {};
local v14 = nil;
v13.setCurrentWindow = function(v15)
    local l_v14_0 = v14;
    v14 = v15;
    return l_v14_0;
end;
v13.getCurrentWindow = function()
    return v14;
end;
v13.waitForInputEventsProcessed = function()
    l_VirtualInputManager_0:WaitForInputEventsProcessed();
end;
v13.__asyncRun = function(v17)
    v3[v17] = true;
end;
v13.__syncRun = function(v18)
    local l_BindableEvent_0 = Instance.new("BindableEvent");
    v4[l_BindableEvent_0] = true;
    local v20 = 0;
    while not v18(v20) do
        v20 = l_BindableEvent_0.Event:Wait();
    end;
    v4[l_BindableEvent_0] = false;
end;
v13.__handleGuiInset = function(v21, v22)
    local l_l_GuiService_0_GuiInset_0, _ = l_GuiService_0:GetGuiInset();
    return v21 + l_l_GuiService_0_GuiInset_0.X, v22 + l_l_GuiService_0_GuiInset_0.Y;
end;
return v13;


local v0 = {
    __type = "XPath"
};
v0.__index = v0;
local v1 = {};
for v2 = 1, 6 do
    v1[("\\.=[],"):sub(v2, v2)] = true;
end;
v0.addSlash = function(v3)
    local v4 = {};
    for v5 = 1, v3:len() do
        local v6 = v3:sub(v5, v5);
        if v1[v6] then
            table.insert(v4, "\\");
        end;
        table.insert(v4, v6);
    end;
    return table.concat(v4);
end;
v0.removeSlash = function(v7)
    local v8 = {};
    local v9 = false;
    for v10 = 1, v7:len() do
        local v11 = v7:sub(v10, v10);
        if v11 == "\\" and v9 == false then
            v9 = true;
        else
            if v9 == true then
                v9 = false;
            end;
            table.insert(v8, v11);
        end;
    end;
    return table.concat(v8);
end;
local function v19(v12, v13)
    local v14 = {};
    if not (v12 ~= nil) or v12 == "" then
        return v14;
    else
        local v15 = false;
        local v16 = 1;
        for v17 = 1, v12:len() do
            local v18 = v12:sub(v17, v17);
            if v18 == "\\" and v15 == false then
                v15 = true;
            elseif v15 == true then
                v15 = false;
            elseif v18 == v13 then
                table.insert(v14, (v12:sub(v16, v17 - 1)));
                v16 = v17 + 1;
            end;
        end;
        table.insert(v14, (v12:sub(v16, v12:len())));
        return v14;
    end;
end;
local function v20(v21)
    local v22 = {};
    for v23, v24 in pairs(v21) do
        if type(v24) == "table" then
            v22[v23] = v20(v24);
        else
            v22[v23] = v24;
        end;
    end;
    return v22;
end;
v0.new = function(v25, v26)
    local v27 = {
        data = {},
        root = v26,
        waitDelay = 0.2,
        waitTimeOut = 2
    };
    setmetatable(v27, v0);
    if type(v25) == "string" then
        v27:fromString(v25);
        return v27;
    else
        if type(v25) == "userdata" then
            local l_v25_0 = v25;
            while l_v25_0 do
                local l_Name_0 = l_v25_0.Name;
                if l_v25_0.ClassName == "DataModel" then
                    l_Name_0 = "game";
                end;
                table.insert(v27.data, 1, {
                    name = l_Name_0
                });
                l_v25_0 = l_v25_0.Parent;
            end;
        elseif type(v25) == "table" and v25.__type == v0.__type then
            return v25:copy();
        else
            error(string.format("unknown parameter %s", (tostring(v25))));
        end;
        return v27;
    end;
end;
v0.size = function(v30)
    return #v30.data;
end;
v0.mergeFilter = function(v31, v32, v33)
    if v31:size() < v32 then
        error("bad index");
    end;
    local v34 = v31.data[v32].filter or {};
    local v35 = {};
    for _, v37 in ipairs(v34) do
        v35[v37.key] = v37.value;
    end;
    if v33 then
        for _, v39 in ipairs(v33) do
            v35[v39.key] = tostring(v39.value);
        end;
    end;
    local v40 = {};
    for v41, v42 in pairs(v35) do
        table.insert(v40, {
            key = v41,
            value = v42
        });
    end;
    v31.data[v32].filter = v40;
    return v31;
end;
v0.fromString = function(v43, v44)
    local v45 = false;
    local v46 = false;
    local v47 = {};
    local v48 = 1;
    v44 = v44 .. ".";
    for v49 = 1, v44:len() do
        local v50 = v44:sub(v49, v49);
        if v50 == "\\" and v46 == false then
            v46 = true;
        elseif v46 == true then
            v46 = false;
        elseif v50 == "." then
            if not v45 then
                table.insert(v47, {
                    name = v44:sub(v48, v49 - 1)
                });
                v48 = v49 + 1;
            end;
        elseif v50 == "[" then
            if v45 == true then
                error("no nested bracket allowed: " .. v44);
            end;
            v45 = true;
        elseif v50 == "]" then
            if not v45 then
                error("unbalanced brackets: " .. v44);
            end;
            v45 = false;
        end;
    end;
    if v45 == true then
        error("unbalanced brackets: " .. v44);
    end;
    for v51 = 1, #v47 do
        local v52, v53 = v47[v51].name:match("%s*(.*[^\\])%[(.*[^\\])%]%s*");
        if v52 == nil then
            v53 = "";
            v52 = v47[v51].name;
        end;
        if v52 ~= nil and v53 ~= nil then
            v47[v51].name = v0.removeSlash(v52);
            local v54 = v19(v53, ",");
            local v55 = {};
            for _, v57 in ipairs(v54) do
                local v58, v59 = v57:match("^%s*(.-[^\\])%s*=%s*(.-)%s*$");
                if not (not v58 or not v59) then
                    table.insert(v55, {
                        key = v58,
                        value = v59
                    });
                end;
            end;
            v47[v51].filter = v55;
        end;
    end;
    v43.data = v47;
end;
v0.copy = function(v60)
    local v61 = v20(v60);
    setmetatable(v61, v0);
    return v61;
end;
v0.parent = function(v62)
    local v63 = v62:copy();
    if #v63.data <= 1 then
        return v63;
    else
        table.remove(v63.data, #v63.data);
        return v63;
    end;
end;
v0._itemToString = function(_, v65)
    local v66 = v0.addSlash(v65.name);
    if v65.filter and #v65.filter > 0 then
        local v67 = {};
        for _, v69 in ipairs(v65.filter) do
            table.insert(v67, v69.key .. " = " .. v69.value);
        end;
        v66 = v66 .. "[" .. table.concat(v67, ", ") .. "]";
    end;
    return v66;
end;
v0.toString = function(v70, v71)
    if v71 == nil then
        local v72 = {};
        for _, v74 in ipairs(v70.data) do
            table.insert(v72, v70:_itemToString(v74));
        end;
        return table.concat(v72, ".");
    elseif type(v71) == "number" then
        if v71 < 0 then
            v71 = (v70:size() + v71) + 1;
        end;
        if not (v70:size() >= v71) or v71 < 1 then
            error("invalid index");
        end;
        return v70:_itemToString(v70.data[v71]);
    elseif type(v71) == "table" then
        return v70:_itemToString(v71);
    else
        error("Unsupported argument to `XPath:toString()`");
        return ;
    end;
end;
v0.hasChild = function(v75, v76)
    return v76:relative(v75) ~= nil;
end;
v0.relative = function(v77, v78)
    if v77:size() < #v78.data then
        return nil;
    else
        local v79 = v78:copy();
        local v80 = v77:copy();
        while true do
            if #v79.data > 0 then
                if v79.data[1].name ~= v80.data[1].name then
                    return nil;
                else
                    table.remove(v79.data, 1);
                    table.remove(v80.data, 1);
                end;
            else
                return v80;
            end;
        end;
    end;
end;
v0.cat = function(v81, v82)
    if typeof(v82) == "string" then
        v82 = v0.new(v82);
    end;
    local v83 = v81:copy();
    for _, v85 in ipairs(v82.data) do
        table.insert(v83.data, v85);
    end;
    return v83;
end;
v0.clearFilter = function(v86)
    for v87 = 1, v86:size() do
        v86.data[v87].filter = nil;
    end;
    return v86;
end;
local function _(v88, v89)
    local l_status_0, l_result_0 = pcall(function()
        return v88[v89];
    end);
    if not l_status_0 then
        return nil;
    else
        return l_result_0;
    end;
end;
local function _(v93, v94)
    v93 = tostring(v93);
    v94 = tostring(v94);
    local v95 = true;
    if v94 ~= "*" then
        v95 = v93 == v94;
    end;
    return v95;
end;
local function v111(v97, v98)
    local l_v97_Children_0 = v97:GetChildren();
    local v100 = {};
    for _, v102 in ipairs(l_v97_Children_0) do
        local l_pcall_0 = pcall;
        local v104 = "Name";
        local v105;
        l_pcall_0, v105 = l_pcall_0(function()
            return v102[v104];
        end);
        local v106 = if not l_pcall_0 then nil else v105;
        l_pcall_0 = v98;
        v106 = tostring(v106);
        l_pcall_0 = tostring(l_pcall_0);
        local v107 = true;
        if l_pcall_0 ~= "*" then
            v107 = v106 == l_pcall_0;
        end;
        if v107 then
            table.insert(v100, v102);
        end;
    end;
    if #v100 == 0 then
        local l_status_1, l_result_1 = pcall(function()
            return v97[v98];
        end);
        local v110 = if not l_status_1 then nil else l_result_1;
        if v110 then
            table.insert(v100, v110);
        end;
    end;
    return v100;
end;
local function v119(v112, v113)
    local v114 = {};
    for _, v116 in ipairs(v112) do
        for _, v118 in ipairs((v111(v116, v113))) do
            table.insert(v114, v118);
        end;
    end;
    return v114;
end;
local _ = function(v120, v121)
    for _, v123 in ipairs(v121) do
        v120 = v119(v120, v123);
    end;
    return v120;
end;
local function v141(v125, v126)
    local l_key_0 = v126.key;
    local v128, v129 = l_key_0:match("^%.?(.*[^\\])%.(%w-)$");
    if v129 == nil then
        v128 = "";
        v129 = l_key_0:match("^%.?(%w-)$");
    end;
    if v129 ~= nil then
        local v130 = v19(v128, ".");
        for v131 = 1, #v130 do
            v130[v131] = v0.removeSlash(v130[v131]);
        end;
        local v132 = {
            v125
        };
        for _, v134 in ipairs(v130) do
            v132 = v119(v132, v134);
        end;
        for _, v136 in ipairs(v132) do
            local l_v129_0 = v129;
            local l_l_v129_0_0 = l_v129_0 --[[ copy: 13 -> 16 ]];
            local l_status_2, l_result_2 = pcall(function()
                return v136[l_l_v129_0_0];
            end);
            l_status_2 = if not l_status_2 then nil else l_result_2;
            l_result_2 = v0.removeSlash(v126.value);
            l_status_2 = tostring(l_status_2);
            l_result_2 = tostring(l_result_2);
            l_v129_0 = true;
            if l_result_2 ~= "*" then
                l_v129_0 = l_status_2 == l_result_2;
            end;
            if l_v129_0 then
                return true;
            end;
        end;
    end;
    return false;
end;
local function v146(v142, v143)
    for _, v145 in ipairs(v143) do
        if not v141(v142, v145) then
            return false;
        end;
    end;
    return true;
end;
local function v152(v147, v148)
    if v148 == nil then
        return v147;
    else
        local v149 = {};
        for _, v151 in ipairs(v147) do
            if v146(v151, v148) then
                table.insert(v149, v151);
            end;
        end;
        return v149;
    end;
end;
v0.getFirstInstance = function(v153)
    local v154 = v153:getInstances();
    if #v154 == 0 then
        return nil;
    else
        return v154[1];
    end;
end;
v0.getInstances = function(v155)
    if v155:size() < 1 then
        error("instance " .. v155:toString() .. " does not exist");
    end;
    local v156 = nil;
    local l_name_0 = v155.data[1].name;
    if l_name_0 == "game" then
        v156 = game;
    elseif l_name_0 == "PluginGuiService" then
        v156 = game:GetService("PluginGuiService");
    end;
    if v155.root == nil and v156 == nil then
        error("instance " .. v155:toString() .. " does not exist");
    end;
    local v158 = {
        if not v155.root then v156 else v155.root
    };
    local v159 = not v155.root and 2 or 1;
    while true do
        if v159 <= v155:size() then
            v158 = v152(v119(v158, v155.data[v159].name), v155.data[v159].filter);
            if #v158 == 0 then
                return v158, v159 - 1;
            else
                v159 = v159 + 1;
            end;
        else
            return v158, v159 - 1;
        end;
    end;
end;
v0.setWait = function(v160, v161, v162)
    v160.waitDelay = v162 or v160.waitDelay;
    v160.waitTimeOut = v161 or v160.waitTimeOut;
    return v160;
end;
v0.waitFor = function(v163, v164, v165, v166, v167)
    v166 = v166 or v163.waitDelay;
    v167 = v167 or v163.waitTimeOut;
    assert(v167);
    v167 = os.clock() + v167;
    while true do
        local v168 = v164();
        if not v165(v168) then
            task.wait(v166);
            if v167 < os.clock() then
                return v168, false;
            end;
        else
            return v168, true;
        end;
    end;
end;
v0.waitForFirstInstance = function(v169)
    local v170 = v169:waitForNInstances(1);
    if v170 ~= nil and #v170 > 0 then
        return v170[1];
    else
        return nil;
    end;
end;
v0.waitForInstances = function(v171, v172)
    if type(v172) ~= "function" then
        error("arg #1 should be a function");
    end;
    return v171:waitFor(function()
        return v171:getInstances();
    end, v172);
end;
v0.waitForDisappear = function(v173)
    local _, v176 = v173:waitForInstances(function(v174)
        return #v174 == 0;
    end);
    return v176 == true;
end;
v0.waitForNInstances = function(v177, v178)
    local v180, v181 = v177:waitForInstances(function(v179)
        return v178 <= #v179;
    end);
    return v180 or {}, v181;
end;
return v0;


return {
    Element = require(script.Element),
    VirtualInput = require(script.VirtualInput),
    XPath = require(script.XPath),
    RemoteRhodium = require(script.RemoteRhodium),
    FindBy = require(script.FindBy)
};


return function(v0, v1)
    local v2 = {};
    local v3 = false;
    if not v0:IsA("GuiButton") then
        if not v0:IsA("TextBox") or v0:IsFocused() then
            local v4 = false;
            do
                local l_v4_0 = v4;
                table.insert(v2, v0.InputBegan:Connect(function(v6)
                    if v6.UserInputState ~= Enum.UserInputState.Cancel then
                        l_v4_0 = true;
                    end;
                end));
                table.insert(v2, v0.InputEnded:Connect(function(v7)
                    if not (not (v7.UserInputState ~= Enum.UserInputState.Cancel) or not l_v4_0) then
                        v3 = true;
                    end;
                end));
            end;
        else
            table.insert(v2, v0.Focused:Connect(function()
                v3 = true;
            end));
        end;
    else
        table.insert(v2, v0.Activated:Connect(function(v8)
            if v8.UserInputState ~= Enum.UserInputState.Cancel then
                v3 = true;
            end;
        end));
    end;
    v1();
    for _, v10 in v2, nil, nil do
        v10:Disconnect();
    end;
    return v3;
end;


local l_RunService_0 = game:GetService("RunService");
local l_IXPService_0 = game:GetService("IXPService");
local v2 = require(script.Parent.Roact);
local v3 = require(script.Parent.t);
local v4 = require(script.Parent.Cryo);
local v5 = require(script.Symbol);
local v6 = require(script.ExperimentContext);
local v7 = v5.named("IxpServiceProp");
local function v12(v8)
    assert(v3.table(v8));
    if l_IXPService_0 ~= nil then
        if l_RunService_0:IsStudio() then
            l_IXPService_0:ClearUserLayers();
        end;
        local v9 = {};
        for _, v11 in pairs(v8) do
            table.insert(v9, v11);
        end;
        l_IXPService_0:RegisterUserLayers(v9);
    end;
end;
local function v14(v13)
    if l_IXPService_0 ~= nil then
        l_IXPService_0:InitializeUserLayers(v13);
    end;
end;
local function v15()
    if l_IXPService_0 ~= nil then
        l_IXPService_0:ClearUserLayers();
    end;
end;
local function v48(v16, v17, v18, v19, v20)
    assert(v3.string(v16));
    assert(v3.string(v17));
    assert(v3.string(v18));
    assert(v3.string(v19));
    assert(v3.string(v20));
    return function(v21, v22, v23)
        if v23 == nil then
            v23 = true;
        end;
        local v24 = debug.traceback();
        assert(type(v21) == "table", "connect expects layerNames to be a list of layers");
        assert(type(v22) == "function", "connect expects mapLayersToProps to be a function");
        return function(v25)
            if v25 == nil then
                error(string.format("connect returns a function that must be passed a component.\n " .. "Check the connection at:\n %s", v24), 2);
            end;
            local v26 = v2.PureComponent:extend((("AppExperiment(%s)"):format((tostring(v25)))));
            v26.init = function(v27)
                v27.onLoadingStatusChangeConnection = nil;
                v27.state = {
                    layerToVariables = {},
                    layerLoadingStatus = Enum.IXPLoadingStatus.None
                };
                v27.updateStateLayerData = function(v28)
                    local v29 = v27.props[v7];
                    if v29 ~= nil then
                        local v30 = {};
                        for _, v32 in ipairs(v21) do
                            v30[v32] = v29[v18](v29, v32);
                        end;
                        v27:setState({
                            layerToVariables = v30,
                            layerLoadingStatus = v28
                        });
                    end;
                end;
                v27.logAllLayersExposure = function(v33)
                    local v34 = v27.props[v7];
                    if not (not (v34 ~= nil and v33 == Enum.IXPLoadingStatus.Initialized) or not v23) then
                        for _, v36 in ipairs(v21) do
                            if v34[v20](v34, v36) == Enum.IXPLoadingStatus.Initialized then
                                v34[v19](v34, v36);
                            end;
                        end;
                    end;
                end;
                local v37 = v27.props[v7];
                if v37 ~= nil then
                    v27.updateStateLayerData((v37[v17](v37)));
                end;
            end;
            v26.render = function(v38)
                local v39 = v4.Dictionary.join(v38.props, {
                    [v7] = v4.None
                });
                return v2.createElement(v25, (v4.Dictionary.join(v39, (v22(v38.state.layerToVariables, v39)))));
            end;
            v26.didMount = function(v40)
                local v41 = v40.props[v7];
                if v41 ~= nil then
                    v40.onLoadingStatusChangeConnection = v41[v16]:Connect(function(_)
                        local v43 = v41[v17](v41);
                        if v40.state.layerLoadingStatus ~= v43 then
                            v40.updateStateLayerData(v43, v18);
                            v40.logAllLayersExposure(v43);
                        end;
                    end);
                    local v44 = v41[v17](v41);
                    if v40.state.layerLoadingStatus ~= v44 then
                        v40.updateStateLayerData(v44, v18);
                    end;
                    v40.logAllLayersExposure(v44);
                end;
            end;
            v26.willUnmount = function(v45)
                if v45.onLoadingStatusChangeConnection ~= nil then
                    v45.onLoadingStatusChangeConnection:Disconnect();
                end;
            end;
            return function(v46)
                return v2.createElement(v6.Consumer, {
                    render = function(v47)
                        assert(v46[v7] == nil, "Symbol 'IxpServiceProp' should never exist in the incoming props.");
                        return v2.createElement(v26, (v4.Dictionary.join(v46, {
                            [v7] = v47
                        })));
                    end
                });
            end;
        end;
    end;
end;
return {
    Provider = v6.Provider,
    Consumer = v6.Consumer,
    Context = v6,
    registerUserLayers = v12,
    initializeUserLayers = v14,
    clearUserLayers = v15,
    useBrowserTrackerExperiment = require(script.useBrowserTrackerExperiment),
    useUserExperiment = require(script.useUserExperiment),
    useIXPService = require(script.useIXPService),
    connectBrowserTrackerLayer = v48("OnBrowserTrackerLayerLoadingStatusChanged", "GetBrowserTrackerLayerLoadingStatus", "GetBrowserTrackerLayerVariables", "LogBrowserTrackerLayerExposure", "GetBrowserTrackerStatusForLayer"),
    connectUserLayer = v48("OnUserLayerLoadingStatusChanged", "GetUserLayerLoadingStatus", "GetUserLayerVariables", "LogUserLayerExposure", "GetUserStatusForLayer"),
    MockIXPService = require(script.MockIXPService)
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("RoactAppExperiment");
local v1 = require(l_script_FirstAncestor_0.Parent.React);
local v2 = require(script.Parent.usePrevious);
local v3 = require(l_script_FirstAncestor_0.useIXPService);
local function _(v4)
    local v5 = "";
    for v6, v7 in ipairs(v4) do
        if v6 > 1 then
            v5 = v5 .. ",";
        end;
        v5 = v5 .. v7;
    end;
    return v5;
end;
return function(v9, v10, v11, v12, v13)
    return function(v14, v15, v16)
        if v16 == nil then
            v16 = true;
        end;
        local v17 = v3();
        assert(type(v14) == "table", "useExperiment expects layerNames to be a list of layers");
        assert(type(v15) == "function", "useExperiment expects mapLayers to be a function");
        local function v21()
            local v18 = {};
            for _, v20 in ipairs(v14) do
                v18[v20] = v17[v11](v17, v20);
                if not (not v18[v20] or next(v18[v20])) then
                    v18[v20] = nil;
                end;
            end;
            return v18;
        end;
        local function v22()
            return v17[v10](v17);
        end;
        local v23, v24 = v1.useState(v21);
        local v25, v26 = v1.useState(v22);
        local v27 = "";
        for v28, v29 in ipairs(v14) do
            if v28 > 1 then
                v27 = v27 .. ",";
            end;
            v27 = v27 .. v29;
        end;
        local l_v27_0 = v27;
        v1.useEffect(function()
            if v17 == nil then
                return function()
                end;
            else
                local function _()
                    local v31 = v17[v10](v17);
                    local v32 = v21();
                    v24(function(v33)
                        if not next(v32) ~= not next(v33) then
                            return v32;
                        else
                            return v33;
                        end;
                    end);
                    v26(v31);
                end;
                local v39 = v17[v9]:Connect(function(_)
                    local v36 = v17[v10](v17);
                    local v37 = v21();
                    v24(function(v38)
                        if not next(v37) ~= not next(v38) then
                            return v37;
                        else
                            return v38;
                        end;
                    end);
                    v26(v36);
                end);
                local v40 = v17[v10](v17);
                local v41 = v21();
                v24(function(v42)
                    if not next(v41) ~= not next(v42) then
                        return v41;
                    else
                        return v42;
                    end;
                end);
                v26(v40);
                return function()
                    if v39 ~= nil then
                        v39:Disconnect();
                    end;
                end;
            end;
        end, {
            v17,
            l_v27_0
        });
        v27 = v2(v25) or Enum.IXPLoadingStatus.None;
        v1.useEffect(function()
            if ((v16 and v17 ~= nil) and v25 == Enum.IXPLoadingStatus.Initialized) and v27 ~= Enum.IXPLoadingStatus.Initialized then
                for _, v44 in ipairs(v14) do
                    if v17[v13](v17, v44) == Enum.IXPLoadingStatus.Initialized then
                        v17[v12](v17, v44);
                    end;
                end;
            end;
        end, {
            v17,
            l_v27_0,
            v16,
            v25,
            v27
        });
        return v15(v23);
    end;
end;


local v0 = require(script.Parent.makeUseExperiment)("OnBrowserTrackerLayerLoadingStatusChanged", "GetBrowserTrackerLayerLoadingStatus", "GetBrowserTrackerLayerVariables", "LogBrowserTrackerLayerExposure", "GetBrowserTrackerStatusForLayer");
return function(v1, v2, v3)
    return v0(v1, v2, v3);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("RoactAppExperiment");
local l_IXPService_0 = game:GetService("IXPService");
local v2 = require(l_script_FirstAncestor_0.Parent.React);
local v3 = require(script.Parent.ExperimentContext);
return function()
    local v4 = v2.useContext(v3);
    if not v4 then
        return l_IXPService_0;
    else
        return v4;
    end;
end;


local v0 = require(script:FindFirstAncestor("RoactAppExperiment").Parent.React);
return function(v1)
    local v2 = v0.useRef(nil);
    v0.useEffect(function()
        v2.current = v1;
    end);
    return v2.current;
end;


local v0 = require(script.Parent.makeUseExperiment)("OnUserLayerLoadingStatusChanged", "GetUserLayerLoadingStatus", "GetUserLayerVariables", "LogUserLayerExposure", "GetUserStatusForLayer");
return function(v1, v2, v3)
    return v0(v1, v2, v3);
end;


local v0 = require(script.Parent.Parent.ReactRoblox);
local v1 = require(script.Parent.warnOnce);
return function(v2)
    if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
        v1("Roact.Portal", "Please use the createPortal API on ReactRoblox instead");
    end;
    return v0.createPortal(v2.children, v2.target);
end;


local l_Parent_0 = script.Parent.Parent;
local l_inspect_0 = require(l_Parent_0.LuauPolyfill).util.inspect;
local v2 = require(l_Parent_0.ReactRoblox);
local v3 = require(script.Parent.warnOnce);
return {
    mount = function(v4, v5, v6)
        if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
            v3("mount", "Please use the createRoot API in ReactRoblox");
        end;
        if v5 ~= nil and typeof(v5) ~= "Instance" then
            error(string.format("Cannot mount element (`%s`) into a parent that is not a Roblox Instance (got type `%s`) \n%s", not v4 and "<unknown>" or tostring(v4.type), typeof(v5), (function()
                if v5 ~= nil then
                    return l_inspect_0(v5);
                else
                    return "";
                end;
            end)()));
        end;
        local v7 = nil;
        v7 = if not _G.__ROACT_17_COMPAT_LEGACY_ROOT__ then v2.createRoot(Instance.new("Folder")) else v2.createLegacyRoot(Instance.new("Folder"));
        if v5 == nil then
            local l_Folder_0 = Instance.new("Folder");
            l_Folder_0.Name = "Target";
            v5 = l_Folder_0;
        end;
        if v6 == nil then
            v6 = not _G.__ROACT_17_COMPAT_LEGACY_ROOT__ and "ReactRoot" or "ReactLegacyRoot";
        end;
        if not _G.__ROACT_17_INLINE_ACT__ then
            v7:render(v2.createPortal({
                [v6] = v4
            }, v5));
        else
            v2.act(function()
                v7:render(v2.createPortal({
                    [v6] = v4
                }, v5));
            end);
        end;
        return {
            root = v7,
            parent = v5,
            key = v6
        };
    end,
    update = function(v9, v10)
        if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
            v3("update", "Please use the createRoot API in ReactRoblox");
        end;
        local l_key_0 = v9.key;
        local l_parent_0 = v9.parent;
        if not _G.__ROACT_17_INLINE_ACT__ then
            v9.root:render(v2.createPortal({
                [l_key_0] = v10
            }, l_parent_0));
            return v9;
        else
            v2.act(function()
                v9.root:render(v2.createPortal({
                    [l_key_0] = v10
                }, l_parent_0));
            end);
            return v9;
        end;
    end,
    unmount = function(v13)
        if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
            v3("unmount", "Please use the createRoot API in ReactRoblox");
        end;
        if not _G.__ROACT_17_INLINE_ACT__ then
            v13.root:unmount();
            return ;
        else
            v2.act(function()
                v13.root:unmount();
            end);
            return ;
        end;
    end
};


local v0 = require(script.Parent.Parent.React);
local v1 = require(script.Parent.warnOnce);
return function(v2)
    if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
        v1("createFragment", "Please instead use:\n\tReact.createElement(React.Fragment, ...)");
    end;
    return v0.createElement(v0.Fragment, nil, v2);
end;


local l_Parent_0 = script.Parent;
local v1 = require(l_Parent_0.React);
local v2 = require(l_Parent_0.ReactRoblox);
local v3 = require(l_Parent_0.Shared);
local v4 = require(script.RoactTree);
return {
    Component = v1.Component,
    PureComponent = v1.PureComponent,
    createElement = v1.createElement,
    createRef = v1.createRef,
    forwardRef = v1.forwardRef,
    createContext = v1.createContext,
    None = v1.None,
    mount = v4.mount,
    update = v4.update,
    unmount = v4.unmount,
    createFragment = require(script.createFragment),
    oneChild = require(script.oneChild),
    setGlobalConfig = require(script.setGlobalConfig),
    Portal = require(script.Portal),
    Ref = "ref",
    Children = "children",
    Event = v3.Event,
    Change = v3.Change,
    createBinding = v1.createBinding,
    joinBindings = v1.joinBindings,
    act = v2.act
};


local v0 = require(script.Parent.Parent.React);
local v1 = require(script.Parent.warnOnce);
return function(v2)
    if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
        v1("oneChild", "You likely don't need this at all If you were assigning children " .. "via `React.oneChild(someChildren)`, you can simply use " .. "`someChildren` directly.");
    end;
    if v2 then
        local v3, v4 = next(v2);
        if v4 then
            if next(v2, v3) then
                error("Expected at most one child, had more than one child.", 2);
            end;
            return v0.Children.only(v4);
        else
            return nil;
        end;
    else
        return nil;
    end;
end;


local v0 = require(script.Parent.warnOnce);
return function(_)
    if not (not _G.__DEV__ or not _G.__COMPAT_WARNINGS__) then
        v0("setGlobalConfig", "Roact 17 uses a `_G.__DEV__` flag to enable development behavior. " .. "If you're seeing this warning, you already have it enabled. " .. "Please remove any redundant uses of `setGlobalConfig`.");
    end;
end;


local l_console_0 = require(script.Parent.Parent.Shared).console;
local v1 = {};
return function(v2, v3)
    if not v1[v2] then
        l_console_0.warn("The legacy Roact API '%s' is deprecated, and will be removed " .. "in a future release.\n\n%s", v2, v3);
    end;
    v1[v2] = true;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Cryo);
local v2 = require(l_Parent_0.Roact);
local v3 = require(script.Parent.FitFrameOnAxis);
local v4 = require(script.Parent.isRoact17);
return v2.forwardRef(function(v5, v6)
    v5 = v5 or {};
    return v2.createElement(v3, (v1.Dictionary.join(v5, {
        axis = v3.Axis.Horizontal,
        minimumSize = UDim2.new(UDim.new(0, 0), v5.height),
        [if not v4() then v2.Ref else "forwardedRef"] = v6,
        height = v1.None
    })));
end);


local l_Parent_0 = script.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v2 = require(l_Parent_1.Cryo);
local v3 = require(l_Parent_1.Roact);
local v4 = require(l_Parent_0.isRoact17);
local v5 = require(l_Parent_0.Rect);
local v6 = {
    Horizontal = {},
    Vertical = {},
    Both = {}
};
local v7 = v3.PureComponent:extend("FitFrameOnAxis");
v7.defaultProps = {
    axis = v6.Vertical,
    minimumSize = UDim2.new(UDim.new(0, 0), UDim.new(0, 0)),
    margin = v5.square(0),
    FillDirection = Enum.FillDirection.Vertical,
    HorizontalAlignment = Enum.HorizontalAlignment.Left,
    ImageSet = {},
    VerticalAlignment = Enum.VerticalAlignment.Top,
    contentPadding = UDim.new(0, 0),
    textProps = nil
};
v7.init = function(v8)
    v8.layoutRef = v3.createRef();
    if not v4() then
        v8.frameRef = v8.props[v3.Ref] or v3.createRef();
    else
        v8.frameRef = v8.props.forwardedRef or v3.createRef();
    end;
    v8.onResize = function()
        local l_current_0 = v8.layoutRef.current;
        local l_current_1 = v8.frameRef.current;
        if l_current_1 and l_current_0 then
            l_current_1.Size = v8:__getSize(l_current_0);
            return ;
        else
            return ;
        end;
    end;
end;
v7.render = function(v11)
    assert(v11.props.Size == nil, "Size is not a valid property of FitFrameOnAxis. Did you mean `minimumSize`?");
    local v12 = v11.props[v3.Children] or {};
    local v13 = v11:__getFilteredProps();
    local v14 = not v11.props.onActivated and "ImageLabel" or "ImageButton";
    v12 = v2.Dictionary.join(v12, {
        ["$layout"] = v3.createElement("UIListLayout", {
            FillDirection = v11.props.FillDirection,
            HorizontalAlignment = v11.props.HorizontalAlignment,
            Padding = v11.props.contentPadding,
            SortOrder = Enum.SortOrder.LayoutOrder,
            VerticalAlignment = v11.props.VerticalAlignment,
            [v3.Change.AbsoluteContentSize] = v11.onResize,
            [v3.Ref] = v11.layoutRef
        }),
        ["$margin"] = v3.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, v11.props.margin.left),
            PaddingRight = UDim.new(0, v11.props.margin.right),
            PaddingTop = UDim.new(0, v11.props.margin.top),
            PaddingBottom = UDim.new(0, v11.props.margin.bottom)
        })
    });
    if not v11.props.textProps then
        return v3.createElement(v14, v13, v12);
    else
        return v3.createElement(v14, v13, {
            TextLabel = v3.createElement("TextLabel", v2.Dictionary.join(v11.props.textProps, {
                BackgroundTransparency = 1,
                Size = UDim2.fromScale(1, 1)
            })),
            ChildFrame = v3.createElement("Frame", {
                BackgroundTransparency = 1,
                Size = UDim2.fromScale(1, 1)
            }, v12)
        });
    end;
end;
v7.didMount = function(v15)
    v15.onResize();
end;
v7.didUpdate = function(v16)
    v16.onResize();
end;
v7.__getFilteredProps = function(v17)
    local v18 = v2.Dictionary.join(v17.props.ImageSet, {
        [v3.Ref] = v17.frameRef,
        [v3.Event.Activated] = v17.props.onActivated
    });
    for v19, _ in pairs(v7.defaultProps) do
        v18[v19] = v2.None;
    end;
    v18.textProps = v2.None;
    return v2.Dictionary.join(v17.props, v18, {
        onActivated = v2.None,
        forwardedRef = v2.None,
        [v3.Children] = v2.None
    });
end;
v7.__getSize = function(v21, v22)
    if v21.props.axis == v6.Both then
        return v21:__getBothAxisSize(v22);
    else
        local v23 = v21:__getAxisUDim(v22.AbsoluteContentSize);
        local v24 = v21:__getOtherUDim();
        if v21.props.axis == v6.Vertical then
            return UDim2.new(v24, v23);
        elseif v21.props.axis == v6.Horizontal then
            return UDim2.new(v23, v24);
        else
            return ;
        end;
    end;
end;
v7.__getBothAxisSize = function(v25, v26)
    local l_minimumSize_0 = v25.props.minimumSize;
    local l_AbsoluteContentSize_0 = v26.AbsoluteContentSize;
    return UDim2.new(UDim.new(l_minimumSize_0.X.Scale, l_AbsoluteContentSize_0.X + v25:__getHorizontalMargin()), (UDim.new(l_minimumSize_0.Y.Scale, l_AbsoluteContentSize_0.Y + v25:__getVerticalMargin())));
end;
v7.__getAxisUDim = function(v29, v30)
    local l_minimumSize_1 = v29.props.minimumSize;
    local v32 = nil;
    local v33 = nil;
    if v29.props.axis == v6.Vertical then
        v32 = l_minimumSize_1.Y;
        v33 = v30.Y + v29:__getVerticalMargin();
    elseif v29.props.axis == v6.Horizontal then
        v32 = l_minimumSize_1.X;
        v33 = v30.X + v29:__getHorizontalMargin();
    end;
    return UDim.new(v32.Scale, (math.max(v33, v32.Offset)));
end;
v7.__getVerticalMargin = function(v34)
    return v34.props.margin.top + v34.props.margin.bottom;
end;
v7.__getHorizontalMargin = function(v35)
    return v35.props.margin.left + v35.props.margin.right;
end;
v7.__getOtherUDim = function(v36)
    local l_minimumSize_2 = v36.props.minimumSize;
    if v36.props.axis == v6.Vertical then
        return l_minimumSize_2.X;
    elseif v36.props.axis == v6.Horizontal then
        return l_minimumSize_2.Y;
    else
        return ;
    end;
end;
local v38 = nil;
v38 = if not v4() then v7 else v3.forwardRef(function(v39, v40)
    return v3.createElement(v7, v2.Dictionary.join(v39, {
        forwardedRef = v40
    }));
end);
v38.Axis = v6;
return v38;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Cryo);
local v2 = require(l_Parent_0.Roact);
local v3 = require(script.Parent.FitFrameOnAxis);
local v4 = require(script.Parent.isRoact17);
return v2.forwardRef(function(v5, v6)
    v5 = v5 or {};
    return v2.createElement(v3, (v1.Dictionary.join(v5, {
        axis = v3.Axis.Vertical,
        minimumSize = UDim2.new(v5.width, UDim.new(0, 0)),
        [if not v4() then v2.Ref else "forwardedRef"] = v6,
        width = v1.None
    })));
end);


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Cryo);
local v2 = require(l_Parent_0.Roact);
local v3 = nil;
local l_status_0, l_result_0 = pcall(function()
    return game:GetEngineFeature("TextBoundsRoundUp");
end);
v3 = l_status_0 and l_result_0;
l_status_0 = game:GetService("TextService");
l_result_0 = function(v6, v7, v8, v9)
    if not v3 then
        return l_status_0:GetTextSize(v6, v7, v8, Vector2.new(v9, 10000)).Y + 2;
    else
        return l_status_0:GetTextSize(v6, v7, v8, Vector2.new(v9, 10000)).Y;
    end;
end;
local function v13(v10, v11, v12)
    if not v3 then
        return l_status_0:GetTextSize(v10, v11, v12, Vector2.new(10000, 10000)).X + 2;
    else
        return l_status_0:GetTextSize(v10, v11, v12, Vector2.new(10000, 10000)).X;
    end;
end;
local v14 = {
    FitToText = {}
};
local v15 = v2.PureComponent:extend("FitTextLabel");
v15.defaultProps = {
    Font = Enum.Font.SourceSans,
    Text = "Label",
    TextSize = 12,
    TextWrapped = true,
    maximumWidth = math.huge
};
v15.init = function(v16)
    if v2.Ref == "ref" then
        v16.frameRef = v16.props.forwardedRef or v2.createRef();
    else
        v16.frameRef = v16.props[v2.Ref] or v2.createRef();
    end;
    v16.onResize = function()
        if v16.frameRef.current then
            v16.frameRef.current.Size = v16:__getSize(v16.frameRef.current);
            return ;
        else
            return ;
        end;
    end;
end;
v15.render = function(v17)
    return v2.createElement(not v17.props.onActivated and "TextLabel" or "TextButton", v17:__getFilteredProps());
end;
v15.didMount = function(v18)
    v18.onResize();
end;
v15.didUpdate = function(v19)
    v19.onResize();
end;
v15.__getFilteredProps = function(v20)
    local v21 = {
        width = v1.None,
        maximumWidth = v1.None,
        onActivated = v1.None,
        forwardedRef = v1.None,
        Size = UDim2.new(v20.props.width, UDim.new(0, 0)),
        [v2.Ref] = v20.frameRef
    };
    local l_Children_0 = v2.Children;
    local l_join_0 = v1.Dictionary.join;
    local v24 = v20.props[v2.Children] or {};
    local v25 = {};
    local v26 = false;
    if v20.props.maximumWidth < math.huge then
        v26 = v2.createElement("UISizeConstraint", {
            MaxSize = Vector2.new(v20.props.maximumWidth, math.huge)
        });
    end;
    v25.sizeConstraint = v26;
    v21[l_Children_0] = l_join_0(v24, v25);
    v21[v2.Event.Activated] = v20.props.onActivated;
    v21[v2.Change.AbsoluteSize] = function(v27)
        if v20.props[v2.Change.AbsoluteSize] then
            v20.props[v2.Change.AbsoluteSize](v27);
        end;
        v20.onResize();
    end;
    return v1.Dictionary.join(v20.props, v21);
end;
v15.__getSize = function(v28, v29)
    local l_maximumWidth_0 = v28.props.maximumWidth;
    local l_width_0 = v28.props.width;
    if l_width_0 == v14.FitToText then
        l_width_0 = UDim.new(0, (math.min(v13(v28.props.Text, v28.props.TextSize, v28.props.Font), l_maximumWidth_0)));
    end;
    return UDim2.new(l_width_0, UDim.new(0, (l_result_0(v28.props.Text, v28.props.TextSize, v28.props.Font, (math.max(l_maximumWidth_0 < math.huge and l_maximumWidth_0 or 0, v29.AbsoluteSize.X))))));
end;
local v32 = nil;
v32 = if v2.Ref == "ref" then v2.forwardRef(function(v33, v34)
    return v2.createElement(v15, v1.Dictionary.join(v33, {
        forwardedRef = v34
    }));
end) else v15;
v32.Width = v14;
return v32;


return {
    rectangle = function(v0, v1)
        return {
            top = v1,
            bottom = v1,
            left = v0,
            right = v0
        };
    end,
    square = function(v2)
        return {
            top = v2,
            bottom = v2,
            left = v2,
            right = v2
        };
    end,
    quad = function(v3, v4, v5, v6)
        return {
            top = v3,
            bottom = v5,
            left = v6,
            right = v4
        };
    end
};


return {
    FitFrameHorizontal = require(script.FitFrameHorizontal),
    FitFrameOnAxis = require(script.FitFrameOnAxis),
    FitFrameVertical = require(script.FitFrameVertical),
    FitTextLabel = require(script.FitTextLabel),
    Rect = require(script.Rect)
};


local v0 = require(script.Parent.Parent.Roact);
return function()
    return v0.Ref == "ref";
end;


local v0 = require(script.Parent.Parent.Cryo);
local v1 = require(script.Parent.Input);
local v2 = require(script.Parent.createSignal);
local v3 = require(script.Parent.debugPrint);
local v4 = require(script.Parent.FocusControllerInternalApi);
local v5 = {};
v5.__index = v5;
v5.new = function()
    return (setmetatable({
        selectionChangedSignal = v2(),
        boundInputsChangedSignal = v2(),
        focusNodeTree = {},
        allNodes = {},
        rootRef = nil,
        engineInterface = nil,
        captureFocusOnInitialize = false,
        moveFocusToOnInitialize = nil,
        inputDisconnectors = {},
        boundInputs = {},
        focusedLeaf = nil,
        inProgressFocus = nil
    }, v5));
end;
v5.isInitialized = function(v6)
    return v6.engineInterface ~= nil;
end;
v5.moveFocusTo = function(v7, v8)
    if v7.engineInterface == nil then
        v7.moveFocusToOnInitialize = v8;
        return ;
    else
        v3("[FOCUS] Move focus to", v8);
        local v9 = v7.allNodes[v8];
        if not (not (v9 ~= nil) or v7:isNodeFocused(v9)) then
            v9:focus();
        end;
        v7:debugPrintTree();
        return ;
    end;
end;
v5.moveFocusToNeighbor = function(v10, v11)
    if v10.engineInterface == nil then
        error("FocusController is not connected to a component hierarchy", 2);
    end;
    if v10.focusedLeaf ~= nil then
        v3("[FOCUS] Move focus to", v11, "from", v10.focusedLeaf.ref);
        local v12 = v10.focusedLeaf.ref:getValue();
        if v12 ~= nil and v12[v11] ~= nil then
            v10:setSelection(v12[v11]);
        end;
    end;
end;
v5.getSelection = function(v13)
    return v13.engineInterface.getSelection();
end;
v5.setSelection = function(v14, v15)
    v14.engineInterface.setSelection(v15);
end;
v5.registerNode = function(v16, v17, v18, v19)
    if v17 ~= nil then
        v3("[TREE ] Registering child node", v18);
        local v20 = v16.focusNodeTree[v17] or {};
        v20[v18] = v19;
        v16.focusNodeTree[v17] = v20;
        v16.allNodes[v18] = v19;
        v16:descendantAddedRefocus();
        return ;
    else
        v3("[TREE ] Registering root node", v18);
        v16.rootRef = v18;
        v16.allNodes[v18] = v19;
        if v16.captureFocusOnRootRegistered then
            v16.captureFocusOnRootRegistered = false;
            v16:captureFocus();
        end;
        return ;
    end;
end;
v5.deregisterNode = function(v21, v22, v23)
    if v22 ~= nil then
        v3("[TREE ] Deregistering child node", v23);
        v21.focusNodeTree[v22][v23] = nil;
        v21.allNodes[v23] = nil;
        v21:descendantRemovedRefocus();
        return ;
    else
        v3("[TREE ] Deregistering root node", v23);
        v21.allNodes[v23] = nil;
        return ;
    end;
end;
v5.needsDescendantRemovedRefocus = function(v24)
    if v24.focusedLeaf == nil then
        return ;
    else
        return v24.focusedLeaf.ref:getValue() == nil;
    end;
end;
v5.descendantRemovedRefocus = function(v25)
    if v25:needsDescendantRemovedRefocus() then
        v3("[FOCUS] Focused node was removed; refocusing from nearest existing ancestor");
        local l_parent_0 = v25.focusedLeaf.parent;
        while l_parent_0 ~= nil and v25.allNodes[l_parent_0.ref] == nil do
            l_parent_0 = l_parent_0.parent;
        end;
        if l_parent_0 ~= nil then
            l_parent_0:focus();
        end;
    end;
end;
v5.needsDescendantAddedRefocus = function(v27)
    if v27.focusedLeaf == nil then
        return nil;
    else
        return not v0.isEmpty(v27:getChildren(v27.focusedLeaf));
    end;
end;
v5.descendantAddedRefocus = function(v28)
    if v28:needsDescendantAddedRefocus() then
        v3("[FOCUS] Currently-focused node is no longer a leaf; refocusing", v28.focusedLeaf.ref);
        v28.focusedLeaf:focus();
    end;
end;
v5.getChildren = function(v29, v30)
    return v29.focusNodeTree[v30] or {};
end;
v5.isNodeFocused = function(v31, v32)
    if v31.focusedLeaf == nil then
        return false;
    elseif v31.focusedLeaf == v32 then
        return true;
    else
        local l_parent_1 = v31.focusedLeaf.parent;
        while true do
            if l_parent_1 ~= nil then
                if l_parent_1 == v32 then
                    return true;
                else
                    l_parent_1 = l_parent_1.parent;
                end;
            else
                return false;
            end;
        end;
    end;
end;
v5.setFocusedLeaf = function(v34, v35)
    v34.focusedLeaf = v35;
end;
v5.setInProgressFocus = function(v36, v37)
    v36.inProgressFocus = v37;
end;
v5.isInProgressFocus = function(v38, v39)
    return v38.inProgressFocus == v39;
end;
v5.debugPrintTree = function(v40)
    if v3.isEnabled then
        local function v41(v42, v43)
            local v44 = tostring(v42.ref);
            if v40:isNodeFocused(v42) then
                v44 = v44 .. "*";
            end;
            v3(v43, v44);
            for _, v46 in pairs((v40:getChildren(v42))) do
                v41(v46, v43 .. "  ");
            end;
        end;
        v3("Focus Node Tree:");
        v41(v40.allNodes[v40.rootRef], "  ");
        return ;
    else
        return ;
    end;
end;
v5.updateInputBindings = function(v47)
    local v48 = {};
    local l_focusedLeaf_0 = v47.focusedLeaf;
    while l_focusedLeaf_0 ~= nil do
        for _, v51 in pairs(l_focusedLeaf_0.inputBindings) do
            local v52 = v1.getUniqueKey(v51);
            if v48[v52] == nil then
                v3("[INPUT] Bind input", v52);
                v48[v52] = v51;
            end;
        end;
        l_focusedLeaf_0 = l_focusedLeaf_0.parent;
    end;
    for _, v54 in pairs(v47.inputDisconnectors) do
        v54();
    end;
    v47.inputDisconnectors = {};
    v47.boundInputs = {};
    for v55, v56 in pairs(v48) do
        v47.inputDisconnectors[v55] = v1.connectToEvent(v56, v47.engineInterface);
        if v56.keyCode then
            v47.boundInputs[v56.keyCode] = v56.meta or {};
        end;
    end;
    v47.boundInputsChangedSignal:fire(v47.boundInputs);
end;
v5.initialize = function(v57, v58)
    if v57.engineInterface ~= nil then
        error("FocusController cannot be initialized more than once; make sure you are not passing it to multiple components");
    end;
    v57.engineInterface = v58;
    v57.guiServiceConnection = v58.subscribeToSelectionChanged(function()
        if v57.rootRef == nil then
            return ;
        else
            local v59 = v57.focusedLeaf ~= nil;
            v57.focusedLeaf = nil;
            local v60 = v58.getSelection();
            local v61 = v57.rootRef:getValue();
            if not (not (v60 ~= nil) or v61 ~= v60 and not v60:IsDescendantOf(v61)) then
                v3("[EVENT] Selection changed to", v60, "in focus hierarchy beginning at", v61);
                for v62, v63 in pairs(v57.allNodes) do
                    if v60 == v62:getValue() then
                        v57.focusedLeaf = v63;
                        break;
                    end;
                end;
            end;
            if not (v57.focusedLeaf == nil and not v59) then
                v57.selectionChangedSignal:fire();
                v57:updateInputBindings();
            end;
            return ;
        end;
    end);
    if v57.captureFocusOnInitialize then
        v57:captureFocus();
    end;
    if v57.moveFocusToOnInitialize then
        v57:moveFocusTo(v57.moveFocusToOnInitialize);
    end;
end;
v5.captureFocus = function(v64)
    if v64.engineInterface == nil then
        v64.captureFocusOnInitialize = true;
        return ;
    elseif v64.rootRef == nil then
        v64.captureFocusOnRootRegistered = true;
        return ;
    else
        v64.allNodes[v64.rootRef]:focus();
        v64:debugPrintTree();
        return ;
    end;
end;
v5.releaseFocus = function(v65)
    if v65.engineInterface ~= nil then
        v65.engineInterface.setSelection(nil);
    end;
    v65.captureFocusOnInitialize = false;
    v65.captureFocusOnRootRegistered = false;
end;
v5.teardown = function(v66)
    if v66.guiServiceConnection ~= nil then
        v66.guiServiceConnection:Disconnect();
    end;
    for _, v68 in pairs(v66.inputDisconnectors) do
        v68();
    end;
    v66.rootRef = nil;
    v66.engineInterface = nil;
    v66.captureFocusOnInitialize = false;
    v66.captureFocusOnRootRegistered = false;
    v66.focusedLeaf = nil;
end;
v5.subscribeToSelectionChange = function(v69, v70)
    v3("[TREE ] New subscription to selection change event");
    return v69.selectionChangedSignal:subscribe(v70);
end;
v5.createPublicApiWrapper = function()
    local v71 = v5.new();
    return {
        [v4] = v71,
        moveFocusTo = function(...)
            v71:moveFocusTo(...);
        end,
        moveFocusLeft = function()
            v71:moveFocusToNeighbor("NextSelectionLeft");
        end,
        moveFocusRight = function()
            v71:moveFocusToNeighbor("NextSelectionRight");
        end,
        moveFocusUp = function()
            v71:moveFocusToNeighbor("NextSelectionUp");
        end,
        moveFocusDown = function()
            v71:moveFocusToNeighbor("NextSelectionDown");
        end,
        captureFocus = function()
            v71:captureFocus();
        end,
        releaseFocus = function()
            v71:releaseFocus();
        end,
        getCurrentFocus = function()
            local l_focusedLeaf_1 = v71.focusedLeaf;
            return not not l_focusedLeaf_1 and l_focusedLeaf_1.ref or nil;
        end,
        getBoundInputs = function()
            return v71.boundInputs;
        end,
        subscribeToBoundInputsChanged = function(v73)
            return v71.boundInputsChangedSignal:subscribe(v73);
        end
    };
end;
return v5;


local v0 = require(script.Parent.Parent.Cryo);
local v1 = require(script.Parent.FocusControllerInternalApi);
local v2 = require(script.Parent.inputBindingsEqual);
local v3 = require(script.Parent.debugPrint);
local v4 = require(script.Parent.Config);
local v5 = {};
v5.__index = v5;
v5.new = function(v6, v7)
    local v8 = nil;
    if v6.parentFocusNode ~= nil then
        v8 = v6.parentFocusNode.focusController;
    elseif v6.focusController ~= nil then
        v8 = v6.focusController;
    else
        error("Cannot create node without focus manager");
    end;
    local v9 = setmetatable({
        focusController = v8,
        ref = v7,
        lastFocused = nil
    }, v5);
    v9:updateNavProps(v6);
    return v9;
end;
v5.__getFocusControllerInternal = function(v10)
    return v10.focusController[v1];
end;
v5.__findDefaultChildNode = function(v11)
    local l_huge_0 = math.huge;
    local v13 = nil;
    local v14 = v11:__getFocusControllerInternal():getChildren(v11);
    local v15 = v11.ref:getValue();
    for v16, v17 in pairs(v14) do
        local v18 = v16:getValue();
        while v18 ~= v15 and v18 ~= nil do
            if v18:isA("GuiObject") then
                local l_LayoutOrder_0 = v18.LayoutOrder;
                if l_LayoutOrder_0 ~= 0 then
                    if l_LayoutOrder_0 < l_huge_0 then
                        l_huge_0 = l_LayoutOrder_0;
                        v13 = v17;
                        break;
                    else
                        break;
                    end;
                end;
            end;
            v18 = v18.Parent;
        end;
    end;
    if v13 ~= nil then
        return v13;
    else
        for v20, v21 in pairs(v14) do
            if v20:getValue() ~= nil then
                return v21;
            end;
        end;
        return nil;
    end;
end;
v5.updateNavProps = function(v22, v23)
    local v24 = false;
    if v23.restorePreviousChildFocus ~= nil then
        v24 = v23.restorePreviousChildFocus;
    end;
    local l_inputBindings_0 = v22.inputBindings;
    v22.defaultChildRef = v23.defaultChild;
    v22.restorePreviousChildFocus = v24;
    v22.inputBindings = v23.inputBindings or {};
    local v26 = v22:__getFocusControllerInternal();
    if not (not v26:isNodeFocused(v22) or v2(l_inputBindings_0, v22.inputBindings)) then
        v26:updateInputBindings();
    end;
end;
v5.focus = function(v27)
    if v4.Enabled then
        local v28 = v27:__getFocusControllerInternal();
        if v28:isInitialized() then
            v28:setInProgressFocus(v27);
            if not v0.isEmpty((v28:getChildren(v27))) then
                local v29 = os.clock();
                local v30 = false;
                if v27.defaultChildRef ~= nil then
                    v30 = false;
                    if v28.allNodes[v27.defaultChildRef] ~= nil then
                        v30 = v27.defaultChildRef:getValue() ~= nil;
                    end;
                end;
                local v31 = true;
                if v27.timeout ~= nil then
                    v31 = v29 < v27.timeout;
                end;
                if not (v27.restorePreviousChildFocus and v27.lastFocused ~= nil) or not v27.lastFocused:getValue() then
                    if not v27.defaultChildRef or not v31 and not v30 then
                        if v27.timeout ~= nil then
                            v3("[FOCUS] Timeout for default child of", v27.ref);
                            v27.timeout = nil;
                        end;
                        local v32 = v27:__findDefaultChildNode();
                        if v32 ~= nil then
                            v3("[FOCUS] No default, use fallback logic to focus", v32.ref);
                            v32:focus();
                            return ;
                        else
                            v28:setFocusedLeaf(v27);
                            v28:setInProgressFocus(nil);
                            return ;
                        end;
                    elseif not v30 then
                        if v27.timeout == nil then
                            v3("[FOCUS] Default child specified is not valid. Wait for it to be assigned...");
                            v27.timeout = v29 + 0.5;
                        end;
                        task.delay(0, function()
                            if v28:isInProgressFocus(v27) then
                                v27:focus();
                            end;
                        end);
                        return ;
                    else
                        v3("[FOCUS] Found valid default child", v27.defaultChildRef, "for", v27.ref);
                        v27.timeout = nil;
                        v28:moveFocusTo(v27.defaultChildRef);
                        return ;
                    end;
                else
                    v3("[FOCUS] Restore previous focus:", v27.lastFocused);
                    v28:moveFocusTo(v27.lastFocused);
                    return ;
                end;
            else
                v28:setSelection(v27.ref:getValue());
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v5.attachToTree = function(v33, v34, v35)
    local v36 = v33:__getFocusControllerInternal();
    v36:registerNode(v34, v33.ref, v33);
    v33.parent = v34;
    v33.disconnectSelectionListener = v36:subscribeToSelectionChange(function()
        local v37 = v36:isNodeFocused(v33);
        v35(v37);
        if not (not (v33.parent ~= nil) or not v37) then
            v33.parent.lastFocused = v33.ref;
        end;
        if not (v0.isEmpty((v36:getChildren(v33))) or not v37) and v36:getSelection() == v33.ref:getValue() then
            v33:focus();
        end;
    end);
end;
v5.detachFromTree = function(v38)
    v38:__getFocusControllerInternal():deregisterNode(v38.parent, v38.ref);
    if v38.disconnectSelectionListener ~= nil then
        v38.disconnectSelectionListener();
        v38.disconnectSelectionListener = nil;
    end;
end;
return v5;