local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_ScriptEditorService_0 = game:GetService("ScriptEditorService");
local l_MarketplaceService_0 = game:GetService("MarketplaceService");
local l_ScriptAnalysis_0 = l_script_FirstAncestor_0.Src.Util.ScriptAnalysis;
local v5 = require(l_ScriptAnalysis_0.StringUtil);
local v6 = require(l_ScriptAnalysis_0.findAssetId);
local v7 = require(l_ScriptAnalysis_0.buildRange);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v9 = require(l_Util_0.findAllInServices);
local v10 = require(l_Util_0.SaveInterface);
local v11 = require(l_Util_0.AnimationConversion.AnimationConversionManager);
local v12 = require(l_Util_0.ScriptHistory.ChunkUtil);
local l_AnimationTagging_0 = require(l_Util_0.PublishTagging).AnimationTagging;
local l_AnimationConversion_0 = l_Util_0.AnimationConversion;
local v15 = require(l_AnimationConversion_0.DiagRef);
local v16 = require(l_AnimationConversion_0.AnimationState);
local v17 = require(l_AnimationConversion_0.constants);
local l_AssetType_0 = v17.AssetType;
local l_AnimationStatus_0 = v17.AnimationStatus;
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local v21 = require(l_Actions_0.SetStatus);
local v22 = require(l_Actions_0.SetAnimations);
local l_OriginalId_0 = require(l_script_FirstAncestor_0.Src.Resources.Constants).Attributes.OriginalId;
local function v25(v24)
    return v24:IsA("Script");
end;
local function v64(v26)
    v26:dispatch(v21(v17.Status.ScanningScripts));
    local v27 = v9(v25);
    local v28 = {};
    local v29 = {};
    for _, v31 in v27, nil, nil do
        local l_l_ScriptEditorService_0_EditorSource_0 = l_ScriptEditorService_0:GetEditorSource(v31);
        local _ = function(v33, v34, v35, _, v37)
            if v11.isR6Animation(v35) then
                return v15.new(v35, v7(v37, v33, v34), v31);
            else
                return ;
            end;
        end;
        v5.ForEachLine(l_l_ScriptEditorService_0_EditorSource_0, function(v39, v40)
            v6(v39, v40, function(...)
                local v41, v42, v43, _, v45 = ...;
                local v46 = if v11.isR6Animation(v43) then v15.new(v43, v7(v45, v41, v42), v31) else nil;
                if v46 then
                    v41 = v46:id();
                    if not v28[v41] then
                        v28[v41] = {};
                    end;
                    table.insert(v28[v41], v46);
                    return ;
                else
                    return ;
                end;
            end);
        end);
        local l_v12_ScriptBackupChunks_0 = v12:GetScriptBackupChunks(v31);
        if not (not l_v12_ScriptBackupChunks_0 or not v12:DidSourceChange(v31, l_v12_ScriptBackupChunks_0)) then
            local v48 = 0;
            do
                local l_v48_0 = v48;
                for _, v51 in l_v12_ScriptBackupChunks_0, nil, nil do
                    v5.ForEachLine(v51, function(v52, v53)
                        v6(v52, v53 + l_v48_0, function(...)
                            local v54, v55, v56, _, v58 = ...;
                            local v59 = if v11.isR6Animation(v56) then v15.new(v56, v7(v58, v54, v55), v31) else nil;
                            if v59 then
                                v54 = v59:id();
                                if v28[v54] then
                                    for _, v61 in v28[v54], nil, nil do
                                        if v61 == v59 then
                                            return ;
                                        end;
                                    end;
                                end;
                                if not v29[v54] then
                                    v29[v54] = {};
                                end;
                                table.insert(v29[v54], v59);
                                return ;
                            else
                                return ;
                            end;
                        end);
                    end);
                    local _, v63 = v51:gsub("\n", "\n");
                    l_v48_0 = l_v48_0 + v63;
                end;
            end;
        end;
    end;
    return v28, v29;
end;
local function v73(v65)
    v65:dispatch(v21(v17.Status.ScanningWorkspace));
    local v67 = v9(function(v66)
        return v66:IsA("Animation") or v66:IsA("KeyframeSequence");
    end);
    local v68 = {};
    local v69 = {};
    local v70 = {};
    for _, v72 in v67, nil, nil do
        if not v10.isConvertibleKeyframeSequence(v72) or v11.isR6KeyframeSequence(v72) then
            if not v11.isR6Animation(v72) then
                if v72:GetAttribute(l_OriginalId_0) then
                    if not v72:IsA("Animation") then
                        warn("OriginalId Attribute should only be found on Animation Instances. Were Attributes manually edited?");
                    else
                        table.insert(v70, v72);
                    end;
                end;
            else
                table.insert(v68, v72);
                l_AnimationTagging_0:addTag(v72);
            end;
        else
            table.insert(v69, v72);
        end;
    end;
    return v68, v69, v70;
end;
local function v83(v74)
    local v75 = {};
    local v76 = 1;
    for _, v78 in v74, nil, nil do
        local v79 = v11.getAnimationAssetInfo(v78);
        local l_Name_0 = v78.Name;
        if not (not v79:IsA(l_AssetType_0.RobloxAsset) or v75[v79.id]) then
            local l_status_0, l_result_0 = pcall(function()
                return l_MarketplaceService_0:GetProductInfo(v79.id);
            end);
            if l_status_0 then
                l_Name_0 = l_result_0.Name;
            end;
        end;
        if not (not v79:IsA(l_AssetType_0.RobloxAsset) or v78:GetAttribute(l_OriginalId_0)) then
            v78:SetAttribute(l_OriginalId_0, v79.id);
        end;
        if not v75[v79.id] then
            v75[v79.id] = v16.new(v79, l_Name_0, v76, nil, nil);
            v76 = v76 + 1;
        end;
        v75[v79.id].refs[v78] = v79;
    end;
    return v75;
end;
local function v94(v84, v85, v86)
    local v87 = {};
    for v88, _ in v84, nil, nil do
        v87[v88] = true;
    end;
    for v90, _ in v85, nil, nil do
        v87[v90] = true;
    end;
    for v92, v93 in v86, nil, nil do
        if v93.animationAssetInfo:IsA(l_AssetType_0.RobloxAsset) then
            v87[v92] = true;
        end;
    end;
    return v87;
end;
local function v104(v95, v96, v97, v98)
    v95:dispatch(v21(v17.Status.ConvertingAnimations));
    for _, v100 in v98, nil, nil do
        if not (v100.animationAssetInfo:IsA(l_AssetType_0.RobloxAsset) or not v100.animationAssetInfo:IsA(l_AssetType_0.LocalAsset)) then
            for v101 in v100.refs, nil, nil do
                v11.convertAnimation(v101);
                break;
            end;
        end;
    end;
    for v102, v103 in (v11.checkIfAssetsAlreadyConverted(v96, v97)), nil, nil do
        if v98[v102] then
            v98[v102].converted = v103;
        end;
    end;
end;
local function v113(v105, v106)
    local v107 = v10.getOriginalR6KeyframeSequences(v106);
    local v108 = 1 + #v1.Dictionary.keys(v105);
    for v109, v110 in v107, nil, nil do
        v11.registerConvertedKeyframeSequence(v110, v109);
        local v111 = v11.getAnimationAssetInfo(v110);
        local l_id_0 = v111.id;
        if not v105[l_id_0] then
            v105[l_id_0] = v16.new(v111, v109.Name, v108, l_AnimationStatus_0.Done, nil);
            v108 = v108 + 1;
        end;
        v105[l_id_0].oldRefs[v109] = v111;
    end;
end;
local function v122(v114, v115)
    local v116 = 1 + #v1.Dictionary.keys(v114);
    for _, v118 in v115, nil, nil do
        local v119 = v118:Clone();
        v119.AnimationId = v11.getAnimationId(v118:GetAttribute(l_OriginalId_0));
        local v120 = v11.getAnimationAssetInfo(v119);
        local l_id_1 = v120.id;
        if not v114[l_id_1] then
            v114[l_id_1] = v16.new(v120, v118.Name, v116, l_AnimationStatus_0.Done, v11.getConvertedAssetId(l_id_1));
            l_AnimationTagging_0:removeTag(v118);
            v116 = v116 + 1;
        end;
        v114[l_id_1].oldRefs[v118] = v120;
    end;
end;
local function v131(v123, v124)
    local v125 = 1 + #v1.Dictionary.keys(v123);
    for v126, v127 in v124, nil, nil do
        for _, v129 in v127, nil, nil do
            local v130 = v11.getAnimationAssetInfo(v129.str);
            if not v123[v126] then
                v123[v126] = v16.new(v130, v11.getCachedName(v126) or v129.str, v125, l_AnimationStatus_0.Done, v11.getConvertedAssetId(v126));
                v125 = v125 + 1;
            end;
            v123[v126].oldRefs[v129] = v130;
        end;
    end;
end;
local function v134()
    for v132, v133 in (v10.getAllSavedAnimationAssetIds()), nil, nil do
        v11.registerConvertedAssetId(v132, v133.converted, v133.kfs, v133.name);
        v11.overrideIsR6Cache(v133.converted, false);
    end;
end;
return function(v135, v136, v137)
    return function(v138)
        task.spawn(function()
            v134();
            local v139, v140 = v64(v138);
            local v141, v142, v143 = v73(v138);
            local v144 = v83(v141);
            v113(v144, v142);
            v122(v144, v143);
            v131(v144, v140);
            v10.addConvertibleKeyframeSequences(v141);
            v10.addConvertibleAnimations(v141);
            v10.addConvertibleAssetIds(v1.Dictionary.keys(v139));
            local v145 = v94(v139, v140, v144);
            v135:getHandler("onInitialAnimationsAnalysisScan")(v145, v144);
            v104(v138, v136, v145, v144);
            v138:dispatch(v22(v144));
            v137();
            v138:dispatch(v21(v17.Status.Done));
        end);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Actions.SetProcessResult);
local v2 = require(l_script_FirstAncestor_0.Src.Util.ScriptHistory.undoRevert);
local v3 = require(l_script_FirstAncestor_0.Src.Util.ScriptConversionProgressTracker);
return function(v4, _, v6)
    return function(v7)
        local v8 = v7:getState();
        local l_selection_0 = v8.ScriptConversion.selection;
        local l_revertedScripts_0 = v8.ScriptConversion.revertedScripts;
        local v11 = {};
        for _, v13 in l_selection_0, nil, nil do
            if not ((not v13.scriptId or v13.range) or not l_revertedScripts_0[v13.scriptId]) then
                table.insert(v11, v13.scriptId);
            end;
        end;
        local v14 = v3.new("UndoRevert", #v11, v7);
        v2(v11, v4, function()
            v14:updateProgress();
        end);
        v14:clearProgressBar();
        local v15 = {
            undoRevertResult = #v11
        };
        v7:dispatch(v1(v15));
        v6:getHandler("onScriptSelectionRevertUndo")(v15);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_AnimationConversion_0 = l_script_FirstAncestor_0.Src.Util.AnimationConversion;
local v4 = require(l_AnimationConversion_0.AnimationConversionManager);
local v5 = require(l_AnimationConversion_0.AnimationState);
local l_AssetType_0 = require(l_AnimationConversion_0.constants).AssetType;
local v7 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimations);
local function v18(v8, v9, v10)
    for _, v12 in v9, nil, nil do
        local v13 = v4.getAnimationAssetInfo(v12.str);
        local l_id_0 = v13.id;
        local v15 = v8[l_id_0];
        if not v15 then
            v15 = v5.new(v13, v4.getCachedName(l_id_0) or tostring(l_id_0), v10, nil, v4.getConvertedAssetId(l_id_0));
            v10 = v10 + 1;
            v8[l_id_0] = v15;
        end;
        v15.refs[v12] = v13;
        v15.status = nil;
        for v16, _ in v15.oldRefs, nil, nil do
            if v16 == v12 then
                v15.oldRefs[v16] = nil;
            end;
        end;
    end;
end;
local function v28(v19, v20)
    for _, v22 in v20, nil, nil do
        local v23 = v19[v4.getAnimationAssetInfo(v22.str).id];
        local v24 = {};
        local v25 = 0;
        if v23 then
            for v26, v27 in v23.refs, nil, nil do
                if v27:IsA(l_AssetType_0.AssetIdString) and v26 == v22 then
                    table.insert(v24, v26);
                end;
                v25 = v25 + 1;
            end;
            if #v24 ~= 0 then
                v23:removeRefs(v24);
            end;
        end;
    end;
end;
local function v39(v29, v30)
    local v31 = {};
    for v32, v33 in v29, nil, nil do
        if v30[v32] then
            for _, v35 in v33, nil, nil do
                local v36 = false;
                for _, v38 in v30[v32], nil, nil do
                    if v35 == v38 then
                        v36 = true;
                        break;
                    end;
                end;
                if not v36 then
                    table.insert(v31, v35);
                end;
            end;
        else
            v31 = v2.List.join(v31, v33);
        end;
    end;
    return v31;
end;
return function(v40, v41)
    return function(v42)
        local v43 = v39(v41, v40);
        local v44 = v39(v40, v41);
        if #v43 == 0 and #v44 == 0 then
            return ;
        else
            local v45 = l_deepCopy_0(v42:getState().AnimationConversion.animations);
            local v46 = 0;
            for _, v48 in v45, nil, nil do
                if v46 <= v48.index then
                    v46 = v48.index + 1;
                end;
            end;
            v18(v45, v43, v46);
            v28(v45, v44);
            v42:dispatch(v7(v45));
            return ;
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetDiagnostics);
local v3 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Range);
return function(v4, v5, v6)
    return function(v7)
        local l_diagnostics_0 = v7:getState().ScriptConversion.diagnostics;
        if v5 then
            local v9 = v4:addOrFindScript(v5);
            local v10 = l_diagnostics_0[v9];
            if v10 then
                local l__list_0 = l_deepCopy_0(v10)._list;
                local v12 = nil;
                local v13 = false;
                for _, v15 in v6, nil, nil do
                    v15.range = v3.fromLinter(v15.range);
                    v12 = {};
                    for _, v17 in l__list_0, nil, nil do
                        if not v17.range:Overlaps(v15.range) then
                            if not (v15.range.startLine >= v17.range.startLine) or v15.range.startLine == v17.range.startLine and v15.range.startCharacter < v17.range.startCharacter then
                                local _, v19 = v15.text:gsub("\n", "\n");
                                local v20 = v19 - (v15.range.endLine - v15.range.startLine);
                                local v21 = 0;
                                if v15.range.endLine == v17.range.startLine then
                                    local v22 = v15.text:find("\n[^\n]*$");
                                    v21 = ((#v15.text - (v22 or 0)) + (v22 ~= nil and 1 or v15.range.startCharacter)) - v15.range.endCharacter;
                                    local l_range_0 = v17.range;
                                    l_range_0.startCharacter = l_range_0.startCharacter + v21;
                                    if v17.range.endLine == v17.range.startLine then
                                        l_range_0 = v17.range;
                                        l_range_0.endCharacter = l_range_0.endCharacter + v21;
                                    end;
                                end;
                                local l_range_1 = v17.range;
                                l_range_1.startLine = l_range_1.startLine + v20;
                                l_range_1 = v17.range;
                                l_range_1.endLine = l_range_1.endLine + v20;
                                l_range_1 = v13;
                                if not l_range_1 then
                                    l_range_1 = true;
                                    if v20 == 0 then
                                        l_range_1 = v21 ~= 0;
                                    end;
                                end;
                                v13 = l_range_1;
                            end;
                            table.insert(v12, v17);
                        else
                            v13 = true;
                        end;
                    end;
                    l__list_0 = v12;
                end;
                if v13 then
                    local v25 = l_deepCopy_0(l_diagnostics_0);
                    v25[v9]._list = v12;
                    v7:dispatch(v2(v25));
                end;
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
end;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Actions.SetScriptAnalyticsSent);
return function(v1, v2, v3)
    return function(v4)
        local v5 = v4:getState();
        if not v5.ScriptConversion.analyticsSent then
            v3:getHandler("onInitialScriptAnalysisScan")(v2, #v1, v5.ScriptConversion.completedScripts);
            v4:dispatch(v0(true));
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetDiagnostics);
local l_AssetType_0 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.constants).AssetType;
local _ = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
return function(v5, v6, v7)
    return function(v8)
        local v9 = v8:getState();
        local l_diagnostics_0 = v9.ScriptConversion.diagnostics;
        local l_animations_0 = v9.AnimationConversion.animations;
        local v12 = l_deepCopy_0(l_diagnostics_0);
        local v13 = l_animations_0[v5];
        local v14 = false;
        for v15, v16 in v13.refs, nil, nil do
            if v16:IsA(l_AssetType_0.AssetIdString) then
                local v17 = v7:findScriptGUID(v15.scriptInstance);
                if v12[v17] then
                    for _, v19 in v12[v17]._list, nil, nil do
                        if v19.instanceName == v16.url and v15.range == v19.range then
                            v19.suggestions = {
                                v6
                            };
                            v14 = true;
                        end;
                    end;
                end;
            end;
        end;
        if v14 then
            v8:dispatch(v2(v12));
        end;
    end;
end;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Util.AnimationConversion.serializeInstances);
local l_StudioService_0 = game:GetService("StudioService");
local l_PublishService_0 = game:GetService("PublishService");
local function v14(v3, v4)
    local function _(v5)
        print("rbxassetid://" .. v5);
    end;
    local v7 = {};
    table.insert(v7, v3);
    local l_status_0, l_result_0 = pcall(function()
        return v0(v7);
    end);
    if l_status_0 then
        local l_User_0 = Enum.AssetCreatorType.User;
        local l_l_StudioService_0_UserId_0 = l_StudioService_0:GetUserId();
        local l_status_1, l_result_1 = pcall(function()
            return l_PublishService_0:CreateAssetOrAssetVersionAndPollAssetWithTelemetryAsync(l_result_0, l_User_0, l_l_StudioService_0_UserId_0, "Animation", 0, v4, "", "", "model/x-rbxm", 0);
        end);
        if l_status_1 then
            print("rbxassetid://" .. l_result_1.AssetId);
            return ;
        else
            warn((("Upload failed. %*"):format(l_result_1)));
            return ;
        end;
    else
        return ;
    end;
end;
return function(v15)
    return function(v16)
        local v17, _ = next(v16:getState().AnimationConversion.animations[v15].refs);
        for v19 = 1, 300 do
            v14(v17:Clone(), v17.Name .. v19);
        end;
    end;
end;


local l_AssetType_0 = require(script.Parent.constants).AssetType;
local v1 = {};
v1.__index = v1;
v1.new = function(v2, v3, v4, v5)
    return (setmetatable({
        id = v2,
        url = v3,
        _type = v4,
        instance = v5
    }, v1));
end;
v1.IsA = function(v6, v7)
    if v7 == l_AssetType_0.RobloxAsset then
        local v8 = true;
        if v6._type ~= l_AssetType_0.RobloxAsset then
            v8 = true;
            if v6._type ~= l_AssetType_0.AnimationInstance then
                v8 = v6._type == l_AssetType_0.AssetIdString;
            end;
        end;
        return v8;
    else
        return v6._type == v7;
    end;
end;
return v1;


local l_AnimationStatus_0 = require(script:FindFirstAncestor("R15Migrator").Src.Util.AnimationConversion.constants).AnimationStatus;
local v1 = {};
v1.__index = v1;
v1.new = function(v2, v3, v4, v5, v6)
    assert((v2.id and v2.url) and v2._type, "invalid animation asset info");
    assert(type(v3) == "string", "invalid animation name");
    assert(type(v4) == "number", "invalid animation index");
    return (setmetatable({
        animationAssetInfo = v2,
        refs = {},
        oldRefs = {},
        name = v3,
        index = v4,
        status = v5,
        converted = v6
    }, v1));
end;
v1.complete = function(v7)
    v7.oldRefs = v7.refs;
    v7.refs = {};
    v7.status = l_AnimationStatus_0.Done;
end;
v1.removeRefs = function(v8, v9)
    for _, v11 in v9, nil, nil do
        assert(v8.refs[v11], "ref not found");
        v8.oldRefs[v11] = v8.refs[v11];
        v8.refs[v11] = nil;
    end;
    if not next(v8.refs) then
        v8.status = l_AnimationStatus_0.Done;
    end;
end;
v1.addRefs = function(v12, v13)
    for _, v15 in v13, nil, nil do
        assert(v12.oldRefs[v15], "ref not found");
        v12.refs[v15] = v12.oldRefs[v15];
        v12.oldRefs[v15] = nil;
    end;
    if not next(v12.oldRefs) then
        v12.status = nil;
    end;
end;
return v1;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local _ = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v2 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.normalizeAssetId);
local v3 = {};
v3.__index = v3;
v3.__eq = function(v4, v5)
    local v6 = false;
    if v4.scriptInstance == v5.scriptInstance then
        v6 = false;
        if v2(v4.str) == v2(v5.str) then
            v6 = v4.range == v5.range;
        end;
    end;
    return v6;
end;
v3.id = function(v7)
    return v2(v7.str);
end;
v3.new = function(v8, v9, v10)
    return (setmetatable({
        str = v8,
        name = v8,
        range = v9,
        scriptInstance = v10
    }, v3));
end;
return v3;


local v0 = {};
local v1 = {
    NotStarted = "NotStarted",
    ScanningScripts = "ScanningScripts",
    ScanningWorkspace = "ScanningWorkspace",
    ConvertingAnimations = "ConvertingAnimations",
    Done = "Done"
};
local v2 = {
    RobloxAsset = 1,
    LocalAsset = 2,
    AnimationInstance = 3,
    AssetIdString = 4
};
local v3 = {
    Uploading = 1,
    FailedSerialization = "FailedSerialization",
    FailedToGetProductInfo = "FailedToGetProductInfo",
    FailedWithError = "FailedWithError",
    Done = "Done"
};
v0.Status = v1;
v0.AssetType = v2;
v0.AnimationStatus = v3;
return v0;


return function(v0)
    assert((tonumber(v0)));
    return "https://www.roblox.com/asset/?id=" .. v0;
end;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Util.parseAssetURL);
return function(v1)
    local _, _, _, v5 = v0(v1);
    return v5;
end;


local l_RobloxPluginGuiService_0 = game:GetService("RobloxPluginGuiService");
local l_StudioAssetService_0 = game:GetService("StudioAssetService");
return function(v2)
    local l_Folder_0 = Instance.new("Folder");
    l_Folder_0.Name = "TemporaryInstances";
    l_Folder_0.Parent = l_RobloxPluginGuiService_0;
    for _, v5 in pairs(v2) do
        v5.Parent = l_Folder_0;
    end;
    local l_status_0, l_result_0 = pcall(function()
        return l_StudioAssetService_0:DEPRECATED_SerializeInstances(v2);
    end);
    for _, v9 in pairs(v2) do
        v9.Parent = nil;
    end;
    l_Folder_0:Destroy();
    if not l_status_0 then
        error("SerializeInstances failed: " .. tostring(l_result_0));
        return ;
    else
        return l_result_0;
    end;
end;


return {
    getUnknownAssetId = function()
        return 0;
    end,
    isValidAssetId = function(v0)
        if v0 then
            return v0 ~= 0;
        else
            return false;
        end;
    end
};


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


return {
    R6Error = game:DefineFastString("R6ScriptErrorUrl", "https://create.roblox.com/docs/art/avatar"),
    R6Warning = game:DefineFastString("R6ScriptWarningUrl", "https://create.roblox.com/docs/art/avatar"),
    LearnMore = game:DefineFastString("R6ToR15LearnMoreUrl", "https://create.roblox.com/docs/art/avatar")
};


return {
    isShift = function(_, v1)
        local v2 = true;
        if v1 ~= Enum.KeyCode.LeftShift then
            v2 = v1 == Enum.KeyCode.RightShift;
        end;
        return v2;
    end,
    isControl = function(_, v4)
        local v5 = true;
        if v4 ~= Enum.KeyCode.LeftControl then
            v5 = true;
            if v4 ~= Enum.KeyCode.RightControl then
                v5 = true;
                if v4 ~= Enum.KeyCode.RightSuper then
                    v5 = v4 == Enum.KeyCode.LeftSuper;
                end;
            end;
        end;
        return v5;
    end,
    isLetterA = function(_, v7)
        return v7 == Enum.KeyCode.A;
    end
};


return {
    NotStarted = "NotStarted",
    InProgress = "InProgress",
    Completed = "Completed"
};


local l_CollectionService_0 = game:GetService("CollectionService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v2 = require(l_script_FirstAncestor_0.Src.Util.DebugFlags);
local v3 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local l_PublishTags_0 = v3.PublishTags;
local v5 = v3.AttributePrefix .. "Blocked";
local v6 = {
    _name = nil,
    mask = 0
};
v6.__index = v6;
v6.new = function(v7)
    return (setmetatable({
        _name = not not v7 and v7.Name or nil,
        _mask = not not v7 and v7.Mask or 0
    }, v6));
end;
v6.addTag = function(v8, v9)
    l_CollectionService_0:AddTag(v9, v8._name);
    v8:setPublishBlocked();
end;
v6.removeTag = function(v10, v11)
    l_CollectionService_0:RemoveTag(v11, v10._name);
    v10:checkPublishTags();
end;
v6.isBlocking = function(v12)
    if v2.RunTests() then
        return nil;
    else
        return (bit32.btest(game:GetService("StudioPublishService"):GetAttribute(v5) or 0, v12._mask));
    end;
end;
v6.removeAllTags = function(v13)
    for _, v15 in pairs(v13:getTagged()) do
        l_CollectionService_0:RemoveTag(v15, v13._name);
    end;
    v13:checkPublishTags();
end;
v6.getTagged = function(v16)
    return (l_CollectionService_0:GetTagged(v16._name));
end;
v6.hasTagged = function(v17, v18)
    return l_CollectionService_0:HasTag(v18, v17._name);
end;
for v19, v20 in l_PublishTags_0, nil, nil do
    v6[v19] = v6.new(v20);
end;
v6.clearPublishTags = function(_, v22)
    for v23 in l_PublishTags_0, nil, nil do
        local v24 = v6[v23];
        v24:removeTag(v22);
        for _, v26 in v22:GetDescendants() do
            v24:removeTag(v26);
        end;
    end;
end;
v6.checkPublishTags = function(v27)
    if not v2.RunTests() then
        local l_StudioPublishService_0 = game:GetService("StudioPublishService");
        l_StudioPublishService_0.PublishLocked = true;
        local v29 = nil;
        if not v27._name or not v27._mask then
            v29 = 0;
            for _, v31 in l_PublishTags_0, nil, nil do
                if #l_CollectionService_0:GetTagged(v31.Name) > 0 then
                    v29 = bit32.bor(v29, v31.Mask);
                end;
            end;
        else
            v29 = l_StudioPublishService_0:GetAttribute(v5) or 0;
            if not (#l_CollectionService_0:GetTagged(v27._name) > 0) then
                v29 = bit32.band(v29, (bit32.bnot(v27._mask)));
            end;
        end;
        l_StudioPublishService_0:SetAttribute(v5, v29);
    end;
end;
v6.setPublishBlocked = function(v32)
    if not v2.RunTests() then
        local l_StudioPublishService_1 = game:GetService("StudioPublishService");
        l_StudioPublishService_1.PublishLocked = true;
        l_StudioPublishService_1:SetAttribute(v5, (bit32.bor(l_StudioPublishService_1:GetAttribute(v5) or 0, v32._mask)));
    end;
end;
v6.publishingIsBlocked = function(_)
    if v2.RunTests() then
        return nil;
    else
        return game:GetService("StudioPublishService"):GetAttribute(v5);
    end;
end;
v6.prepareToPublish = function(_)
    if not v2.RunTests() then
        game:GetService("StudioPublishService").PublishLocked = false;
    end;
end;
return v6;


local l_CollectionService_0 = game:GetService("CollectionService");
local l_NonePublishTags_0 = require(script:FindFirstAncestor("R15Migrator").Src.Resources.Constants).NonePublishTags;
local v2 = {
    _tag = nil
};
v2.__index = v2;
v2.new = function(v3)
    return (setmetatable({
        _tag = v3
    }, v2));
end;
v2.addTag = function(v4, v5)
    l_CollectionService_0:AddTag(v5, v4._tag);
end;
v2.removeTag = function(v6, v7)
    l_CollectionService_0:RemoveTag(v7, v6._tag);
end;
v2.getTagged = function(v8)
    return l_CollectionService_0:GetTagged(v8._tag);
end;
local v9 = {};
v9.clearTags = function(v10)
    for _, v12 in {
        v9.CharactersConvertedToR15Tagging
    }, nil, nil do
        v12:removeTag(v10);
        for _, v14 in v10:GetDescendants() do
            v12:removeTag(v14);
        end;
    end;
end;
v9.CharactersConvertedToR15Tagging = v2.new(l_NonePublishTags_0.CharactersConvertedToR15Tag);
return v9;


local v0 = {};
local l_ServerStorage_0 = game:GetService("ServerStorage");
local l_HttpService_0 = game:GetService("HttpService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local l_Attributes_0 = v5.Attributes;
local v7 = require(l_script_FirstAncestor_0.Src.Util.PublishTagging);
local v8 = require(l_script_FirstAncestor_0.Src.Util.QuickAccessTagging);
local v9 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.AnimationConversionManager);
local v10 = v5.AttributePrefix .. "R15MigratorConversionId";
local v11 = v5.AttributePrefix .. "ScriptConversionRules";
local v12 = nil;
local v13 = nil;
local function _(v14)
    local l_l_ServerStorage_0_FirstChild_0 = l_ServerStorage_0:FindFirstChild(v14);
    if not l_l_ServerStorage_0_FirstChild_0 or not l_l_ServerStorage_0_FirstChild_0:IsA("Folder") then
        return nil;
    else
        return l_l_ServerStorage_0_FirstChild_0;
    end;
end;
local function _(v17, v18)
    local l_v18_FirstChild_0 = v18:FindFirstChild(v17);
    if not l_v18_FirstChild_0 or not l_v18_FirstChild_0:IsA("Folder") then
        local l_Folder_0 = Instance.new("Folder");
        l_Folder_0.Name = v17;
        l_Folder_0.Parent = v18;
        return l_Folder_0;
    else
        return l_v18_FirstChild_0;
    end;
end;
local function _(v22)
    if not v12 then
        local l_l_ServerStorage_0_0 = l_ServerStorage_0;
        local l_R15MigratorProgress_0 = l_l_ServerStorage_0_0:FindFirstChild("R15MigratorProgress");
        local v25;
        if not l_R15MigratorProgress_0 or not l_R15MigratorProgress_0:IsA("Folder") then
            local l_Folder_1 = Instance.new("Folder");
            l_Folder_1.Name = "R15MigratorProgress";
            l_Folder_1.Parent = l_l_ServerStorage_0_0;
            v25 = l_Folder_1;
        else
            v25 = l_R15MigratorProgress_0;
        end;
        v12 = v25;
    end;
    if not v22 then
        return v12;
    else
        local l_v12_0 = v12;
        local l_l_v12_0_FirstChild_0 = l_v12_0:FindFirstChild(v22);
        if not l_l_v12_0_FirstChild_0 or not l_l_v12_0_FirstChild_0:IsA("Folder") then
            local l_Folder_2 = Instance.new("Folder");
            l_Folder_2.Name = v22;
            l_Folder_2.Parent = l_v12_0;
            return l_Folder_2;
        else
            return l_l_v12_0_FirstChild_0;
        end;
    end;
end;
local function _(v31)
    if not v13 then
        local l_l_ServerStorage_0_1 = l_ServerStorage_0;
        local l_R15MigratorPostPublish_0 = l_l_ServerStorage_0_1:FindFirstChild("R15MigratorPostPublish");
        local v34;
        if not l_R15MigratorPostPublish_0 or not l_R15MigratorPostPublish_0:IsA("Folder") then
            local l_Folder_3 = Instance.new("Folder");
            l_Folder_3.Name = "R15MigratorPostPublish";
            l_Folder_3.Parent = l_l_ServerStorage_0_1;
            v34 = l_Folder_3;
        else
            v34 = l_R15MigratorPostPublish_0;
        end;
        v13 = v34;
    end;
    if not v31 then
        return v13;
    else
        local l_v13_0 = v13;
        local l_l_v13_0_FirstChild_0 = l_v13_0:FindFirstChild(v31);
        if not l_l_v13_0_FirstChild_0 or not l_l_v13_0_FirstChild_0:IsA("Folder") then
            local l_Folder_4 = Instance.new("Folder");
            l_Folder_4.Name = v31;
            l_Folder_4.Parent = l_v13_0;
            return l_Folder_4;
        else
            return l_l_v13_0_FirstChild_0;
        end;
    end;
end;
local function _(v40)
    if not v12 then
        local l_R15MigratorProgress_1 = l_ServerStorage_0:FindFirstChild("R15MigratorProgress");
        v12 = if not not l_R15MigratorProgress_1 and l_R15MigratorProgress_1:IsA("Folder") then l_R15MigratorProgress_1 else nil;
    end;
    if not v12 or not v40 then
        return v12;
    else
        return (v12:FindFirstChild(v40));
    end;
end;
local function _(v43)
    if not v13 then
        local l_R15MigratorPostPublish_1 = l_ServerStorage_0:FindFirstChild("R15MigratorPostPublish");
        v13 = if not not l_R15MigratorPostPublish_1 and l_R15MigratorPostPublish_1:IsA("Folder") then l_R15MigratorPostPublish_1 else nil;
    end;
    if not v13 or not v43 then
        return v13;
    else
        return (v13:FindFirstChild(v43));
    end;
end;
local function _(v46)
    v7:clearPublishTags(v46);
    v8.clearTags(v46);
end;
v0.isRootSaveFolderChildOf = function(v48)
    if not v12 then
        local l_l_ServerStorage_0_2 = l_ServerStorage_0;
        local l_R15MigratorProgress_2 = l_l_ServerStorage_0_2:FindFirstChild("R15MigratorProgress");
        local v51;
        if not l_R15MigratorProgress_2 or not l_R15MigratorProgress_2:IsA("Folder") then
            local l_Folder_5 = Instance.new("Folder");
            l_Folder_5.Name = "R15MigratorProgress";
            l_Folder_5.Parent = l_l_ServerStorage_0_2;
            v51 = l_Folder_5;
        else
            v51 = l_R15MigratorProgress_2;
        end;
        v12 = v51;
    end;
    return v12.Parent == v48;
end;
v0.isRootSaveFolderDescendantOf = function(v53)
    if not v12 then
        local l_l_ServerStorage_0_3 = l_ServerStorage_0;
        local l_R15MigratorProgress_3 = l_l_ServerStorage_0_3:FindFirstChild("R15MigratorProgress");
        local v56;
        if not l_R15MigratorProgress_3 or not l_R15MigratorProgress_3:IsA("Folder") then
            local l_Folder_6 = Instance.new("Folder");
            l_Folder_6.Name = "R15MigratorProgress";
            l_Folder_6.Parent = l_l_ServerStorage_0_3;
            v56 = l_Folder_6;
        else
            v56 = l_R15MigratorProgress_3;
        end;
        v12 = v56;
    end;
    return v12:IsDescendantOf(v53);
end;
v0.isRootSaveFolder = function(v58)
    if not v12 then
        local l_l_ServerStorage_0_4 = l_ServerStorage_0;
        local l_R15MigratorProgress_4 = l_l_ServerStorage_0_4:FindFirstChild("R15MigratorProgress");
        local v61;
        if not l_R15MigratorProgress_4 or not l_R15MigratorProgress_4:IsA("Folder") then
            local l_Folder_7 = Instance.new("Folder");
            l_Folder_7.Name = "R15MigratorProgress";
            l_Folder_7.Parent = l_l_ServerStorage_0_4;
            v61 = l_Folder_7;
        else
            v61 = l_R15MigratorProgress_4;
        end;
        v12 = v61;
    end;
    return v12 == v58;
end;
v0.isDescendantOfSaveFolder = function(v63)
    if not v12 then
        local l_l_ServerStorage_0_5 = l_ServerStorage_0;
        local l_R15MigratorProgress_5 = l_l_ServerStorage_0_5:FindFirstChild("R15MigratorProgress");
        local v66;
        if not l_R15MigratorProgress_5 or not l_R15MigratorProgress_5:IsA("Folder") then
            local l_Folder_8 = Instance.new("Folder");
            l_Folder_8.Name = "R15MigratorProgress";
            l_Folder_8.Parent = l_l_ServerStorage_0_5;
            v66 = l_Folder_8;
        else
            v66 = l_R15MigratorProgress_5;
        end;
        v12 = v66;
    end;
    return v63:IsDescendantOf(v12);
end;
v0.doesSaveFolderExistInDM = function()
    return l_ServerStorage_0:FindFirstChild("R15MigratorProgress") ~= nil;
end;
v0.removeAllSavedData = function()
    local l_R15MigratorProgress_6 = l_ServerStorage_0:FindFirstChild("R15MigratorProgress");
    if l_R15MigratorProgress_6 ~= nil then
        l_R15MigratorProgress_6:Destroy();
    end;
end;
v0.conversionIdFilter = function()
    return function(v69)
        return v69:GetAttribute(v10) ~= nil;
    end;
end;
v0.removeConversionId = function(v70)
    v70:SetAttribute(v10, nil);
end;
v0.SetAdapted = function(v71)
    if not v12 then
        local l_l_ServerStorage_0_6 = l_ServerStorage_0;
        local l_R15MigratorProgress_7 = l_l_ServerStorage_0_6:FindFirstChild("R15MigratorProgress");
        local v74;
        if not l_R15MigratorProgress_7 or not l_R15MigratorProgress_7:IsA("Folder") then
            local l_Folder_9 = Instance.new("Folder");
            l_Folder_9.Name = "R15MigratorProgress";
            l_Folder_9.Parent = l_l_ServerStorage_0_6;
            v74 = l_Folder_9;
        else
            v74 = l_R15MigratorProgress_7;
        end;
        v12 = v74;
    end;
    v12:SetAttribute(l_Attributes_0.Adapted, v71);
end;
v0.GetAdapted = function()
    if not v12 then
        local l_l_ServerStorage_0_7 = l_ServerStorage_0;
        local l_R15MigratorProgress_8 = l_l_ServerStorage_0_7:FindFirstChild("R15MigratorProgress");
        local v78;
        if not l_R15MigratorProgress_8 or not l_R15MigratorProgress_8:IsA("Folder") then
            local l_Folder_10 = Instance.new("Folder");
            l_Folder_10.Name = "R15MigratorProgress";
            l_Folder_10.Parent = l_l_ServerStorage_0_7;
            v78 = l_Folder_10;
        else
            v78 = l_R15MigratorProgress_8;
        end;
        v12 = v78;
    end;
    local l_v12_1 = v12;
    local l_l_v12_1_Attribute_0 = l_v12_1:GetAttribute(l_Attributes_0.Adapted);
    if l_l_v12_1_Attribute_0 == nil then
        l_v12_1:SetAttribute(l_Attributes_0.Adapted, true);
        return true;
    else
        return l_l_v12_1_Attribute_0 == true;
    end;
end;
v0.getConversionId = function(v82)
    return v82:GetAttribute(v10);
end;
v0.hasConvertedFrom = function(v83)
    return v0.getConversionId(v83) ~= nil;
end;
v0.addConvertibleCharacters = function(v84)
    if not v12 then
        local l_l_ServerStorage_0_8 = l_ServerStorage_0;
        local l_R15MigratorProgress_9 = l_l_ServerStorage_0_8:FindFirstChild("R15MigratorProgress");
        local v87;
        if not l_R15MigratorProgress_9 or not l_R15MigratorProgress_9:IsA("Folder") then
            local l_Folder_11 = Instance.new("Folder");
            l_Folder_11.Name = "R15MigratorProgress";
            l_Folder_11.Parent = l_l_ServerStorage_0_8;
            v87 = l_Folder_11;
        else
            v87 = l_R15MigratorProgress_9;
        end;
        v12 = v87;
    end;
    local l_v12_2 = v12;
    local l_R6Characters_0 = l_v12_2:FindFirstChild("R6Characters");
    local v91;
    if not l_R6Characters_0 or not l_R6Characters_0:IsA("Folder") then
        local l_Folder_12 = Instance.new("Folder");
        l_Folder_12.Name = "R6Characters";
        l_Folder_12.Parent = l_v12_2;
        v91 = l_Folder_12;
    else
        v91 = l_R6Characters_0;
    end;
    for _, v94 in v84, nil, nil do
        if not v94:GetAttribute(v10) then
            local v95 = l_HttpService_0:GenerateGUID();
            v94:SetAttribute(v10, v95);
            local v96 = v94:Clone();
            v96.Name = v95;
            v96.Parent = v91;
            v7:clearPublishTags(v96);
            v8.clearTags(v96);
        end;
    end;
end;
v0.getR6Characters = function()
    if not v12 then
        local l_l_ServerStorage_0_9 = l_ServerStorage_0;
        local l_R15MigratorProgress_10 = l_l_ServerStorage_0_9:FindFirstChild("R15MigratorProgress");
        local v99;
        if not l_R15MigratorProgress_10 or not l_R15MigratorProgress_10:IsA("Folder") then
            local l_Folder_13 = Instance.new("Folder");
            l_Folder_13.Name = "R15MigratorProgress";
            l_Folder_13.Parent = l_l_ServerStorage_0_9;
            v99 = l_Folder_13;
        else
            v99 = l_R15MigratorProgress_10;
        end;
        v12 = v99;
    end;
    local l_v12_3 = v12;
    local l_R6Characters_1 = l_v12_3:FindFirstChild("R6Characters");
    local v103;
    if not l_R6Characters_1 or not l_R6Characters_1:IsA("Folder") then
        local l_Folder_14 = Instance.new("Folder");
        l_Folder_14.Name = "R6Characters";
        l_Folder_14.Parent = l_v12_3;
        v103 = l_Folder_14;
    else
        v103 = l_R6Characters_1;
    end;
    l_v12_3 = {};
    for _, v106 in v103:GetChildren() do
        l_v12_3[v106.Name] = v106;
    end;
    return l_v12_3;
end;
v0.addScriptConversionRules = function(v107)
    if not v12 then
        local l_l_ServerStorage_0_10 = l_ServerStorage_0;
        local l_R15MigratorProgress_11 = l_l_ServerStorage_0_10:FindFirstChild("R15MigratorProgress");
        local v110;
        if not l_R15MigratorProgress_11 or not l_R15MigratorProgress_11:IsA("Folder") then
            local l_Folder_15 = Instance.new("Folder");
            l_Folder_15.Name = "R15MigratorProgress";
            l_Folder_15.Parent = l_l_ServerStorage_0_10;
            v110 = l_Folder_15;
        else
            v110 = l_R15MigratorProgress_11;
        end;
        v12 = v110;
    end;
    v12:SetAttribute(v11, l_HttpService_0:JSONEncode(v107));
end;
v0.getScriptConversionRules = function()
    if not v12 then
        local l_R15MigratorProgress_12 = l_ServerStorage_0:FindFirstChild("R15MigratorProgress");
        v12 = if not not l_R15MigratorProgress_12 and l_R15MigratorProgress_12:IsA("Folder") then l_R15MigratorProgress_12 else nil;
    end;
    if v12 then
        if not v12 then
            local l_R15MigratorProgress_13 = l_ServerStorage_0:FindFirstChild("R15MigratorProgress");
            v12 = if not not l_R15MigratorProgress_13 and l_R15MigratorProgress_13:IsA("Folder") then l_R15MigratorProgress_13 else nil;
        end;
        local l_v12_Attribute_0 = v12:GetAttribute(v11);
        if not l_v12_Attribute_0 then
            return nil;
        else
            return (l_HttpService_0:JSONDecode(l_v12_Attribute_0));
        end;
    else
        return nil;
    end;
end;
v0.isConvertibleKeyframeSequence = function(v115)
    return v115:IsA("KeyframeSequence") and v115:GetAttribute(v10) ~= nil;
end;
v0.addConvertibleKeyframeSequences = function(v116)
    if not v12 then
        local l_l_ServerStorage_0_11 = l_ServerStorage_0;
        local l_R15MigratorProgress_14 = l_l_ServerStorage_0_11:FindFirstChild("R15MigratorProgress");
        local v119;
        if not l_R15MigratorProgress_14 or not l_R15MigratorProgress_14:IsA("Folder") then
            local l_Folder_16 = Instance.new("Folder");
            l_Folder_16.Name = "R15MigratorProgress";
            l_Folder_16.Parent = l_l_ServerStorage_0_11;
            v119 = l_Folder_16;
        else
            v119 = l_R15MigratorProgress_14;
        end;
        v12 = v119;
    end;
    local l_v12_4 = v12;
    local l_R6KeyframeSequences_0 = l_v12_4:FindFirstChild("R6KeyframeSequences");
    local v123;
    if not l_R6KeyframeSequences_0 or not l_R6KeyframeSequences_0:IsA("Folder") then
        local l_Folder_17 = Instance.new("Folder");
        l_Folder_17.Name = "R6KeyframeSequences";
        l_Folder_17.Parent = l_v12_4;
        v123 = l_Folder_17;
    else
        v123 = l_R6KeyframeSequences_0;
    end;
    for _, v126 in v116, nil, nil do
        if not (not v126:IsA("KeyframeSequence") or v126:GetAttribute(v10)) then
            local v127 = l_HttpService_0:GenerateGUID();
            v126:SetAttribute(v10, v127);
            local v128 = v126:Clone();
            v128.Name = v127;
            v128:SetAttribute(l_Attributes_0.OriginalId, nil);
            v128.Parent = v123;
            v7:clearPublishTags(v128);
            v8.clearTags(v128);
        end;
    end;
end;
v0.getR6KeyframeSequence = function(v129, v130)
    local l_v129_Attribute_0 = v129:GetAttribute(v10);
    if l_v129_Attribute_0 then
        local v132 = nil;
        if not v130 then
            if not v12 then
                local l_l_ServerStorage_0_12 = l_ServerStorage_0;
                local l_R15MigratorProgress_15 = l_l_ServerStorage_0_12:FindFirstChild("R15MigratorProgress");
                local v135;
                if not l_R15MigratorProgress_15 or not l_R15MigratorProgress_15:IsA("Folder") then
                    local l_Folder_18 = Instance.new("Folder");
                    l_Folder_18.Name = "R15MigratorProgress";
                    l_Folder_18.Parent = l_l_ServerStorage_0_12;
                    v135 = l_Folder_18;
                else
                    v135 = l_R15MigratorProgress_15;
                end;
                v12 = v135;
            end;
            local l_v12_5 = v12;
            local l_R6KeyframeSequences_1 = l_v12_5:FindFirstChild("R6KeyframeSequences");
            local v139;
            if not l_R6KeyframeSequences_1 or not l_R6KeyframeSequences_1:IsA("Folder") then
                local l_Folder_19 = Instance.new("Folder");
                l_Folder_19.Name = "R6KeyframeSequences";
                l_Folder_19.Parent = l_v12_5;
                v139 = l_Folder_19;
            else
                v139 = l_R6KeyframeSequences_1;
            end;
            v132 = v139:FindFirstChild(l_v129_Attribute_0);
        else
            v132 = v130[l_v129_Attribute_0];
        end;
        if v132 then
            return v132;
        else
            local l_warn_0 = warn;
            local v142 = "Original R6 KeyframeSequence is unavailable. Was the %* folder edited?";
            if not v12 then
                local l_l_ServerStorage_0_13 = l_ServerStorage_0;
                local l_R15MigratorProgress_16 = l_l_ServerStorage_0_13:FindFirstChild("R15MigratorProgress");
                local v145;
                if not l_R15MigratorProgress_16 or not l_R15MigratorProgress_16:IsA("Folder") then
                    local l_Folder_20 = Instance.new("Folder");
                    l_Folder_20.Name = "R15MigratorProgress";
                    l_Folder_20.Parent = l_l_ServerStorage_0_13;
                    v145 = l_Folder_20;
                else
                    v145 = l_R15MigratorProgress_16;
                end;
                v12 = v145;
            end;
            l_warn_0((v142:format(v12)));
            return ;
        end;
    else
        local l_warn_1 = warn;
        local v148 = "Could not find matching R6 KeyframeSequence. Was the %* folder edited?";
        if not v12 then
            local l_l_ServerStorage_0_14 = l_ServerStorage_0;
            local l_R15MigratorProgress_17 = l_l_ServerStorage_0_14:FindFirstChild("R15MigratorProgress");
            local v151;
            if not l_R15MigratorProgress_17 or not l_R15MigratorProgress_17:IsA("Folder") then
                local l_Folder_21 = Instance.new("Folder");
                l_Folder_21.Name = "R15MigratorProgress";
                l_Folder_21.Parent = l_l_ServerStorage_0_14;
                v151 = l_Folder_21;
            else
                v151 = l_R15MigratorProgress_17;
            end;
            v12 = v151;
        end;
        l_warn_1((v148:format(v12)));
        return ;
    end;
end;
v0.getOriginalR6KeyframeSequences = function(v153)
    if not v12 then
        local l_l_ServerStorage_0_15 = l_ServerStorage_0;
        local l_R15MigratorProgress_18 = l_l_ServerStorage_0_15:FindFirstChild("R15MigratorProgress");
        local v156;
        if not l_R15MigratorProgress_18 or not l_R15MigratorProgress_18:IsA("Folder") then
            local l_Folder_22 = Instance.new("Folder");
            l_Folder_22.Name = "R15MigratorProgress";
            l_Folder_22.Parent = l_l_ServerStorage_0_15;
            v156 = l_Folder_22;
        else
            v156 = l_R15MigratorProgress_18;
        end;
        v12 = v156;
    end;
    local l_v12_6 = v12;
    local l_R6KeyframeSequences_2 = l_v12_6:FindFirstChild("R6KeyframeSequences");
    local v160;
    if not l_R6KeyframeSequences_2 or not l_R6KeyframeSequences_2:IsA("Folder") then
        local l_Folder_23 = Instance.new("Folder");
        l_Folder_23.Name = "R6KeyframeSequences";
        l_Folder_23.Parent = l_v12_6;
        v160 = l_Folder_23;
    else
        v160 = l_R6KeyframeSequences_2;
    end;
    l_v12_6 = {};
    for _, v163 in v160:GetChildren() do
        l_v12_6[v163.Name] = v163;
    end;
    l_R6KeyframeSequences_2 = {};
    for _, v165 in v153, nil, nil do
        l_R6KeyframeSequences_2[v165] = v0.getR6KeyframeSequence(v165, l_v12_6);
    end;
    return l_R6KeyframeSequences_2;
end;
v0.addConvertibleAssetIds = function(v166)
    if not v12 then
        local l_l_ServerStorage_0_16 = l_ServerStorage_0;
        local l_R15MigratorProgress_19 = l_l_ServerStorage_0_16:FindFirstChild("R15MigratorProgress");
        local v169;
        if not l_R15MigratorProgress_19 or not l_R15MigratorProgress_19:IsA("Folder") then
            local l_Folder_24 = Instance.new("Folder");
            l_Folder_24.Name = "R15MigratorProgress";
            l_Folder_24.Parent = l_l_ServerStorage_0_16;
            v169 = l_Folder_24;
        else
            v169 = l_R15MigratorProgress_19;
        end;
        v12 = v169;
    end;
    local l_v12_7 = v12;
    local l_R15KeyframeSequences_0 = l_v12_7:FindFirstChild("R15KeyframeSequences");
    local v173;
    if not l_R15KeyframeSequences_0 or not l_R15KeyframeSequences_0:IsA("Folder") then
        local l_Folder_25 = Instance.new("Folder");
        l_Folder_25.Name = "R15KeyframeSequences";
        l_Folder_25.Parent = l_v12_7;
        v173 = l_Folder_25;
    else
        v173 = l_R15KeyframeSequences_0;
    end;
    l_v12_7 = {};
    for _, v176 in v173:GetChildren() do
        l_v12_7[tonumber(v176.Name)] = true;
    end;
    for _, v178 in v166, nil, nil do
        if not l_v12_7[v178] then
            local v179 = v9.getConvertedKeyframeSequence(v178);
            if v179 then
                l_v12_7[v178] = true;
                local v180 = v179.Parent:Clone();
                v180.Name = v178;
                v180:SetAttribute(l_Attributes_0.TempId, nil);
                v180.Parent = v173;
                v7:clearPublishTags(v180);
                v8.clearTags(v180);
            end;
        end;
    end;
end;
v0.setTargetAssetId = function(v181, v182)
    if v181 and v182 then
        local v183 = tostring(v181);
        local v184 = tostring(v182);
        if not v12 then
            local l_l_ServerStorage_0_17 = l_ServerStorage_0;
            local l_R15MigratorProgress_20 = l_l_ServerStorage_0_17:FindFirstChild("R15MigratorProgress");
            local v187;
            if not l_R15MigratorProgress_20 or not l_R15MigratorProgress_20:IsA("Folder") then
                local l_Folder_26 = Instance.new("Folder");
                l_Folder_26.Name = "R15MigratorProgress";
                l_Folder_26.Parent = l_l_ServerStorage_0_17;
                v187 = l_Folder_26;
            else
                v187 = l_R15MigratorProgress_20;
            end;
            v12 = v187;
        end;
        local l_v12_8 = v12;
        local l_R15KeyframeSequences_1 = l_v12_8:FindFirstChild("R15KeyframeSequences");
        local v191;
        if not l_R15KeyframeSequences_1 or not l_R15KeyframeSequences_1:IsA("Folder") then
            local l_Folder_27 = Instance.new("Folder");
            l_Folder_27.Name = "R15KeyframeSequences";
            l_Folder_27.Parent = l_v12_8;
            v191 = l_Folder_27;
        else
            v191 = l_R15KeyframeSequences_1;
        end;
        l_v12_8 = v191:FindFirstChild(v183);
        if l_v12_8 and l_v12_8:IsA("StringValue") then
            if #l_v12_8.Value > 0 then
                l_R15KeyframeSequences_1 = warn;
                local v193 = "%*.Value in folder %* should be empty. Was the %* folder edited?";
                local l_v183_0 = v183;
                local v195 = "R15KeyframeSequences";
                if not v12 then
                    local l_l_ServerStorage_0_18 = l_ServerStorage_0;
                    local l_R15MigratorProgress_21 = l_l_ServerStorage_0_18:FindFirstChild("R15MigratorProgress");
                    local v198;
                    if not l_R15MigratorProgress_21 or not l_R15MigratorProgress_21:IsA("Folder") then
                        local l_Folder_28 = Instance.new("Folder");
                        l_Folder_28.Name = "R15MigratorProgress";
                        l_Folder_28.Parent = l_l_ServerStorage_0_18;
                        v198 = l_Folder_28;
                    else
                        v198 = l_R15MigratorProgress_21;
                    end;
                    v12 = v198;
                end;
                l_R15KeyframeSequences_1((v193:format(l_v183_0, v195, v12)));
            end;
            l_v12_8.Value = v184;
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v0.addConvertibleAnimations = function(v200)
    local v201 = {};
    for _, v203 in v200, nil, nil do
        if v203:IsA("Animation") then
            local v204 = v9.getNormalizedAssetId(v203);
            assert(v204 and typeof(v204) == "number");
            table.insert(v201, v204);
        end;
    end;
    v0.addConvertibleAssetIds(v201);
end;
v0.getAllSavedAnimationAssetIds = function()
    if not v12 then
        local l_l_ServerStorage_0_19 = l_ServerStorage_0;
        local l_R15MigratorProgress_22 = l_l_ServerStorage_0_19:FindFirstChild("R15MigratorProgress");
        local v207;
        if not l_R15MigratorProgress_22 or not l_R15MigratorProgress_22:IsA("Folder") then
            local l_Folder_29 = Instance.new("Folder");
            l_Folder_29.Name = "R15MigratorProgress";
            l_Folder_29.Parent = l_l_ServerStorage_0_19;
            v207 = l_Folder_29;
        else
            v207 = l_R15MigratorProgress_22;
        end;
        v12 = v207;
    end;
    local l_v12_9 = v12;
    local l_R15KeyframeSequences_2 = l_v12_9:FindFirstChild("R15KeyframeSequences");
    local v211;
    if not l_R15KeyframeSequences_2 or not l_R15KeyframeSequences_2:IsA("Folder") then
        local l_Folder_30 = Instance.new("Folder");
        l_Folder_30.Name = "R15KeyframeSequences";
        l_Folder_30.Parent = l_v12_9;
        v211 = l_Folder_30;
    else
        v211 = l_R15KeyframeSequences_2;
    end;
    l_v12_9 = {};
    for _, v214 in v211:GetChildren() do
        if v214:IsA("StringValue") then
            local v215 = tonumber(v214.Name);
            if v215 then
                local v216 = tonumber(v214.Value);
                if v216 then
                    l_v12_9[v215] = {
                        converted = v216,
                        kfs = v214:FindFirstChildWhichIsA("KeyframeSequence"),
                        name = v214:GetAttribute(l_Attributes_0.Name)
                    };
                end;
            end;
        end;
    end;
    return l_v12_9;
end;
v0.setPublishTime = function(v217)
    if not v13 then
        local l_l_ServerStorage_0_20 = l_ServerStorage_0;
        local l_R15MigratorPostPublish_2 = l_l_ServerStorage_0_20:FindFirstChild("R15MigratorPostPublish");
        local v220;
        if not l_R15MigratorPostPublish_2 or not l_R15MigratorPostPublish_2:IsA("Folder") then
            local l_Folder_31 = Instance.new("Folder");
            l_Folder_31.Name = "R15MigratorPostPublish";
            l_Folder_31.Parent = l_l_ServerStorage_0_20;
            v220 = l_Folder_31;
        else
            v220 = l_R15MigratorPostPublish_2;
        end;
        v13 = v220;
    end;
    local l_v13_1 = v13;
    local l_PublishInfo_0 = l_v13_1:FindFirstChild("PublishInfo");
    local v224;
    if not l_PublishInfo_0 or not l_PublishInfo_0:IsA("Folder") then
        local l_Folder_32 = Instance.new("Folder");
        l_Folder_32.Name = "PublishInfo";
        l_Folder_32.Parent = l_v13_1;
        v224 = l_Folder_32;
    else
        v224 = l_PublishInfo_0;
    end;
    v224:SetAttribute("publishTime", v217:ToIsoDate());
end;
v0.getPublishTime = function()
    if not v13 then
        local l_R15MigratorPostPublish_3 = l_ServerStorage_0:FindFirstChild("R15MigratorPostPublish");
        v13 = if not not l_R15MigratorPostPublish_3 and l_R15MigratorPostPublish_3:IsA("Folder") then l_R15MigratorPostPublish_3 else nil;
    end;
    local v227 = if not v13 then v13 else v13:FindFirstChild("PublishInfo");
    if v227 then
        local l_v227_Attribute_0 = v227:GetAttribute("publishTime");
        if type(l_v227_Attribute_0) == "string" then
            return (DateTime.fromIsoDate(l_v227_Attribute_0));
        else
            return nil;
        end;
    else
        return nil;
    end;
end;
return v0;


local v0 = require(script.Parent.CodeBlock);
local v1 = {};
v1.__index = v1;
v1.new = function()
    return (setmetatable({
        _root = v0.new(1, 1)
    }, v1));
end;
v1.GetRoot = function(v2)
    return v2._root;
end;
v1.TraverseBF = function(v3, v4)
    local v5 = {
        v3._root
    };
    while #v5 > 0 do
        local v6 = v5[1];
        table.remove(v5, 1);
        for _, v8 in ipairs(v6.Children) do
            table.insert(v5, v8);
        end;
        v4(v6);
    end;
end;
v1.TraverseUp = function(v9, v10)
    local l_v9_0 = v9;
    while true do
        if not l_v9_0 then
            return ;
        elseif not v10(l_v9_0) then
            l_v9_0 = l_v9_0.Parent;
        else
            return ;
        end;
    end;
end;
return v1;


local l_Parent_0 = script.Parent;
local v1 = require(l_Parent_0.Issue);
local v2 = require(l_Parent_0.R6Info);
local v3 = {};
v3.__index = v3;
v3.new = function(v4, v5)
    return (setmetatable({
        StartIndex = v4,
        EndIndex = v5,
        Issues = {},
        Children = {},
        Lines = {},
        Variables = {}
    }, v3));
end;
local function _(v6, v7)
    v6.Parent = v7;
end;
v3.AddChild = function(v9, v10)
    table.insert(v9.Children, v10);
    v10.Parent = v9;
end;
v3.AddVariable = function(v11, v12, v13, v14, v15)
    v11.Variables[v12] = {
        Value = v13,
        LineNo = v14,
        StartIndex = v15
    };
end;
v3.SetVariableValue = function(v16, v17, v18)
    if v16.Variables[v17] then
        v16.Variables[v17].Value = v18;
    end;
end;
v3.IsHumanoidVariable = function(v19, v20)
    if not v19.Variables[v20] then
        return false;
    else
        return v2.IsHumanoidName(v20) or v2.IsHumanoidName(v19.Variables[v20].Value);
    end;
end;
v3.AddIssue = function(v21, ...)
    table.insert(v21.Issues, v1.new(...));
end;
return v3;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Resources.Constants);
return {
    StartKey = "start",
    EndKey = "end",
    CharacterLimit = 199987,
    AttributeChunkNameBase = v0.AttributePrefix .. "ScriptBackupChunk",
    AttributeChunkCountName = v0.AttributePrefix .. "ScriptBackupCount",
    AttributeInitialIssueCountName = v0.AttributePrefix .. "InitialIssueCount",
    AttributeUnificationScriptName = v0.AttributePrefix .. "UnificationScript",
    ScriptStatus = {
        AutoConverted = "AutoConverted",
        Complete = "Complete",
        Reverted = "Reverted",
        Warning = "Warning",
        Error = "Error",
        VariableError = "VariableError",
        None = "None"
    },
    ReferenceKey = "Reference",
    ScriptBackupTag = "R15MigratorScriptHasBackup"
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_HttpService_0 = game:GetService("HttpService");
local _ = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v3 = {};
v3.__index = v3;
v3.__eq = function(v4, v5)
    if not ((v4.range == v5.range and v4.message == v5.message) and #v4.suggestions == #v5.suggestions) or v4.issueType ~= v5.issueType then
        return false;
    else
        for v6, v7 in v4.suggestions, nil, nil do
            if v7 ~= v5.suggestions[v6] then
                return false;
            end;
        end;
        return true;
    end;
end;
v3.__lt = function(v8, v9)
    return v8.range < v9.range;
end;
v3.new = function(v10, v11, v12, v13, v14, v15, v16, v17)
    return (setmetatable({
        diagnosticId = l_HttpService_0:GenerateGUID(true),
        range = v10,
        code = v11,
        codeDescription = v16,
        instanceName = v12,
        message = v13,
        severity = v14,
        suggestions = v15,
        issueType = v17
    }, v3));
end;
v3.GetDataForLinter = function(v18)
    return {
        range = v18.range:GetDataForLinter(),
        code = v18.code,
        message = v18.message,
        severity = v18.severity,
        codeDescription = v18.codeDescription
    };
end;
return v3;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local _ = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v3 = {};
v3.__index = v3;
v3.__eq = function(v4, v5)
    if #v4._list ~= #v5._list then
        return false;
    else
        for v6, v7 in v4._list, nil, nil do
            if v7 ~= v5._list[v6] then
                return false;
            end;
        end;
        return true;
    end;
end;
v3.new = function()
    return (setmetatable({
        _list = {}
    }, v3));
end;
v3.AddDiagnostic = function(v8, v9)
    table.insert(v8._list, v9);
end;
v3.GetDataForLinter = function(v10)
    local v11 = {};
    for _, v13 in v10._list, nil, nil do
        table.insert(v11, v13:GetDataForLinter());
    end;
    return v11;
end;
v3.Get = function(v14)
    return v14._list;
end;
v3.GetSize = function(v15)
    return #v15._list;
end;
v3.ErrorCount = function(v16, v17)
    local v18 = 0;
    for _, v20 in v16._list, nil, nil do
        if not (not ((not v17 or v17 == v20.instanceName) and v20.severity == Enum.Severity.Error) or v20.resolution) then
            v18 = v18 + 1;
        end;
    end;
    return v18;
end;
v3.WarningCount = function(v21, v22)
    local v23 = 0;
    for _, v25 in v21._list, nil, nil do
        if not (not ((not v22 or v22 == v25.instanceName) and v25.severity == Enum.Severity.Warning) or v25.resolution) then
            v23 = v23 + 1;
        end;
    end;
    return v23;
end;
v3.HasErrors = function(v26)
    return v26:ErrorCount() > 0;
end;
v3.HasWarnings = function(v27)
    return v27:WarningCount() > 0;
end;
v3.Merge = function(v28, v29)
    local v30 = v3.new();
    v30._list = l_deepCopy_0(v28._list);
    for _, v32 in v29._list, nil, nil do
        local v33 = false;
        for _, v35 in v30._list, nil, nil do
            if (v32.range == v35.range and v32.instanceName == v35.instanceName) and v32.issueType == v35.issueType then
                v33 = true;
                break;
            end;
        end;
        if not v33 then
            v30:AddDiagnostic(v32);
        end;
    end;
    table.sort(v30._list);
    return v30;
end;
return v3;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Util.DocumentationUrls);
local l_ScriptAnalysis_0 = l_script_FirstAncestor_0.Src.Util.ScriptAnalysis;
local v3 = require(l_ScriptAnalysis_0.Constants);
local v4 = require(l_ScriptAnalysis_0.Diagnostic);
local v5 = require(l_ScriptAnalysis_0.R6Info);
local v6 = require(l_ScriptAnalysis_0.buildRange);
local v7 = {};
v7.__index = v7;
v7.new = function(v8, v9, v10, v11, v12, v13, v14)
    return (setmetatable({
        InstanceName = v8,
        VariableName = v9,
        Type = v10,
        Range = v6(v11, v12, v13),
        Suggestions = v14
    }, v7));
end;
local function v19(v15, v16, v17, v18)
    if v17 == v5.HumanoidKey then
        return v18:getText("ScriptAnalysis", "HumanoidWarning", {
            name = v15,
            suggestion = v16[1]
        });
    elseif v17 == v5.RigTypeKey then
        return v18:getText("ScriptAnalysis", "RigTypeWarning", {
            name = v15,
            suggestion = v16[1]
        });
    elseif v17 == v3.ReferenceKey then
        return v18:getText("ScriptAnalysis", "VariableReferenceWarning", {
            suggestion = v16[1]
        });
    else
        return (v18:getText("ScriptAnalysis", "R6ReferenceError", {
            name = v15
        }));
    end;
end;
v7.IsWarning = function(v20)
    local v21 = true;
    if v20.Type ~= v5.HumanoidKey then
        v21 = true;
        if v20.Type ~= v5.RigTypeKey then
            v21 = v20.Type == v3.ReferenceKey;
        end;
    end;
    return v21;
end;
v7.ConvertToDiagnostic = function(v22, v23)
    if v22.Type == v5.AnimationKey then
        return v4.new(v22.Range, v23:getText("ScriptAnalysis", "AnimationWarningCode"), v22.InstanceName, v23:getText("ScriptAnalysis", "AnimationWarning"), Enum.Severity.Error, v22.Suggestions, {
            href = v1.R6Error
        }, v22.Type);
    else
        return v4.new(v22.Range, v23:getText("ScriptAnalysis", "R6ScriptErrorCode"), v22.InstanceName, v19(v22.InstanceName, v22.Suggestions, v22.Type, v23), Enum.Severity.Error, if not v22:IsWarning() then v22.Suggestions else {}, {
            href = v1.R6Error
        }, v22.Type);
    end;
end;
return v7;


local v0 = {
    AttachmentsKey = "Attachments",
    AttachmentKey = "Attachment",
    PartsKey = "Parts",
    PartKey = "Part",
    JointsKey = "Joints",
    JointKey = "Joint",
    HumanoidKey = "Humanoid",
    AnimationKey = "Animation",
    RigTypeKey = "RigTypeKey"
};
v0.HumanoidNames = {
    v0.HumanoidKey,
    "humanoid",
    "hum"
};
v0.R6RigType = "Enum.HumanoidRigType.R6";
v0.R15RigType = "Enum.HumanoidRigType.R15";
v0.Conversions = {
    [v0.HumanoidKey] = {
        Torso = "HumanoidRootPart",
        LeftArm = "LeftUpperArm",
        RightArm = "RightUpperArm",
        LeftLeg = "LeftUpperLeg",
        RightLeg = "RightUpperLeg",
        ["Left Arm"] = "LeftUpperArm",
        ["Right Arm"] = "RightUpperArm",
        ["Left Leg"] = "LeftUpperLeg",
        ["Right Leg"] = "RightUpperLeg"
    },
    [v0.PartsKey] = {
        LeftArm = {
            "LeftUpperArm",
            "LeftLowerArm",
            "LeftHand"
        },
        RightArm = {
            "RightUpperArm",
            "RightLowerArm",
            "RightHand"
        },
        LeftLeg = {
            "LeftUpperLeg",
            "LeftLowerLeg",
            "LeftFoot"
        },
        RightLeg = {
            "RightUpperLeg",
            "RightLowerLeg",
            "RightFoot"
        },
        ["Left Arm"] = {
            "LeftUpperArm",
            "LeftLowerArm",
            "LeftHand"
        },
        ["Right Arm"] = {
            "RightUpperArm",
            "RightLowerArm",
            "RightHand"
        },
        ["Left Leg"] = {
            "LeftUpperLeg",
            "LeftLowerLeg",
            "LeftFoot"
        },
        ["Right Leg"] = {
            "RightUpperLeg",
            "RightLowerLeg",
            "RightFoot"
        },
        Torso = {
            "UpperTorso",
            "LowerTorso",
            "HumanoidRootPart"
        }
    },
    [v0.AttachmentsKey] = {
        FaceCenterAttachment = {
            [v0.PartKey] = {
                "Head"
            },
            [v0.AttachmentKey] = "FaceCenterAttachment"
        },
        FaceFrontAttachment = {
            [v0.PartKey] = {
                "Head"
            },
            [v0.AttachmentKey] = "FaceFrontAttachment"
        },
        HairAttachment = {
            [v0.PartKey] = {
                "Head"
            },
            [v0.AttachmentKey] = "HairAttachment"
        },
        HatAttachment = {
            [v0.PartKey] = {
                "Head"
            },
            [v0.AttachmentKey] = "HatAttachment"
        },
        RootAttachment = {
            [v0.PartKey] = {
                "HumanoidRootPart"
            },
            [v0.AttachmentKey] = "RootRigAttachment"
        },
        LeftGripAttachment = {
            [v0.PartKey] = {
                "LeftHand"
            },
            [v0.AttachmentKey] = "LeftGripAttachment"
        },
        LeftShoulderAttachment = {
            [v0.PartKey] = {
                "LeftUpperArm"
            },
            [v0.AttachmentKey] = "LeftShoulderAttachment"
        },
        LeftFootAttachment = {
            [v0.PartKey] = {
                "LeftFoot"
            },
            [v0.AttachmentKey] = "LeftAnkleRigAttachment"
        },
        RightGripAttachment = {
            [v0.PartKey] = {
                "RightHand"
            },
            [v0.AttachmentKey] = "RightGripAttachment"
        },
        RightShoulderAttachment = {
            [v0.PartKey] = {
                "RightUpperArm"
            },
            [v0.AttachmentKey] = "RightShoulderAttachment"
        },
        RightFootAttachment = {
            [v0.PartKey] = {
                "RightFoot"
            },
            [v0.AttachmentKey] = "RightAnkleRigAttachment"
        },
        BodyBackAttachment = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.AttachmentKey] = "BodyBackAttachment"
        },
        BodyFrontAttachment = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.AttachmentKey] = "BodyFrontAttachment"
        },
        LeftCollarAttachment = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.AttachmentKey] = "LeftCollarAttachment"
        },
        NeckAttachment = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.AttachmentKey] = "NeckAttachment"
        },
        RightCollarAttachment = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.AttachmentKey] = "RightCollarAttachment"
        },
        WaistBackAttachment = {
            [v0.PartKey] = {
                "LowerTorso"
            },
            [v0.AttachmentKey] = "WaistBackAttachment"
        },
        WaistCenterAttachment = {
            [v0.PartKey] = {
                "LowerTorso"
            },
            [v0.AttachmentKey] = "WaistCenterAttachment"
        },
        WaistFrontAttachment = {
            [v0.PartKey] = {
                "LowerTorso"
            },
            [v0.AttachmentKey] = "WaistFrontAttachment"
        },
        RootRigAttachment = {
            [v0.PartKey] = {
                "HumanoidRootPart",
                "LowerTorso"
            },
            [v0.AttachmentKey] = "RootRigAttachment"
        },
        RightHipRigAttachment = {
            [v0.PartKey] = {
                "LowerTorso",
                "RightUpperLeg"
            },
            [v0.AttachmentKey] = "RightHipRigAttachment"
        },
        LeftHipRigAttachment = {
            [v0.PartKey] = {
                "LowerTorso",
                "LeftUpperLeg"
            },
            [v0.AttachmentKey] = "LeftHipRigAttachment"
        },
        LeftKneeRigAttachment = {
            [v0.PartKey] = {
                "LeftUpperLeg",
                "LeftLowerLeg"
            },
            [v0.AttachmentKey] = "LeftKneeRigAttachment"
        },
        RightKneeRigAttachment = {
            [v0.PartKey] = {
                "RightUpperLeg",
                "RightLowerLeg"
            },
            [v0.AttachmentKey] = "RightKneeRigAttachment"
        },
        RightElbowRigAttachment = {
            [v0.PartKey] = {
                "RightUpperArm",
                "RightLowerArm"
            },
            [v0.AttachmentKey] = "RightElbowRigAttachment"
        },
        LeftElbowRigAttachment = {
            [v0.PartKey] = {
                "LeftUpperArm",
                "LeftLowerArm"
            },
            [v0.AttachmentKey] = "LeftElbowRigAttachment"
        },
        WaistRigAttachment = {
            [v0.PartKey] = {
                "UpperTorso",
                "LowerTorso"
            },
            [v0.AttachmentKey] = "WaistRigAttachment"
        },
        LeftShoulderRigAttachment = {
            [v0.PartKey] = {
                "UpperTorso",
                "LeftUpperArm"
            },
            [v0.AttachmentKey] = "LeftShoulderRigAttachment"
        },
        RightShoulderRigAttachment = {
            [v0.PartKey] = {
                "UpperTorso",
                "RightUpperArm"
            },
            [v0.AttachmentKey] = "RightShoulderRigAttachment"
        },
        NeckRigAttachment = {
            [v0.PartKey] = {
                "UpperTorso",
                "Head"
            },
            [v0.AttachmentKey] = "NeckRigAttachment"
        },
        RightAnkleRigAttachment = {
            [v0.PartKey] = {
                "RightLowerLeg",
                "RightFoot"
            },
            [v0.AttachmentKey] = "RightAnkleRigAttachment"
        },
        LeftAnkleRigAttachment = {
            [v0.PartKey] = {
                "LeftLowerLeg",
                "LeftFoot"
            },
            [v0.AttachmentKey] = "LeftAnkleRigAttachment"
        },
        RightWristRigAttachment = {
            [v0.PartKey] = {
                "RightLowerArm",
                "RightHand"
            },
            [v0.AttachmentKey] = "RightWristRigAttachment"
        },
        LeftWristRigAttachment = {
            [v0.PartKey] = {
                "LeftLowerArm",
                "LeftHand"
            },
            [v0.AttachmentKey] = "LeftWristRigAttachment"
        }
    },
    [v0.JointsKey] = {
        RootJoint = {
            [v0.PartKey] = {
                "LowerTorso"
            },
            [v0.JointKey] = "Root"
        },
        Root = {
            [v0.PartKey] = {
                "LowerTorso"
            },
            [v0.JointKey] = "Root"
        },
        LeftGrip = {
            [v0.PartKey] = {
                "LeftHand"
            },
            [v0.JointKey] = "LeftGrip"
        },
        RightGrip = {
            [v0.PartKey] = {
                "RightHand"
            },
            [v0.JointKey] = "RightGrip"
        },
        ["Left Hip"] = {
            [v0.PartKey] = {
                "LeftUpperLeg"
            },
            [v0.JointKey] = "LeftHip"
        },
        LeftHip = {
            [v0.PartKey] = {
                "LeftUpperLeg"
            },
            [v0.JointKey] = "LeftHip"
        },
        ["Left Shoulder"] = {
            [v0.PartKey] = {
                "LeftUpperArm"
            },
            [v0.JointKey] = "LeftShoulder"
        },
        LeftShoulder = {
            [v0.PartKey] = {
                "LeftUpperArm"
            },
            [v0.JointKey] = "LeftShoulder"
        },
        LeftKnee = {
            [v0.PartKey] = {
                "LeftLowerLeg"
            },
            [v0.JointKey] = "LeftKnee"
        },
        LeftAnkle = {
            [v0.PartKey] = {
                "LeftFoot"
            },
            [v0.JointKey] = "LeftAnkle"
        },
        LeftElbow = {
            [v0.PartKey] = {
                "LeftLowerArm"
            },
            [v0.JointKey] = "LeftElbow"
        },
        LeftWrist = {
            [v0.PartKey] = {
                "LeftHand"
            },
            [v0.JointKey] = "LeftWrist"
        },
        Neck = {
            [v0.PartKey] = {
                "Head"
            },
            [v0.JointKey] = "Neck"
        },
        ["Right Hip"] = {
            [v0.PartKey] = {
                "RightUpperLeg"
            },
            [v0.JointKey] = "RightHip"
        },
        RightHip = {
            [v0.PartKey] = {
                "RightUpperLeg"
            },
            [v0.JointKey] = "RightHip"
        },
        RightKnee = {
            [v0.PartKey] = {
                "RightLowerLeg"
            },
            [v0.JointKey] = "RightKnee"
        },
        RightAnkle = {
            [v0.PartKey] = {
                "RightFoot"
            },
            [v0.JointKey] = "RightAnkle"
        },
        ["Right Shoulder"] = {
            [v0.PartKey] = {
                "RightUpperArm"
            },
            [v0.JointKey] = "RightShoulder"
        },
        RightShoulder = {
            [v0.PartKey] = {
                "RightUpperArm"
            },
            [v0.JointKey] = "RightShoulder"
        },
        RightElbow = {
            [v0.PartKey] = {
                "RightLowerArm"
            },
            [v0.JointKey] = "RightElbow"
        },
        RightWrist = {
            [v0.PartKey] = {
                "RightHand"
            },
            [v0.JointKey] = "RightWrist"
        },
        Waist = {
            [v0.PartKey] = {
                "UpperTorso"
            },
            [v0.JointKey] = "Waist"
        }
    }
};
local function _(v1)
    local v2 = {};
    for v3 in pairs(v1) do
        table.insert(v2, v3);
    end;
    return v2;
end;
v0.GetPartNames = function()
    local l_Parts_0 = v0.Conversions.Parts;
    local v6 = {};
    for v7 in pairs(l_Parts_0) do
        table.insert(v6, v7);
    end;
    return v6;
end;
v0.GetR15PartNames = function()
    local v8 = {};
    for _, v10 in v0.Conversions.Parts, nil, nil do
        for _, v12 in ipairs(v10) do
            v8[v12] = v12;
        end;
    end;
    v8.Head = "Head";
    return v8;
end;
v0.GetAttachmentNames = function()
    local l_Attachments_0 = v0.Conversions.Attachments;
    local v14 = {};
    for v15 in pairs(l_Attachments_0) do
        table.insert(v14, v15);
    end;
    return v14;
end;
v0.GetJointNames = function()
    local l_Joints_0 = v0.Conversions.Joints;
    local v17 = {};
    for v18 in pairs(l_Joints_0) do
        table.insert(v17, v18);
    end;
    return v17;
end;
v0.IsHumanoidName = function(v19)
    if not string.find(string.lower(v19), string.lower(v0.HumanoidKey)) then
        for _, v21 in v0.HumanoidNames, nil, nil do
            if v21 == v19 then
                return true;
            end;
        end;
        return false;
    else
        return true;
    end;
end;
return v0;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Util.ScriptAnalysis.Constants);
local v1 = {};
v1.__index = v1;
v1.new = function(v2, v3, v4, v5)
    return (setmetatable({
        startLine = v2,
        startCharacter = v3,
        endLine = v4,
        endCharacter = v5
    }, v1));
end;
v1.__eq = function(v6, v7)
    local v8 = false;
    if v6.startLine == v7.startLine then
        v8 = false;
        if v6.startCharacter == v7.startCharacter then
            v8 = false;
            if v6.endLine == v7.endLine then
                v8 = v6.endCharacter == v7.endCharacter;
            end;
        end;
    end;
    return v8;
end;
v1.__lt = function(v9, v10)
    if v9.startLine == v10.startLine then
        return v9.startCharacter < v10.startCharacter;
    else
        return v9.startLine < v10.startLine;
    end;
end;
v1.__le = function(v11, v12)
    return v11:__eq(v12) or v11:__lt(v12);
end;
v1.fromLinter = function(v13)
    return v1.new(v13[v0.StartKey].line, v13[v0.StartKey].character, v13[v0.EndKey].line, v13[v0.EndKey].character);
end;
v1.Overlaps = function(v14, v15)
    local v16 = true;
    if v15.endLine >= v14.startLine then
        if v15.endLine == v14.startLine then
            v16 = true;
            if not (v15.endCharacter >= v14.startCharacter) then
                goto label0;
            end;
        end;
        v16 = true;
        if v14.endLine >= v15.startLine then
            v16 = false;
            if v15.startLine == v14.endLine then
                v16 = v14.endCharacter < v15.startCharacter;
            end;
        end;
    end;
    ::label0::;
    return not v16;
end;
v1.GetDataForLinter = function(v17)
    return {
        [v0.StartKey] = {
            line = v17.startLine,
            character = v17.startCharacter
        },
        [v0.EndKey] = {
            line = v17.endLine,
            character = v17.endCharacter
        }
    };
end;
return v1;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_ScriptAnalysis_0 = l_script_FirstAncestor_0.Src.Util.ScriptAnalysis;
local v2 = require(l_ScriptAnalysis_0.buildBlockTree);
local v3 = require(l_ScriptAnalysis_0.findR6Names);
local v4 = require(l_ScriptAnalysis_0.findAssetId);
local v5 = require(l_ScriptAnalysis_0.R6Info);
local v6 = require(l_ScriptAnalysis_0.StatementParser);
local v7 = require(l_ScriptAnalysis_0.BlockTree);
local v8 = require(l_ScriptAnalysis_0.Constants);
local v9 = require(l_ScriptAnalysis_0.DiagnosticList);
local v10 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.AnimationConversionManager);
local v11 = {};
local function v23(v12, v13, v14, v15)
    local l_PartKey_0 = v5.PartKey;
    local v17 = v5.Conversions.Parts[v14] or {};
    v7.TraverseUp(v12, function(v18)
        for v19, _ in v18.Variables, nil, nil do
            if not (not v18:IsHumanoidVariable(v19) or not v6:FindVariableAccess(v15, v13, v19)) then
                v17 = {
                    v5.Conversions.Humanoid[v14]
                };
                l_PartKey_0 = v5.HumanoidKey;
                return true;
            end;
        end;
        return false;
    end);
    for _, v22 in v5.HumanoidNames, nil, nil do
        if v6:FindVariableAccess(v15, v13, v22) then
            v17 = {
                v5.Conversions.Humanoid[v14]
            };
            l_PartKey_0 = v5.HumanoidKey;
            break;
        end;
    end;
    return l_PartKey_0, v17;
end;
local function _(v24, v25, v26, v27)
    local v28 = nil;
    local v29 = nil;
    v7.TraverseUp(v24, function(v30)
        local l_v6_VariableAssignment_0, v32 = v6:FindVariableAssignment(v30.Variables, v27, v25);
        v28 = l_v6_VariableAssignment_0;
        v29 = v32;
        if not v29 or not v28 then
            return false;
        else
            v29.Value = v26;
            return true;
        end;
    end);
    return v28, v29;
end;
local function _(v34, v35, v36, v37, v38, v39, v40)
    local v41 = nil;
    local v42 = nil;
    local v43;
    do
        local l_v41_0, l_v42_0 = v41, v42;
        v7.TraverseUp(v34, function(v46)
            local l_v6_VariableAssignment_1, v48 = v6:FindVariableAssignment(v46.Variables, v39, v36);
            l_v41_0 = l_v6_VariableAssignment_1;
            l_v42_0 = v48;
            if not l_v42_0 or not l_v41_0 then
                return false;
            else
                l_v42_0.Value = v38;
                return true;
            end;
        end);
        v43 = l_v41_0;
    end;
    v41, v42 = v23(v34, v36, v38, v39);
    v34:AddIssue(v38, v43, v41, v40, v36 + v35, v37 + v35, v42);
end;
local function v60(v50, v51, v52, v53, v54)
    v7.TraverseUp(v50, function(v55)
        for _, v57 in ipairs(v55.Issues) do
            if not ((not (v57.Type == v5.PartKey) or not v57.VariableName) or not v6:FindVariableAccess(v52, v51, v57.VariableName)) then
                v57.Suggestions = v54;
                return ;
            end;
        end;
    end);
    for _, v59 in ipairs(v50.Issues) do
        if not (not (v59.Type == v5.PartKey and v59.Range.startLine == v53) or not v6:FindVariableAccess(v52, v51, v59.InstanceName)) then
            v59.Suggestions = v54;
            return ;
        end;
    end;
end;
local function _(v61, v62, v63, v64, v65)
    v7.TraverseUp(v61, function(v66)
        for v67, v68 in v66.Variables, nil, nil do
            if v6:FindVariableAccess(v64, v63, v67) and v68.Value ~= v65 then
                local v69, v70 = string.find(v64, v67);
                v61:AddIssue(v67, v67, v8.ReferenceKey, v62, v69, v70, {
                    v65
                });
                return ;
            end;
        end;
    end);
    return false;
end;
local function v89(v72, v73, v74, v75, v76, v77, v78, v79, v80)
    local v81 = v5.Conversions[v72][v78];
    if v81 then
        local l_v6_VariableAssignment_2 = v6:FindVariableAssignment(v74.Variables, v79, v76);
        if v78 ~= v81[v73] then
            v74:AddIssue(v78, l_v6_VariableAssignment_2, v73, v80, v76 + v75, v77 + v75, {
                v81[v73]
            });
        end;
        v60(v74, v76, v79, v80, v81.Part);
        if #v81.Part == 1 then
            local v83 = v81.Part[1];
            v7.TraverseUp(v74, function(v84)
                for v85, v86 in v84.Variables, nil, nil do
                    if v6:FindVariableAccess(v79, v76, v85) and v86.Value ~= v83 then
                        local v87, v88 = string.find(v79, v85);
                        v74:AddIssue(v85, v85, v8.ReferenceKey, v80, v87, v88, {
                            v83
                        });
                        return ;
                    end;
                end;
            end);
        end;
        return ;
    else
        return ;
    end;
end;
local function v90(...)
    v89(v5.AttachmentsKey, v5.AttachmentKey, ...);
end;
local function v91(...)
    v89(v5.JointsKey, v5.JointKey, ...);
end;
local function v99(v92, v93, v94, v95, v96, v97, v98)
    if v10.isR6Animation(v96, true) then
        v92:AddIssue(v96, v6:FindVariableAssignment(v92.Variables, v97, v94), v5.AnimationKey, v98, v94 + v93, v95 + v93, {
            v10.getConvertedAssetUrl(v96)
        });
        return ;
    else
        return ;
    end;
end;
local function v107(v100, v101, v102, v103, v104, v105, v106)
    v100:AddIssue(v104, v6:FindVariableAssignment(v100.Variables, v105, v102), v5.RigTypeKey, v106, v102 + v101, v103 + v101, {
        v5.R15RigType
    });
end;
local function v137(v108)
    for _, v110 in ipairs(v108.Lines) do
        v3(v110.Text, v110.LineNo, v5.GetPartNames(), true, function(...)
            local l_v108_0 = v108;
            local l_Offset_0 = v110.Offset;
            local v113, v114, v115, v116, v117 = ...;
            local v118 = nil;
            local v119 = nil;
            local v120;
            do
                local l_v118_0, l_v119_0 = v118, v119;
                v7.TraverseUp(l_v108_0, function(v123)
                    local l_v6_VariableAssignment_3, v125 = v6:FindVariableAssignment(v123.Variables, v116, v113);
                    l_v118_0 = l_v6_VariableAssignment_3;
                    l_v119_0 = v125;
                    if not l_v119_0 or not l_v118_0 then
                        return false;
                    else
                        l_v119_0.Value = v115;
                        return true;
                    end;
                end);
                v120 = l_v118_0;
            end;
            v118, v119 = v23(l_v108_0, v113, v115, v116);
            l_v108_0:AddIssue(v115, v120, v118, v117, v113 + l_Offset_0, v114 + l_Offset_0, v119);
        end);
        v3(v110.Text, v110.LineNo, v5.GetR15PartNames(), true, function(v126, _, v128, v129, _)
            local l_v108_1 = v108;
            local v132 = nil;
            local v133 = nil;
            v7.TraverseUp(l_v108_1, function(v134)
                local l_v6_VariableAssignment_4, v136 = v6:FindVariableAssignment(v134.Variables, v129, v126);
                v132 = l_v6_VariableAssignment_4;
                v133 = v136;
                if not v133 or not v132 then
                    return false;
                else
                    v133.Value = v128;
                    return true;
                end;
            end);
        end);
        v3(v110.Text, v110.LineNo, v5.GetAttachmentNames(), true, function(...)
            v90(v108, v110.Offset, ...);
        end);
        v3(v110.Text, v110.LineNo, v5.GetJointNames(), true, function(...)
            v91(v108, v110.Offset, ...);
        end);
        v3(v110.Text, v110.LineNo, {
            v5.R6RigType
        }, false, function(...)
            v107(v108, v110.Offset, ...);
        end);
        v4(v110.Text, v110.LineNo, function(...)
            v99(v108, v110.Offset, ...);
        end);
    end;
end;
local function v146(v138, v139)
    local v140 = v9.new();
    v138:TraverseBF(function(v141)
        for _, v143 in ipairs(v141.Issues) do
            v140:AddDiagnostic(v143:ConvertToDiagnostic(v139));
        end;
    end);
    table.sort(v140, function(v144, v145)
        if v144.range[v8.StartKey].line < v145.range[v8.StartKey].line then
            return true;
        elseif v144.range[v8.StartKey].line == v145.range[v8.StartKey].line then
            return v144.range[v8.StartKey].character <= v145.range[v8.StartKey].character;
        else
            return false;
        end;
    end);
    return v140;
end;
v11.ScanScript = function(_, v148, v149)
    local v150 = v2(v148);
    v150:TraverseBF(v137);
    return (v146(v150, v149));
end;
return v11;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local _ = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v2 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Range);
return function(v3, v4, v5)
    return v2.new(v3, v4, v3, v5 + 1);
end;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Util.parseAssetURL);
local v1 = require(script.Parent.StringUtil);
return function(v2, v3, v4)
    local v5, v6, v7 = v0(v2);
    if v5 then
        if v1.MatchBeforeAndAfter(v2, v5, v6, "[\"]", "[\"]") or v1.MatchBeforeAndAfter(v2, v5, v6, "[']", "[']") then
            if v4 then
                v4(v5, v6, v7, v2, v3);
            end;
            return v7;
        else
            return false;
        end;
    else
        return false;
    end;
end;


local v0 = require(script.Parent.StringUtil);
local function v4(v1, v2, v3)
    if not v0.MatchBeforeOrAfter(v3, v1, v2, "%w", "%w") then
        if not v0.MatchBeforeAndAfter(v3, v1, v2, "[\"]", "[\"]") then
            if not v0.MatchBeforeAndAfter(v3, v1, v2, "[']", "[']") then
                if not v0.MatchBeforeAndAfter(v3, v1, v2, "[.]", "[[:%s.=,\r\n\t]", false, true) then
                    return false;
                else
                    return true;
                end;
            else
                return true;
            end;
        else
            return true;
        end;
    else
        return false;
    end;
end;
return function(v5, v6, v7, v8, v9)
    local v10 = 1;
    for _, v12 in v7, nil, nil do
        local v13 = nil;
        local v14 = nil;
        while true do
            local v15, v16 = string.find(v5, v12, v10);
            v13 = v15;
            v14 = v16;
            if not (not v13 or not v14) then
                if not (v8 and not v4(v13, v14, v5)) then
                    v9(v13, v14, v12, v5, v6);
                end;
                v10 = v14;
            end;
            if not (not (v13 == nil) or v14 ~= nil) then
                break;
            end;
        end;
        v10 = 1;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetReplaceProgress);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetProgressBarMessageKey);
local v4 = {};
v4.__index = v4;
v4.new = function(v5, v6, v7)
    local v8 = setmetatable({}, v4);
    v8._dispatchSetProgress = function(v9)
        v7:dispatch(v2(v9));
    end;
    v8._dispatchSetMessage = function(v10)
        v7:dispatch(v3(v10));
    end;
    v8._dispatchSetMessage(v5);
    v8._progress = -1;
    v8._targetProgress = math.max(v6, 1);
    v8:updateProgress();
    return v8;
end;
v4.updateProgress = function(v11)
    v11._progress = v11._progress + 1;
    v11._dispatchSetProgress(v11._progress / v11._targetProgress);
end;
v4.clearProgressBar = function(v12)
    v12._dispatchSetProgress(v1.None);
end;
return v4;