App.Arcology.Cell.Penthouse = class extends App.Arcology.Cell.BaseCell {
	constructor() {
		super(1);
	}

	/**
	 * @returns {string}
	 */
	get colorClass() {
		return "penthouse";
	}

	/**
	 * @returns {number}
	 */
	get width() {
		return 2;
	}

	/**
	 * @param {Array<number>} path
	 * @returns {Node}
	 */
	cellContent(path) {
		const fragment = document.createDocumentFragment();

		const link = App.UI.DOM.passageLink("Penthouse", "Manage Penthouse");
		const hotkey = App.UI.DOM.makeElement("span", "[P]", "hotkey");
		if (V.verticalizeArcologyLinks === 0) {
			const div = document.createElement("div");
			div.append(link, " ", hotkey);
			fragment.append(div);
		} else {
			fragment.append(link, " ", hotkey);
		}

		const wrapper = getWrapper(fragment);
		const fcs = App.Entity.facilities;

		/**
		 * @param {App.Entity.Facilities.Facility} facility
		 * @param {string} [passageName]
		 */
		function addFacility(facility, passageName) {
			if (facility.established) {
				const report = facility.occupancyReport(false);
				wrapper.append(createFacilityDiv(
					App.UI.DOM.passageLink(facility.UIName, passageName || facility.genericName),
					report ? `(${report})` : null
				));
			}
		}

		addFacility(fcs.masterSuite);
		addFacility(fcs.headGirlSuite, "Head Girl Suite");
		addFacility(fcs.armory, "BG Select");
		addFacility(fcs.servantsQuarters);
		addFacility(fcs.spa);
		addFacility(fcs.nursery);
		addFacility(fcs.clinic);
		addFacility(fcs.schoolroom);
		addFacility(fcs.cellblock);

		if (V.incubator) {
			const inc = App.Entity.facilities.incubator;
			const link = App.UI.DOM.passageLink(inc.UIName, "Incubator");
			const desc = `(${numberWithPluralOne(inc.capacity - V.tanks.length, "empty tank")})`;

			if (V.readySlaves > 0) {
				wrapper.append(createFacilityDiv(link, desc, App.UI.DOM.makeElement("span", "[!]", "noteworthy")));
			} else {
				wrapper.append(createFacilityDiv(link, desc));
			}
		}

		if (V.researchLab.level > 0) {
			wrapper.append(createFacilityDiv(App.UI.DOM.passageLink("Prosthetic Lab", "Prosthetic Lab")));
		}

		return fragment;

		/**
		 * @returns {HTMLDivElement}
		 */
		function getWrapper(outer) {
			const wrapper = document.createElement("div");
			if (V.verticalizeArcologyLinks !== 0) {
				let gridClass = `grid${V.verticalizeArcologyLinks}`;
				wrapper.classList.add("gridWrapper", gridClass);
			}
			outer.append(wrapper);
			return wrapper;
		}

		/**
		 *
		 * @param {HTMLElement} link
		 * @param {(Node|string)} [content]
		 * @returns {HTMLDivElement}
		 */
		function createFacilityDiv(link, content) {
			const div = document.createElement("div");
			div.append(link);
			// in collapsed mode additional information needs to be in it's own div to stop linebreaks at weird places
			if (V.verticalizeArcologyLinks === 0) {
				div.classList.add("collapsed");
				if (content) {
					div.append(" ", content);
				}
			} else if (content) {
				const innerDiv = document.createElement("div");
				innerDiv.append(content);
				div.append(" ", innerDiv);
			}
			return div;
		}
	}

	static _cleanupConfigScheme(config) {
		super._cleanupConfigScheme(config);
		// BC code
	}

	clone() {
		return (new App.Arcology.Cell.Penthouse())._init(this);
	}

	get className() { return "App.Arcology.Cell.Penthouse"; }
};

src/arcologyBuilding/penthouse.js