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

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