local A=game:GetService("\083\116\097\114\116\101\114\071\117\105")local N=game:GetService("\071\117\105\083\101\114\118\105\099\101")local E=game:GetService("\072\097\112\116\105\099\083\101\114\118\105\099\101")local I=game:GetService("\082\117\110\083\101\114\118\105\099\101")local e=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local s=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local W=game:GetService("\080\108\097\121\101\114\115")local p={}local Y=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local B=require(script.Parent.Signal)local H=require(script.Parent.TopbarPlusGui)local f={}local m="\095\070\097\107\101\067\104\097\116"local X=false local M local w=false local L=32 local k={}k.left={startScale=0,getOffset=function()local N=48 if A:GetCoreGuiEnabled("\067\104\097\116")then N+=44 end return N end;getStartOffset=function()local A=p.leftGap local N=k.left.getOffset()+A return N end,records={}}k.mid={startScale=.5;getOffset=function()return 0 end;getStartOffset=function(A)local N=p.midGap return-A/2+N/2 end,records={}}k.right={startScale=1,getOffset=function()local N=0 if A:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)or A:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)or A:GetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu)then N+=48 end return N end;getStartOffset=function(A)local N=-A-k.right.getOffset()return N end,records={}}

local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local IconController = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(script.Parent.Signal)
local TopbarPlusGui = require(script.Parent.TopbarPlusGui)
local topbarIcons = {}
local fakeChatName = "_FakeChat"
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local STUPID_CONTROLLER_OFFSET = 32
local alignmentDetails = {}
alignmentDetails["left"] = {
	startScale = 0,
	getOffset = function()
		local offset = 48
		if starterGui:GetCoreGuiEnabled("Chat") then
			offset += 12 + 32
		end
		return offset
	end,
	getStartOffset = function()
		local alignmentGap = IconController["leftGap"]
		local startOffset = alignmentDetails.left.getOffset() + alignmentGap
		return startOffset
	end,
	records = {}
}
alignmentDetails["mid"] = {
	startScale = 0.5,
	getOffset = function()
		return 0
	end,
	getStartOffset = function(totalIconX) 
		local alignmentGap = IconController["midGap"]
		return -totalIconX/2 + (alignmentGap/2)
	end,
	records = {}
}
alignmentDetails["right"] = {
	startScale = 1,
	getOffset = function()
		local offset = 0
		if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu) then
			offset += 48
		end
		return offset
	end,
	getStartOffset = function(totalIconX)
		local startOffset = -totalIconX - alignmentDetails.right.getOffset()
		return startOffset
	end,
	records = {}
	--reverseSort = true
}


