local C=script.Parent.Parent.Parent local U=C.Parent local Z=require(C.Utility.FrameVisualizer)local b=require(U.Sift)local p=require(U.Roact)local w=p.createElement local m=require(C.App.Flyout.Flyout)local O=require(script.Parent.Window)local M=p.PureComponent:extend(script.Name)function M.render(C)local U=C.props local p=w(O,b.Dictionary.join({AutomaticSize=Enum.AutomaticSize.XY;Size=UDim2.fromOffset(400,200);ContentBackgroundColor="\099\111\108\111\114\115\047\066\097\099\107\103\114\111\117\110\100\047\070\105\108\108\095\067\111\108\111\114\047\076\097\121\101\114\047\068\101\102\097\117\108\116",FooterHeight=U.FooterHeight,TitleBarProps={Icon="\105\109\097\103\101\115\047\114\111\098\108\111\120\047\105\099\111\110\115\047\108\111\103\111\047\115\116\117\100\105\111\108\111\103\111\095\115\109\097\108\108\047\049\120",Text="\087\105\110\100\111\119",ReleaseText="\083\116\111\114\121";OnClose=U.CanClose and print or nil},FooterContents={Label=w("\084\101\120\116\076\097\098\101\108",{BackgroundTransparency=1;Size=UDim2.fromScale(1,1);Text="\096\070\111\111\116\101\114\067\111\110\116\101\110\116\115\096 \103\111\101\115 \104\101\114\101";TextColor3=Color3.new(1,1,1),TextStrokeTransparency=0})}},C.props.Props),{Label=w("\084\101\120\116\076\097\098\101\108",{BackgroundTransparency=1;Size=UDim2.fromScale(1,1);Text="\n\n\n\n\n\n\n\n\n\096\091\082\111\097\099\116\046\067\104\105\108\100\114\101\110\093\096 \103\111\101\115 \104\101\114\101";TextColor3=Color3.new(1,1,1),TextStrokeTransparency=0,ZIndex=2});Flyout=w(m,{AnchorPoint=Vector2.new(.5,0),Position=UDim2.new(.5,0,0,25);RichText=true,Text="\060\098\062\078\111\116\101\058\060\047\098\062\n\087\105\110\100\111\119 \100\114\097\103\103\105\110\103 \119\105\108\108 \110\111\116 \119\111\114\107 \119\104\105\108\101 \105\110\115\105\100\101 \097 \112\108\117\103\105\110 \119\105\100\103\101\116 \119\105\110\100\111\119\046"})})if C.props.Wireframe then return w(Z,{Size=UDim2.new(1,0,1,0)},p)else return p end end return{controls={Wireframe=false;CanClose=true,FooterHeight=80},stories={Window=function(C)return w(M,C.controls)end}}
-- TitleBar: The top bar of a window component

local Winro = script.Parent.Parent.Parent
local Packages = Winro.Parent

local FrameVisualizer = require(Winro.Utility.FrameVisualizer)

local Sift = require(Packages.Sift)
local Roact = require(Packages.Roact)
local new = Roact.createElement

local Flyout = require(Winro.App.Flyout.Flyout)
local Window = require(script.Parent.Window)

local WindowStory = Roact.PureComponent:extend(script.Name)

function WindowStory:render()
	local props = self.props

	local Window = new(Window, Sift.Dictionary.join({
		AutomaticSize = Enum.AutomaticSize.XY,
		Size = UDim2.fromOffset(400, 200),
		ContentBackgroundColor = 'colors/Background/Fill_Color/Layer/Default',
		FooterHeight = props.FooterHeight,
		TitleBarProps = {
			Icon = 'images/roblox/icons/logo/studiologo_small/1x',
			-- BackgroundColor = 'colors/Background/Fill_Color/Layer/Alt',
			Text = 'Window',
			ReleaseText = 'Story',
			OnClose = props.CanClose and print or nil,
		},
		FooterContents = {
			Label = new('TextLabel', {
				BackgroundTransparency = 1,
				Size = UDim2.fromScale(1, 1),
				Text = '`FooterContents` goes here',
				TextColor3 = Color3.new(1, 1, 1),
				TextStrokeTransparency = 0,
			})
		}
	}, self.props.Props), {
		Label = new('TextLabel', {
			BackgroundTransparency = 1,
			Size = UDim2.fromScale(1, 1),
			Text = '\n\n\n\n\n\n\n\n\n`[Roact.Children]` goes here',
			TextColor3 = Color3.new(1, 1, 1),
			TextStrokeTransparency = 0,
			ZIndex = 2,
		}),
		Flyout = new(Flyout, {
			AnchorPoint = Vector2.new(0.5, 0),
			Position = UDim2.new(0.5, 0, 0, 25),
			RichText = true,
			Text = '<b>Note:</b>\nWindow dragging will not work while inside a plugin widget window.'
		}),
	})

	if self.props.Wireframe then
		return new(FrameVisualizer, {
			Size = UDim2.new(1, 0, 1, 0),
		}, Window)
	else
		return Window
	end
end

return {
	controls = {
		Wireframe = false,
		CanClose = true,
		FooterHeight = 80,
	},
	stories = {
		Window = function(props)
			return new(WindowStory, props.controls)
		end
	}
}
