local s=script.Parent local U=require(s:WaitForChild("\077\101\115\115\097\103\101\076\097\098\101\108\067\114\101\097\116\111\114"))local p=require(s:WaitForChild("\067\117\114\118\101\085\116\105\108"))local c=require(((game:GetService("\067\104\097\116")):WaitForChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")):WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))local B=false local q,f=pcall(function()return(settings()):IsUserFeatureEnabled("\085\115\101\114\070\105\120\067\104\097\116\077\101\115\115\097\103\101\076\111\103\080\101\114\102\111\114\109\097\110\099\101")end)if q then B=f end local o={}o.__index=o local x={ScrollBarThickness=4}function o.Destroy(s)s.GuiObject:Destroy()s.Destroyed=true end function o.SetActive(s,U)s.GuiObject.Visible=U end function o.UpdateMessageFiltered(s,U)local p=nil local c=1 local q=s.MessageObjectLog while c<=#q do local s=q[c]if s.ID==U.ID then p=s break end c=c+1 end if p then local c=s:IsScrolledDown()p.UpdateTextFunction(U)if not B then s:ReorderAllMessages()return end else return end s:PositionMessageLabelInWindow(p,v13)end local N=U.new()function o.AddMessage(s,U)s:WaitUntilParentedCorrectly()local p=N:CreateMessageLabel(U,s.CurrentChannelName)if p==nil then return end table.insert(s.MessageObjectLog,p)s:PositionMessageLabelInWindow(p)end function o.AddMessageAtIndex(s,U,p)local c=N:CreateMessageLabel(U,s.CurrentChannelName)if c==nil then return end table.insert(s.MessageObjectLog,p,c)local B=s:IsScrolledDown()s:ReorderAllMessages()if B then s.Scroller.CanvasPosition=Vector2.new(0,math.max(0,s.Scroller.CanvasSize.Y.Offset-s.Scroller.AbsoluteSize.Y))end end function o.RemoveLastMessage(s)s:WaitUntilParentedCorrectly()local U=s.MessageObjectLog[1]local p=UDim2.new(0,0,0,U.BaseFrame.AbsoluteSize.Y)U:Destroy()table.remove(s.MessageObjectLog,1)if not B then for s,U in pairs(s.MessageObjectLog)do U.BaseFrame.Position=U.BaseFrame.Position-p end s.Scroller.CanvasSize=s.Scroller.CanvasSize-p end end function o.IsScrolledDown(s)local U=nil local p=nil local c=nil U=s.Scroller.CanvasSize.Y.Offset p=s.Scroller.AbsoluteWindowSize.Y c=s.Scroller.CanvasPosition.Y if B then local s=true if not(U<p)then s=p-5<=U+c end return s end local q=true if not(U<p)then q=U-c<=p+5 end return q end function o.PositionMessageLabelInWindow(s,U,p)s:WaitUntilParentedCorrectly()local c=U.BaseFrame if B then if p==nil then p=s:IsScrolledDown()end c.LayoutOrder=U.ID else c.Parent=s.Scroller c.Position=UDim2.new(0,0,0,s.Scroller.CanvasSize.Y.Offset)end c.Size=UDim2.new(1,0,0,U.GetHeightFunction(s.Scroller.AbsoluteSize.X))if B then c.Parent=s.Scroller end if U.BaseMessage then if B then for p=1,10,1 do if U.BaseMessage.TextFits then break end c.Size=UDim2.new(1,0,0,U.GetHeightFunction(s.Scroller.AbsoluteSize.X-p))end else local p=s.Scroller.AbsoluteSize.X local B=math.min(s.Scroller.AbsoluteSize.X-10,0)while not U.BaseMessage.TextFits do p=p-1 if p<B then break end c.Size=UDim2.new(1,0,0,U.GetHeightFunction(p))end end end if B then if not p then return end else p=s:IsScrolledDown()s.Scroller.CanvasSize=s.Scroller.CanvasSize+UDim2.new(0,0,0,c.Size.Y.Offset)if p then s.Scroller.CanvasPosition=Vector2.new(0,math.max(0,s.Scroller.CanvasSize.Y.Offset-s.Scroller.AbsoluteSize.Y))end return end s.Scroller.CanvasPosition=Vector2.new(0,math.max(0,s.Scroller.CanvasSize.Y.Offset-s.Scroller.AbsoluteSize.Y))end function o.ReorderAllMessages(s)s:WaitUntilParentedCorrectly()if s.GuiObject.AbsoluteSize.Y<1 then return end s.Scroller.CanvasSize=UDim2.new(0,0,0,0)for U,p in pairs(s.MessageObjectLog)do s:PositionMessageLabelInWindow(p)end if not s:IsScrolledDown()then s.Scroller.CanvasPosition=s.Scroller.CanvasPosition end end function o.Clear(s)for s,U in pairs(s.MessageObjectLog)do U:Destroy()end s.MessageObjectLog={}if not B then s.Scroller.CanvasSize=UDim2.new(0,0,0,0)end end function o.SetCurrentChannelName(s,U)s.CurrentChannelName=U end function o.FadeOutBackground(s,U) end function o.FadeInBackground(s,U) end function o.FadeOutText(s,U)for c=1,#s.MessageObjectLog,1 do if s.MessageObjectLog[c].FadeOutFunction then s.MessageObjectLog[c].FadeOutFunction(U,p)end end end function o.FadeInText(s,U)for c=1,#s.MessageObjectLog,1 do if s.MessageObjectLog[c].FadeInFunction then s.MessageObjectLog[c].FadeInFunction(U,p)end end end function o.Update(s,U)for c=1,#s.MessageObjectLog,1 do if s.MessageObjectLog[c].UpdateAnimFunction then s.MessageObjectLog[c].UpdateAnimFunction(U,p)end end end function o.WaitUntilParentedCorrectly(s)while not s.GuiObject:IsDescendantOf((game:GetService("\080\108\097\121\101\114\115")).LocalPlayer)do s.GuiObject.AncestryChanged:wait()end end local function h()local s=Instance.new("\070\114\097\109\101")s.Selectable=false s.Size=UDim2.new(1,0,1,0)s.BackgroundTransparency=1 local U=Instance.new("\083\099\114\111\108\108\105\110\103\070\114\097\109\101")U.Selectable=c.GamepadNavigationEnabled U.Name="\083\099\114\111\108\108\101\114"U.BackgroundTransparency=1 U.BorderSizePixel=0 U.Position=UDim2.new(0,0,0,3)U.Size=UDim2.new(1,-4,1,-6)U.CanvasSize=UDim2.new(0,0,0,0)U.ScrollBarThickness=x.ScrollBarThickness U.Active=false U.Parent=s local p=nil if B then p=Instance.new("\085\073\076\105\115\116\076\097\121\111\117\116")p.SortOrder=Enum.SortOrder.LayoutOrder p.Parent=U end return s,U,p end function x.new()local s=setmetatable({},o)s.Destroyed=false local U,p,c=h()s.GuiObject=U s.Scroller=p s.Layout=c s.MessageObjectLog={}s.Name="\077\101\115\115\097\103\101\076\111\103\068\105\115\112\108\097\121"s.GuiObject.Name="\070\114\097\109\101\095"..s.Name s.CurrentChannelName="";(s.GuiObject:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\083\105\122\101")):Connect(function()spawn(function()s:ReorderAllMessages()end)end)if B then local U=true;(s.Layout:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\067\111\110\116\101\110\116\083\105\122\101")):Connect(function()local p=s.Layout.AbsoluteContentSize s.Scroller.CanvasSize=UDim2.new(0,0,0,p.Y)if U then s.Scroller.CanvasPosition=Vector2.new(0,p.Y-s.Scroller.AbsoluteWindowSize.Y)end end);(s.Scroller:GetPropertyChangedSignal("\067\097\110\118\097\115\080\111\115\105\116\105\111\110")):Connect(function()U=s:IsScrolledDown()end)end return s end return x
-- Decompiled with the Synapse X Luau decompiler.

local l__Parent__1 = script.Parent
local v2 = require(l__Parent__1:WaitForChild("MessageLabelCreator"))
local v3 = require(l__Parent__1:WaitForChild("CurveUtil"))
local v4 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"))
local v5 = false
local v6, v7 = pcall(function()
	return settings():IsUserFeatureEnabled("UserFixChatMessageLogPerformance")
end)
if v6 then
	v5 = v7
end
local v8 = {}
v8.__index = v8
local u1 = {
	ScrollBarThickness = 4,
}
function v8.Destroy(p1)
	p1.GuiObject:Destroy()
	p1.Destroyed = true
end
function v8.SetActive(p2, p3)
	p2.GuiObject.Visible = p3
end
function v8.UpdateMessageFiltered(p4, p5)
	local v9 = nil
	local v10 = 1
	local l__MessageObjectLog__11 = p4.MessageObjectLog
	while v10 <= #l__MessageObjectLog__11 do
		local v12 = l__MessageObjectLog__11[v10]
		if v12.ID == p5.ID then
			v9 = v12
			break
		end
		v10 = v10 + 1
	end
	if v9 then
		local v13 = p4:IsScrolledDown()
		v9.UpdateTextFunction(p5)
		if not v5 then
			p4:ReorderAllMessages()
			return
		end
	else
		return
	end
	p4:PositionMessageLabelInWindow(v9, v13)
end
local u2 = v2.new()
function v8.AddMessage(p6, p7)
	p6:WaitUntilParentedCorrectly()
	local v14 = u2:CreateMessageLabel(p7, p6.CurrentChannelName)
	if v14 == nil then
		return
	end
	table.insert(p6.MessageObjectLog, v14)
	p6:PositionMessageLabelInWindow(v14)
end
function v8.AddMessageAtIndex(p8, p9, p10)
	local v15 = u2:CreateMessageLabel(p9, p8.CurrentChannelName)
	if v15 == nil then
		return
	end
	table.insert(p8.MessageObjectLog, p10, v15)
	local v16 = p8:IsScrolledDown()
	p8:ReorderAllMessages()
	if v16 then
		p8.Scroller.CanvasPosition =
			Vector2.new(0, math.max(0, p8.Scroller.CanvasSize.Y.Offset - p8.Scroller.AbsoluteSize.Y))
	end
end
function v8.RemoveLastMessage(p11)
	p11:WaitUntilParentedCorrectly()
	local v17 = p11.MessageObjectLog[1]
	local v18 = UDim2.new(0, 0, 0, v17.BaseFrame.AbsoluteSize.Y)
	v17:Destroy()
	table.remove(p11.MessageObjectLog, 1)
	if not v5 then
		for v19, v20 in pairs(p11.MessageObjectLog) do
			v20.BaseFrame.Position = v20.BaseFrame.Position - v18
		end
		p11.Scroller.CanvasSize = p11.Scroller.CanvasSize - v18
	end
end
function v8.IsScrolledDown(p12)
	local v21 = nil
	local v22 = nil
	local v23 = nil
	v21 = p12.Scroller.CanvasSize.Y.Offset
	v22 = p12.Scroller.AbsoluteWindowSize.Y
	v23 = p12.Scroller.CanvasPosition.Y
	if v5 then
		local v24 = true
		if not (v21 < v22) then
			v24 = v22 - 5 <= v21 + v23
		end
		return v24
	end
	local v25 = true
	if not (v21 < v22) then
		v25 = v21 - v23 <= v22 + 5
	end
	return v25
end
function v8.PositionMessageLabelInWindow(p13, p14, p15)
	p13:WaitUntilParentedCorrectly()
	local l__BaseFrame__26 = p14.BaseFrame
	if v5 then
		if p15 == nil then
			p15 = p13:IsScrolledDown()
		end
		l__BaseFrame__26.LayoutOrder = p14.ID
	else
		l__BaseFrame__26.Parent = p13.Scroller
		l__BaseFrame__26.Position = UDim2.new(0, 0, 0, p13.Scroller.CanvasSize.Y.Offset)
	end
	l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X))
	if v5 then
		l__BaseFrame__26.Parent = p13.Scroller
	end
	if p14.BaseMessage then
		if v5 then
			for v27 = 1, 10 do
				if p14.BaseMessage.TextFits then
					break
				end
				l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X - v27))
			end
		else
			local v28 = p13.Scroller.AbsoluteSize.X
			local v29 = math.min(p13.Scroller.AbsoluteSize.X - 10, 0)
			while not p14.BaseMessage.TextFits do
				v28 = v28 - 1
				if v28 < v29 then
					break
				end
				l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(v28))
			end
		end
	end
	if v5 then
		if not p15 then
			return
		end
	else
		p15 = p13:IsScrolledDown()
		p13.Scroller.CanvasSize = p13.Scroller.CanvasSize + UDim2.new(0, 0, 0, l__BaseFrame__26.Size.Y.Offset)
		if p15 then
			p13.Scroller.CanvasPosition =
				Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y))
		end
		return
	end
	p13.Scroller.CanvasPosition =
		Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y))
end
function v8.ReorderAllMessages(p16)
	p16:WaitUntilParentedCorrectly()
	if p16.GuiObject.AbsoluteSize.Y < 1 then
		return
	end
	p16.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0)
	for v30, v31 in pairs(p16.MessageObjectLog) do
		p16:PositionMessageLabelInWindow(v31)
	end
	if not p16:IsScrolledDown() then
		p16.Scroller.CanvasPosition = p16.Scroller.CanvasPosition
	end
end
function v8.Clear(p17)
	for v32, v33 in pairs(p17.MessageObjectLog) do
		v33:Destroy()
	end
	p17.MessageObjectLog = {}
	if not v5 then
		p17.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0)
	end
end
function v8.SetCurrentChannelName(p18, p19)
	p18.CurrentChannelName = p19
end
function v8.FadeOutBackground(p20, p21) end
function v8.FadeInBackground(p22, p23) end
function v8.FadeOutText(p24, p25)
	for v34 = 1, #p24.MessageObjectLog do
		if p24.MessageObjectLog[v34].FadeOutFunction then
			p24.MessageObjectLog[v34].FadeOutFunction(p25, v3)
		end
	end
end
function v8.FadeInText(p26, p27)
	for v35 = 1, #p26.MessageObjectLog do
		if p26.MessageObjectLog[v35].FadeInFunction then
			p26.MessageObjectLog[v35].FadeInFunction(p27, v3)
		end
	end
end
function v8.Update(p28, p29)
	for v36 = 1, #p28.MessageObjectLog do
		if p28.MessageObjectLog[v36].UpdateAnimFunction then
			p28.MessageObjectLog[v36].UpdateAnimFunction(p29, v3)
		end
	end
end
function v8.WaitUntilParentedCorrectly(p30)
	while not p30.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
		p30.GuiObject.AncestryChanged:wait()
	end
end
local function u3()
	local v37 = Instance.new("Frame")
	v37.Selectable = false
	v37.Size = UDim2.new(1, 0, 1, 0)
	v37.BackgroundTransparency = 1
	local v38 = Instance.new("ScrollingFrame")
	v38.Selectable = v4.GamepadNavigationEnabled
	v38.Name = "Scroller"
	v38.BackgroundTransparency = 1
	v38.BorderSizePixel = 0
	v38.Position = UDim2.new(0, 0, 0, 3)
	v38.Size = UDim2.new(1, -4, 1, -6)
	v38.CanvasSize = UDim2.new(0, 0, 0, 0)
	v38.ScrollBarThickness = u1.ScrollBarThickness
	v38.Active = false
	v38.Parent = v37
	local v39 = nil
	if v5 then
		v39 = Instance.new("UIListLayout")
		v39.SortOrder = Enum.SortOrder.LayoutOrder
		v39.Parent = v38
	end
	return v37, v38, v39
end
function u1.new()
	local v40 = setmetatable({}, v8)
	v40.Destroyed = false
	local v41, v42, v43 = u3()
	v40.GuiObject = v41
	v40.Scroller = v42
	v40.Layout = v43
	v40.MessageObjectLog = {}
	v40.Name = "MessageLogDisplay"
	v40.GuiObject.Name = "Frame_" .. v40.Name
	v40.CurrentChannelName = ""
	v40.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
		spawn(function()
			v40:ReorderAllMessages()
		end)
	end)
	if v5 then
		local u4 = true
		v40.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
			local l__AbsoluteContentSize__44 = v40.Layout.AbsoluteContentSize
			v40.Scroller.CanvasSize = UDim2.new(0, 0, 0, l__AbsoluteContentSize__44.Y)
			if u4 then
				v40.Scroller.CanvasPosition =
					Vector2.new(0, l__AbsoluteContentSize__44.Y - v40.Scroller.AbsoluteWindowSize.Y)
			end
		end)
		v40.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
			u4 = v40:IsScrolledDown()
		end)
	end
	return v40
end
return u1
