@adatechnology/game-floorplan-interactables 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/MIGRATION.md +307 -0
- package/README.md +44 -2
- package/dist/index.d.ts +167 -0
- package/dist/index.global.js +1392 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +1367 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/locale.ts","../src/tables.ts","../src/adapter.ts"],"sourcesContent":["import { ADAPTER_VERSION, PREFERENCE, create, mergeRegistry } from './adapter.js'\nimport { CHAIR_TABLES, CONTENT_BY_GROUP, CONTENT_MAP, TYPE_MAP } from './tables.js'\n\nexport { ADAPTER_VERSION, PREFERENCE, create, mergeRegistry } from './adapter.js'\nexport type { Preference, PreferenceContext } from './adapter.js'\nexport { createTranslator, locales } from './locale.js'\nexport type { MessageKey, Messages } from './locale.js'\nexport {\n CHAIR_TABLES,\n CONTENT_BY_GROUP,\n CONTENT_FALLBACK,\n CONTENT_MAP,\n DINING_CHAIR_SIDE,\n DRAWER_GROUPS,\n DRAWER_ITEMS,\n FIXTURES_OF_POINT,\n FROZEN_ITEMS,\n OBJECT_SUBSTITUTES,\n OWN_TYPES,\n TYPE_MAP,\n} from './tables.js'\nexport type { TypeMapEntry } from './tables.js'\nexport type { AdapterOptions, FloorplanAdapter, Json, Registry } from './types.js'\n\n/**\n * The adapter as the house renderer takes it (`interactives.adapter`): `create(options)` makes the adapter; the tables are on it too.\n * Same shape as the team's `AdaptadorInterativos` (`criar`, `MAPA_TIPOS`, `MAPA_CONTEUDO`, `CONTEUDO_POR_CATEGORIA`).\n */\nexport const FloorplanInteractables = { version: ADAPTER_VERSION, create, TYPE_MAP, CONTENT_MAP, CONTENT_BY_GROUP, CHAIR_TABLES, PREFERENCE, mergeRegistry }\n","// Texts of the adapter (warnings of a plan and errors). `pt-BR` are the team's own sentences; `en` is the default of the kit.\nconst en = {\n 'error.missingKit': 'game-floorplan-interactables: create needs GameInteractables and GameInteractablesHousehold',\n 'error.unknownOwnType': 'game-floorplan-interactables: unknown own type: {type}',\n 'warn.cylinderNoCabinet': 'cylinder {id} under the counter has no kitchen cabinet to hide it',\n 'warn.cabinetNoDoor': 'cabinet {cabinet} has no door for the cylinder {id}',\n 'warn.switchUnknownLamp': 'switch {id} controls {lamp}, which does not exist',\n 'warn.pointNoObject': 'point {id} ({kind}) has no object for {item}',\n 'warn.buildEmpty': 'build returned nothing for {id}',\n} as const\n\nexport type MessageKey = keyof typeof en\nexport type Messages = Record<MessageKey, string>\n\nconst ptBR: Messages = {\n 'error.missingKit': 'game-floorplan-interactables: create precisa de GameInteractables e GameInteractablesHousehold',\n 'error.unknownOwnType': 'game-floorplan-interactables: tipo próprio desconhecido: {type}',\n 'warn.cylinderNoCabinet': 'botijão {id} sob a bancada sem armário de cozinha para escondê-lo',\n 'warn.cabinetNoDoor': 'armário {cabinet} sem porta para o botijão {id}',\n 'warn.switchUnknownLamp': 'interruptor {id} controla {lamp}, que não existe',\n 'warn.pointNoObject': 'ponto {id} ({kind}) sem objeto para {item}',\n 'warn.buildEmpty': 'construir devolveu vazio para {id}',\n}\n\nexport const locales: Record<string, Messages> = { en, 'pt-BR': ptBR }\n\n/** Translator for a locale (`pt-BR`, `pt`, `en`, another falls back to `en`); `table` adds or replaces keys. */\nexport function createTranslator(locale?: string, table?: Partial<Messages>): (key: MessageKey, params?: Record<string, string | number>) => string {\n const base = locale && /^pt/i.test(locale) ? ptBR : en\n const messages: Messages = { ...base, ...(table ?? {}) }\n return (key, params) => (messages[key] ?? key).replace(/\\{(\\w+)\\}/g, (_m, name: string) => (params && params[name] !== undefined ? String(params[name]) : `{${name}}`))\n}\n","// Defaults of the adapter: the tables of the team's `AdaptadorInterativos` (kit 0.3.0), with the ids of this kit. Every table is a registry: `create` takes an\n// override of each (a key with `null` removes the entry), so a game can add, replace or drop entries without touching the adapter.\n// The comments say which id of the team's `PlantasSDK` each entry was (the tables of MIGRATION.md in the floorplan packs give the same ids).\n\n/** How a furniture type of the plan becomes an object of the household pack. */\nexport interface TypeMapEntry {\n /** Household type (`hh.types`), or one the adapter creates itself (`lamp`). */\n type?: string\n /** Household variant (`steel`, `garage`, `hanging`). */\n variant?: string\n /** The furniture becomes more than one object: `sink` (basin + base cabinet + wall cabinet), `basin` (bathroom basin + wall cabinet), `rustic_sink`. */\n compound?: 'sink' | 'basin' | 'rustic_sink'\n /**\n * Which sizes of the furniture go to the drawing: `wdh` (default), `wd` (width and depth: the plan gives the height of the base, not of the whole drawing, like the\n * 10 cm shower tray or the 50 cm bench without a back), `wh`, `w`, `x` (none, but the height off the floor `y` stays) or `none` (none, not even `y`).\n */\n dim?: 'wdh' | 'wd' | 'wh' | 'w' | 'x' | 'none'\n /** Power of a lamp (W). */\n watts?: number\n}\n\n/** Furniture type of the plan to the object of the kit (`TypeMapEntry`). */\nexport const TYPE_MAP: Readonly<Record<string, TypeMapEntry>> = Object.freeze({\n fridge: { type: 'fridge' }, // was `geladeira`\n fridge_large: { type: 'fridge' }, // was `geladeira2`\n display_fridge_medium: { type: 'fridge', variant: 'steel' }, // was `geladeira_med`\n display_fridge: { type: 'fridge', variant: 'steel' }, // was `refrig_exp`\n freezer: { type: 'fridge_compact' }, // was `freezer`\n kitchen_cabinet: { compound: 'sink' }, // was `armario_cozinha`\n kitchen_cabinet_small: { compound: 'sink' }, // was `armario_cozinha_p`\n kitchen_cabinet_large: { compound: 'sink' }, // was `armario_cozinha_g`\n washbasin: { compound: 'basin' }, // was `pia_b`\n pedestal_basin: { compound: 'basin' }, // was `pia_coluna`\n wardrobe: { type: 'wardrobe' }, // was `guarda`\n wardrobe_small: { type: 'wardrobe' }, // was `guarda_peq`\n wardrobe_large: { type: 'wardrobe' }, // was `guarda_g`\n closet_wardrobe: { type: 'wardrobe' }, // was `guarda_closet`\n dresser: { type: 'dresser' }, // was `comoda`\n nightstand: { type: 'nightstand' }, // was `criado`\n pantry: { type: 'pantry' }, // was `despensa`\n laundry_cabinet: { type: 'pantry' }, // was `armario_lav`\n china_cabinet: { type: 'pantry' }, // was `cristaleira`\n filing_cabinet: { type: 'dresser' }, // was `arquivo`\n console_table: { type: 'dresser' }, // was `aparador_c`\n tv_unit: { type: 'kitchen_cabinet_base' }, // was `rack`\n tv_unit_small: { type: 'kitchen_cabinet_base' }, // was `rack_peq`\n tv_unit_large: { type: 'kitchen_cabinet_base' }, // was `rack_grande`\n stove: { type: 'stove' }, // was `fogao`\n stove_4burner: { type: 'stove' }, // was `fogao4`\n cooking_gas_cylinder: { type: 'gas_bottle', dim: 'none' }, // was `botijao_gas`\n gas_cylinder: { type: 'gas_bottle', dim: 'none' }, // was `botijao`\n tv: { type: 'tv' }, // was `tv`\n tv_large: { type: 'tv' }, // was `tv_grande`\n microwave: { type: 'microwave' }, // was `microondas`\n washing_machine: { type: 'washing_machine' }, // was `maquina`\n shower: { type: 'shower', dim: 'wd' }, // was `box`\n shower_large: { type: 'shower', dim: 'wd' }, // was `box_g`\n toilet: { type: 'toilet', dim: 'wd' }, // was `vaso`\n laundry_tub: { type: 'utility_sink', dim: 'wd' }, // was `tanque`\n sofa_2seat: { type: 'sofa' }, // was `sofa2`\n sofa_3seat: { type: 'sofa' }, // was `sofa3`\n sofa_l: { type: 'sofa' }, // was `sofa_l`\n sofa_xl: { type: 'sofa' }, // was `sofa_xl`\n armchair: { type: 'armchair' }, // was `poltrona`\n armchair_high: { type: 'armchair' }, // was `poltrona_alta`\n stool: { type: 'dining_chair' }, // was `banqueta`\n camp_chair: { type: 'camp_chair', dim: 'wd' }, // was `cadeira_camping`\n rocking_chair: { type: 'armchair' }, // was `cadeira_balanco`\n rustic_sink: { compound: 'rustic_sink' }, // was `pia_rustica`: the sink of the cabin or shack: the basin the whole width, no cabinet under it; a wall cabinet only if there is `overhead` content\n improvised_bed: { type: 'bed_single', dim: 'wd' }, // was `cama_improvisada`\n log_bench: { type: 'bench', dim: 'wd' }, // was `banco_tronco`\n plank_shelf: { type: 'pantry', variant: 'garage' }, // was `prateleira_tabua`\n sideboard: { type: 'dresser' }, // was `aparador`\n buffet: { type: 'dresser' }, // was `bufe`\n single_bed: { type: 'bed_single', dim: 'wd' }, // was `cama_solteiro`\n double_bed: { type: 'bed_double', dim: 'wd' }, // was `cama_casal`\n queen_bed: { type: 'bed_double', dim: 'wd' }, // was `cama_queen`\n king_bed: { type: 'bed_double', dim: 'wd' }, // was `cama_king`\n bench: { type: 'bench', dim: 'wd' }, // was `banco`\n garden_bench: { type: 'bench', dim: 'wd' }, // was `banco_jardim`\n waiting_bench: { type: 'bench', dim: 'wd' }, // was `espera`\n blinds: { type: 'blinds' }, // was `persiana`\n curtain: { type: 'curtain' }, // was `cortina`\n trash_bin: { type: 'trash_bin' }, // was `lixeira`\n outdoor_bin: { type: 'wheelie_bin' }, // was `lixeira_ext`\n mailbox: { type: 'mailbox', dim: 'none' }, // was `caixa_correio`: the household draws the box on its post: position and rotation only\n doghouse: { type: 'dog_house' }, // was `casinha_cachorro`\n bbq_grill: { type: 'bbq', dim: 'wd' }, // was `churrasqueira`\n bbq_simple: { type: 'bbq', dim: 'wd' }, // was `churrasqueira_simples`\n clothesline: { type: 'clothesline', dim: 'wh' }, // was `varal`\n tool_shelf: { type: 'pantry', variant: 'garage' }, // was `estante_ferr`\n workbench: { type: 'pantry', variant: 'garage' }, // was `bancada_ferr`\n // rural houses and campsite (types of the household pack: rural and camp)\n bunk_bed: { type: 'bunk_bed', dim: 'wd' }, // was `beliche`\n wood_stove: { type: 'wood_stove', dim: 'wd' }, // was `fogao_lenha`: the flue rises to the chimney height (cabin); the fireplace is handled in `planSimple` (it moves and changes height)\n fireplace: { type: 'fireplace', dim: 'w' }, // was `lareira`\n outhouse: { type: 'outhouse', dim: 'wdh' }, // was `privada`\n well: { type: 'well', dim: 'none' }, // was `poco`\n cooler: { type: 'cooler', dim: 'wd' }, // was `cooler`\n campfire: { type: 'campfire', dim: 'wd' }, // was `fogueira`\n camp_stove: { type: 'camp_stove', dim: 'wd' }, // was `fogareiro`\n camp_gas_canister: { type: 'gas_canister', dim: 'none' }, // was `botijao_camping`\n camp_table: { type: 'camp_table', dim: 'wdh' }, // was `mesa_camping`\n // kerosene/gas lanterns: a `lamp` device without electricity (the grid does not matter); the ceiling one is the `hanging` variant\n oil_lamp: { type: 'lantern_lamp', dim: 'x' }, // was `lampiao`\n camp_lantern: { type: 'lantern_lamp', dim: 'x' }, // was `lampiao_camping`\n ceiling_oil_lamp: { type: 'lantern_lamp', variant: 'hanging', dim: 'x' }, // was `lampiao_teto`\n // lamps: objects of the adapter (the kit has no lamp mesh; the house renderer draws the fixture)\n ceiling_light: { type: 'lamp', watts: 15 }, // was `plafon`\n pendant: { type: 'lamp', watts: 20 }, // was `pendente`\n track_spot: { type: 'lamp', watts: 10 }, // was `spot_trilho`\n chandelier: { type: 'lamp', watts: 60 }, // was `lustre`\n floor_lamp: { type: 'lamp', watts: 12 }, // was `luminaria`\n table_lamp: { type: 'lamp', watts: 9 }, // was `abajur`\n})\n\n/**\n * Tables that get chairs of the kit (the plan puts none around them). `dining`: chairs on both long sides (and at the ends if the table is 1.6 m or more); `office`:\n * one armchair on the front side of the desk. The adapter only puts a chair where it fits (walls and other furniture).\n */\nexport const CHAIR_TABLES: Readonly<Record<string, 'dining' | 'office'>> = Object.freeze({\n dining_table: 'dining', // was `mesa`\n dining_table_small: 'dining', // was `mesa_peq`\n dining_table_round: 'dining', // was `mesa_red`\n dining_table_large: 'dining', // was `mesa_grande`\n gourmet_table: 'dining', // was `mesa_gourmet`\n gourmet_table_small: 'dining', // was `mesa_gourmet_peq`\n outdoor_table: 'dining', // was `mesa_ext`\n office_desk: 'office', // was `mesa_escr`\n office_desk_large: 'office', // was `mesa_escr_g`\n desk: 'office', // was `escrivaninha`\n})\n\n/** Side of the dining chair of the pack (m). */\nexport const DINING_CHAIR_SIDE = 0.45\n\n/**\n * What a content stack of the plan (`FindStack.itemId`) becomes in the household catalog (`hh.items`). The ids on the left are the ones the structure pack\n * puts in `result.contents` by default and the ones of the goods catalog (`game-items-goods`, through its provenance); the right side is the team's choice.\n * An id that is not here but is a household item stays as it is.\n */\nexport const CONTENT_MAP: Readonly<Record<string, string>> = Object.freeze({\n // food\n sugar: 'sugar', // was `acucar`\n rice: 'rice', // was `arroz`\n biscuits: 'biscuits', // was `biscoito`\n coffee: 'coffee', // was `cafe`\n raw_beef: 'frozen_meat', // was `carne`\n packed_meat: 'frozen_meat', // was `carne`\n flour: 'flour', // was `farinha`\n beans: 'beans', // was `feijao`\n apple: 'apple', // was `fruta`\n fruit: 'apple', // was `fruta`\n yogurt: 'yogurt', // was `iogurte`\n canned_food: 'canned_food', // was `lata_atum`\n canned_tuna: 'canned_food', // was `lata_atum`\n canned_corn_and_peas: 'canned_food', // was `lata_milho`\n canned_corn: 'canned_food', // was `lata_milho`\n milk_carton: 'milk_carton', // was `leite`\n pasta: 'pasta', // was `macarrao`\n cooking_oil: 'cooking_oil', // was `oleo`\n eggs: 'eggs', // was `ovos`\n cheese: 'cheese', // was `queijo`\n leftover_meal: 'bowl', // was `sobras`\n leftovers: 'bowl', // was `sobras`\n ice_cream: 'ice_cream', // was `sorvete`\n seasoning: 'salt', // was `tempero`\n spices: 'salt', // was `tempero`\n // water and drink\n water_jug_5l: 'water_bottle', // was `agua_galao`\n water_jug: 'water_bottle', // was `agua_galao`\n water_bottle: 'water_bottle', // was `agua_garrafa`\n soda_can: 'soda_can', // was `refrigerante`\n soda: 'soda_can', // was `refrigerante`\n // medicine\n alcohol_70: 'alcohol_70', // was `alcool`\n rubbing_alcohol: 'alcohol_70', // was `alcool`\n adhesive_bandages: 'bandage', // was `curativo`\n bandages: 'bandage', // was `curativo`\n insulin: 'first_aid_kit', // was `insulina`\n painkillers: 'painkillers', // was `paracetamol`\n painkiller: 'painkillers', // was `paracetamol`\n maintenance_medication: 'painkillers', // was `remedio`\n medicine: 'painkillers', // was `remedio`\n // cleaning and hygiene\n bleach: 'bleach', // was `agua_sanitaria`\n disinfectant: 'bleach', // was `desinfetante`\n detergent: 'detergent', // was `detergente`\n dish_soap: 'detergent', // was `detergente`\n toothbrush: 'toothbrush', // was `escova_dente`\n sponge: 'sponge', // was `esponja`\n rubber_gloves: 'sponge', // was `luvas`\n toilet_paper: 'toilet_paper', // was `papel_higienico`\n laundry_powder: 'detergent', // was `sabao_po`\n washing_powder: 'detergent', // was `sabao_po`\n soap: 'soap', // was `sabonete`\n shampoo: 'shampoo', // was `shampoo`\n // clothes\n jeans: 'jeans', // was `calca`\n trousers: 'jeans', // was `calca`\n tshirt: 'tshirt', // was `camisa`\n shirt: 'tshirt', // was `camisa`\n t_shirt: 'tshirt', // was `camiseta`\n jacket: 'jacket', // was `casaco`\n coat: 'jacket', // was `casaco`\n blanket: 'blanket', // was `cobertor`\n socks: 'socks', // was `meias`\n underwear: 'underwear', // was `roupa_intima`\n sneakers: 'sneakers', // was `sapato`\n shoes: 'sneakers', // was `sapato`\n // utensils\n cup: 'cup', // was `caneca`\n mug: 'cup', // was `caneca`\n plate: 'plate', // was `prato`\n china_plates: 'plate', // was `prato`\n plates: 'plate', // was `prato`\n wine_glass: 'cup', // was `taca`\n wine_glasses: 'cup', // was `taca`\n pot: 'pot', // was `panela`\n // tools and electronics\n pliers: 'screwdriver', // was `alicate`\n bucket: 'paint_can', // was `balde`\n cable_bundle: 'phone_charger', // was `cabos`\n cables: 'phone_charger', // was `cabos`\n pen: 'pen', // was `caneta`\n phone_charger: 'phone_charger', // was `carregador`\n charger: 'phone_charger', // was `carregador`\n screwdriver: 'screwdriver', // was `chave_fenda`\n house_key: 'wallet', // was `chaves`\n keys: 'wallet', // was `chaves`\n remote_control: 'batteries', // was `controle_remoto`\n rope: 'rope', // was `corda`\n electrical_tape: 'duct_tape', // was `fita_isolante`\n insulating_tape: 'duct_tape', // was `fita_isolante`\n flashlight: 'flashlight', // was `lanterna`\n backpack: 'backpack', // was `mochila`\n eyeglasses: 'wallet', // was `oculos`\n glasses: 'wallet', // was `oculos`\n screws: 'duct_tape', // was `parafusos`\n batteries: 'batteries', // was `pilhas`\n nails: 'duct_tape', // was `pregos`\n // improvised weapons\n knife: 'knife', // was `faca`\n kitchen_knife: 'knife', // was `faca`\n stapler: 'scissors', // was `grampeador`\n hammer: 'hammer', // was `martelo`\n handsaw: 'hammer', // was `serrote`\n hand_saw: 'hammer', // was `serrote`\n scissors: 'scissors', // was `tesoura`\n broom: 'rope', // was `vassoura`\n // papers\n letter: 'letter', // was `carta`\n bill: 'bill', // was `conta`\n documents: 'documents', // was `documento`\n dvd: 'notebook', // was `dvd`\n dvds: 'notebook', // was `dvd`\n book: 'notebook', // was `livro`\n // trash\n food_packaging: 'plastic_bag', // was `embalagem`\n packaging: 'plastic_bag', // was `embalagem`\n paint_can: 'paint_can', // was `lata_tinta`\n empty_can: 'empty_can', // was `lata_vazia`\n flyer: 'flyer', // was `panfleto`\n crumpled_paper: 'crumpled_paper', // was `papel_amassado`\n trash_bag: 'plastic_bag', // was `saco_lixo`\n full_trash_bag: 'plastic_bag', // was `saco_lixo_cheio`\n})\n\n/** When the item is in no table: the closest household item by the group of the stack (`FindStack.group`). */\nexport const CONTENT_BY_GROUP: Readonly<Record<string, string>> = Object.freeze({\n food: 'canned_food', // was `comida`\n water: 'water_bottle', // was `agua`\n medicine: 'painkillers', // was `remedio`\n tool: 'duct_tape', // was `ferramenta`\n improvised_weapon: 'hammer', // was `arma_improvisada`\n clothes: 'tshirt', // was `roupa`\n document: 'documents', // was `documento`\n cleaning: 'detergent', // was `limpeza`\n trash: 'crumpled_paper', // was `lixo`\n utensil: 'plate', // was `utensilio`\n})\n\n/** The item for a stack with no table entry, no household id and no known group. */\nexport const CONTENT_FALLBACK = 'crumpled_paper'\n\n/** Items that go in the freezer first (the team asked for it by the name of the stack: ice cream and \"frozen meat\"). */\nexport const FROZEN_ITEMS: readonly string[] = Object.freeze(['ice_cream', 'frozen_meat'])\n\n/** Items that go in the drawers of a wardrobe first (underwear and socks). */\nexport const DRAWER_ITEMS: readonly string[] = Object.freeze(['underwear', 'socks'])\n\n/** Groups that go in the drawer of a kitchen base cabinet first. */\nexport const DRAWER_GROUPS: readonly string[] = Object.freeze(['improvised_weapon', 'tool'])\n\n/** The last resort when nothing of the category fits the slots of the object (a mailbox holds only thin paper). */\nexport const OBJECT_SUBSTITUTES: Readonly<Record<string, readonly string[]>> = Object.freeze({ mailbox: ['flyer', 'postcard', 'letter'] })\n\n/** Point of the plumbing (`plumbing.points[].kind`) to the fixtures of the household object that use it. */\nexport const FIXTURES_OF_POINT: Readonly<Record<string, readonly string[]>> = Object.freeze({\n tap: ['tap'], // was `torneira`\n shower: ['shower'], // was `chuveiro`\n flush: ['flush'], // was `descarga`\n tub: ['tap', 'basin'], // was `tanque`\n machine: ['inlet'], // was `maquina`\n})\n\n/** Objects the kit does not have and the adapter creates itself (without going through `build`). */\nexport const OWN_TYPES: Readonly<Record<string, true>> = Object.freeze({ lamp: true, gas_piped: true })\n\n","// Literal port of the team's `AdaptadorInterativos` (kit 0.3.0): the bridge between the plan of a house (`game-floorplan`) and the interactables kit\n// (`game-interactables` + `game-interactables-household`). Pure JS logic, no three.js, no `Math.random`. The names are English; MIGRATION.md maps each old one.\n//\n// const adapter = create({ GameInteractables, GameInteractablesHousehold, locale: 'pt-BR', region: 'br' })\n// const plan = adapter.plan(result, { floor }) // pure data, nothing is drawn\n// const world = adapter.createWorld(result, { water, seed, onEvent, lightsOn }) // kit World with texts, items, loot and water network\n// adapter.add(world, plan, { build, isBlocked }) // adds everything and fits the doors against the walls\n//\n// Conventions (README of the plan, \"Coordinates\"): x = originX + u, z = originZ + inw * v, ry = atan2(fu, inw * fv). The front of an object of the kit is its local +z,\n// the same as the front (frontU, frontV) of the furniture of the plan; so the fridge against the back wall faces away from it. `inw` is 1 by default (v grows toward the back).\n//\n// What the adapter reads of the plan (the result of `engine.generate` with the structure pack): `items` (and `contents`, `utilities`, `floors`, `rooms`, `walls`,\n// `colors`, `state`, `seed`, `template`, `structureExtras`). It never reads a global.\nimport { createTranslator } from './locale.js'\nimport type { MessageKey } from './locale.js'\nimport {\n CHAIR_TABLES,\n CONTENT_BY_GROUP,\n CONTENT_FALLBACK,\n CONTENT_MAP,\n DINING_CHAIR_SIDE,\n DRAWER_GROUPS,\n DRAWER_ITEMS,\n FIXTURES_OF_POINT,\n FROZEN_ITEMS,\n OBJECT_SUBSTITUTES,\n OWN_TYPES,\n TYPE_MAP,\n} from './tables.js'\nimport type { TypeMapEntry } from './tables.js'\nimport type { AdapterOptions, FloorplanAdapter, Json } from './types.js'\n\n/** Version of the team's adapter this is the port of. */\nexport const ADAPTER_VERSION = '0.3.0'\n\nconst r3 = (n: number): number => Math.round(n * 1000) / 1000\n\n/** Copy of a table with the overrides applied: a `null` or `undefined` value removes the entry. */\nexport function mergeRegistry<T>(base: Readonly<Record<string, T>>, extra?: Readonly<Record<string, T | null | undefined>> | null): Record<string, T> {\n const out: Record<string, T> = { ...base }\n if (extra) {\n for (const [key, value] of Object.entries(extra)) {\n if (value == null) delete out[key]\n else out[key] = value\n }\n }\n return out\n}\n\n/** The helpers the preference functions of a container get. */\nexport interface PreferenceContext {\n /** The stack goes in the freezer first (ice cream, frozen meat). */\n frozen(stack: Json): boolean\n /** Group of the stack (`food`, `tool`, ...), or null. */\n group(stack: Json): string | null\n /** The stack is underwear or socks. */\n drawerItem(stack: Json): boolean\n}\n\n/** Order of the containers of an object for a stack (the first with a free slot that fits takes the stack). */\nexport type Preference = (stack: Json, context: PreferenceContext) => string[]\n\n/** Default preference by household type. */\nexport const PREFERENCE: Readonly<Record<string, Preference>> = Object.freeze({\n fridge: (s, c) => (c.frozen(s) ? ['freezer', 'fridge'] : ['fridge', 'freezer']),\n fridge_compact: (s, c) => (c.frozen(s) ? ['freezer', 'fridge'] : ['fridge', 'freezer']),\n kitchen_cabinet_base: (s, c) => (DRAWER_GROUPS.includes(c.group(s) as string) ? ['drawer', 'cupboard'] : ['cupboard', 'drawer']),\n wardrobe: (s, c) => (c.drawerItem(s) ? ['drawer_1', 'drawer_2', 'drawer_3', 'shelves'] : ['shelves', 'drawer_1', 'drawer_2', 'drawer_3']),\n})\n\nexport function create(options: AdapterOptions = {}): FloorplanAdapter {\n const opts = options || {}\n const GI: Json = opts.GameInteractables\n const HH: Json = opts.GameInteractablesHousehold\n const locale = opts.locale || 'pt-BR'\n const msg = createTranslator(locale, opts.messages)\n if (!GI || !HH) throw new Error(msg('error.missingKit'))\n const region = opts.region || 'br'\n const hh: Json = HH.createHousehold({ locale, region })\n const householdTypes = new Set<string>(hh.types.map((t: Json) => t.id))\n const worlds = new WeakMap<object, { points: Map<string, string>; water: Json; lightsOn: Json }>() // world -> { points: Map(global fixture -> point), water }\n\n // ---- registries (the defaults of tables.ts, with the overrides of the game) ----\n const typeMap = mergeRegistry<TypeMapEntry>(TYPE_MAP, opts.typeMap)\n const contentMap = mergeRegistry<string>(CONTENT_MAP, opts.contentMap)\n const contentByGroup = mergeRegistry<string>(CONTENT_BY_GROUP, opts.contentByGroup)\n const chairTables = mergeRegistry<'dining' | 'office'>(CHAIR_TABLES, opts.chairTables)\n const fixturesOfPoint = mergeRegistry<readonly string[]>(FIXTURES_OF_POINT, opts.fixturesOfPoint)\n const substitutes = mergeRegistry<readonly string[]>(OBJECT_SUBSTITUTES, opts.substitutes)\n const preference = mergeRegistry<Preference>(PREFERENCE, opts.preference)\n const ownTypes = mergeRegistry<true>(OWN_TYPES, opts.ownTypes)\n const frozenItems = new Set<string>(opts.frozenItems ?? FROZEN_ITEMS)\n const drawerItems = new Set<string>(opts.drawerItems ?? DRAWER_ITEMS)\n const chairSide = opts.chairSide ?? DINING_CHAIR_SIDE\n const contentFallback = opts.contentFallback ?? CONTENT_FALLBACK\n const seedKey = (id: string): string => {\n if (!opts.seedKey) return id\n const key = opts.seedKey(id)\n return key == null ? id : key\n }\n\n // ---- geometry ----\n function conv(o: Json) {\n return {\n x: (u: number) => r3(o.ox + u),\n z: (v: number) => r3(o.oz + o.inw * v),\n ry: (fu: number, fv: number) => r3(Math.atan2(fu, o.inw * fv)),\n // local offset (lx, lz) of an object with rotation ry -> offset in the world (same convention as three.js)\n off: (ry: number, lx: number, lz: number): [number, number] => [Math.cos(ry) * lx + Math.sin(ry) * lz, -Math.sin(ry) * lx + Math.cos(ry) * lz],\n }\n }\n\n function floorYOf(res: Json, o: Json, floor: number | null | undefined): number {\n if (floor == null || floor < 0) return o.base\n const f = (res.floors || []).find((x: Json) => x.index === floor)\n return r3(o.base + (f ? f.y0 : 0))\n }\n\n function colorOf(res: Json, color: unknown): number | undefined {\n if (color == null) return undefined\n if (typeof color === 'number') return color\n const v = res.colors && res.colors[color as string]\n return typeof v === 'number' ? v : undefined\n }\n\n function paletteOf(res: Json): Json {\n const c = res.colors || {}\n const p: Json = {}\n if (c.wood != null) p.wood = c.wood\n if (c.fabric_main != null) p.fabric_main = c.fabric_main\n if (c.fabric_accent != null) p.fabric_accent = c.fabric_accent\n if (c.metal != null) p.metal = c.metal\n return p\n }\n\n // ---- initial state of the lights ----\n // `lightsOn`: boolean or (lampId, entry) => boolean, in the options of plan, createWorld or add (the last one wins). Without it: off, unless `night: true` in plan; then the\n // lamps of a house with a grid and electric light that is not abandoned turn on (abandoned, no grid or kerosene lamps/lanterns: off). The team read `energia.iluminacao`\n // for \"electric light\"; the kit says the same with the mode of the installation: `offgrid` is the kerosene lamp, the lantern and the solar lamp.\n function lightsOfState(res: Json): boolean {\n const electrical = res.utilities && res.utilities.electrical\n return res.state !== 'abandoned' && !!electrical && electrical.mode !== 'offgrid'\n }\n\n function initialLight(res: Json, popts: Json, id: string, entry: Json): boolean {\n const v = popts && popts.lightsOn\n if (typeof v === 'function') return !!v(id, entry)\n if (typeof v === 'boolean') return v\n return !!(popts && popts.night) && lightsOfState(res)\n }\n\n // ---- content ----\n const stackGroup = (s: Json): string | null => s.group ?? (opts.groupOf ? opts.groupOf(s.itemId) : null) ?? null\n const preferenceContext: PreferenceContext = {\n frozen: (s) => frozenItems.has(s.itemId),\n group: stackGroup,\n drawerItem: (s) => drawerItems.has(s.itemId),\n }\n\n // a stack of the plan -> item of the household catalog: the table, the household id itself, the closest by group, the fallback\n const itemOfContent = (c: Json): string => {\n const id = contentMap[c.itemId] || (hh.items[c.itemId] ? c.itemId : null) || contentByGroup[stackGroup(c) as string] || contentFallback\n return hh.items[id] ? id : contentFallback\n }\n\n const volume = (d: Json): number => d.size[0] * d.size[1] * d.size[2]\n const candidates = (id: string, objectType: string): string[] => {\n const def = hh.items[id]\n const siblings = Object.values<Json>(hh.items)\n .filter((i) => i.category === def.category && i.id !== id)\n .sort((a, b) => volume(a) - volume(b) || (a.id < b.id ? -1 : 1))\n return [id].concat(siblings.map((i) => i.id), (substitutes[objectType] as string[] | undefined) || [])\n }\n\n // Distributes the stacks of the plan into the slots of the containers (probed with the recorder, drawing nothing).\n // Every container of the object gets an explicit list (empty where nothing fit): the draw of the kit does not enter.\n function distribute(type: string, probeItem: Json, stacks: Json[] | undefined) {\n const spec = hh.build(type, probeItem, HH.createRecorder().api)\n const conts: Json[] = spec.containers || []\n const contents: Record<string, (Json | null)[]> = {}\n for (const c of conts) contents[c.id] = c.slots.map(() => null)\n const rejected: Json[] = []\n const pref = preference[type]\n for (const p of stacks || []) {\n const original = itemOfContent(p)\n const order = (pref ? pref(p, preferenceContext) : []).concat(conts.map((c) => c.id))\n let placed = false\n // the item asked for first; if it fits no slot, the smallest of the same category that fits\n for (const id of candidates(original, type)) {\n const def = hh.items[id]\n const qty = Math.max(1, Math.min(p.count || 1, (def && def.stack) || 1))\n for (const cid of order) {\n const c = conts.find((x) => x.id === cid)\n if (!c) continue\n for (let i = 0; i < c.slots.length && !placed; i++) {\n if (contents[cid]![i] || !GI.fitsSlot(id, c.slots[i], hh.items)) continue\n const data: Json = { source: p.itemId, group: p.group, pickable: p.pickable !== false }\n if (id !== original) data.substituteFor = original\n contents[cid]![i] = { type: id, qty, data }\n placed = true\n }\n if (placed) break\n }\n if (placed) break\n }\n if (!placed) rejected.push(p)\n }\n return { contents, rejected }\n }\n\n // ---- plan ----\n function plan(res: Json, popts: Json = {}): Json {\n popts = popts || {}\n const o = { ox: popts.originX || 0, oz: popts.originZ || 0, inw: popts.inw || 1, base: popts.base || 0 }\n const K = conv(o)\n const floorSel = popts.floor\n const externals = popts.externals !== false\n const seed = popts.seed != null ? popts.seed : res.seed\n const palette = paletteOf(res)\n const onFloor = (f: number, outdoor?: boolean): boolean => floorSel == null || f === floorSel || ((outdoor || f < 0) && externals)\n const utilities = res.utilities || {}\n const electrical = utilities.electrical || null\n const circuits: Json[] = (electrical && electrical.circuits) || []\n const contents: Json = res.contents || {}\n\n const result: Json = {\n version: ADAPTER_VERSION,\n template: res.template,\n seed: res.seed,\n floor: floorSel == null ? null : floorSel,\n items: [] as Json[],\n outlets: [] as string[], // ids of the wall_socket entries\n switches: [] as string[], // ids of the wall_switch entries\n lights: [] as string[], // ids of the lamps (inside and outside)\n lanterns: [] as string[], // ids of the lanterns (lantern_lamp): kerosene/gas light, no grid\n canisters: [] as string[], // ids of the small camping cylinders (gas_canister)\n serviceEntrance: null as string | null,\n panel: null as string | null, // id of the electrical_panel entry (distribution board)\n meter: null as string | null, // id of the power_meter entry (meter box on the facade or the pillar)\n conduits: [] as string[],\n cylinders: [] as Json[], // { id, stove, place }\n stoves: [] as string[],\n fixtures: [] as Json[], // { object, fixture, global, point, pointKind }\n points: {} as Record<string, string>, // global fixture -> point of the plumbing\n mapped: [] as string[], // ids of furniture of the plan that became objects of the kit (the renderer does not need to draw them)\n chairs: [] as string[], // ids of the chairs the adapter put around the tables (origin = the table, which the renderer keeps drawing)\n unmapped: {} as Record<string, number>, // \"category/type\" -> count\n discarded: 0, // stacks of content that fit no slot\n warnings: [] as string[],\n origin: { x: o.ox, z: o.oz, inw: o.inw, base: o.base },\n }\n const byOrigin = new Map<string, Json[]>() // id of the furniture of the plan -> entries\n\n const seedOf = (id: string): number => GI.hashString(String(seed) + ':' + seedKey(id))\n\n function push(e: Json): Json {\n result.items.push(e)\n if (!byOrigin.has(e.origin)) byOrigin.set(e.origin, [])\n byOrigin.get(e.origin)!.push(e)\n return e\n }\n\n function baseItem(m: Json): Json {\n const item: Json = {\n x: K.x(m.x),\n z: K.z(m.z),\n ry: m.frontU != null ? K.ry(m.frontU, m.frontV) : r3(m.ry || 0),\n w: m.w,\n d: m.d,\n h: m.h,\n y: m.y || 0,\n seed: seedOf(m.id),\n palette,\n }\n const color = colorOf(res, m.color)\n if (color != null) item.color = color\n return item\n }\n\n function entry(id: string, type: string, item: Json, origin: string, floor: number, extra?: Json): Json {\n return Object.assign({ id, type, item, origin, floor, floorY: floorYOf(res, o, floor), connections: {} }, extra || {})\n }\n\n // Stores the stacks in the first destination that takes them; what did not fit goes to the next destination. Every destination gets an explicit list (empty where\n // nothing fit: the draw of the kit does not enter). What is left at the end counts in `discarded`.\n function store(targets: [string, Json][], stacks: Json[] | undefined): void {\n let rest = stacks || []\n for (const [type, item] of targets) {\n const d = distribute(type, item, rest)\n item.contents = Object.assign(item.contents || {}, d.contents)\n rest = d.rejected\n }\n result.discarded += rest.length\n }\n\n // cylinders \"under the counter\": the plan puts them in the gap of the stove (`on` is the slot of the stove, `hidden`); what hides them is the base cabinet of the\n // nearest kitchen (kitchen_cabinet_base: the sink with a cabinet or the tv unit). The register only works with the door of that cabinet open:\n // `requires: { object, part }` (the kit carries this to InteractionSpec.requires).\n const hidden: Json[] = []\n function distRect(c: Json, x: number, z: number): number {\n const dx = x - c.item.x\n const dz = z - c.item.z\n const s = Math.sin(c.item.ry)\n const co = Math.cos(c.item.ry)\n const lx = dx * co - dz * s\n const lz = dx * s + dz * co\n return Math.hypot(Math.max(Math.abs(lx) - (c.item.w || 0) / 2, 0), Math.max(Math.abs(lz) - (c.item.d || 0) / 2, 0))\n }\n function hideCylinders(): void {\n for (const b of hidden) {\n let target: Json = null\n for (const c of result.items) {\n if (c.type !== 'kitchen_cabinet_base' || c.floor !== b.floor) continue\n const dist = distRect(c, b.item.x, b.item.z)\n if (!target || dist < target.dist) target = { c, dist }\n }\n if (!target) {\n result.warnings.push(msg('warn.cylinderNoCabinet', { id: b.id }))\n continue\n }\n // the door whose latch (toggle_part interaction of a hinge part) is nearest the cylinder, in world coordinates\n const c = target.c\n const spec = hh.build(c.type, c.item, HH.createRecorder().api)\n const sn = Math.sin(c.item.ry)\n const cs = Math.cos(c.item.ry)\n let door: Json = null\n for (const it of spec.interactions || []) {\n const pt = it.action && it.action.do === 'toggle_part' ? (spec.parts || []).find((q: Json) => q.id === it.action.part) : null\n if (!pt || pt.motion.kind !== 'hinge') continue\n const wx = c.item.x + it.pos[0] * cs + it.pos[2] * sn\n const wz = c.item.z - it.pos[0] * sn + it.pos[2] * cs\n const dist = Math.hypot(wx - b.item.x, wz - b.item.z)\n if (!door || dist < door.dist) door = { id: pt.id, dist }\n }\n if (!door) {\n result.warnings.push(msg('warn.cabinetNoDoor', { cabinet: c.id, id: b.id }))\n continue\n }\n b.item.requires = { object: c.id, part: door.id }\n }\n }\n\n // lantern: lights with `lightsOn` (as the lamps) or at night in a house that is not abandoned\n function initialLanternLight(id: string, e: Json): boolean {\n const v = popts.lightsOn\n if (typeof v === 'function') return !!v(id, e)\n if (typeof v === 'boolean') return v\n return !!popts.night && res.state !== 'abandoned'\n }\n\n // chimney of the structure pack (`structureExtras.chimney`) and the item it belongs to. The team's chimney carried the id of its fireplace or stove; the kit's has only\n // `kind` (`fireplace`, `flue`): a chimney names its item in `fireplace` / `stove` when it has them, otherwise the first fireplace (kind fireplace) or wood stove (kind flue).\n const chimney: Json = (res.structureExtras && res.structureExtras.chimney) || null\n const firstOfType = (type: string): Json => (res.items || []).find((m: Json) => typeMap[m.type] && typeMap[m.type]!.type === type)\n function chimneyOf(m: Json, role: 'fireplace' | 'stove'): Json {\n if (!chimney) return null\n const named = role === 'fireplace' ? chimney.fireplace : chimney.stove\n if (named != null) return named === m.id ? chimney : null\n const first = firstOfType(role === 'fireplace' ? 'fireplace' : 'wood_stove')\n return chimney.kind === (role === 'fireplace' ? 'fireplace' : 'flue') && first && first.id === m.id ? chimney : null\n }\n const chimneyHeight = (ch: Json): number | undefined => (ch.height != null ? ch.height : ch.top)\n\n // The team's `res.gas` of the campsite named the first camp stove and the first small cylinder; the kit's plan has no gas there (the stoves of the gas planner are\n // the `stove` category), so the adapter reads the same two items.\n const campStove = firstOfType('camp_stove')\n const campCylinder = firstOfType('gas_canister')\n\n // fireplace: the pack draws the whole fireplace (45 cm deep firebox, floor hearth and chimney breast up to the ceiling), 1.0 m deep; the plan reserves only the wall of 0.5 m.\n // Its back is against the wall: the centre moves half the difference. The smoke comes out of the top of the outside chimney (`structureExtras.chimney`), which the house\n // renderer keeps drawing.\n function planFireplace(m: Json, e: Json, item: Json): void {\n const def = hh.types.find((t: Json) => t.id === 'fireplace')\n const lack = (def.d - m.d) / 2\n item.x = r3(item.x + Math.sin(item.ry) * lack)\n item.z = r3(item.z + Math.cos(item.ry) * lack)\n const room = (res.rooms || []).find((c: Json) => c.id === m.room && c.floor === m.floor)\n const f = (res.floors || []).find((x: Json) => x.index === m.floor)\n item.h = r3((room && room.ceiling) || (f && f.ceiling) || 2.6)\n const ch = chimneyOf(m, 'fireplace')\n if (ch) {\n if (ch.material === 'stone') item.variant = 'stone'\n const cx = K.x((ch.aabb[0] + ch.aabb[2]) / 2)\n const cz = K.z((ch.aabb[1] + ch.aabb[3]) / 2)\n // top of the outside chimney, in world coordinates (y is absolute in the plan + the base)\n e.connections.chimneyTop = [cx, r3(o.base + (chimneyHeight(ch) as number)), cz]\n }\n }\n\n function planSimple(m: Json, map: TypeMapEntry): void {\n const item = baseItem(m)\n const dim = map.dim === 'none' ? '' : map.dim || 'wdh'\n for (const k of ['w', 'd', 'h']) if (dim.indexOf(k) < 0) delete item[k]\n if (map.dim === 'none') delete item.y\n if (map.variant) item.variant = map.variant\n // the TV of the plan is a 10 cm blade: the drawing needs at least the foot\n if (map.type === 'tv') item.d = Math.max(item.d || 0, 0.2)\n const e = entry(m.id, map.type as string, item, m.id, m.floor)\n if (contents[m.id]) store([[map.type as string, item]], contents[m.id])\n if (m.outlet) e.connections.outlet = m.outlet\n if (map.type === 'shower') e.connections.shower = m.showerHeater || { electric: false }\n if (map.type === 'stove') {\n result.stoves.push(e.id)\n e.connections.gas = m.gas || 'cylinder'\n e.connections.cylinder = m.cylinder || null\n }\n if (map.type === 'gas_bottle') result.cylinders.push({ id: e.id, stove: m.link || null, place: m.placement || null })\n if (map.type === 'gas_canister') {\n result.canisters.push(e.id)\n if (campCylinder && campCylinder.id === m.id && campStove) result.cylinders.push({ id: e.id, stove: campStove.id, place: null }) // the camp stove uses this cylinder\n }\n if (map.type === 'wood_stove') {\n // the flue of the wood stove goes out through the roof: it rises to the height of the top of the chimney (`structureExtras.chimney`, absolute y of the plan)\n const ch = chimneyOf(m, 'stove')\n if (ch && chimneyHeight(ch)) {\n const f = (res.floors || []).find((x: Json) => x.index === m.floor)\n const high = r3((chimneyHeight(ch) as number) - (f ? f.y0 : 0) - (m.y || 0))\n item.h = high\n item.flueHeight = high\n }\n }\n if (map.type === 'fireplace') planFireplace(m, e, item)\n if (map.type === 'lantern_lamp') {\n e.lit = initialLanternLight(m.id, e)\n item.on = e.lit\n result.lanterns.push(e.id)\n }\n if (map.type === 'gas_bottle' && m.placement === 'under_counter') hidden.push(e)\n push(e)\n }\n\n // sink: basin + base cabinet (+ wall cabinet). washbasin: bathroom basin (+ wall cabinet when there is content). rustic_sink: basin the whole width, no cabinet under it; wall cabinet only if it has content\n function planCompound(m: Json, kind: string): void {\n const ry = m.frontU != null ? K.ry(m.frontU, m.frontV) : r3(m.ry || 0)\n const cx = K.x(m.x)\n const cz = K.z(m.z)\n const part = (id: string, type: string, w: number, d: number, h: number, y: number, lx: number, lz: number): Json => {\n const [dx, dz] = K.off(ry, lx, lz)\n const item = baseItem(m)\n item.x = r3(cx + dx)\n item.z = r3(cz + dz)\n item.ry = ry\n item.w = r3(w)\n item.d = r3(d)\n item.h = r3(h)\n item.y = y\n item.seed = seedOf(id)\n return entry(id, type, item, m.id, m.floor)\n }\n const list: Json[] = []\n const overhead = contents[m.id + '#overhead']\n if (kind === 'rustic_sink') {\n const dd = Math.max(m.d, 0.56) // the drawing of the basin needs at least 56 cm of depth; it grows to the front and the back stays on the wall\n const basin = part(m.id, 'sink_kitchen', m.w, dd, m.h + 0.3, 0, 0, -(dd - m.d) / 2)\n list.push(basin)\n const over = overhead || []\n if (m.overhead !== false && over.length) {\n const wall = part(m.id + '#overhead', 'kitchen_cabinet_wall', m.w, 0.35, 0.6, 1.55, 0, -(m.d / 2) + 0.175)\n store([['kitchen_cabinet_wall', wall.item]], over)\n list.push(wall)\n }\n if (contents[m.id]) store([['sink_kitchen', basin.item]], contents[m.id])\n if (m.outlet) basin.connections.outlet = m.outlet\n } else if (kind === 'sink') {\n const width = m.w\n const basinW = width >= 1.5 ? 1.0 : Math.max(0.6, Math.min(0.8, width - 0.3))\n const rest = r3(width - basinW)\n const left = seedOf(m.id) % 2 === 0 // side of the basin, decided by the seed\n const sink = part(m.id, 'sink_kitchen', basinW, m.d, m.h + 0.25, 0, left ? -(width / 2) + basinW / 2 : width / 2 - basinW / 2, 0)\n list.push(sink)\n let cabinet: Json = null\n if (rest >= 0.35) {\n cabinet = part(m.id + '#cabinet', 'kitchen_cabinet_base', rest, m.d, m.h, 0, left ? width / 2 - rest / 2 : -(width / 2) + rest / 2, 0)\n list.push(cabinet)\n }\n if (contents[m.id]) store(cabinet ? [['kitchen_cabinet_base', cabinet.item], ['sink_kitchen', sink.item]] : [['sink_kitchen', sink.item]], contents[m.id])\n if (m.overhead !== false) {\n // y 1.55 to 2.15 m, against the back wall of the counter\n const wall = part(m.id + '#overhead', 'kitchen_cabinet_wall', width, 0.35, 0.6, 1.55, 0, -(m.d / 2) + 0.175)\n store([['kitchen_cabinet_wall', wall.item]], overhead || [])\n list.push(wall)\n }\n if (m.outlet) sink.connections.outlet = m.outlet\n } else {\n const basin = part(m.id, 'sink_bathroom', m.w, m.d, m.h + 0.2, 0, 0, 0)\n list.push(basin)\n if (contents[m.id]) {\n if (contents[m.id].length) {\n const cabinet = part(m.id + '#cabinet', 'bathroom_cabinet', Math.max(0.45, Math.min(0.6, m.w)), 0.15, 0.75, 1.3, 0, -(m.d / 2) + 0.075)\n list.push(cabinet)\n store([['bathroom_cabinet', cabinet.item], ['sink_bathroom', basin.item]], contents[m.id])\n } else {\n store([['sink_bathroom', basin.item]], [])\n }\n }\n }\n for (const e of list) push(e)\n }\n\n // circuit of the lamp: the one that lists it, otherwise the one of the switch that controls it, otherwise a standalone circuit (the stair light, for example)\n function circuitOfLight(id: string): string {\n const direct = circuits.find((c) => (c.lamps || []).indexOf(id) >= 0)\n if (direct) return direct.id\n const sw = ((electrical && electrical.switches) || []).find((s: Json) => (s.controls || []).indexOf(id) >= 0)\n const viaSwitch = sw && circuits.find((c) => (c.switches || []).indexOf(sw.id) >= 0)\n return viaSwitch ? viaSwitch.id : 'standalone_circuit'\n }\n\n function planLamp(m: Json, map: TypeMapEntry): void {\n const item = baseItem(m)\n delete item.palette\n const e = entry(m.id, 'lamp', item, m.id, m.floor, { watts: map.watts })\n e.connections.circuit = circuitOfLight(m.id)\n e.lit = initialLight(res, popts, m.id, e)\n push(e)\n result.lights.push(e.id)\n }\n\n // ---- furniture ----\n for (const m of res.items || []) {\n if (!onFloor(m.floor, m.outdoor)) continue\n const map = typeMap[m.type]\n if (!map) {\n const k = m.category + '/' + m.type\n result.unmapped[k] = (result.unmapped[k] || 0) + 1\n continue\n }\n result.mapped.push(m.id)\n if (map.type === 'lamp') planLamp(m, map)\n else if (map.compound) planCompound(m, map.compound)\n else planSimple(m, map)\n }\n\n // ---- chairs around the tables (the plan puts none) ----\n // Position in (u, v) of the plan: centre of the table + p * lx + f * lz, with f the front of the table and p = (-fv, fu) the direction of the width. The chair looks at the\n // table (the front of the kit object is the side the sitter looks at). It only goes where there is no wall and no other furniture.\n result.chairs = []\n if (opts.chairs !== false && popts.chairs !== false) {\n const blocked = blockedOf(res, { originX: o.ox, originZ: o.oz, inw: o.inw })\n const floorKind = (q: Json) => !q.decor && !q.flat && (q.y || 0) < 0.9 && q.aabb\n const placed: number[][] = []\n const free = (m: Json, cu: number, cv: number, half: number): boolean => {\n const a = [cu - half + 0.03, cv - half + 0.03, cu + half - 0.03, cv + half - 0.03]\n for (const [dx, dz] of [[-1, -1], [1, -1], [-1, 1], [1, 1], [0, 0]] as const) if (blocked(K.x(cu + dx * half * 0.9), K.z(cv + dz * half * 0.9), m.floor)) return false\n for (const q of res.items || []) {\n if (q === m || !floorKind(q) || (q.floor !== m.floor && !(q.outdoor && m.outdoor))) continue\n if (a[0]! < q.aabb[2] && a[2]! > q.aabb[0] && a[1]! < q.aabb[3] && a[3]! > q.aabb[1]) return false\n }\n for (const c of placed) if (a[0]! < c[2]! && a[2]! > c[0]! && a[1]! < c[3]! && a[3]! > c[1]! && c[4] === m.floor) return false\n placed.push([a[0]!, a[1]!, a[2]!, a[3]!, m.floor])\n return true\n }\n for (const m of res.items || []) {\n const mode = chairTables[m.type]\n if (!mode || !onFloor(m.floor, m.outdoor) || m.frontU == null) continue\n const f = [m.frontU, m.frontV] as const\n const pp = [-m.frontV, m.frontU] as const\n const seats: [number, number, readonly [number, number]][] = [] // [lx, lz, direction of the look (fu, fv)]\n if (mode === 'dining') {\n const n = Math.max(1, Math.min(3, Math.floor((m.w - 0.1) / 0.55)))\n for (const side of [1, -1]) {\n for (let i = 0; i < n; i++) seats.push([(i - (n - 1) / 2) * (m.w / n), side * (m.d / 2 + 0.17), [-side * f[0], -side * f[1]]])\n }\n if (m.w >= 1.6) for (const side of [1, -1]) seats.push([side * (m.w / 2 + 0.17), 0, [-side * pp[0], -side * pp[1]]])\n } else {\n seats.push([0, m.d / 2 + 0.2, [-f[0], -f[1]]])\n }\n seats.forEach((lg, i) => {\n const cu = r3(m.x + pp[0] * lg[0] + f[0] * lg[1])\n const cv = r3(m.z + pp[1] * lg[0] + f[1] * lg[1])\n const half = mode === 'dining' ? chairSide / 2 : 0.3\n if (!free(m, cu, cv, half)) return\n const id = m.id + '#chair' + (i + 1)\n const item: Json = { x: K.x(cu), z: K.z(cv), ry: K.ry(lg[2][0], lg[2][1]), seed: seedOf(id), palette }\n if (mode !== 'dining') {\n item.w = 0.6\n item.d = 0.6\n item.h = 0.95\n }\n const e = push(entry(id, mode === 'dining' ? 'dining_chair' : 'armchair', item, m.id, m.floor))\n result.chairs.push(e.id)\n })\n }\n }\n\n function conduit(id: string, pts: number[][], floor: number): void {\n const x0 = K.x(pts[0]![0]!)\n const z0 = K.z(pts[0]![1]!)\n const item = {\n x: x0,\n z: z0,\n ry: 0,\n seed: seedOf(id),\n // the points of the plan already have the absolute y of the world: the object stays on the base ground and not on the floor of the storey\n points: pts.map((p) => [r3(K.x(p[0]!) - x0), p[2], r3(K.z(p[1]!) - z0)]),\n }\n const e = entry(id, 'conduit_run', item, id, floor)\n e.floorY = o.base\n push(e)\n result.conduits.push(e.id)\n }\n\n // ---- electrical ----\n if (electrical) {\n for (const l of electrical.outdoorLamps || []) {\n if (!onFloor(-1, true)) continue\n const e = entry(l.id, 'lamp', { x: K.x(l.u), z: K.z(l.v), ry: 0, y: l.y, seed: seedOf(l.id) }, l.id, -1, { watts: 15 })\n e.connections.circuit = circuitOfLight(l.id)\n e.lit = initialLight(res, popts, l.id, e)\n push(e)\n result.lights.push(e.id)\n }\n for (const t of electrical.outlets || []) {\n if (!onFloor(t.floor, false)) continue\n const c = circuits.find((x) => (x.outlets || []).indexOf(t.id) >= 0)\n const item: Json = { x: K.x(t.u), z: K.z(t.v), ry: K.ry(t.frontU, t.frontV), y: t.y, seed: seedOf(t.id) }\n if (c) item.circuit = c.id\n const e = entry(t.id, 'wall_socket', item, t.id, t.floor)\n e.connections.circuit = c ? c.id : null\n push(e)\n result.outlets.push(e.id)\n }\n const lights = new Set<string>(result.lights)\n for (const s of electrical.switches || []) {\n if (!onFloor(s.floor, false)) continue\n const item: Json = { x: K.x(s.u), z: K.z(s.v), ry: K.ry(s.frontU, s.frontV), y: s.y, seed: seedOf(s.id) }\n // global device ids (\"object:device\"): each lamp is an object with the `lamp` device\n item.controls = (s.controls || []).map((id: string) => id + ':lamp')\n const e = entry(s.id, 'wall_switch', item, s.id, s.floor)\n e.connections.controls = (s.controls || []).slice()\n e.lit = e.connections.controls.some((id: string) => (result.items.find((x: Json) => x.id === id) || {}).lit === true) // the key follows the lamps\n if (floorSel == null) for (const id of s.controls || []) if (!lights.has(id)) result.warnings.push(msg('warn.switchUnknownLamp', { id: s.id, lamp: id }))\n push(e)\n result.switches.push(e.id)\n }\n const ee = electrical.serviceEntrance\n if (ee && ee.pole && onFloor(-1, true)) {\n const drop: number[][] = ee.drop || []\n const end = drop.length ? drop[drop.length - 1]! : [ee.pole.u, ee.pole.v, 2.6]\n const px = K.x(ee.pole.u)\n const pz = K.z(ee.pole.v)\n const item: Json = {\n x: px,\n z: pz,\n ry: 0,\n h: ee.pole.h,\n seed: seedOf('service_entrance'),\n // point where the drop reaches the house, in local coordinates of the pole (absolute y)\n house: [r3(K.x(end[0]!) - px), end[2], r3(K.z(end[1]!) - pz)],\n }\n if (ee.tap || electrical.mode === 'tap') item.variant = 'gato' // illegal tap: the drop leaves the pole straight to the house, with no meter box\n const e = entry('service_entrance', 'service_entrance', item, 'service_entrance', -1)\n push(e)\n result.serviceEntrance = e.id\n if (ee.descent && ee.descent.length > 1) conduit('conduit_descent', ee.descent, -1)\n }\n // distribution board: one breaker per circuit of the plan (the label is the room); against the wall (u, v is the plane of it)\n const q = electrical.panel\n if (q && onFloor(q.floor, false)) {\n const hdq = 0.06\n const ryq = K.ry(q.frontU, q.frontV)\n const item: Json = {\n x: r3(K.x(q.u) + Math.sin(ryq) * hdq),\n z: r3(K.z(q.v) + Math.cos(ryq) * hdq),\n ry: ryq,\n y: q.y,\n seed: seedOf('panel'),\n circuits: circuits.map((c) => ({ id: c.id, label: c.room })),\n }\n if (!item.circuits.length) delete item.circuits\n const e = entry('panel', 'electrical_panel', item, 'panel', q.floor)\n push(e)\n result.panel = e.id\n }\n // meter box (on the facade or on the gate pillar), facing out\n const med = ee && ee.meter\n if (med && onFloor(-1, true)) {\n const hdm = 0.08\n const item = { x: K.x(med.u), z: r3(K.z(med.v) - o.inw * hdm), ry: K.ry(0, -1), y: med.y, seed: seedOf('meter') }\n const e = entry('meter', 'power_meter', item, 'meter', -1)\n push(e)\n result.meter = e.id\n }\n for (const ed of electrical.conduits || []) {\n if (!ed.exposed || !ed.points || ed.points.length < 2) continue\n const circ = circuits.find((c) => c.id === ed.circuit)\n const floor = circ ? circ.floor : 0\n if (!onFloor(floor, false)) continue\n conduit(ed.id, ed.points, floor)\n }\n }\n\n // ---- gas ----\n const piped = result.items.filter((e: Json) => e.type === 'stove' && e.connections.gas === 'piped')\n if (piped.length) {\n // the kit only knows gas in cylinders: piped gas becomes a source with no valve near the meter\n const med = utilities.gas && utilities.gas.meter\n const ref = med ? { x: K.x(med.u), z: K.z(med.v), y: med.y || 1 } : { x: piped[0].item.x, z: piped[0].item.z, y: 0.3 }\n const e = entry('piped_gas', 'gas_piped', { x: ref.x, z: ref.z, ry: 0, y: ref.y, seed: seedOf('piped_gas') }, 'piped_gas', piped[0].floor)\n e.floorY = o.base\n push(e)\n for (const f of piped) f.connections.fuel = 'piped_gas:gas'\n }\n for (const b of result.cylinders) {\n const stove = result.items.find((e: Json) => e.id === b.stove)\n if (stove) stove.connections.fuel = b.id + ':gas'\n }\n\n // ---- plumbing ----\n const plumbing = utilities.plumbing\n if (plumbing) {\n const isCabinet = (t: string): boolean => t === 'kitchen_cabinet_base' || t === 'kitchen_cabinet_wall' || t === 'bathroom_cabinet'\n for (const p of plumbing.points || []) {\n const target = (byOrigin.get(p.item) || []).filter((e) => !isCabinet(e.type))[0]\n if (!target) {\n if (floorSel == null) result.warnings.push(msg('warn.pointNoObject', { id: p.id, kind: p.kind, item: p.item }))\n continue\n }\n target.point = p.id\n target.connections.flowLpm = p.flowLpm\n for (const f of fixturesOfPoint[p.kind] || []) {\n result.fixtures.push({ object: target.id, fixture: f, global: target.id + ':' + f, point: p.id, pointKind: p.kind })\n result.points[target.id + ':' + f] = p.id\n }\n }\n }\n hideCylinders()\n return result\n }\n\n // ---- own objects of the adapter ----\n function ownSpec(entry: Json): Json {\n if (entry.type === 'lamp') {\n const dev: Json = { id: 'lamp', kind: 'lamp', watts: entry.watts || 15, on: !!entry.lit }\n if (entry.connections.circuit) dev.circuit = entry.connections.circuit\n return { type: 'lamp', devices: [dev] }\n }\n if (entry.type === 'gas_piped') return { type: 'gas_piped', fuels: [{ id: 'gas', kind: 'gas', capacity: 1000, level: 1000 }] }\n throw new Error(msg('error.unknownOwnType', { type: entry.type }))\n }\n\n // Wires what the plan has already decided: the outlet of the appliance, the cylinder of the stove, the circuit of the shower, the water inlet of the machine.\n function connect(entry: Json, spec: Json): Json {\n const L = entry.connections || {}\n if (entry.type === 'wall_switch') for (const p of spec.parts || []) if (p.id === 'rocker') p.t0 = entry.lit ? 1 : 0 // the key at the position of the lamps\n if (entry.type !== 'shower') {\n for (const dv of spec.devices || []) if (L.outlet && dv.socket === 'auto') dv.socket = L.outlet + ':socket'\n } else {\n const sh = L.shower || {}\n const heater = (spec.devices || []).find((d: Json) => d.id === 'heater')\n if (heater && sh.electric === false) {\n spec.devices = spec.devices.filter((d: Json) => d !== heater)\n for (const f of spec.fixtures || []) if (f.heater === 'heater') delete f.heater\n } else if (heater) {\n if (sh.powerW) heater.watts = sh.powerW\n if (L.outletCircuit) heater.circuit = L.outletCircuit\n }\n }\n if ((entry.type === 'stove' || entry.type === 'camp_stove') && L.fuel) for (const b of spec.burners || []) if (b.fuel === 'auto') b.fuel = L.fuel\n if (entry.type === 'fireplace' && L.chimneyTop) {\n // the smoke comes out of the top of the outside chimney: the world point goes back to the local coordinates of the object\n const it = entry.item\n const dx = L.chimneyTop[0] - it.x\n const dz = L.chimneyTop[2] - it.z\n const lx = Math.cos(it.ry) * dx - Math.sin(it.ry) * dz\n const lz = Math.sin(it.ry) * dx + Math.cos(it.ry) * dz\n for (const em of spec.emitters || []) if (em.kind === 'smoke') em.pos = [r3(lx), r3(L.chimneyTop[1] - entry.floorY + 0.02), r3(lz)]\n }\n if (entry.type === 'washing_machine' && entry.point) {\n // the pack already brings the water inlet (`inlet`, tied to the appliance: it runs while the cycle runs); here only the flow of the project and the network\n spec.fixtures = spec.fixtures || []\n const inlet = spec.fixtures.find((f: Json) => f.id === 'inlet')\n if (inlet) {\n if (L.flowLpm) inlet.flow = L.flowLpm\n inlet.tank = 'auto'\n } else {\n spec.fixtures.push({ id: 'inlet', kind: 'hose', outlet: [0, 0.3, -(entry.item.d || 0.6) / 2], flow: L.flowLpm || 8, tank: 'auto' })\n }\n }\n return spec\n }\n\n // ---- create the world ----\n function createWorld(res: Json, copts: Json = {}): Json {\n copts = copts || {}\n const info = { points: new Map<string, string>(), water: copts.water || null, lightsOn: copts.lightsOn }\n const electrical = res.utilities && res.utilities.electrical\n const world = GI.createWorld({\n locale,\n strings: hh.strings,\n items: hh.items,\n loot: hh.loot,\n seed: copts.seed != null ? copts.seed : res.seed,\n // no grid: the cabin and the off-grid campsite have no service entrance, sockets or electric lamps (lanterns do not need a grid)\n grid: copts.grid != null ? !!copts.grid : !!electrical && electrical.mode !== 'offgrid',\n onEvent: copts.onEvent,\n canInteract: copts.canInteract,\n waterSupply: {\n draw(fixtureId: string, l: number) {\n if (!info.water) return l\n const point = info.points.get(fixtureId)\n return point == null ? l : info.water.consume(point, l)\n },\n },\n })\n worlds.set(world, info)\n return world\n }\n\n function pointOf(world: object, fixtureId: string): string | undefined {\n const info = worlds.get(world)\n return info ? info.points.get(fixtureId) : undefined\n }\n\n // ---- walls -> blocked ----\n // (x, z, floor) -> true inside a wall. The gap of the doors already comes open in `walls`. `margin` shrinks the wall on each side (2 cm) so furniture against it does not count as \"inside\".\n function blockedOf(res: Json, bopts: Json = {}): (x: number, z: number, floor?: number | null) => boolean {\n bopts = bopts || {}\n const ox = bopts.originX || 0\n const oz = bopts.originZ || 0\n const inw = bopts.inw || 1\n const margin = bopts.margin != null ? bopts.margin : 0.02\n const segs = (res.walls || []).map((p: Json) => {\n const e = Math.max(0, p.thickness / 2 - margin)\n const u0 = Math.min(p.u0, p.u1) - (p.axis === 'u' ? 0 : e)\n const u1 = Math.max(p.u0, p.u1) + (p.axis === 'u' ? 0 : e)\n const v0 = Math.min(p.v0, p.v1) - (p.axis === 'v' ? 0 : e)\n const v1 = Math.max(p.v0, p.v1) + (p.axis === 'v' ? 0 : e)\n const za = oz + inw * v0\n const zb = oz + inw * v1\n return { floor: p.floor, x0: ox + u0, x1: ox + u1, z0: Math.min(za, zb), z1: Math.max(za, zb) }\n })\n // index by cell of 0.5 m and floor: fitSweep calls this thousands of times per object\n const CELL = 0.5\n const grid = new Map<number, Json[]>()\n const key = (a: number, i: number, j: number): number => (a * 4096 + (i + 2048)) * 4096 + (j + 2048)\n for (const s of segs) {\n for (let i = Math.floor(s.x0 / CELL); i <= Math.floor(s.x1 / CELL); i++) {\n for (let j = Math.floor(s.z0 / CELL); j <= Math.floor(s.z1 / CELL); j++) {\n const k = key(s.floor, i, j)\n if (!grid.has(k)) grid.set(k, [])\n grid.get(k)!.push(s)\n }\n }\n }\n // object of the lot (floor -1) against the house: the wall of the ground floor counts\n return function blocked(x: number, z: number, floor?: number | null): boolean {\n const a = floor == null || floor < 0 ? 0 : floor\n const list = grid.get(key(a, Math.floor(x / CELL), Math.floor(z / CELL)))\n if (!list) return false\n for (const s of list) if (x > s.x0 && x < s.x1 && z > s.z0 && z < s.z1) return true\n return false\n }\n }\n\n // ---- add ----\n function add(world: Json, planned: Json, aopts: Json = {}): Json {\n aopts = aopts || {}\n const info = worlds.get(world)\n const build = aopts.build || ((type: string, item: Json) => hh.build(type, item, HH.createRecorder().api))\n const isBlocked = aopts.isBlocked || null\n const out: Json = { added: 0, parts: [] as Json[], hinges: {} as Record<string, string>, moved: {} as Record<string, number>, warnings: [] as string[] }\n // initial state of the lights: `lightsOn` of add, otherwise the one of createWorld, otherwise what the plan decided (`entry.lit`)\n const override = aopts.lightsOn !== undefined ? aopts.lightsOn : info && info.lightsOn\n if (override !== undefined) {\n for (const e of planned.items) if (e.type === 'lamp') e.lit = typeof override === 'function' ? !!override(e.id, e) : !!override\n for (const e of planned.items) if (e.type === 'lantern_lamp') e.lit = typeof override === 'function' ? !!override(e.id, e) : !!override\n for (const e of planned.items) if (e.type === 'wall_switch') e.lit = (e.connections.controls || []).some((id: string) => (planned.items.find((x: Json) => x.id === id) || {}).lit === true)\n }\n for (const e of planned.items) if (e.type === 'lantern_lamp') e.item.on = !!e.lit // the lantern is born in the state of the plan\n let scratch: Json = null // disposable world to test the side of the hinge without drawing anything\n\n // Measures how much the hinge parts open (fitSweep) with a hinge side and a setback from the front, in a disposable world.\n function probe(e: Json, hinge: string | undefined, setback: number): { sum: number; min: number; n: number } {\n if (!scratch) scratch = GI.createWorld({ locale, strings: hh.strings, items: hh.items, loot: hh.loot, grid: false })\n const it = e.item\n const x = it.x + Math.sin(it.ry) * setback\n const z = it.z + Math.cos(it.ry) * setback\n const spec = hh.build(e.type, Object.assign({}, it, { hinge }), HH.createRecorder().api)\n scratch.add('__probe', spec, { x, y: e.floorY, z, ry: it.ry })\n const blocks = (px: number, pz: number): boolean => isBlocked(px, pz, e.floor)\n let sum = 0\n let min = 1\n let n = 0\n for (const p of spec.parts || []) {\n if (p.motion.kind !== 'hinge' || !(p.bounds || p.sweep)) continue\n const t = scratch.fitSweep('__probe', p.id, blocks)\n sum += t\n min = Math.min(min, t)\n n++\n }\n scratch.remove('__probe')\n return { sum, min, n }\n }\n\n const better = (a: { sum: number; min: number }, b: { sum: number; min: number }): boolean => a.sum > b.sum + 1e-9 || (Math.abs(a.sum - b.sum) <= 1e-9 && a.min > b.min + 1e-9)\n\n // Hinged doors: keeps the side where fitSweep gives the greatest t (tie: the default of the type). If a part still does not open fully, tries moving the object away from\n // the wall up to 4 cm along the front (the plan puts the furniture against the face of the wall and the corner of the lid of a bin, for example, grazes it as it turns).\n // If the default of the type opens everything fully, nothing else is tried.\n function fitDoors(e: Json): void {\n if (!isBlocked || !householdTypes.has(e.type)) return\n const standard = probe(e, undefined, 0)\n if (!standard.n || standard.min >= 1) return\n let bestSide: string | undefined\n let m = standard\n for (const side of ['left', 'right']) {\n const r = probe(e, side, 0)\n if (better(r, m)) {\n m = r\n bestSide = side\n }\n }\n if (bestSide) {\n e.item.hinge = bestSide\n out.hinges[e.id] = bestSide\n }\n if (m.min >= 1) return\n let target = { setback: 0, r: m }\n for (const setback of [0.01, 0.02, 0.03, 0.04]) {\n const r = probe(e, bestSide, setback)\n if (better(r, target.r)) target = { setback, r }\n if (r.min >= 1) break\n }\n if (target.setback > 0 && target.r.sum > m.sum + 0.2) {\n e.item.x = r3(e.item.x + Math.sin(e.item.ry) * target.setback)\n e.item.z = r3(e.item.z + Math.cos(e.item.ry) * target.setback)\n e.moved = target.setback\n out.moved[e.id] = target.setback\n }\n }\n\n // the circuit of the shower is the one of the outlet the plan connected to it\n for (const e of planned.items) {\n if (e.type !== 'shower' || !e.connections.outlet) continue\n const t = planned.items.find((x: Json) => x.id === e.connections.outlet)\n if (t && t.connections.circuit) e.connections.outletCircuit = t.connections.circuit\n }\n\n for (const e of planned.items) {\n let spec: Json\n if (ownTypes[e.type]) {\n spec = ownSpec(e)\n } else {\n fitDoors(e)\n spec = build(e.type, e.item)\n if (!spec) {\n out.warnings.push(msg('warn.buildEmpty', { id: e.id }))\n continue\n }\n }\n connect(e, spec)\n world.add(e.id, spec, { x: e.item.x, y: e.floorY, z: e.item.z, ry: e.item.ry })\n out.added++\n if (!isBlocked) continue\n for (const p of spec.parts || []) {\n if (!(p.bounds || p.sweep)) continue\n const t = world.fitSweep(e.id, p.id, (x: number, z: number) => isBlocked(x, z, e.floor))\n if (t < 1) out.parts.push({ object: e.id, part: p.id, t })\n }\n }\n if (info) for (const f of planned.fixtures) info.points.set(f.global, f.point)\n return out\n }\n\n return { version: ADAPTER_VERSION, household: hh, plan, createWorld, add, blockedOf, pointOf, ownSpec, registries: { typeMap, contentMap, contentByGroup, chairTables, fixturesOfPoint, substitutes, preference, ownTypes } }\n}\n\n// keeps the type import used for the key of messages in the declaration file\nexport type { MessageKey }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,MAAM,KAAK;AAAA,IACT,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,mBAAmB;AAAA,EACrB;AAKA,MAAM,OAAiB;AAAA,IACrB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,mBAAmB;AAAA,EACrB;AAEO,MAAM,UAAoC,EAAE,IAAI,SAAS,KAAK;AAG9D,WAAS,iBAAiB,QAAiB,OAAkG;AAClJ,UAAM,OAAO,UAAU,OAAO,KAAK,MAAM,IAAI,OAAO;AACpD,UAAM,WAAqB,EAAE,GAAG,MAAM,GAAI,SAAS,CAAC,EAAG;AACvD,WAAO,CAAC,KAAK,YAAY,SAAS,GAAG,KAAK,KAAK,QAAQ,cAAc,CAAC,IAAI,SAAkB,UAAU,OAAO,IAAI,MAAM,SAAY,OAAO,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,GAAI;AAAA,EACxK;;;ACTO,MAAM,WAAmD,OAAO,OAAO;AAAA,IAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA;AAAA,IACzB,cAAc,EAAE,MAAM,SAAS;AAAA;AAAA,IAC/B,uBAAuB,EAAE,MAAM,UAAU,SA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