local s=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local D=s:WaitForChild("\108\105\098")local G=s:WaitForChild("\099\111\109\109\111\110")local w=script.Parent local Y=G:WaitForChild("\117\116\105\108")local j=require(Y:WaitForChild("\103\101\116\084\101\120\116\083\105\122\101"))local m=require(G:WaitForChild("\065\099\116\105\111\110\115"))local b=require(G:WaitForChild("\086\101\114\115\105\111\110\073\110\102\111"))local h=require(w:WaitForChild("\083\104\097\100\111\119\101\100\084\101\120\116\076\097\098\101\108"))local O=require(D:WaitForChild("\082\111\097\099\116"))local V=require(D:WaitForChild("\082\111\097\099\116\082\111\100\117\120"))local c=O.Component:extend("\086\101\114\115\105\111\110\076\097\098\101\108")function c.render(s)local D=b:getCurrent()local G=("\086\101\114\115\105\111\110\058 \037\115 \040\037\115\041"):format(D.version,D.date)local w=j(G,Enum.Font.Gotham,24)return O.createElement("\084\101\120\116\066\117\116\116\111\110",{BackgroundTransparency=1;Position=UDim2.new(0,10,1,-10);AnchorPoint=Vector2.new(0,1),Size=UDim2.new(0,w.X,0,w.Y),Text="";[O.Event.MouseButton1Click]=function()s.props.onClick(s.props)end},{O.createElement(h,{BackgroundTransparency=1,Font=Enum.Font.Gotham,TextSize=24,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Bottom;TextColor3=Color3.fromRGB(255,255,255),TextStrokeColor3=Color3.fromRGB(0,0,0);TextStrokeTransparency=0,Text=G;Size=UDim2.new(1,0,1,0)})})end local function v(s)return{onClick=function(D)if D.view=="\099\104\097\110\103\101\108\111\103"then s(m.UI_VIEW_SET(nil))return end s(m.UI_VIEW_SET("\099\104\097\110\103\101\108\111\103"))end}end c=(V.connect(nil,v))(c)return c
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local lib = ReplicatedStorage:WaitForChild("lib")
local common = ReplicatedStorage:WaitForChild("common")
local component = script.Parent
local common_util = common:WaitForChild("util")

local getTextSize = require(common_util:WaitForChild("getTextSize"))

local Actions = require(common:WaitForChild("Actions"))
local VersionInfo = require(common:WaitForChild("VersionInfo"))
local ShadowedTextLabel = require(component:WaitForChild("ShadowedTextLabel"))

local Roact = require(lib:WaitForChild("Roact"))
local RoactRodux = require(lib:WaitForChild("RoactRodux"))

local VersionLabel = Roact.Component:extend("VersionLabel")

function VersionLabel:render()
    local currentVersion = VersionInfo:getCurrent()

    local versionText = ("Version: %s (%s)"):format(currentVersion.version,currentVersion.date)
    local labelSize = getTextSize(versionText,Enum.Font.Gotham,24)

    return Roact.createElement("TextButton", {
        BackgroundTransparency = 1,
        Position = UDim2.new(0,10,1,-10),
        AnchorPoint = Vector2.new(0,1),
        Size = UDim2.new(
            0,labelSize.X,
            0,labelSize.Y),
        Text = "",
        [Roact.Event.MouseButton1Click] = (function()
            self.props.onClick(self.props)
        end)
    },
    {
        Roact.createElement(ShadowedTextLabel, {
            BackgroundTransparency = 1,
            Font = Enum.Font.Gotham,
            TextSize = 24,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Bottom,
            TextColor3 = Color3.fromRGB(255,255,255),
            TextStrokeColor3 = Color3.fromRGB(0,0,0),
            TextStrokeTransparency = 0,
            Text = versionText,
            Size = UDim2.new(1,0,1,0),
        })
    })
end

local function mapDispatchToProps(dispatch)
    return {
        onClick = function(props)
            if props.view == "changelog" then
                dispatch(Actions.UI_VIEW_SET(nil))
                return
            end
            dispatch(Actions.UI_VIEW_SET("changelog"))
        end
    }
end

VersionLabel = RoactRodux.connect(nil,mapDispatchToProps)(VersionLabel)

return VersionLabel