local P=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Y=require(P.Game.Rodux)local z=require(P.Packages.sift)local V={items={};selected=nil}local I=Y.createReducer(V,{SetSelected=function(P,Y)local V=P.selected local I=Y.selected local s=V==I and z.None or I return z.Dictionary.merge(P,{selected=s})end,SetItems=function(P,Y)return z.Dictionary.merge(P,{items=Y.items})end})return I
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Rodux = require(ReplicatedStorage.Game.Rodux)
local Sift = require(ReplicatedStorage.Packages.sift)

local initialState = {
	items = {},
	selected = nil,
}

local reducer = Rodux.createReducer(initialState, {
	SetSelected = function(state, action)
		local currentSelected = state.selected
		local i = action.selected
		local selected = (currentSelected == i) and Sift.None or i
		return Sift.Dictionary.merge(state, {
			selected = selected,
		})
	end,

	SetItems = function(state, action)
		return Sift.Dictionary.merge(state, {
			items = action.items,
		})
	end,
})

return reducer
