@kerros/editor 0.0.0-stage → 0.1.0-rc.2

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.
Files changed (345) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -2
  3. package/dist/SitePlanner.js +1189 -0
  4. package/dist/SitePlanner.js.map +1 -0
  5. package/dist/adapters/basemap.js +11 -0
  6. package/dist/adapters/basemap.js.map +1 -0
  7. package/dist/adapters/persistence.js +121 -0
  8. package/dist/adapters/persistence.js.map +1 -0
  9. package/dist/adapters/status.js +11 -0
  10. package/dist/adapters/status.js.map +1 -0
  11. package/dist/adapters/useProjectPersistence.js +56 -0
  12. package/dist/adapters/useProjectPersistence.js.map +1 -0
  13. package/dist/components/AiImportPanel.js +635 -0
  14. package/dist/components/AiImportPanel.js.map +1 -0
  15. package/dist/components/AnalysisPreview.js +179 -0
  16. package/dist/components/AnalysisPreview.js.map +1 -0
  17. package/dist/components/ElevatorPanel.js +120 -0
  18. package/dist/components/ElevatorPanel.js.map +1 -0
  19. package/dist/components/Icons.js +57 -0
  20. package/dist/components/Icons.js.map +1 -0
  21. package/dist/components/ImportDialog.js +467 -0
  22. package/dist/components/ImportDialog.js.map +1 -0
  23. package/dist/components/Inspector.js +1184 -0
  24. package/dist/components/Inspector.js.map +1 -0
  25. package/dist/components/NavigatePanel.js +301 -0
  26. package/dist/components/NavigatePanel.js.map +1 -0
  27. package/dist/components/NavigationGraph.js +234 -0
  28. package/dist/components/NavigationGraph.js.map +1 -0
  29. package/dist/components/StructureExplorer.js +510 -0
  30. package/dist/components/StructureExplorer.js.map +1 -0
  31. package/dist/components/StructureView.js +286 -0
  32. package/dist/components/StructureView.js.map +1 -0
  33. package/dist/components/controls.js +209 -0
  34. package/dist/components/controls.js.map +1 -0
  35. package/dist/components/graphLayout.js +27 -0
  36. package/dist/components/graphLayout.js.map +1 -0
  37. package/dist/host.js +175 -0
  38. package/dist/host.js.map +1 -0
  39. package/dist/i18n.js +88 -0
  40. package/dist/i18n.js.map +1 -0
  41. package/dist/import/analysisPreview.js +41 -0
  42. package/dist/import/analysisPreview.js.map +1 -0
  43. package/dist/import/brief.js +29 -0
  44. package/dist/import/brief.js.map +1 -0
  45. package/dist/import/checkpoint.js +50 -0
  46. package/dist/import/checkpoint.js.map +1 -0
  47. package/dist/import/detect.js +120 -0
  48. package/dist/import/detect.js.map +1 -0
  49. package/dist/import/documentSvg.js +49 -0
  50. package/dist/import/documentSvg.js.map +1 -0
  51. package/dist/import/instructions.js +20 -0
  52. package/dist/import/instructions.js.map +1 -0
  53. package/dist/import/openings.js +61 -0
  54. package/dist/import/openings.js.map +1 -0
  55. package/dist/import/planImport.js +233 -0
  56. package/dist/import/planImport.js.map +1 -0
  57. package/dist/import/register.js +47 -0
  58. package/dist/import/register.js.map +1 -0
  59. package/dist/import/runs.js +67 -0
  60. package/dist/import/runs.js.map +1 -0
  61. package/dist/import/session.js +23 -0
  62. package/dist/import/session.js.map +1 -0
  63. package/dist/import/types.js +13 -0
  64. package/dist/import/types.js.map +1 -0
  65. package/dist/import/usage.js +29 -0
  66. package/dist/import/usage.js.map +1 -0
  67. package/dist/import/walls.js +112 -0
  68. package/dist/import/walls.js.map +1 -0
  69. package/dist/index.js +178 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/map/CabinMaterials.js +81 -0
  72. package/dist/map/CabinMaterials.js.map +1 -0
  73. package/dist/map/CabinMirror.js +43 -0
  74. package/dist/map/CabinMirror.js.map +1 -0
  75. package/dist/map/Doors.js +80 -0
  76. package/dist/map/Doors.js.map +1 -0
  77. package/dist/map/ElevatorCabin.js +93 -0
  78. package/dist/map/ElevatorCabin.js.map +1 -0
  79. package/dist/map/FixtureLights.js +117 -0
  80. package/dist/map/FixtureLights.js.map +1 -0
  81. package/dist/map/MapCanvas.js +2161 -0
  82. package/dist/map/MapCanvas.js.map +1 -0
  83. package/dist/map/Passenger.js +69 -0
  84. package/dist/map/Passenger.js.map +1 -0
  85. package/dist/map/SceneLayer.js +1534 -0
  86. package/dist/map/SceneLayer.js.map +1 -0
  87. package/dist/map/UndergroundContext.js +153 -0
  88. package/dist/map/UndergroundContext.js.map +1 -0
  89. package/dist/map/ambience.js +194 -0
  90. package/dist/map/ambience.js.map +1 -0
  91. package/dist/map/architecture.js +305 -0
  92. package/dist/map/architecture.js.map +1 -0
  93. package/dist/map/bathMusic.js +92 -0
  94. package/dist/map/bathMusic.js.map +1 -0
  95. package/dist/map/cameraAim.js +33 -0
  96. package/dist/map/cameraAim.js.map +1 -0
  97. package/dist/map/elevators.js +56 -0
  98. package/dist/map/elevators.js.map +1 -0
  99. package/dist/map/excavation.js +52 -0
  100. package/dist/map/excavation.js.map +1 -0
  101. package/dist/map/exteriors.js +25 -0
  102. package/dist/map/exteriors.js.map +1 -0
  103. package/dist/map/features.js +218 -0
  104. package/dist/map/features.js.map +1 -0
  105. package/dist/map/fences.js +29 -0
  106. package/dist/map/fences.js.map +1 -0
  107. package/dist/map/journey.js +112 -0
  108. package/dist/map/journey.js.map +1 -0
  109. package/dist/map/levels.js +6 -0
  110. package/dist/map/levels.js.map +1 -0
  111. package/dist/map/lighting.js +143 -0
  112. package/dist/map/lighting.js.map +1 -0
  113. package/dist/map/loadBasemap.js +26 -0
  114. package/dist/map/loadBasemap.js.map +1 -0
  115. package/dist/map/materials.js +183 -0
  116. package/dist/map/materials.js.map +1 -0
  117. package/dist/map/poolLighting.js +39 -0
  118. package/dist/map/poolLighting.js.map +1 -0
  119. package/dist/map/projection.js +24 -0
  120. package/dist/map/projection.js.map +1 -0
  121. package/dist/map/rampGeometry.js +38 -0
  122. package/dist/map/rampGeometry.js.map +1 -0
  123. package/dist/map/route.js +107 -0
  124. package/dist/map/route.js.map +1 -0
  125. package/dist/map/stairSurfaces.js +115 -0
  126. package/dist/map/stairSurfaces.js.map +1 -0
  127. package/dist/map/surfaces.js +136 -0
  128. package/dist/map/surfaces.js.map +1 -0
  129. package/dist/map/textures.js +95 -0
  130. package/dist/map/textures.js.map +1 -0
  131. package/dist/map/underground.js +34 -0
  132. package/dist/map/underground.js.map +1 -0
  133. package/dist/map/walk.js +433 -0
  134. package/dist/map/walk.js.map +1 -0
  135. package/dist/map/walkContext.js +46 -0
  136. package/dist/map/walkContext.js.map +1 -0
  137. package/dist/map/walkDimensions.js +7 -0
  138. package/dist/map/walkDimensions.js.map +1 -0
  139. package/dist/map/walkJourney.js +85 -0
  140. package/dist/map/walkJourney.js.map +1 -0
  141. package/dist/map/walkSurfaces.js +106 -0
  142. package/dist/map/walkSurfaces.js.map +1 -0
  143. package/dist/map/wallJoins.js +70 -0
  144. package/dist/map/wallJoins.js.map +1 -0
  145. package/dist/map/water.js +274 -0
  146. package/dist/map/water.js.map +1 -0
  147. package/dist/model/authoring.js +99 -0
  148. package/dist/model/authoring.js.map +1 -0
  149. package/dist/model/boundaries.js +548 -0
  150. package/dist/model/boundaries.js.map +1 -0
  151. package/dist/model/coverage.js +30 -0
  152. package/dist/model/coverage.js.map +1 -0
  153. package/dist/model/document.js +52 -0
  154. package/dist/model/document.js.map +1 -0
  155. package/dist/model/doors.js +47 -0
  156. package/dist/model/doors.js.map +1 -0
  157. package/dist/model/factory.js +56 -0
  158. package/dist/model/factory.js.map +1 -0
  159. package/dist/model/geometry.js +454 -0
  160. package/dist/model/geometry.js.map +1 -0
  161. package/dist/model/history.js +29 -0
  162. package/dist/model/history.js.map +1 -0
  163. package/dist/model/imports.js +45 -0
  164. package/dist/model/imports.js.map +1 -0
  165. package/dist/model/inference.js +182 -0
  166. package/dist/model/inference.js.map +1 -0
  167. package/dist/model/materials.js +11 -0
  168. package/dist/model/materials.js.map +1 -0
  169. package/dist/model/mutations.js +157 -0
  170. package/dist/model/mutations.js.map +1 -0
  171. package/dist/model/navigation.js +275 -0
  172. package/dist/model/navigation.js.map +1 -0
  173. package/dist/model/ontology.js +109 -0
  174. package/dist/model/ontology.js.map +1 -0
  175. package/dist/model/passages.js +5 -0
  176. package/dist/model/passages.js.map +1 -0
  177. package/dist/model/portals.js +42 -0
  178. package/dist/model/portals.js.map +1 -0
  179. package/dist/model/precision.js +11 -0
  180. package/dist/model/precision.js.map +1 -0
  181. package/dist/model/project.js +31 -0
  182. package/dist/model/project.js.map +1 -0
  183. package/dist/model/ramps.js +10 -0
  184. package/dist/model/ramps.js.map +1 -0
  185. package/dist/model/roomNavigation.js +87 -0
  186. package/dist/model/roomNavigation.js.map +1 -0
  187. package/dist/model/routeClearance.js +72 -0
  188. package/dist/model/routeClearance.js.map +1 -0
  189. package/dist/model/spaces.js +104 -0
  190. package/dist/model/spaces.js.map +1 -0
  191. package/dist/model/stairGeometry.js +40 -0
  192. package/dist/model/stairGeometry.js.map +1 -0
  193. package/dist/model/stairTraversal.js +48 -0
  194. package/dist/model/stairTraversal.js.map +1 -0
  195. package/dist/model/topology.js +63 -0
  196. package/dist/model/topology.js.map +1 -0
  197. package/dist/model/types.js +35 -0
  198. package/dist/model/types.js.map +1 -0
  199. package/dist/model/validate.js +240 -0
  200. package/dist/model/validate.js.map +1 -0
  201. package/dist/model/vertical.js +129 -0
  202. package/dist/model/vertical.js.map +1 -0
  203. package/dist/model/walls.js +261 -0
  204. package/dist/model/walls.js.map +1 -0
  205. package/dist/planner/DrawingDock.js +231 -0
  206. package/dist/planner/DrawingDock.js.map +1 -0
  207. package/dist/planner/FloorControls.js +93 -0
  208. package/dist/planner/FloorControls.js.map +1 -0
  209. package/dist/planner/MapSettings.js +143 -0
  210. package/dist/planner/MapSettings.js.map +1 -0
  211. package/dist/planner/PlannerHelp.js +57 -0
  212. package/dist/planner/PlannerHelp.js.map +1 -0
  213. package/dist/planner/ProjectSidebar.js +246 -0
  214. package/dist/planner/ProjectSidebar.js.map +1 -0
  215. package/dist/planner/floors.js +18 -0
  216. package/dist/planner/floors.js.map +1 -0
  217. package/dist/planner/useDrawingTools.js +341 -0
  218. package/dist/planner/useDrawingTools.js.map +1 -0
  219. package/dist/planner/useMapDisplay.js +51 -0
  220. package/dist/planner/useMapDisplay.js.map +1 -0
  221. package/dist/planner/usePlannerKeyboard.js +138 -0
  222. package/dist/planner/usePlannerKeyboard.js.map +1 -0
  223. package/dist/planner/useReferenceAlignment.js +50 -0
  224. package/dist/planner/useReferenceAlignment.js.map +1 -0
  225. package/dist/styles.css +4931 -0
  226. package/dist/theme/index.js +34 -0
  227. package/dist/theme/index.js.map +1 -0
  228. package/dist/types/SitePlanner.d.ts +5 -0
  229. package/dist/types/adapters/basemap.d.ts +2 -0
  230. package/dist/types/adapters/persistence.d.ts +29 -0
  231. package/dist/types/adapters/status.d.ts +4 -0
  232. package/dist/types/adapters/useProjectPersistence.d.ts +13 -0
  233. package/dist/types/components/AiImportPanel.d.ts +9 -0
  234. package/dist/types/components/AnalysisPreview.d.ts +4 -0
  235. package/dist/types/components/ElevatorPanel.d.ts +18 -0
  236. package/dist/types/components/Icons.d.ts +8 -0
  237. package/dist/types/components/ImportDialog.d.ts +42 -0
  238. package/dist/types/components/Inspector.d.ts +38 -0
  239. package/dist/types/components/NavigatePanel.d.ts +27 -0
  240. package/dist/types/components/NavigationGraph.d.ts +10 -0
  241. package/dist/types/components/StructureExplorer.d.ts +8 -0
  242. package/dist/types/components/StructureView.d.ts +22 -0
  243. package/dist/types/components/controls.d.ts +52 -0
  244. package/dist/types/components/graphLayout.d.ts +9 -0
  245. package/dist/types/editor/host.d.ts +9 -0
  246. package/dist/types/editor/index.d.ts +2 -0
  247. package/dist/types/i18n.d.ts +85 -0
  248. package/dist/types/import/analysisPreview.d.ts +27 -0
  249. package/dist/types/import/brief.d.ts +22 -0
  250. package/dist/types/import/checkpoint.d.ts +49 -0
  251. package/dist/types/import/detect.d.ts +34 -0
  252. package/dist/types/import/documentSvg.d.ts +2 -0
  253. package/dist/types/import/index.d.ts +10 -0
  254. package/dist/types/import/instructions.d.ts +7 -0
  255. package/dist/types/import/openings.d.ts +22 -0
  256. package/dist/types/import/planImport.d.ts +22 -0
  257. package/dist/types/import/register.d.ts +25 -0
  258. package/dist/types/import/runs.d.ts +31 -0
  259. package/dist/types/import/session.d.ts +33 -0
  260. package/dist/types/import/types.d.ts +56 -0
  261. package/dist/types/import/usage.d.ts +10 -0
  262. package/dist/types/import/walls.d.ts +37 -0
  263. package/dist/types/map/CabinMaterials.d.ts +18 -0
  264. package/dist/types/map/CabinMirror.d.ts +13 -0
  265. package/dist/types/map/Doors.d.ts +11 -0
  266. package/dist/types/map/ElevatorCabin.d.ts +20 -0
  267. package/dist/types/map/FixtureLights.d.ts +35 -0
  268. package/dist/types/map/MapCanvas.d.ts +87 -0
  269. package/dist/types/map/Passenger.d.ts +18 -0
  270. package/dist/types/map/SceneLayer.d.ts +306 -0
  271. package/dist/types/map/UndergroundContext.d.ts +18 -0
  272. package/dist/types/map/ambience.d.ts +29 -0
  273. package/dist/types/map/architecture.d.ts +8 -0
  274. package/dist/types/map/bathMusic.d.ts +14 -0
  275. package/dist/types/map/cameraAim.d.ts +20 -0
  276. package/dist/types/map/elevators.d.ts +16 -0
  277. package/dist/types/map/excavation.d.ts +9 -0
  278. package/dist/types/map/exteriors.d.ts +3 -0
  279. package/dist/types/map/features.d.ts +33 -0
  280. package/dist/types/map/fences.d.ts +4 -0
  281. package/dist/types/map/journey.d.ts +36 -0
  282. package/dist/types/map/levels.d.ts +4 -0
  283. package/dist/types/map/lighting.d.ts +103 -0
  284. package/dist/types/map/loadBasemap.d.ts +4 -0
  285. package/dist/types/map/materials.d.ts +38 -0
  286. package/dist/types/map/poolLighting.d.ts +11 -0
  287. package/dist/types/map/projection.d.ts +9 -0
  288. package/dist/types/map/rampGeometry.d.ts +8 -0
  289. package/dist/types/map/route.d.ts +59 -0
  290. package/dist/types/map/stairSurfaces.d.ts +29 -0
  291. package/dist/types/map/surfaces.d.ts +36 -0
  292. package/dist/types/map/textures.d.ts +8 -0
  293. package/dist/types/map/underground.d.ts +30 -0
  294. package/dist/types/map/walk.d.ts +232 -0
  295. package/dist/types/map/walkContext.d.ts +11 -0
  296. package/dist/types/map/walkDimensions.d.ts +5 -0
  297. package/dist/types/map/walkJourney.d.ts +33 -0
  298. package/dist/types/map/walkSurfaces.d.ts +27 -0
  299. package/dist/types/map/wallJoins.d.ts +6 -0
  300. package/dist/types/map/water.d.ts +12 -0
  301. package/dist/types/model/authoring.d.ts +38 -0
  302. package/dist/types/model/boundaries.d.ts +41 -0
  303. package/dist/types/model/coverage.d.ts +8 -0
  304. package/dist/types/model/document.d.ts +9 -0
  305. package/dist/types/model/doors.d.ts +19 -0
  306. package/dist/types/model/factory.d.ts +5 -0
  307. package/dist/types/model/geometry.d.ts +99 -0
  308. package/dist/types/model/history.d.ts +10 -0
  309. package/dist/types/model/host.d.ts +154 -0
  310. package/dist/types/model/imports.d.ts +7 -0
  311. package/dist/types/model/inference.d.ts +46 -0
  312. package/dist/types/model/live.d.ts +60 -0
  313. package/dist/types/model/materials.d.ts +28 -0
  314. package/dist/types/model/mutations.d.ts +178 -0
  315. package/dist/types/model/navigation.d.ts +70 -0
  316. package/dist/types/model/ontology.d.ts +43 -0
  317. package/dist/types/model/passages.d.ts +2 -0
  318. package/dist/types/model/portals.d.ts +9 -0
  319. package/dist/types/model/precision.d.ts +11 -0
  320. package/dist/types/model/project.d.ts +8 -0
  321. package/dist/types/model/ramps.d.ts +7 -0
  322. package/dist/types/model/roomNavigation.d.ts +15 -0
  323. package/dist/types/model/routeClearance.d.ts +11 -0
  324. package/dist/types/model/spaces.d.ts +46 -0
  325. package/dist/types/model/stairGeometry.d.ts +27 -0
  326. package/dist/types/model/stairTraversal.d.ts +8 -0
  327. package/dist/types/model/topology.d.ts +14 -0
  328. package/dist/types/model/types.d.ts +369 -0
  329. package/dist/types/model/validate.d.ts +38 -0
  330. package/dist/types/model/vertical.d.ts +145 -0
  331. package/dist/types/model/walls.d.ts +71 -0
  332. package/dist/types/planner/DrawingDock.d.ts +16 -0
  333. package/dist/types/planner/FloorControls.d.ts +17 -0
  334. package/dist/types/planner/MapSettings.d.ts +16 -0
  335. package/dist/types/planner/PlannerHelp.d.ts +3 -0
  336. package/dist/types/planner/ProjectSidebar.d.ts +32 -0
  337. package/dist/types/planner/floors.d.ts +3 -0
  338. package/dist/types/planner/types.d.ts +3 -0
  339. package/dist/types/planner/useDrawingTools.d.ts +52 -0
  340. package/dist/types/planner/useMapDisplay.d.ts +29 -0
  341. package/dist/types/planner/usePlannerKeyboard.d.ts +18 -0
  342. package/dist/types/planner/useReferenceAlignment.d.ts +30 -0
  343. package/dist/types/schema/index.d.ts +25 -0
  344. package/dist/types/theme/index.d.ts +55 -0
  345. package/package.json +58 -4
@@ -0,0 +1,1189 @@
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { Layers3 as rn, Eye as sn, MousePointer2 as an, Radio as ln, Sun as cn, Moon as dn, CircleHelp as un, PanelLeftClose as fn, PanelLeftOpen as mn, ChevronRight as pn, ArrowDownToLine as hn, ArrowUpFromLine as gn, Shapes as bn, Waypoints as vn, PanelRightClose as wn, PanelRightOpen as In, Bell as Nn, Minimize2 as kn, Maximize2 as yn, Settings2 as jn, X as Sn, Plus as Pn, ShieldCheck as Cn } from "lucide-react";
3
+ import { lazy as Fn, useState as i, useRef as P, useEffect as N, useCallback as Le, useMemo as He, Suspense as Dn } from "react";
4
+ import { validateProject as Mn, transact as $n } from "./model/validate.js";
5
+ import { exportProject as zn } from "./model/document.js";
6
+ import { statusTone as An } from "./adapters/status.js";
7
+ import { useProjectPersistence as En } from "./adapters/useProjectPersistence.js";
8
+ import { AlignmentPanel as Tn, ImportDialog as xn } from "./components/ImportDialog.js";
9
+ import { Inspector as Rn } from "./components/Inspector.js";
10
+ import { NavigatePanel as Bn } from "./components/NavigatePanel.js";
11
+ import { StructureView as Ln } from "./components/StructureView.js";
12
+ import { Modal as Oe } from "./components/controls.js";
13
+ import { importPlanEntities as Hn } from "./import/planImport.js";
14
+ import { loadAiImportSession as On } from "./import/session.js";
15
+ import { MapCanvas as Gn } from "./map/MapCanvas.js";
16
+ import { toLngLat as eo, footprint as to, closeRing as Un, addBarrier as Kn, add as oo, removeFloor as qn, duplicateFloor as Wn, moveOrigin as Zn, removeBarrier as no } from "./model/geometry.js";
17
+ import { floorAim as Jn } from "./map/cameraAim.js";
18
+ import { boundaryEdges as Xn, disconnectSpace as Qn, connectSpace as Yn } from "./model/boundaries.js";
19
+ import { createObject as _n } from "./model/factory.js";
20
+ import { makeHistory as mt, commitHistory as ro, redoHistory as so, undoHistory as ao } from "./model/history.js";
21
+ import { spacesRejoinedBy as Vn, mergeSpaces as er } from "./model/inference.js";
22
+ import { findRoute as tr, HERE as or } from "./model/navigation.js";
23
+ import { pruneOntology as pt } from "./model/ontology.js";
24
+ import { openingFloorId as ht } from "./model/project.js";
25
+ import { derivedGraph as nr } from "./model/topology.js";
26
+ import { uid as gt } from "./model/types.js";
27
+ import { DrawingDock as rr } from "./planner/DrawingDock.js";
28
+ import { FloorControls as sr } from "./planner/FloorControls.js";
29
+ import { MapSettings as ar } from "./planner/MapSettings.js";
30
+ import { PlannerHelp as lr } from "./planner/PlannerHelp.js";
31
+ import { useProjectSidebar as ir, ProjectSidebar as cr } from "./planner/ProjectSidebar.js";
32
+ import { floorBand as dr } from "./planner/floors.js";
33
+ import { useDrawingTools as ur } from "./planner/useDrawingTools.js";
34
+ import { useMapDisplay as fr } from "./planner/useMapDisplay.js";
35
+ import { usePlannerKeyboard as mr } from "./planner/usePlannerKeyboard.js";
36
+ import { useReferenceAlignment as pr } from "./planner/useReferenceAlignment.js";
37
+ import { useDarkMode as hr, useKerrosTheme as gr, useStrings as br } from "./theme/index.js";
38
+ const vr = Fn(
39
+ () => import("./components/NavigationGraph.js").then((b) => ({ default: b.NavigationGraph }))
40
+ );
41
+ function wr(b, h) {
42
+ const de = URL.createObjectURL(new Blob([b], { type: "application/json" })), T = document.createElement("a");
43
+ T.href = de, T.download = h, T.click(), setTimeout(() => URL.revokeObjectURL(de), 1e3);
44
+ }
45
+ function Ir({
46
+ project: b,
47
+ adapters: h,
48
+ onChange: de,
49
+ onSelectionChange: T,
50
+ onBack: Ge,
51
+ initialView: f,
52
+ onViewChange: bt,
53
+ onModeChange: vt,
54
+ renderStatusPanel: lo,
55
+ elevators: k,
56
+ readOnly: C = !1
57
+ }) {
58
+ var Yt, _t;
59
+ const [ue, wt] = hr(), [fe, O] = i(() => mt(b)), a = fe.present, [c, A] = i(
60
+ (f == null ? void 0 : f.floor) !== void 0 && (f.floor === null || b.floors.some((e) => e.id === f.floor)) ? f.floor : ht(b)
61
+ ), [m, x] = i(null), [io, It] = i(null), me = !!h.status, [y, ke] = i(() => {
62
+ const e = f == null ? void 0 : f.mode;
63
+ return e === "edit" ? C ? "view" : "edit" : e === "live" ? me ? "live" : "view" : e === "view" ? "view" : C && me ? "live" : "view";
64
+ }), [ye, co] = i(!1), v = y === "edit" && !ye, je = y === "live", [R, te] = i((f == null ? void 0 : f.threeD) ?? (f == null ? void 0 : f.mode) !== "edit"), [X, Ue] = i((f == null ? void 0 : f.stack) ?? !1), [oe, Nt] = i((f == null ? void 0 : f.walk) ?? !1), [E, pe] = i(null), kt = P(b.id);
65
+ N(() => {
66
+ b.id !== kt.current && (kt.current = b.id, O(mt(b)), x(null), j([]), A(ht(b)));
67
+ }, [b]);
68
+ const [uo, Ke] = i(!1), [Q, yt] = i(!1), [ne, G] = i((f == null ? void 0 : f.mode) === "edit" && !C), [re, B] = i(!1), jt = fr(a, h.basemap, f), {
69
+ coverage: fo,
70
+ showLabels: mo,
71
+ showPlan: po,
72
+ sun: ho,
73
+ excavation: go,
74
+ cityBuildings: bo,
75
+ cadastre: vo,
76
+ settings: qe,
77
+ setSettings: wo,
78
+ basemap: Io,
79
+ canAdopt: No
80
+ } = jt, ko = ir(), [he, U] = i(!1), [yo, St] = i(!1);
81
+ N(() => {
82
+ if (!h.aiImport || C) return;
83
+ let e = !0;
84
+ return On(h.assets, b.id).then((t) => {
85
+ e && t && (St(!0), U(!0), ke("edit"), G(!0));
86
+ }).catch(() => {
87
+ }), () => {
88
+ e = !1;
89
+ };
90
+ }, [h.aiImport, h.assets, b.id, C]);
91
+ const [jo, Pt] = i(!1), [So, Se] = i(!1), [Po, We] = i(!1), [Co, Y] = i(!1), [Pe, Ce] = i(null), [Fe, Ze] = i(""), [Fo, Je] = i("structure"), [_, Xe] = i(/* @__PURE__ */ new Map()), [K, Qe] = i(null), [se, De] = i(!1), [Do, Mo] = i(void 0), Ct = P(void 0), Ye = P(null);
92
+ N(() => Qe(null), [a.id]);
93
+ const [L, q] = i(!1), [ge, be] = i(!1), [ve, _e] = i(null), [we, Ve] = i(null), [Me, Ft] = i(!1), [et, $e] = i(null), ze = P(!1), F = Le(() => {
94
+ ze.current = !1, Ft(!1);
95
+ }, []), Dt = P(null), W = He(() => {
96
+ const e = Me ? Dt.current ?? K : K, t = (n) => n === or ? e ? { floorId: e.floorId, position: e.position } : null : n, o = t(ve), s = t(we);
97
+ return o && s ? tr(fe.present, o, s, {
98
+ statuses: new Map([..._, ...((k == null ? void 0 : k.statuses) ?? []).map((n) => [n.feedId, n])])
99
+ }) : null;
100
+ }, [fe.present, ve, we, K, Me, _, k == null ? void 0 : k.statuses]);
101
+ N(() => {
102
+ F(), $e(null);
103
+ }, [ve, we, F]), N(() => {
104
+ !W && ze.current && F();
105
+ }, [W, F]);
106
+ const [tt, $o] = i("New floor"), [Mt, $t] = i(3), [Ae, zt] = i(a.buildings[0].id), [ot, zo] = i(""), D = P(null), Ee = P(a), Te = P(de), xe = P(bt);
107
+ Ee.current = a, Te.current = de, xe.current = bt;
108
+ const At = P({ floorId: c, threeD: R, stack: X, walk: oe });
109
+ At.current = { floorId: c, threeD: R, stack: X, walk: oe };
110
+ const Ie = Le((e = !1) => {
111
+ var n;
112
+ const t = D.current;
113
+ if (!t || ze.current) return;
114
+ const o = At.current;
115
+ if (o.walk && !e) return;
116
+ const s = t.getCenter();
117
+ (n = xe.current) == null || n.call(xe, {
118
+ floor: o.floorId,
119
+ threeD: o.threeD,
120
+ stack: o.stack,
121
+ walk: o.walk,
122
+ camera: { center: [s.lng, s.lat], zoom: t.getZoom(), bearing: t.getBearing(), pitch: t.getPitch() }
123
+ });
124
+ }, []);
125
+ N(() => {
126
+ Ie(!0);
127
+ }, [c, R, X, oe, Ie]);
128
+ const nt = oe ? "walk" : R ? "3d" : "2d", Ao = nt === "2d" ? "3d" : nt === "3d" ? "walk" : "2d", ae = (e) => {
129
+ Nt(e === "walk"), te(e !== "2d"), e === "walk" && Ue(!1), e !== "2d" && (ee("select"), j([]));
130
+ }, V = gr(), le = br(), I = Le(
131
+ (e) => {
132
+ V.notify ? V.notify(e) : Ze(e);
133
+ },
134
+ [V]
135
+ );
136
+ N(() => {
137
+ m && B(!0);
138
+ }, [m]);
139
+ const { state: rt, flush: Et, saveNow: Tt } = En(a, h.projects, !C, I), Eo = Le(
140
+ async (e) => {
141
+ const t = Mn({ ...e, id: Ee.current.id, updatedAt: (/* @__PURE__ */ new Date()).toISOString() });
142
+ Ee.current = t, O((o) => ({ ...ro(o, t), present: t })), A((o) => t.floors.some((s) => s.id === o) ? o : ht(t)), x(null), j([]), await Tt(t);
143
+ },
144
+ [Tt]
145
+ ), xt = async () => {
146
+ try {
147
+ await Et(), Ge == null || Ge();
148
+ } catch {
149
+ }
150
+ };
151
+ N(() => {
152
+ if (!Fe) return;
153
+ const e = setTimeout(() => Ze(""), 6500);
154
+ return () => clearTimeout(e);
155
+ }, [Fe]);
156
+ const p = (e) => {
157
+ if (!v) return !1;
158
+ const t = $n(a, e);
159
+ return t.ok ? (O((o) => ro(o, t.project)), !0) : (I(t.error), !1);
160
+ }, st = ur({
161
+ project: a,
162
+ floorId: c,
163
+ selected: m,
164
+ editing: v,
165
+ threeD: R,
166
+ commit: p,
167
+ notify: I,
168
+ setSelected: x,
169
+ onSelect: $,
170
+ onFloorChange: J,
171
+ onChooseTool: () => {
172
+ Ke(!1), te(!1);
173
+ }
174
+ }), {
175
+ tool: at,
176
+ setTool: ee,
177
+ draft: lt,
178
+ setDraft: j,
179
+ hover: To,
180
+ snapping: it,
181
+ setSnapping: xo,
182
+ routeAnchor: Ro,
183
+ setRouteAnchor: Z,
184
+ chooseTool: Bo,
185
+ finish: Lo,
186
+ adoptBuilding: Ho,
187
+ onHover: Oo,
188
+ guides: Go,
189
+ geometryPreview: Uo,
190
+ vertexMove: Ko,
191
+ updateObject: qo
192
+ } = st, { alignment: w, setAlignment: Ne, startAlignment: Wo, previewAlignment: Zo, confirmAlignment: Jo, calibrate: Xo, displayProject: Qo } = pr({
193
+ project: a,
194
+ floorId: c,
195
+ assets: h.assets,
196
+ commit: p,
197
+ notify: I,
198
+ setSelected: x,
199
+ onStart: () => {
200
+ te(!1), ee("select");
201
+ }
202
+ }), ct = p;
203
+ N(() => {
204
+ var e;
205
+ C || (e = Te.current) == null || e.call(Te, a);
206
+ }, [a, C]);
207
+ const Yo = a.objects.filter((e) => e.feedId).map((e) => e.feedId).sort().join("|");
208
+ N(() => {
209
+ Xe(/* @__PURE__ */ new Map());
210
+ }, [a.id]), N(() => {
211
+ var e;
212
+ return (e = h.status) == null ? void 0 : e.subscribe(
213
+ Ee.current,
214
+ (t) => Xe((o) => {
215
+ const s = new Map(o);
216
+ for (const n of t) s.set(n.feedId, n);
217
+ return s;
218
+ })
219
+ );
220
+ }, [h.status, Yo, a.id]), N(() => {
221
+ const e = setInterval(() => Xe((t) => new Map(t)), 5e3);
222
+ return () => clearInterval(e);
223
+ }, []);
224
+ const Rt = He(
225
+ () => new Map([...y === "view" ? [] : _, ...((k == null ? void 0 : k.statuses) ?? []).map((e) => [e.feedId, e])]),
226
+ [y, _, k == null ? void 0 : k.statuses]
227
+ ), ie = a.floors.find((e) => e.id === c), M = He(
228
+ () => a.objects.filter((e) => e.feedId && An(_.get(e.feedId)) === "critical"),
229
+ [_, a]
230
+ ), Bt = He(() => new Set(M.map((e) => e.floorId)), [M]), Re = P(vt);
231
+ Re.current = vt, N(() => {
232
+ var e;
233
+ (e = Re.current) == null || e.call(Re, y);
234
+ }, [y]);
235
+ const Lt = P(Date.now()), Be = P(/* @__PURE__ */ new Set());
236
+ N(() => {
237
+ const e = () => {
238
+ Lt.current = Date.now();
239
+ }, t = ["pointerdown", "wheel", "keydown", "touchstart"];
240
+ for (const o of t) window.addEventListener(o, e, !0);
241
+ return () => {
242
+ for (const o of t) window.removeEventListener(o, e, !0);
243
+ };
244
+ }, []), N(() => {
245
+ if (!je) return;
246
+ const e = setInterval(() => {
247
+ const t = new Set(M.map((s) => s.id));
248
+ for (const s of Be.current) t.has(s) || Be.current.delete(s);
249
+ if (Date.now() - Lt.current < 5e3) return;
250
+ const o = M.find((s) => s.floorId === c && !Be.current.has(s.id));
251
+ o && (Be.current.add(o.id), It(o.id));
252
+ }, 1e3);
253
+ return () => clearInterval(e);
254
+ }, [je, M, c]);
255
+ function Ht() {
256
+ ke("view"), ee("select"), j([]), G(!1), B(!1), te(!0);
257
+ }
258
+ function dt() {
259
+ C || (ke("edit"), te(!1), G(!0));
260
+ }
261
+ function Ot() {
262
+ ke("live"), ee("select"), j([]), G(!1), B(!1), te(!0);
263
+ }
264
+ function Gt(e) {
265
+ const t = dr(a, c), o = t.findIndex((n) => n.id === c), s = o < 0 ? e === 1 ? t[0] : t[t.length - 1] : t[o + e];
266
+ s && J(s.id);
267
+ }
268
+ const H = (e) => ft ? /* @__PURE__ */ r("kbd", { className: "key-hint", children: e }) : null;
269
+ function $(e, t = !1) {
270
+ var s;
271
+ const o = a.objects.find((n) => n.id === e) ?? a.barriers.find((n) => n.id === e) ?? ((s = a.virtualBoundaries) == null ? void 0 : s.find((n) => n.id === e)) ?? a.drawings.find((n) => n.id === e);
272
+ o && o.floorId !== c && o.floorId !== null && (A(o.floorId), j([]), Z(null), at !== "select" && at !== "pan" && ee("select")), x(e), T == null || T(e), e && B(!0), t && It(e);
273
+ }
274
+ function _o(e) {
275
+ const t = D.current;
276
+ if (t) {
277
+ const o = t.getCenter();
278
+ Ct.current = {
279
+ center: [o.lng, o.lat],
280
+ zoom: t.getZoom(),
281
+ pitch: t.getPitch(),
282
+ bearing: t.getBearing()
283
+ };
284
+ }
285
+ F(), Nt(!1), Mo(e), De(!0), D.current = null;
286
+ }
287
+ function ut() {
288
+ const e = Ye.current, t = D.current;
289
+ if (!e || !t || (Ye.current = null, !e.points.length)) return;
290
+ let o = 1 / 0, s = -1 / 0, n = 1 / 0, d = -1 / 0;
291
+ for (const u of e.points) {
292
+ const [S, g] = eo(u, a.origin);
293
+ o = Math.min(o, S), s = Math.max(s, S), n = Math.min(n, g), d = Math.max(d, g);
294
+ }
295
+ t.fitBounds(
296
+ [
297
+ [o, n],
298
+ [s, d]
299
+ ],
300
+ { padding: 90, maxZoom: 20, duration: 450 }
301
+ );
302
+ }
303
+ function Ut(e) {
304
+ var u, S, g;
305
+ const t = new Set(e.objectIds ?? []), o = a.objects.filter((z) => t.has(z.id)), s = e.floorId !== void 0 ? e.floorId : o.some((z) => z.floorId === c) ? c : ((u = o[0]) == null ? void 0 : u.floorId) ?? c, n = o.filter(
306
+ (z) => {
307
+ var Vt;
308
+ return z.floorId === s || ((Vt = z.servedFloorIds) == null ? void 0 : Vt.includes(s ?? ""));
309
+ }
310
+ ), d = e.position ? [e.position] : n.flatMap((z) => to(z).flat());
311
+ d.length || d.push(
312
+ ...a.objects.filter((z) => z.floorId === s).flatMap((z) => to(z).flat())
313
+ ), Ye.current = { points: d }, x(((S = n[0]) == null ? void 0 : S.id) ?? null), T == null || T(((g = n[0]) == null ? void 0 : g.id) ?? null), De(!1), ae("2d"), A(s), requestAnimationFrame(ut);
314
+ }
315
+ N(() => {
316
+ se || requestAnimationFrame(ut);
317
+ }, [se, c, R]);
318
+ function J(e) {
319
+ A(e), x(null), j([]), ee("select"), Ne(null), Z(null);
320
+ }
321
+ function Vo(e, t) {
322
+ if (window.matchMedia("(max-width: 840px)").matches && G(!1), w) {
323
+ if (w.preview || w.imagePoints.length < 2 || w.mapPoints.length >= 2) return;
324
+ Ne({ ...w, mapPoints: [...w.mapPoints, e] });
325
+ return;
326
+ }
327
+ st.mapClick(e, t);
328
+ }
329
+ function en() {
330
+ const { nodes: e, edges: t } = nr(a);
331
+ p((o) => {
332
+ o.navNodes = e.map((s) => ({ ...s })), o.navEdges = t.map((s) => ({ ...s }));
333
+ }) && I(
334
+ `Adopted ${e.length} node${e.length === 1 ? "" : "s"} and ${t.length} edges · the graph no longer follows the plan.`
335
+ );
336
+ }
337
+ function Kt() {
338
+ m && p((e) => {
339
+ var s;
340
+ const t = e.objects.find((n) => n.id === m);
341
+ if (!t || t.barrierId) return;
342
+ const o = structuredClone(t);
343
+ o.id = gt(), o.name += " copy", o.feedId = void 0, o.geometry = { mode: "independent" }, o.parentId = void 0, o.position = oo(o.position, [2, -2]), o.rings = (s = o.rings) == null ? void 0 : s.map((n) => n.map((d) => oo(d, [2, -2]))), e.objects.push(o), x(o.id);
344
+ });
345
+ }
346
+ function qt(e) {
347
+ const t = a.objects.filter((n) => n.floorId === e).length, o = a.barriers.filter((n) => n.floorId === e).length, s = [
348
+ t && `${t} object${t > 1 ? "s" : ""}`,
349
+ o && `${o} wall${o > 1 ? "s" : ""}`
350
+ ].filter(Boolean);
351
+ return s.length ? `This also removes ${s.join(" and ")}.` : "This floor is empty.";
352
+ }
353
+ function Wt(e) {
354
+ var o, s;
355
+ const t = a.floors.filter((n) => n.id !== e).sort((n, d) => n.elevation - d.elevation);
356
+ p((n) => void qn(n, e)) && (c === e && J(((o = t.find((n) => n.elevation === 0)) == null ? void 0 : o.id) ?? ((s = t[0]) == null ? void 0 : s.id) ?? null), I("Floor removed with everything on it. Undo restores it.")), Ce(null);
357
+ }
358
+ async function tn(e) {
359
+ if (a.floors.length <= 1) {
360
+ I("A project needs at least one floor.");
361
+ return;
362
+ }
363
+ if (!V.confirm) {
364
+ Ce(e);
365
+ return;
366
+ }
367
+ const t = a.floors.find((o) => o.id === e);
368
+ await V.confirm({
369
+ title: `Delete ${(t == null ? void 0 : t.name) ?? "this floor"}?`,
370
+ body: qt(e),
371
+ danger: !0,
372
+ confirmLabel: "Delete floor"
373
+ }) && Wt(e);
374
+ }
375
+ async function on() {
376
+ if (m) {
377
+ if (!V.confirm) {
378
+ Y(!0);
379
+ return;
380
+ }
381
+ await V.confirm({
382
+ title: "Delete selected object?",
383
+ body: ce ? `This also removes ${ce} attached opening${ce > 1 ? "s" : ""}.` : "Child zones become independent areas.",
384
+ danger: !0,
385
+ confirmLabel: "Delete object"
386
+ }) && Zt();
387
+ }
388
+ }
389
+ function Zt() {
390
+ var s;
391
+ if (!m) return;
392
+ const e = (s = a.virtualBoundaries) == null ? void 0 : s.some((n) => n.id === m), t = e ? a.objects.filter(
393
+ (n) => {
394
+ var d;
395
+ return ((d = n.geometry) == null ? void 0 : d.mode) === "boundaries" && n.geometry.loops.some((u) => u.some((S) => S.edgeId === m));
396
+ }
397
+ ) : [];
398
+ if (e && t.length === 1) {
399
+ I("This boundary closes a space. Move it, or switch the space to Independent outline before removing it."), Y(!1);
400
+ return;
401
+ }
402
+ const o = t.length === 2 ? t : a.barriers.some((n) => n.id === m) ? Vn(a, m) : null;
403
+ if (o && !E) {
404
+ Y(!1), pe({ wallId: m, a: o[0], b: o[1] });
405
+ return;
406
+ }
407
+ // The transaction preserves referenced walls as virtual edges and regenerates space caches.
408
+ ct((n) => {
409
+ var d;
410
+ if (n.objects = n.objects.filter((u) => u.id !== m && u.barrierId !== m), n.objects.forEach((u) => {
411
+ u.parentId === m && (u.parentId = void 0);
412
+ }), n.barriers = n.barriers.filter((u) => u.id !== m), n.virtualBoundaries && (n.virtualBoundaries = n.virtualBoundaries.filter((u) => u.id !== m)), n.drawings = n.drawings.filter((u) => u.id !== m), n.junctions = n.junctions.filter((u) => Xn(n).some((S) => S.startId === u.id || S.endId === u.id)), (d = n.navNodes) != null && d.length) {
413
+ const u = new Set(n.objects.map((g) => g.id));
414
+ n.navNodes = n.navNodes.filter(
415
+ (g) => g.id !== m && (g.objectId === void 0 || u.has(g.objectId))
416
+ );
417
+ const S = new Set(n.navNodes.map((g) => g.id));
418
+ n.navEdges = (n.navEdges ?? []).filter(
419
+ (g) => S.has(g.aId) && S.has(g.bId) && (g.objectId === void 0 || u.has(g.objectId))
420
+ );
421
+ }
422
+ pt(n);
423
+ }) && ($(null), Y(!1), Ro === m && Z(null));
424
+ }
425
+ function Jt(e) {
426
+ if (!W) return;
427
+ const t = Math.max(0, Math.min(W.steps.length - 1, e)), o = W.steps[t];
428
+ F(), $e(t);
429
+ const s = o.floorId !== c;
430
+ s && A(o.floorId);
431
+ const n = W.nodes.find((d) => d.id === o.nodeIds.at(-1));
432
+ !s && n && D.current && D.current.easeTo({
433
+ // Through the map's own depth aim: in 3D the step is drawn at its storey's elevation, and a
434
+ // node in the garage centred on its ground coordinate lands well outside the frame.
435
+ center: Jn(D.current, a, n.position, o.floorId, { threeD: R, stack: X }),
436
+ zoom: Math.max(D.current.getZoom(), 18),
437
+ duration: 550
438
+ });
439
+ }
440
+ async function Xt() {
441
+ try {
442
+ wr(
443
+ await zn(a, h.assets),
444
+ `${a.name.toLowerCase().replace(/[^a-z0-9]+/g, "-")}.json`
445
+ ), I("Portable project exported with reference drawings.");
446
+ } catch (e) {
447
+ I(e.message);
448
+ }
449
+ }
450
+ const ft = mr({
451
+ graphView: se,
452
+ editing: v,
453
+ threeD: R,
454
+ walk: oe,
455
+ hasDraft: !!lt.length,
456
+ hasSelection: !!m,
457
+ mapRef: D,
458
+ chooseTool: Bo,
459
+ stepFloor: Gt,
460
+ commands: {
461
+ undo: () => {
462
+ O(ao), j([]), Z(null);
463
+ },
464
+ redo: () => {
465
+ O(so), j([]), Z(null);
466
+ },
467
+ undoPoint: () => j(lt.slice(0, -1)),
468
+ export: Xt,
469
+ cancel: () => {
470
+ j([]), ee("select"), Ke(!1), B(!1), Z(null), L && (F(), q(!1)), w ? Ne(null) : $(null);
471
+ },
472
+ finish: Lo,
473
+ help: () => We(!0),
474
+ view: Ht,
475
+ edit: dt,
476
+ walk: () => ae("walk"),
477
+ live: Ot,
478
+ cycleView: () => ae(Ao),
479
+ toggleStack: () => Ue(!X),
480
+ toggleSidebar: () => G(!ne),
481
+ toggleInspector: () => {
482
+ U(!1), be(!1), q(!1), B(!re);
483
+ },
484
+ toggleFullscreen: () => yt(!Q),
485
+ toggleNavigation: () => {
486
+ U(!1), L && F(), q(!L);
487
+ },
488
+ toggleTheme: wt,
489
+ deleteSelection: () => Y(!0),
490
+ duplicate: Kt
491
+ }
492
+ });
493
+ function nn(e) {
494
+ const t = a.objects.find((o) => o.id === e);
495
+ if (t != null && t.rings) {
496
+ if (c === null) {
497
+ I("Select a destination floor, then select the footprint in Objects to create its walls.");
498
+ return;
499
+ }
500
+ p((o) => {
501
+ for (const n of t.rings) {
502
+ const d = Un(n);
503
+ for (let u = 1; u < d.length; u++) Kn(o, d[u - 1], d[u], c, "wall");
504
+ }
505
+ const s = _n("zone", t.position, c, (ie == null ? void 0 : ie.name) ?? "Floor");
506
+ s.width = t.width, s.depth = t.depth, s.rings = structuredClone(t.rings), o.objects.push(s);
507
+ });
508
+ }
509
+ }
510
+ const ce = a.barriers.find((e) => e.id === m) ? a.objects.filter((e) => e.barrierId === m).length : 0, Qt = (e) => /* @__PURE__ */ r(
511
+ xn,
512
+ {
513
+ mode: e,
514
+ project: a,
515
+ floorId: c,
516
+ assets: h.assets,
517
+ importProjections: h.importProjections,
518
+ aiImport: h.aiImport,
519
+ pdfDrawing: h.pdfDrawing,
520
+ onAiProject: Eo,
521
+ onAiRunningChange: co,
522
+ onClose: () => e === "plan" ? U(!1) : Pt(!1),
523
+ onDrawing: Wo,
524
+ onProject: async (t) => {
525
+ var o;
526
+ await Et(), O(mt(t)), A(((o = t.floors[0]) == null ? void 0 : o.id) ?? null), zt(t.buildings[0].id), $(null);
527
+ },
528
+ onOrigin: (t) => {
529
+ p((o) => {
530
+ const [s, n] = o.origin;
531
+ o.origin = t ? [s, n, t] : [s, n];
532
+ });
533
+ },
534
+ onPlan: (t, o, s) => {
535
+ let n;
536
+ if (p((d) => {
537
+ n = Hn(d, t, s ? { floorId: o, layers: s } : { floorId: o });
538
+ }) && n) {
539
+ o !== c && A(o), Je("structure");
540
+ const d = n.skipped.length ? ` · ${n.skipped.length} skipped` : "";
541
+ I(
542
+ `Plan imported: ${n.walls} walls, ${n.rooms} rooms, ${n.doors} doors, ${n.windows} windows${n.passages ? ` · ${n.passages} open passages` : ""}${d}.`
543
+ );
544
+ }
545
+ },
546
+ onFootprints: (t) => {
547
+ var o;
548
+ if (p((s) => s.objects.push(...t))) {
549
+ x(((o = t[0]) == null ? void 0 : o.id) ?? null), Je("objects");
550
+ const s = t[0];
551
+ s && D.current && D.current.easeTo({ center: eo(s.position, a.origin), zoom: 18 }), I(
552
+ `Imported ${t.length} ${t.length === 1 ? "footprint" : "footprints"}. Select a floor to generate its walls.`
553
+ );
554
+ }
555
+ }
556
+ },
557
+ `${a.id}:${e}`
558
+ );
559
+ return /* @__PURE__ */ l("div", { className: `kerros-root app-shell ${Q ? "fullscreen" : ""}`, children: [
560
+ /* @__PURE__ */ l("header", { className: "app-header", children: [
561
+ /* @__PURE__ */ l(
562
+ "a",
563
+ {
564
+ className: "brand",
565
+ href: "#",
566
+ onClick: (e) => {
567
+ e.preventDefault(), xt();
568
+ },
569
+ children: [
570
+ /* @__PURE__ */ r("span", { className: "brand-mark", children: /* @__PURE__ */ r(rn, { size: 22, strokeWidth: 2 }) }),
571
+ /* @__PURE__ */ r("strong", { children: le.brand }),
572
+ /* @__PURE__ */ r("span", { className: "brand-divider" }),
573
+ /* @__PURE__ */ r("span", { className: "brand-product", children: le.app })
574
+ ]
575
+ }
576
+ ),
577
+ /* @__PURE__ */ l("div", { className: "mode-switch", children: [
578
+ /* @__PURE__ */ l("button", { className: y === "view" ? "active" : "", onClick: Ht, children: [
579
+ /* @__PURE__ */ r(sn, { size: 15 }),
580
+ /* @__PURE__ */ r("span", { className: "mode-label", children: le.viewer }),
581
+ H("1")
582
+ ] }),
583
+ !C && /* @__PURE__ */ l("button", { className: y === "edit" ? "active" : "", onClick: dt, children: [
584
+ /* @__PURE__ */ r(an, { size: 15 }),
585
+ /* @__PURE__ */ r("span", { className: "mode-label", children: le.editor }),
586
+ H("2")
587
+ ] }),
588
+ me && /* @__PURE__ */ l("button", { className: y === "live" ? "active" : "", onClick: Ot, children: [
589
+ /* @__PURE__ */ r(ln, { size: 15 }),
590
+ /* @__PURE__ */ r("span", { className: "mode-label", children: le.monitor }),
591
+ H("3")
592
+ ] })
593
+ ] }),
594
+ /* @__PURE__ */ l("div", { className: "header-right", children: [
595
+ /* @__PURE__ */ l("span", { className: `save-status ${rt}`, children: [
596
+ /* @__PURE__ */ r("span", {}),
597
+ C ? "Read-only viewer" : le[rt === "saved" ? "saved" : rt === "saving" ? "saving" : "saveError"]
598
+ ] }),
599
+ /* @__PURE__ */ l(
600
+ "button",
601
+ {
602
+ className: "icon-button",
603
+ title: ue ? "Switch to light mode" : "Switch to dark mode",
604
+ "aria-label": ue ? "Switch to light mode" : "Switch to dark mode",
605
+ onClick: wt,
606
+ children: [
607
+ ue ? /* @__PURE__ */ r(cn, { size: 18 }) : /* @__PURE__ */ r(dn, { size: 18 }),
608
+ H("N")
609
+ ]
610
+ }
611
+ ),
612
+ /* @__PURE__ */ l(
613
+ "button",
614
+ {
615
+ className: "icon-button help-button",
616
+ title: "Help and shortcuts (?)",
617
+ "aria-label": "Help and shortcuts",
618
+ onClick: () => We(!0),
619
+ children: [
620
+ /* @__PURE__ */ r(un, { size: 19 }),
621
+ H("?")
622
+ ]
623
+ }
624
+ ),
625
+ /* @__PURE__ */ r("span", { className: "avatar", children: "KH" })
626
+ ] })
627
+ ] }),
628
+ /* @__PURE__ */ l("div", { className: "workspace", children: [
629
+ ne && /* @__PURE__ */ r(
630
+ cr,
631
+ {
632
+ state: ko,
633
+ project: a,
634
+ floorId: c,
635
+ selected: m,
636
+ mode: y,
637
+ editing: v,
638
+ readOnly: C,
639
+ statuses: _,
640
+ alarmFloors: Bt,
641
+ activeTab: Fo,
642
+ setActiveTab: Je,
643
+ leave: xt,
644
+ select: $,
645
+ changeFloor: J,
646
+ onAnchor: () => {
647
+ v || dt(), $(null), B(!0);
648
+ },
649
+ onAddFloor: () => {
650
+ $t(Math.max(...a.floors.map((e) => e.elevation + e.height))), Se(!0);
651
+ },
652
+ onDuplicateFloor: () => {
653
+ let e = "";
654
+ p((t) => {
655
+ e = Wn(t, c);
656
+ }) && (A(e), I("Floor duplicated with new IDs and cleared feed bindings."));
657
+ },
658
+ onImportReference: () => Pt(!0)
659
+ }
660
+ ),
661
+ /* @__PURE__ */ l("main", { className: "canvas-column", children: [
662
+ /* @__PURE__ */ l("div", { className: "canvas-header", children: [
663
+ /* @__PURE__ */ l(
664
+ "button",
665
+ {
666
+ className: "icon-button",
667
+ "aria-label": ne ? "Hide side panel" : "Show side panel",
668
+ title: ne ? "Hide side panel" : "Show side panel",
669
+ onClick: () => G(!ne),
670
+ children: [
671
+ ne ? /* @__PURE__ */ r(fn, { size: 17 }) : /* @__PURE__ */ r(mn, { size: 17 }),
672
+ H("B")
673
+ ]
674
+ }
675
+ ),
676
+ /* @__PURE__ */ l("div", { className: "breadcrumb", children: [
677
+ /* @__PURE__ */ r("span", { children: a.name }),
678
+ /* @__PURE__ */ r(pn, { size: 13 }),
679
+ /* @__PURE__ */ r("strong", { children: (ie == null ? void 0 : ie.name) ?? "Outdoor site" }),
680
+ /* @__PURE__ */ r("span", { className: "mode-pill", children: ye ? "AI IMPORT" : v ? "EDITING" : "VIEWING" })
681
+ ] }),
682
+ /* @__PURE__ */ l("div", { children: [
683
+ (v || ye) && /* @__PURE__ */ r(
684
+ "button",
685
+ {
686
+ className: "icon-button",
687
+ "aria-label": "Import plan",
688
+ title: "Import plan",
689
+ "aria-pressed": he,
690
+ "data-import-running": ye || void 0,
691
+ onClick: () => {
692
+ St(!0), U(!he), he || (q(!1), be(!1), B(!1));
693
+ },
694
+ children: /* @__PURE__ */ r(hn, { size: 17 })
695
+ }
696
+ ),
697
+ /* @__PURE__ */ r(
698
+ "button",
699
+ {
700
+ className: "icon-button",
701
+ "aria-label": "Export project",
702
+ title: "Export portable project",
703
+ onClick: Xt,
704
+ children: /* @__PURE__ */ r(gn, { size: 17 })
705
+ }
706
+ ),
707
+ /* @__PURE__ */ r(
708
+ "button",
709
+ {
710
+ className: `icon-button ${ge ? "active-nav" : ""}`,
711
+ "aria-label": ge ? "Hide structure panel" : "Show structure panel",
712
+ title: "Structure — zones and portals",
713
+ onClick: () => {
714
+ U(!1), be(!ge), ge || q(!1);
715
+ },
716
+ children: /* @__PURE__ */ r(bn, { size: 17 })
717
+ }
718
+ ),
719
+ /* @__PURE__ */ l(
720
+ "button",
721
+ {
722
+ className: `icon-button ${L ? "active-nav" : ""}`,
723
+ "aria-label": L ? "Hide navigation panel" : "Show navigation panel",
724
+ title: "Navigate (G)",
725
+ onClick: () => {
726
+ U(!1), L && F(), q(!L), L || be(!1);
727
+ },
728
+ children: [
729
+ /* @__PURE__ */ r(vn, { size: 17 }),
730
+ H("G")
731
+ ]
732
+ }
733
+ ),
734
+ /* @__PURE__ */ l(
735
+ "button",
736
+ {
737
+ className: "icon-button",
738
+ "aria-label": re ? "Hide properties panel" : "Show properties panel",
739
+ title: re ? "Hide properties panel" : "Show properties panel",
740
+ onClick: () => {
741
+ U(!1), be(!1), q(!1), B(!re);
742
+ },
743
+ children: [
744
+ re ? /* @__PURE__ */ r(wn, { size: 17 }) : /* @__PURE__ */ r(In, { size: 17 }),
745
+ H("I")
746
+ ]
747
+ }
748
+ )
749
+ ] })
750
+ ] }),
751
+ se ? /* @__PURE__ */ r(
752
+ Dn,
753
+ {
754
+ fallback: /* @__PURE__ */ r("p", { className: "structure-empty", role: "status", children: "Loading navigation graph…" }),
755
+ children: /* @__PURE__ */ r(
756
+ vr,
757
+ {
758
+ project: a,
759
+ initialFloor: Do,
760
+ dark: ue,
761
+ onLocate: Ut,
762
+ onClose: () => De(!1)
763
+ }
764
+ )
765
+ }
766
+ ) : /* @__PURE__ */ l("div", { className: "canvas-body", children: [
767
+ /* @__PURE__ */ r(
768
+ Gn,
769
+ {
770
+ project: Qo,
771
+ canEdit: v,
772
+ floorId: c,
773
+ selected: m,
774
+ tool: at,
775
+ draft: lt,
776
+ hover: To,
777
+ guides: Go,
778
+ threeD: R,
779
+ stack: X,
780
+ coverage: fo,
781
+ showLabels: mo,
782
+ showPlan: po,
783
+ sun: ho,
784
+ dark: ue,
785
+ excavation: go,
786
+ cityBuildings: bo,
787
+ cadastre: vo,
788
+ basemap: Io,
789
+ assets: h.assets,
790
+ statuses: Rt,
791
+ elevators: k,
792
+ focusId: io,
793
+ alignment: w ? { image: w.imagePoints, map: w.mapPoints } : void 0,
794
+ onClick: Vo,
795
+ onAdopt: Ho,
796
+ onHover: Oo,
797
+ onSelect: (e) => $(e),
798
+ onVertexMove: Ko,
799
+ onVertexPreview: (e, t, o, s, n, d) => Uo(e, t, o, d, s, n),
800
+ snapping: it,
801
+ onError: I,
802
+ route: W,
803
+ activeStep: et,
804
+ playing: Me,
805
+ onJourneyStep: (e) => $e(e),
806
+ onJourneyEnd: () => {
807
+ F(), Ie(!0);
808
+ },
809
+ walk: oe,
810
+ onWalkExit: () => ae("3d"),
811
+ avatar: K,
812
+ onAvatar: Qe,
813
+ onWalkAt: (e) => {
814
+ Qe(e), e.floorId !== c && A(e.floorId), ae("walk");
815
+ },
816
+ onRequestFloor: (e) => A(e),
817
+ onReady: (e) => {
818
+ D.current = e, requestAnimationFrame(ut), e.on("moveend", () => Ie()), Ie(!0);
819
+ },
820
+ initialCamera: Ct.current ?? (f == null ? void 0 : f.camera)
821
+ }
822
+ ),
823
+ /* @__PURE__ */ r(
824
+ sr,
825
+ {
826
+ project: a,
827
+ floorId: c,
828
+ mode: y,
829
+ viewMode: nt,
830
+ stack: X,
831
+ alarmFloors: Bt,
832
+ showKeys: ft,
833
+ changeFloor: J,
834
+ chooseMode: ae,
835
+ setStack: Ue,
836
+ stepFloor: Gt
837
+ }
838
+ ),
839
+ /* @__PURE__ */ l("div", { className: "canvas-top-right", children: [
840
+ me && y !== "view" && /* @__PURE__ */ l(
841
+ "button",
842
+ {
843
+ className: `live-badge ${M.length ? "has-alarm" : ""}`,
844
+ onClick: () => {
845
+ M[0] ? $(M[0].id, !0) : I("Everything bound to the feed is reporting without active alarms.");
846
+ },
847
+ children: [
848
+ M.length ? /* @__PURE__ */ r(Nn, { size: 14 }) : /* @__PURE__ */ r("span", { className: "live-pip" }),
849
+ M.length ? `${M.length} active alarm${M.length > 1 ? "s" : ""}` : "Status feed"
850
+ ]
851
+ }
852
+ ),
853
+ /* @__PURE__ */ l(
854
+ "button",
855
+ {
856
+ className: `floating-icon ${Q ? "active" : ""}`,
857
+ "aria-label": Q ? "Exit full screen" : "Full-screen map",
858
+ title: Q ? "Exit full screen" : "Full-screen map",
859
+ onClick: () => yt(!Q),
860
+ children: [
861
+ Q ? /* @__PURE__ */ r(kn, { size: 18 }) : /* @__PURE__ */ r(yn, { size: 18 }),
862
+ H("F")
863
+ ]
864
+ }
865
+ ),
866
+ /* @__PURE__ */ r(
867
+ "button",
868
+ {
869
+ className: `floating-icon ${qe ? "active" : ""}`,
870
+ "aria-label": "Map settings",
871
+ onClick: () => wo(!qe),
872
+ children: /* @__PURE__ */ r(jn, { size: 18 })
873
+ }
874
+ )
875
+ ] }),
876
+ qe && /* @__PURE__ */ r(
877
+ ar,
878
+ {
879
+ display: jt,
880
+ project: a,
881
+ floorId: c,
882
+ editing: v,
883
+ hostBasemap: h.basemap,
884
+ commit: p,
885
+ snapping: it,
886
+ setSnapping: xo
887
+ }
888
+ ),
889
+ v && !R && !w && /* @__PURE__ */ r(
890
+ rr,
891
+ {
892
+ drawing: st,
893
+ projectHasGraph: !!a.navNodes,
894
+ showKeys: ft,
895
+ palette: uo,
896
+ setPalette: Ke,
897
+ canAdopt: No,
898
+ adoptDerivedGraph: en,
899
+ canUndo: !!fe.past.length,
900
+ canRedo: !!fe.future.length,
901
+ onUndo: () => {
902
+ O(ao), j([]), Z(null);
903
+ },
904
+ onRedo: () => {
905
+ O(so), j([]), Z(null);
906
+ }
907
+ }
908
+ ),
909
+ y !== "view" && /* @__PURE__ */ l("div", { className: "map-legend", children: [
910
+ /* @__PURE__ */ l("span", { children: [
911
+ /* @__PURE__ */ r("i", { className: "status-dot normal" }),
912
+ "Normal"
913
+ ] }),
914
+ /* @__PURE__ */ l("span", { children: [
915
+ /* @__PURE__ */ r("i", { className: "status-dot warning" }),
916
+ "Attention"
917
+ ] }),
918
+ /* @__PURE__ */ l("span", { children: [
919
+ /* @__PURE__ */ r("i", { className: "status-dot critical" }),
920
+ "Alarm"
921
+ ] }),
922
+ /* @__PURE__ */ l("span", { children: [
923
+ /* @__PURE__ */ r("i", { className: "status-dot unknown" }),
924
+ "Unknown"
925
+ ] })
926
+ ] })
927
+ ] }),
928
+ /* @__PURE__ */ l("div", { className: "canvas-statusbar", children: [
929
+ /* @__PURE__ */ l("span", { children: [
930
+ /* @__PURE__ */ r("span", { className: "status-dot normal" }),
931
+ se ? "Navigation graph" : v ? "Editor ready" : je ? "Live view ready" : "Plan viewer ready"
932
+ ] }),
933
+ /* @__PURE__ */ l("span", { children: [
934
+ a.barriers.length,
935
+ " barriers ",
936
+ /* @__PURE__ */ r("i", {}),
937
+ a.objects.length,
938
+ " objects ",
939
+ /* @__PURE__ */ r("i", {}),
940
+ a.floors.length,
941
+ " floors"
942
+ ] }),
943
+ /* @__PURE__ */ l("span", { children: [
944
+ se ? "Drag to arrange · scroll to zoom" : it ? "Snapping on · 0.5 m · 15°" : "Free positioning",
945
+ /* @__PURE__ */ r("kbd", { children: "?" })
946
+ ] })
947
+ ] })
948
+ ] }),
949
+ yo && /* @__PURE__ */ r("div", { className: "plan-import-slot", hidden: !he, children: Qt("plan") }),
950
+ !he && (w ? /* @__PURE__ */ r(
951
+ Tn,
952
+ {
953
+ drawing: w.prepared,
954
+ imagePoints: w.imagePoints,
955
+ mapPoints: w.mapPoints,
956
+ preview: w.preview,
957
+ setImagePoints: (e) => Ne({ ...w, imagePoints: e, mapPoints: [], preview: !1 }),
958
+ onCancel: () => Ne(null),
959
+ onPreview: Zo,
960
+ onConfirm: Jo,
961
+ onKnownDistance: Xo
962
+ }
963
+ ) : ge ? /* @__PURE__ */ r(
964
+ Ln,
965
+ {
966
+ project: a,
967
+ selected: m,
968
+ onSelect: x,
969
+ onFloorChange: J,
970
+ onLocate: Ut,
971
+ onGraphView: _o,
972
+ onEdit: v ? (e) => p(e) : void 0
973
+ }
974
+ ) : L ? /* @__PURE__ */ r(
975
+ Bn,
976
+ {
977
+ project: a,
978
+ here: K ? { floorId: K.floorId, position: K.position } : null,
979
+ from: ve,
980
+ to: we,
981
+ route: W,
982
+ playing: Me,
983
+ activeStep: et,
984
+ editing: v,
985
+ onFrom: _e,
986
+ onTo: Ve,
987
+ onSwap: () => {
988
+ _e(we), Ve(ve);
989
+ },
990
+ onClear: () => {
991
+ _e(null), Ve(null);
992
+ },
993
+ onPlay: () => {
994
+ De(!1), Dt.current = K, ze.current = !0, $e(0), Ft(!0);
995
+ },
996
+ onPause: F,
997
+ onStep: (e) => Jt((et ?? (e === 1 ? -1 : 1)) + e),
998
+ onSeek: Jt,
999
+ onClose: () => {
1000
+ F(), q(!1);
1001
+ }
1002
+ }
1003
+ ) : re ? /* @__PURE__ */ r(
1004
+ Rn,
1005
+ {
1006
+ onEdit: v ? (e) => p(e) : void 0,
1007
+ onSpaceGeometry: v ? (e, t) => p((o) => t === "independent" ? Qn(o, e) : Yn(o, e, t)) : void 0,
1008
+ onShiftOrigin: v ? (e, t) => p((o) => {
1009
+ o.origin = Zn(o.origin, e, t);
1010
+ }) : void 0,
1011
+ project: a,
1012
+ floorId: c,
1013
+ selected: m,
1014
+ statuses: Rt,
1015
+ monitoring: me,
1016
+ editing: v,
1017
+ live: je,
1018
+ renderStatusPanel: lo,
1019
+ onClose: () => {
1020
+ $(null), B(!1), window.matchMedia("(max-width: 840px)").matches && G(!1);
1021
+ },
1022
+ onUpdateObject: qo,
1023
+ onUpdateBarrier: (e, t) => (
1024
+ // Thickness is geometry: a wall that grows eats into the rooms on either side of it.
1025
+ ct((o) => Object.assign(o.barriers.find((s) => s.id === e), t))
1026
+ ),
1027
+ onUpdateDrawing: (e, t) => p((o) => Object.assign(o.drawings.find((s) => s.id === e), t)),
1028
+ onUpdateFloor: (e, t) => p((o) => Object.assign(o.floors.find((s) => s.id === e), t)),
1029
+ onDeleteFloor: tn,
1030
+ onSetInitialFloor: (e) => p((t) => {
1031
+ e === null ? delete t.initialFloorId : t.initialFloorId = e;
1032
+ }),
1033
+ onDuplicate: Kt,
1034
+ onDelete: on,
1035
+ onSelect: (e) => $(e, !0),
1036
+ onFloor: J,
1037
+ onTraceFootprint: nn
1038
+ }
1039
+ ) : null)
1040
+ ] }),
1041
+ Fe && /* @__PURE__ */ l("div", { className: "toast", role: "status", children: [
1042
+ /* @__PURE__ */ r(Nr, {}),
1043
+ /* @__PURE__ */ r("span", { children: Fe }),
1044
+ /* @__PURE__ */ r("button", { "aria-label": "Dismiss notification", onClick: () => Ze(""), children: /* @__PURE__ */ r(Sn, { size: 16 }) })
1045
+ ] }),
1046
+ jo && Qt("reference"),
1047
+ So && /* @__PURE__ */ l(
1048
+ Oe,
1049
+ {
1050
+ title: "Add a floor",
1051
+ subtitle: "Create a level at its real elevation relative to the site.",
1052
+ onClose: () => Se(!1),
1053
+ children: [
1054
+ /* @__PURE__ */ l("label", { className: "field", children: [
1055
+ /* @__PURE__ */ r("span", { children: "Floor name" }),
1056
+ /* @__PURE__ */ r("input", { "aria-label": "New floor name", value: tt, onChange: (e) => $o(e.target.value) })
1057
+ ] }),
1058
+ /* @__PURE__ */ l("div", { className: "field-grid", children: [
1059
+ /* @__PURE__ */ l("label", { className: "field", children: [
1060
+ /* @__PURE__ */ r("span", { children: "Building" }),
1061
+ /* @__PURE__ */ l("select", { value: Ae, onChange: (e) => zt(e.target.value), children: [
1062
+ a.buildings.map((e) => /* @__PURE__ */ r("option", { value: e.id, children: e.name }, e.id)),
1063
+ /* @__PURE__ */ r("option", { value: "new", children: "+ New building" })
1064
+ ] })
1065
+ ] }),
1066
+ /* @__PURE__ */ l("label", { className: "field", children: [
1067
+ /* @__PURE__ */ r("span", { children: "Elevation (m)" }),
1068
+ /* @__PURE__ */ r(
1069
+ "input",
1070
+ {
1071
+ "aria-label": "New floor elevation",
1072
+ type: "number",
1073
+ value: Mt,
1074
+ onChange: (e) => $t(Number(e.target.value))
1075
+ }
1076
+ )
1077
+ ] })
1078
+ ] }),
1079
+ Ae === "new" && /* @__PURE__ */ l("label", { className: "field", children: [
1080
+ /* @__PURE__ */ r("span", { children: "Building name" }),
1081
+ /* @__PURE__ */ r("input", { value: ot, onChange: (e) => zo(e.target.value) })
1082
+ ] }),
1083
+ /* @__PURE__ */ l("footer", { children: [
1084
+ /* @__PURE__ */ r("button", { className: "button secondary", onClick: () => Se(!1), children: "Cancel" }),
1085
+ /* @__PURE__ */ l(
1086
+ "button",
1087
+ {
1088
+ className: "button primary",
1089
+ disabled: !tt.trim() || Ae === "new" && !ot.trim(),
1090
+ onClick: () => {
1091
+ const e = gt();
1092
+ p((t) => {
1093
+ let o = Ae;
1094
+ o === "new" && (o = gt(), t.buildings.push({ id: o, name: ot })), t.floors.push({ id: e, name: tt, buildingId: o, elevation: Mt, height: 3.5 });
1095
+ }) && (J(e), Se(!1));
1096
+ },
1097
+ children: [
1098
+ "Create floor",
1099
+ /* @__PURE__ */ r(Pn, { size: 16 })
1100
+ ]
1101
+ }
1102
+ )
1103
+ ] })
1104
+ ]
1105
+ }
1106
+ ),
1107
+ E && /* @__PURE__ */ r(
1108
+ Oe,
1109
+ {
1110
+ title: (Yt = a.virtualBoundaries) != null && Yt.some((e) => e.id === E.wallId) ? "This boundary divides two spaces" : "This wall was dividing two spaces",
1111
+ subtitle: `Removing it leaves “${E.a.name}” and “${E.b.name}” open to each other. Keeping them apart is fine — they simply become connected. Merging is not reversible by redrawing the wall: the space that is absorbed loses its name, its feed binding and any zones it had joined.`,
1112
+ onClose: () => pe(null),
1113
+ children: /* @__PURE__ */ l("footer", { children: [
1114
+ /* @__PURE__ */ r("button", { className: "button secondary", onClick: () => pe(null), children: "Cancel" }),
1115
+ /* @__PURE__ */ r(
1116
+ "button",
1117
+ {
1118
+ className: "button secondary",
1119
+ onClick: () => {
1120
+ const e = E.wallId;
1121
+ pe(null), ct((t) => {
1122
+ no(t, e), pt(t);
1123
+ }), $(null);
1124
+ },
1125
+ children: "Keep both spaces"
1126
+ }
1127
+ ),
1128
+ [
1129
+ [E.a, E.b],
1130
+ [E.b, E.a]
1131
+ ].map(([e, t]) => /* @__PURE__ */ l(
1132
+ "button",
1133
+ {
1134
+ className: "button",
1135
+ onClick: () => {
1136
+ const o = E.wallId;
1137
+ pe(null), p((s) => {
1138
+ no(s, o), er(s, e.id, t.id), pt(s);
1139
+ }), $(null);
1140
+ },
1141
+ children: [
1142
+ "Merge into “",
1143
+ e.name,
1144
+ "”"
1145
+ ]
1146
+ },
1147
+ e.id
1148
+ ))
1149
+ ] })
1150
+ }
1151
+ ),
1152
+ Co && /* @__PURE__ */ r(
1153
+ Oe,
1154
+ {
1155
+ title: "Delete selected object?",
1156
+ subtitle: ce ? `This also removes ${ce} attached opening${ce > 1 ? "s" : ""}. The operation can be undone.` : "This operation can be undone. Child zones become independent areas.",
1157
+ onClose: () => Y(!1),
1158
+ children: /* @__PURE__ */ l("footer", { children: [
1159
+ /* @__PURE__ */ r("button", { className: "button secondary", onClick: () => Y(!1), children: "Cancel" }),
1160
+ /* @__PURE__ */ r("button", { className: "button danger", onClick: Zt, children: "Delete object" })
1161
+ ] })
1162
+ }
1163
+ ),
1164
+ Pe && /* @__PURE__ */ r(
1165
+ Oe,
1166
+ {
1167
+ title: `Delete ${((_t = a.floors.find((e) => e.id === Pe)) == null ? void 0 : _t.name) ?? "floor"}?`,
1168
+ subtitle: `${qt(Pe)} This operation can be undone.`,
1169
+ onClose: () => Ce(null),
1170
+ children: /* @__PURE__ */ l("footer", { children: [
1171
+ /* @__PURE__ */ r("button", { className: "button secondary", onClick: () => Ce(null), children: "Cancel" }),
1172
+ /* @__PURE__ */ r("button", { className: "button danger", onClick: () => Wt(Pe), children: "Delete floor" })
1173
+ ] })
1174
+ }
1175
+ ),
1176
+ Po && /* @__PURE__ */ r(lr, { onClose: () => We(!1) })
1177
+ ] });
1178
+ }
1179
+ function Nr() {
1180
+ return /* @__PURE__ */ r(Cn, { size: 18 });
1181
+ }
1182
+ function as(b) {
1183
+ return /* @__PURE__ */ r(Ir, { ...b, readOnly: !0 });
1184
+ }
1185
+ export {
1186
+ Ir as SitePlanner,
1187
+ as as SiteViewer
1188
+ };
1189
+ //# sourceMappingURL=SitePlanner.js.map