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