local H=Roact.Component:extend("\067\111\110\102\105\103\117\114\097\116\105\111\110\080\114\111\118\105\100\101\114")function H.init(H)assert(typeof(H.props.config)=="\116\097\098\108\101","\067\111\110\102\105\103\117\114\097\116\105\111\110\067\111\110\116\101\120\116 \114\101\113\117\105\114\101\115 \116\104\101 \096\099\111\110\102\105\103\096 \112\114\111\112 \116\111 \098\101 \097\110 \105\110\115\116\097\110\099\101 \111\102 \067\111\110\102\105\103\117\114\097\116\105\111\110")H.state=H.props.config.getValues()H:_connectUpdateEvent()end function H.render(H)return Roact.createElement(context.Provider,{value=H.state},H.props[Roact.Children])end function H.didMount(H)H:_connectUpdateEvent()end function H.willUnmount(H)if H.changedConn then H.changedConn:Disconnect()H.changedConn=nil end end
--[[
	Wrapper component that provides the ConfigurationContext to the child components.
]]
local ConfigurationProvider = Roact.Component:extend("ConfigurationProvider")
function ConfigurationProvider:init()
	assert(
		typeof(self.props.config) == "table",
		"ConfigurationContext requires the `config` prop to be an instance of Configuration"
	)

	self.state = self.props.config.getValues()
	self:_connectUpdateEvent()
end

function ConfigurationProvider:render()
	return Roact.createElement(context.Provider, {
		value = self.state,
	}, self.props[Roact.Children])
end

function ConfigurationProvider:didMount()
	self:_connectUpdateEvent()
end

function ConfigurationProvider:willUnmount()
	if self.changedConn then
		self.changedConn:Disconnect()
		self.changedConn = nil
	end
end
