return Rodux.createReducer({},{[SetAvailableToSellAssetsFromFetchSellData.name]=function(w,j)local A=j.assetId local H=j.userAssetIdList return Cryo.Dictionary.join(w,{[A]=H})end,[AddAvailableToSellAsset.name]=function(w,j)local A=j.assetId local H=j.userAssetId local G={H}local x=w[A]if x then G=Cryo.List.join(x,G)end return Cryo.Dictionary.join(w,{[A]=G})end;[RemoveAvailableToSellAsset.name]=function(w,j)local A=j.assetId local H=w[A]if not H then return w end local G=Cryo.List.removeValue(H,j.userAssetId)return Cryo.Dictionary.join(w,{[A]=G})end})

return Rodux.createReducer({}, {
	--[[
		action.assetId: string
		action.userAssetIdList: table
	]]
	[SetAvailableToSellAssetsFromFetchSellData.name] = function(state, action)
		local assetId = action.assetId
		local userAssetIdList = action.userAssetIdList

		return Cryo.Dictionary.join(state, {
			[assetId] = userAssetIdList,
		})
	end,

	--[[
		action.assetId: string
		action.userAssetId: string
	]]
	[AddAvailableToSellAsset.name] = function(state, action)
		local assetId = action.assetId
		local userAssetId = action.userAssetId
		local newList = { userAssetId }

		local currentInfo = state[assetId]
		if currentInfo then
			newList = Cryo.List.join(currentInfo, newList)
		end

		return Cryo.Dictionary.join(state, {
			[assetId] = newList,
		})
	end,

	--[[
		action.assetId: string
		action.userAssetId: string
	]]
	[RemoveAvailableToSellAsset.name] = function(state, action)
		local assetId = action.assetId

		local currentInfo = state[assetId]
		if not currentInfo then
			return state
		end

		local newList = Cryo.List.removeValue(currentInfo, action.userAssetId)

		return Cryo.Dictionary.join(state, {
			[assetId] = newList,
		})
	end,
})
