# files

id: cd437c03-6e7b-4f48-8c62-960dd7dfca47
title: state.js
sha: 6acc0775c9f4bcd68e71a7a0c1441cf6e604aaf4acb9edc171b7cca7c9e15bec
createdAt: 2022-03-29 06:26:12.171 +00:00
updatedAt: 2022-03-29 06:26:12.311 +00:00
userId: bbf6c27f-e7f6-42bd-a4d7-2b201390dc37
postId: f2ca3e63-b70b-4d9b-a631-54deb929ec4b
content:
  import * as irc from "./lib/irc.js";
  import Client from "./lib/client.js";

  export const SERVER_BUFFER = "*";

  export const BufferType = {
  	SERVER: "server",
  	CHANNEL: "channel",
  	NICK: "nick",
  };

  export const ServerStatus = Client.Status;

  export const Unread = {
  	NONE: "",
  	MESSAGE: "message",
  	HIGHLIGHT: "highlight",

  	compare(a, b) {
  		const priority = {
  			[Unread.NONE]: 0,
  			[Unread.MESSAGE]: 1,
  			[Unread.HIGHLIGHT]: 2,
  		};
  		return priority[a] - priority[b];
  	},
  	union(a, b) {
  		return (Unread.compare(a, b) > 0) ? a : b;
  	},
  };

  export const ReceiptType = {
  	DELIVERED: "delivered",
  	READ: "read",
  };

  export function getNickURL(nick) {
  	return "irc:///" + encodeURIComponent(nick) + ",isuser";
  }

  export function getChannelURL(channel) {
  	return "irc:///" + encodeURIComponent(channel);
  }

  export function getBufferURL(buf) {
  	switch (buf.type) {
  	case BufferType.SERVER:
  		return "irc:///";
  	case BufferType.CHANNEL:
  		return getChannelURL(buf.name);
  	case BufferType.NICK:
  		return getNickURL(buf.name);
  	}
  	throw new Error("Unknown buffer type: " + buf.type);
  }

  export function getMessageURL(buf, msg) {
  	let bufURL = getBufferURL(buf);
  	if (msg.tags.msgid) {
  		return bufURL + "?msgid=" + encodeURIComponent(msg.tags.msgid);
  	} else {
  		return bufURL + "?timestamp=" + encodeURIComponent(msg.tags.time);
  	}
  }

  export function getServerName(server, bouncerNetwork, isBouncer) {
  	let netName = server.isupport.get("NETWORK");

  	if (bouncerNetwork && bouncerNetwork.name && bouncerNetwork.name !== bouncerNetwork.host) {
  		// User has picked a custom name for the network, use that
  		return bouncerNetwork.name;
  	}

  	if (netName) {
  		// Server has specified a name
  		return netName;
  	}

  	if (bouncerNetwork) {
  		return bouncerNetwork.name || bouncerNetwork.host || "server";
  	} else if (isBouncer) {
  		return "bouncer";
  	} else {
  		return "server";
  	}
  }

  function updateState(state, updater) {
  	let updated;
  	if (typeof updater === "function") {
  		updated = updater(state, state);
  	} else {
  		updated = updater;
  	}
  	if (state === updated || !updated) {
  		return;
  	}
  	return { ...state, ...updated };
  }

  function isServerBuffer(buf) {
  	return buf.type == BufferType.SERVER;
  }

  /* Returns 1 if a should appear after b, -1 if a should appear before b, or
   * 0 otherwise. */
  function compareBuffers(a, b) {
  	if (a.server != b.server) {
  		return a.server > b.server ? 1 : -1;
  	}
  	if (isServerBuffer(a) != isServerBuffer(b)) {
  		return isServerBuffer(b) ? 1 : -1;
  	}
  	if (a.name != b.name) {
  		return a.name > b.name ? 1 : -1;
  	}
  	return 0;
  }

  function updateMembership(membership, letter, add, client) {
  	let prefix = client.isupport.get("PREFIX") || "";

  	let prefixPrivs = new Map(irc.parseMembershipModes(prefix).map((membership, i) => {
  		return [membership.prefix, i];
  	}));

  	if (add) {
  		let i = membership.indexOf(letter);
  		if (i < 0) {
  			membership += letter;
  			membership = Array.from(membership).sort((a, b) => {
  				return prefixPrivs.get(a) - prefixPrivs.get(b);
  			}).join("");
  		}
  	} else {
  		membership = membership.replace(letter, "");
  	}

  	return membership;
  }

  /* Insert a message in an immutable list of sorted messages. */
  function insertMessage(list, msg) {
  	if (list.length == 0) {
  		return [msg];
  	} else if (!irc.findBatchByType(msg, "chathistory") || list[list.length - 1].tags.time <= msg.tags.time) {
  		return list.concat(msg);
  	}

  	let insertBefore = -1;
  	for (let i = 0; i < list.length; i++) {
  		let other = list[i];
  		if (msg.tags.time < other.tags.time) {
  			insertBefore = i;
  			break;
  		}
  	}
  	console.assert(insertBefore >= 0, "");

  	list = [ ...list ];
  	list.splice(insertBefore, 0, msg);
  	return list;
  }

  let lastServerID = 0;
  let lastBufferID = 0;
  let lastMessageKey = 0;

  export const State = {
  	create() {
  		return {
  			servers: new Map(),
  			buffers: new Map(),
  			activeBuffer: null,
  		};
  	},
  	updateServer(state, id, updater) {
  		let server = state.servers.get(id);
  		if (!server) {
  			return;
  		}

  		let updated = updateState(server, updater);
  		if (!updated) {
  			return;
  		}

  		let servers = new Map(state.servers);
  		servers.set(id, updated);
  		return { servers };
  	},
  	updateBuffer(state, id, updater) {
  		let buf = State.getBuffer(state, id);
  		if (!buf) {
  			return;
  		}

  		let updated = updateState(buf, updater);
  		if (!updated) {
  			return;
  		}

  		let buffers = new Map(state.buffers);
  		buffers.set(buf.id, updated);
  		return { buffers };
  	},
  	getActiveServerID(state) {
  		let buf = state.buffers.get(state.activeBuffer);
  		if (!buf) {
  			return null;
  		}
  		return buf.server;
  	},
  	getBuffer(state, id) {
  		switch (typeof id) {
  		case "number":
  			return state.buffers.get(id);
  		case "object":
  			if (id.id) {
  				return state.buffers.get(id.id);
  			}

  			let serverID = id.server, name = id.name;
  			if (!serverID) {
  				serverID = State.getActiveServerID(state);
  			}
  			if (!name) {
  				name = SERVER_BUFFER;
  			}

  			let cm = irc.CaseMapping.RFC1459;
  			let server = state.servers.get(serverID);
  			if (server) {
  				cm = irc.CaseMapping.byName(server.isupport.get("CASEMAPPING")) || cm;
  			}

  			let nameCM = cm(name);
  			for (let buf of state.buffers.values()) {
  				if (buf.server === serverID && cm(buf.name) === nameCM) {
  					return buf;
  				}
  			}
  			return null;
  		default:
  			throw new Error("Invalid buffer ID type: " + (typeof id));
  		}
  	},
  	createServer(state) {
  		lastServerID++;
  		let id = lastServerID;

  		let servers = new Map(state.servers);
  		servers.set(id, {
  			id,
  			status: ServerStatus.DISCONNECTED,
  			isupport: new Map(),
  			users: new irc.CaseMapMap(null, irc.CaseMapping.RFC1459),
  		});
  		return [id, { servers }];
  	},
  	createBuffer(state, name, serverID, client) {
  		let buf = State.getBuffer(state, { server: serverID, name });
  		if (buf) {
  			return [buf.id, null];
  		}

  		lastBufferID++;
  		let id = lastBufferID;

  		let type;
  		if (name == SERVER_BUFFER) {
  			type = BufferType.SERVER;
  		} else if (client.isChannel(name)) {
  			type = BufferType.CHANNEL;
  		} else {
  			type = BufferType.NICK;
  		}

  		let bufferList = Array.from(state.buffers.values());
  		bufferList.push({
  			id,
  			name,
  			type,
  			server: serverID,
  			serverInfo: null, // if server
  			joined: false, // if channel
  			topic: null, // if channel
  			members: new irc.CaseMapMap(null, client.cm), // if channel
  			messages: [],
  			unread: Unread.NONE,
  			prevReadReceipt: null,
  		});
  		bufferList = bufferList.sort(compareBuffers);
  		let buffers = new Map(bufferList.map((buf) => [buf.id, buf]));
  		return [id, { buffers }];
  	},
  	handleMessage(state, msg, serverID, client) {
  		function updateServer(updater) {
  			return State.updateServer(state, serverID, updater);
  		}
  		function updateBuffer(name, updater) {
  			return State.updateBuffer(state, { server: serverID, name }, updater);
  		}
  		function updateUser(name, updater) {
  			return updateServer((server) => {
  				let users = new irc.CaseMapMap(server.users);
  				let updated = updateState(users.get(name), updater);
  				if (!updated) {
  					return;
  				}
  				users.set(name, updated);
  				return { users };
  			});
  		}

  		// Don't update our internal state if it's a chat history message
  		if (irc.findBatchByType(msg, "chathistory")) {
  			return;
  		}

  		let target, channel, topic, targets, who, update, buffers;
  		switch (msg.command) {
  		case irc.RPL_MYINFO:
  			// TODO: parse available modes
  			let serverInfo = {
  				name: msg.params[1],
  				version: msg.params[2],
  			};
  			return updateBuffer(SERVER_BUFFER, { serverInfo });
  		case irc.RPL_ISUPPORT:
  			buffers = new Map(state.buffers);
  			state.buffers.forEach((buf) => {
  				if (buf.server != serverID) {
  					return;
  				}
  				let members = new irc.CaseMapMap(buf.members, client.cm);
  				buffers.set(buf.id, { ...buf, members });
  			});
  			return {
  				buffers,
  				...updateServer((server) => {
  					return {
  						isupport: new Map(client.isupport),
  						users: new irc.CaseMapMap(server.users, client.cm),
  					};
  				}),
  			};
  		case irc.RPL_NOTOPIC:
  			channel = msg.params[1];
  			return updateBuffer(channel, { topic: null });
  		case irc.RPL_TOPIC:
  			channel = msg.params[1];
  			topic = msg.params[2];
  			return updateBuffer(channel, { topic });
  		case irc.RPL_TOPICWHOTIME:
  			// Ignore
  			break;
  		case irc.RPL_ENDOFNAMES:
  			channel = msg.params[1];
  			return updateBuffer(channel, (buf) => {
  				let members = new irc.CaseMapMap(null, buf.members.caseMap);
  				msg.list.forEach((namreply) => {
  					let membersList = namreply.params[3].split(" ");
  					membersList.forEach((s) => {
  						let member = irc.parseTargetPrefix(s);
  						members.set(member.name, member.prefix);
  					});
  				});
  				return { members };
  			});
  			break;
  		case irc.RPL_WHOREPLY:
  		case irc.RPL_WHOSPCRPL:
  			who = client.parseWhoReply(msg);

  			if (who.flags !== undefined) {
  				who.away = who.flags.indexOf("G") >= 0; // H for here, G for gone
  				who.operator = who.flags.indexOf("*") >= 0;
  				delete who.flags;
  			}

  			who.offline = false;

  			return updateUser(who.nick, who);
  		case irc.RPL_ENDOFWHO:
  			target = msg.params[1];
  			if (msg.list.length == 0 && !client.isChannel(target) && target.indexOf("*") < 0) {
  				// Not a channel nor a mask, likely a nick
  				return updateUser(target, (user) => {
  					return { offline: true };
  				});
  			}
  			break;
  		case "JOIN":
  			channel = msg.params[0];

  			if (client.isMyNick(msg.prefix.name)) {
  				let [id, update] = State.createBuffer(state, channel, serverID, client);
  				state = { ...state, ...update };
  			}

  			update = updateBuffer(channel, (buf) => {
  				let members = new irc.CaseMapMap(buf.members);
  				members.set(msg.prefix.name, "");

  				let joined = buf.joined || client.isMyNick(msg.prefix.name);

  				return { members, joined };
  			});
  			state = { ...state, ...update };

  			who = { nick: msg.prefix.name, offline: false };
  			if (msg.prefix.user) {
  				who.username = msg.prefix.user;
  			}
  			if (msg.prefix.host) {
  				who.hostname = msg.prefix.host;
  			}
  			if (msg.params.length > 2) {
  				who.account = msg.params[1];
  				if (who.account === "*") {
  					who.account = null;
  				}
  				who.realname = msg.params[2];
  			}
  			update = updateUser(msg.prefix.name, who);
  			state = { ...state, ...update };

  			return state;
  		case "PART":
  			channel = msg.params[0];

  			return updateBuffer(channel, (buf) => {
  				let members = new irc.CaseMapMap(buf.members);
  				members.delete(msg.prefix.name);

  				let joined = buf.joined && !client.isMyNick(msg.prefix.name);

  				return { members, joined };
  			});
  		case "KICK":
  			channel = msg.params[0];
  			let nick = msg.params[1];

  			return updateBuffer(channel, (buf) => {
  				let members = new irc.CaseMapMap(buf.members);
  				members.delete(nick);
  				return { members };
  			});
  		case "QUIT":
  			buffers = new Map(state.buffers);
  			state.buffers.forEach((buf) => {
  				if (buf.server != serverID) {
  					return;
  				}
  				if (!buf.members.has(msg.prefix.name)) {
  					return;
  				}
  				let members = new irc.CaseMapMap(buf.members);
  				members.delete(msg.prefix.name);
  				buffers.set(buf.id, { ...buf, members });
  			});
  			state = { ...state, buffers };

  			update = updateUser(msg.prefix.name, (user) => {
  				if (!user) {
  					return;
  				}
  				return { offline: true };
  			});
  			state = { ...state, ...update };

  			return state;
  		case "NICK":
  			let newNick = msg.params[0];

  			buffers = new Map(state.buffers);
  			state.buffers.forEach((buf) => {
  				if (buf.server != serverID) {
  					return;
  				}
  				if (!buf.members.has(msg.prefix.name)) {
  					return;
  				}
  				let members = new irc.CaseMapMap(buf.members);
  				members.set(newNick, members.get(msg.prefix.name));
  				members.delete(msg.prefix.name);
  				buffers.set(buf.id, { ...buf, members });
  			});
  			state = { ...state, buffers };

  			update = updateServer((server) => {
  				let users = new irc.CaseMapMap(server.users);
  				let user = users.get(msg.prefix.name);
  				if (!user) {
  					return;
  				}
  				users.set(newNick, user);
  				users.delete(msg.prefix.name);
  				return { users };
  			});
  			state = { ...state, ...update };

  			return state;
  		case "SETNAME":
  			return updateUser(msg.prefix.name, { realname: msg.params[0] });
  		case "CHGHOST":
  			return updateUser(msg.prefix.name, {
  				username: msg.params[0],
  				hostname: msg.params[1],
  			});
  		case "ACCOUNT":
  			let account = msg.params[0];
  			if (account === "*") {
  				account = null;
  			}
  			return updateUser(msg.prefix.name, { account });
  		case "AWAY":
  			let awayMessage = msg.params[0];
  			return updateUser(msg.prefix.name, { away: !!awayMessage });
  		case "TOPIC":
  			channel = msg.params[0];
  			topic = msg.params[1];
  			return updateBuffer(channel, { topic });
  		case "MODE":
  			target = msg.params[0];

  			if (!client.isChannel(target)) {
  				return; // TODO: handle user mode changes too
  			}

  			let prefix = client.isupport.get("PREFIX") || "";
  			let prefixByMode = new Map(irc.parseMembershipModes(prefix).map((membership) => {
  				return [membership.mode, membership.prefix];
  			}));

  			return updateBuffer(target, (buf) => {
  				let members = new irc.CaseMapMap(buf.members);

  				irc.forEachChannelModeUpdate(msg, client.isupport, (mode, add, arg) => {
  					if (prefixByMode.has(mode)) {
  						let nick = arg;
  						let membership = members.get(nick);
  						let letter = prefixByMode.get(mode);
  						members.set(nick, updateMembership(membership, letter, add, client));
  					}
  				});

  				return { members };
  			});
  		case irc.RPL_MONONLINE:
  			targets = msg.params[1].split(",");

  			for (let target of targets) {
  				let prefix = irc.parsePrefix(target);
  				let update = updateUser(prefix.name, { offline: false });
  				state = { ...state, ...update };
  			}

  			return state;
  		case irc.RPL_MONOFFLINE:
  			targets = msg.params[1].split(",");

  			for (let target of targets) {
  				let prefix = irc.parsePrefix(target);
  				let update = updateUser(prefix.name, { offline: true });
  				state = { ...state, ...update };
  			}

  			return state;
  		}
  	},
  	addMessage(state, msg, bufID) {
  		lastMessageKey++;
  		msg.key = lastMessageKey;

  		return State.updateBuffer(state, bufID, (buf) => {
  			let messages = insertMessage(buf.messages, msg);
  			return { messages };
  		});
  	},
  };

html:
  <pre><code class="prism-code language-js"><div class="token-line"><span class="token keyword module">import</span><span class="token plain"> </span><span class="token imports operator">*</span><span class="token imports"> </span><span class="token imports keyword module">as</span><span class="token imports"> irc</span><span class="token plain"> </span><span class="token keyword module">from</span><span class="token plain"> </span><span class="token string">&quot;./lib/irc.js&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">import</span><span class="token plain"> </span><span class="token imports maybe-class-name">Client</span><span class="token plain"> </span><span class="token keyword module">from</span><span class="token plain"> </span><span class="token string">&quot;./lib/client.js&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token constant">SERVER_BUFFER</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string">&quot;*&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">SERVER</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;server&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">CHANNEL</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;channel&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">NICK</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;nick&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token maybe-class-name">ServerStatus</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">Client</span><span class="token punctuation">.</span><span class="token property-access maybe-class-name">Status</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token maybe-class-name">Unread</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">NONE</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">MESSAGE</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;message&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">HIGHLIGHT</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;highlight&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token function">compare</span><span class="token punctuation">(</span><span class="token parameter">a</span><span class="token parameter punctuation">,</span><span class="token parameter"> b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">const</span><span class="token plain"> priority </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">[</span><span class="token maybe-class-name">Unread</span><span class="token punctuation">.</span><span class="token constant">NONE</span><span class="token punctuation">]</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">[</span><span class="token maybe-class-name">Unread</span><span class="token punctuation">.</span><span class="token constant">MESSAGE</span><span class="token punctuation">]</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">[</span><span class="token maybe-class-name">Unread</span><span class="token punctuation">.</span><span class="token constant">HIGHLIGHT</span><span class="token punctuation">]</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> priority</span><span class="token punctuation">[</span><span class="token plain">a</span><span class="token punctuation">]</span><span class="token plain"> </span><span class="token operator">-</span><span class="token plain"> priority</span><span class="token punctuation">[</span><span class="token plain">b</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">union</span><span class="token punctuation">(</span><span class="token parameter">a</span><span class="token parameter punctuation">,</span><span class="token parameter"> b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token maybe-class-name">Unread</span><span class="token punctuation">.</span><span class="token method function property-access">compare</span><span class="token punctuation">(</span><span class="token plain">a</span><span class="token punctuation">,</span><span class="token plain"> b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">&gt;</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">?</span><span class="token plain"> a </span><span class="token operator">:</span><span class="token plain"> b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token maybe-class-name">ReceiptType</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">DELIVERED</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;delivered&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token constant">READ</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string">&quot;read&quot;</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">getNickURL</span><span class="token punctuation">(</span><span class="token parameter">nick</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token string">&quot;irc:///&quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token function">encodeURIComponent</span><span class="token punctuation">(</span><span class="token plain">nick</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token string">&quot;,isuser&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">getChannelURL</span><span class="token punctuation">(</span><span class="token parameter">channel</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token string">&quot;irc:///&quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token function">encodeURIComponent</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">getBufferURL</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">switch</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">type</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">SERVER</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token string">&quot;irc:///&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">CHANNEL</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">getChannelURL</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">NICK</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">getNickURL</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">throw</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Error</span><span class="token punctuation">(</span><span class="token string">&quot;Unknown buffer type: &quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">type</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">getMessageURL</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token parameter punctuation">,</span><span class="token parameter"> msg</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> bufURL </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">getBufferURL</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">msgid</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> bufURL </span><span class="token operator">+</span><span class="token plain"> </span><span class="token string">&quot;?msgid=&quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token function">encodeURIComponent</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">msgid</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> bufURL </span><span class="token operator">+</span><span class="token plain"> </span><span class="token string">&quot;?timestamp=&quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token function">encodeURIComponent</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">time</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">getServerName</span><span class="token punctuation">(</span><span class="token parameter">server</span><span class="token parameter punctuation">,</span><span class="token parameter"> bouncerNetwork</span><span class="token parameter punctuation">,</span><span class="token parameter"> isBouncer</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> netName </span><span class="token operator">=</span><span class="token plain"> server</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token string">&quot;NETWORK&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">bouncerNetwork </span><span class="token operator">&amp;&amp;</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">&amp;&amp;</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">!==</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">host</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token comment">// User has picked a custom name for the network, use that</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">netName</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token comment">// Server has specified a name</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> netName</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">bouncerNetwork</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> bouncerNetwork</span><span class="token punctuation">.</span><span class="token property-access">host</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> </span><span class="token string">&quot;server&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">isBouncer</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token string">&quot;bouncer&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token string">&quot;server&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">updateState</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> updated</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">typeof</span><span class="token plain"> updater </span><span class="token operator">===</span><span class="token plain"> </span><span class="token string">&quot;function&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        updated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updater</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> state</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        updated </span><span class="token operator">=</span><span class="token plain"> updater</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">state </span><span class="token operator">===</span><span class="token plain"> updated </span><span class="token operator">||</span><span class="token plain"> </span><span class="token operator">!</span><span class="token plain">updated</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">updated </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">isServerBuffer</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">type</span><span class="token plain"> </span><span class="token operator">==</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">SERVER</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token comment">/* Returns 1 if a should appear after b, -1 if a should appear before b, or</span></div><div class="token-line"><span class="token comment"> * 0 otherwise. */</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">compareBuffers</span><span class="token punctuation">(</span><span class="token parameter">a</span><span class="token parameter punctuation">,</span><span class="token parameter"> b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">a</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> b</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> a</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">&gt;</span><span class="token plain"> b</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">?</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token function">isServerBuffer</span><span class="token punctuation">(</span><span class="token plain">a</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token function">isServerBuffer</span><span class="token punctuation">(</span><span class="token plain">b</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">isServerBuffer</span><span class="token punctuation">(</span><span class="token plain">b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">?</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">a</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> b</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> a</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">&gt;</span><span class="token plain"> b</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator">?</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">updateMembership</span><span class="token punctuation">(</span><span class="token parameter">membership</span><span class="token parameter punctuation">,</span><span class="token parameter"> letter</span><span class="token parameter punctuation">,</span><span class="token parameter"> add</span><span class="token parameter punctuation">,</span><span class="token parameter"> client</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> prefix </span><span class="token operator">=</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token string">&quot;PREFIX&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> prefixPrivs </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">irc</span><span class="token punctuation">.</span><span class="token method function property-access">parseMembershipModes</span><span class="token punctuation">(</span><span class="token plain">prefix</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">membership</span><span class="token parameter punctuation">,</span><span class="token parameter"> i</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">membership</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">,</span><span class="token plain"> i</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">add</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> i </span><span class="token operator">=</span><span class="token plain"> membership</span><span class="token punctuation">.</span><span class="token method function property-access">indexOf</span><span class="token punctuation">(</span><span class="token plain">letter</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">i </span><span class="token operator">&lt;</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            membership </span><span class="token operator">+=</span><span class="token plain"> letter</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            membership </span><span class="token operator">=</span><span class="token plain"> </span><span class="token known-class-name class-name">Array</span><span class="token punctuation">.</span><span class="token keyword module">from</span><span class="token punctuation">(</span><span class="token plain">membership</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">sort</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">a</span><span class="token parameter punctuation">,</span><span class="token parameter"> b</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> prefixPrivs</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">a</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">-</span><span class="token plain"> prefixPrivs</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">b</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">join</span><span class="token punctuation">(</span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        membership </span><span class="token operator">=</span><span class="token plain"> membership</span><span class="token punctuation">.</span><span class="token method function property-access">replace</span><span class="token punctuation">(</span><span class="token plain">letter</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> membership</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token comment">/* Insert a message in an immutable list of sorted messages. */</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">insertMessage</span><span class="token punctuation">(</span><span class="token parameter">list</span><span class="token parameter punctuation">,</span><span class="token parameter"> msg</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">list</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token plain"> </span><span class="token operator">==</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">msg</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">irc</span><span class="token punctuation">.</span><span class="token method function property-access">findBatchByType</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token string">&quot;chathistory&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> list</span><span class="token punctuation">[</span><span class="token plain">list</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token plain"> </span><span class="token operator">-</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">time</span><span class="token plain"> </span><span class="token operator">&lt;=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">time</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> list</span><span class="token punctuation">.</span><span class="token method function property-access">concat</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword">let</span><span class="token plain"> insertBefore </span><span class="token operator">=</span><span class="token plain"> </span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">for</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">let</span><span class="token plain"> i </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"> i </span><span class="token operator">&lt;</span><span class="token plain"> list</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token punctuation">;</span><span class="token plain"> i</span><span class="token operator">++</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> other </span><span class="token operator">=</span><span class="token plain"> list</span><span class="token punctuation">[</span><span class="token plain">i</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">time</span><span class="token plain"> </span><span class="token operator">&lt;</span><span class="token plain"> other</span><span class="token punctuation">.</span><span class="token property-access">tags</span><span class="token punctuation">.</span><span class="token property-access">time</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            insertBefore </span><span class="token operator">=</span><span class="token plain"> i</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">break</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">assert</span><span class="token punctuation">(</span><span class="token plain">insertBefore </span><span class="token operator">&gt;=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    list </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">list </span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    list</span><span class="token punctuation">.</span><span class="token method function property-access">splice</span><span class="token punctuation">(</span><span class="token plain">insertBefore</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">,</span><span class="token plain"> msg</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token keyword control-flow">return</span><span class="token plain"> list</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">let</span><span class="token plain"> lastServerID </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">let</span><span class="token plain"> lastBufferID </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token keyword">let</span><span class="token plain"> lastMessageKey </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token keyword module">export</span><span class="token plain"> </span><span class="token keyword">const</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">servers</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">buffers</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">activeBuffer</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">updateServer</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> id</span><span class="token parameter punctuation">,</span><span class="token parameter"> updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> server </span><span class="token operator">=</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">servers</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> updated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateState</span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">,</span><span class="token plain"> updater</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">updated</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> servers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">servers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        servers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">,</span><span class="token plain"> updated</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> servers </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> id</span><span class="token parameter punctuation">,</span><span class="token parameter"> updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> buf </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">getBuffer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> id</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> updated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateState</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">,</span><span class="token plain"> updater</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">updated</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> buffers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        buffers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> updated</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> buffers </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">getActiveServerID</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> buf </span><span class="token operator">=</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">activeBuffer</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">getBuffer</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> id</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">switch</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">typeof</span><span class="token plain"> id</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;number&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;object&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> serverID </span><span class="token operator">=</span><span class="token plain"> id</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token punctuation">,</span><span class="token plain"> name </span><span class="token operator">=</span><span class="token plain"> id</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">serverID</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                serverID </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">getActiveServerID</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">name</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                name </span><span class="token operator">=</span><span class="token plain"> </span><span class="token constant">SERVER_BUFFER</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> cm </span><span class="token operator">=</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token property-access maybe-class-name">CaseMapping</span><span class="token punctuation">.</span><span class="token constant">RFC1459</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> server </span><span class="token operator">=</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">servers</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">serverID</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                cm </span><span class="token operator">=</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token property-access maybe-class-name">CaseMapping</span><span class="token punctuation">.</span><span class="token method function property-access">byName</span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token string">&quot;CASEMAPPING&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> cm</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> nameCM </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">cm</span><span class="token punctuation">(</span><span class="token plain">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">for</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">let</span><span class="token plain"> buf </span><span class="token keyword">of</span><span class="token plain"> state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">values</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">===</span><span class="token plain"> serverID </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token function">cm</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">===</span><span class="token plain"> nameCM</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token plain"> buf</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword module">default</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">throw</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Error</span><span class="token punctuation">(</span><span class="token string">&quot;Invalid buffer ID type: &quot;</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">typeof</span><span class="token plain"> id</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">createServer</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        lastServerID</span><span class="token operator">++</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> id </span><span class="token operator">=</span><span class="token plain"> lastServerID</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> servers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">servers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        servers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            id</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">status</span><span class="token operator">:</span><span class="token plain"> </span><span class="token maybe-class-name">ServerStatus</span><span class="token punctuation">.</span><span class="token constant">DISCONNECTED</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">isupport</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">users</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token property-access maybe-class-name">CaseMapping</span><span class="token punctuation">.</span><span class="token constant">RFC1459</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> servers </span><span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">createBuffer</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> name</span><span class="token parameter punctuation">,</span><span class="token parameter"> serverID</span><span class="token parameter punctuation">,</span><span class="token parameter"> client</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> buf </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">getBuffer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">server</span><span class="token operator">:</span><span class="token plain"> serverID</span><span class="token punctuation">,</span><span class="token plain"> name </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        lastBufferID</span><span class="token operator">++</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> id </span><span class="token operator">=</span><span class="token plain"> lastBufferID</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> type</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">name </span><span class="token operator">==</span><span class="token plain"> </span><span class="token constant">SERVER_BUFFER</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">SERVER</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token method function property-access">isChannel</span><span class="token punctuation">(</span><span class="token plain">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">CHANNEL</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"> </span><span class="token keyword control-flow">else</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">BufferType</span><span class="token punctuation">.</span><span class="token constant">NICK</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> bufferList </span><span class="token operator">=</span><span class="token plain"> </span><span class="token known-class-name class-name">Array</span><span class="token punctuation">.</span><span class="token keyword module">from</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">values</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        bufferList</span><span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            id</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            name</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            type</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">server</span><span class="token operator">:</span><span class="token plain"> serverID</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">serverInfo</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token comment">// if server</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">joined</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token comment">// if channel</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">topic</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token comment">// if channel</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">members</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">cm</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token comment">// if channel</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">messages</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">unread</span><span class="token operator">:</span><span class="token plain"> </span><span class="token maybe-class-name">Unread</span><span class="token punctuation">.</span><span class="token constant">NONE</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token literal-property property">prevReadReceipt</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        bufferList </span><span class="token operator">=</span><span class="token plain"> bufferList</span><span class="token punctuation">.</span><span class="token method function property-access">sort</span><span class="token punctuation">(</span><span class="token plain">compareBuffers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> buffers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">bufferList</span><span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> buf</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> buffers </span><span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">handleMessage</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> msg</span><span class="token parameter punctuation">,</span><span class="token parameter"> serverID</span><span class="token parameter punctuation">,</span><span class="token parameter"> client</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">updateServer</span><span class="token punctuation">(</span><span class="token parameter">updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">updateServer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> serverID</span><span class="token punctuation">,</span><span class="token plain"> updater</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token parameter">name</span><span class="token parameter punctuation">,</span><span class="token parameter"> updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">server</span><span class="token operator">:</span><span class="token plain"> serverID</span><span class="token punctuation">,</span><span class="token plain"> name </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"> updater</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">function</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token parameter">name</span><span class="token parameter punctuation">,</span><span class="token parameter"> updater</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateServer</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> users </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">.</span><span class="token property-access">users</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> updated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateState</span><span class="token punctuation">(</span><span class="token plain">users</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">name</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"> updater</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">updated</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                users</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">name</span><span class="token punctuation">,</span><span class="token plain"> updated</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> users </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token comment">// Don&#x27;t update our internal state if it&#x27;s a chat history message</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">irc</span><span class="token punctuation">.</span><span class="token method function property-access">findBatchByType</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token string">&quot;chathistory&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">let</span><span class="token plain"> target</span><span class="token punctuation">,</span><span class="token plain"> channel</span><span class="token punctuation">,</span><span class="token plain"> topic</span><span class="token punctuation">,</span><span class="token plain"> targets</span><span class="token punctuation">,</span><span class="token plain"> who</span><span class="token punctuation">,</span><span class="token plain"> update</span><span class="token punctuation">,</span><span class="token plain"> buffers</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">switch</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">command</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_MYINFO</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token comment">// TODO: parse available modes</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> serverInfo </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token literal-property property">name</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token literal-property property">version</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token constant">SERVER_BUFFER</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> serverInfo </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_ISUPPORT</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            buffers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> serverID</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">cm</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                buffers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">buf</span><span class="token punctuation">,</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                buffers</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token spread operator">...</span><span class="token method function property-access">updateServer</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token literal-property property">isupport</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token literal-property property">users</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">.</span><span class="token property-access">users</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">cm</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_NOTOPIC</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">topic</span><span class="token operator">:</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_TOPIC</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            topic </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> topic </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_TOPICWHOTIME</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token comment">// Ignore</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">break</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_ENDOFNAMES</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token keyword null nil">null</span><span class="token punctuation">,</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">.</span><span class="token property-access">caseMap</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                msg</span><span class="token punctuation">.</span><span class="token property-access">list</span><span class="token punctuation">.</span><span class="token method function property-access">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">namreply</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword">let</span><span class="token plain"> membersList </span><span class="token operator">=</span><span class="token plain"> namreply</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token method function property-access">split</span><span class="token punctuation">(</span><span class="token string">&quot; &quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    membersList</span><span class="token punctuation">.</span><span class="token method function property-access">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">s</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token keyword">let</span><span class="token plain"> member </span><span class="token operator">=</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token method function property-access">parseTargetPrefix</span><span class="token punctuation">(</span><span class="token plain">s</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        members</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">member</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> member</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">break</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_WHOREPLY</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_WHOSPCRPL</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            who </span><span class="token operator">=</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token method function property-access">parseWhoReply</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">who</span><span class="token punctuation">.</span><span class="token property-access">flags</span><span class="token plain"> </span><span class="token operator">!==</span><span class="token plain"> </span><span class="token keyword nil">undefined</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">away</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> who</span><span class="token punctuation">.</span><span class="token property-access">flags</span><span class="token punctuation">.</span><span class="token method function property-access">indexOf</span><span class="token punctuation">(</span><span class="token string">&quot;G&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">&gt;=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"> </span><span class="token comment">// H for here, G for gone</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">operator</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> who</span><span class="token punctuation">.</span><span class="token property-access">flags</span><span class="token punctuation">.</span><span class="token method function property-access">indexOf</span><span class="token punctuation">(</span><span class="token string">&quot;*&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">&gt;=</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">delete</span><span class="token plain"> who</span><span class="token punctuation">.</span><span class="token property-access">flags</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            who</span><span class="token punctuation">.</span><span class="token property-access">offline</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">who</span><span class="token punctuation">.</span><span class="token property-access">nick</span><span class="token punctuation">,</span><span class="token plain"> who</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_ENDOFWHO</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            target </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">list</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token plain"> </span><span class="token operator">==</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token operator">!</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token method function property-access">isChannel</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">&amp;&amp;</span><span class="token plain"> target</span><span class="token punctuation">.</span><span class="token method function property-access">indexOf</span><span class="token punctuation">(</span><span class="token string">&quot;*&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">&lt;</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token comment">// Not a channel nor a mask, likely a nick</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">user</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">offline</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">break</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;JOIN&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token method function property-access">isMyNick</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">id</span><span class="token punctuation">,</span><span class="token plain"> update</span><span class="token punctuation">]</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">createBuffer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> channel</span><span class="token punctuation">,</span><span class="token plain"> serverID</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> joined </span><span class="token operator">=</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">joined</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token method function property-access">isMyNick</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> members</span><span class="token punctuation">,</span><span class="token plain"> joined </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            who </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">nick</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token literal-property property">offline</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">user</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">username</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">user</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">host</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">hostname</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">host</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">.</span><span class="token property-access">length</span><span class="token plain"> </span><span class="token operator">&gt;</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">account</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">who</span><span class="token punctuation">.</span><span class="token property-access">account</span><span class="token plain"> </span><span class="token operator">===</span><span class="token plain"> </span><span class="token string">&quot;*&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    who</span><span class="token punctuation">.</span><span class="token property-access">account</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                who</span><span class="token punctuation">.</span><span class="token property-access">realname</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> who</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;PART&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> joined </span><span class="token operator">=</span><span class="token plain"> buf</span><span class="token punctuation">.</span><span class="token property-access">joined</span><span class="token plain"> </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token operator">!</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token method function property-access">isMyNick</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> members</span><span class="token punctuation">,</span><span class="token plain"> joined </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;KICK&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> nick </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token plain">nick</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;QUIT&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            buffers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> serverID</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">.</span><span class="token method function property-access">has</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                buffers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">buf</span><span class="token punctuation">,</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> buffers </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">user</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">user</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">offline</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;NICK&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> newNick </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            buffers </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state</span><span class="token punctuation">.</span><span class="token property-access">buffers</span><span class="token punctuation">.</span><span class="token method function property-access">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">server</span><span class="token plain"> </span><span class="token operator">!=</span><span class="token plain"> serverID</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">.</span><span class="token method function property-access">has</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">newNick</span><span class="token punctuation">,</span><span class="token plain"> members</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                members</span><span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                buffers</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">buf</span><span class="token punctuation">,</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> buffers </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateServer</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">server</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> users </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">server</span><span class="token punctuation">.</span><span class="token property-access">users</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> users</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">user</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                users</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">newNick</span><span class="token punctuation">,</span><span class="token plain"> user</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                users</span><span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> users </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;SETNAME&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">realname</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;CHGHOST&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token literal-property property">username</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token literal-property property">hostname</span><span class="token operator">:</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;ACCOUNT&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> account </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">account </span><span class="token operator">===</span><span class="token plain"> </span><span class="token string">&quot;*&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                account </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword null nil">null</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> account </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;AWAY&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> awayMessage </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">away</span><span class="token operator">:</span><span class="token plain"> </span><span class="token operator">!</span><span class="token operator">!</span><span class="token plain">awayMessage </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;TOPIC&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            channel </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            topic </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">channel</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> topic </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> </span><span class="token string">&quot;MODE&quot;</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            target </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token plain">client</span><span class="token punctuation">.</span><span class="token method function property-access">isChannel</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token punctuation">;</span><span class="token plain"> </span><span class="token comment">// TODO: handle user mode changes too</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> prefix </span><span class="token operator">=</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token string">&quot;PREFIX&quot;</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token operator">||</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> prefixByMode </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">Map</span><span class="token punctuation">(</span><span class="token plain">irc</span><span class="token punctuation">.</span><span class="token method function property-access">parseMembershipModes</span><span class="token punctuation">(</span><span class="token plain">prefix</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">membership</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">[</span><span class="token plain">membership</span><span class="token punctuation">.</span><span class="token property-access">mode</span><span class="token punctuation">,</span><span class="token plain"> membership</span><span class="token punctuation">.</span><span class="token property-access">prefix</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token function">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> members </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword">new</span><span class="token plain"> </span><span class="token class-name">irc</span><span class="token class-name punctuation">.</span><span class="token class-name">CaseMapMap</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">members</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                irc</span><span class="token punctuation">.</span><span class="token method function property-access">forEachChannelModeUpdate</span><span class="token punctuation">(</span><span class="token plain">msg</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">.</span><span class="token property-access">isupport</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">mode</span><span class="token parameter punctuation">,</span><span class="token parameter"> add</span><span class="token parameter punctuation">,</span><span class="token parameter"> arg</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token keyword control-flow">if</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token plain">prefixByMode</span><span class="token punctuation">.</span><span class="token method function property-access">has</span><span class="token punctuation">(</span><span class="token plain">mode</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token keyword">let</span><span class="token plain"> nick </span><span class="token operator">=</span><span class="token plain"> arg</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token keyword">let</span><span class="token plain"> membership </span><span class="token operator">=</span><span class="token plain"> members</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">nick</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        </span><span class="token keyword">let</span><span class="token plain"> letter </span><span class="token operator">=</span><span class="token plain"> prefixByMode</span><span class="token punctuation">.</span><span class="token method function property-access">get</span><span class="token punctuation">(</span><span class="token plain">mode</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                        members</span><span class="token punctuation">.</span><span class="token method function property-access">set</span><span class="token punctuation">(</span><span class="token plain">nick</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token function">updateMembership</span><span class="token punctuation">(</span><span class="token plain">membership</span><span class="token punctuation">,</span><span class="token plain"> letter</span><span class="token punctuation">,</span><span class="token plain"> add</span><span class="token punctuation">,</span><span class="token plain"> client</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> members </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_MONONLINE</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            targets </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token method function property-access">split</span><span class="token punctuation">(</span><span class="token string">&quot;,&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">for</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">let</span><span class="token plain"> target </span><span class="token keyword">of</span><span class="token plain"> targets</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> prefix </span><span class="token operator">=</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token method function property-access">parsePrefix</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">offline</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword">case</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token constant">RPL_MONOFFLINE</span><span class="token operator">:</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            targets </span><span class="token operator">=</span><span class="token plain"> msg</span><span class="token punctuation">.</span><span class="token property-access">params</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token method function property-access">split</span><span class="token punctuation">(</span><span class="token string">&quot;,&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">for</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token keyword">let</span><span class="token plain"> target </span><span class="token keyword">of</span><span class="token plain"> targets</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> prefix </span><span class="token operator">=</span><span class="token plain"> irc</span><span class="token punctuation">.</span><span class="token method function property-access">parsePrefix</span><span class="token punctuation">(</span><span class="token plain">target</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                </span><span class="token keyword">let</span><span class="token plain"> update </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">updateUser</span><span class="token punctuation">(</span><span class="token plain">prefix</span><span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token literal-property property">offline</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">                state </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token spread operator">...</span><span class="token plain">update </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> state</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token function">addMessage</span><span class="token punctuation">(</span><span class="token parameter">state</span><span class="token parameter punctuation">,</span><span class="token parameter"> msg</span><span class="token parameter punctuation">,</span><span class="token parameter"> bufID</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        lastMessageKey</span><span class="token operator">++</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        msg</span><span class="token punctuation">.</span><span class="token property-access">key</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> lastMessageKey</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token maybe-class-name">State</span><span class="token punctuation">.</span><span class="token method function property-access">updateBuffer</span><span class="token punctuation">(</span><span class="token plain">state</span><span class="token punctuation">,</span><span class="token plain"> bufID</span><span class="token punctuation">,</span><span class="token plain"> </span><span class="token punctuation">(</span><span class="token parameter">buf</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword">let</span><span class="token plain"> messages </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function">insertMessage</span><span class="token punctuation">(</span><span class="token plain">buf</span><span class="token punctuation">.</span><span class="token property-access">messages</span><span class="token punctuation">,</span><span class="token plain"> msg</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">            </span><span class="token keyword control-flow">return</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"> messages </span><span class="token punctuation">}</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token punctuation">;</span></div></code></pre>


id: eb9cf4b9-f503-46e3-9311-acef059a016a
title: style.css
sha: 612b5bd93228acdff03601057bde45374b1a6ad89a5c3123026ba6365ff2d1c8
createdAt: 2022-03-29 06:26:12.238 +00:00
updatedAt: 2022-03-29 06:26:12.311 +00:00
userId: bbf6c27f-e7f6-42bd-a4d7-2b201390dc37
postId: f2ca3e63-b70b-4d9b-a631-54deb929ec4b
content:
  :root {
  	--main-background: white;
  	--main-color: black;
  	--sidebar-background: #e3e3e3;
  	--expander-background: #b5b5b5;
  	--expander-background-hover: #a6a6a6;
  	--expander-border: #6c6c6c;

  	--button-color: #eff7ef;
  	--button-background: #545499;
  	--button-background-hover: #00007C;
  	--button-border: #e3e3e3;

  	--danger-button-color: #eff7ef;
  	--danger-button-background: #db2626;
  	--danger-button-background-hover: #B20000;
  	--danger-button-border: #e3e3e3;

  	--green: green;
  	--gray: #4a4a4a;
  }

  @media (prefers-color-scheme: dark) {
  	:root {
  		--main-background: #212529;
  		--main-color: #f8f9fa;
  		--sidebar-background: #131618;
  		--expander-background: #424446;
  		--expander-background-hover: #2a2d2f;
  		--button-background: #282879;
  		--button-background-hover: #00007C;
  		--button-border: #131618;
  		--danger-button-background: #B20000;
  		--danger-button-background-hover: red;
  		--danger-button-border: #131618;
  		--green: #53b266;
  		--gray: #979797;

  		--red: #fb615b;
  	}
  }

  html {
  	scrollbar-color: #8e8e8e transparent;
  }

  html, body {
  	height: 100%;
  	padding: 0;
  	margin: 0;
  	overflow: hidden;
  }

  body {
  	display: grid;
  	grid-template-rows: auto 1fr max-content;
  	grid-template-columns: max-content 1fr max-content;
  	font-family: monospace;
  }

  button {
  	background: var(--button-background);
  	transition: background 0.25s linear;
  	color: var(--button-color);
  	padding: 0.25rem 0.5rem;
  	border-style: solid;
  	border-color: var(--button-border);
  	border-width: 1px;
  	font-size: 0.8rem;
  	cursor: pointer;
  }

  button:hover {
  	background: var(--button-background-hover);
  }

  button.danger {
  	background: var(--danger-button-background);
  	color: var(--danger-button-color);
  	border-color: var(--danger-button-border);
  }

  button.danger:hover {
  	background: var(--danger-button-background-hover);
  }

  #buffer, #connect {
  	color: var(--main-color);
  	background: var(--main-background);
  	width: 100%;
  	height: 100%;
  	overflow-x: hidden;
  	overflow-y: auto;
  }

  #buffer-list, #member-list {
  	color: var(--main-color);
  	background: var(--main-background);
  	width: 100%;
  	height: 100%;

  	background-color: var(--sidebar-background);
  	grid-column: 1;
  	grid-row: 1 / 4;

  	display: flex;
  	flex-direction: row;
  }

  .expander {
  	display: none;
  	cursor: pointer;
  	padding: 0;
  	margin: 0;
  	background: var(--expander-background);
  	transition: background 0.2s linear;
  	border: none;
  	width: 10px;
  }

  .expander:hover {
  	background: var(--expander-background-hover);
  }

  .expander span {
  	display: block;
  	width: 100%;
  	height: 2px;
  	margin-bottom: 2px;
  	border-style: solid;
  	border-width: 1px 0;
  	border-color: var(--expander-border);
  }

  #buffer-list ul {
  	list-style-type: none;
  	margin: 0;
  	padding: 0;
  	flex: 1 0 auto;
  	overflow-x: hidden;
  	overflow-y: auto;
  	scrollbar-width: thin;
  }
  #buffer-list li a {
  	display: inline-block;
  	width: 100%;
  	padding: 2px 10px;
  	box-sizing: border-box;
  }
  #buffer-list li.active a {
  	color: white;
  	background-color: var(--gray);
  }
  #buffer-list li.unread-message a {
  	color: #b37400;
  }
  #buffer-list li.unread-highlight a {
  	color: #22009b;
  }
  #buffer-list li:not(.type-server) a {
  	padding-left: 20px;
  }

  #member-list-header {
  	color: var(--main-color);
  	background-color: var(--main-background);
  	box-sizing: border-box;
  	padding: 5px 10px;
  	border-bottom: 1px solid var(--sidebar-background);
  }

  #buffer-header {
  	color: var(--main-color);
  	background-color: var(--main-background);
  	box-sizing: border-box;
  	border-bottom: 1px solid var(--sidebar-background);

  	grid-row: 1;
  	grid-column: 2;

  	display: grid;
  	grid-template-rows: auto auto;
  	grid-template-columns: 1fr auto;
  }

  #buffer-header .title {
  	display: none;
  	padding: 5px 10px;
  	font-weight: bold;
  	grid-row: 1;
  	grid-column: 1;
  }

  #buffer-header .description {
  	padding: 5px 10px;
  	grid-row: 2;
  	grid-column: 1;
  }

  #buffer-header .actions {
  	grid-row: 1 / 3;
  	grid-column: 2;
  }

  #buffer-header .status-here {
  	color: var(--green);
  }
  #buffer-header .status-gone {
  	color: orange;
  }
  #buffer-header .status-offline {
  	color: red;
  }

  .actions {
  	display: flex;
  	flex-direction: row;
  	justify-content: center;
  }

  .actions button {
  	border-width: 0 0 0px 1px;
  }

  #buffer {
  	grid-row: 2;
  	grid-column: 2;
  }

  #buffer:focus {
  	outline: none;
  }

  #member-list {
  	grid-row: 1 / 4;
  	grid-column: 3;
  	width: 100%;
  	height: 100%;
  	display: flex;
  	flex-direction: row;
  }

  #member-list > section {
  	display: flex;
  	flex-direction: column;
  }

  #member-list-header {
  	border-left: 1px solid var(--sidebar-background);
  }

  @media (max-width: 640px) {
  	#buffer-list ul {
  		width: 0px;
  	}

  	#buffer-list.expand {
  		z-index: 999;
  		grid-column: 1 / 4;
  	}

  	#buffer-list.expand ul {
  		width: auto;
  	}
  }

  #member-list ul {
  	list-style-type: none;
  	margin: 0;
  	padding: 0;
  	flex-grow: 1;
  	overflow-x: hidden;
  	overflow-y: auto;
  	scrollbar-width: thin;
  }
  #member-list li a {
  	display: inline-block;
  	width: 100%;
  	padding: 2px 10px;
  	box-sizing: border-box;
  }

  .membership.owner {
  	color: red;
  }
  .membership.admin {
  	color: blue;
  }
  .membership.op {
  	color: var(--green);
  }
  .membership.halfop {
  	color: orange;
  }
  .membership.voice {
  	color: yellow;
  }

  #composer {
  	color: var(--main-color);
  	background: var(--main-background);
  	grid-row: 3;
  	grid-column: 2 / 3;
  	border-top: 1px solid var(--sidebar-background);
  }
  #composer input {
  	display: block;
  	height: 35px;
  	width: 100%;
  	box-sizing: border-box;
  	padding: 10px;
  }
  #composer input, #composer input:focus {
  	border: none;
  	background: none;
  	outline: none;
  }
  #composer.read-only {
  	display: none;
  }

  #connect {
  	position: absolute;
  	top: 0;
  	left: 0;
  	height: 100%;
  }
  #connect form {
  	margin: 0 auto;
  	max-width: 350px;
  	padding: 10px;
  	box-sizing: border-box;
  }

  form input[type="text"],
  form input[type="username"],
  form input[type="password"],
  form input[type="url"],
  form input[type="email"] {
  	box-sizing: border-box;
  	width: 100%;
  }

  a {
  	color: var(--green);
  }
  #buffer-list li a, a.timestamp, a.nick {
  	color: var(--gray);
  	text-decoration: none;
  }
  #buffer-list li a:hover, #buffer-list li a:active,
  a.timestamp:hover, a.timestamp:active,
  a.nick:hover, a.nick:active {
  	text-decoration: underline;
  }

  details summary[role="button"] {
  	user-select: none;
  	cursor: pointer;
  }

  #buffer {
  	box-sizing: border-box;
  	color: var(--gray);
  	word-wrap: break-word;
  }
  #buffer .logline-list {
  	padding: 10px;
  }
  #buffer .logline {
  	white-space: pre-wrap;
  }
  #buffer .talk, #buffer .motd {
  	color: var(--main-color);
  }
  #buffer .error {
  	color: red;
  }
  #buffer .me-tell {
  	color: #b37400;
  }
  #buffer .highlight .nick {
  	color: yellow;
  	background-color: #c700ff;
  }
  #buffer .nick-1 {
  	color: #f25e0d;
  }
  #buffer .nick-2 {
  	color: #e43611;
  }
  #buffer .nick-3 {
  	color: #f98a11;
  }
  #buffer .nick-4 {
  	color: #b4a700;
  }
  #buffer .nick-5 {
  	color: #89bd3b;
  }
  #buffer .nick-6 {
  	color: #4ea847;
  }
  #buffer .nick-7 {
  	color: #287e52;
  }
  #buffer .nick-8 {
  	color: #117873;
  }
  #buffer .nick-9 {
  	color: #0083a7;
  }
  #buffer .nick-10 {
  	color: #2a6596;
  }
  #buffer .nick-11 {
  	color: #385189;
  }
  #buffer .nick-12 {
  	color: #434078;
  }
  #buffer .nick-13 {
  	color: #5e4279;
  }
  #buffer .nick-14 {
  	color: #7a447a;
  }
  #buffer .nick-15 {
  	color: #e92980;
  }
  #buffer .nick-16 {
  	color: #ec273e;
  }

  #buffer .separator {
  	display: flex;
  	align-items: center;
  	text-align: center;
  	text-transform: lowercase;
  	font-variant: small-caps;
  }
  #buffer .separator::before, #buffer .separator::after {
  	content: "";
  	flex: 1;
  	border-bottom: 1px solid transparent;
  }
  #buffer .date-separator {
  	color: #757575;
  }
  #buffer .date-separator::before, #buffer .date-separator::after {
  	border-color: #ddd;
  }
  #buffer .unread-separator {
  	color: #ff3535;
  }
  #buffer .unread-separator::before, #buffer .unread-separator::after {
  	border-color: #ff3535;
  }

  #error-msg {
  	color: white;
  	background-color: red;
  	position: fixed;
  	bottom: 2rem;
  	right: 0;
  	padding: 0.5rem;
  	margin: 0.5rem;
  }

  #error-msg button, .dialog button.dialog-close {
  	border: none;
  	background: transparent;
  	color: inherit;
  	font-size: inherit;
  	padding: 0;
  }

  .error-text {
  	color: red;
  }

  .dialog {
  	position: fixed;
  	top: 0;
  	left: 0;
  	right: 0;
  	bottom: 0;
  	background-color: rgba(0, 0, 0, 0.5);
  	overflow: auto;
  }
  .dialog .dialog-body {
  	background-color: var(--main-background);
  	color: var(--main-color);
  	margin: 20px auto;
  	max-width: 500px;
  	padding: 15px;
  	border: 1px solid rgba(0, 0, 0, 0.6);
  }
  .dialog .dialog-header {
  	display: flex;
  	flex-direction: row;
  	align-items: center;
  	margin-bottom: 1em;
  }
  .dialog .dialog-header h2 {
  	flex-grow: 1;
  	margin: 0;
  }
  .dialog .dialog-header button.dialog-close {
  	font-size: 1.5em;
  	padding: 0 5px;
  }
  .dialog h2 {
  	margin-top: 0;
  }
  .dialog form button:not([type="button"]) {
  	float: right;
  }
  .dialog form {
  	overflow: auto; /* hack to clear floating elements */
  }

  kbd {
  	background-color: #f0f0f0;
  	border: 1px solid #bfbfbf;
  	box-shadow: inset 0 1px 0 0 #fff, inset 0 -2px 0 0 #d9d9d9;
  	display: inline-block;
  	font-size: 80%;
  	margin: 3px;
  	min-width: 1em;
  	text-align: center;
  	white-space: nowrap;
  	padding: 2px 4px;
  	font-family: monospace;
  	border-radius: 3px;
  }

  @media (prefers-color-scheme: dark) {
  	html {
  		scrollbar-color: var(--gray) transparent;
  	}

  	#buffer-list li.active a {
  		color: var(--sidebar-background);
  		background-color: white;
  	}
  	#buffer-list li.unread-message a {
  		color: var(--green);
  	}
  	#buffer-list li.unread-highlight a {
  		color: #0062cc;
  	}

  	#buffer-header .status-gone {
  		color: #fb885b;
  	}
  	#buffer-header .status-offline {
  		color: var(--red);
  	}

  	form input[type="text"],
  	form input[type="username"],
  	form input[type="password"],
  	form input[type="url"],
  	form input[type="email"] {
  		color: #ffffff;
  		background: var(--sidebar-background);
  		border: 1px solid #495057;
  		padding: 0.25rem 0.375rem;
  	}
  	form input[type="text"]:focus,
  	form input[type="username"]:focus,
  	form input[type="password"]:focus,
  	form input[type="url"]:focus,
  	form input[type="email"]:focus {
  		outline: 0;
  		border-color: #3897ff;
  	}

  	#buffer-list li a,
  	a.nick {
  		color: var(--main-color);
  	}

  	#buffer {
  		background: var(--main-background);
  	}
  	#buffer .error {
  		color: var(--red);
  	}
  	#buffer .me-tell {
  		color: #e16b97;
  	}
  	#buffer .highlight .nick {
  		color: #1e0010;
  		background-color: #0062cc;
  	}

  	#buffer .date-separator {
  		color: #757575;
  	}

  	#buffer .date-separator::before,
  	#buffer .date-separator::after {
  		border-color: #373737;
  	}
  	#buffer .unread-separator {
  		color: var(--green);
  	}
  	#buffer .unread-separator::before,
  	#buffer .unread-separator::after {
  		border-color: var(--green);
  	}

  	#error-msg {
  		color: black;
  		background-color: #efa3aa;
  	}

  	#error-msg a {
  		color: black;
  	}

  	.error-text {
  		color: #efa3aa;
  	}

  	#buffer .nick-8 {
  		color: #6bccc7;
  	}
  	#buffer .nick-10 {
  		color: #6296c1;
  	}
  	#buffer .nick-11 {
  		color: #c6b5df;
  	}
  	#buffer .nick-12 {
  		color: #9995df;
  	}
  	#buffer .nick-13 {
  		color: #8b62b3;
  	}
  	#buffer .nick-15 {
  		color: #e3418b;
  	}

  	kbd {
  		--outline-color: #6e7681;

  		background-color: transparent;
  		border: 1px solid var(--outline-color);
  		box-shadow: inset 0 -1px 0 var(--outline-color);
  	}
  }

  @media (max-width: 640px) {
  	.expander {
  		display: block;
  	}

  	#buffer-list ul, #member-list > section {
  		width: 0px;
  	}

  	#buffer-list.expand, #member-list.expand {
  		z-index: 999;
  		grid-column-start: 1;
  		grid-column-end: 4;
  	}

  	#buffer-list.expand ul {
  		width: auto;
  	}

  	#member-list.expand > section {
  		width: 100%;
  	}

  	#member-list-header {
  		border-left: none;
  	}

  	#buffer-header {
  		grid-template-columns: 1fr min-content;
  	}

  	#buffer-header .title {
  		display: block;
  	}
  }

  @media (pointer: none), (pointer: coarse) {
  	#buffer-list li a, #member-list li a {
  		padding: 7px 10px;
  	}
  }

html:
  <pre><code class="prism-code language-css"><div class="token-line"><span class="token selector pseudo-class">:root</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--main-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">white</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--main-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">black</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--sidebar-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e3e3e3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--expander-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#b5b5b5</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--expander-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#a6a6a6</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--expander-border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#6c6c6c</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--button-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#eff7ef</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--button-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#545499</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--button-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#00007C</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--button-border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e3e3e3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--danger-button-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#eff7ef</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--danger-button-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#db2626</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--danger-button-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#B20000</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--danger-button-border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e3e3e3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--green</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">green</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token variable">--gray</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#4a4a4a</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token atrule rule">@media</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">prefers-color-scheme</span><span class="token atrule punctuation">:</span><span class="token atrule"> dark</span><span class="token atrule punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector pseudo-class">:root</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--main-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#212529</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--main-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#f8f9fa</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--sidebar-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#131618</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--expander-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#424446</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--expander-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#2a2d2f</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--button-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#282879</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--button-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#00007C</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--button-border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#131618</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--danger-button-background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#B20000</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--danger-button-background-hover</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--danger-button-border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#131618</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--green</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#53b266</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--gray</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#979797</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--red</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#fb615b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">html</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">scrollbar-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#8e8e8e</span><span class="token plain"> </span><span class="token color">transparent</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">html</span><span class="token selector punctuation">,</span><span class="token selector"> body</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow</span><span class="token punctuation">:</span><span class="token plain"> hidden</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">body</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> grid</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-template-rows</span><span class="token punctuation">:</span><span class="token plain"> auto </span><span class="token number">1</span><span class="token unit">fr</span><span class="token plain"> max-content</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-template-columns</span><span class="token punctuation">:</span><span class="token plain"> max-content </span><span class="token number">1</span><span class="token unit">fr</span><span class="token plain"> max-content</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-family</span><span class="token punctuation">:</span><span class="token plain"> monospace</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">button</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--button-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">transition</span><span class="token punctuation">:</span><span class="token plain"> background </span><span class="token number">0.25</span><span class="token unit">s</span><span class="token plain"> linear</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--button-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0.25</span><span class="token unit">rem</span><span class="token plain"> </span><span class="token number">0.5</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-style</span><span class="token punctuation">:</span><span class="token plain"> solid</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--button-border</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-size</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0.8</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">cursor</span><span class="token punctuation">:</span><span class="token plain"> pointer</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">button</span><span class="token selector pseudo-class">:hover</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--button-background-hover</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">button</span><span class="token selector class">.danger</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--danger-button-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--danger-button-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--danger-button-border</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">button</span><span class="token selector class">.danger</span><span class="token selector pseudo-class">:hover</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--danger-button-background-hover</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#connect</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-x</span><span class="token punctuation">:</span><span class="token plain"> hidden</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-y</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#member-list</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">/</span><span class="token plain"> </span><span class="token number">4</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-direction</span><span class="token punctuation">:</span><span class="token plain"> row</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.expander</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">cursor</span><span class="token punctuation">:</span><span class="token plain"> pointer</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--expander-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">transition</span><span class="token punctuation">:</span><span class="token plain"> background </span><span class="token number">0.2</span><span class="token unit">s</span><span class="token plain"> linear</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.expander</span><span class="token selector pseudo-class">:hover</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--expander-background-hover</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.expander</span><span class="token selector"> span</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin-bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-style</span><span class="token punctuation">:</span><span class="token plain"> solid</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--expander-border</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> ul</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">list-style-type</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-x</span><span class="token punctuation">:</span><span class="token plain"> hidden</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-y</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">scrollbar-width</span><span class="token punctuation">:</span><span class="token plain"> thin</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> inline-block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.active</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">white</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--gray</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.unread-message</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#b37400</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.unread-highlight</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#22009b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector pseudo-class">:not</span><span class="token selector punctuation">(</span><span class="token selector class">.type-server</span><span class="token selector punctuation">)</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding-left</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">20</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">5</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> grid</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-template-rows</span><span class="token punctuation">:</span><span class="token plain"> auto auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-template-columns</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">fr</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.title</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">5</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-weight</span><span class="token punctuation">:</span><span class="token plain"> bold</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.description</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">5</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.actions</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">/</span><span class="token plain"> </span><span class="token number">3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.status-here</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.status-gone</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">orange</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.status-offline</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.actions</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-direction</span><span class="token punctuation">:</span><span class="token plain"> row</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">justify-content</span><span class="token punctuation">:</span><span class="token plain"> center</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.actions</span><span class="token selector"> button</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">0</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector pseudo-class">:focus</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">outline</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">/</span><span class="token plain"> </span><span class="token number">4</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-direction</span><span class="token punctuation">:</span><span class="token plain"> row</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list</span><span class="token selector"> </span><span class="token selector combinator">&gt;</span><span class="token selector"> section</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-direction</span><span class="token punctuation">:</span><span class="token plain"> column</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-left</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token atrule rule">@media</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">max-width</span><span class="token atrule punctuation">:</span><span class="token atrule"> </span><span class="token atrule number">640</span><span class="token atrule unit">px</span><span class="token atrule punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> ul</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector class">.expand</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">z-index</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">999</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token plain"> </span><span class="token operator">/</span><span class="token plain"> </span><span class="token number">4</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector class">.expand</span><span class="token selector"> ul</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list</span><span class="token selector"> ul</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">list-style-type</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-grow</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-x</span><span class="token punctuation">:</span><span class="token plain"> hidden</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow-y</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">scrollbar-width</span><span class="token punctuation">:</span><span class="token plain"> thin</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#member-list</span><span class="token selector"> li a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> inline-block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.membership</span><span class="token selector class">.owner</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.membership</span><span class="token selector class">.admin</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">blue</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.membership</span><span class="token selector class">.op</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.membership</span><span class="token selector class">.halfop</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">orange</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.membership</span><span class="token selector class">.voice</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">yellow</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#composer</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-row</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">grid-column</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token plain"> </span><span class="token operator">/</span><span class="token plain"> </span><span class="token number">3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-top</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#composer</span><span class="token selector"> input</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">35</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#composer</span><span class="token selector"> input</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#composer</span><span class="token selector"> input</span><span class="token selector pseudo-class">:focus</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">outline</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#composer</span><span class="token selector class">.read-only</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#connect</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">position</span><span class="token punctuation">:</span><span class="token plain"> absolute</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">top</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">left</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">height</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#connect</span><span class="token selector"> form</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">max-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">350</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;text&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;username&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;password&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;url&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;email&quot;</span><span class="token selector attribute punctuation">]</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token selector punctuation">,</span><span class="token selector"> a</span><span class="token selector class">.timestamp</span><span class="token selector punctuation">,</span><span class="token selector"> a</span><span class="token selector class">.nick</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--gray</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">text-decoration</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token selector pseudo-class">:hover</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token selector pseudo-class">:active</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">a</span><span class="token selector class">.timestamp</span><span class="token selector pseudo-class">:hover</span><span class="token selector punctuation">,</span><span class="token selector"> a</span><span class="token selector class">.timestamp</span><span class="token selector pseudo-class">:active</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">a</span><span class="token selector class">.nick</span><span class="token selector pseudo-class">:hover</span><span class="token selector punctuation">,</span><span class="token selector"> a</span><span class="token selector class">.nick</span><span class="token selector pseudo-class">:active</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">text-decoration</span><span class="token punctuation">:</span><span class="token plain"> underline</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">details summary</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">role</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;button&quot;</span><span class="token selector attribute punctuation">]</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">user-select</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">cursor</span><span class="token punctuation">:</span><span class="token plain"> pointer</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-sizing</span><span class="token punctuation">:</span><span class="token plain"> border-box</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--gray</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">word-wrap</span><span class="token punctuation">:</span><span class="token plain"> break-word</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.logline-list</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.logline</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">white-space</span><span class="token punctuation">:</span><span class="token plain"> pre-wrap</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.talk</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.motd</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.error</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.me-tell</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#b37400</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.highlight</span><span class="token selector"> </span><span class="token selector class">.nick</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">yellow</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#c700ff</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-1</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#f25e0d</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-2</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e43611</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-3</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#f98a11</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-4</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#b4a700</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-5</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#89bd3b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-6</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#4ea847</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-7</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#287e52</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-8</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#117873</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-9</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#0083a7</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-10</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#2a6596</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-11</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#385189</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-12</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#434078</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-13</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#5e4279</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-14</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#7a447a</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-15</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e92980</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-16</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#ec273e</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.separator</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">align-items</span><span class="token punctuation">:</span><span class="token plain"> center</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">text-align</span><span class="token punctuation">:</span><span class="token plain"> center</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">text-transform</span><span class="token punctuation">:</span><span class="token plain"> lowercase</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-variant</span><span class="token punctuation">:</span><span class="token plain"> small-caps</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.separator</span><span class="token selector pseudo-element">::before</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.separator</span><span class="token selector pseudo-element">::after</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">content</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token string">&quot;&quot;</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token color">transparent</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#757575</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token selector pseudo-element">::before</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token selector pseudo-element">::after</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#ddd</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#ff3535</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token selector pseudo-element">::before</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token selector pseudo-element">::after</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#ff3535</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#error-msg</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">white</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">position</span><span class="token punctuation">:</span><span class="token plain"> fixed</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">right</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0.5</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0.5</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector id">#error-msg</span><span class="token selector"> button</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector class">.dialog</span><span class="token selector"> button</span><span class="token selector class">.dialog-close</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">transparent</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> inherit</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-size</span><span class="token punctuation">:</span><span class="token plain"> inherit</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.error-text</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">red</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">position</span><span class="token punctuation">:</span><span class="token plain"> fixed</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">top</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">left</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">right</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color function">rgba</span><span class="token color punctuation">(</span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0.5</span><span class="token color punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> </span><span class="token selector class">.dialog-body</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">20</span><span class="token unit">px</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">max-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">500</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">15</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token color function">rgba</span><span class="token color punctuation">(</span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0</span><span class="token color punctuation">,</span><span class="token color"> </span><span class="token color number">0.6</span><span class="token color punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> </span><span class="token selector class">.dialog-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> flex</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-direction</span><span class="token punctuation">:</span><span class="token plain"> row</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">align-items</span><span class="token punctuation">:</span><span class="token plain"> center</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin-bottom</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">em</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> </span><span class="token selector class">.dialog-header</span><span class="token selector"> h2</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">flex-grow</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> </span><span class="token selector class">.dialog-header</span><span class="token selector"> button</span><span class="token selector class">.dialog-close</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-size</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1.5</span><span class="token unit">em</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">5</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> h2</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin-top</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> form button</span><span class="token selector pseudo-class">:not</span><span class="token selector punctuation">(</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;button&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">float</span><span class="token punctuation">:</span><span class="token plain"> right</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token selector class">.dialog</span><span class="token selector"> form</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">overflow</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"> </span><span class="token comment">/* hack to clear floating elements */</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token selector">kbd</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#f0f0f0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token hexcode color">#bfbfbf</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">box-shadow</span><span class="token punctuation">:</span><span class="token plain"> inset </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token hexcode color">#fff</span><span class="token punctuation">,</span><span class="token plain"> inset </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">-2</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token hexcode color">#d9d9d9</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> inline-block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-size</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">80</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">margin</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">3</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">min-width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">em</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">text-align</span><span class="token punctuation">:</span><span class="token plain"> center</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">white-space</span><span class="token punctuation">:</span><span class="token plain"> nowrap</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">4</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">font-family</span><span class="token punctuation">:</span><span class="token plain"> monospace</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token property">border-radius</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">3</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token atrule rule">@media</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">prefers-color-scheme</span><span class="token atrule punctuation">:</span><span class="token atrule"> dark</span><span class="token atrule punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector">html</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">scrollbar-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--gray</span><span class="token punctuation">)</span><span class="token plain"> </span><span class="token color">transparent</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.active</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">white</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.unread-message</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> li</span><span class="token selector class">.unread-highlight</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#0062cc</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.status-gone</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#fb885b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.status-offline</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--red</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;text&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;username&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;password&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;url&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;email&quot;</span><span class="token selector attribute punctuation">]</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#ffffff</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--sidebar-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token hexcode color">#495057</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0.25</span><span class="token unit">rem</span><span class="token plain"> </span><span class="token number">0.375</span><span class="token unit">rem</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector">form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;text&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector pseudo-class">:focus</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;username&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector pseudo-class">:focus</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;password&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector pseudo-class">:focus</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;url&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector pseudo-class">:focus</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    form input</span><span class="token selector attribute punctuation">[</span><span class="token selector attribute attr-name">type</span><span class="token selector attribute operator">=</span><span class="token selector attribute attr-value">&quot;email&quot;</span><span class="token selector attribute punctuation">]</span><span class="token selector pseudo-class">:focus</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">outline</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#3897ff</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    a</span><span class="token selector class">.nick</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--main-background</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.error</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--red</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.me-tell</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e16b97</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.highlight</span><span class="token selector"> </span><span class="token selector class">.nick</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#1e0010</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#0062cc</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#757575</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token selector pseudo-element">::before</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.date-separator</span><span class="token selector pseudo-element">::after</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#373737</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token selector pseudo-element">::before</span><span class="token selector punctuation">,</span><span class="token selector"></span></div><div class="token-line"><span class="token selector">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.unread-separator</span><span class="token selector pseudo-element">::after</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--green</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#error-msg</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">black</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#efa3aa</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#error-msg</span><span class="token selector"> a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">black</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector class">.error-text</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#efa3aa</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-8</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#6bccc7</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-10</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#6296c1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-11</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#c6b5df</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-12</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#9995df</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-13</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#8b62b3</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer</span><span class="token selector"> </span><span class="token selector class">.nick-15</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#e3418b</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector">kbd</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token variable">--outline-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token hexcode color">#6e7681</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">        </span><span class="token property">background-color</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token color">transparent</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">px</span><span class="token plain"> solid </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--outline-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">box-shadow</span><span class="token punctuation">:</span><span class="token plain"> inset </span><span class="token number">0</span><span class="token plain"> </span><span class="token number">-1</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">0</span><span class="token plain"> </span><span class="token function">var</span><span class="token punctuation">(</span><span class="token variable">--outline-color</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token atrule rule">@media</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">max-width</span><span class="token atrule punctuation">:</span><span class="token atrule"> </span><span class="token atrule number">640</span><span class="token atrule unit">px</span><span class="token atrule punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector class">.expander</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> ul</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#member-list</span><span class="token selector"> </span><span class="token selector combinator">&gt;</span><span class="token selector"> section</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">0</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector class">.expand</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#member-list</span><span class="token selector class">.expand</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">z-index</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">999</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">grid-column-start</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">grid-column-end</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">4</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector class">.expand</span><span class="token selector"> ul</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> auto</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#member-list</span><span class="token selector class">.expand</span><span class="token selector"> </span><span class="token selector combinator">&gt;</span><span class="token selector"> section</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">width</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token unit">%</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#member-list-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">border-left</span><span class="token punctuation">:</span><span class="token plain"> none</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-header</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">grid-template-columns</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">1</span><span class="token unit">fr</span><span class="token plain"> min-content</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-header</span><span class="token selector"> </span><span class="token selector class">.title</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">display</span><span class="token punctuation">:</span><span class="token plain"> block</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">
  </span></div><div class="token-line"><span class="token plain"></span><span class="token atrule rule">@media</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">pointer</span><span class="token atrule punctuation">:</span><span class="token atrule"> none</span><span class="token atrule punctuation">)</span><span class="token atrule punctuation">,</span><span class="token atrule"> </span><span class="token atrule punctuation">(</span><span class="token atrule property">pointer</span><span class="token atrule punctuation">:</span><span class="token atrule"> coarse</span><span class="token atrule punctuation">)</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token selector id">#buffer-list</span><span class="token selector"> li a</span><span class="token selector punctuation">,</span><span class="token selector"> </span><span class="token selector id">#member-list</span><span class="token selector"> li a</span><span class="token plain"> </span><span class="token punctuation">{</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">        </span><span class="token property">padding</span><span class="token punctuation">:</span><span class="token plain"> </span><span class="token number">7</span><span class="token unit">px</span><span class="token plain"> </span><span class="token number">10</span><span class="token unit">px</span><span class="token punctuation">;</span><span class="token plain"></span></div><div class="token-line"><span class="token plain">    </span><span class="token punctuation">}</span><span class="token plain"></span></div><div class="token-line"><span class="token plain"></span><span class="token punctuation">}</span></div></code></pre>


