// Module ID: 4682 // Function ID: 4683 // Name: serverGuildRoomObjectToClient // Dependencies: [4679, 4683, 4684, 4681, 4680, 2] // Exports: findSeat, serverGuildRoomToClient // Module 4682 (serverGuildRoomObjectToClient) import GuildRoomObjectTypes from "GuildRoomObjectTypes" /* 4680 */; import closure_2 from "resolveCreatingNotes" /* 4679 */; import { GUILD_ROOM_BACKGROUND_CONFIG as closure_3 } from "items" /* 4683 */; require = arg1; function serverGuildRoomObjectToClient(object_type) { if (object_type.object_type === GuildRoomObjectTypes.GuildRoomObjectTypes.PLANT) { let obj = { objectType: null }; obj[0] = tmp(4680).GuildRoomObjectTypes.PLANT; obj = { objectId: null, createdBy: null, updatedAt: null, updatedBy: null }; ({ object_id: obj2[0], created_by: obj2[1] } = object_type); let date; if (null != object_type.updated_at) { const _Date2 = Date; date = new Date(object_type.updated_at); } obj[2] = date; obj[3] = object_type.updated_by; const merged = Object.assign(obj); } else { obj = { objectType: null }; obj[0] = tmp(4680).GuildRoomObjectTypes.NOTE; obj1 = { objectId: null, createdBy: null, updatedAt: null, updatedBy: null }; ({ object_id: obj4[0], created_by: obj4[1] } = object_type); let date1; if (null != object_type.updated_at) { const _Date = Date; date1 = new Date(object_type.updated_at); } obj1[2] = date1; obj1[3] = object_type.updated_by; const merged1 = Object.assign(obj1); ({ content: obj3.content, position: obj3.position } = object_type); } return obj; } let result = require("set").fileFinishedImporting("modules/guild_rooms/GuildRoomUtils.tsx"); export const findSeat = function findSeat(items2, channelId, channelId2) { const _require = channelId; room = room.getRoom(channelId2); let background; if (room != null) { background = room.background; } if (background == null) { background = _require(4684).GuildRoomBackgrounds.DEFAULT; } const seats = table[background].seats; if (null != items2) { if (items2 !== _require(4681).GuildRoomSeats.UNSET) { let found = seats[items2]; } return found; } const values = Object.values(seats); found = values.find((position) => position.position.x === x.x && position.position.y === tmp.y); }; export const serverGuildRoomToClient = function serverGuildRoomToClient(body) { const obj = { roomId: body.room_id, users: users.reduce((set, userId) => { const result = set.set(userId.user_id, { userId: userId.user_id, seat: userId.seat, position: userId.position, statusId: userId.status_id, statusText: userId.status_text }); return set; }, new Map()), background: body.background, objects: null }; users = body.users; const entries = Object.entries(body.objects); const map = new Map(); obj[3] = entries.reduce((set) => { [tmp, arr] = arg1; const result = set.set(+tmp, arr.map(closure_4)); return set; }, new Map()); return obj; };