@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.22

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