local o=game:GetService("\071\117\105\083\101\114\118\105\099\101")local v=script.Parent.Parent.Parent.Parent.Parent local Y=require(v.Parent.Fusion)local O=require(script.Parent)local R=Y.peek local r={Scope=Y.scoped(Y)}r.IsUnibarOpen=r.Scope:Computed(function(o)return(o(O.CoreGui.TopbarInset)).Min.X>250 end)function r.Start(v)O.CoreGui.TopbarInset:set(o.TopbarInset);(o:GetPropertyChangedSignal("\084\111\112\098\097\114\073\110\115\101\116")):Connect(function()O.CoreGui.TopbarInset:set(o.TopbarInset)end);(o:GetPropertyChangedSignal("\077\101\110\117\073\115\079\112\101\110")):Connect(function()O.CoreGui.RobloxMenuOpen:set(o.MenuIsOpen)end);(v.Scope:Observer(v.IsUnibarOpen)):onChange(function()O.Topbar.Visible:set(not R(r.IsUnibarOpen))if R(r.IsUnibarOpen)then O.Menus.CurrentMenu:set(nil)end end);(v.Scope:Observer(O.CoreGui.RobloxMenuOpen)):onChange(function()O.Topbar.Visible:set(not R(O.CoreGui.RobloxMenuOpen))if R(O.CoreGui.RobloxMenuOpen)then O.Menus.CurrentMenu:set(nil)O.Menus.ItemsMenu.Open:set(false)end end)local function Y()local v=math.clamp(o.PreferredTransparency/4,0,.15)O.CoreGui.PreferredTransparency:set(v)end Y();(o:GetPropertyChangedSignal("\080\114\101\102\101\114\114\101\100\084\114\097\110\115\112\097\114\101\110\099\121")):Connect(function()Y()end)end return r
local GuiService = game:GetService("GuiService")

local Rorooms = script.Parent.Parent.Parent.Parent.Parent
local Fusion = require(Rorooms.Parent.Fusion)
local States = require(script.Parent)
local Peek = Fusion.peek

local CoreGui = {
	Scope = Fusion.scoped(Fusion),
}

CoreGui.IsUnibarOpen = CoreGui.Scope:Computed(function(Use)
	return Use(States.CoreGui.TopbarInset).Min.X > 250
end)

function CoreGui:Start()
	States.CoreGui.TopbarInset:set(GuiService.TopbarInset)

	GuiService:GetPropertyChangedSignal("TopbarInset"):Connect(function()
		States.CoreGui.TopbarInset:set(GuiService.TopbarInset)
	end)

	GuiService:GetPropertyChangedSignal("MenuIsOpen"):Connect(function()
		States.CoreGui.RobloxMenuOpen:set(GuiService.MenuIsOpen)
	end)

	self.Scope:Observer(self.IsUnibarOpen):onChange(function()
		States.Topbar.Visible:set(not Peek(CoreGui.IsUnibarOpen))
		if Peek(CoreGui.IsUnibarOpen) then
			States.Menus.CurrentMenu:set(nil)
		end
	end)

	self.Scope:Observer(States.CoreGui.RobloxMenuOpen):onChange(function()
		States.Topbar.Visible:set(not Peek(States.CoreGui.RobloxMenuOpen))
		if Peek(States.CoreGui.RobloxMenuOpen) then
			States.Menus.CurrentMenu:set(nil)
			States.Menus.ItemsMenu.Open:set(false)
		end
	end)

	local function UpdatePrefferedTransparency()
		local Transparency = math.clamp(GuiService.PreferredTransparency / 4, 0, 0.15)
		States.CoreGui.PreferredTransparency:set(Transparency)
	end

	UpdatePrefferedTransparency()
	GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
		UpdatePrefferedTransparency()
	end)
end

return CoreGui
