local X=Roact.PureComponent:extend(script.Name)function X.init(X)X.Active=true X:setState({ShouldWarnAboutHttpService=false;ShouldWarnAboutUpdate=false})fastSpawn(function()local F=X.props.Core.IsVersionOutdated()if X.Active then X:setState({ShouldWarnAboutUpdate=F})end end)fastSpawn(function()local F=X.props.Core local e=F.Mode=="\084\111\111\108"and not F.SyncAPI:Invoke("\073\115\072\116\116\112\083\101\114\118\105\099\101\069\110\097\098\108\101\100")if X.Active then X:setState({ShouldWarnAboutHttpService=e})end end)end function X.willUnmount(X)X.Active=false end function X.render(X)return new("\083\099\114\101\101\110\071\117\105",{},{Container=new("\070\114\097\109\101",{AnchorPoint=Vector2.new(.5,.5);BackgroundTransparency=1,Position=UDim2.new(.5,0,.5,0);Size=UDim2.new(0,300,1,0)},{Layout=new("\085\073\076\105\115\116\076\097\121\111\117\116",{Padding=UDim.new(0,10);FillDirection=Enum.FillDirection.Vertical,HorizontalAlignment=Enum.HorizontalAlignment.Left;VerticalAlignment=Enum.VerticalAlignment.Center;SortOrder=Enum.SortOrder.LayoutOrder});UpdateNotification=(X.state.ShouldWarnAboutUpdate or nil)and new(NotificationDialog,{LayoutOrder=1,ThemeColor=Color3.fromRGB(255,170,0);NoticeText="\084\104\105\115 \118\101\114\115\105\111\110 \111\102 \066\117\105\108\100\105\110\103 \084\111\111\108\115 \105\115 \060\098\062\111\117\116\100\097\116\101\100\046\060\047\098\062",DetailText=X.props.Core.Mode=="\080\108\117\103\105\110"and"\084\111 \117\112\100\097\116\101 \112\108\117\103\105\110\115\044 \103\111 \116\111\n\060\098\062\080\076\085\071\073\078\083\060\047\098\062 \062 \060\098\062\077\097\110\097\103\101 \080\108\117\103\105\110\115\060\047\098\062 \058-\041"or"\079\119\110 \116\104\105\115 \112\108\097\099\101\063 \083\105\109\112\108\121 \060\098\062\114\101\105\110\115\101\114\116\060\047\098\062 \116\104\101 \066\117\105\108\100\105\110\103 \084\111\111\108\115 \109\111\100\101\108\046",OnDismiss=function()X:setState({ShouldWarnAboutUpdate=false})end}),HTTPEnabledNotification=(X.state.ShouldWarnAboutHttpService or nil)and new(NotificationDialog,{LayoutOrder=0;ThemeColor=Color3.fromRGB(255,0,4);NoticeText="\072\084\084\080 \114\101\113\117\101\115\116\115 \109\117\115\116 \098\101 \060\098\062\101\110\097\098\108\101\100\060\047\098\062 \102\111\114 \115\111\109\101 \102\101\097\116\117\114\101\115 \111\102 \066\117\105\108\100\105\110\103 \084\111\111\108\115 \116\111 \119\111\114\107\044 \105\110\099\108\117\100\105\110\103 \101\120\112\111\114\116\105\110\103\046",DetailText="\079\119\110 \116\104\105\115 \112\108\097\099\101\063 \069\100\105\116 \105\116 \105\110 \083\116\117\100\105\111\044 \097\110\100 \116\111\103\103\108\101 \111\110\n\072\079\077\069 \062 \060\098\062\071\097\109\101 \083\101\116\116\105\110\103\115\060\047\098\062 \062 \083\101\099\117\114\105\116\121 \062 \060\098\062\065\108\108\111\119 \072\084\084\080 \082\101\113\117\101\115\116\115\060\047\098\062 \058-\041",OnDismiss=function()X:setState({ShouldWarnAboutHttpService=false})end})})})end return X

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

function Notifications:init()
    self.Active = true
    self:setState({
        ShouldWarnAboutHttpService = false;
        ShouldWarnAboutUpdate = false;
    })

    fastSpawn(function ()
        local IsOutdated = self.props.Core.IsVersionOutdated()
        if self.Active then
            self:setState({
                ShouldWarnAboutUpdate = IsOutdated;
            })
        end
    end)
    fastSpawn(function ()
        local Core = self.props.Core
        local IsHttpServiceDisabled = (Core.Mode == 'Tool') and
            not Core.SyncAPI:Invoke('IsHttpServiceEnabled')
        if self.Active then
            self:setState({
                ShouldWarnAboutHttpService = IsHttpServiceDisabled;
            })
        end
    end)
end

function Notifications:willUnmount()
    self.Active = false
end

function Notifications:render()
    return new('ScreenGui', {}, {
        Container = new('Frame', {
            AnchorPoint = Vector2.new(0.5, 0.5);
            BackgroundTransparency = 1;
            Position = UDim2.new(0.5, 0, 0.5, 0);
            Size = UDim2.new(0, 300, 1, 0);
        }, {
            Layout = new('UIListLayout', {
                Padding = UDim.new(0, 10);
                FillDirection = Enum.FillDirection.Vertical;
                HorizontalAlignment = Enum.HorizontalAlignment.Left;
                VerticalAlignment = Enum.VerticalAlignment.Center;
                SortOrder = Enum.SortOrder.LayoutOrder;
            });
            UpdateNotification = (self.state.ShouldWarnAboutUpdate or nil) and new(NotificationDialog, {
                LayoutOrder = 1;
                ThemeColor = Color3.fromRGB(255, 170, 0);
                NoticeText = 'This version of Building Tools is <b>outdated.</b>';
                DetailText = (self.props.Core.Mode == 'Plugin') and
                    'To update plugins, go to\n<b>PLUGINS</b> > <b>Manage Plugins</b> :-)' or
                    'Own this place? Simply <b>reinsert</b> the Building Tools model.';
                OnDismiss = function ()
                    self:setState({
                        ShouldWarnAboutUpdate = false;
                    })
                end;
            });
            HTTPEnabledNotification = (self.state.ShouldWarnAboutHttpService or nil) and new(NotificationDialog, {
                LayoutOrder = 0;
                ThemeColor = Color3.fromRGB(255, 0, 4);
                NoticeText = 'HTTP requests must be <b>enabled</b> for some features of Building Tools to work, including exporting.';
                DetailText = 'Own this place? Edit it in Studio, and toggle on\nHOME > <b>Game Settings</b> > Security > <b>Allow HTTP Requests</b> :-)';
                OnDismiss = function ()
                    self:setState({
                        ShouldWarnAboutHttpService = false;
                    })
                end;
            });
        });
    })
end

return Notifications
