@realsee/dnalogel 2.0.0-alpha.9 → 2.0.0-beta.36

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 (485) hide show
  1. package/README.md +78 -28
  2. package/components/index.js +1450 -0
  3. package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
  5. package/dist/CSS3DRenderPlugin/index.js +27 -26
  6. package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/index.d.ts +4 -6
  8. package/dist/CameraMovementPlugin/index.js +12 -12
  9. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  10. package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
  11. package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
  12. package/dist/ItemLabelPlugin/index.d.ts +9 -0
  13. package/dist/ItemLabelPlugin/index.js +941 -0
  14. package/dist/ItemLabelPlugin/typings.d.ts +59 -0
  15. package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  16. package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  17. package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  18. package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  19. package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  20. package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  21. package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
  22. package/dist/ModelChassisCompassPlugin/index.js +8 -5
  23. package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  24. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  25. package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
  26. package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  27. package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
  28. package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
  29. package/dist/ModelItemLabelPlugin/index.js +674 -0
  30. package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
  31. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  32. package/dist/ModelRoomLabelPlugin/index.js +153 -73
  33. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  34. package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  35. package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
  36. package/dist/ModelTVVideoPlugin/index.js +301 -0
  37. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  38. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  39. package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
  40. package/dist/ModelViewPlugin/index.d.ts +3 -16
  41. package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
  42. package/dist/PanoCompassPlugin/index.d.ts +4 -47
  43. package/dist/PanoCompassPlugin/index.js +242 -129
  44. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  45. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  46. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  47. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  48. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  49. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  50. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  51. package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  52. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  53. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  54. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  55. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  56. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  57. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  58. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  59. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  60. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  61. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  62. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  63. package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  64. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  65. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  66. package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  67. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  68. package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  69. package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  70. package/dist/PanoMeasurePlugin/index.d.ts +9 -6
  71. package/dist/PanoMeasurePlugin/index.js +2649 -3442
  72. package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
  73. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  74. package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  75. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  76. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  77. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  78. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  79. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  80. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  81. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  82. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  83. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  84. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  85. package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
  86. package/dist/PanoRulerPlugin/index.d.ts +4 -30
  87. package/dist/PanoRulerPlugin/index.js +12 -12
  88. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  89. package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
  90. package/dist/PanoSpatialTagPlugin/index.js +1307 -0
  91. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  92. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  93. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  94. package/dist/base/BasePlugin.d.ts +100 -0
  95. package/dist/base/BasePluginWithData.d.ts +34 -0
  96. package/dist/components/PaintBrush/Controller.d.ts +43 -0
  97. package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
  98. package/dist/components/PaintBrush/index.d.ts +27 -0
  99. package/dist/components/PaintBrush/style.d.ts +2 -0
  100. package/dist/components/PaintBrush/tween.d.ts +62 -0
  101. package/dist/components/PaintBrush/typings.d.ts +58 -0
  102. package/dist/components/PaintBrush/utils.d.ts +26 -0
  103. package/dist/components/index.d.ts +2 -0
  104. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  105. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  106. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  107. package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
  108. package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  109. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  110. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  111. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
  112. package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  113. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  114. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  115. package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
  116. package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  117. package/dist/floorplan/index.d.ts +6 -0
  118. package/dist/floorplan/utils/constant.d.ts +22 -0
  119. package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
  120. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  121. package/dist/index.d.ts +15 -24
  122. package/dist/index.es.js +10694 -7145
  123. package/dist/index.js +10432 -6869
  124. package/dist/index.umd.js +10435 -6875
  125. package/dist/shared-utils/five/changeMode.d.ts +4 -1
  126. package/dist/shared-utils/getPxmm.d.ts +8 -0
  127. package/dist/shared-utils/index.d.ts +1 -0
  128. package/dist/shared-utils/math/Interval.d.ts +13 -0
  129. package/dist/shared-utils/math/Rectangle.d.ts +27 -0
  130. package/dist/shared-utils/math/index.d.ts +2 -0
  131. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  132. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  133. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  134. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  135. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  136. package/dist/shared-utils/uuid.d.ts +1 -0
  137. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  138. package/docs/assets/search.js +1 -1
  139. package/docs/classes/Magnifier.html +9 -0
  140. package/docs/classes/ModelRoomLabelController.html +5 -8
  141. package/docs/enums/CameraMovementEffect.html +3 -0
  142. package/docs/enums/DIRECTION.html +1 -0
  143. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
  144. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  145. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
  146. package/docs/enums/Rotation.html +3 -0
  147. package/docs/index.html +78 -33
  148. package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
  149. package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
  150. package/docs/interfaces/FloorplanBounding.html +10 -0
  151. package/docs/interfaces/FloorplanData.html +3 -0
  152. package/docs/interfaces/FloorplanEntrance.html +15 -0
  153. package/docs/interfaces/FloorplanExtraObject.html +7 -0
  154. package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
  155. package/docs/interfaces/FloorplanFloorData.html +3 -0
  156. package/docs/interfaces/FloorplanImagePosition.html +3 -0
  157. package/docs/interfaces/FloorplanObserver.html +5 -0
  158. package/docs/interfaces/FloorplanOutlineItem.html +3 -0
  159. package/docs/interfaces/FloorplanPosition.html +3 -0
  160. package/docs/interfaces/FloorplanRoomItem.html +17 -0
  161. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
  162. package/docs/interfaces/FloorplanServerBounding.html +10 -0
  163. package/docs/interfaces/FloorplanServerComputedData.html +1 -0
  164. package/docs/interfaces/FloorplanServerData.html +3 -0
  165. package/docs/interfaces/FloorplanServerEntrance.html +15 -0
  166. package/docs/interfaces/FloorplanServerFloorData.html +3 -0
  167. package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
  168. package/docs/interfaces/FloorplanServerObserver.html +5 -0
  169. package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
  170. package/docs/interfaces/FloorplanServerPosition.html +3 -0
  171. package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
  172. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
  173. package/docs/interfaces/ItemLabelPluginData.html +1 -0
  174. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
  175. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
  176. package/docs/interfaces/LineJson.html +1 -1
  177. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  178. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  179. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  180. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  181. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  182. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  183. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  184. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  185. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  186. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  187. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  188. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  189. package/docs/interfaces/ModelViewPluginExportType.html +1 -0
  190. package/docs/interfaces/OpenParameter.html +3 -0
  191. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  192. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  193. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  194. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
  195. package/docs/interfaces/PanoMeasureParameterType.html +1 -0
  196. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  197. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  198. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  199. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
  200. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
  201. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  202. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
  203. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  204. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
  205. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  206. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
  207. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
  208. package/docs/interfaces/Point.html +1 -0
  209. package/docs/interfaces/PointJson.html +1 -1
  210. package/docs/interfaces/Room.html +1 -0
  211. package/docs/interfaces/RoomInfo.html +1 -0
  212. package/docs/interfaces/RoomLabel.html +7 -7
  213. package/docs/interfaces/RoomRules.html +1 -0
  214. package/docs/interfaces/Rooms.html +1 -0
  215. package/docs/modules.html +26 -18
  216. package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  217. package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
  218. package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
  219. package/libs/CSS3DRenderPlugin/index.js +2 -180
  220. package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  221. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
  222. package/libs/CameraMovementPlugin/index.d.ts +4 -6
  223. package/libs/CameraMovementPlugin/index.js +3 -158
  224. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  225. package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
  226. package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
  227. package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
  228. package/libs/ItemLabelPlugin/Plugin.js +120 -0
  229. package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
  230. package/libs/ItemLabelPlugin/events.type.js +1 -0
  231. package/libs/ItemLabelPlugin/index.d.ts +9 -0
  232. package/libs/ItemLabelPlugin/index.js +8 -0
  233. package/libs/ItemLabelPlugin/typings.d.ts +59 -0
  234. package/libs/ItemLabelPlugin/typings.js +7 -0
  235. package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
  236. package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
  237. package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
  238. package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
  239. package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
  240. package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
  241. package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
  242. package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
  243. package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
  244. package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
  245. package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  246. package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
  247. package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
  248. package/libs/ModelChassisCompassPlugin/index.js +2 -74
  249. package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  250. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
  251. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  252. package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
  253. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
  254. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  255. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  256. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
  257. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  258. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  259. package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
  260. package/libs/ModelItemLabelPlugin/index.js +8 -0
  261. package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
  262. package/libs/ModelItemLabelPlugin/typings.js +7 -0
  263. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  264. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  265. package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
  266. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
  267. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  268. package/libs/ModelSimulationPlugin/index.d.ts +33 -0
  269. package/libs/ModelSimulationPlugin/index.js +166 -0
  270. package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
  271. package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
  272. package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
  273. package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
  274. package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  275. package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
  276. package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
  277. package/libs/ModelTVVideoPlugin/index.js +4 -0
  278. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  279. package/libs/ModelTVVideoPlugin/typings.js +8 -0
  280. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  281. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  282. package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
  283. package/libs/ModelViewPlugin/Plugin.js +160 -0
  284. package/libs/ModelViewPlugin/index.d.ts +3 -16
  285. package/libs/ModelViewPlugin/index.js +2 -159
  286. package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
  287. package/libs/PanoCompassPlugin/Plugin.js +249 -0
  288. package/libs/PanoCompassPlugin/index.d.ts +4 -47
  289. package/libs/PanoCompassPlugin/index.js +3 -167
  290. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  291. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  292. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
  293. package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
  294. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  295. package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
  296. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
  297. package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
  298. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  299. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  300. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
  301. package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
  302. package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
  303. package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
  304. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  305. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  306. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  307. package/libs/PanoMeasurePlugin/Model/line.js +61 -11
  308. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  309. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  310. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  311. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  312. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
  313. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
  314. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
  315. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
  316. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
  317. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
  318. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  319. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  320. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  321. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  322. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
  323. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
  324. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  325. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
  326. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
  327. package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
  328. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  329. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  330. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
  331. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
  332. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
  333. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
  334. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
  335. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
  336. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
  337. package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
  338. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
  339. package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
  340. package/libs/PanoMeasurePlugin/index.d.ts +9 -6
  341. package/libs/PanoMeasurePlugin/index.js +3 -1
  342. package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
  343. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
  344. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
  345. package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
  346. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  347. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  348. package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
  349. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  350. package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
  351. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  352. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  353. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  354. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  355. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  356. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  357. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  358. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
  359. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
  360. package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
  361. package/libs/PanoRulerPlugin/Plugin.js +403 -0
  362. package/libs/PanoRulerPlugin/index.d.ts +4 -30
  363. package/libs/PanoRulerPlugin/index.js +2 -397
  364. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  365. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  366. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
  367. package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
  368. package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
  369. package/libs/PanoSpatialTagPlugin/index.js +5 -0
  370. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  371. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  372. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  373. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  374. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  375. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  376. package/libs/base/BasePlugin.d.ts +100 -0
  377. package/libs/base/BasePlugin.js +31 -0
  378. package/libs/base/BasePluginWithData.d.ts +34 -0
  379. package/libs/base/BasePluginWithData.js +4 -0
  380. package/libs/components/PaintBrush/Controller.d.ts +43 -0
  381. package/libs/components/PaintBrush/Controller.js +575 -0
  382. package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
  383. package/libs/components/PaintBrush/Subscribe.js +121 -0
  384. package/libs/components/PaintBrush/index.d.ts +27 -0
  385. package/libs/components/PaintBrush/index.js +57 -0
  386. package/libs/components/PaintBrush/style.d.ts +2 -0
  387. package/libs/components/PaintBrush/style.js +102 -0
  388. package/libs/components/PaintBrush/tween.d.ts +62 -0
  389. package/libs/components/PaintBrush/tween.js +15 -0
  390. package/libs/components/PaintBrush/typings.d.ts +58 -0
  391. package/libs/components/PaintBrush/typings.js +6 -0
  392. package/libs/components/PaintBrush/utils.d.ts +26 -0
  393. package/libs/components/PaintBrush/utils.js +51 -0
  394. package/libs/components/index.d.ts +2 -0
  395. package/libs/components/index.js +3 -0
  396. package/libs/floorplan/Assets/compass.d.ts +1 -0
  397. package/libs/floorplan/Assets/compass.js +1 -0
  398. package/libs/floorplan/Components/BaseImage.js +10 -5
  399. package/libs/floorplan/Components/Camera.js +120 -0
  400. package/libs/floorplan/Components/Compass.js +120 -0
  401. package/libs/floorplan/Components/CurrentFloor.js +469 -0
  402. package/libs/floorplan/Components/Main.js +470 -0
  403. package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
  404. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
  405. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
  406. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
  407. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
  408. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
  409. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
  410. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  411. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
  412. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
  413. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
  414. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
  415. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
  416. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
  417. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
  418. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
  419. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
  420. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
  421. package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
  422. package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
  423. package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
  424. package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
  425. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
  426. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  427. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
  428. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
  429. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
  430. package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
  431. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
  432. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
  433. package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
  434. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
  435. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
  436. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
  437. package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
  438. package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
  439. package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
  440. package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
  441. package/libs/floorplan/index.d.ts +6 -0
  442. package/libs/floorplan/index.js +7 -0
  443. package/libs/floorplan/utils/constant.d.ts +22 -0
  444. package/libs/floorplan/utils/constant.js +23 -0
  445. package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
  446. package/libs/floorplan/utils/correctFiveState.js +46 -0
  447. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  448. package/libs/floorplan/utils/formatPosition.js +3 -3
  449. package/libs/index.d.ts +15 -24
  450. package/libs/index.js +25 -14
  451. package/libs/shared-utils/Subscribe.js +8 -1
  452. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  453. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  454. package/libs/shared-utils/five/changeMode.d.ts +4 -1
  455. package/libs/shared-utils/five/changeMode.js +34 -13
  456. package/libs/shared-utils/getPxmm.d.ts +8 -0
  457. package/libs/shared-utils/getPxmm.js +25 -20
  458. package/libs/shared-utils/index.d.ts +1 -0
  459. package/libs/shared-utils/index.js +1 -0
  460. package/libs/shared-utils/math/Interval.d.ts +13 -0
  461. package/libs/shared-utils/math/Interval.js +40 -0
  462. package/libs/shared-utils/math/Rectangle.d.ts +27 -0
  463. package/libs/shared-utils/math/Rectangle.js +50 -0
  464. package/libs/shared-utils/math/evenNumber.js +1 -1
  465. package/libs/shared-utils/math/index.d.ts +2 -0
  466. package/libs/shared-utils/math/index.js +2 -0
  467. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  468. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  469. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  470. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  471. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  472. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  473. package/libs/shared-utils/tinyEJSrender.js +210 -0
  474. package/libs/shared-utils/uuid.d.ts +1 -0
  475. package/libs/shared-utils/uuid.js +1 -0
  476. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  477. package/package.json +13 -6
  478. package/CHANGELOG.md +0 -30
  479. package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
  480. package/dist/shared-utils/useDebounce.d.ts +0 -8
  481. package/dist/shared-utils/useThrottle.d.ts +0 -8
  482. package/docs/enums/ModelFloorplanErrorType.html +0 -1
  483. package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
  484. package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
  485. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
@@ -0,0 +1,941 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var five = require('@realsee/five');
6
+ var internal = require('svelte/internal');
7
+ var svelte = require('svelte');
8
+ var THREE = require('three');
9
+ var classNames = require('classnames');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
32
+ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
33
+
34
+ exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE = void 0;
35
+ (function (ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE) {
36
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
37
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
38
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
39
+ ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE["EXTRA_LARGE"] = "x-large";
40
+ })(exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE || (exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE = {}));
41
+
42
+ /* src/ItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
43
+
44
+ function add_css$1(target) {
45
+ internal.append_styles(target, "svelte-4rvov0", ".item-label-item.svelte-4rvov0.svelte-4rvov0{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-animation:svelte-4rvov0-fadeIn .3s ease-in;animation:svelte-4rvov0-fadeIn .3s ease-in}.item-label-item.fold.svelte-4rvov0>.item-label-item__text-wrap.svelte-4rvov0{visibility:hidden}.item-label-item.fold.svelte-4rvov0>.item-label-item__bar.anchor.svelte-4rvov0{visibility:hidden}.item-label-item.fold.svelte-4rvov0>.item-label-item__bar.anchor.svelte-4rvov0:after{visibility:visible}.item-label-item__text-wrap.svelte-4rvov0.svelte-4rvov0{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0.625rem 1.04167rem 0.625rem 0.625rem;position:absolute;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:24.63542rem;min-height:4.79167rem;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:1.5px solid rgba(255, 255, 255, .65);border-radius:0.15625rem;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.icon-wrap.svelte-4rvov0.svelte-4rvov0{width:3.54167rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-4rvov0.svelte-4rvov0{width:3.54167rem;height:3.54167rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-4rvov0.svelte-4rvov0{margin-left:0.625rem;padding-left:0.625rem;min-height:3.54167rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 1px;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-4rvov0.svelte-4rvov0{white-space:nowrap;font-size:1.14583rem;font-weight:bold;line-height:1.5625rem}.item-name.svelte-4rvov0.svelte-4rvov0{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.04167rem;line-height:1.45833rem}.item-label-item__bar.svelte-4rvov0.svelte-4rvov0{position:absolute;bottom:0;width:0.15625rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 2px 0.41667rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-4rvov0.svelte-4rvov0:after{content:'';position:absolute;bottom:0;width:1.25rem;height:1.25rem;background-image:url(\"//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png \");background-position:center;background-size:contain;transform:translate(-0.54688rem, 50%)}@-webkit-keyframes svelte-4rvov0-fadeIn{from{opacity:0\n }to{opacity:1\n }}@keyframes svelte-4rvov0-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
46
+ }
47
+
48
+ // (21:2) {#if itemLabel.icon}
49
+ function create_if_block$1(ctx) {
50
+ let div1;
51
+ let div0;
52
+ let div0_style_value;
53
+ let mounted;
54
+ let dispose;
55
+
56
+ return {
57
+ c() {
58
+ div1 = internal.element("div");
59
+ div0 = internal.element("div");
60
+ internal.attr(div0, "class", "icon svelte-4rvov0");
61
+ internal.attr(div0, "style", div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon})`);
62
+ internal.attr(div1, "class", "icon-wrap svelte-4rvov0");
63
+ },
64
+ m(target, anchor) {
65
+ internal.insert(target, div1, anchor);
66
+ internal.append(div1, div0);
67
+
68
+ if (!mounted) {
69
+ dispose = internal.listen(div1, "click", /*click_handler*/ ctx[5]);
70
+ mounted = true;
71
+ }
72
+ },
73
+ p(ctx, dirty) {
74
+ if (dirty & /*itemLabel*/ 1 && div0_style_value !== (div0_style_value = `background-image: url(${/*itemLabel*/ ctx[0].icon})`)) {
75
+ internal.attr(div0, "style", div0_style_value);
76
+ }
77
+ },
78
+ d(detaching) {
79
+ if (detaching) internal.detach(div1);
80
+ mounted = false;
81
+ dispose();
82
+ }
83
+ };
84
+ }
85
+
86
+ function create_fragment$1(ctx) {
87
+ let div3;
88
+ let div1;
89
+ let t0;
90
+ let div0;
91
+ let span0;
92
+ let t1_value = (/*itemLabel*/ ctx[0].code || /*itemLabel*/ ctx[0].id) + "";
93
+ let t1;
94
+ let t2;
95
+ let span1;
96
+ let t3_value = /*itemLabel*/ ctx[0].name + "";
97
+ let t3;
98
+ let t4;
99
+ let div2;
100
+ let div2_class_value;
101
+ let div3_class_value;
102
+ let mounted;
103
+ let dispose;
104
+ let if_block = /*itemLabel*/ ctx[0].icon && create_if_block$1(ctx);
105
+
106
+ return {
107
+ c() {
108
+ div3 = internal.element("div");
109
+ div1 = internal.element("div");
110
+ if (if_block) if_block.c();
111
+ t0 = internal.space();
112
+ div0 = internal.element("div");
113
+ span0 = internal.element("span");
114
+ t1 = internal.text(t1_value);
115
+ t2 = internal.space();
116
+ span1 = internal.element("span");
117
+ t3 = internal.text(t3_value);
118
+ t4 = internal.space();
119
+ div2 = internal.element("div");
120
+ internal.attr(span0, "class", "item-model svelte-4rvov0");
121
+ internal.attr(span1, "class", "item-name svelte-4rvov0");
122
+ internal.attr(div0, "class", "item-label-text svelte-4rvov0");
123
+ internal.attr(div1, "class", "" + (internal.null_to_empty(classNames__default["default"]("item-label-item__text-wrap")) + " svelte-4rvov0"));
124
+ internal.set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
125
+ internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-4rvov0"));
126
+ internal.set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
127
+ internal.attr(div3, "class", div3_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-4rvov0"));
128
+ internal.set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
129
+ internal.set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
130
+ },
131
+ m(target, anchor) {
132
+ internal.insert(target, div3, anchor);
133
+ internal.append(div3, div1);
134
+ if (if_block) if_block.m(div1, null);
135
+ internal.append(div1, t0);
136
+ internal.append(div1, div0);
137
+ internal.append(div0, span0);
138
+ internal.append(span0, t1);
139
+ internal.append(div0, t2);
140
+ internal.append(div0, span1);
141
+ internal.append(span1, t3);
142
+ internal.append(div3, t4);
143
+ internal.append(div3, div2);
144
+
145
+ if (!mounted) {
146
+ dispose = internal.listen(div1, "click", /*onClick*/ ctx[3]);
147
+ mounted = true;
148
+ }
149
+ },
150
+ p(ctx, [dirty]) {
151
+ if (/*itemLabel*/ ctx[0].icon) {
152
+ if (if_block) {
153
+ if_block.p(ctx, dirty);
154
+ } else {
155
+ if_block = create_if_block$1(ctx);
156
+ if_block.c();
157
+ if_block.m(div1, t0);
158
+ }
159
+ } else if (if_block) {
160
+ if_block.d(1);
161
+ if_block = null;
162
+ }
163
+
164
+ if (dirty & /*itemLabel*/ 1 && t1_value !== (t1_value = (/*itemLabel*/ ctx[0].code || /*itemLabel*/ ctx[0].id) + "")) internal.set_data(t1, t1_value);
165
+ if (dirty & /*itemLabel*/ 1 && t3_value !== (t3_value = /*itemLabel*/ ctx[0].name + "")) internal.set_data(t3, t3_value);
166
+
167
+ if (dirty & /*itemLabel*/ 1) {
168
+ internal.set_style(div1, "bottom", `${/*itemLabel*/ ctx[0].strokeLength}px`);
169
+ }
170
+
171
+ if (dirty & /*anchorEnabled*/ 2 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item__bar", { anchor: /*anchorEnabled*/ ctx[1] })) + " svelte-4rvov0"))) {
172
+ internal.attr(div2, "class", div2_class_value);
173
+ }
174
+
175
+ if (dirty & /*itemLabel*/ 1) {
176
+ internal.set_style(div2, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
177
+ }
178
+
179
+ if (dirty & /*itemLabel*/ 1 && div3_class_value !== (div3_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { fold: /*itemLabel*/ ctx[0].isFold })) + " svelte-4rvov0"))) {
180
+ internal.attr(div3, "class", div3_class_value);
181
+ }
182
+
183
+ if (dirty & /*itemLabel*/ 1) {
184
+ internal.set_style(div3, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
185
+ }
186
+
187
+ if (dirty & /*itemLabel*/ 1) {
188
+ internal.set_style(div3, "transform", /*itemLabel*/ ctx[0].transform, false);
189
+ }
190
+ },
191
+ i: internal.noop,
192
+ o: internal.noop,
193
+ d(detaching) {
194
+ if (detaching) internal.detach(div3);
195
+ if (if_block) if_block.d();
196
+ mounted = false;
197
+ dispose();
198
+ }
199
+ };
200
+ }
201
+
202
+ function instance$1($$self, $$props, $$invalidate) {
203
+ let { itemLabel } = $$props;
204
+ let { hooks } = $$props;
205
+ let { anchorEnabled } = $$props;
206
+ let { onIconClick } = $$props;
207
+
208
+ // const defaultIcon = '//vrlab-public.ljcdn.com/common/file/web/c8591aaa-e62b-4e31-8fed-671483ace37f.svg\n'
209
+ function onClick() {
210
+ hooks.emit('onLabelClick', itemLabel);
211
+ }
212
+
213
+ const click_handler = e => onIconClick(itemLabel);
214
+
215
+ $$self.$$set = $$props => {
216
+ if ('itemLabel' in $$props) $$invalidate(0, itemLabel = $$props.itemLabel);
217
+ if ('hooks' in $$props) $$invalidate(4, hooks = $$props.hooks);
218
+ if ('anchorEnabled' in $$props) $$invalidate(1, anchorEnabled = $$props.anchorEnabled);
219
+ if ('onIconClick' in $$props) $$invalidate(2, onIconClick = $$props.onIconClick);
220
+ };
221
+
222
+ return [itemLabel, anchorEnabled, onIconClick, onClick, hooks, click_handler];
223
+ }
224
+
225
+ class ItemLabelItem extends internal.SvelteComponent {
226
+ constructor(options) {
227
+ super();
228
+
229
+ internal.init(
230
+ this,
231
+ options,
232
+ instance$1,
233
+ create_fragment$1,
234
+ internal.safe_not_equal,
235
+ {
236
+ itemLabel: 0,
237
+ hooks: 4,
238
+ anchorEnabled: 1,
239
+ onIconClick: 2
240
+ },
241
+ add_css$1
242
+ );
243
+ }
244
+ }
245
+
246
+ /**
247
+ * 创建一个防抖动函数,该函数会在 wait 毫秒后调用 func 方法
248
+ * @param func - 要防抖动的函数
249
+ * @param [wait=0] - 需要延迟的毫秒数
250
+ */
251
+ function debounce(func, wait = 200) {
252
+ let last;
253
+ return function (...args) {
254
+ clearTimeout(last);
255
+ last = setTimeout(() => {
256
+ func(...args);
257
+ }, wait);
258
+ };
259
+ }
260
+
261
+ const { Raycaster, Vector3 } = THREE__namespace;
262
+ /**
263
+ * 碰撞检测可见性
264
+ * */
265
+ const isImpacted = (five, sourceVector, targetVector, distance) => {
266
+ const direction = sourceVector.clone().sub(targetVector).normalize();
267
+ const raycaster = new Raycaster();
268
+ raycaster.set(targetVector, direction);
269
+ const [intersection] = five.model.intersectRaycaster(raycaster);
270
+ return intersection && intersection.distance + 0.01 < distance;
271
+ // return intersection && distance <= intersection.distance + 0.1
272
+ };
273
+
274
+ /**
275
+ * 展示策略
276
+ * */
277
+ const getStrokeLength = (itemSpaceHeight, type) => {
278
+ switch (type) {
279
+ case exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL:
280
+ return Math.ceil(-27.78 * itemSpaceHeight + 85);
281
+ case exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.MIDLLE:
282
+ return Math.ceil(-38.9 * itemSpaceHeight + 130);
283
+ case exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.LARGE:
284
+ return Math.ceil(-44.44 * itemSpaceHeight + 140);
285
+ case exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
286
+ return Math.ceil(-92.59 * itemSpaceHeight + 300);
287
+ }
288
+ };
289
+
290
+ const getLabelTransform = (cssOffset) => {
291
+ return `translate(${cssOffset[0]}px, ${cssOffset[1]}px)`;
292
+ };
293
+
294
+ /** @description 转成内部所需数据 */
295
+ function transform2RenderData(data) {
296
+ return data.map(label => (Object.assign({ observerIndex: undefined, visible: false, isFold: false }, label)));
297
+ }
298
+
299
+ /* src/ItemLabelPlugin/ItemLabelComponent.svelte generated by Svelte v3.47.0 */
300
+
301
+ function add_css(target) {
302
+ internal.append_styles(target, "svelte-gk8s47", ".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}");
303
+ }
304
+
305
+ function get_each_context(ctx, list, i) {
306
+ const child_ctx = ctx.slice();
307
+ child_ctx[32] = list[i];
308
+ return child_ctx;
309
+ }
310
+
311
+ // (248:2) {#if itemLabelItem.visible}
312
+ function create_if_block(ctx) {
313
+ let itemlabelitem;
314
+ let current;
315
+
316
+ itemlabelitem = new ItemLabelItem({
317
+ props: {
318
+ itemLabel: /*itemLabelItem*/ ctx[32],
319
+ hooks: /*hooks*/ ctx[0],
320
+ anchorEnabled: /*anchorEnabled*/ ctx[2],
321
+ onIconClick: /*onIconClick*/ ctx[6]
322
+ }
323
+ });
324
+
325
+ return {
326
+ c() {
327
+ internal.create_component(itemlabelitem.$$.fragment);
328
+ },
329
+ m(target, anchor) {
330
+ internal.mount_component(itemlabelitem, target, anchor);
331
+ current = true;
332
+ },
333
+ p(ctx, dirty) {
334
+ const itemlabelitem_changes = {};
335
+ if (dirty[0] & /*renderItemLabels*/ 2) itemlabelitem_changes.itemLabel = /*itemLabelItem*/ ctx[32];
336
+ if (dirty[0] & /*hooks*/ 1) itemlabelitem_changes.hooks = /*hooks*/ ctx[0];
337
+ if (dirty[0] & /*anchorEnabled*/ 4) itemlabelitem_changes.anchorEnabled = /*anchorEnabled*/ ctx[2];
338
+ itemlabelitem.$set(itemlabelitem_changes);
339
+ },
340
+ i(local) {
341
+ if (current) return;
342
+ internal.transition_in(itemlabelitem.$$.fragment, local);
343
+ current = true;
344
+ },
345
+ o(local) {
346
+ internal.transition_out(itemlabelitem.$$.fragment, local);
347
+ current = false;
348
+ },
349
+ d(detaching) {
350
+ internal.destroy_component(itemlabelitem, detaching);
351
+ }
352
+ };
353
+ }
354
+
355
+ // (247:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
356
+ function create_each_block(key_1, ctx) {
357
+ let first;
358
+ let if_block_anchor;
359
+ let current;
360
+ let if_block = /*itemLabelItem*/ ctx[32].visible && create_if_block(ctx);
361
+
362
+ return {
363
+ key: key_1,
364
+ first: null,
365
+ c() {
366
+ first = internal.empty();
367
+ if (if_block) if_block.c();
368
+ if_block_anchor = internal.empty();
369
+ this.first = first;
370
+ },
371
+ m(target, anchor) {
372
+ internal.insert(target, first, anchor);
373
+ if (if_block) if_block.m(target, anchor);
374
+ internal.insert(target, if_block_anchor, anchor);
375
+ current = true;
376
+ },
377
+ p(new_ctx, dirty) {
378
+ ctx = new_ctx;
379
+
380
+ if (/*itemLabelItem*/ ctx[32].visible) {
381
+ if (if_block) {
382
+ if_block.p(ctx, dirty);
383
+
384
+ if (dirty[0] & /*renderItemLabels*/ 2) {
385
+ internal.transition_in(if_block, 1);
386
+ }
387
+ } else {
388
+ if_block = create_if_block(ctx);
389
+ if_block.c();
390
+ internal.transition_in(if_block, 1);
391
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
392
+ }
393
+ } else if (if_block) {
394
+ internal.group_outros();
395
+
396
+ internal.transition_out(if_block, 1, 1, () => {
397
+ if_block = null;
398
+ });
399
+
400
+ internal.check_outros();
401
+ }
402
+ },
403
+ i(local) {
404
+ if (current) return;
405
+ internal.transition_in(if_block);
406
+ current = true;
407
+ },
408
+ o(local) {
409
+ internal.transition_out(if_block);
410
+ current = false;
411
+ },
412
+ d(detaching) {
413
+ if (detaching) internal.detach(first);
414
+ if (if_block) if_block.d(detaching);
415
+ if (detaching) internal.detach(if_block_anchor);
416
+ }
417
+ };
418
+ }
419
+
420
+ function create_fragment(ctx) {
421
+ let div;
422
+ let each_blocks = [];
423
+ let each_1_lookup = new Map();
424
+ let div_resize_listener;
425
+ let current;
426
+ let each_value = /*renderItemLabels*/ ctx[1];
427
+ const get_key = ctx => /*itemLabelItem*/ ctx[32].id;
428
+
429
+ for (let i = 0; i < each_value.length; i += 1) {
430
+ let child_ctx = get_each_context(ctx, each_value, i);
431
+ let key = get_key(child_ctx);
432
+ each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
433
+ }
434
+
435
+ return {
436
+ c() {
437
+ div = internal.element("div");
438
+
439
+ for (let i = 0; i < each_blocks.length; i += 1) {
440
+ each_blocks[i].c();
441
+ }
442
+
443
+ internal.attr(div, "class", "item-labels-container svelte-gk8s47");
444
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[13].call(div));
445
+ internal.set_style(div, "opacity", /*itemsVisible*/ ctx[5] ? 1 : 0, false);
446
+ },
447
+ m(target, anchor) {
448
+ internal.insert(target, div, anchor);
449
+
450
+ for (let i = 0; i < each_blocks.length; i += 1) {
451
+ each_blocks[i].m(div, null);
452
+ }
453
+
454
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[13].bind(div));
455
+ current = true;
456
+ },
457
+ p(ctx, dirty) {
458
+ if (dirty[0] & /*renderItemLabels, hooks, anchorEnabled, onIconClick*/ 71) {
459
+ each_value = /*renderItemLabels*/ ctx[1];
460
+ internal.group_outros();
461
+ 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, null, get_each_context);
462
+ internal.check_outros();
463
+ }
464
+
465
+ if (dirty[0] & /*itemsVisible*/ 32) {
466
+ internal.set_style(div, "opacity", /*itemsVisible*/ ctx[5] ? 1 : 0, false);
467
+ }
468
+ },
469
+ i(local) {
470
+ if (current) return;
471
+
472
+ for (let i = 0; i < each_value.length; i += 1) {
473
+ internal.transition_in(each_blocks[i]);
474
+ }
475
+
476
+ current = true;
477
+ },
478
+ o(local) {
479
+ for (let i = 0; i < each_blocks.length; i += 1) {
480
+ internal.transition_out(each_blocks[i]);
481
+ }
482
+
483
+ current = false;
484
+ },
485
+ d(detaching) {
486
+ if (detaching) internal.detach(div);
487
+
488
+ for (let i = 0; i < each_blocks.length; i += 1) {
489
+ each_blocks[i].d();
490
+ }
491
+
492
+ div_resize_listener();
493
+ }
494
+ };
495
+ }
496
+ let basicWidth = 11;
497
+
498
+ function instance($$self, $$props, $$invalidate) {
499
+ const { Raycaster, Vector3 } = THREE__namespace;
500
+ let { five: five$1 } = $$props;
501
+ let { modelOcclusionEnable } = $$props;
502
+ let { itemLabels } = $$props;
503
+ let { wrapper } = $$props;
504
+ let { hooks } = $$props;
505
+ let { displayStrategyType } = $$props;
506
+ let { maxVisibleDistance } = $$props;
507
+ let curItemLabels = null;
508
+ let renderItemLabels = null;
509
+
510
+ let anchorEnabled = (five$1 === null || five$1 === void 0
511
+ ? void 0
512
+ : five$1.currentMode) === five.Five.Mode.Panorama;
513
+
514
+ let wrapperSize = { width: 0, height: 0 };
515
+ let containerWidth;
516
+ let containerHeight;
517
+
518
+ // 计算重叠
519
+ let cssOffsetLists = [];
520
+
521
+ // 动画过程中 itemsVisible 为 false
522
+ let itemsVisible = true;
523
+
524
+ /**
525
+ * 可见性策略:
526
+ * 1、当前楼层(假设先不考虑多楼层)
527
+ * 2、模型未被遮挡(一个 box 有没有被遮挡的计算? TODO)
528
+ * */
529
+ const judgeImpacted = (five$1, itemLabel) => {
530
+ // 虚拟 VR 仅有一层,不考虑楼层信息
531
+ const cameraPosition = five$1.camera.position.clone();
532
+
533
+ const modelPosition = new Vector3(itemLabel.modelPosition[0], itemLabel.modelPosition[1], itemLabel.modelPosition[2]);
534
+
535
+ // 计算点到相机的位置
536
+ const vectorDistance = modelPosition.distanceTo(cameraPosition);
537
+
538
+ // 判断距离,大于最大可见距离直接不可见 TODO 把距离计算和碰撞拆分开
539
+ if (maxVisibleDistance !== undefined && five$1.state.mode === five.Five.Mode.Panorama) {
540
+ if (vectorDistance > maxVisibleDistance) {
541
+ return false;
542
+ }
543
+ }
544
+
545
+ return isImpacted(five$1, modelPosition.clone().sub(cameraPosition).normalize(), cameraPosition, vectorDistance);
546
+ }; // raycaster.set(cameraPosition.clone(), modelPosition.clone().sub(cameraPosition).normalize())
547
+ // const [intersection] = five.model.intersectRaycaster(raycaster)
548
+ // return !(intersection && intersection.distance + 1 < vectorDistance);
549
+
550
+ const judgeInViewport = modelPoint => {
551
+ const { camera, model } = five$1;
552
+ const { x: offsetXFromCenter, y: offsetYFromCenter, z: offsetZFromCenter } = modelPoint.clone().project(camera);
553
+ const ratioFromLeft = (offsetXFromCenter + 1) / 2;
554
+ const ratioFromTop = (2 - (offsetYFromCenter + 1)) / 2;
555
+ const isFront = Math.abs(offsetZFromCenter) < 1;
556
+ const cssOffset = [ratioFromLeft, ratioFromTop];
557
+ const isInViewport = isFront && cssOffset.every(ratio => ratio < 1 && ratio >= 0);
558
+ return Boolean(isInViewport);
559
+ };
560
+
561
+ // cssOffset 获取
562
+ const getLabelCssOffset = (five, itemLabel) => {
563
+ const modelPosition = new Vector3(itemLabel.modelPosition[0], itemLabel.modelPosition[1], itemLabel.modelPosition[2]);
564
+ const cssPosition = five.project2d(modelPosition);
565
+
566
+ const xOffset = cssPosition === null || cssPosition === void 0
567
+ ? void 0
568
+ : cssPosition.x;
569
+
570
+ const yOffset = cssPosition === null || cssPosition === void 0
571
+ ? void 0
572
+ : cssPosition.y;
573
+
574
+ return [xOffset, yOffset];
575
+ };
576
+
577
+ const getFormatedItemLabels = (five$1, labels) => {
578
+ // 计算位置 & 可见性
579
+ const newLabels = labels.map(label => {
580
+ const cssOffset = getLabelCssOffset(five$1, label);
581
+ label.name.length * basicWidth;
582
+ const strokeLength = getStrokeLength(label.modelPosition[1], displayStrategyType);
583
+
584
+ // 是否加入碰撞检测
585
+ // 配置加入碰撞检测,则判断碰撞检测
586
+ // 在可见范围内, 仅在 Panorama 模态计算
587
+ const isInViewport = five$1.currentMode === five.Five.Mode.Panorama
588
+ ? judgeInViewport(new Vector3(label.position[0], label.position[1], label.position[2]))
589
+ : true;
590
+
591
+ // 碰撞
592
+ const isBlocked = modelOcclusionEnable
593
+ ? judgeImpacted(five$1, label)
594
+ : false;
595
+
596
+ const visible = isInViewport && !isBlocked;
597
+
598
+ // 关掉重叠计算
599
+ // const visible = naturalVisible && !isOverlap([cssOffset[0], cssOffset[1] + strokeLength], curLabelWidth)
600
+ if (!visible) return Object.assign(Object.assign({}, label), { visible });
601
+
602
+ cssOffsetLists.push(cssOffset);
603
+
604
+ // position
605
+ const transform = getLabelTransform(cssOffset);
606
+
607
+ return Object.assign(Object.assign({}, label), { visible, transform, strokeLength });
608
+ });
609
+
610
+ const sortedItemLabelItems = newLabels.filter(({ visible }) => visible).map(label => ({
611
+ itemLabelItem: label,
612
+ distance: new Vector3(label.modelPosition[0], label.modelPosition[1], label.modelPosition[2]).clone().distanceTo(five$1.camera.position)
613
+ })).sort((a, b) => a.distance - b.distance);
614
+
615
+ return newLabels.map(label => {
616
+ const sortIndex = sortedItemLabelItems.findIndex(item => item.itemLabelItem.id === label.id);
617
+ if (sortIndex !== undefined) return Object.assign(Object.assign({}, label), { zIndex: sortIndex * 10 });
618
+ return label;
619
+ });
620
+ };
621
+
622
+ const onItemLabelUpdate = () => {
623
+ cssOffsetLists = [];
624
+ $$invalidate(1, renderItemLabels = getFormatedItemLabels(five$1, renderItemLabels));
625
+ };
626
+
627
+ const handleCameraUpdateCallback = () => {
628
+ $$invalidate(5, itemsVisible = false);
629
+ handleCameraUpdate();
630
+ };
631
+
632
+ const onFiveModeChange = mode => {
633
+ $$invalidate(5, itemsVisible = false);
634
+
635
+ five$1.once('initAnimationEnded', (panoIndex, pose, userAction) => {
636
+ $$invalidate(2, anchorEnabled = mode === five.Five.Mode.Panorama);
637
+ $$invalidate(5, itemsVisible = true);
638
+ if (!userAction) return; else onItemLabelUpdate();
639
+ });
640
+ };
641
+
642
+ const handleCameraUpdate = debounce(
643
+ () => {
644
+ $$invalidate(5, itemsVisible = true);
645
+ onItemLabelUpdate();
646
+ },
647
+ 300
648
+ );
649
+
650
+ const addResizeListener = () => {
651
+ wrapperSize = {
652
+ width: wrapper.clientWidth,
653
+ height: wrapper.clientHeight
654
+ };
655
+
656
+ resizeObserver.observe(wrapper);
657
+ };
658
+
659
+ const addDataUpdateListener = () => {
660
+ if (curItemLabels !== itemLabels) {
661
+ $$invalidate(1, renderItemLabels = transform2RenderData(itemLabels));
662
+ curItemLabels = itemLabels;
663
+ onItemLabelUpdate();
664
+ }
665
+ };
666
+
667
+ const resizeObserver = new ResizeObserver(entries => {
668
+ const entry = entries[0];
669
+ const target = entry.target;
670
+ const curWidth = target.clientWidth;
671
+ const curHeight = target.clientHeight;
672
+
673
+ if (wrapperSize.width !== curWidth || wrapperSize.height !== curHeight) {
674
+ wrapperSize = { width: curWidth, height: curHeight };
675
+ onItemLabelUpdate();
676
+ }
677
+ });
678
+
679
+ const getNearObserverPano = (fromPositionVector, observers) => {
680
+ let candidates = [];
681
+
682
+ for (let i = 0; i < observers.length; i++) {
683
+ const { position: obVector, panoIndex } = observers[i];
684
+ const distance = fromPositionVector.distanceTo(obVector);
685
+
686
+ if (maxVisibleDistance === undefined || distance <= maxVisibleDistance || five$1.state.mode !== five.Five.Mode.Panorama) {
687
+ candidates.push({ panoIndex, obVector, distance });
688
+ }
689
+ }
690
+
691
+ candidates = candidates.sort((a, b) => a.distance - b.distance);
692
+ let observerIndex;
693
+
694
+ for (let i = 0; i < candidates.length; i++) {
695
+ const { obVector, distance, panoIndex } = candidates[i];
696
+ const isImpactedRes = isImpacted(five$1, fromPositionVector, obVector, distance);
697
+
698
+ if (!isImpactedRes) {
699
+ observerIndex = panoIndex;
700
+ break;
701
+ }
702
+ }
703
+
704
+ return typeof observerIndex === "number"
705
+ ? observers[observerIndex]
706
+ : undefined;
707
+ };
708
+
709
+ const onIconClick = itemLabel => {
710
+ if (five$1.state.mode === five.Five.Mode.Panorama) return;
711
+ const observers = five$1.work.observers;
712
+ const fromPositionVector = new Vector3(itemLabel.position[0], itemLabel.position[1], itemLabel.position[2]);
713
+ const observer = getNearObserverPano(fromPositionVector, observers);
714
+
715
+ if (observer) {
716
+ console.log('--has observer--');
717
+ itemLabel.observerIndex = observer.panoIndex;
718
+ }
719
+
720
+ if (typeof itemLabel.observerIndex === "number") {
721
+ const observer = observers[itemLabel.observerIndex];
722
+ const direction = fromPositionVector.clone().sub(observer.position).normalize();
723
+
724
+ const cameraCoord = {
725
+ longitude: Math.PI + Math.atan2(direction.x, direction.z),
726
+ latitude: Math.acos(direction.y / direction.length()) - Math.PI / 2
727
+ };
728
+
729
+ five$1.setState(Object.assign(Object.assign({}, cameraCoord), {
730
+ mode: five.Five.Mode.Panorama,
731
+ panoIndex: itemLabel.observerIndex
732
+ }));
733
+
734
+ // 游走结束更新 render list
735
+ five$1.once('initAnimationEnded', () => {
736
+ $$invalidate(1, renderItemLabels = renderItemLabels.map(item => {
737
+ return Object.assign(Object.assign({}, item), { isFold: item.id !== itemLabel.id });
738
+ }));
739
+
740
+ five$1.once('cameraUpdate', () => {
741
+ $$invalidate(1, renderItemLabels = renderItemLabels.map(item => {
742
+ return Object.assign(Object.assign({}, item), { isFold: false });
743
+ }));
744
+ });
745
+ });
746
+ }
747
+ };
748
+
749
+ svelte.beforeUpdate(() => {
750
+ addDataUpdateListener();
751
+ });
752
+
753
+ svelte.onMount(() => {
754
+ $$invalidate(1, renderItemLabels = transform2RenderData(itemLabels));
755
+ curItemLabels = itemLabels;
756
+ onItemLabelUpdate();
757
+ addResizeListener();
758
+ five$1.on('cameraUpdate', handleCameraUpdateCallback);
759
+ five$1.on('modeChange', onFiveModeChange);
760
+ });
761
+
762
+ svelte.onDestroy(() => {
763
+ five$1.off('cameraUpdate', handleCameraUpdateCallback);
764
+ five$1.off('modeChange', onFiveModeChange);
765
+ resizeObserver.unobserve(wrapper);
766
+ });
767
+
768
+ function div_elementresize_handler() {
769
+ containerWidth = this.clientWidth;
770
+ containerHeight = this.clientHeight;
771
+ $$invalidate(3, containerWidth);
772
+ $$invalidate(4, containerHeight);
773
+ }
774
+
775
+ $$self.$$set = $$props => {
776
+ if ('five' in $$props) $$invalidate(7, five$1 = $$props.five);
777
+ if ('modelOcclusionEnable' in $$props) $$invalidate(8, modelOcclusionEnable = $$props.modelOcclusionEnable);
778
+ if ('itemLabels' in $$props) $$invalidate(9, itemLabels = $$props.itemLabels);
779
+ if ('wrapper' in $$props) $$invalidate(10, wrapper = $$props.wrapper);
780
+ if ('hooks' in $$props) $$invalidate(0, hooks = $$props.hooks);
781
+ if ('displayStrategyType' in $$props) $$invalidate(11, displayStrategyType = $$props.displayStrategyType);
782
+ if ('maxVisibleDistance' in $$props) $$invalidate(12, maxVisibleDistance = $$props.maxVisibleDistance);
783
+ };
784
+
785
+ return [
786
+ hooks,
787
+ renderItemLabels,
788
+ anchorEnabled,
789
+ containerWidth,
790
+ containerHeight,
791
+ itemsVisible,
792
+ onIconClick,
793
+ five$1,
794
+ modelOcclusionEnable,
795
+ itemLabels,
796
+ wrapper,
797
+ displayStrategyType,
798
+ maxVisibleDistance,
799
+ div_elementresize_handler
800
+ ];
801
+ }
802
+
803
+ class ItemLabelComponent extends internal.SvelteComponent {
804
+ constructor(options) {
805
+ super();
806
+
807
+ internal.init(
808
+ this,
809
+ options,
810
+ instance,
811
+ create_fragment,
812
+ internal.safe_not_equal,
813
+ {
814
+ five: 7,
815
+ modelOcclusionEnable: 8,
816
+ itemLabels: 9,
817
+ wrapper: 10,
818
+ hooks: 0,
819
+ displayStrategyType: 11,
820
+ maxVisibleDistance: 12
821
+ },
822
+ add_css,
823
+ [-1, -1]
824
+ );
825
+ }
826
+ }
827
+
828
+ /** @description 转成内部所需数据 */
829
+ function parseItemLabelPluginData(data) {
830
+ return data.item_labels.map(label => (Object.assign({ modelPosition: [label.position[0], label.position[1], label.position[2]], observerIndex: undefined }, label)));
831
+ }
832
+
833
+ const defaultMaxVisibleDistance = undefined;
834
+ const Plugin = (five$1, params) => {
835
+ var _a, _b, _c;
836
+ const pluginState = {
837
+ container: document.createElement('div'),
838
+ data: null,
839
+ enabled: true,
840
+ fiveModeEnabled: true,
841
+ itemLabels: [],
842
+ wrapper: null,
843
+ app: undefined,
844
+ hooks: new five.Subscribe(),
845
+ modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
846
+ displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.SMALL,
847
+ maxVisibleDistance: (_c = params === null || params === void 0 ? void 0 : params.maxVisibleDistance) !== null && _c !== void 0 ? _c : defaultMaxVisibleDistance,
848
+ };
849
+ pluginState.container.setAttribute('class', 'item-label-plugin-container');
850
+ pluginState.container.style.cssText = `
851
+ position: absolute;
852
+ left: 0;
853
+ top: 0;
854
+ width: 100%;
855
+ height: 100%;
856
+ z-index: 5;
857
+ `;
858
+ pluginState.container.style.pointerEvents = 'none'; // 写到 cssText 里不生效
859
+ const appendTo = (wrapper) => {
860
+ pluginState.wrapper = wrapper;
861
+ wrapper.appendChild(pluginState.container);
862
+ render();
863
+ return true;
864
+ };
865
+ const load = (data) => {
866
+ pluginState.itemLabels = parseItemLabelPluginData(data);
867
+ render();
868
+ };
869
+ const enable = () => {
870
+ if (pluginState.enabled)
871
+ return true;
872
+ pluginState.enabled = true;
873
+ render();
874
+ return true;
875
+ };
876
+ const disable = () => {
877
+ if (!pluginState.enabled)
878
+ return true;
879
+ pluginState.enabled = false;
880
+ render();
881
+ return true;
882
+ };
883
+ const dispose = () => {
884
+ pluginState.container.remove();
885
+ };
886
+ const render = () => {
887
+ var _a;
888
+ if (!pluginState.wrapper)
889
+ return;
890
+ // 只要不可展示,销毁容器
891
+ if (!pluginState.enabled || !pluginState.fiveModeEnabled) {
892
+ (_a = pluginState.app) === null || _a === void 0 ? void 0 : _a.$destroy();
893
+ pluginState.app = undefined;
894
+ return;
895
+ }
896
+ // 正常显示时,分为 app 存在和不存在两种情况,如果存在,传值,不存在则初始化并传值
897
+ if (!pluginState.app) {
898
+ pluginState.app = new ItemLabelComponent({
899
+ target: pluginState.container,
900
+ props: {
901
+ five: five$1,
902
+ modelOcclusionEnable: pluginState.modelOcclusionEnable,
903
+ itemLabels: pluginState.itemLabels,
904
+ wrapper: pluginState.wrapper,
905
+ hooks: pluginState.hooks,
906
+ displayStrategyType: pluginState.displayStrategyType,
907
+ maxVisibleDistance: pluginState.maxVisibleDistance
908
+ }
909
+ });
910
+ }
911
+ else {
912
+ pluginState.app.$set({
913
+ five: five$1,
914
+ itemLabels: pluginState.itemLabels
915
+ });
916
+ }
917
+ };
918
+ // 添加 five 监听
919
+ const addListener4Five = () => {
920
+ // five.on('modeChange', onFiveModeChange)
921
+ five$1.once('dispose', dispose);
922
+ };
923
+ addListener4Five();
924
+ return {
925
+ appendTo,
926
+ load,
927
+ enable,
928
+ disable,
929
+ dispose,
930
+ hooks: pluginState.hooks
931
+ };
932
+ };
933
+
934
+ const itemLabelPluginServerParams = {
935
+ name: 'ItemLabelPlugin',
936
+ version: 0,
937
+ };
938
+
939
+ exports.ItemLabelPlugin = Plugin;
940
+ exports["default"] = Plugin;
941
+ exports.itemLabelPluginServerParams = itemLabelPluginServerParams;