@realsee/dnalogel 2.0.0-alpha.1 → 2.0.0-alpha.10

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 (373) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +45 -5
  3. package/TERMS.txt +56 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
  5. package/dist/CSS3DRenderPlugin/index.js +231 -0
  6. package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/index.d.ts +7 -0
  8. package/dist/CameraMovementPlugin/index.js +302 -0
  9. package/dist/CameraMovementPlugin/typing.d.ts +68 -0
  10. package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
  11. package/dist/ModelChassisCompassPlugin/index.js +142 -0
  12. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
  13. package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
  14. package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
  15. package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
  16. package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
  17. package/dist/ModelRoomLabelPlugin/index.js +461 -0
  18. package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
  19. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
  20. package/dist/ModelViewPlugin/index.d.ts +17 -0
  21. package/dist/ModelViewPlugin/index.js +187 -0
  22. package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
  23. package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
  24. package/dist/PanoCompassPlugin/index.d.ts +51 -0
  25. package/dist/PanoCompassPlugin/index.js +521 -0
  26. package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
  27. package/dist/PanoCursorRaycasterPlugin/index.js +88 -0
  28. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  29. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  30. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  31. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  32. package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  33. package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
  34. package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
  35. package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
  36. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  37. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  38. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  39. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  40. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  41. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  42. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  43. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  44. package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  45. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  46. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
  47. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  48. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  49. package/dist/PanoMeasurePlugin/index.d.ts +7 -0
  50. package/dist/PanoMeasurePlugin/index.js +4789 -0
  51. package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
  52. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  53. package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  54. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  55. package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  56. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  57. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  58. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  59. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  60. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  61. package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  62. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  63. package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
  64. package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
  65. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  66. package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  67. package/dist/PanoRulerPlugin/index.d.ts +31 -0
  68. package/dist/PanoRulerPlugin/index.js +610 -0
  69. package/dist/PanoRulerPlugin/style.d.ts +2 -0
  70. package/dist/PanoRulerPlugin/typings.d.ts +21 -0
  71. package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
  72. package/dist/PanoSpatialTagPlugin/index.js +1259 -0
  73. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  74. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  75. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  76. package/dist/floorplan/Assets/camera.d.ts +1 -0
  77. package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  78. package/dist/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  79. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +104 -0
  80. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
  81. package/dist/floorplan/ModelFloorplanPlugin/index.js +3827 -0
  82. package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
  83. package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
  84. package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
  85. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
  86. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
  87. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1673 -0
  88. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +61 -0
  89. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
  90. package/dist/floorplan/TopviewFloorplanPlugin/index.js +3466 -0
  91. package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
  92. package/dist/floorplan/constant.d.ts +5 -0
  93. package/dist/floorplan/typings/floorplanData.d.ts +137 -0
  94. package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
  95. package/dist/floorplan/typings/utility.d.ts +2 -0
  96. package/dist/floorplan/utils/formatData.d.ts +5 -0
  97. package/dist/floorplan/utils/formatPosition.d.ts +36 -0
  98. package/dist/index.d.ts +26 -0
  99. package/dist/index.es.js +12910 -0
  100. package/dist/index.js +12949 -0
  101. package/dist/index.umd.js +12943 -0
  102. package/dist/shared-utils/Preloader.d.ts +6 -0
  103. package/dist/shared-utils/Subscribe.d.ts +45 -0
  104. package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
  105. package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
  106. package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
  107. package/dist/shared-utils/animationFrame/index.d.ts +15 -0
  108. package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
  109. package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  110. package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
  111. package/dist/shared-utils/createLine/index.d.ts +3 -0
  112. package/dist/shared-utils/debounce.d.ts +6 -0
  113. package/dist/shared-utils/equal.d.ts +11 -0
  114. package/dist/shared-utils/filter.d.ts +27 -0
  115. package/dist/shared-utils/five/changeMode.d.ts +2 -0
  116. package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
  117. package/dist/shared-utils/formatRad.d.ts +7 -0
  118. package/dist/shared-utils/getPxmm.d.ts +11 -0
  119. package/dist/shared-utils/getRandomColor.d.ts +1 -0
  120. package/dist/shared-utils/isNil.d.ts +10 -0
  121. package/dist/shared-utils/isTruelyObject.d.ts +18 -0
  122. package/dist/shared-utils/math/evenNumber.d.ts +3 -0
  123. package/dist/shared-utils/math/planimetry.d.ts +116 -0
  124. package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
  125. package/dist/shared-utils/nearlyEqual.d.ts +7 -0
  126. package/dist/shared-utils/nextFrame.d.ts +1 -0
  127. package/dist/shared-utils/noop.d.ts +5 -0
  128. package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
  129. package/dist/shared-utils/px2rem.d.ts +1 -0
  130. package/dist/shared-utils/removeArrayItem.d.ts +7 -0
  131. package/dist/shared-utils/tap.d.ts +8 -0
  132. package/dist/shared-utils/three/centerPoint.d.ts +2 -0
  133. package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
  134. package/dist/shared-utils/three/getNormal.d.ts +2 -0
  135. package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
  136. package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
  137. package/dist/shared-utils/three/loadTexture.d.ts +2 -0
  138. package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
  139. package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
  140. package/dist/shared-utils/throttle.d.ts +7 -0
  141. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  142. package/dist/shared-utils/to.d.ts +8 -0
  143. package/dist/shared-utils/useDebounce.d.ts +8 -0
  144. package/dist/shared-utils/useThrottle.d.ts +8 -0
  145. package/dist/shared-utils/uuid.d.ts +4 -0
  146. package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
  147. package/dist/typings/math.type.d.ts +44 -0
  148. package/dist/typings/utils.type.d.ts +2 -0
  149. package/docs/.nojekyll +1 -0
  150. package/docs/assets/highlight.css +78 -0
  151. package/docs/assets/icons.css +1043 -0
  152. package/docs/assets/icons.png +0 -0
  153. package/docs/assets/icons@2x.png +0 -0
  154. package/docs/assets/main.js +52 -0
  155. package/docs/assets/search.js +1 -0
  156. package/docs/assets/style.css +1413 -0
  157. package/docs/assets/widgets.png +0 -0
  158. package/docs/assets/widgets@2x.png +0 -0
  159. package/docs/classes/ModelRoomLabelController.html +20 -0
  160. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
  161. package/docs/enums/ModelFloorplanErrorType.html +1 -0
  162. package/docs/index.html +43 -0
  163. package/docs/interfaces/LineJson.html +1 -0
  164. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
  165. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
  166. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
  167. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
  168. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
  169. package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
  170. package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
  171. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
  172. package/docs/interfaces/PanoCompassPluginData.html +1 -0
  173. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
  174. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
  175. package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
  176. package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
  177. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
  178. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  179. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  180. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  181. package/docs/interfaces/PointJson.html +1 -0
  182. package/docs/interfaces/RoomLabel.html +13 -0
  183. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -0
  184. package/docs/modules.html +28 -0
  185. package/libs/CSS3DRenderPlugin/index.js +11 -13
  186. package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
  187. package/libs/ModelRoomLabelPlugin/Controller.js +2 -2
  188. package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
  189. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +253 -0
  190. package/libs/ModelViewPlugin/index.js +6 -6
  191. package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
  192. package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
  193. package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
  194. package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
  195. package/libs/PanoCompassPlugin/index.d.ts +51 -0
  196. package/libs/PanoCompassPlugin/index.js +171 -0
  197. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  198. package/libs/PanoMeasurePlugin/Controller/BaseController.js +69 -0
  199. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  200. package/libs/PanoMeasurePlugin/Controller/EditController.js +216 -0
  201. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  202. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +44 -0
  203. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  204. package/libs/PanoMeasurePlugin/Controller/WatchController.js +223 -0
  205. package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  206. package/libs/PanoMeasurePlugin/Controller/index.js +176 -0
  207. package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
  208. package/libs/PanoMeasurePlugin/Model/index.js +114 -0
  209. package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
  210. package/libs/PanoMeasurePlugin/Model/line.js +64 -0
  211. package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
  212. package/libs/PanoMeasurePlugin/Model/point.js +28 -0
  213. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  214. package/libs/PanoMeasurePlugin/Model/polyline.js +48 -0
  215. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  216. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
  217. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  218. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
  219. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  220. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
  221. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  222. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +108 -0
  223. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  224. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +33 -0
  225. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  226. package/libs/PanoMeasurePlugin/Modules/GuideController.js +75 -0
  227. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  228. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +103 -0
  229. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  230. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
  231. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  232. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +102 -0
  233. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
  234. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +35 -0
  235. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  236. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +69 -0
  237. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  238. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +78 -0
  239. package/libs/PanoMeasurePlugin/index.d.ts +7 -0
  240. package/libs/PanoMeasurePlugin/index.js +5 -0
  241. package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
  242. package/libs/PanoMeasurePlugin/typings/data.js +1 -0
  243. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  244. package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
  245. package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  246. package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
  247. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  248. package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
  249. package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  250. package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
  251. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  252. package/libs/PanoMeasurePlugin/utils/distanceDom.js +114 -0
  253. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  254. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
  255. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  256. package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
  257. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  258. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
  259. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  260. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
  261. package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  262. package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
  263. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  264. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
  265. package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
  266. package/libs/PanoMeasurePlugin/utils/line.js +32 -0
  267. package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
  268. package/libs/PanoMeasurePlugin/utils/math.js +44 -0
  269. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  270. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +21 -0
  271. package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  272. package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
  273. package/libs/PanoRulerPlugin/index.d.ts +31 -0
  274. package/libs/PanoRulerPlugin/index.js +398 -0
  275. package/libs/PanoRulerPlugin/style.d.ts +2 -0
  276. package/libs/PanoRulerPlugin/style.js +88 -0
  277. package/libs/PanoRulerPlugin/typings.d.ts +21 -0
  278. package/libs/PanoRulerPlugin/typings.js +1 -0
  279. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  280. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  281. package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
  282. package/libs/PanoSpatialTagPlugin/index.js +411 -0
  283. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  284. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  285. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  286. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  287. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  288. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  289. package/libs/floorplan/Components/BaseImage.js +217 -0
  290. package/libs/floorplan/Components/Normalmage.js +63 -0
  291. package/libs/floorplan/Components/RoomHighlight/Room.js +70 -0
  292. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +289 -0
  293. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +328 -0
  294. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
  295. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
  296. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
  297. package/libs/floorplan/Components/SvgImage.js +83 -0
  298. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
  299. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
  300. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
  301. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
  302. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
  303. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
  304. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
  305. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
  306. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -0
  307. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +4 -3
  308. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
  309. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +248 -0
  310. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
  311. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
  312. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -1
  313. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +2 -0
  314. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +5 -4
  315. package/libs/floorplan/constant.d.ts +5 -0
  316. package/libs/floorplan/constant.js +6 -0
  317. package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
  318. package/libs/index.d.ts +18 -9
  319. package/libs/index.js +9 -3
  320. package/libs/shared-utils/getPxmm.d.ts +6 -1
  321. package/libs/shared-utils/getPxmm.js +26 -12
  322. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  323. package/libs/shared-utils/tinyEJSrender.js +180 -0
  324. package/package.json +22 -12
  325. package/dist/dnalogel.es.js +0 -37145
  326. package/dist/dnalogel.umd.js +0 -2
  327. package/dist/style.css +0 -1
  328. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
  329. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
  330. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
  331. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
  332. package/libs/floorplan/Components/BaseImage.svelte +0 -25
  333. package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
  334. package/libs/floorplan/Components/Normalmage.svelte +0 -11
  335. package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
  336. package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
  337. package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
  338. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
  339. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
  340. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
  341. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
  342. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
  343. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
  344. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
  345. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
  346. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
  347. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
  348. package/libs/floorplan/Components/SvgImage.svelte +0 -25
  349. package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
  350. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
  351. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
  352. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
  353. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
  354. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
  355. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  356. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
  357. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
  358. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
  359. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
  360. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
  361. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
  362. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
  363. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
  364. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
  365. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
  366. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
  367. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
  368. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
  369. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  370. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
  371. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
  372. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
  373. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
@@ -0,0 +1,3466 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var THREE = require('three');
6
+ var internal = require('svelte/internal');
7
+ var easing = require('svelte/easing');
8
+ var transition = require('svelte/transition');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n["default"] = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
29
+
30
+ const pluginStyle = {
31
+ position: 'absolute',
32
+ left: '50%',
33
+ top: '50%',
34
+ transform: 'translate(-50%, -50%)',
35
+ pointerEvents: 'none',
36
+ zIndex: '10',
37
+ };
38
+
39
+ function pathD(points, options = {}) {
40
+ let d = '';
41
+ const { needZ, needA } = options;
42
+ const _points = needZ ? points.slice().concat(points[0]) : points.slice();
43
+ _points.forEach((_point, index) => {
44
+ const { x, y } = options.format ? options.format(_point) : _point;
45
+ const point = x + ',' + y;
46
+ if (index === 0) {
47
+ d += 'M' + point;
48
+ return d;
49
+ }
50
+ if (needA?.[index]) {
51
+ d += 'A' + needA[index] + ',' + point;
52
+ return d;
53
+ }
54
+ d += 'L' + point;
55
+ return d;
56
+ });
57
+ return d + (needZ ? 'Z' : '');
58
+ }
59
+ /** 把户型图上点点位转换到 SVG 上的点位 */
60
+ function formatFloorplanPoint({ x, y }, pxmm, bounding) {
61
+ const { max, min } = bounding;
62
+ return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
63
+ }
64
+
65
+ async function formatOutlines(outlines) {
66
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
67
+ const getOutlineItem = async function (item) {
68
+ const outlineItem = {
69
+ index: item.index,
70
+ url: item.url,
71
+ svgUrl: item.svg_url,
72
+ };
73
+ if (item.svg_url) {
74
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
75
+ outlineItem.svgContent = svgContent;
76
+ }
77
+ return outlineItem;
78
+ };
79
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
80
+ return svgOutlineItems;
81
+ }
82
+ function formatRoom(data) {
83
+ const floorplanRoomItem = {
84
+ id: data.id,
85
+ size: data.size,
86
+ name: data.name,
87
+ path: data.path,
88
+ roomType: data.room_type,
89
+ floorType: data.floor_type,
90
+ roomLabel: {
91
+ position: data.room_label.position,
92
+ positionInImage: data.room_label.position_in_image,
93
+ },
94
+ observerIndexs: data.observer_indexs,
95
+ };
96
+ return floorplanRoomItem;
97
+ }
98
+ function formatFloorData(_data) {
99
+ return {
100
+ floorName: _data.floor_name,
101
+ floorIndex: _data.floor_index,
102
+ rooms: _data.rooms.map(formatRoom),
103
+ rules: _data.rules,
104
+ };
105
+ }
106
+ function formateFloorplanObserver(data) {
107
+ const floorplanObserver = {
108
+ index: data.index,
109
+ floorIndex: data.floor_index,
110
+ position: data.position,
111
+ positionInImage: data.position_in_image,
112
+ };
113
+ return floorplanObserver;
114
+ }
115
+ function formatFloorplanEntrance(data) {
116
+ const floorplanEntrance = {
117
+ rad: data.rad,
118
+ position: data.position,
119
+ positionInImage: data.position_in_image,
120
+ northRad: data.north_rad,
121
+ roomId: data.room_id,
122
+ floorIndex: data.floor_index,
123
+ };
124
+ return floorplanEntrance;
125
+ }
126
+ async function formatData(data) {
127
+ const outlines = await formatOutlines(data.outlines);
128
+ const bounding = data.computed_data.bounding;
129
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
130
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
131
+ const floorplanData = {
132
+ outlines,
133
+ entrance,
134
+ bounding,
135
+ floorDatas,
136
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
137
+ };
138
+ return floorplanData;
139
+ }
140
+
141
+ /**
142
+ * 把第一个参数传入第二个参数(函数)中并执行
143
+ * 一般用于执行函数后返回变量。
144
+ * @param {any} something
145
+ * @param {function} callback
146
+ * @return {any}
147
+ */
148
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
+ function tap(something, callback) {
150
+ callback(something);
151
+ return something;
152
+ }
153
+
154
+ /**
155
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
156
+ * @param object
157
+ * @param props 排除的属性
158
+ * @return
159
+ */
160
+ function omit(object, props) {
161
+ return tap({}, (result) => {
162
+ for (const name in object) {
163
+ if (props.indexOf(name) !== -1)
164
+ continue;
165
+ result[name] = object[name];
166
+ }
167
+ });
168
+ }
169
+
170
+ var FLOOR_PLAN_ATTACHED_TO;
171
+ (function (FLOOR_PLAN_ATTACHED_TO) {
172
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["FLOOR"] = 1] = "FLOOR";
173
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["CEILING"] = 2] = "CEILING";
174
+ FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
175
+ })(FLOOR_PLAN_ATTACHED_TO || (FLOOR_PLAN_ATTACHED_TO = {}));
176
+
177
+ /**
178
+ * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
179
+ * @param five five
180
+ */
181
+ function getPxmm(five, container, floorIndex, options) {
182
+ const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
183
+ function getFloorY(floorIndex) {
184
+ return floorIndex > maxFloorIndex
185
+ ? five.model.bounding.max.y
186
+ : Math.max(...five.work.observers
187
+ .filter((ob) => ob.floorIndex === floorIndex)
188
+ .map((ob) => ob.standingPosition.y));
189
+ }
190
+ function getY() {
191
+ const currentFloorY = getFloorY(floorIndex);
192
+ const nextFloorY = getFloorY(floorIndex + 1);
193
+ const attachedTo = options?.attachedTo || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
194
+ if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
195
+ return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
196
+ else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
197
+ return nextFloorY;
198
+ else
199
+ return currentFloorY;
200
+ }
201
+ const y = getY();
202
+ const originPosition = new THREE__namespace.Vector3(0, y, 0);
203
+ const originPositionXUnit = new THREE__namespace.Vector3(1, y, 0);
204
+ const mouse = originPosition.clone().project(five.camera);
205
+ const xUnitMouse = originPositionXUnit.clone().project(five.camera);
206
+ const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
207
+ return pxmm;
208
+ }
209
+
210
+ const CAMERA_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv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components/Camera.svelte generated by Svelte v3.47.0 */
217
+
218
+ function add_css$c(target) {
219
+ internal.append_styles(target, "svelte-e8a2kn", ".floorplan__camera-position.svelte-e8a2kn{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-e8a2kn{position:absolute;background-repeat:no-repeat;background-size:100%}");
220
+ }
221
+
222
+ function create_fragment$g(ctx) {
223
+ let div1;
224
+ let div0;
225
+
226
+ return {
227
+ c() {
228
+ div1 = internal.element("div");
229
+ div0 = internal.element("div");
230
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-e8a2kn");
231
+ internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
232
+ internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
233
+ internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
234
+ internal.set_style(div0, "left", '-' + /*domSizeStyle*/ ctx[4], false);
235
+ internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
236
+ internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
237
+ internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
238
+ internal.attr(div1, "class", "floorplan__camera-position svelte-e8a2kn");
239
+ internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
240
+ internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
241
+ },
242
+ m(target, anchor) {
243
+ internal.insert(target, div1, anchor);
244
+ internal.append(div1, div0);
245
+ },
246
+ p(ctx, [dirty]) {
247
+ if (dirty & /*cameraImageUrl*/ 1) {
248
+ internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
249
+ }
250
+ },
251
+ i: internal.noop,
252
+ o: internal.noop,
253
+ d(detaching) {
254
+ if (detaching) internal.detach(div1);
255
+ }
256
+ };
257
+ }
258
+
259
+ function instance$g($$self, $$props, $$invalidate) {
260
+ let { panoIndex } = $$props;
261
+ let { floorplanData } = $$props;
262
+ let { lastPanoramaLongitude } = $$props;
263
+ let { cameraImageUrl } = $$props;
264
+ const { observers } = floorplanData;
265
+ const observer = observers[panoIndex];
266
+ const leftRatio = observer.positionInImage.x;
267
+ const topRatio = observer.positionInImage.y;
268
+ const positionLeft = leftRatio * 100 + '%';
269
+ const positionTop = topRatio * 100 + '%';
270
+ const rotate = -rad2Deg$1(lastPanoramaLongitude) + 45;
271
+
272
+ // TODO: 统一这里的判断条件,目前写了多处
273
+ const bodyWidth = document.body.clientWidth;
274
+
275
+ const bodyHeight = document.body.clientHeight;
276
+ const size = bodyWidth < 500 || bodyHeight < 500 ? 17 : 37;
277
+ const domSizeStyle = `${size / 16}rem`;
278
+
279
+ $$self.$$set = $$props => {
280
+ if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
281
+ if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
282
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(7, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
283
+ if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
284
+ };
285
+
286
+ return [
287
+ cameraImageUrl,
288
+ positionLeft,
289
+ positionTop,
290
+ rotate,
291
+ domSizeStyle,
292
+ panoIndex,
293
+ floorplanData,
294
+ lastPanoramaLongitude
295
+ ];
296
+ }
297
+
298
+ class Camera extends internal.SvelteComponent {
299
+ constructor(options) {
300
+ super();
301
+
302
+ internal.init(
303
+ this,
304
+ options,
305
+ instance$g,
306
+ create_fragment$g,
307
+ internal.safe_not_equal,
308
+ {
309
+ panoIndex: 5,
310
+ floorplanData: 6,
311
+ lastPanoramaLongitude: 7,
312
+ cameraImageUrl: 0
313
+ },
314
+ add_css$c
315
+ );
316
+ }
317
+ }
318
+
319
+ const COMPASS_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4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0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=';
320
+
321
+ /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
322
+
323
+ function add_css$b(target) {
324
+ internal.append_styles(target, "svelte-5l80pv", ".floorplan-plugin__compass.svelte-5l80pv{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-5l80pv{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-5l80pv{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
325
+ }
326
+
327
+ // (11:0) {#if northRad}
328
+ function create_if_block$6(ctx) {
329
+ let div1;
330
+ let div0;
331
+ let t0;
332
+ let span;
333
+
334
+ return {
335
+ c() {
336
+ div1 = internal.element("div");
337
+ div0 = internal.element("div");
338
+ t0 = internal.space();
339
+ span = internal.element("span");
340
+ span.textContent = "北";
341
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-5l80pv");
342
+ internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
343
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-5l80pv");
344
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-5l80pv");
345
+ internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[1], false);
346
+ },
347
+ m(target, anchor) {
348
+ internal.insert(target, div1, anchor);
349
+ internal.append(div1, div0);
350
+ internal.append(div1, t0);
351
+ internal.append(div1, span);
352
+ },
353
+ p: internal.noop,
354
+ d(detaching) {
355
+ if (detaching) internal.detach(div1);
356
+ }
357
+ };
358
+ }
359
+
360
+ function create_fragment$f(ctx) {
361
+ let if_block_anchor;
362
+ let if_block = /*northRad*/ ctx[0] && create_if_block$6(ctx);
363
+
364
+ return {
365
+ c() {
366
+ if (if_block) if_block.c();
367
+ if_block_anchor = internal.empty();
368
+ },
369
+ m(target, anchor) {
370
+ if (if_block) if_block.m(target, anchor);
371
+ internal.insert(target, if_block_anchor, anchor);
372
+ },
373
+ p(ctx, [dirty]) {
374
+ if (/*northRad*/ ctx[0]) if_block.p(ctx, dirty);
375
+ },
376
+ i: internal.noop,
377
+ o: internal.noop,
378
+ d(detaching) {
379
+ if (if_block) if_block.d(detaching);
380
+ if (detaching) internal.detach(if_block_anchor);
381
+ }
382
+ };
383
+ }
384
+
385
+ function rad2Deg(rad) {
386
+ return rad / Math.PI * 180;
387
+ }
388
+
389
+ function instance$f($$self, $$props, $$invalidate) {
390
+ let { floorplanData } = $$props;
391
+ const northRad = floorplanData.entrance?.northRad;
392
+ const rotate = !northRad ? 0 : rad2Deg(northRad);
393
+ const compassTransformStyle = `translateX(-50%) translateZ(10px) rotate(${-rotate + 90}deg)`;
394
+
395
+ $$self.$$set = $$props => {
396
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
397
+ };
398
+
399
+ return [northRad, compassTransformStyle, floorplanData];
400
+ }
401
+
402
+ class Compass extends internal.SvelteComponent {
403
+ constructor(options) {
404
+ super();
405
+ internal.init(this, options, instance$f, create_fragment$f, internal.safe_not_equal, { floorplanData: 2 }, add_css$b);
406
+ }
407
+ }
408
+
409
+ /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
410
+
411
+ function add_css$a(target) {
412
+ internal.append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item.svelte-1ashbdx{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:15px;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-1ashbdx{opacity:0.45}");
413
+ }
414
+
415
+ // (22:30)
416
+ function create_if_block_1$4(ctx) {
417
+ let html_tag;
418
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
419
+ let html_anchor;
420
+
421
+ return {
422
+ c() {
423
+ html_tag = new internal.HtmlTag();
424
+ html_anchor = internal.empty();
425
+ html_tag.a = html_anchor;
426
+ },
427
+ m(target, anchor) {
428
+ html_tag.m(raw_value, target, anchor);
429
+ internal.insert(target, html_anchor, anchor);
430
+ },
431
+ p(ctx, dirty) {
432
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
433
+ },
434
+ d(detaching) {
435
+ if (detaching) internal.detach(html_anchor);
436
+ if (detaching) html_tag.d();
437
+ }
438
+ };
439
+ }
440
+
441
+ // (16:2) {#if getLabelElement === undefined}
442
+ function create_if_block$5(ctx) {
443
+ let span0;
444
+ let t0_value = /*room*/ ctx[0].name + "";
445
+ let t0;
446
+ let t1;
447
+ let span1;
448
+
449
+ return {
450
+ c() {
451
+ span0 = internal.element("span");
452
+ t0 = internal.text(t0_value);
453
+ t1 = internal.space();
454
+ span1 = internal.element("span");
455
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
456
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
457
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
458
+ },
459
+ m(target, anchor) {
460
+ internal.insert(target, span0, anchor);
461
+ internal.append(span0, t0);
462
+ internal.insert(target, t1, anchor);
463
+ internal.insert(target, span1, anchor);
464
+ },
465
+ p(ctx, dirty) {
466
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
467
+ },
468
+ d(detaching) {
469
+ if (detaching) internal.detach(span0);
470
+ if (detaching) internal.detach(t1);
471
+ if (detaching) internal.detach(span1);
472
+ }
473
+ };
474
+ }
475
+
476
+ function create_fragment$e(ctx) {
477
+ let div;
478
+
479
+ function select_block_type(ctx, dirty) {
480
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$5;
481
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
482
+ }
483
+
484
+ let current_block_type = select_block_type(ctx);
485
+ let if_block = current_block_type && current_block_type(ctx);
486
+
487
+ return {
488
+ c() {
489
+ div = internal.element("div");
490
+ if (if_block) if_block.c();
491
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
492
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
493
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
494
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
495
+ },
496
+ m(target, anchor) {
497
+ internal.insert(target, div, anchor);
498
+ if (if_block) if_block.m(div, null);
499
+ },
500
+ p(ctx, [dirty]) {
501
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
502
+ if_block.p(ctx, dirty);
503
+ } else {
504
+ if (if_block) if_block.d(1);
505
+ if_block = current_block_type && current_block_type(ctx);
506
+
507
+ if (if_block) {
508
+ if_block.c();
509
+ if_block.m(div, null);
510
+ }
511
+ }
512
+ },
513
+ i: internal.noop,
514
+ o: internal.noop,
515
+ d(detaching) {
516
+ if (detaching) internal.detach(div);
517
+
518
+ if (if_block) {
519
+ if_block.d();
520
+ }
521
+ }
522
+ };
523
+ }
524
+
525
+ function instance$e($$self, $$props, $$invalidate) {
526
+ let userConfigElement;
527
+ let { room } = $$props;
528
+ let { getLabelElement } = $$props;
529
+
530
+ // TODO: 统一这里的判断条件,目前写了多处
531
+ const bodyWidth = document.body.clientWidth;
532
+
533
+ const bodyHeight = document.body.clientHeight;
534
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
535
+ const roomLabel = room.roomLabel;
536
+ const left = roomLabel.positionInImage.x * 100 + '%';
537
+ const top = roomLabel.positionInImage.y * 100 + '%';
538
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
539
+
540
+ $$self.$$set = $$props => {
541
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
542
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
543
+ };
544
+
545
+ $$self.$$.update = () => {
546
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
547
+ $$invalidate(2, userConfigElement = getLabelElement?.(room));
548
+ }
549
+ };
550
+
551
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
552
+ }
553
+
554
+ class RoomLabel extends internal.SvelteComponent {
555
+ constructor(options) {
556
+ super();
557
+ internal.init(this, options, instance$e, create_fragment$e, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$a);
558
+ }
559
+ }
560
+
561
+ /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
562
+
563
+ function add_css$9(target) {
564
+ internal.append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels.svelte-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
565
+ }
566
+
567
+ function get_each_context$4(ctx, list, i) {
568
+ const child_ctx = ctx.slice();
569
+ child_ctx[4] = list[i];
570
+ return child_ctx;
571
+ }
572
+
573
+ // (8:0) {#if rooms}
574
+ function create_if_block$4(ctx) {
575
+ let div;
576
+ let each_blocks = [];
577
+ let each_1_lookup = new Map();
578
+ let current;
579
+ let each_value = /*rooms*/ ctx[1];
580
+ const get_key = ctx => /*room*/ ctx[4].id;
581
+
582
+ for (let i = 0; i < each_value.length; i += 1) {
583
+ let child_ctx = get_each_context$4(ctx, each_value, i);
584
+ let key = get_key(child_ctx);
585
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
586
+ }
587
+
588
+ return {
589
+ c() {
590
+ div = internal.element("div");
591
+
592
+ for (let i = 0; i < each_blocks.length; i += 1) {
593
+ each_blocks[i].c();
594
+ }
595
+
596
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
597
+ },
598
+ m(target, anchor) {
599
+ internal.insert(target, div, anchor);
600
+
601
+ for (let i = 0; i < each_blocks.length; i += 1) {
602
+ each_blocks[i].m(div, null);
603
+ }
604
+
605
+ current = true;
606
+ },
607
+ p(ctx, dirty) {
608
+ if (dirty & /*rooms, getLabelElement*/ 3) {
609
+ each_value = /*rooms*/ ctx[1];
610
+ internal.group_outros();
611
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
612
+ internal.check_outros();
613
+ }
614
+ },
615
+ i(local) {
616
+ if (current) return;
617
+
618
+ for (let i = 0; i < each_value.length; i += 1) {
619
+ internal.transition_in(each_blocks[i]);
620
+ }
621
+
622
+ current = true;
623
+ },
624
+ o(local) {
625
+ for (let i = 0; i < each_blocks.length; i += 1) {
626
+ internal.transition_out(each_blocks[i]);
627
+ }
628
+
629
+ current = false;
630
+ },
631
+ d(detaching) {
632
+ if (detaching) internal.detach(div);
633
+
634
+ for (let i = 0; i < each_blocks.length; i += 1) {
635
+ each_blocks[i].d();
636
+ }
637
+ }
638
+ };
639
+ }
640
+
641
+ // (10:4) {#each rooms as room (room.id)}
642
+ function create_each_block$4(key_1, ctx) {
643
+ let first;
644
+ let roomlabel;
645
+ let current;
646
+
647
+ const roomlabel_spread_levels = [
648
+ {
649
+ room: /*room*/ ctx[4],
650
+ getLabelElement: /*getLabelElement*/ ctx[0]
651
+ }
652
+ ];
653
+
654
+ let roomlabel_props = {};
655
+
656
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
657
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
658
+ }
659
+
660
+ roomlabel = new RoomLabel({ props: roomlabel_props });
661
+
662
+ return {
663
+ key: key_1,
664
+ first: null,
665
+ c() {
666
+ first = internal.empty();
667
+ internal.create_component(roomlabel.$$.fragment);
668
+ this.first = first;
669
+ },
670
+ m(target, anchor) {
671
+ internal.insert(target, first, anchor);
672
+ internal.mount_component(roomlabel, target, anchor);
673
+ current = true;
674
+ },
675
+ p(new_ctx, dirty) {
676
+ ctx = new_ctx;
677
+
678
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
679
+ ? internal.get_spread_update(roomlabel_spread_levels, [
680
+ {
681
+ room: /*room*/ ctx[4],
682
+ getLabelElement: /*getLabelElement*/ ctx[0]
683
+ }
684
+ ])
685
+ : {};
686
+
687
+ roomlabel.$set(roomlabel_changes);
688
+ },
689
+ i(local) {
690
+ if (current) return;
691
+ internal.transition_in(roomlabel.$$.fragment, local);
692
+ current = true;
693
+ },
694
+ o(local) {
695
+ internal.transition_out(roomlabel.$$.fragment, local);
696
+ current = false;
697
+ },
698
+ d(detaching) {
699
+ if (detaching) internal.detach(first);
700
+ internal.destroy_component(roomlabel, detaching);
701
+ }
702
+ };
703
+ }
704
+
705
+ function create_fragment$d(ctx) {
706
+ let if_block_anchor;
707
+ let current;
708
+ let if_block = /*rooms*/ ctx[1] && create_if_block$4(ctx);
709
+
710
+ return {
711
+ c() {
712
+ if (if_block) if_block.c();
713
+ if_block_anchor = internal.empty();
714
+ },
715
+ m(target, anchor) {
716
+ if (if_block) if_block.m(target, anchor);
717
+ internal.insert(target, if_block_anchor, anchor);
718
+ current = true;
719
+ },
720
+ p(ctx, [dirty]) {
721
+ if (/*rooms*/ ctx[1]) {
722
+ if (if_block) {
723
+ if_block.p(ctx, dirty);
724
+
725
+ if (dirty & /*rooms*/ 2) {
726
+ internal.transition_in(if_block, 1);
727
+ }
728
+ } else {
729
+ if_block = create_if_block$4(ctx);
730
+ if_block.c();
731
+ internal.transition_in(if_block, 1);
732
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
733
+ }
734
+ } else if (if_block) {
735
+ internal.group_outros();
736
+
737
+ internal.transition_out(if_block, 1, 1, () => {
738
+ if_block = null;
739
+ });
740
+
741
+ internal.check_outros();
742
+ }
743
+ },
744
+ i(local) {
745
+ if (current) return;
746
+ internal.transition_in(if_block);
747
+ current = true;
748
+ },
749
+ o(local) {
750
+ internal.transition_out(if_block);
751
+ current = false;
752
+ },
753
+ d(detaching) {
754
+ if (if_block) if_block.d(detaching);
755
+ if (detaching) internal.detach(if_block_anchor);
756
+ }
757
+ };
758
+ }
759
+
760
+ function instance$d($$self, $$props, $$invalidate) {
761
+ let rooms;
762
+ let { floorIndex } = $$props;
763
+ let { floorplanData } = $$props;
764
+ let { getLabelElement } = $$props;
765
+
766
+ $$self.$$set = $$props => {
767
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
768
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
769
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
770
+ };
771
+
772
+ $$self.$$.update = () => {
773
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
774
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
775
+ }
776
+ };
777
+
778
+ return [getLabelElement, rooms, floorIndex, floorplanData];
779
+ }
780
+
781
+ class RoomLabels extends internal.SvelteComponent {
782
+ constructor(options) {
783
+ super();
784
+
785
+ internal.init(
786
+ this,
787
+ options,
788
+ instance$d,
789
+ create_fragment$d,
790
+ internal.safe_not_equal,
791
+ {
792
+ floorIndex: 2,
793
+ floorplanData: 3,
794
+ getLabelElement: 0
795
+ },
796
+ add_css$9
797
+ );
798
+ }
799
+ }
800
+
801
+ /**
802
+ * 判断对象是否为`null`或`undefined`。
803
+ * @param
804
+ * @return
805
+ */
806
+ /**
807
+ * 判断对象不为`null`或`undefined`。
808
+ */
809
+ function notNil(value) {
810
+ return value !== null && value !== undefined;
811
+ }
812
+
813
+ /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
814
+
815
+ function add_css$8(target) {
816
+ internal.append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1rr09in{transform:translate(-50%, -50%)}");
817
+ }
818
+
819
+ function get_each_context$3(ctx, list, i) {
820
+ const child_ctx = ctx.slice();
821
+ child_ctx[24] = list[i];
822
+ child_ctx[26] = i;
823
+ return child_ctx;
824
+ }
825
+
826
+ function get_each_context_1(ctx, list, i) {
827
+ const child_ctx = ctx.slice();
828
+ child_ctx[27] = list[i];
829
+ child_ctx[29] = i;
830
+ return child_ctx;
831
+ }
832
+
833
+ // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
834
+ function create_each_block_1(key_1, ctx) {
835
+ let div;
836
+ let style_left = `${/*position*/ ctx[27]}px`;
837
+
838
+ return {
839
+ key: key_1,
840
+ first: null,
841
+ c() {
842
+ div = internal.element("div");
843
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
844
+ internal.set_style(div, "left", style_left, false);
845
+ this.first = div;
846
+ },
847
+ m(target, anchor) {
848
+ internal.insert(target, div, anchor);
849
+ },
850
+ p(new_ctx, dirty) {
851
+ ctx = new_ctx;
852
+ },
853
+ d(detaching) {
854
+ if (detaching) internal.detach(div);
855
+ }
856
+ };
857
+ }
858
+
859
+ // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
860
+ function create_each_block$3(key_1, ctx) {
861
+ let div;
862
+ let span;
863
+ let t0_value = /*textItem*/ ctx[24].distance + "";
864
+ let t0;
865
+ let t1;
866
+ let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
867
+
868
+ return {
869
+ key: key_1,
870
+ first: null,
871
+ c() {
872
+ div = internal.element("div");
873
+ span = internal.element("span");
874
+ t0 = internal.text(t0_value);
875
+ t1 = internal.space();
876
+ internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
877
+ internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
878
+ internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
879
+ internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
880
+ internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
881
+ internal.set_style(div, "left", style_left, false);
882
+ this.first = div;
883
+ },
884
+ m(target, anchor) {
885
+ internal.insert(target, div, anchor);
886
+ internal.append(div, span);
887
+ internal.append(span, t0);
888
+ internal.append(div, t1);
889
+ },
890
+ p(new_ctx, dirty) {
891
+ ctx = new_ctx;
892
+ },
893
+ d(detaching) {
894
+ if (detaching) internal.detach(div);
895
+ }
896
+ };
897
+ }
898
+
899
+ function create_fragment$c(ctx) {
900
+ let div1;
901
+ let div0;
902
+ let t0;
903
+ let each_blocks_1 = [];
904
+ let each0_lookup = new Map();
905
+ let t1;
906
+ let each_blocks = [];
907
+ let each1_lookup = new Map();
908
+ let div1_class_value;
909
+ let each_value_1 = /*positionPxArray*/ ctx[6];
910
+ const get_key = ctx => /*positionIndex*/ ctx[29];
911
+
912
+ for (let i = 0; i < each_value_1.length; i += 1) {
913
+ let child_ctx = get_each_context_1(ctx, each_value_1, i);
914
+ let key = get_key(child_ctx);
915
+ each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
916
+ }
917
+
918
+ let each_value = /*textArray*/ ctx[10];
919
+ const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
920
+
921
+ for (let i = 0; i < each_value.length; i += 1) {
922
+ let child_ctx = get_each_context$3(ctx, each_value, i);
923
+ let key = get_key_1(child_ctx);
924
+ each1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
925
+ }
926
+
927
+ return {
928
+ c() {
929
+ div1 = internal.element("div");
930
+ div0 = internal.element("div");
931
+ t0 = internal.space();
932
+
933
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
934
+ each_blocks_1[i].c();
935
+ }
936
+
937
+ t1 = internal.space();
938
+
939
+ for (let i = 0; i < each_blocks.length; i += 1) {
940
+ each_blocks[i].c();
941
+ }
942
+
943
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
944
+ internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
945
+ internal.set_style(div1, "width", /*width*/ ctx[9], false);
946
+ internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
947
+ internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
948
+ },
949
+ m(target, anchor) {
950
+ internal.insert(target, div1, anchor);
951
+ internal.append(div1, div0);
952
+ internal.append(div1, t0);
953
+
954
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
955
+ each_blocks_1[i].m(div1, null);
956
+ }
957
+
958
+ internal.append(div1, t1);
959
+
960
+ for (let i = 0; i < each_blocks.length; i += 1) {
961
+ each_blocks[i].m(div1, null);
962
+ }
963
+ },
964
+ p(ctx, [dirty]) {
965
+ if (dirty & /*positionPxArray*/ 64) {
966
+ each_value_1 = /*positionPxArray*/ ctx[6];
967
+ each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
968
+ }
969
+
970
+ if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
971
+ each_value = /*textArray*/ ctx[10];
972
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$3, null, get_each_context$3);
973
+ }
974
+
975
+ if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
976
+ internal.attr(div1, "class", div1_class_value);
977
+ }
978
+ },
979
+ i: internal.noop,
980
+ o: internal.noop,
981
+ d(detaching) {
982
+ if (detaching) internal.detach(div1);
983
+
984
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
985
+ each_blocks_1[i].d();
986
+ }
987
+
988
+ for (let i = 0; i < each_blocks.length; i += 1) {
989
+ each_blocks[i].d();
990
+ }
991
+ }
992
+ };
993
+ }
994
+
995
+ const padding = 1000;
996
+
997
+ function instance$c($$self, $$props, $$invalidate) {
998
+ let { pxmm } = $$props;
999
+ let { type } = $$props;
1000
+ let { data } = $$props;
1001
+ let { bounding } = $$props;
1002
+ const isTop = type === 'top';
1003
+ const isBottom = type === 'bottom';
1004
+ const isLeft = type === 'left';
1005
+ const isRight = type === 'right';
1006
+ const isRow = isTop || isBottom;
1007
+
1008
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
1009
+ const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
1010
+ if (index === 0) return true;
1011
+ return x !== arr[index - 1];
1012
+ });
1013
+
1014
+ const minPosition = positionArray[0];
1015
+ const maxPosition = positionArray.slice(-1)[0];
1016
+ const length = maxPosition - minPosition;
1017
+ const minBounding = isRow ? bounding.min.x : bounding.min.y;
1018
+ const lengthPx = length * pxmm;
1019
+ const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
1020
+
1021
+ // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
1022
+ const translateMain = (minPosition - minBounding) * pxmm;
1023
+
1024
+ // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
1025
+ const translateSecond = 27 - padding * pxmm;
1026
+
1027
+ const translate = (() => {
1028
+ if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
1029
+ if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
1030
+ if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
1031
+ if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
1032
+ })();
1033
+
1034
+ const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
1035
+ const transform = `${translate} ${rotate}`;
1036
+ const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
1037
+ const width = lengthPx + 'px';
1038
+
1039
+ // 把点位的户型图坐标转成距离起始位置的像素值
1040
+ const textArray = positionArray.map((position, index, array) => {
1041
+ if (index === 0) return null;
1042
+ const distance = position - array[index - 1];
1043
+ const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
1044
+ return { distance, positionPx };
1045
+ }).filter(notNil).filter(item => item.distance / length > 0.12);
1046
+
1047
+ $$self.$$set = $$props => {
1048
+ if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
1049
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
1050
+ if ('data' in $$props) $$invalidate(12, data = $$props.data);
1051
+ if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1052
+ };
1053
+
1054
+ return [
1055
+ type,
1056
+ isTop,
1057
+ isBottom,
1058
+ isLeft,
1059
+ isRight,
1060
+ isRow,
1061
+ positionPxArray,
1062
+ transform,
1063
+ transformOrigin,
1064
+ width,
1065
+ textArray,
1066
+ pxmm,
1067
+ data,
1068
+ bounding
1069
+ ];
1070
+ }
1071
+
1072
+ class RuleItem extends internal.SvelteComponent {
1073
+ constructor(options) {
1074
+ super();
1075
+
1076
+ internal.init(
1077
+ this,
1078
+ options,
1079
+ instance$c,
1080
+ create_fragment$c,
1081
+ internal.safe_not_equal,
1082
+ {
1083
+ pxmm: 11,
1084
+ type: 0,
1085
+ data: 12,
1086
+ bounding: 13
1087
+ },
1088
+ add_css$8
1089
+ );
1090
+ }
1091
+ }
1092
+
1093
+ /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1094
+
1095
+ function get_each_context$2(ctx, list, i) {
1096
+ const child_ctx = ctx.slice();
1097
+ child_ctx[7] = list[i][0];
1098
+ child_ctx[8] = list[i][1];
1099
+ return child_ctx;
1100
+ }
1101
+
1102
+ // (12:2) {#each ruleLabelArray as [type, data] (type)}
1103
+ function create_each_block$2(key_1, ctx) {
1104
+ let first;
1105
+ let ruleitem;
1106
+ let current;
1107
+
1108
+ const ruleitem_spread_levels = [
1109
+ {
1110
+ type: /*type*/ ctx[7],
1111
+ data: /*data*/ ctx[8],
1112
+ pxmm: /*pxmm*/ ctx[0],
1113
+ bounding: /*bounding*/ ctx[2]
1114
+ }
1115
+ ];
1116
+
1117
+ let ruleitem_props = {};
1118
+
1119
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
1120
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
1121
+ }
1122
+
1123
+ ruleitem = new RuleItem({ props: ruleitem_props });
1124
+
1125
+ return {
1126
+ key: key_1,
1127
+ first: null,
1128
+ c() {
1129
+ first = internal.empty();
1130
+ internal.create_component(ruleitem.$$.fragment);
1131
+ this.first = first;
1132
+ },
1133
+ m(target, anchor) {
1134
+ internal.insert(target, first, anchor);
1135
+ internal.mount_component(ruleitem, target, anchor);
1136
+ current = true;
1137
+ },
1138
+ p(new_ctx, dirty) {
1139
+ ctx = new_ctx;
1140
+
1141
+ const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
1142
+ ? internal.get_spread_update(ruleitem_spread_levels, [
1143
+ {
1144
+ type: /*type*/ ctx[7],
1145
+ data: /*data*/ ctx[8],
1146
+ pxmm: /*pxmm*/ ctx[0],
1147
+ bounding: /*bounding*/ ctx[2]
1148
+ }
1149
+ ])
1150
+ : {};
1151
+
1152
+ ruleitem.$set(ruleitem_changes);
1153
+ },
1154
+ i(local) {
1155
+ if (current) return;
1156
+ internal.transition_in(ruleitem.$$.fragment, local);
1157
+ current = true;
1158
+ },
1159
+ o(local) {
1160
+ internal.transition_out(ruleitem.$$.fragment, local);
1161
+ current = false;
1162
+ },
1163
+ d(detaching) {
1164
+ if (detaching) internal.detach(first);
1165
+ internal.destroy_component(ruleitem, detaching);
1166
+ }
1167
+ };
1168
+ }
1169
+
1170
+ function create_fragment$b(ctx) {
1171
+ let div;
1172
+ let each_blocks = [];
1173
+ let each_1_lookup = new Map();
1174
+ let current;
1175
+ let each_value = /*ruleLabelArray*/ ctx[1];
1176
+ const get_key = ctx => /*type*/ ctx[7];
1177
+
1178
+ for (let i = 0; i < each_value.length; i += 1) {
1179
+ let child_ctx = get_each_context$2(ctx, each_value, i);
1180
+ let key = get_key(child_ctx);
1181
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx));
1182
+ }
1183
+
1184
+ return {
1185
+ c() {
1186
+ div = internal.element("div");
1187
+
1188
+ for (let i = 0; i < each_blocks.length; i += 1) {
1189
+ each_blocks[i].c();
1190
+ }
1191
+
1192
+ internal.attr(div, "class", "floorplan-plugin__rulelabels");
1193
+ },
1194
+ m(target, anchor) {
1195
+ internal.insert(target, div, anchor);
1196
+
1197
+ for (let i = 0; i < each_blocks.length; i += 1) {
1198
+ each_blocks[i].m(div, null);
1199
+ }
1200
+
1201
+ current = true;
1202
+ },
1203
+ p(ctx, [dirty]) {
1204
+ if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
1205
+ each_value = /*ruleLabelArray*/ ctx[1];
1206
+ internal.group_outros();
1207
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$2, null, get_each_context$2);
1208
+ internal.check_outros();
1209
+ }
1210
+ },
1211
+ i(local) {
1212
+ if (current) return;
1213
+
1214
+ for (let i = 0; i < each_value.length; i += 1) {
1215
+ internal.transition_in(each_blocks[i]);
1216
+ }
1217
+
1218
+ current = true;
1219
+ },
1220
+ o(local) {
1221
+ for (let i = 0; i < each_blocks.length; i += 1) {
1222
+ internal.transition_out(each_blocks[i]);
1223
+ }
1224
+
1225
+ current = false;
1226
+ },
1227
+ d(detaching) {
1228
+ if (detaching) internal.detach(div);
1229
+
1230
+ for (let i = 0; i < each_blocks.length; i += 1) {
1231
+ each_blocks[i].d();
1232
+ }
1233
+ }
1234
+ };
1235
+ }
1236
+
1237
+ function instance$b($$self, $$props, $$invalidate) {
1238
+ let bounding;
1239
+ let ruleLabelData;
1240
+ let ruleLabelDataKeys;
1241
+ let ruleLabelArray;
1242
+ let { pxmm } = $$props;
1243
+ let { floorIndex } = $$props;
1244
+ let { floorplanData } = $$props;
1245
+
1246
+ $$self.$$set = $$props => {
1247
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
1248
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
1249
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
1250
+ };
1251
+
1252
+ $$self.$$.update = () => {
1253
+ if ($$self.$$.dirty & /*floorplanData*/ 16) {
1254
+ $$invalidate(2, bounding = floorplanData.bounding);
1255
+ }
1256
+
1257
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
1258
+ $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1259
+ }
1260
+
1261
+ if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
1262
+ $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
1263
+ }
1264
+
1265
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
1266
+ $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
1267
+ }
1268
+ };
1269
+
1270
+ return [
1271
+ pxmm,
1272
+ ruleLabelArray,
1273
+ bounding,
1274
+ floorIndex,
1275
+ floorplanData,
1276
+ ruleLabelData,
1277
+ ruleLabelDataKeys
1278
+ ];
1279
+ }
1280
+
1281
+ class RuleLabels extends internal.SvelteComponent {
1282
+ constructor(options) {
1283
+ super();
1284
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
1285
+ }
1286
+ }
1287
+
1288
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1289
+
1290
+ function add_css$7(target) {
1291
+ internal.append_styles(target, "svelte-1cuuebb", "img.svelte-1cuuebb{width:100%;height:100%}");
1292
+ }
1293
+
1294
+ function create_fragment$a(ctx) {
1295
+ let img;
1296
+ let img_src_value;
1297
+
1298
+ return {
1299
+ c() {
1300
+ img = internal.element("img");
1301
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1302
+ internal.attr(img, "alt", "floorplan iamge");
1303
+ internal.attr(img, "class", "svelte-1cuuebb");
1304
+ },
1305
+ m(target, anchor) {
1306
+ internal.insert(target, img, anchor);
1307
+ },
1308
+ p(ctx, [dirty]) {
1309
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1310
+ internal.attr(img, "src", img_src_value);
1311
+ }
1312
+ },
1313
+ i: internal.noop,
1314
+ o: internal.noop,
1315
+ d(detaching) {
1316
+ if (detaching) internal.detach(img);
1317
+ }
1318
+ };
1319
+ }
1320
+
1321
+ function instance$a($$self, $$props, $$invalidate) {
1322
+ let { url } = $$props;
1323
+
1324
+ $$self.$$set = $$props => {
1325
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1326
+ };
1327
+
1328
+ return [url];
1329
+ }
1330
+
1331
+ class Normalmage extends internal.SvelteComponent {
1332
+ constructor(options) {
1333
+ super();
1334
+ internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { url: 0 }, add_css$7);
1335
+ }
1336
+ }
1337
+
1338
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1339
+
1340
+ function add_css$6(target) {
1341
+ internal.append_styles(target, "svelte-1qqy56u", ".floorplan-plugin__base-image.svelte-1qqy56u{width:100%;height:100%}");
1342
+ }
1343
+
1344
+ function create_fragment$9(ctx) {
1345
+ let div;
1346
+ let html_tag;
1347
+ let t;
1348
+ let html_tag_1;
1349
+
1350
+ return {
1351
+ c() {
1352
+ div = internal.element("div");
1353
+ html_tag = new internal.HtmlTag();
1354
+ t = internal.space();
1355
+ html_tag_1 = new internal.HtmlTag();
1356
+ html_tag.a = t;
1357
+ html_tag_1.a = null;
1358
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-1qqy56u");
1359
+ },
1360
+ m(target, anchor) {
1361
+ internal.insert(target, div, anchor);
1362
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1363
+ internal.append(div, t);
1364
+ html_tag_1.m(/*content*/ ctx[0], div);
1365
+ },
1366
+ p(ctx, [dirty]) {
1367
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1368
+ },
1369
+ i: internal.noop,
1370
+ o: internal.noop,
1371
+ d(detaching) {
1372
+ if (detaching) internal.detach(div);
1373
+ }
1374
+ };
1375
+ }
1376
+
1377
+ function instance$9($$self, $$props, $$invalidate) {
1378
+ let { content } = $$props;
1379
+
1380
+ const svgStyle = `
1381
+ <style>
1382
+ svg [type='lineGroup'] path {
1383
+ fill: #ffffff;
1384
+ stroke: #ffffff;
1385
+ }
1386
+ svg [type='lineItemGroup'] g g g g {
1387
+ stroke: #ffffff;
1388
+ }
1389
+ </style>
1390
+ `;
1391
+
1392
+ $$self.$$set = $$props => {
1393
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1394
+ };
1395
+
1396
+ return [content, svgStyle];
1397
+ }
1398
+
1399
+ class SvgImage extends internal.SvelteComponent {
1400
+ constructor(options) {
1401
+ super();
1402
+ internal.init(this, options, instance$9, create_fragment$9, internal.safe_not_equal, { content: 0 }, add_css$6);
1403
+ }
1404
+ }
1405
+
1406
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1407
+
1408
+ function add_css$5(target) {
1409
+ internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1410
+ }
1411
+
1412
+ // (12:22)
1413
+ function create_if_block_1$3(ctx) {
1414
+ let normalimage;
1415
+ let current;
1416
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1417
+
1418
+ return {
1419
+ c() {
1420
+ internal.create_component(normalimage.$$.fragment);
1421
+ },
1422
+ m(target, anchor) {
1423
+ internal.mount_component(normalimage, target, anchor);
1424
+ current = true;
1425
+ },
1426
+ p(ctx, dirty) {
1427
+ const normalimage_changes = {};
1428
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1429
+ normalimage.$set(normalimage_changes);
1430
+ },
1431
+ i(local) {
1432
+ if (current) return;
1433
+ internal.transition_in(normalimage.$$.fragment, local);
1434
+ current = true;
1435
+ },
1436
+ o(local) {
1437
+ internal.transition_out(normalimage.$$.fragment, local);
1438
+ current = false;
1439
+ },
1440
+ d(detaching) {
1441
+ internal.destroy_component(normalimage, detaching);
1442
+ }
1443
+ };
1444
+ }
1445
+
1446
+ // (10:2) {#if svgContent}
1447
+ function create_if_block$3(ctx) {
1448
+ let svgimage;
1449
+ let current;
1450
+
1451
+ svgimage = new SvgImage({
1452
+ props: { content: /*svgContent*/ ctx[0] }
1453
+ });
1454
+
1455
+ return {
1456
+ c() {
1457
+ internal.create_component(svgimage.$$.fragment);
1458
+ },
1459
+ m(target, anchor) {
1460
+ internal.mount_component(svgimage, target, anchor);
1461
+ current = true;
1462
+ },
1463
+ p(ctx, dirty) {
1464
+ const svgimage_changes = {};
1465
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1466
+ svgimage.$set(svgimage_changes);
1467
+ },
1468
+ i(local) {
1469
+ if (current) return;
1470
+ internal.transition_in(svgimage.$$.fragment, local);
1471
+ current = true;
1472
+ },
1473
+ o(local) {
1474
+ internal.transition_out(svgimage.$$.fragment, local);
1475
+ current = false;
1476
+ },
1477
+ d(detaching) {
1478
+ internal.destroy_component(svgimage, detaching);
1479
+ }
1480
+ };
1481
+ }
1482
+
1483
+ function create_fragment$8(ctx) {
1484
+ let div;
1485
+ let current_block_type_index;
1486
+ let if_block;
1487
+ let current;
1488
+ const if_block_creators = [create_if_block$3, create_if_block_1$3];
1489
+ const if_blocks = [];
1490
+
1491
+ function select_block_type(ctx, dirty) {
1492
+ if (/*svgContent*/ ctx[0]) return 0;
1493
+ if (/*imageData*/ ctx[1]) return 1;
1494
+ return -1;
1495
+ }
1496
+
1497
+ if (~(current_block_type_index = select_block_type(ctx))) {
1498
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1499
+ }
1500
+
1501
+ return {
1502
+ c() {
1503
+ div = internal.element("div");
1504
+ if (if_block) if_block.c();
1505
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
1506
+ },
1507
+ m(target, anchor) {
1508
+ internal.insert(target, div, anchor);
1509
+
1510
+ if (~current_block_type_index) {
1511
+ if_blocks[current_block_type_index].m(div, null);
1512
+ }
1513
+
1514
+ current = true;
1515
+ },
1516
+ p(ctx, [dirty]) {
1517
+ let previous_block_index = current_block_type_index;
1518
+ current_block_type_index = select_block_type(ctx);
1519
+
1520
+ if (current_block_type_index === previous_block_index) {
1521
+ if (~current_block_type_index) {
1522
+ if_blocks[current_block_type_index].p(ctx, dirty);
1523
+ }
1524
+ } else {
1525
+ if (if_block) {
1526
+ internal.group_outros();
1527
+
1528
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1529
+ if_blocks[previous_block_index] = null;
1530
+ });
1531
+
1532
+ internal.check_outros();
1533
+ }
1534
+
1535
+ if (~current_block_type_index) {
1536
+ if_block = if_blocks[current_block_type_index];
1537
+
1538
+ if (!if_block) {
1539
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1540
+ if_block.c();
1541
+ } else {
1542
+ if_block.p(ctx, dirty);
1543
+ }
1544
+
1545
+ internal.transition_in(if_block, 1);
1546
+ if_block.m(div, null);
1547
+ } else {
1548
+ if_block = null;
1549
+ }
1550
+ }
1551
+ },
1552
+ i(local) {
1553
+ if (current) return;
1554
+ internal.transition_in(if_block);
1555
+ current = true;
1556
+ },
1557
+ o(local) {
1558
+ internal.transition_out(if_block);
1559
+ current = false;
1560
+ },
1561
+ d(detaching) {
1562
+ if (detaching) internal.detach(div);
1563
+
1564
+ if (~current_block_type_index) {
1565
+ if_blocks[current_block_type_index].d();
1566
+ }
1567
+ }
1568
+ };
1569
+ }
1570
+
1571
+ function instance$8($$self, $$props, $$invalidate) {
1572
+ let imageData;
1573
+ let svgContent;
1574
+ let { floorIndex } = $$props;
1575
+ let { floorplanData } = $$props;
1576
+
1577
+ $$self.$$set = $$props => {
1578
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1579
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1580
+ };
1581
+
1582
+ $$self.$$.update = () => {
1583
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1584
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1585
+ }
1586
+
1587
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1588
+ $$invalidate(0, svgContent = floorplanData.outlines?.[floorIndex]?.svgContent);
1589
+ }
1590
+ };
1591
+
1592
+ return [svgContent, imageData, floorIndex, floorplanData];
1593
+ }
1594
+
1595
+ class BaseImage extends internal.SvelteComponent {
1596
+ constructor(options) {
1597
+ super();
1598
+ internal.init(this, options, instance$8, create_fragment$8, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$5);
1599
+ }
1600
+ }
1601
+
1602
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte generated by Svelte v3.47.0 */
1603
+
1604
+ function create_fragment$7(ctx) {
1605
+ let path_1;
1606
+
1607
+ return {
1608
+ c() {
1609
+ path_1 = internal.svg_element("path");
1610
+ internal.attr(path_1, "d", /*d*/ ctx[0]);
1611
+ internal.attr(path_1, "fill", "#2F313A");
1612
+ },
1613
+ m(target, anchor) {
1614
+ internal.insert(target, path_1, anchor);
1615
+ },
1616
+ p(ctx, [dirty]) {
1617
+ if (dirty & /*d*/ 1) {
1618
+ internal.attr(path_1, "d", /*d*/ ctx[0]);
1619
+ }
1620
+ },
1621
+ i: internal.noop,
1622
+ o: internal.noop,
1623
+ d(detaching) {
1624
+ if (detaching) internal.detach(path_1);
1625
+ }
1626
+ };
1627
+ }
1628
+
1629
+ function instance$7($$self, $$props, $$invalidate) {
1630
+ let d;
1631
+ let { path } = $$props;
1632
+
1633
+ $$self.$$set = $$props => {
1634
+ if ('path' in $$props) $$invalidate(1, path = $$props.path);
1635
+ };
1636
+
1637
+ $$self.$$.update = () => {
1638
+ if ($$self.$$.dirty & /*path*/ 2) {
1639
+ $$invalidate(0, d = pathD(path, { needZ: true }));
1640
+ }
1641
+ };
1642
+
1643
+ return [d, path];
1644
+ }
1645
+
1646
+ class RoomMaterial_0 extends internal.SvelteComponent {
1647
+ constructor(options) {
1648
+ super();
1649
+ internal.init(this, options, instance$7, create_fragment$7, internal.safe_not_equal, { path: 1 });
1650
+ }
1651
+ }
1652
+
1653
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte generated by Svelte v3.47.0 */
1654
+
1655
+ function create_fragment$6(ctx) {
1656
+ let defs;
1657
+ let pattern;
1658
+ let rect;
1659
+ let path0;
1660
+ let t;
1661
+ let path1;
1662
+
1663
+ return {
1664
+ c() {
1665
+ defs = internal.svg_element("defs");
1666
+ pattern = internal.svg_element("pattern");
1667
+ rect = internal.svg_element("rect");
1668
+ path0 = internal.svg_element("path");
1669
+ t = internal.space();
1670
+ path1 = internal.svg_element("path");
1671
+ internal.attr(rect, "x", "0");
1672
+ internal.attr(rect, "y", "0");
1673
+ internal.attr(rect, "width", /*width*/ ctx[1]);
1674
+ internal.attr(rect, "height", /*width*/ ctx[1]);
1675
+ internal.attr(rect, "fill", "#323747");
1676
+ internal.attr(path0, "d", /*patternPathD*/ ctx[2]);
1677
+ internal.attr(path0, "stroke", "#ffffff");
1678
+ internal.attr(path0, "stroke-opacity", "0.06");
1679
+ internal.attr(path0, "stroke-width", "0.5");
1680
+ internal.attr(path0, "fill", "none");
1681
+ internal.attr(pattern, "id", "fpm-room-pattern-0");
1682
+ internal.attr(pattern, "x", "0");
1683
+ internal.attr(pattern, "y", "0");
1684
+ internal.attr(pattern, "width", /*width*/ ctx[1]);
1685
+ internal.attr(pattern, "height", /*width*/ ctx[1]);
1686
+ internal.attr(pattern, "patternUnits", "userSpaceOnUse");
1687
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1688
+ internal.attr(path1, "fill", "url(#fpm-room-pattern-0)");
1689
+ },
1690
+ m(target, anchor) {
1691
+ internal.insert(target, defs, anchor);
1692
+ internal.append(defs, pattern);
1693
+ internal.append(pattern, rect);
1694
+ internal.append(pattern, path0);
1695
+ internal.insert(target, t, anchor);
1696
+ internal.insert(target, path1, anchor);
1697
+ },
1698
+ p(ctx, [dirty]) {
1699
+ if (dirty & /*d*/ 1) {
1700
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1701
+ }
1702
+ },
1703
+ i: internal.noop,
1704
+ o: internal.noop,
1705
+ d(detaching) {
1706
+ if (detaching) internal.detach(defs);
1707
+ if (detaching) internal.detach(t);
1708
+ if (detaching) internal.detach(path1);
1709
+ }
1710
+ };
1711
+ }
1712
+
1713
+ const halfWidth = 6;
1714
+
1715
+ function instance$6($$self, $$props, $$invalidate) {
1716
+ let d;
1717
+ let { path } = $$props;
1718
+ const width = halfWidth * 2;
1719
+ const patternPathD = `M0 ${halfWidth} h ${width} M${halfWidth} 0 v ${width}`;
1720
+
1721
+ $$self.$$set = $$props => {
1722
+ if ('path' in $$props) $$invalidate(3, path = $$props.path);
1723
+ };
1724
+
1725
+ $$self.$$.update = () => {
1726
+ if ($$self.$$.dirty & /*path*/ 8) {
1727
+ $$invalidate(0, d = pathD(path, { needZ: true }));
1728
+ }
1729
+ };
1730
+
1731
+ return [d, width, patternPathD, path];
1732
+ }
1733
+
1734
+ class RoomMaterial_1 extends internal.SvelteComponent {
1735
+ constructor(options) {
1736
+ super();
1737
+ internal.init(this, options, instance$6, create_fragment$6, internal.safe_not_equal, { path: 3 });
1738
+ }
1739
+ }
1740
+
1741
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte generated by Svelte v3.47.0 */
1742
+
1743
+ function create_fragment$5(ctx) {
1744
+ let defs;
1745
+ let pattern0;
1746
+ let rect0;
1747
+ let pattern1;
1748
+ let rect1;
1749
+ let t0;
1750
+ let path0;
1751
+ let t1;
1752
+ let path1;
1753
+ let t2;
1754
+ let path2;
1755
+
1756
+ return {
1757
+ c() {
1758
+ defs = internal.svg_element("defs");
1759
+ pattern0 = internal.svg_element("pattern");
1760
+ rect0 = internal.svg_element("rect");
1761
+ pattern1 = internal.svg_element("pattern");
1762
+ rect1 = internal.svg_element("rect");
1763
+ t0 = internal.space();
1764
+ path0 = internal.svg_element("path");
1765
+ t1 = internal.space();
1766
+ path1 = internal.svg_element("path");
1767
+ t2 = internal.space();
1768
+ path2 = internal.svg_element("path");
1769
+ internal.attr(rect0, "x", "0.5");
1770
+ internal.attr(rect0, "y", "0.5");
1771
+ internal.attr(rect0, "width", "6");
1772
+ internal.attr(rect0, "height", "50");
1773
+ internal.attr(rect0, "fill", "none");
1774
+ internal.attr(rect0, "stroke", "#4B4B57");
1775
+ internal.attr(rect0, "stroke-width", "0.5");
1776
+ internal.attr(pattern0, "id", "room-material-pattern-1");
1777
+ internal.attr(pattern0, "x", "0");
1778
+ internal.attr(pattern0, "y", "0");
1779
+ internal.attr(pattern0, "width", "13");
1780
+ internal.attr(pattern0, "height", "51");
1781
+ internal.attr(pattern0, "patternUnits", "userSpaceOnUse");
1782
+ internal.attr(rect1, "x", "0.5");
1783
+ internal.attr(rect1, "y", "0.5");
1784
+ internal.attr(rect1, "width", "6");
1785
+ internal.attr(rect1, "height", "50");
1786
+ internal.attr(rect1, "fill", "none");
1787
+ internal.attr(rect1, "stroke", "#4B4B57");
1788
+ internal.attr(rect1, "stroke-width", "0.5");
1789
+ internal.attr(pattern1, "id", "room-material-pattern-2");
1790
+ internal.attr(pattern1, "x", "7");
1791
+ internal.attr(pattern1, "y", "25");
1792
+ internal.attr(pattern1, "width", "13");
1793
+ internal.attr(pattern1, "height", "51");
1794
+ internal.attr(pattern1, "patternUnits", "userSpaceOnUse");
1795
+ internal.attr(path0, "d", /*d*/ ctx[0]);
1796
+ internal.attr(path0, "fill", "#43434D");
1797
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1798
+ internal.attr(path1, "fill", "url(#room-material-pattern-1)");
1799
+ internal.attr(path2, "d", /*d*/ ctx[0]);
1800
+ internal.attr(path2, "fill", "url(#room-material-pattern-2)");
1801
+ },
1802
+ m(target, anchor) {
1803
+ internal.insert(target, defs, anchor);
1804
+ internal.append(defs, pattern0);
1805
+ internal.append(pattern0, rect0);
1806
+ internal.append(defs, pattern1);
1807
+ internal.append(pattern1, rect1);
1808
+ internal.insert(target, t0, anchor);
1809
+ internal.insert(target, path0, anchor);
1810
+ internal.insert(target, t1, anchor);
1811
+ internal.insert(target, path1, anchor);
1812
+ internal.insert(target, t2, anchor);
1813
+ internal.insert(target, path2, anchor);
1814
+ },
1815
+ p(ctx, [dirty]) {
1816
+ if (dirty & /*d*/ 1) {
1817
+ internal.attr(path0, "d", /*d*/ ctx[0]);
1818
+ }
1819
+
1820
+ if (dirty & /*d*/ 1) {
1821
+ internal.attr(path1, "d", /*d*/ ctx[0]);
1822
+ }
1823
+
1824
+ if (dirty & /*d*/ 1) {
1825
+ internal.attr(path2, "d", /*d*/ ctx[0]);
1826
+ }
1827
+ },
1828
+ i: internal.noop,
1829
+ o: internal.noop,
1830
+ d(detaching) {
1831
+ if (detaching) internal.detach(defs);
1832
+ if (detaching) internal.detach(t0);
1833
+ if (detaching) internal.detach(path0);
1834
+ if (detaching) internal.detach(t1);
1835
+ if (detaching) internal.detach(path1);
1836
+ if (detaching) internal.detach(t2);
1837
+ if (detaching) internal.detach(path2);
1838
+ }
1839
+ };
1840
+ }
1841
+
1842
+ function instance$5($$self, $$props, $$invalidate) {
1843
+ let d;
1844
+ let { path } = $$props;
1845
+
1846
+ $$self.$$set = $$props => {
1847
+ if ('path' in $$props) $$invalidate(1, path = $$props.path);
1848
+ };
1849
+
1850
+ $$self.$$.update = () => {
1851
+ if ($$self.$$.dirty & /*path*/ 2) {
1852
+ $$invalidate(0, d = pathD(path, { needZ: true }));
1853
+ }
1854
+ };
1855
+
1856
+ return [d, path];
1857
+ }
1858
+
1859
+ class RoomMaterial_2 extends internal.SvelteComponent {
1860
+ constructor(options) {
1861
+ super();
1862
+ internal.init(this, options, instance$5, create_fragment$5, internal.safe_not_equal, { path: 1 });
1863
+ }
1864
+ }
1865
+
1866
+ /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
1867
+
1868
+ function add_css$4(target) {
1869
+ internal.append_styles(target, "svelte-1b0icjc", "svg.svelte-1b0icjc{position:absolute;width:100%;height:100%;overflow:visible}");
1870
+ }
1871
+
1872
+ function get_each_context$1(ctx, list, i) {
1873
+ const child_ctx = ctx.slice();
1874
+ child_ctx[4] = list[i];
1875
+ return child_ctx;
1876
+ }
1877
+
1878
+ // (21:6) {:else}
1879
+ function create_else_block(ctx) {
1880
+ let roommaterial_1;
1881
+ let current;
1882
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
1883
+
1884
+ return {
1885
+ c() {
1886
+ internal.create_component(roommaterial_1.$$.fragment);
1887
+ },
1888
+ m(target, anchor) {
1889
+ internal.mount_component(roommaterial_1, target, anchor);
1890
+ current = true;
1891
+ },
1892
+ p(ctx, dirty) {
1893
+ const roommaterial_1_changes = {};
1894
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
1895
+ roommaterial_1.$set(roommaterial_1_changes);
1896
+ },
1897
+ i(local) {
1898
+ if (current) return;
1899
+ internal.transition_in(roommaterial_1.$$.fragment, local);
1900
+ current = true;
1901
+ },
1902
+ o(local) {
1903
+ internal.transition_out(roommaterial_1.$$.fragment, local);
1904
+ current = false;
1905
+ },
1906
+ d(detaching) {
1907
+ internal.destroy_component(roommaterial_1, detaching);
1908
+ }
1909
+ };
1910
+ }
1911
+
1912
+ // (19:37)
1913
+ function create_if_block_1$2(ctx) {
1914
+ let roommaterial_2;
1915
+ let current;
1916
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
1917
+
1918
+ return {
1919
+ c() {
1920
+ internal.create_component(roommaterial_2.$$.fragment);
1921
+ },
1922
+ m(target, anchor) {
1923
+ internal.mount_component(roommaterial_2, target, anchor);
1924
+ current = true;
1925
+ },
1926
+ p(ctx, dirty) {
1927
+ const roommaterial_2_changes = {};
1928
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
1929
+ roommaterial_2.$set(roommaterial_2_changes);
1930
+ },
1931
+ i(local) {
1932
+ if (current) return;
1933
+ internal.transition_in(roommaterial_2.$$.fragment, local);
1934
+ current = true;
1935
+ },
1936
+ o(local) {
1937
+ internal.transition_out(roommaterial_2.$$.fragment, local);
1938
+ current = false;
1939
+ },
1940
+ d(detaching) {
1941
+ internal.destroy_component(roommaterial_2, detaching);
1942
+ }
1943
+ };
1944
+ }
1945
+
1946
+ // (17:6) {#if room.floorType === 1}
1947
+ function create_if_block$2(ctx) {
1948
+ let roommaterial_0;
1949
+ let current;
1950
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
1951
+
1952
+ return {
1953
+ c() {
1954
+ internal.create_component(roommaterial_0.$$.fragment);
1955
+ },
1956
+ m(target, anchor) {
1957
+ internal.mount_component(roommaterial_0, target, anchor);
1958
+ current = true;
1959
+ },
1960
+ p(ctx, dirty) {
1961
+ const roommaterial_0_changes = {};
1962
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
1963
+ roommaterial_0.$set(roommaterial_0_changes);
1964
+ },
1965
+ i(local) {
1966
+ if (current) return;
1967
+ internal.transition_in(roommaterial_0.$$.fragment, local);
1968
+ current = true;
1969
+ },
1970
+ o(local) {
1971
+ internal.transition_out(roommaterial_0.$$.fragment, local);
1972
+ current = false;
1973
+ },
1974
+ d(detaching) {
1975
+ internal.destroy_component(roommaterial_0, detaching);
1976
+ }
1977
+ };
1978
+ }
1979
+
1980
+ // (15:2) {#each rooms as room}
1981
+ function create_each_block$1(ctx) {
1982
+ let svg;
1983
+ let current_block_type_index;
1984
+ let if_block;
1985
+ let current;
1986
+ const if_block_creators = [create_if_block$2, create_if_block_1$2, create_else_block];
1987
+ const if_blocks = [];
1988
+
1989
+ function select_block_type(ctx, dirty) {
1990
+ if (/*room*/ ctx[4].floorType === 1) return 0;
1991
+ if (/*room*/ ctx[4].floorType === 0) return 1;
1992
+ return 2;
1993
+ }
1994
+
1995
+ current_block_type_index = select_block_type(ctx);
1996
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1997
+
1998
+ return {
1999
+ c() {
2000
+ svg = internal.svg_element("svg");
2001
+ if_block.c();
2002
+ internal.attr(svg, "class", "svelte-1b0icjc");
2003
+ },
2004
+ m(target, anchor) {
2005
+ internal.insert(target, svg, anchor);
2006
+ if_blocks[current_block_type_index].m(svg, null);
2007
+ current = true;
2008
+ },
2009
+ p(ctx, dirty) {
2010
+ let previous_block_index = current_block_type_index;
2011
+ current_block_type_index = select_block_type(ctx);
2012
+
2013
+ if (current_block_type_index === previous_block_index) {
2014
+ if_blocks[current_block_type_index].p(ctx, dirty);
2015
+ } else {
2016
+ internal.group_outros();
2017
+
2018
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2019
+ if_blocks[previous_block_index] = null;
2020
+ });
2021
+
2022
+ internal.check_outros();
2023
+ if_block = if_blocks[current_block_type_index];
2024
+
2025
+ if (!if_block) {
2026
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2027
+ if_block.c();
2028
+ } else {
2029
+ if_block.p(ctx, dirty);
2030
+ }
2031
+
2032
+ internal.transition_in(if_block, 1);
2033
+ if_block.m(svg, null);
2034
+ }
2035
+ },
2036
+ i(local) {
2037
+ if (current) return;
2038
+ internal.transition_in(if_block);
2039
+ current = true;
2040
+ },
2041
+ o(local) {
2042
+ internal.transition_out(if_block);
2043
+ current = false;
2044
+ },
2045
+ d(detaching) {
2046
+ if (detaching) internal.detach(svg);
2047
+ if_blocks[current_block_type_index].d();
2048
+ }
2049
+ };
2050
+ }
2051
+
2052
+ function create_fragment$4(ctx) {
2053
+ let div;
2054
+ let current;
2055
+ let each_value = /*rooms*/ ctx[0];
2056
+ let each_blocks = [];
2057
+
2058
+ for (let i = 0; i < each_value.length; i += 1) {
2059
+ each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2060
+ }
2061
+
2062
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
2063
+ each_blocks[i] = null;
2064
+ });
2065
+
2066
+ return {
2067
+ c() {
2068
+ div = internal.element("div");
2069
+
2070
+ for (let i = 0; i < each_blocks.length; i += 1) {
2071
+ each_blocks[i].c();
2072
+ }
2073
+
2074
+ internal.attr(div, "class", "floorplan-plugin__room-material");
2075
+ },
2076
+ m(target, anchor) {
2077
+ internal.insert(target, div, anchor);
2078
+
2079
+ for (let i = 0; i < each_blocks.length; i += 1) {
2080
+ each_blocks[i].m(div, null);
2081
+ }
2082
+
2083
+ current = true;
2084
+ },
2085
+ p(ctx, [dirty]) {
2086
+ if (dirty & /*rooms*/ 1) {
2087
+ each_value = /*rooms*/ ctx[0];
2088
+ let i;
2089
+
2090
+ for (i = 0; i < each_value.length; i += 1) {
2091
+ const child_ctx = get_each_context$1(ctx, each_value, i);
2092
+
2093
+ if (each_blocks[i]) {
2094
+ each_blocks[i].p(child_ctx, dirty);
2095
+ internal.transition_in(each_blocks[i], 1);
2096
+ } else {
2097
+ each_blocks[i] = create_each_block$1(child_ctx);
2098
+ each_blocks[i].c();
2099
+ internal.transition_in(each_blocks[i], 1);
2100
+ each_blocks[i].m(div, null);
2101
+ }
2102
+ }
2103
+
2104
+ internal.group_outros();
2105
+
2106
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
2107
+ out(i);
2108
+ }
2109
+
2110
+ internal.check_outros();
2111
+ }
2112
+ },
2113
+ i(local) {
2114
+ if (current) return;
2115
+
2116
+ for (let i = 0; i < each_value.length; i += 1) {
2117
+ internal.transition_in(each_blocks[i]);
2118
+ }
2119
+
2120
+ current = true;
2121
+ },
2122
+ o(local) {
2123
+ each_blocks = each_blocks.filter(Boolean);
2124
+
2125
+ for (let i = 0; i < each_blocks.length; i += 1) {
2126
+ internal.transition_out(each_blocks[i]);
2127
+ }
2128
+
2129
+ current = false;
2130
+ },
2131
+ d(detaching) {
2132
+ if (detaching) internal.detach(div);
2133
+ internal.destroy_each(each_blocks, detaching);
2134
+ }
2135
+ };
2136
+ }
2137
+
2138
+ function instance$4($$self, $$props, $$invalidate) {
2139
+ let rooms;
2140
+ let { floorIndex } = $$props;
2141
+ let { pxmm } = $$props;
2142
+ let { floorplanData } = $$props;
2143
+
2144
+ $$self.$$set = $$props => {
2145
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2146
+ if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
2147
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2148
+ };
2149
+
2150
+ $$self.$$.update = () => {
2151
+ if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
2152
+ $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => ({
2153
+ ...room,
2154
+ path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
2155
+ })));
2156
+ }
2157
+ };
2158
+
2159
+ return [rooms, floorIndex, pxmm, floorplanData];
2160
+ }
2161
+
2162
+ class RoomMaterial extends internal.SvelteComponent {
2163
+ constructor(options) {
2164
+ super();
2165
+ internal.init(this, options, instance$4, create_fragment$4, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$4);
2166
+ }
2167
+ }
2168
+
2169
+ /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
2170
+
2171
+ function add_css$3(target) {
2172
+ internal.append_styles(target, "svelte-11takew", "path.svelte-11takew{opacity:0}path.svelte-11takew:hover{opacity:0.1}");
2173
+ }
2174
+
2175
+ function create_fragment$3(ctx) {
2176
+ let path;
2177
+
2178
+ return {
2179
+ c() {
2180
+ path = internal.svg_element("path");
2181
+ internal.attr(path, "d", /*_pathD*/ ctx[0]);
2182
+ internal.attr(path, "fill", `#fff`);
2183
+ internal.attr(path, "class", "svelte-11takew");
2184
+ },
2185
+ m(target, anchor) {
2186
+ internal.insert(target, path, anchor);
2187
+ },
2188
+ p: internal.noop,
2189
+ i: internal.noop,
2190
+ o: internal.noop,
2191
+ d(detaching) {
2192
+ if (detaching) internal.detach(path);
2193
+ }
2194
+ };
2195
+ }
2196
+
2197
+ function instance$3($$self, $$props, $$invalidate) {
2198
+ let { pxmm } = $$props;
2199
+ let { room } = $$props;
2200
+ let { floorplanData } = $$props;
2201
+ const { bounding } = floorplanData;
2202
+
2203
+ const _pathD = pathD(room.path, {
2204
+ needZ: true,
2205
+ format: vector => formatFloorplanPoint(vector, pxmm, bounding)
2206
+ });
2207
+
2208
+ $$self.$$set = $$props => {
2209
+ if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
2210
+ if ('room' in $$props) $$invalidate(2, room = $$props.room);
2211
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2212
+ };
2213
+
2214
+ return [_pathD, pxmm, room, floorplanData];
2215
+ }
2216
+
2217
+ class Room extends internal.SvelteComponent {
2218
+ constructor(options) {
2219
+ super();
2220
+ internal.init(this, options, instance$3, create_fragment$3, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$3);
2221
+ }
2222
+ }
2223
+
2224
+ /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
2225
+
2226
+ function add_css$2(target) {
2227
+ internal.append_styles(target, "svelte-1aais5l", ".floorplan-plugin__room-highlight.svelte-1aais5l{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-1aais5l{width:100%;height:100%;overflow:visible}");
2228
+ }
2229
+
2230
+ function get_each_context(ctx, list, i) {
2231
+ const child_ctx = ctx.slice();
2232
+ child_ctx[12] = list[i];
2233
+ return child_ctx;
2234
+ }
2235
+
2236
+ // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
2237
+ function create_each_block(key_1, ctx) {
2238
+ let first;
2239
+ let room;
2240
+ let current;
2241
+
2242
+ const room_spread_levels = [
2243
+ {
2244
+ room: /*room*/ ctx[12],
2245
+ floorplanData: /*floorplanData*/ ctx[2],
2246
+ pxmm: /*pxmm*/ ctx[0]
2247
+ }
2248
+ ];
2249
+
2250
+ let room_props = {};
2251
+
2252
+ for (let i = 0; i < room_spread_levels.length; i += 1) {
2253
+ room_props = internal.assign(room_props, room_spread_levels[i]);
2254
+ }
2255
+
2256
+ room = new Room({ props: room_props });
2257
+
2258
+ return {
2259
+ key: key_1,
2260
+ first: null,
2261
+ c() {
2262
+ first = internal.empty();
2263
+ internal.create_component(room.$$.fragment);
2264
+ this.first = first;
2265
+ },
2266
+ m(target, anchor) {
2267
+ internal.insert(target, first, anchor);
2268
+ internal.mount_component(room, target, anchor);
2269
+ current = true;
2270
+ },
2271
+ p(new_ctx, dirty) {
2272
+ ctx = new_ctx;
2273
+
2274
+ const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
2275
+ ? internal.get_spread_update(room_spread_levels, [
2276
+ {
2277
+ room: /*room*/ ctx[12],
2278
+ floorplanData: /*floorplanData*/ ctx[2],
2279
+ pxmm: /*pxmm*/ ctx[0]
2280
+ }
2281
+ ])
2282
+ : {};
2283
+
2284
+ room.$set(room_changes);
2285
+ },
2286
+ i(local) {
2287
+ if (current) return;
2288
+ internal.transition_in(room.$$.fragment, local);
2289
+ current = true;
2290
+ },
2291
+ o(local) {
2292
+ internal.transition_out(room.$$.fragment, local);
2293
+ current = false;
2294
+ },
2295
+ d(detaching) {
2296
+ if (detaching) internal.detach(first);
2297
+ internal.destroy_component(room, detaching);
2298
+ }
2299
+ };
2300
+ }
2301
+
2302
+ function create_fragment$2(ctx) {
2303
+ let div;
2304
+ let svg;
2305
+ let each_blocks = [];
2306
+ let each_1_lookup = new Map();
2307
+ let div_resize_listener;
2308
+ let current;
2309
+ let mounted;
2310
+ let dispose;
2311
+ let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2312
+ const get_key = ctx => /*room*/ ctx[12].id;
2313
+
2314
+ for (let i = 0; i < each_value.length; i += 1) {
2315
+ let child_ctx = get_each_context(ctx, each_value, i);
2316
+ let key = get_key(child_ctx);
2317
+ each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
2318
+ }
2319
+
2320
+ return {
2321
+ c() {
2322
+ div = internal.element("div");
2323
+ svg = internal.svg_element("svg");
2324
+
2325
+ for (let i = 0; i < each_blocks.length; i += 1) {
2326
+ each_blocks[i].c();
2327
+ }
2328
+
2329
+ internal.attr(svg, "class", "svelte-1aais5l");
2330
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1aais5l");
2331
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
2332
+ },
2333
+ m(target, anchor) {
2334
+ internal.insert(target, div, anchor);
2335
+ internal.append(div, svg);
2336
+
2337
+ for (let i = 0; i < each_blocks.length; i += 1) {
2338
+ each_blocks[i].m(svg, null);
2339
+ }
2340
+
2341
+ /*div_binding*/ ctx[9](div);
2342
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
2343
+ current = true;
2344
+
2345
+ if (!mounted) {
2346
+ dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
2347
+ mounted = true;
2348
+ }
2349
+ },
2350
+ p(ctx, [dirty]) {
2351
+ if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
2352
+ each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
2353
+ internal.group_outros();
2354
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block, null, get_each_context);
2355
+ internal.check_outros();
2356
+ }
2357
+ },
2358
+ i(local) {
2359
+ if (current) return;
2360
+
2361
+ for (let i = 0; i < each_value.length; i += 1) {
2362
+ internal.transition_in(each_blocks[i]);
2363
+ }
2364
+
2365
+ current = true;
2366
+ },
2367
+ o(local) {
2368
+ for (let i = 0; i < each_blocks.length; i += 1) {
2369
+ internal.transition_out(each_blocks[i]);
2370
+ }
2371
+
2372
+ current = false;
2373
+ },
2374
+ d(detaching) {
2375
+ if (detaching) internal.detach(div);
2376
+
2377
+ for (let i = 0; i < each_blocks.length; i += 1) {
2378
+ each_blocks[i].d();
2379
+ }
2380
+
2381
+ /*div_binding*/ ctx[9](null);
2382
+ div_resize_listener();
2383
+ mounted = false;
2384
+ dispose();
2385
+ }
2386
+ };
2387
+ }
2388
+
2389
+ function instance$2($$self, $$props, $$invalidate) {
2390
+ let { five } = $$props;
2391
+ let { pxmm } = $$props;
2392
+ let { floorIndex } = $$props;
2393
+ let { floorplanData } = $$props;
2394
+ let { onRoomHeightClick } = $$props;
2395
+ let clientWidth;
2396
+ let clientHeight;
2397
+ let highlightContainerDom;
2398
+ const { observers: floorplan_observers } = floorplanData;
2399
+
2400
+ const handleClick = function (e) {
2401
+ if (onRoomHeightClick?.(e) === false) return;
2402
+
2403
+ // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
2404
+ const boundingClientRect = highlightContainerDom.getBoundingClientRect();
2405
+
2406
+ const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
2407
+ const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
2408
+ const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
2409
+
2410
+ // px 转换为 百分比
2411
+ const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
2412
+
2413
+ const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
2414
+ const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
2415
+ const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
2416
+ return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
2417
+ })[0];
2418
+
2419
+ five.moveToPano(closestPoint.index);
2420
+ };
2421
+
2422
+ function div_binding($$value) {
2423
+ internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
2424
+ highlightContainerDom = $$value;
2425
+ $$invalidate(5, highlightContainerDom);
2426
+ });
2427
+ }
2428
+
2429
+ function div_elementresize_handler() {
2430
+ clientWidth = this.clientWidth;
2431
+ clientHeight = this.clientHeight;
2432
+ $$invalidate(3, clientWidth);
2433
+ $$invalidate(4, clientHeight);
2434
+ }
2435
+
2436
+ $$self.$$set = $$props => {
2437
+ if ('five' in $$props) $$invalidate(7, five = $$props.five);
2438
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2439
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
2440
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
2441
+ if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
2442
+ };
2443
+
2444
+ return [
2445
+ pxmm,
2446
+ floorIndex,
2447
+ floorplanData,
2448
+ clientWidth,
2449
+ clientHeight,
2450
+ highlightContainerDom,
2451
+ handleClick,
2452
+ five,
2453
+ onRoomHeightClick,
2454
+ div_binding,
2455
+ div_elementresize_handler
2456
+ ];
2457
+ }
2458
+
2459
+ class RoomHighlight extends internal.SvelteComponent {
2460
+ constructor(options) {
2461
+ super();
2462
+
2463
+ internal.init(
2464
+ this,
2465
+ options,
2466
+ instance$2,
2467
+ create_fragment$2,
2468
+ internal.safe_not_equal,
2469
+ {
2470
+ five: 7,
2471
+ pxmm: 0,
2472
+ floorIndex: 1,
2473
+ floorplanData: 2,
2474
+ onRoomHeightClick: 8
2475
+ },
2476
+ add_css$2
2477
+ );
2478
+ }
2479
+ }
2480
+
2481
+ /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
2482
+
2483
+ function add_css$1(target) {
2484
+ internal.append_styles(target, "svelte-3pdgs4", ".floorplan-current-floor.svelte-3pdgs4{position:relative;width:100%;height:100%}");
2485
+ }
2486
+
2487
+ // (19:2) {#if hoverEnable}
2488
+ function create_if_block_2(ctx) {
2489
+ let roomhighlight;
2490
+ let current;
2491
+
2492
+ const roomhighlight_spread_levels = [
2493
+ {
2494
+ five: /*five*/ ctx[1],
2495
+ pxmm: /*pxmm*/ ctx[0],
2496
+ floorIndex: /*floorIndex*/ ctx[2],
2497
+ floorplanData: /*floorplanData*/ ctx[6],
2498
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2499
+ }
2500
+ ];
2501
+
2502
+ let roomhighlight_props = {};
2503
+
2504
+ for (let i = 0; i < roomhighlight_spread_levels.length; i += 1) {
2505
+ roomhighlight_props = internal.assign(roomhighlight_props, roomhighlight_spread_levels[i]);
2506
+ }
2507
+
2508
+ roomhighlight = new RoomHighlight({ props: roomhighlight_props });
2509
+
2510
+ return {
2511
+ c() {
2512
+ internal.create_component(roomhighlight.$$.fragment);
2513
+ },
2514
+ m(target, anchor) {
2515
+ internal.mount_component(roomhighlight, target, anchor);
2516
+ current = true;
2517
+ },
2518
+ p(ctx, dirty) {
2519
+ const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
2520
+ ? internal.get_spread_update(roomhighlight_spread_levels, [
2521
+ {
2522
+ five: /*five*/ ctx[1],
2523
+ pxmm: /*pxmm*/ ctx[0],
2524
+ floorIndex: /*floorIndex*/ ctx[2],
2525
+ floorplanData: /*floorplanData*/ ctx[6],
2526
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
2527
+ }
2528
+ ])
2529
+ : {};
2530
+
2531
+ roomhighlight.$set(roomhighlight_changes);
2532
+ },
2533
+ i(local) {
2534
+ if (current) return;
2535
+ internal.transition_in(roomhighlight.$$.fragment, local);
2536
+ current = true;
2537
+ },
2538
+ o(local) {
2539
+ internal.transition_out(roomhighlight.$$.fragment, local);
2540
+ current = false;
2541
+ },
2542
+ d(detaching) {
2543
+ internal.destroy_component(roomhighlight, detaching);
2544
+ }
2545
+ };
2546
+ }
2547
+
2548
+ // (23:2) {#if roomLabelsEnable}
2549
+ function create_if_block_1$1(ctx) {
2550
+ let roomlabels;
2551
+ let current;
2552
+
2553
+ const roomlabels_spread_levels = [
2554
+ {
2555
+ floorplanData: /*floorplanData*/ ctx[6],
2556
+ floorIndex: /*floorIndex*/ ctx[2],
2557
+ getLabelElement: /*getLabelElement*/ ctx[8]
2558
+ }
2559
+ ];
2560
+
2561
+ let roomlabels_props = {};
2562
+
2563
+ for (let i = 0; i < roomlabels_spread_levels.length; i += 1) {
2564
+ roomlabels_props = internal.assign(roomlabels_props, roomlabels_spread_levels[i]);
2565
+ }
2566
+
2567
+ roomlabels = new RoomLabels({ props: roomlabels_props });
2568
+
2569
+ return {
2570
+ c() {
2571
+ internal.create_component(roomlabels.$$.fragment);
2572
+ },
2573
+ m(target, anchor) {
2574
+ internal.mount_component(roomlabels, target, anchor);
2575
+ current = true;
2576
+ },
2577
+ p(ctx, dirty) {
2578
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
2579
+ ? internal.get_spread_update(roomlabels_spread_levels, [
2580
+ {
2581
+ floorplanData: /*floorplanData*/ ctx[6],
2582
+ floorIndex: /*floorIndex*/ ctx[2],
2583
+ getLabelElement: /*getLabelElement*/ ctx[8]
2584
+ }
2585
+ ])
2586
+ : {};
2587
+
2588
+ roomlabels.$set(roomlabels_changes);
2589
+ },
2590
+ i(local) {
2591
+ if (current) return;
2592
+ internal.transition_in(roomlabels.$$.fragment, local);
2593
+ current = true;
2594
+ },
2595
+ o(local) {
2596
+ internal.transition_out(roomlabels.$$.fragment, local);
2597
+ current = false;
2598
+ },
2599
+ d(detaching) {
2600
+ internal.destroy_component(roomlabels, detaching);
2601
+ }
2602
+ };
2603
+ }
2604
+
2605
+ // (26:2) {#if ruleLabelsEnable}
2606
+ function create_if_block$1(ctx) {
2607
+ let rulelabels;
2608
+ let current;
2609
+
2610
+ const rulelabels_spread_levels = [
2611
+ {
2612
+ floorplanData: /*floorplanData*/ ctx[6],
2613
+ floorIndex: /*floorIndex*/ ctx[2],
2614
+ pxmm: /*pxmm*/ ctx[0]
2615
+ }
2616
+ ];
2617
+
2618
+ let rulelabels_props = {};
2619
+
2620
+ for (let i = 0; i < rulelabels_spread_levels.length; i += 1) {
2621
+ rulelabels_props = internal.assign(rulelabels_props, rulelabels_spread_levels[i]);
2622
+ }
2623
+
2624
+ rulelabels = new RuleLabels({ props: rulelabels_props });
2625
+
2626
+ return {
2627
+ c() {
2628
+ internal.create_component(rulelabels.$$.fragment);
2629
+ },
2630
+ m(target, anchor) {
2631
+ internal.mount_component(rulelabels, target, anchor);
2632
+ current = true;
2633
+ },
2634
+ p(ctx, dirty) {
2635
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
2636
+ ? internal.get_spread_update(rulelabels_spread_levels, [
2637
+ {
2638
+ floorplanData: /*floorplanData*/ ctx[6],
2639
+ floorIndex: /*floorIndex*/ ctx[2],
2640
+ pxmm: /*pxmm*/ ctx[0]
2641
+ }
2642
+ ])
2643
+ : {};
2644
+
2645
+ rulelabels.$set(rulelabels_changes);
2646
+ },
2647
+ i(local) {
2648
+ if (current) return;
2649
+ internal.transition_in(rulelabels.$$.fragment, local);
2650
+ current = true;
2651
+ },
2652
+ o(local) {
2653
+ internal.transition_out(rulelabels.$$.fragment, local);
2654
+ current = false;
2655
+ },
2656
+ d(detaching) {
2657
+ internal.destroy_component(rulelabels, detaching);
2658
+ }
2659
+ };
2660
+ }
2661
+
2662
+ function create_fragment$1(ctx) {
2663
+ let div;
2664
+ let roommaterial;
2665
+ let t0;
2666
+ let t1;
2667
+ let baseimage;
2668
+ let t2;
2669
+ let t3;
2670
+ let current;
2671
+
2672
+ const roommaterial_spread_levels = [
2673
+ {
2674
+ floorIndex: /*floorIndex*/ ctx[2],
2675
+ floorplanData: /*floorplanData*/ ctx[6],
2676
+ pxmm: /*pxmm*/ ctx[0]
2677
+ }
2678
+ ];
2679
+
2680
+ let roommaterial_props = {};
2681
+
2682
+ for (let i = 0; i < roommaterial_spread_levels.length; i += 1) {
2683
+ roommaterial_props = internal.assign(roommaterial_props, roommaterial_spread_levels[i]);
2684
+ }
2685
+
2686
+ roommaterial = new RoomMaterial({ props: roommaterial_props });
2687
+ let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
2688
+
2689
+ const baseimage_spread_levels = [
2690
+ {
2691
+ floorplanData: /*floorplanData*/ ctx[6],
2692
+ floorIndex: /*floorIndex*/ ctx[2]
2693
+ }
2694
+ ];
2695
+
2696
+ let baseimage_props = {};
2697
+
2698
+ for (let i = 0; i < baseimage_spread_levels.length; i += 1) {
2699
+ baseimage_props = internal.assign(baseimage_props, baseimage_spread_levels[i]);
2700
+ }
2701
+
2702
+ baseimage = new BaseImage({ props: baseimage_props });
2703
+ let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
2704
+ let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$1(ctx);
2705
+
2706
+ return {
2707
+ c() {
2708
+ div = internal.element("div");
2709
+ internal.create_component(roommaterial.$$.fragment);
2710
+ t0 = internal.space();
2711
+ if (if_block0) if_block0.c();
2712
+ t1 = internal.space();
2713
+ internal.create_component(baseimage.$$.fragment);
2714
+ t2 = internal.space();
2715
+ if (if_block1) if_block1.c();
2716
+ t3 = internal.space();
2717
+ if (if_block2) if_block2.c();
2718
+ internal.attr(div, "class", "floorplan-current-floor svelte-3pdgs4");
2719
+ },
2720
+ m(target, anchor) {
2721
+ internal.insert(target, div, anchor);
2722
+ internal.mount_component(roommaterial, div, null);
2723
+ internal.append(div, t0);
2724
+ if (if_block0) if_block0.m(div, null);
2725
+ internal.append(div, t1);
2726
+ internal.mount_component(baseimage, div, null);
2727
+ internal.append(div, t2);
2728
+ if (if_block1) if_block1.m(div, null);
2729
+ internal.append(div, t3);
2730
+ if (if_block2) if_block2.m(div, null);
2731
+ current = true;
2732
+ },
2733
+ p(ctx, [dirty]) {
2734
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
2735
+ ? internal.get_spread_update(roommaterial_spread_levels, [
2736
+ {
2737
+ floorIndex: /*floorIndex*/ ctx[2],
2738
+ floorplanData: /*floorplanData*/ ctx[6],
2739
+ pxmm: /*pxmm*/ ctx[0]
2740
+ }
2741
+ ])
2742
+ : {};
2743
+
2744
+ roommaterial.$set(roommaterial_changes);
2745
+
2746
+ if (/*hoverEnable*/ ctx[3]) {
2747
+ if (if_block0) {
2748
+ if_block0.p(ctx, dirty);
2749
+
2750
+ if (dirty & /*hoverEnable*/ 8) {
2751
+ internal.transition_in(if_block0, 1);
2752
+ }
2753
+ } else {
2754
+ if_block0 = create_if_block_2(ctx);
2755
+ if_block0.c();
2756
+ internal.transition_in(if_block0, 1);
2757
+ if_block0.m(div, t1);
2758
+ }
2759
+ } else if (if_block0) {
2760
+ internal.group_outros();
2761
+
2762
+ internal.transition_out(if_block0, 1, 1, () => {
2763
+ if_block0 = null;
2764
+ });
2765
+
2766
+ internal.check_outros();
2767
+ }
2768
+
2769
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
2770
+ ? internal.get_spread_update(baseimage_spread_levels, [
2771
+ {
2772
+ floorplanData: /*floorplanData*/ ctx[6],
2773
+ floorIndex: /*floorIndex*/ ctx[2]
2774
+ }
2775
+ ])
2776
+ : {};
2777
+
2778
+ baseimage.$set(baseimage_changes);
2779
+
2780
+ if (/*roomLabelsEnable*/ ctx[4]) {
2781
+ if (if_block1) {
2782
+ if_block1.p(ctx, dirty);
2783
+
2784
+ if (dirty & /*roomLabelsEnable*/ 16) {
2785
+ internal.transition_in(if_block1, 1);
2786
+ }
2787
+ } else {
2788
+ if_block1 = create_if_block_1$1(ctx);
2789
+ if_block1.c();
2790
+ internal.transition_in(if_block1, 1);
2791
+ if_block1.m(div, t3);
2792
+ }
2793
+ } else if (if_block1) {
2794
+ internal.group_outros();
2795
+
2796
+ internal.transition_out(if_block1, 1, 1, () => {
2797
+ if_block1 = null;
2798
+ });
2799
+
2800
+ internal.check_outros();
2801
+ }
2802
+
2803
+ if (/*ruleLabelsEnable*/ ctx[5]) {
2804
+ if (if_block2) {
2805
+ if_block2.p(ctx, dirty);
2806
+
2807
+ if (dirty & /*ruleLabelsEnable*/ 32) {
2808
+ internal.transition_in(if_block2, 1);
2809
+ }
2810
+ } else {
2811
+ if_block2 = create_if_block$1(ctx);
2812
+ if_block2.c();
2813
+ internal.transition_in(if_block2, 1);
2814
+ if_block2.m(div, null);
2815
+ }
2816
+ } else if (if_block2) {
2817
+ internal.group_outros();
2818
+
2819
+ internal.transition_out(if_block2, 1, 1, () => {
2820
+ if_block2 = null;
2821
+ });
2822
+
2823
+ internal.check_outros();
2824
+ }
2825
+ },
2826
+ i(local) {
2827
+ if (current) return;
2828
+ internal.transition_in(roommaterial.$$.fragment, local);
2829
+ internal.transition_in(if_block0);
2830
+ internal.transition_in(baseimage.$$.fragment, local);
2831
+ internal.transition_in(if_block1);
2832
+ internal.transition_in(if_block2);
2833
+ current = true;
2834
+ },
2835
+ o(local) {
2836
+ internal.transition_out(roommaterial.$$.fragment, local);
2837
+ internal.transition_out(if_block0);
2838
+ internal.transition_out(baseimage.$$.fragment, local);
2839
+ internal.transition_out(if_block1);
2840
+ internal.transition_out(if_block2);
2841
+ current = false;
2842
+ },
2843
+ d(detaching) {
2844
+ if (detaching) internal.detach(div);
2845
+ internal.destroy_component(roommaterial);
2846
+ if (if_block0) if_block0.d();
2847
+ internal.destroy_component(baseimage);
2848
+ if (if_block1) if_block1.d();
2849
+ if (if_block2) if_block2.d();
2850
+ }
2851
+ };
2852
+ }
2853
+
2854
+ function instance$1($$self, $$props, $$invalidate) {
2855
+ let { pxmm } = $$props;
2856
+ let { five } = $$props;
2857
+ let { floorIndex } = $$props;
2858
+ let { hoverEnable } = $$props;
2859
+ let { roomLabelsEnable } = $$props;
2860
+ let { ruleLabelsEnable } = $$props;
2861
+ let { floorplanData } = $$props;
2862
+ let { onRoomHeightClick } = $$props;
2863
+ let { getLabelElement } = $$props;
2864
+
2865
+ $$self.$$set = $$props => {
2866
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2867
+ if ('five' in $$props) $$invalidate(1, five = $$props.five);
2868
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2869
+ if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
2870
+ if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
2871
+ if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
2872
+ if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
2873
+ if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
2874
+ if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
2875
+ };
2876
+
2877
+ return [
2878
+ pxmm,
2879
+ five,
2880
+ floorIndex,
2881
+ hoverEnable,
2882
+ roomLabelsEnable,
2883
+ ruleLabelsEnable,
2884
+ floorplanData,
2885
+ onRoomHeightClick,
2886
+ getLabelElement
2887
+ ];
2888
+ }
2889
+
2890
+ class CurrentFloor extends internal.SvelteComponent {
2891
+ constructor(options) {
2892
+ super();
2893
+
2894
+ internal.init(
2895
+ this,
2896
+ options,
2897
+ instance$1,
2898
+ create_fragment$1,
2899
+ internal.safe_not_equal,
2900
+ {
2901
+ pxmm: 0,
2902
+ five: 1,
2903
+ floorIndex: 2,
2904
+ hoverEnable: 3,
2905
+ roomLabelsEnable: 4,
2906
+ ruleLabelsEnable: 5,
2907
+ floorplanData: 6,
2908
+ onRoomHeightClick: 7,
2909
+ getLabelElement: 8
2910
+ },
2911
+ add_css$1
2912
+ );
2913
+ }
2914
+ }
2915
+
2916
+ /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
2917
+
2918
+ function add_css(target) {
2919
+ internal.append_styles(target, "svelte-177x2q7", ".floorplan-main.svelte-177x2q7{width:100%;height:100%}");
2920
+ }
2921
+
2922
+ // (23:0) {#if visible}
2923
+ function create_if_block(ctx) {
2924
+ let div;
2925
+ let currentfloor;
2926
+ let t0;
2927
+ let camera;
2928
+ let t1;
2929
+ let div_intro;
2930
+ let current;
2931
+
2932
+ const currentfloor_spread_levels = [
2933
+ {
2934
+ five: /*five*/ ctx[1],
2935
+ pxmm: /*pxmm*/ ctx[0],
2936
+ floorIndex: /*floorIndex*/ ctx[5],
2937
+ hoverEnable: /*hoverEnable*/ ctx[6],
2938
+ floorplanData: /*floorplanData*/ ctx[10],
2939
+ getLabelElement: /*getLabelElement*/ ctx[14],
2940
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
2941
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
2942
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
2943
+ }
2944
+ ];
2945
+
2946
+ let currentfloor_props = {};
2947
+
2948
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
2949
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
2950
+ }
2951
+
2952
+ currentfloor = new CurrentFloor({ props: currentfloor_props });
2953
+
2954
+ const camera_spread_levels = [
2955
+ {
2956
+ panoIndex: /*panoIndex*/ ctx[4],
2957
+ floorplanData: /*floorplanData*/ ctx[10],
2958
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
2959
+ cameraImageUrl: /*cameraImageUrl*/ ctx[12]
2960
+ }
2961
+ ];
2962
+
2963
+ let camera_props = {};
2964
+
2965
+ for (let i = 0; i < camera_spread_levels.length; i += 1) {
2966
+ camera_props = internal.assign(camera_props, camera_spread_levels[i]);
2967
+ }
2968
+
2969
+ camera = new Camera({ props: camera_props });
2970
+ let if_block = /*compassEnable*/ ctx[7] && create_if_block_1(ctx);
2971
+
2972
+ return {
2973
+ c() {
2974
+ div = internal.element("div");
2975
+ internal.create_component(currentfloor.$$.fragment);
2976
+ t0 = internal.space();
2977
+ internal.create_component(camera.$$.fragment);
2978
+ t1 = internal.space();
2979
+ if (if_block) if_block.c();
2980
+ internal.attr(div, "class", "floorplan-main svelte-177x2q7");
2981
+ },
2982
+ m(target, anchor) {
2983
+ internal.insert(target, div, anchor);
2984
+ internal.mount_component(currentfloor, div, null);
2985
+ internal.append(div, t0);
2986
+ internal.mount_component(camera, div, null);
2987
+ internal.append(div, t1);
2988
+ if (if_block) if_block.m(div, null);
2989
+ current = true;
2990
+ },
2991
+ p(new_ctx, dirty) {
2992
+ ctx = new_ctx;
2993
+
2994
+ const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 26467)
2995
+ ? internal.get_spread_update(currentfloor_spread_levels, [
2996
+ {
2997
+ five: /*five*/ ctx[1],
2998
+ pxmm: /*pxmm*/ ctx[0],
2999
+ floorIndex: /*floorIndex*/ ctx[5],
3000
+ hoverEnable: /*hoverEnable*/ ctx[6],
3001
+ floorplanData: /*floorplanData*/ ctx[10],
3002
+ getLabelElement: /*getLabelElement*/ ctx[14],
3003
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[8],
3004
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[9],
3005
+ onRoomHeightClick: /*onRoomHeightClick*/ ctx[13]
3006
+ }
3007
+ ])
3008
+ : {};
3009
+
3010
+ currentfloor.$set(currentfloor_changes);
3011
+
3012
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 7184)
3013
+ ? internal.get_spread_update(camera_spread_levels, [
3014
+ {
3015
+ panoIndex: /*panoIndex*/ ctx[4],
3016
+ floorplanData: /*floorplanData*/ ctx[10],
3017
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[11],
3018
+ cameraImageUrl: /*cameraImageUrl*/ ctx[12]
3019
+ }
3020
+ ])
3021
+ : {};
3022
+
3023
+ camera.$set(camera_changes);
3024
+
3025
+ if (/*compassEnable*/ ctx[7]) {
3026
+ if (if_block) {
3027
+ if_block.p(ctx, dirty);
3028
+
3029
+ if (dirty & /*compassEnable*/ 128) {
3030
+ internal.transition_in(if_block, 1);
3031
+ }
3032
+ } else {
3033
+ if_block = create_if_block_1(ctx);
3034
+ if_block.c();
3035
+ internal.transition_in(if_block, 1);
3036
+ if_block.m(div, null);
3037
+ }
3038
+ } else if (if_block) {
3039
+ internal.group_outros();
3040
+
3041
+ internal.transition_out(if_block, 1, 1, () => {
3042
+ if_block = null;
3043
+ });
3044
+
3045
+ internal.check_outros();
3046
+ }
3047
+ },
3048
+ i(local) {
3049
+ if (current) return;
3050
+ internal.transition_in(currentfloor.$$.fragment, local);
3051
+ internal.transition_in(camera.$$.fragment, local);
3052
+ internal.transition_in(if_block);
3053
+
3054
+ if (!div_intro) {
3055
+ internal.add_render_callback(() => {
3056
+ div_intro = internal.create_in_transition(div, transition.fade, {
3057
+ duration: /*duration*/ ctx[2],
3058
+ easing: easing.linear
3059
+ });
3060
+
3061
+ div_intro.start();
3062
+ });
3063
+ }
3064
+
3065
+ current = true;
3066
+ },
3067
+ o(local) {
3068
+ internal.transition_out(currentfloor.$$.fragment, local);
3069
+ internal.transition_out(camera.$$.fragment, local);
3070
+ internal.transition_out(if_block);
3071
+ current = false;
3072
+ },
3073
+ d(detaching) {
3074
+ if (detaching) internal.detach(div);
3075
+ internal.destroy_component(currentfloor);
3076
+ internal.destroy_component(camera);
3077
+ if (if_block) if_block.d();
3078
+ }
3079
+ };
3080
+ }
3081
+
3082
+ // (39:4) {#if compassEnable}
3083
+ function create_if_block_1(ctx) {
3084
+ let compass;
3085
+ let current;
3086
+
3087
+ compass = new Compass({
3088
+ props: { floorplanData: /*floorplanData*/ ctx[10] }
3089
+ });
3090
+
3091
+ return {
3092
+ c() {
3093
+ internal.create_component(compass.$$.fragment);
3094
+ },
3095
+ m(target, anchor) {
3096
+ internal.mount_component(compass, target, anchor);
3097
+ current = true;
3098
+ },
3099
+ p(ctx, dirty) {
3100
+ const compass_changes = {};
3101
+ if (dirty & /*floorplanData*/ 1024) compass_changes.floorplanData = /*floorplanData*/ ctx[10];
3102
+ compass.$set(compass_changes);
3103
+ },
3104
+ i(local) {
3105
+ if (current) return;
3106
+ internal.transition_in(compass.$$.fragment, local);
3107
+ current = true;
3108
+ },
3109
+ o(local) {
3110
+ internal.transition_out(compass.$$.fragment, local);
3111
+ current = false;
3112
+ },
3113
+ d(detaching) {
3114
+ internal.destroy_component(compass, detaching);
3115
+ }
3116
+ };
3117
+ }
3118
+
3119
+ function create_fragment(ctx) {
3120
+ let if_block_anchor;
3121
+ let current;
3122
+ let if_block = /*visible*/ ctx[3] && create_if_block(ctx);
3123
+
3124
+ return {
3125
+ c() {
3126
+ if (if_block) if_block.c();
3127
+ if_block_anchor = internal.empty();
3128
+ },
3129
+ m(target, anchor) {
3130
+ if (if_block) if_block.m(target, anchor);
3131
+ internal.insert(target, if_block_anchor, anchor);
3132
+ current = true;
3133
+ },
3134
+ p(ctx, [dirty]) {
3135
+ if (/*visible*/ ctx[3]) {
3136
+ if (if_block) {
3137
+ if_block.p(ctx, dirty);
3138
+
3139
+ if (dirty & /*visible*/ 8) {
3140
+ internal.transition_in(if_block, 1);
3141
+ }
3142
+ } else {
3143
+ if_block = create_if_block(ctx);
3144
+ if_block.c();
3145
+ internal.transition_in(if_block, 1);
3146
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
3147
+ }
3148
+ } else if (if_block) {
3149
+ internal.group_outros();
3150
+
3151
+ internal.transition_out(if_block, 1, 1, () => {
3152
+ if_block = null;
3153
+ });
3154
+
3155
+ internal.check_outros();
3156
+ }
3157
+ },
3158
+ i(local) {
3159
+ if (current) return;
3160
+ internal.transition_in(if_block);
3161
+ current = true;
3162
+ },
3163
+ o(local) {
3164
+ internal.transition_out(if_block);
3165
+ current = false;
3166
+ },
3167
+ d(detaching) {
3168
+ if (if_block) if_block.d(detaching);
3169
+ if (detaching) internal.detach(if_block_anchor);
3170
+ }
3171
+ };
3172
+ }
3173
+
3174
+ function instance($$self, $$props, $$invalidate) {
3175
+ let { pxmm } = $$props;
3176
+ let { five } = $$props;
3177
+ let { duration = 0 } = $$props;
3178
+ let { visible } = $$props;
3179
+ let { panoIndex } = $$props;
3180
+ let { floorIndex } = $$props;
3181
+ let { hoverEnable } = $$props;
3182
+ let { compassEnable } = $$props;
3183
+ let { roomLabelsEnable } = $$props;
3184
+ let { ruleLabelsEnable } = $$props;
3185
+ let { floorplanData } = $$props;
3186
+ let { lastPanoramaLongitude } = $$props;
3187
+ let { cameraImageUrl } = $$props;
3188
+ let { onRoomHeightClick } = $$props;
3189
+ let { getLabelElement } = $$props;
3190
+
3191
+ $$self.$$set = $$props => {
3192
+ if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3193
+ if ('five' in $$props) $$invalidate(1, five = $$props.five);
3194
+ if ('duration' in $$props) $$invalidate(2, duration = $$props.duration);
3195
+ if ('visible' in $$props) $$invalidate(3, visible = $$props.visible);
3196
+ if ('panoIndex' in $$props) $$invalidate(4, panoIndex = $$props.panoIndex);
3197
+ if ('floorIndex' in $$props) $$invalidate(5, floorIndex = $$props.floorIndex);
3198
+ if ('hoverEnable' in $$props) $$invalidate(6, hoverEnable = $$props.hoverEnable);
3199
+ if ('compassEnable' in $$props) $$invalidate(7, compassEnable = $$props.compassEnable);
3200
+ if ('roomLabelsEnable' in $$props) $$invalidate(8, roomLabelsEnable = $$props.roomLabelsEnable);
3201
+ if ('ruleLabelsEnable' in $$props) $$invalidate(9, ruleLabelsEnable = $$props.ruleLabelsEnable);
3202
+ if ('floorplanData' in $$props) $$invalidate(10, floorplanData = $$props.floorplanData);
3203
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(11, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
3204
+ if ('cameraImageUrl' in $$props) $$invalidate(12, cameraImageUrl = $$props.cameraImageUrl);
3205
+ if ('onRoomHeightClick' in $$props) $$invalidate(13, onRoomHeightClick = $$props.onRoomHeightClick);
3206
+ if ('getLabelElement' in $$props) $$invalidate(14, getLabelElement = $$props.getLabelElement);
3207
+ };
3208
+
3209
+ return [
3210
+ pxmm,
3211
+ five,
3212
+ duration,
3213
+ visible,
3214
+ panoIndex,
3215
+ floorIndex,
3216
+ hoverEnable,
3217
+ compassEnable,
3218
+ roomLabelsEnable,
3219
+ ruleLabelsEnable,
3220
+ floorplanData,
3221
+ lastPanoramaLongitude,
3222
+ cameraImageUrl,
3223
+ onRoomHeightClick,
3224
+ getLabelElement
3225
+ ];
3226
+ }
3227
+
3228
+ class Main extends internal.SvelteComponent {
3229
+ constructor(options) {
3230
+ super();
3231
+
3232
+ internal.init(
3233
+ this,
3234
+ options,
3235
+ instance,
3236
+ create_fragment,
3237
+ internal.safe_not_equal,
3238
+ {
3239
+ pxmm: 0,
3240
+ five: 1,
3241
+ duration: 2,
3242
+ visible: 3,
3243
+ panoIndex: 4,
3244
+ floorIndex: 5,
3245
+ hoverEnable: 6,
3246
+ compassEnable: 7,
3247
+ roomLabelsEnable: 8,
3248
+ ruleLabelsEnable: 9,
3249
+ floorplanData: 10,
3250
+ lastPanoramaLongitude: 11,
3251
+ cameraImageUrl: 12,
3252
+ onRoomHeightClick: 13,
3253
+ getLabelElement: 14
3254
+ },
3255
+ add_css
3256
+ );
3257
+ }
3258
+ }
3259
+
3260
+ function changeModelCanvasOpacity(five, opacity, duration = 300) {
3261
+ const fiveEle = five.getElement();
3262
+ if (!fiveEle)
3263
+ return;
3264
+ fiveEle.style.opacity = opacity + '';
3265
+ fiveEle.style.transition = duration === 0 ? 'none' : `opacity ${duration}ms linear`;
3266
+ if (duration === 0)
3267
+ return;
3268
+ Promise.race([
3269
+ new Promise((res) => fiveEle.addEventListener('transitionend', res, { once: true })),
3270
+ new Promise((res) => setTimeout(res, duration)),
3271
+ ]).then(() => {
3272
+ fiveEle.style.transition = 'none';
3273
+ });
3274
+ }
3275
+
3276
+ class TopviewFloorplanPluginController {
3277
+ size = { width: 0, height: 0 };
3278
+ visible = false;
3279
+ pxmm = 0;
3280
+ app;
3281
+ five;
3282
+ panoIndex = 0;
3283
+ floorIndex = 0;
3284
+ configs = {};
3285
+ lastPanoramaLongitude = 0;
3286
+ selector;
3287
+ floorplanData;
3288
+ wrapper;
3289
+ container = document.createElement('div');
3290
+ constructor(five, params) {
3291
+ this.five = five;
3292
+ this.selector = params.selector;
3293
+ this.configs = omit(params, ['selector']);
3294
+ // 设置 container 样式
3295
+ this.container.classList.add('floorplan-plugin');
3296
+ Object.assign(this.container.style, pluginStyle);
3297
+ // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
3298
+ this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
3299
+ this.five.once('dispose', this.dispose);
3300
+ this.five.on('modeChange', this.handleModeChange);
3301
+ this.five.on('panoArrived', this.handlePanoArrived);
3302
+ this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
3303
+ this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
3304
+ }
3305
+ /** 加载户型图数据 */
3306
+ async load(data) {
3307
+ const copyData = JSON.parse(JSON.stringify(data));
3308
+ this.floorplanData = await formatData(copyData);
3309
+ this.render();
3310
+ }
3311
+ /** 把插件的渲染DOM插入到对应的容器中去 */
3312
+ appendTo(wrapper) {
3313
+ this.wrapper = wrapper;
3314
+ wrapper.appendChild(this.container);
3315
+ return this;
3316
+ }
3317
+ dispose = () => {
3318
+ this.hide();
3319
+ this.container?.remove();
3320
+ this.app?.$destroy();
3321
+ this.five.off('modeChange', this.handleModeChange);
3322
+ this.five.off('panoArrived', this.handlePanoArrived);
3323
+ this.five.off('modelLoaded', this.handleModelLoaded);
3324
+ this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
3325
+ this.five.off('wantsPanGesture', this.handleWantsPanGesture);
3326
+ this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
3327
+ this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
3328
+ };
3329
+ /** 模型楼层高亮改变时,自动进行楼层切换 */
3330
+ onModelShownFloorChange = (shownFloor) => {
3331
+ if (shownFloor === null)
3332
+ return;
3333
+ this.floorIndex = shownFloor;
3334
+ this.updateSize();
3335
+ this.render();
3336
+ };
3337
+ /** panoIndex 改变时,更新 floorIndex */
3338
+ handlePanoArrived = (index) => {
3339
+ if (!this.five?.work)
3340
+ return;
3341
+ this.panoIndex = index;
3342
+ this.floorIndex = this.five.work.observers[index].floorIndex;
3343
+ };
3344
+ /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
3345
+ handleWantsMoveToPano = () => {
3346
+ if (!this.visible)
3347
+ return;
3348
+ if (this.configs.preventRoomClick)
3349
+ return false;
3350
+ return;
3351
+ };
3352
+ /** 在户型图展示时阻止 Five 滑动行为 */
3353
+ handleWantsPanGesture = () => {
3354
+ if (!this.visible)
3355
+ return;
3356
+ return false;
3357
+ };
3358
+ handleModelLoaded = () => {
3359
+ if (this.wrapper)
3360
+ return;
3361
+ if (!this.selector)
3362
+ return;
3363
+ const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
3364
+ if (!wrapper)
3365
+ throw new Error('不正确的父容器选择器');
3366
+ this.wrapper = wrapper;
3367
+ wrapper.append(this.container);
3368
+ };
3369
+ /** 非 Topview 态隐藏户型图 */
3370
+ handleModeChange = (mode) => {
3371
+ if (mode !== 'Topview')
3372
+ return this.hide();
3373
+ };
3374
+ /** 动画结束后是 Topview 态就展示户型图 */
3375
+ handleInitAnimationEnded = () => {
3376
+ const { mode } = this.five.getCurrentState();
3377
+ if (mode === 'Topview')
3378
+ this.show();
3379
+ };
3380
+ show() {
3381
+ this.visible = true;
3382
+ this.five.model.show(this.floorIndex);
3383
+ this.updateSize();
3384
+ const renderDuration = 500;
3385
+ const modelOpacity = this.configs.modelOpacity;
3386
+ if (typeof modelOpacity === 'number') {
3387
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3388
+ }
3389
+ this.render(renderDuration);
3390
+ this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3391
+ this.five.on('wantsPanGesture', this.handleWantsPanGesture);
3392
+ }
3393
+ hide() {
3394
+ const modelOpacity = 1;
3395
+ const renderDuration = 0;
3396
+ this.visible = false;
3397
+ changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
3398
+ this.render();
3399
+ this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
3400
+ this.five.on('wantsPanGesture', this.handleWantsPanGesture);
3401
+ }
3402
+ /** 更新户型图大小 */
3403
+ updateSize = () => {
3404
+ if (!this.floorplanData)
3405
+ return;
3406
+ if (!this.container || !this.wrapper)
3407
+ return;
3408
+ if (this.five.getCurrentState().mode !== 'Topview')
3409
+ return;
3410
+ // 计算户型图展示大小
3411
+ const { min, max } = this.floorplanData.bounding;
3412
+ const width = max.x - min.x;
3413
+ const height = max.y - min.y;
3414
+ // 每毫米对应的 px 值
3415
+ const options = this.configs.attachedTo ? { attachedTo: this.configs.attachedTo } : undefined;
3416
+ const pxmm = getPxmm(this.five, this.wrapper, this.floorIndex, options);
3417
+ const _width = Math.ceil(width * pxmm);
3418
+ const _height = Math.ceil(height * pxmm);
3419
+ this.pxmm = pxmm;
3420
+ this.size = { width: _width, height: _height };
3421
+ this.container.style.width = _width + 'px';
3422
+ this.container.style.height = _height + 'px';
3423
+ };
3424
+ render(duration) {
3425
+ if (!this.container || !this.floorplanData)
3426
+ return;
3427
+ if (this.size.width === 0)
3428
+ return;
3429
+ const { getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
3430
+ const handleClick = preventRoomClick ? () => false : undefined;
3431
+ const props = {
3432
+ five: this.five,
3433
+ pxmm: this.pxmm,
3434
+ cameraImageUrl,
3435
+ visible: this.visible,
3436
+ duration: duration ?? 0,
3437
+ panoIndex: this.panoIndex,
3438
+ floorIndex: this.floorIndex,
3439
+ floorplanData: this.floorplanData,
3440
+ hoverEnable: hoverEnable ?? false,
3441
+ compassEnable: compassEnable ?? true,
3442
+ ruleLabelsEnable: ruleLabelsEnable ?? true,
3443
+ roomLabelsEnable: roomLabelsEnable ?? true,
3444
+ lastPanoramaLongitude: this.lastPanoramaLongitude,
3445
+ getLabelElement,
3446
+ onRoomHeightClick: handleClick,
3447
+ };
3448
+ if (!this.app) {
3449
+ this.app = new Main({
3450
+ target: this.container,
3451
+ intro: true,
3452
+ props,
3453
+ });
3454
+ }
3455
+ else {
3456
+ this.app.$set(props);
3457
+ }
3458
+ }
3459
+ }
3460
+
3461
+ const TopviewFloorplanPlugin = (five, params) => {
3462
+ return new TopviewFloorplanPluginController(five, params);
3463
+ };
3464
+
3465
+ exports.TopviewFloorplanPlugin = TopviewFloorplanPlugin;
3466
+ exports["default"] = TopviewFloorplanPlugin;