@realsee/dnalogel 2.20.9 → 2.20.10-dev.0

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 (316) hide show
  1. package/dist/PanoCompassPlugin/typings.d.ts +1 -1
  2. package/dist/base/BasePlugin.d.ts +4 -4
  3. package/dist/base/BasePluginWithData.d.ts +2 -1
  4. package/dist/index.cjs.js +3 -3
  5. package/dist/index.js +5 -5
  6. package/dist/index.umd.js +3 -3
  7. package/dist/shared-utils/absoluteUrl.d.ts +2 -2
  8. package/docs/classes/CSS3DRender.html +30 -30
  9. package/docs/classes/CruisePluginController.html +25 -25
  10. package/docs/classes/GuideLineItem.GuideLineItem.html +19 -19
  11. package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +34 -34
  12. package/docs/classes/Magnifier.html +19 -19
  13. package/docs/classes/ModelRoomLabelController.html +10 -10
  14. package/docs/classes/Object3DHelperController.html +24 -24
  15. package/docs/classes/PaintBrush.html +14 -14
  16. package/docs/classes/PanoMeasurePluginLine.html +22 -22
  17. package/docs/classes/PanoMeasurePluginModel.html +21 -21
  18. package/docs/classes/PanoMeasurePluginPoint.html +13 -13
  19. package/docs/classes/PanoMeasurePluginPolyline.html +25 -25
  20. package/docs/classes/PanoTagPluginController.html +46 -46
  21. package/docs/classes/Util.BetterTween.html +8 -8
  22. package/docs/classes/Util.FivePointSelector.html +11 -11
  23. package/docs/classes/Util.Interval.html +11 -11
  24. package/docs/classes/Util.Magnifier.html +16 -16
  25. package/docs/classes/Util.PointDomHelper.html +10 -10
  26. package/docs/classes/Util.PointHelper.html +10 -10
  27. package/docs/classes/Util.Rectangle.html +12 -12
  28. package/docs/enums/CameraMovementEffect.html +6 -6
  29. package/docs/enums/ContentType.html +19 -19
  30. package/docs/enums/DIRECTION.html +8 -8
  31. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +8 -8
  32. package/docs/enums/DimensionType.html +6 -6
  33. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +7 -7
  34. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +8 -8
  35. package/docs/enums/PaintBrushTypeEnum.html +7 -7
  36. package/docs/enums/PointType.html +6 -6
  37. package/docs/enums/Rotation.html +7 -7
  38. package/docs/functions/CSS3DRenderPlugin.html +3 -3
  39. package/docs/functions/CameraMovementPlugin.html +3 -3
  40. package/docs/functions/CruisePlugin.html +3 -3
  41. package/docs/functions/GuideLinePlugin.html +4 -4
  42. package/docs/functions/ItemLabelPlugin.html +3 -3
  43. package/docs/functions/MapviewFloorplanPlugin.html +3 -3
  44. package/docs/functions/ModelChassisCompassPlugin.html +3 -3
  45. package/docs/functions/ModelEntryDoorGuidePlugin.html +3 -3
  46. package/docs/functions/ModelFloorplanPlugin.html +3 -3
  47. package/docs/functions/ModelItemLabelPlugin.html +3 -3
  48. package/docs/functions/ModelRoomLabelPlugin.html +3 -3
  49. package/docs/functions/ModelTVVideoPlugin.html +3 -3
  50. package/docs/functions/ModelViewPlugin.html +3 -3
  51. package/docs/functions/Object3DHelperPlugin.html +3 -3
  52. package/docs/functions/PanoCompassPlugin.html +3 -3
  53. package/docs/functions/PanoCursorRaycasterPlugin.html +3 -3
  54. package/docs/functions/PanoDoorLabelPlugin.html +3 -3
  55. package/docs/functions/PanoFloorplanRadarPlugin.html +3 -3
  56. package/docs/functions/PanoMeasurePlugin.html +3 -3
  57. package/docs/functions/PanoRulerPlugin.html +3 -3
  58. package/docs/functions/PanoRulerProPlugin.html +3 -3
  59. package/docs/functions/PanoSpatialTagPlugin.html +3 -3
  60. package/docs/functions/PanoTagPlugin.html +3 -3
  61. package/docs/functions/PanoVideoPlugin.html +3 -3
  62. package/docs/functions/TopviewFloorplanPlugin.html +3 -3
  63. package/docs/functions/Util.absoluteUrl.html +4 -4
  64. package/docs/functions/Util.getCoordsFromClient.html +4 -4
  65. package/docs/functions/Util.getCoordsFromElement.html +4 -4
  66. package/docs/functions/Util.getFrameTime.html +4 -4
  67. package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
  68. package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
  69. package/docs/functions/Util.isAbsoluteURL.html +4 -4
  70. package/docs/functions/Util.isModelLike.html +4 -4
  71. package/docs/functions/Util.isNil.html +4 -4
  72. package/docs/functions/Util.isPanoramaLike.html +4 -4
  73. package/docs/functions/Util.nextFrame.html +4 -4
  74. package/docs/functions/Util.notNil.html +4 -4
  75. package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
  76. package/docs/functions/Util.tweenProgress.html +4 -4
  77. package/docs/functions/Util.uuid.html +4 -4
  78. package/docs/functions/pluginFlag.html +4 -4
  79. package/docs/index.html +4 -4
  80. package/docs/interfaces/AddTagConfig.html +5 -5
  81. package/docs/interfaces/CSS3DRenderPluginEventMap.html +10 -10
  82. package/docs/interfaces/CSS3DRenderPluginState.html +7 -7
  83. package/docs/interfaces/CameraMovementPluginExportType.html +6 -6
  84. package/docs/interfaces/CruisePluginTypes.Config.html +7 -7
  85. package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +11 -11
  86. package/docs/interfaces/CruisePluginTypes.EventMap.html +19 -19
  87. package/docs/interfaces/CruisePluginTypes.MoveAction.html +11 -11
  88. package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +13 -13
  89. package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +13 -13
  90. package/docs/interfaces/CruisePluginTypes.PluginData.html +8 -8
  91. package/docs/interfaces/CruisePluginTypes.PluginServerData.html +6 -6
  92. package/docs/interfaces/CruisePluginTypes.PluginState.html +10 -10
  93. package/docs/interfaces/EventMap.html +14 -14
  94. package/docs/interfaces/FloorplanBounding.html +7 -7
  95. package/docs/interfaces/FloorplanData.html +9 -9
  96. package/docs/interfaces/FloorplanEntrance.html +10 -10
  97. package/docs/interfaces/FloorplanExtraObject.html +9 -9
  98. package/docs/interfaces/FloorplanExtraObject3D.html +7 -7
  99. package/docs/interfaces/FloorplanFloorData.html +8 -8
  100. package/docs/interfaces/FloorplanImagePosition.html +6 -6
  101. package/docs/interfaces/FloorplanObserver.html +8 -8
  102. package/docs/interfaces/FloorplanOutlineItem.html +8 -8
  103. package/docs/interfaces/FloorplanPosition.html +6 -6
  104. package/docs/interfaces/FloorplanRoomItem.html +12 -12
  105. package/docs/interfaces/FloorplanRoomLabelItem.html +6 -6
  106. package/docs/interfaces/FloorplanServerBounding.html +7 -7
  107. package/docs/interfaces/FloorplanServerComputedData.html +9 -9
  108. package/docs/interfaces/FloorplanServerData.html +6 -6
  109. package/docs/interfaces/FloorplanServerDoorItem.html +9 -9
  110. package/docs/interfaces/FloorplanServerDoorPosition.html +7 -7
  111. package/docs/interfaces/FloorplanServerEntrance.html +10 -10
  112. package/docs/interfaces/FloorplanServerFloorData.html +8 -8
  113. package/docs/interfaces/FloorplanServerImagePosition.html +6 -6
  114. package/docs/interfaces/FloorplanServerObserver.html +8 -8
  115. package/docs/interfaces/FloorplanServerOutlineItem.html +8 -8
  116. package/docs/interfaces/FloorplanServerPosition.html +6 -6
  117. package/docs/interfaces/FloorplanServerRoomItem.html +13 -13
  118. package/docs/interfaces/FloorplanServerRoomLabelItem.html +6 -6
  119. package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +7 -7
  120. package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +9 -9
  121. package/docs/interfaces/GuideLinePluginType.EventMap.html +12 -12
  122. package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +7 -7
  123. package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +5 -5
  124. package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +12 -12
  125. package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +7 -7
  126. package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +17 -17
  127. package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +6 -6
  128. package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +17 -17
  129. package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +4 -4
  130. package/docs/interfaces/GuideLinePluginType.PluginServerData.html +6 -6
  131. package/docs/interfaces/GuideLinePluginType.PluginState.html +7 -7
  132. package/docs/interfaces/GuideLinePluginType.Route.html +10 -10
  133. package/docs/interfaces/GuideLinePluginType.RouteConfig.html +8 -8
  134. package/docs/interfaces/HelperOffset.html +7 -7
  135. package/docs/interfaces/ImagePlaneGroup.html +5 -5
  136. package/docs/interfaces/ItemLabelPluginData.html +5 -5
  137. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +10 -10
  138. package/docs/interfaces/ItemLabelPluginParametersType.html +8 -8
  139. package/docs/interfaces/MinMax.html +6 -6
  140. package/docs/interfaces/ModelChassisCompassPluginData.html +6 -6
  141. package/docs/interfaces/ModelChassisCompassPluginExportType.html +7 -7
  142. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +6 -6
  143. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +7 -7
  144. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +7 -7
  145. package/docs/interfaces/ModelItemLabelPluginData.html +5 -5
  146. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +10 -10
  147. package/docs/interfaces/ModelItemLabelPluginParametersType.html +6 -6
  148. package/docs/interfaces/ModelRoomLabelPluginData.html +5 -5
  149. package/docs/interfaces/ModelTVVideoPluginData.html +8 -8
  150. package/docs/interfaces/ModelTVVideoPluginExportType.html +7 -7
  151. package/docs/interfaces/ModelTVVideoPluginParameterType.html +5 -5
  152. package/docs/interfaces/ModelViewPluginExportType.html +10 -10
  153. package/docs/interfaces/Object3DHelperState.html +7 -7
  154. package/docs/interfaces/ObjectHelperControllers.html +8 -8
  155. package/docs/interfaces/PaintBrushAction.html +11 -11
  156. package/docs/interfaces/PaintBrushConfigs.html +11 -11
  157. package/docs/interfaces/PaintBrushState.html +9 -9
  158. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +9 -9
  159. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
  160. package/docs/interfaces/PanoMeasureParameterType.html +13 -13
  161. package/docs/interfaces/PanoMeasurePluginLineJson.html +7 -7
  162. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +6 -6
  163. package/docs/interfaces/PanoMeasurePluginPointJson.html +6 -6
  164. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +7 -7
  165. package/docs/interfaces/PanoRulerPluginExportType.html +9 -9
  166. package/docs/interfaces/PanoRulerPluginOptions.html +6 -6
  167. package/docs/interfaces/PanoRulerPluginParameterType.html +7 -7
  168. package/docs/interfaces/PanoRulerProPluginExportType.html +8 -8
  169. package/docs/interfaces/PanoRulerProPluginOptions.html +6 -6
  170. package/docs/interfaces/PanoRulerProPluginParameterType.html +6 -6
  171. package/docs/interfaces/PanoRulerProPluginState.html +7 -7
  172. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
  173. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
  174. package/docs/interfaces/PanoSpatialTagPluginData.html +10 -10
  175. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +9 -9
  176. package/docs/interfaces/PanoSpatialTagPluginExportType.html +12 -12
  177. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +9 -9
  178. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +12 -12
  179. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +10 -10
  180. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +9 -9
  181. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +5 -5
  182. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +7 -7
  183. package/docs/interfaces/PanoVideoPluginType.PluginData.html +5 -5
  184. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +8 -8
  185. package/docs/interfaces/PanoVideoPluginType.PluginState.html +5 -5
  186. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +7 -7
  187. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +9 -9
  188. package/docs/interfaces/Point.html +7 -7
  189. package/docs/interfaces/Room.html +8 -8
  190. package/docs/interfaces/RoomInfo.html +6 -6
  191. package/docs/interfaces/RoomLabel.html +13 -13
  192. package/docs/interfaces/RoomRules.html +4 -4
  193. package/docs/interfaces/Rooms.html +4 -4
  194. package/docs/interfaces/Scissor.html +8 -8
  195. package/docs/interfaces/State.html +7 -7
  196. package/docs/interfaces/TagCacheInterface.html +11 -11
  197. package/docs/interfaces/TagConfig.html +12 -12
  198. package/docs/interfaces/TagGLTFObjectGroup.html +5 -5
  199. package/docs/interfaces/TagIconUrl.html +11 -11
  200. package/docs/interfaces/TagObjectGroup.html +5 -5
  201. package/docs/interfaces/TagStyle.html +5 -5
  202. package/docs/interfaces/Tags.html +8 -8
  203. package/docs/interfaces/TemporaryState.html +5 -5
  204. package/docs/interfaces/Util.MagnifierParameter.html +10 -10
  205. package/docs/interfaces/Util.MouseGroupParameter.html +7 -7
  206. package/docs/modules/CruisePluginTypes.html +4 -4
  207. package/docs/modules/GuideLineItem.html +4 -4
  208. package/docs/modules/GuideLineModeItem.html +4 -4
  209. package/docs/modules/GuideLinePluginType.html +4 -4
  210. package/docs/modules/PanoVideoPluginType.html +4 -4
  211. package/docs/modules/Util.html +4 -4
  212. package/docs/modules.html +4 -4
  213. package/docs/types/ArrayPosition.html +4 -4
  214. package/docs/types/AudioAppearance.html +4 -4
  215. package/docs/types/AudioTagTypeConfigKey.html +4 -4
  216. package/docs/types/CSS3DRenderExportType.html +4 -4
  217. package/docs/types/CSS3DRenderPluginExportType.html +4 -4
  218. package/docs/types/CSS3DRenderPluginParameterType.html +4 -4
  219. package/docs/types/ClassFunctionParameters.html +4 -4
  220. package/docs/types/Color.html +4 -4
  221. package/docs/types/ContentTypeConfigKey.html +4 -4
  222. package/docs/types/ContentTypeConfigKeySplit.html +4 -4
  223. package/docs/types/ContentTypeMap.html +4 -4
  224. package/docs/types/Create3DDomContainerReturnType.html +4 -4
  225. package/docs/types/Create3DElementReturnType.html +4 -4
  226. package/docs/types/CruisePluginExportType.html +4 -4
  227. package/docs/types/CruisePluginTypes.CruiseData.html +4 -4
  228. package/docs/types/CruisePluginTypes.MoveEffect.html +4 -4
  229. package/docs/types/DeprecatedMediaPlaneProperty.html +4 -4
  230. package/docs/types/DeprecatedTagProperty.html +4 -4
  231. package/docs/types/Direction-1.html +4 -4
  232. package/docs/types/Direction4.html +4 -4
  233. package/docs/types/ElementRenderer.html +4 -4
  234. package/docs/types/FloorplanRuleLabels.html +4 -4
  235. package/docs/types/FloorplanServerRuleLabels.html +4 -4
  236. package/docs/types/GuideLinePluginExportType.html +4 -4
  237. package/docs/types/GuideLinePluginType.GuideLineItem.html +4 -4
  238. package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +4 -4
  239. package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +4 -4
  240. package/docs/types/GuideLinePluginType.GuideLineStyle.html +4 -4
  241. package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +4 -4
  242. package/docs/types/GuideLinePluginType.PathItem.html +4 -4
  243. package/docs/types/GuideLinePluginType.PluginData.html +4 -4
  244. package/docs/types/HelperEventMap.html +4 -4
  245. package/docs/types/LoadTagConfig.html +4 -4
  246. package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
  247. package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
  248. package/docs/types/MediaData.html +4 -4
  249. package/docs/types/MediaStore.html +4 -4
  250. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
  251. package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
  252. package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
  253. package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
  254. package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
  255. package/docs/types/MoveArgs.html +4 -4
  256. package/docs/types/MoveOpts.html +4 -4
  257. package/docs/types/Object3DHelperEventMap.html +4 -4
  258. package/docs/types/ObjectFit.html +4 -4
  259. package/docs/types/PaintBrushEventMap.html +4 -4
  260. package/docs/types/PanoCompassPluginData.html +4 -4
  261. package/docs/types/PanoCompassPluginExportType.html +4 -4
  262. package/docs/types/PanoCompassPluginParameterType.html +4 -4
  263. package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
  264. package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
  265. package/docs/types/PanoIndex.html +4 -4
  266. package/docs/types/PanoMeasurePluginEvent.html +4 -4
  267. package/docs/types/PanoMeasureReturnType.html +4 -4
  268. package/docs/types/PanoSpatialTagPluginId.html +4 -4
  269. package/docs/types/PanoTagPluginExportInterface.html +4 -4
  270. package/docs/types/PanoTagPluginParamsInterface.html +4 -4
  271. package/docs/types/PanoVideoPluginParameterType.html +4 -4
  272. package/docs/types/PanoVideoPluginReturnType.html +4 -4
  273. package/docs/types/PartialObjectDeep.html +4 -4
  274. package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +4 -4
  275. package/docs/types/PlaneTag.html +4 -4
  276. package/docs/types/Point2DTag.html +4 -4
  277. package/docs/types/Point3DTag.html +4 -4
  278. package/docs/types/PointTag.html +4 -4
  279. package/docs/types/PointTagInstance.html +4 -4
  280. package/docs/types/Position.html +4 -4
  281. package/docs/types/RotateArgs.html +4 -4
  282. package/docs/types/RotateOpts.html +4 -4
  283. package/docs/types/RuleLabelsKey.html +4 -4
  284. package/docs/types/RuleLabelsValue.html +4 -4
  285. package/docs/types/StickType.html +4 -4
  286. package/docs/types/Tag.html +4 -4
  287. package/docs/types/Tag2D.html +4 -4
  288. package/docs/types/Tag3D.html +4 -4
  289. package/docs/types/TagContentType.html +4 -4
  290. package/docs/types/TagDimensionType.html +4 -4
  291. package/docs/types/TagElement.html +4 -4
  292. package/docs/types/TagEvents.html +4 -4
  293. package/docs/types/TagGLTFObject.html +4 -4
  294. package/docs/types/TagHooks.html +4 -4
  295. package/docs/types/TagId.html +4 -4
  296. package/docs/types/TagInstance.html +4 -4
  297. package/docs/types/TagPointType.html +4 -4
  298. package/docs/types/TagRendererMap.html +4 -4
  299. package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
  300. package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
  301. package/docs/types/WorkCode.html +4 -4
  302. package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
  303. package/docs/variables/PLUGIN.html +4 -4
  304. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
  305. package/docs/variables/ROOM_TYPE_MAP.html +4 -4
  306. package/docs/variables/itemLabelPluginServerParams.html +4 -4
  307. package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
  308. package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
  309. package/libs/PanoCompassPlugin/Controller.js +1 -1
  310. package/libs/PanoCompassPlugin/typings.d.ts +1 -1
  311. package/libs/base/BasePlugin.d.ts +4 -4
  312. package/libs/base/BasePlugin.js +3 -3
  313. package/libs/base/BasePluginWithData.d.ts +2 -1
  314. package/libs/shared-utils/absoluteUrl.d.ts +2 -2
  315. package/libs/shared-utils/logger.js +1 -1
  316. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(ee,Ae){typeof exports=="object"&&typeof module!="undefined"?Ae(exports,require("@realsee/five"),require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("hammerjs"),require("@realsee/five/line"),require("three/examples/jsm/loaders/FBXLoader"),require("animejs"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","three/examples/jsm/renderers/CSS3DRenderer","hammerjs","@realsee/five/line","three/examples/jsm/loaders/FBXLoader","animejs","@realsee/five/gltf-loader"],Ae):(ee=typeof globalThis!="undefined"?globalThis:ee||self,Ae(ee.dnalogel={},ee.FiveSDK,ee.THREE,ee.CSS3DRenderer,ee.Hammer,ee.Line,ee.FBXLoader,ee.anime,ee.GLTFLoader))})(this,function(ee,Ae,_,On,Kt,lo,co,Vn,Rt){"use strict";var nP=Object.defineProperty,iP=Object.defineProperties;var oP=Object.getOwnPropertyDescriptors;var wu=Object.getOwnPropertySymbols;var sP=Object.prototype.hasOwnProperty,rP=Object.prototype.propertyIsEnumerable;var ja=(ee,Ae,_)=>Ae in ee?nP(ee,Ae,{enumerable:!0,configurable:!0,writable:!0,value:_}):ee[Ae]=_,W=(ee,Ae)=>{for(var _ in Ae||(Ae={}))sP.call(Ae,_)&&ja(ee,_,Ae[_]);if(wu)for(var _ of wu(Ae))rP.call(Ae,_)&&ja(ee,_,Ae[_]);return ee},Ie=(ee,Ae)=>iP(ee,oP(Ae));var f=(ee,Ae,_)=>(ja(ee,typeof Ae!="symbol"?Ae+"":Ae,_),_);var U=(ee,Ae,_)=>new Promise((On,Kt)=>{var lo=Rt=>{try{Vn(_.next(Rt))}catch(Pi){Kt(Pi)}},co=Rt=>{try{Vn(_.throw(Rt))}catch(Pi){Kt(Pi)}},Vn=Rt=>Rt.done?On(Rt.value):Promise.resolve(Rt.value).then(lo,co);Vn((_=_.apply(ee,Ae)).next())});function Pi(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const E=Pi(_);function Iu(){console.info("%c %c@realsee/dnalogel %cv2.20.9",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Cu(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const o=document.createElement("canvas");return o.width=e,o.height=n,o}})}function za(){}const Oa=()=>Promise.resolve(),Va={__queue:Promise.resolve()};function Pu(i=Oa){Va.__queue=Va.__queue.then(i).catch(Oa)}function ho(i,t,e){const n=i.x,o=i.y,s=Math.floor(n/t*1e4)/1e4,r=Math.floor(o/e*1e4)/1e4;return{x:s,y:r}}function xs(i,t,e){const{x:n,y:o}=i,s=n*t,r=o*e;return{x:s,y:r}}function uo(i){if(i.length<2)return{};const t=i.slice(-2),e=t[0],n={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:n}}function Eu(i,t,e=za){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const Mu=window,Ba=window.requestAnimationFrame||Mu.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function fo(i,t=0){t<=0?Ba(i):Ba(()=>fo(i,t-1))}var Ct=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return this.None(i)},Out:function(i){return this.None(i)},InOut:function(i){return this.None(i)}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var t=1.70158;return i===1?1:i*i*((t+1)*i-t)},Out:function(i){var t=1.70158;return i===0?0:--i*i*((t+1)*i+t)+1},InOut:function(i){var t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}}),Bounce:Object.freeze({In:function(i){return 1-Ct.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Ct.Bounce.In(i*2)*.5:Ct.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return Math.pow(t,i)},Out:function(t){return 1-Math.pow(1-t,i)},InOut:function(t){return t<.5?Math.pow(t*2,i)/2:(1-Math.pow(2-t*2,i))/2+.5}}}}),Bn=function(){return performance.now()},_a=function(){function i(){this._tweens={},this._tweensAddedDuringUpdate={}}return i.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},i.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},i.prototype.update=function(t,e){t===void 0&&(t=Bn()),e===void 0&&(e=!1);var n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<n.length;o++){var s=this._tweens[n[o]],r=!e;s&&s.update(t,r)===!1&&!e&&delete this._tweens[n[o]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),pn={Linear:function(i,t){var e=i.length-1,n=e*t,o=Math.floor(n),s=pn.Utils.Linear;return t<0?s(i[0],i[1],n):t>1?s(i[e],i[e-1],e-n):s(i[o],i[o+1>e?e:o+1],n-o)},Bezier:function(i,t){for(var e=0,n=i.length-1,o=Math.pow,s=pn.Utils.Bernstein,r=0;r<=n;r++)e+=o(1-t,n-r)*o(t,r)*i[r]*s(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,o=Math.floor(n),s=pn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(o=Math.floor(n=e*(1+t))),s(i[(o-1+e)%e],i[o],i[(o+1)%e],i[(o+2)%e],n-o)):t<0?i[0]-(s(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(s(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):s(i[o?o-1:0],i[o],i[e<o+1?e:o+1],i[e<o+2?e:o+2],n-o)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=pn.Utils.Factorial;return e(i)/e(t)/e(i-t)},Factorial:function(){var i=[1];return function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}}(),CatmullRom:function(i,t,e,n,o){var s=(e-i)*.5,r=(n-t)*.5,a=o*o,l=o*a;return(2*t-2*e+s+r)*l+(-3*t+3*e-2*s-r)*a+s*o+t}}},Ss=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Ls=new _a,mo=function(){function i(t,e){e===void 0&&(e=Ls),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ct.Linear.None,this._interpolationFunction=pn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ss.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},i.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},i.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},i.prototype.start=function(t,e){if(t===void 0&&(t=Bn()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var s in this._valuesEnd)o[s]=this._valuesEnd[s];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},i.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},i.prototype._setupProperties=function(t,e,n,o,s){for(var r in n){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(d){var h=n[r];if(h.length===0)continue;for(var u=[a],m=0,A=h.length;m<A;m+=1){var p=this._handleRelativeValue(a,h[m]);if(isNaN(p)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(p)}d&&(n[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var v=a;for(var b in v)e[r][b]=v[b];o[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var w={};for(var b in h)w[b]=h[b];n[r]=h=w}this._setupProperties(v,e[r],h,o[r],s)}else(typeof e[r]=="undefined"||s)&&(e[r]=a),l||(e[r]*=1),d?o[r]=n[r].slice().reverse():o[r]=e[r]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},i.prototype.pause=function(t){return t===void 0&&(t=Bn()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},i.prototype.resume=function(t){return t===void 0&&(t=Bn()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},i.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},i.prototype.group=function(t){return t===void 0&&(t=Ls),this._group=t,this},i.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},i.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},i.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},i.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},i.prototype.easing=function(t){return t===void 0&&(t=Ct.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=pn.Linear),this._interpolationFunction=t,this},i.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},i.prototype.onStart=function(t){return this._onStartCallback=t,this},i.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},i.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},i.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},i.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},i.prototype.onStop=function(t){return this._onStopCallback=t,this},i.prototype.update=function(t,e){if(t===void 0&&(t=Bn()),e===void 0&&(e=!0),this._isPaused)return!0;var n,o,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),o=(t-this._startTime)/this._duration,o=this._duration===0||o>1?1:o;var r=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),o===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(t,e,n,o){for(var s in n)if(e[s]!==void 0){var r=e[s]||0,a=n[s],l=Array.isArray(t[s]),c=Array.isArray(a),d=!l&&c;d?t[s]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[s],r,a,o):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[s]=r+(a-r)*o))}},i.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},i.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},i}(),ku="20.0.3",Du=Ss.nextId,Tt=Ls,xu=Tt.getAll.bind(Tt),Su=Tt.removeAll.bind(Tt),Lu=Tt.add.bind(Tt),Na=Tt.remove.bind(Tt),Tu=Tt.update.bind(Tt),Qa={Easing:Ct,Group:_a,Interpolation:pn,now:Bn,Sequence:Ss,nextId:Du,Tween:mo,VERSION:ku,getAll:xu,removeAll:Su,add:Lu,remove:Na,update:Tu};function ju(i,t,e,n=Ct.Linear.None){const o=new mo(i).to(t,e).easing(n).start();function s(r){o.update(r)&&requestAnimationFrame(s)}return requestAnimationFrame(s),o}var Gt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(Gt||{});const Ei=Symbol("$$PAINT_BRUSH_EVENT$$");function go(i){return i[Ei]||(i[Ei]={}),i[Ei]}function zu(i){i[Ei]||delete i[Ei]}let Ou=class{hasListener(t){const e=go(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const o=go(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){zu(this);return}const n=go(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=go(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function $t(){return((1+Math.random())*65536|0).toString(16).substring(1)}function lt(){return($t()+$t()+"-"+$t()+"-4"+$t().substr(0,3)+"-"+$t()+"-"+$t()+$t()+$t()).toLowerCase()}const Vu=`
1
+ (function(ee,Ae){typeof exports=="object"&&typeof module!="undefined"?Ae(exports,require("@realsee/five"),require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("hammerjs"),require("@realsee/five/line"),require("three/examples/jsm/loaders/FBXLoader"),require("animejs"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three","three/examples/jsm/renderers/CSS3DRenderer","hammerjs","@realsee/five/line","three/examples/jsm/loaders/FBXLoader","animejs","@realsee/five/gltf-loader"],Ae):(ee=typeof globalThis!="undefined"?globalThis:ee||self,Ae(ee.dnalogel={},ee.FiveSDK,ee.THREE,ee.CSS3DRenderer,ee.Hammer,ee.Line,ee.FBXLoader,ee.anime,ee.GLTFLoader))})(this,function(ee,Ae,_,On,Kt,lo,co,Vn,Rt){"use strict";var nP=Object.defineProperty,iP=Object.defineProperties;var oP=Object.getOwnPropertyDescriptors;var wu=Object.getOwnPropertySymbols;var sP=Object.prototype.hasOwnProperty,rP=Object.prototype.propertyIsEnumerable;var ja=(ee,Ae,_)=>Ae in ee?nP(ee,Ae,{enumerable:!0,configurable:!0,writable:!0,value:_}):ee[Ae]=_,W=(ee,Ae)=>{for(var _ in Ae||(Ae={}))sP.call(Ae,_)&&ja(ee,_,Ae[_]);if(wu)for(var _ of wu(Ae))rP.call(Ae,_)&&ja(ee,_,Ae[_]);return ee},Ie=(ee,Ae)=>iP(ee,oP(Ae));var f=(ee,Ae,_)=>(ja(ee,typeof Ae!="symbol"?Ae+"":Ae,_),_);var U=(ee,Ae,_)=>new Promise((On,Kt)=>{var lo=Rt=>{try{Vn(_.next(Rt))}catch(Pi){Kt(Pi)}},co=Rt=>{try{Vn(_.throw(Rt))}catch(Pi){Kt(Pi)}},Vn=Rt=>Rt.done?On(Rt.value):Promise.resolve(Rt.value).then(lo,co);Vn((_=_.apply(ee,Ae)).next())});function Pi(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const E=Pi(_);function Iu(){console.info("%c %c@realsee/dnalogel %cv2.20.10-dev.0",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function Cu(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const o=document.createElement("canvas");return o.width=e,o.height=n,o}})}function za(){}const Oa=()=>Promise.resolve(),Va={__queue:Promise.resolve()};function Pu(i=Oa){Va.__queue=Va.__queue.then(i).catch(Oa)}function ho(i,t,e){const n=i.x,o=i.y,s=Math.floor(n/t*1e4)/1e4,r=Math.floor(o/e*1e4)/1e4;return{x:s,y:r}}function xs(i,t,e){const{x:n,y:o}=i,s=n*t,r=o*e;return{x:s,y:r}}function uo(i){if(i.length<2)return{};const t=i.slice(-2),e=t[0],n={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:n}}function Eu(i,t,e=za){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const Mu=window,Ba=window.requestAnimationFrame||Mu.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function fo(i,t=0){t<=0?Ba(i):Ba(()=>fo(i,t-1))}var Ct=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return this.None(i)},Out:function(i){return this.None(i)},InOut:function(i){return this.None(i)}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var t=1.70158;return i===1?1:i*i*((t+1)*i-t)},Out:function(i){var t=1.70158;return i===0?0:--i*i*((t+1)*i+t)+1},InOut:function(i){var t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}}),Bounce:Object.freeze({In:function(i){return 1-Ct.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Ct.Bounce.In(i*2)*.5:Ct.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return Math.pow(t,i)},Out:function(t){return 1-Math.pow(1-t,i)},InOut:function(t){return t<.5?Math.pow(t*2,i)/2:(1-Math.pow(2-t*2,i))/2+.5}}}}),Bn=function(){return performance.now()},_a=function(){function i(){this._tweens={},this._tweensAddedDuringUpdate={}}return i.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},i.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},i.prototype.update=function(t,e){t===void 0&&(t=Bn()),e===void 0&&(e=!1);var n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<n.length;o++){var s=this._tweens[n[o]],r=!e;s&&s.update(t,r)===!1&&!e&&delete this._tweens[n[o]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),pn={Linear:function(i,t){var e=i.length-1,n=e*t,o=Math.floor(n),s=pn.Utils.Linear;return t<0?s(i[0],i[1],n):t>1?s(i[e],i[e-1],e-n):s(i[o],i[o+1>e?e:o+1],n-o)},Bezier:function(i,t){for(var e=0,n=i.length-1,o=Math.pow,s=pn.Utils.Bernstein,r=0;r<=n;r++)e+=o(1-t,n-r)*o(t,r)*i[r]*s(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,o=Math.floor(n),s=pn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(o=Math.floor(n=e*(1+t))),s(i[(o-1+e)%e],i[o],i[(o+1)%e],i[(o+2)%e],n-o)):t<0?i[0]-(s(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(s(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):s(i[o?o-1:0],i[o],i[e<o+1?e:o+1],i[e<o+2?e:o+2],n-o)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=pn.Utils.Factorial;return e(i)/e(t)/e(i-t)},Factorial:function(){var i=[1];return function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}}(),CatmullRom:function(i,t,e,n,o){var s=(e-i)*.5,r=(n-t)*.5,a=o*o,l=o*a;return(2*t-2*e+s+r)*l+(-3*t+3*e-2*s-r)*a+s*o+t}}},Ss=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Ls=new _a,mo=function(){function i(t,e){e===void 0&&(e=Ls),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ct.Linear.None,this._interpolationFunction=pn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ss.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},i.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},i.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},i.prototype.start=function(t,e){if(t===void 0&&(t=Bn()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var s in this._valuesEnd)o[s]=this._valuesEnd[s];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},i.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},i.prototype._setupProperties=function(t,e,n,o,s){for(var r in n){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(d){var h=n[r];if(h.length===0)continue;for(var u=[a],m=0,A=h.length;m<A;m+=1){var p=this._handleRelativeValue(a,h[m]);if(isNaN(p)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(p)}d&&(n[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var v=a;for(var b in v)e[r][b]=v[b];o[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var w={};for(var b in h)w[b]=h[b];n[r]=h=w}this._setupProperties(v,e[r],h,o[r],s)}else(typeof e[r]=="undefined"||s)&&(e[r]=a),l||(e[r]*=1),d?o[r]=n[r].slice().reverse():o[r]=e[r]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},i.prototype.pause=function(t){return t===void 0&&(t=Bn()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},i.prototype.resume=function(t){return t===void 0&&(t=Bn()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},i.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},i.prototype.group=function(t){return t===void 0&&(t=Ls),this._group=t,this},i.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},i.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},i.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},i.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},i.prototype.easing=function(t){return t===void 0&&(t=Ct.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=pn.Linear),this._interpolationFunction=t,this},i.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},i.prototype.onStart=function(t){return this._onStartCallback=t,this},i.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},i.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},i.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},i.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},i.prototype.onStop=function(t){return this._onStopCallback=t,this},i.prototype.update=function(t,e){if(t===void 0&&(t=Bn()),e===void 0&&(e=!0),this._isPaused)return!0;var n,o,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),o=(t-this._startTime)/this._duration,o=this._duration===0||o>1?1:o;var r=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),o===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(t,e,n,o){for(var s in n)if(e[s]!==void 0){var r=e[s]||0,a=n[s],l=Array.isArray(t[s]),c=Array.isArray(a),d=!l&&c;d?t[s]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[s],r,a,o):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[s]=r+(a-r)*o))}},i.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},i.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},i}(),ku="20.0.3",Du=Ss.nextId,Tt=Ls,xu=Tt.getAll.bind(Tt),Su=Tt.removeAll.bind(Tt),Lu=Tt.add.bind(Tt),Na=Tt.remove.bind(Tt),Tu=Tt.update.bind(Tt),Qa={Easing:Ct,Group:_a,Interpolation:pn,now:Bn,Sequence:Ss,nextId:Du,Tween:mo,VERSION:ku,getAll:xu,removeAll:Su,add:Lu,remove:Na,update:Tu};function ju(i,t,e,n=Ct.Linear.None){const o=new mo(i).to(t,e).easing(n).start();function s(r){o.update(r)&&requestAnimationFrame(s)}return requestAnimationFrame(s),o}var Gt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(Gt||{});const Ei=Symbol("$$PAINT_BRUSH_EVENT$$");function go(i){return i[Ei]||(i[Ei]={}),i[Ei]}function zu(i){i[Ei]||delete i[Ei]}let Ou=class{hasListener(t){const e=go(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const o=go(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){zu(this);return}const n=go(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=go(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function $t(){return((1+Math.random())*65536|0).toString(16).substring(1)}function lt(){return($t()+$t()+"-"+$t()+"-4"+$t().substr(0,3)+"-"+$t()+"-"+$t()+$t()+$t()).toLowerCase()}const Vu=`
2
2
  <style type="text/css">
3
3
 
4
4
  #_gl_paintBrush {
@@ -191,7 +191,7 @@ void main() {
191
191
  svg [type='lineItemGroup'] g g g g {
192
192
  stroke: #ffffff;
193
193
  }</style>
194
- `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Om extends de{constructor(t){super(),ce(this,t,zm,jm,le,{content:0},Tm)}}function Vm(i){me(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Bm(i){let t,e;return t=new Lm({props:{url:i[1].url}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function _m(i){let t,e;return t=new Om({props:{content:i[0]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Nm(i){let t,e,n,o;const s=[_m,Bm],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=T("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(he(),L(r[d],1,1,()=>{r[d]=null}),ue()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){o||(k(n),o=!0)},o(l){L(n),o=!1},d(l){l&&O(t),~e&&r[e].d()}}}function Qm(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Ol extends de{constructor(t){super(),ce(this,t,Qm,Nm,le,{floorIndex:2,floorplanData:3},Vm)}}function Rm(i){me(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Gm(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Mo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&O(n),o&&t.d()}}}function Wm(i){let t,e,n=i[1]&&Vl(i),o=i[0]&&Bl(i);return{c(){n&&n.c(),t=ie(),o&&o.c(),e=Ee()},m(s,r){n&&n.m(s,r),V(s,t,r),o&&o.m(s,r),V(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Vl(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Bl(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&O(t),o&&o.d(s),s&&O(e)}}}function Vl(i){let t,e=i[2].name+"",n;return{c(){t=T("span"),n=Oe(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){V(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Be(n,e)},d(o){o&&O(t)}}}function Bl(i){let t,e;return{c(){t=T("span"),e=Oe(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){V(n,t,o),B(t,e)},p(n,o){o&128&&Be(e,n[7])},d(n){n&&O(t)}}}function Fm(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Wm;if(a[8])return Gm}let s=o(i),r=s&&s(i);return{c(){t=T("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),j(t,"left",i[9]),j(t,"top",i[10]),j(t,"font-size",i[11]),j(t,"opacity",i[6]?"1":"0")},m(a,l){V(a,t,l),r&&r.m(t,null),e||(n=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[19]),Me(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:K,o:K,d(a){a&&O(t),r&&r.d(),e=!1,et(n)}}}function Hm(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Ym(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function v(Q,G){if(G.width===0||G.height===0)return()=>!1;const N=Q.path.map(({x:Ce,y:ve})=>[Ce,ve]),F=Q.roomLabel.position,{x:Z,y:X}=F,{width:q,height:ae}=G,se=q/2,ye=ae/2;return function(ve){const Ve=Z*ve,be=X*ve,Fe=N.map(([we,Te])=>[we*ve,Te*ve]);return[[Ve+se,be-ye],[Ve-se,be-ye],[Ve-se,be+ye],[Ve+se,be+ye]].every(we=>Hm(we,Fe))}}const b=document.body.clientWidth,w=document.body.clientHeight,P=h.roomLabel,M=P.positionInImage.x*100+"%",S=P.positionInImage.y*100+"%",C=(b<500||w<500?10:14)+"px";let z=0,x=0,Y=!1;u.subscribe(function(G){e(16,Y=!!G&&G.id===h.id)});const J=Q=>{e(4,z=Q.detail)},R=Q=>{e(5,x=Q.detail)};return i.$$set=Q=>{"pxmm"in Q&&e(12,l=Q.pxmm),"roomAreaEnable"in Q&&e(0,c=Q.roomAreaEnable),"roomNameEnable"in Q&&e(1,d=Q.roomNameEnable),"room"in Q&&e(2,h=Q.room),"hoveredRoom"in Q&&e(13,u=Q.hoveredRoom),"getRoomAreaText"in Q&&e(14,m=Q.getRoomAreaText),"getLabelElement"in Q&&e(3,A=Q.getLabelElement),"adaptiveRoomLabelVisibleEnable"in Q&&e(15,p=Q.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:z,height:x}),i.$$.dirty&262148&&e(17,r=s?v(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?Y?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,z,x,a,o,n,M,S,C,l,u,m,p,Y,r,s,J,R]}class Um extends de{constructor(t){super(),ce(this,t,Ym,Fm,le,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Rm)}}function Xm(i){me(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function _l(i,t,e){const n=i.slice();return n[12]=t[e],n}function Nl(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=_l(i,a,c),h=l(d);n.set(h,e[c]=Ql(h,d))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){V(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);o=!0,s||(r=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[11])],s=!0)},p(c,d){d&447&&(a=c[8],he(),e=kt(e,d,l,1,c,a,n,t,an,Ql,null,_l),ue())},i(c){if(!o){for(let d=0;d<a.length;d+=1)k(e[d]);o=!0}},o(c){for(let d=0;d<e.length;d+=1)L(e[d]);o=!1},d(c){c&&O(t);for(let d=0;d<e.length;d+=1)e[d].d();s=!1,et(r)}}}function Ql(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new Um({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&447?nt(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function Zm(i){let t,e,n=i[8]&&Nl(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&k(n,1)):(n=Nl(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function Jm(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const A=p=>{e(6,u=p.detail)};return i.$$set=p=>{"floorIndex"in p&&e(9,o=p.floorIndex),"roomAreaEnable"in p&&e(0,s=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,d=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:p,min:v}=a.bounding,b=p.x-v.x;e(7,m=u/b)}},[s,r,l,c,d,h,u,m,n,o,a,A]}class qm extends de{constructor(t){super(),ce(this,t,Jm,Zm,le,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Xm)}}function Km(i){me(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Rl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Gl(i,t,e){const n=i.slice();return n[14]=t[e],n}function Wl(i){let t;return{c(){t=T("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),j(t,"left",i[14].left*100+"%"),j(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:K,d(e){e&&O(t)}}}function Fl(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=T("div"),n=T("div"),s=Oe(o),r=ie(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),j(e,"left",t[11].left*100+"%"),j(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Be(s,o)},d(a){a&&O(e)}}}function $m(i){let t,e,n,o,s,r,a=[],l=new Map,c,d=i[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=Wl(Gl(i,d,A));let u=i[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=Rl(i,u,A),v=m(p);l.set(v,a[A]=Fl(v,p))}return{c(){t=T("div"),e=T("div"),n=ie(),o=T("div");for(let A=0;A<h.length;A+=1)h[A].c();s=ie(),r=T("div");for(let A=0;A<a.length;A+=1)a[A].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),$(t,"is-row",i[2]),j(t,"width",i[2]?"100%":1/16+"rem"),j(t,"height",i[2]?1/16+"rem":"100%")},m(A,p){V(A,t,p),B(t,e),B(t,n),B(t,o);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(o,null);B(t,s),B(t,r);for(let v=0;v<a.length;v+=1)a[v]&&a[v].m(r,null)},p(A,[p]){if(p&8){d=A[3];let v;for(v=0;v<d.length;v+=1){const b=Gl(A,d,v);h[v]?h[v].p(b,p):(h[v]=Wl(b),h[v].c(),h[v].m(o,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=d.length}p&22&&(u=A[4],a=kt(a,p,m,1,A,u,l,r,Xs,Fl,null,Rl)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&y(t,"class",c),p&5&&$(t,"is-row",A[2])},i:K,o:K,d(A){A&&O(t),Ft(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const oi=1e3,si=180;function eg(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(oi-si)*2,c=s.max.y-s.min.y-(oi-si)*2,d=o.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,v)=>p===0?!0:A!==v[p-1]),h=d.map(A=>{const p=a?(A-s.min.x-oi+si)/l:0,v=a?0:(A-s.min.y-oi+si)/c;return{left:p,bottom:v}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((A,p,v)=>{const b=p===0?0:A-v[p-1],w=p===0?0:(A+v[p-1])/2,P=a?(w-s.min.x-oi+si)/l:0,M=a?0:(w-s.min.y-oi+si)/c;return{left:P,bottom:M,distance:b}}).filter(({distance:A})=>A/u>.1);return i.$$set=A=>{"type"in A&&e(0,n=A.type),"data"in A&&e(5,o=A.data),"bounding"in A&&e(6,s=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,h,m,o,s]}class tg extends de{constructor(t){super(),ce(this,t,eg,$m,le,{type:0,data:5,bounding:6,getRuleDistanceText:1},Km)}}function ng(i){me(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Hl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Yl(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new tg({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&19?nt(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function ig(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Hl(i,s,a),c=r(l);n.set(c,e[a]=Yl(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){V(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],he(),e=kt(e,l,r,1,a,s,n,t,an,Yl,null,Hl),ue()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);o=!1},d(a){a&&O(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Ul=1e3,Xl=180;function og(i,t,e){let n,o,s,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return i.$$set=v=>{"floorIndex"in v&&e(5,m=v.floorIndex),"floorplanData"in v&&e(6,A=v.floorplanData),"getRuleDistanceText"in v&&e(0,p=v.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,o=A.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(v=>[v,o[v]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Ul-Xl)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(Ul-Xl)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[p,n,u,h,r,m,A,l,d,a,c,o,s]}class sg extends de{constructor(t){super(),ce(this,t,og,ig,le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},ng)}}function No(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):o!=null&&o[a]?(e+="A"+o[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Zl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function rg(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function ag(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function lg(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function cg(i){let t;return{c(){t=je("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:K,o:K,d(e){e&&O(t)}}}function dg(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=No(o,{needZ:!0}))},[n,o]}class hg extends de{constructor(t){super(),ce(this,t,dg,cg,le,{path:1})}}function ug(i){let t,e,n,o,s,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),o=je("path"),s=ie(),r=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),B(t,e),B(e,n),B(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:K,o:K,d(a){a&&O(t),a&&O(s),a&&O(r)}}}const Ks=6;function fg(i,t,e){let n,{path:o}=t;const s=Ks*2,r=`M0 ${Ks} h ${s} M${Ks} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=No(o,{needZ:!0}))},[n,s,r,o]}class mg extends de{constructor(t){super(),ce(this,t,fg,ug,le,{path:3})}}function gg(i){let t,e,n,o,s,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),o=je("pattern"),s=je("rect"),r=ie(),a=je("path"),l=ie(),c=je("path"),d=ie(),h=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(h,"d",i[0]),y(h,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),B(t,e),B(e,n),B(t,o),B(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,d,m),V(u,h,m)},p(u,[m]){m&1&&y(a,"d",u[0]),m&1&&y(c,"d",u[0]),m&1&&y(h,"d",u[0])},i:K,o:K,d(u){u&&O(t),u&&O(r),u&&O(a),u&&O(l),u&&O(c),u&&O(d),u&&O(h)}}}function pg(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=No(o,{needZ:!0}))},[n,o]}class Ag extends de{constructor(t){super(),ce(this,t,pg,gg,le,{path:1})}}function vg(i){me(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Jl(i,t,e){const n=i.slice();return n[5]=t[e],n}function bg(i){let t,e;return t=new mg({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function yg(i){let t,e;return t=new Ag({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wg(i){let t,e;return t=new hg({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ql(i){let t,e,n,o;const s=[wg,yg,bg],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=je("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(he(),L(r[d],1,1,()=>{r[d]=null}),ue(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null))},i(l){o||(k(n),o=!0)},o(l){L(n),o=!1},d(l){l&&O(t),r[e].d()}}}function Ig(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ql(Jl(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Jl(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=ql(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&O(t),Ft(o,r)}}}function Cg(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>Ie(W({},l),{path:l.path.map(c=>Zl(c,s.bounding))})))},[n,r,a,o,s]}class Pg extends de{constructor(t){super(),ce(this,t,Cg,Ig,le,{floorIndex:3,floorplanData:4},vg)}}function Eg(i){me(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Mg(i){let t,e,n,o;return{c(){t=je("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){V(s,t,r),n||(o=[Me(t,"mouseenter",i[3]),Me(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:K,o:K,d(s){s&&O(t),n=!1,et(o)}}}function kg(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(s)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=No(s.path,{needZ:!0,format:A=>Zl(A,u)});return i.$$set=A=>{"room"in A&&e(0,s=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"highlightData"in A&&e(7,l=A.highlightData),"hoveredRoom"in A&&e(8,c=A.hoveredRoom)},i.$$.update=()=>{i.$$.dirty&131&&e(9,n=l[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,d,h,m,a,l,c,n]}class Dg extends de{constructor(t){super(),ce(this,t,kg,Mg,le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},Eg)}}function xg(i){me(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Kl(i,t,e){const n=i.slice();return n[6]=t[e],n}function $l(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new Dg({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&15?nt(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function Sg(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Kl(i,r,l),d=a(c);o.set(d,n[l]=$l(d,c))}return{c(){t=T("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),B(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,he(),n=kt(n,c,a,1,l,r,o,e,an,$l,null,Kl),ue())},i(l){if(!s){for(let c=0;c<r.length;c+=1)k(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)L(n[c]);s=!1},d(l){l&&O(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Lg(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{highlightData:s}=t,{hoveredRoom:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"highlightData"in c&&e(2,s=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,o,s,r,a,l]}class ec extends de{constructor(t){super(),ce(this,t,Lg,Sg,le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},xg)}}function Tg(i){me(i,"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}")}function tc(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ec({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&24834?nt(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function nc(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new qm({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&22370?nt(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function ic(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new sg({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2306?nt(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function jg(i){let t,e,n,o,s,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Ze(h,d[b]);e=new Pg({props:h});let u=(i[2]||i[3])&&tc(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let b=0;b<m.length;b+=1)A=Ze(A,m[b]);s=new Ol({props:A});let p=i[4]&&nc(i),v=i[7]&&ic(i);return{c(){t=T("div"),oe(e.$$.fragment),n=ie(),u&&u.c(),o=ie(),oe(s.$$.fragment),r=ie(),p&&p.c(),a=ie(),v&&v.c(),y(t,"class",l=Ne(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,w){V(b,t,w),te(e,t,null),B(t,n),u&&u.m(t,null),B(t,o),te(s,t,null),B(t,r),p&&p.m(t,null),B(t,a),v&&v.m(t,null),c=!0},p(b,[w]){const P=w&258?nt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(P),b[2]||b[3]?u?(u.p(b,w),w&12&&k(u,1)):(u=tc(b),u.c(),k(u,1),u.m(t,o)):u&&(he(),L(u,1,1,()=>{u=null}),ue());const M=w&258?nt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};s.$set(M),b[4]?p?(p.p(b,w),w&16&&k(p,1)):(p=nc(b),p.c(),k(p,1),p.m(t,a)):p&&(he(),L(p,1,1,()=>{p=null}),ue()),b[7]?v?(v.p(b,w),w&128&&k(v,1)):(v=ic(b),v.c(),k(v,1),v.m(t,null)):v&&(he(),L(v,1,1,()=>{v=null}),ue()),(!c||w&1&&l!==(l=Ne(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(b){c||(k(e.$$.fragment,b),k(u),k(s.$$.fragment,b),k(p),k(v),c=!0)},o(b){L(e.$$.fragment,b),L(u),L(s.$$.fragment,b),L(p),L(v),c=!1},d(b){b&&O(t),ne(e),u&&u.d(),ne(s),p&&p.d(),v&&v.d()}}}function zg(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:v}=t;const b=qs(void 0);return i.$$set=w=>{"isCurrent"in w&&e(0,n=w.isCurrent),"floorIndex"in w&&e(1,o=w.floorIndex),"highlightEnable"in w&&e(2,s=w.highlightEnable),"hoverEnable"in w&&e(3,r=w.hoverEnable),"roomLabelsEnable"in w&&e(4,a=w.roomLabelsEnable),"roomAreaEnable"in w&&e(5,l=w.roomAreaEnable),"roomNameEnable"in w&&e(6,c=w.roomNameEnable),"ruleLabelsEnable"in w&&e(7,d=w.ruleLabelsEnable),"floorplanData"in w&&e(8,h=w.floorplanData),"getRoomAreaText"in w&&e(9,u=w.getRoomAreaText),"getLabelElement"in w&&e(10,m=w.getLabelElement),"getRuleDistanceText"in w&&e(11,A=w.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in w&&e(12,p=w.adaptiveRoomLabelVisibleEnable),"highlightData"in w&&e(13,v=w.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,A,p,v,b]}let Og=class extends de{constructor(t){super(),ce(this,t,zg,jg,le,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Tg)}};function Vg(i){me(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function oc(i,t,e){const n=i.slice();return n[21]=t[e],n}function sc(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=rc(oc(i,r,h));const l=h=>L(a[h],1,1,()=>{a[h]=null});let c=i[5]&&ac(i),d=i[8]&&lc(i);return{c(){t=T("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ie(),c&&c.c(),n=ie(),d&&d.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,u){V(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);B(t,e),c&&c.m(t,null),B(t,n),d&&d.m(t,null),s=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=oc(i,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=rc(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(he(),m=r.length;m<a.length;m+=1)l(m);ue()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=ac(i),c.c(),k(c,1),c.m(t,n)):c&&(he(),L(c,1,1,()=>{c=null}),ue()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=lc(i),d.c(),k(d,1),d.m(t,null)):d&&(he(),L(d,1,1,()=>{d=null}),ue())},i(h){if(!s){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),o||tt(()=>{o=vn(t,bn,{duration:i[0],easing:tn}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)L(a[u]);L(c),L(d),s=!1},d(h){h&&O(t),Ft(a,h),c&&c.d(),d&&d.d()}}}function rc(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new Og({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2047696?nt(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function ac(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ym({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&57352?nt(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function lc(i){let t,e;return t=new km({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Bg(i){let t,e,n=i[1]&&sc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=sc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function _g(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:p}=t,{floorplanData:v}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:w}=t,{getRoomAreaText:P}=t,{getLabelElement:M}=t,{getRuleDistanceText:S}=t,{adaptiveRoomLabelVisibleEnable:C}=t,{highlightData:z}=t;return i.$$set=x=>{"duration"in x&&e(0,n=x.duration),"visible"in x&&e(1,o=x.visible),"northDesc"in x&&e(2,s=x.northDesc),"panoIndex"in x&&e(3,r=x.panoIndex),"floorIndex"in x&&e(4,a=x.floorIndex),"cameraEnable"in x&&e(5,l=x.cameraEnable),"hoverEnable"in x&&e(6,c=x.hoverEnable),"highlightEnable"in x&&e(7,d=x.highlightEnable),"compassEnable"in x&&e(8,h=x.compassEnable),"roomLabelsEnable"in x&&e(9,u=x.roomLabelsEnable),"roomAreaEnable"in x&&e(10,m=x.roomAreaEnable),"roomNameEnable"in x&&e(11,A=x.roomNameEnable),"ruleLabelsEnable"in x&&e(12,p=x.ruleLabelsEnable),"floorplanData"in x&&e(13,v=x.floorplanData),"lastPanoramaLongitude"in x&&e(14,b=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(15,w=x.cameraImageUrl),"getRoomAreaText"in x&&e(16,P=x.getRoomAreaText),"getLabelElement"in x&&e(17,M=x.getLabelElement),"getRuleDistanceText"in x&&e(18,S=x.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in x&&e(19,C=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,z=x.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,A,p,v,b,w,P,M,S,C,z]}let $s=class extends de{constructor(t){super(),ce(this,t,_g,Bg,le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Vg)}};const Ng="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Qg(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return U(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Rg(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Gg(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Rg),rules:i.rules}}function Wg(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Fg(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function dn(i){return U(this,null,function*(){const t=yield Qg(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Gg),o=i.computed_data.entrance?Fg(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Wg)}})}function Hg(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Ng,width:45,height:48},a=lg(s,t),l=rg(s,e),c=ag(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Yg(i,t){return t(i),i}function Qo(i,t){return Yg({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function cc(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function er(i,t,e=ln.BOUNDING_CENTER){const n=cc(i,t),o=cc(i,t+1);return e===ln.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===ln.CEILING?o:n}function tr(i,t,e,n){const o=er(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let ji=class{constructor(t,e){f(this,"VERSION","2.20.9");f(this,"five");f(this,"hooks",new _n);f(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}absoluteUrl(t){return Vs(this.staticPrefix,t)}},yn=class extends ji{};var At=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(At||{});const dc=500,Ug=80;function nr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function ir(i,t){return U(this,null,function*(){const[e]=yield ti(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const o=i.getCurrentState();if(!Xg(n,o))throw new Error("pose 与预期不符")})}function Xg(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const o=i[e];return typeof n=="number"&&typeof o=="number"?nr(n,o,2):n===o})}function or(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!nr(e,s,2)||!nr(n,r,2)||o!==a)}function hc(i,t,e=!0){return U(this,null,function*(){if(or(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[d]=yield ti(ir(i,[t.mode,t,void 0,e]));if(d)throw new Error(At.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(At.UpdateCameraError)})}function ri(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Zg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Jg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let qg=class extends yn{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>U(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!or(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,At.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(At.ModelNotLoaded);if(!this.data)throw new Error(At.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(hc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(At.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:dc;ri(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,At.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Jg(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Zg(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Ug/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const Kg=(i,t)=>new qg(i,t);function $g(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function ep(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let tp=class extends yn{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>U(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!or(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,At.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(At.ModelNotLoaded);if(!this.data)throw new Error(At.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(hc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(At.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:dc;ri(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,At.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),$g(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(ep(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=er(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const np=(i,t)=>new tp(i,t);let ip=class extends yn{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=er(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_show(e){return U(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield ir(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;ri(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return U(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;ri(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const op=(i,t)=>new ip(i,t);function sr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function sp(i){me(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function rp(i){let t,e,n;return{c(){t=T("div"),e=T("div"),n=T("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||cn)+")"),j(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){V(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&j(n,"background-image","url("+(o[0]||cn)+")"),(s&1||s&3)&&j(n,"transform",o[1]),s&4&&j(e,"transform",o[2])},i:K,o:K,d(o){o&&O(t)}}}function ap(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function lp(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,d=s.getCurrentState().longitude;function h(A,p){const v=A.bounding,b=A.observers[p];if(!b)return"";const w=(v.max.x-v.min.x)*r,P=(v.max.y-v.min.y)*r,M=Math.floor(b.positionInImage.x*w),S=Math.floor(b.positionInImage.y*P);return`translate(${M}px, ${S}px)`}function u(A){e(6,c=A)}const m=sr(A=>{e(7,d=A.longitude)},1e3/60);return Mt(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,s=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=ap(d))},[l,o,n,s,r,a,c,d]}class cp extends de{constructor(t){super(),ce(this,t,lp,rp,le,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},sp)}}function dp(i){me(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function uc(i,t,e){const n=i.slice();return n[1]=t[e],n}function fc(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=T("div"),n=T("div"),r=ie(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",o),j(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),j(e,"top",a),j(e,"left",l),this.first=e},m(c,d){V(c,e,d),B(e,n),B(e,r)},p(c,d){t=c,d&1&&j(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&j(n,"width",o),h&&j(n,"height",s),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&j(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&j(e,"left",l)},d(c){c&&O(e)}}}function hp(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=uc(i,o,r),l=s(a);n.set(l,e[r]=fc(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=kt(e,a,s,1,r,o,n,t,Xs,fc,null,uc))},i:K,o:K,d(r){r&&O(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function up(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class fp extends de{constructor(t){super(),ce(this,t,up,hp,le,{extraObjects:0},dp)}}function mc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5],hoveredRoom:void 0}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ec({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&183?nt(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5],hoveredRoom:void 0}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function mp(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Ze(l,a[d]);t=new Ol({props:l}),n=new fp({props:{extraObjects:i[6]}});let c=i[3]&&mc(i);return{c(){oe(t.$$.fragment),e=ie(),oe(n.$$.fragment),o=ie(),c&&c.c(),s=Ee()},m(d,h){te(t,d,h),V(d,e,h),te(n,d,h),V(d,o,h),c&&c.m(d,h),V(d,s,h),r=!0},p(d,[h]){const u=h&20?nt(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),n.$set(m),d[3]?c?(c.p(d,h),h&8&&k(c,1)):(c=mc(d),c.c(),k(c,1),c.m(s.parentNode,s)):c&&(he(),L(c,1,1,()=>{c=null}),ue())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){L(t.$$.fragment,d),L(n.$$.fragment,d),L(c),r=!1},d(d){ne(t,d),d&&O(e),ne(n,d),d&&O(o),c&&c.d(d),d&&O(s)}}}function gp(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,o=u.five),"pxmm"in u&&e(1,s=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[o,s,r,a,l,d,n,h,c]}class pp extends de{constructor(t){super(),ce(this,t,gp,mp,le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Ap(i){me(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function gc(i){let t,e,n,o,s=i[7]!==0&&pc(i);return{c(){t=T("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){V(r,t,a),s&&s.m(t,null),e=!0,n||(o=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[13]),Me(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&k(s,1)):(s=pc(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),L(s,1,1,()=>{s=null}),ue())},i(r){e||(k(s),e=!0)},o(r){L(s),e=!1},d(r){r&&O(t),s&&s.d(),n=!1,et(o)}}}function pc(i){let t,e,n,o,s=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Ze(c,l[u]);e=new pp({props:c});const d=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let u=0;u<d.length;u+=1)h=Ze(h,d[u]);return o=new cp({props:h}),{c(){t=T("div"),oe(e.$$.fragment),n=ie(),oe(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",s),j(t,"height",r)},m(u,m){V(u,t,m),te(e,t,null),B(t,n),te(o,t,null),a=!0},p(u,m){const A=m&3181?nt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(A);const p=m&1049?nt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(p),m&512&&s!==(s=`${u[9]}px`)&&j(t,"width",s),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(o.$$.fragment,u),a=!0)},o(u){L(e.$$.fragment,u),L(o.$$.fragment,u),a=!1},d(u){u&&O(t),ne(e),ne(o)}}}function vp(i){let t,e,n=i[1]&&gc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=gc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function bp(i,t,e){var P,M;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(P=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function v(S){e(11,h=n.work.observers[S].floorIndex)}Mt(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));const b=S=>{e(7,u=S.detail)},w=S=>{e(8,m=S.detail)};return i.$$set=S=>{"five"in S&&e(0,n=S.five),"visible"in S&&e(1,o=S.visible),"hoverEnable"in S&&e(2,s=S.hoverEnable),"floorplanData"in S&&e(3,r=S.floorplanData),"cameraImageUrl"in S&&e(4,a=S.cameraImageUrl),"extraObjects"in S&&e(5,l=S.extraObjects),"highlightData"in S&&e(6,c=S.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const S=Math.min(u,m),{max:C,min:z}=r.bounding,x=C.x-z.x,Y=C.y-z.y,J=function(){return x>Y?[S,S/x*Y]:[S/Y*x,S]}();e(9,A=J[0]),e(12,p=J[1]),e(10,d=A/x)}},[n,o,s,r,a,l,c,u,m,A,d,h,p,b,w]}class yp extends de{constructor(t){super(),ce(this,t,bp,vp,le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Ap)}}let wp=class extends yn{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:cn},s=n!=null&&n.configs?n.configs:{},r=W(W({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return U(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield dn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Hg(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=W(W({},this.state),e),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=Ie(W({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new yp({target:this.wrapper,props:e})}};const Ip=(i,t)=>new wp(i,t),Cp=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Pp=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Ep=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],rr=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Mp=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(rr(o,0,0)),s&&i.applyMatrix4(rr(0,s,0)),r&&i.applyMatrix4(rr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Ac(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=W({map:o.material.map||{}},t);o.material=new _.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const kp=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,o={},s=h=>U(this,null,function*(){var Q;const u=(h==null?void 0:h.fbx_url)||e,m=(Q=h==null?void 0:h.north_rad)!=null?Q:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=i.model.bounding,p=A.max.x-A.min.x,v=A.max.z-A.min.z,b=Math.max(p,v),P=yield new co.FBXLoader().loadAsync(u);Ac(P,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const M=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:S,z:C},min:{x:z,y:x,z:Y}}}}=i;o.yBase=x;const J={x:(S+z)/2,y:x-1.6,z:(C+Y)/2},R=.0045*b;return Mp(P,{position:J,rotation:M,scale:R}),o.object=P,!0}),r=({latitude:h})=>{if(!o.object)return;const u=a(h);u&&(o.object.position.y=u)},a=h=>{if(o.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return o.yBase-(u+1.6);const m=h*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{o.object&&(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Dp(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new _.CanvasTexture(a)}const xp=({x:i,y:t,z:e})=>new _.Vector3(i,t,e),Sp=(i,t)=>{var p,v,b;const e={},n=(p=t.animationEnabled)!=null?p:!0,o=(v=t.position)!=null?v:void 0,s=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>U(this,null,function*(){var J,R,Q,G,N,F,Z,X;const P=(J=w==null?void 0:w.position)!=null?J:o;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=xp(P),S=(R=w==null?void 0:w.rad)!=null?R:s,C=(Q=w==null?void 0:w.fbx_url)!=null?Q:r;if(e.rad=S,S===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${S}`));const z=yield new co.FBXLoader().loadAsync(C);z.position.copy(M),z.rotation.z=S,z.scale.set(.8,.8,.8),Ac(z,{transparent:!0,side:E.DoubleSide});const x=(Z=(F=(N=(G=z.children)==null?void 0:G[0])==null?void 0:N.children)==null?void 0:F[3])==null?void 0:Z.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Y=(X=t.name)!=null?X:"入户门";return x.material=new _.MeshBasicMaterial({transparent:!0,map:Dp(Y)}),x.renderOrder=3,z.children[0].add(x),e.object=z,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,P=new _.AnimationMixer(e.object);a.push(P);const M=P.clipAction(e.object.animations[0]);M.timeScale=w;let S;const C=()=>{let J=0,R=0;const Q=1e3/30,G=N=>{J=requestAnimationFrame(G);const F=N-R;F<Q||(R=N,a.forEach(Z=>Z.update(F/1e3)),i.needsRender=!0)};return J=requestAnimationFrame(G),()=>{cancelAnimationFrame(J)}},Y={play:()=>{S||(M.play(),S=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),S==null||S(),S=void 0}};e.animation=Y},d=w=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=w==null?void 0:w.animationEnable)!=null?M:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=w=>w==="Floorplan"?d():h();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},Lp=Ct;function Tp(i,t,e,n=Lp.Linear.None){const o=new mo(i).to(t,e).easing(n);wo(()=>o.start(0));const s=Si(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function jp(i,t){return Tp({progress:0},{progress:1},i,t)}var vc=(i=>(i.Move="Move",i.Rotate="Rotate",i))(vc||{}),zt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(zt||{});const Ro=Math.PI*2;function bc(i){return(i%Ro+Ro)%Ro}function yc(i){return i%Ro}function ar(i,t,e){return i+(t-i)*e}const lr=(i,t,e)=>{const n=Math.PI,o=n*2;let s=bc(i),r=bc(t);return e===zt.Anticlockwise&&s<r&&(s+=o),e===zt.Clockwise&&r<s&&(r+=o),e===zt.Loop&&r-s>n?lr(s,r,zt.Anticlockwise):e===zt.Loop&&s-r>n?lr(s,r,zt.Clockwise):{from:s,to:r}},zp=i=>{const t={},e=(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,u)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,W({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},s)):u(new Error("unexpected error"))})}),n=s=>{const r=i.state,a=yc(r.latitude),l=yc(s.latitude),{from:c,to:d}=lr(r.longitude,s.longitude,s.rotation||zt.Loop),h=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ae.Five.Mode.Panorama&&(yield i.changeMode(Ae.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,A)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(s);return yield new Promise(m=>{const A=({progress:P})=>{const M={};M.longitude=ar(h.longitude,u.longitude,P),M.latitude=ar(h.latitude,u.latitude,P),M.fov=ar(h.fov,u.fov,P),i.setState(M,!0)},p=()=>{m(!0)},v=()=>{m(!1)},b=s.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/s.rotateSpeed*1e3):r,w=jp(b,Ct.Linear.None).onUpdate(A).onComplete(p).onDestroy(v);s.rotation===zt.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function wc(i,t){return i.x===t.x&&i.y===t.y}function Ic(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Go(i,t){return(t.y-i.y)/(t.x-i.x)}function Cc(i,t,e){const n=Go(i[1],i[0]),o=Go(t[1],t[0]);if(isNaN(n)||isNaN(o)||Ic(n,o))return!1;if(Wo(i[0],t))return i[0];if(Wo(i[1],t))return i[1];if(Wo(t[0],i))return t[0];if(Wo(t[1],i))return t[1];if(e&&!Op(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Wo(i,t){return wc(i,t[0])||wc(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Ic(Go(t[0],i),Go(i,t[1]))}function Fo(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Op(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Fo(t[0],i[1],i[0])*Fo(i[1],t[1],i[0])>0&&Fo(i[0],t[1],t[0])*Fo(t[1],i[1],t[0])>0?1:0}function Pc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Pc(i,t-1))}const Vp=`<style type="text/css">
194
+ `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Om extends de{constructor(t){super(),ce(this,t,zm,jm,le,{content:0},Tm)}}function Vm(i){me(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Bm(i){let t,e;return t=new Lm({props:{url:i[1].url}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function _m(i){let t,e;return t=new Om({props:{content:i[0]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Nm(i){let t,e,n,o;const s=[_m,Bm],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=T("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(he(),L(r[d],1,1,()=>{r[d]=null}),ue()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){o||(k(n),o=!0)},o(l){L(n),o=!1},d(l){l&&O(t),~e&&r[e].d()}}}function Qm(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Ol extends de{constructor(t){super(),ce(this,t,Qm,Nm,le,{floorIndex:2,floorplanData:3},Vm)}}function Rm(i){me(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Gm(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Mo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&O(n),o&&t.d()}}}function Wm(i){let t,e,n=i[1]&&Vl(i),o=i[0]&&Bl(i);return{c(){n&&n.c(),t=ie(),o&&o.c(),e=Ee()},m(s,r){n&&n.m(s,r),V(s,t,r),o&&o.m(s,r),V(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Vl(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Bl(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&O(t),o&&o.d(s),s&&O(e)}}}function Vl(i){let t,e=i[2].name+"",n;return{c(){t=T("span"),n=Oe(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){V(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Be(n,e)},d(o){o&&O(t)}}}function Bl(i){let t,e;return{c(){t=T("span"),e=Oe(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){V(n,t,o),B(t,e)},p(n,o){o&128&&Be(e,n[7])},d(n){n&&O(t)}}}function Fm(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Wm;if(a[8])return Gm}let s=o(i),r=s&&s(i);return{c(){t=T("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),j(t,"left",i[9]),j(t,"top",i[10]),j(t,"font-size",i[11]),j(t,"opacity",i[6]?"1":"0")},m(a,l){V(a,t,l),r&&r.m(t,null),e||(n=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[19]),Me(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:K,o:K,d(a){a&&O(t),r&&r.d(),e=!1,et(n)}}}function Hm(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Ym(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function v(Q,G){if(G.width===0||G.height===0)return()=>!1;const N=Q.path.map(({x:Ce,y:ve})=>[Ce,ve]),F=Q.roomLabel.position,{x:Z,y:X}=F,{width:q,height:ae}=G,se=q/2,ye=ae/2;return function(ve){const Ve=Z*ve,be=X*ve,Fe=N.map(([we,Te])=>[we*ve,Te*ve]);return[[Ve+se,be-ye],[Ve-se,be-ye],[Ve-se,be+ye],[Ve+se,be+ye]].every(we=>Hm(we,Fe))}}const b=document.body.clientWidth,w=document.body.clientHeight,P=h.roomLabel,M=P.positionInImage.x*100+"%",S=P.positionInImage.y*100+"%",C=(b<500||w<500?10:14)+"px";let z=0,x=0,Y=!1;u.subscribe(function(G){e(16,Y=!!G&&G.id===h.id)});const J=Q=>{e(4,z=Q.detail)},R=Q=>{e(5,x=Q.detail)};return i.$$set=Q=>{"pxmm"in Q&&e(12,l=Q.pxmm),"roomAreaEnable"in Q&&e(0,c=Q.roomAreaEnable),"roomNameEnable"in Q&&e(1,d=Q.roomNameEnable),"room"in Q&&e(2,h=Q.room),"hoveredRoom"in Q&&e(13,u=Q.hoveredRoom),"getRoomAreaText"in Q&&e(14,m=Q.getRoomAreaText),"getLabelElement"in Q&&e(3,A=Q.getLabelElement),"adaptiveRoomLabelVisibleEnable"in Q&&e(15,p=Q.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:z,height:x}),i.$$.dirty&262148&&e(17,r=s?v(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?Y?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,z,x,a,o,n,M,S,C,l,u,m,p,Y,r,s,J,R]}class Um extends de{constructor(t){super(),ce(this,t,Ym,Fm,le,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Rm)}}function Xm(i){me(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function _l(i,t,e){const n=i.slice();return n[12]=t[e],n}function Nl(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=_l(i,a,c),h=l(d);n.set(h,e[c]=Ql(h,d))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){V(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);o=!0,s||(r=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[11])],s=!0)},p(c,d){d&447&&(a=c[8],he(),e=kt(e,d,l,1,c,a,n,t,an,Ql,null,_l),ue())},i(c){if(!o){for(let d=0;d<a.length;d+=1)k(e[d]);o=!0}},o(c){for(let d=0;d<e.length;d+=1)L(e[d]);o=!1},d(c){c&&O(t);for(let d=0;d<e.length;d+=1)e[d].d();s=!1,et(r)}}}function Ql(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new Um({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&447?nt(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function Zm(i){let t,e,n=i[8]&&Nl(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&k(n,1)):(n=Nl(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function Jm(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const A=p=>{e(6,u=p.detail)};return i.$$set=p=>{"floorIndex"in p&&e(9,o=p.floorIndex),"roomAreaEnable"in p&&e(0,s=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,d=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:p,min:v}=a.bounding,b=p.x-v.x;e(7,m=u/b)}},[s,r,l,c,d,h,u,m,n,o,a,A]}class qm extends de{constructor(t){super(),ce(this,t,Jm,Zm,le,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Xm)}}function Km(i){me(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Rl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Gl(i,t,e){const n=i.slice();return n[14]=t[e],n}function Wl(i){let t;return{c(){t=T("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),j(t,"left",i[14].left*100+"%"),j(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:K,d(e){e&&O(t)}}}function Fl(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=T("div"),n=T("div"),s=Oe(o),r=ie(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),j(e,"left",t[11].left*100+"%"),j(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Be(s,o)},d(a){a&&O(e)}}}function $m(i){let t,e,n,o,s,r,a=[],l=new Map,c,d=i[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=Wl(Gl(i,d,A));let u=i[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=Rl(i,u,A),v=m(p);l.set(v,a[A]=Fl(v,p))}return{c(){t=T("div"),e=T("div"),n=ie(),o=T("div");for(let A=0;A<h.length;A+=1)h[A].c();s=ie(),r=T("div");for(let A=0;A<a.length;A+=1)a[A].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),$(t,"is-row",i[2]),j(t,"width",i[2]?"100%":1/16+"rem"),j(t,"height",i[2]?1/16+"rem":"100%")},m(A,p){V(A,t,p),B(t,e),B(t,n),B(t,o);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(o,null);B(t,s),B(t,r);for(let v=0;v<a.length;v+=1)a[v]&&a[v].m(r,null)},p(A,[p]){if(p&8){d=A[3];let v;for(v=0;v<d.length;v+=1){const b=Gl(A,d,v);h[v]?h[v].p(b,p):(h[v]=Wl(b),h[v].c(),h[v].m(o,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=d.length}p&22&&(u=A[4],a=kt(a,p,m,1,A,u,l,r,Xs,Fl,null,Rl)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&y(t,"class",c),p&5&&$(t,"is-row",A[2])},i:K,o:K,d(A){A&&O(t),Ft(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const oi=1e3,si=180;function eg(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(oi-si)*2,c=s.max.y-s.min.y-(oi-si)*2,d=o.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,v)=>p===0?!0:A!==v[p-1]),h=d.map(A=>{const p=a?(A-s.min.x-oi+si)/l:0,v=a?0:(A-s.min.y-oi+si)/c;return{left:p,bottom:v}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((A,p,v)=>{const b=p===0?0:A-v[p-1],w=p===0?0:(A+v[p-1])/2,P=a?(w-s.min.x-oi+si)/l:0,M=a?0:(w-s.min.y-oi+si)/c;return{left:P,bottom:M,distance:b}}).filter(({distance:A})=>A/u>.1);return i.$$set=A=>{"type"in A&&e(0,n=A.type),"data"in A&&e(5,o=A.data),"bounding"in A&&e(6,s=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,h,m,o,s]}class tg extends de{constructor(t){super(),ce(this,t,eg,$m,le,{type:0,data:5,bounding:6,getRuleDistanceText:1},Km)}}function ng(i){me(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Hl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Yl(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new tg({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&19?nt(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function ig(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Hl(i,s,a),c=r(l);n.set(c,e[a]=Yl(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){V(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],he(),e=kt(e,l,r,1,a,s,n,t,an,Yl,null,Hl),ue()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);o=!1},d(a){a&&O(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Ul=1e3,Xl=180;function og(i,t,e){let n,o,s,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return i.$$set=v=>{"floorIndex"in v&&e(5,m=v.floorIndex),"floorplanData"in v&&e(6,A=v.floorplanData),"getRuleDistanceText"in v&&e(0,p=v.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,o=A.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(v=>[v,o[v]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Ul-Xl)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(Ul-Xl)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[p,n,u,h,r,m,A,l,d,a,c,o,s]}class sg extends de{constructor(t){super(),ce(this,t,og,ig,le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},ng)}}function No(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):o!=null&&o[a]?(e+="A"+o[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Zl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function rg(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function ag(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function lg(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function cg(i){let t;return{c(){t=je("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:K,o:K,d(e){e&&O(t)}}}function dg(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=No(o,{needZ:!0}))},[n,o]}class hg extends de{constructor(t){super(),ce(this,t,dg,cg,le,{path:1})}}function ug(i){let t,e,n,o,s,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),o=je("path"),s=ie(),r=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),B(t,e),B(e,n),B(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:K,o:K,d(a){a&&O(t),a&&O(s),a&&O(r)}}}const Ks=6;function fg(i,t,e){let n,{path:o}=t;const s=Ks*2,r=`M0 ${Ks} h ${s} M${Ks} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=No(o,{needZ:!0}))},[n,s,r,o]}class mg extends de{constructor(t){super(),ce(this,t,fg,ug,le,{path:3})}}function gg(i){let t,e,n,o,s,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),o=je("pattern"),s=je("rect"),r=ie(),a=je("path"),l=ie(),c=je("path"),d=ie(),h=je("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(h,"d",i[0]),y(h,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),B(t,e),B(e,n),B(t,o),B(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,d,m),V(u,h,m)},p(u,[m]){m&1&&y(a,"d",u[0]),m&1&&y(c,"d",u[0]),m&1&&y(h,"d",u[0])},i:K,o:K,d(u){u&&O(t),u&&O(r),u&&O(a),u&&O(l),u&&O(c),u&&O(d),u&&O(h)}}}function pg(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=No(o,{needZ:!0}))},[n,o]}class Ag extends de{constructor(t){super(),ce(this,t,pg,gg,le,{path:1})}}function vg(i){me(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Jl(i,t,e){const n=i.slice();return n[5]=t[e],n}function bg(i){let t,e;return t=new mg({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function yg(i){let t,e;return t=new Ag({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wg(i){let t,e;return t=new hg({props:{path:i[5].path}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ql(i){let t,e,n,o;const s=[wg,yg,bg],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=je("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(he(),L(r[d],1,1,()=>{r[d]=null}),ue(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null))},i(l){o||(k(n),o=!0)},o(l){L(n),o=!1},d(l){l&&O(t),r[e].d()}}}function Ig(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ql(Jl(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Jl(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=ql(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&O(t),Ft(o,r)}}}function Cg(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>Ie(W({},l),{path:l.path.map(c=>Zl(c,s.bounding))})))},[n,r,a,o,s]}class Pg extends de{constructor(t){super(),ce(this,t,Cg,Ig,le,{floorIndex:3,floorplanData:4},vg)}}function Eg(i){me(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Mg(i){let t,e,n,o;return{c(){t=je("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){V(s,t,r),n||(o=[Me(t,"mouseenter",i[3]),Me(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:K,o:K,d(s){s&&O(t),n=!1,et(o)}}}function kg(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(s)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=No(s.path,{needZ:!0,format:A=>Zl(A,u)});return i.$$set=A=>{"room"in A&&e(0,s=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"highlightData"in A&&e(7,l=A.highlightData),"hoveredRoom"in A&&e(8,c=A.hoveredRoom)},i.$$.update=()=>{i.$$.dirty&131&&e(9,n=l[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,d,h,m,a,l,c,n]}class Dg extends de{constructor(t){super(),ce(this,t,kg,Mg,le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},Eg)}}function xg(i){me(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Kl(i,t,e){const n=i.slice();return n[6]=t[e],n}function $l(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=Ze(r,s[a]);return n=new Dg({props:r}),{key:i,first:null,c(){e=Ee(),oe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&15?nt(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&O(e),ne(n,a)}}}function Sg(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Kl(i,r,l),d=a(c);o.set(d,n[l]=$l(d,c))}return{c(){t=T("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),B(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,he(),n=kt(n,c,a,1,l,r,o,e,an,$l,null,Kl),ue())},i(l){if(!s){for(let c=0;c<r.length;c+=1)k(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)L(n[c]);s=!1},d(l){l&&O(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Lg(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{highlightData:s}=t,{hoveredRoom:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"highlightData"in c&&e(2,s=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,o,s,r,a,l]}class ec extends de{constructor(t){super(),ce(this,t,Lg,Sg,le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},xg)}}function Tg(i){me(i,"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}")}function tc(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ec({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&24834?nt(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function nc(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new qm({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&22370?nt(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function ic(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new sg({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2306?nt(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function jg(i){let t,e,n,o,s,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Ze(h,d[b]);e=new Pg({props:h});let u=(i[2]||i[3])&&tc(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let b=0;b<m.length;b+=1)A=Ze(A,m[b]);s=new Ol({props:A});let p=i[4]&&nc(i),v=i[7]&&ic(i);return{c(){t=T("div"),oe(e.$$.fragment),n=ie(),u&&u.c(),o=ie(),oe(s.$$.fragment),r=ie(),p&&p.c(),a=ie(),v&&v.c(),y(t,"class",l=Ne(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,w){V(b,t,w),te(e,t,null),B(t,n),u&&u.m(t,null),B(t,o),te(s,t,null),B(t,r),p&&p.m(t,null),B(t,a),v&&v.m(t,null),c=!0},p(b,[w]){const P=w&258?nt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(P),b[2]||b[3]?u?(u.p(b,w),w&12&&k(u,1)):(u=tc(b),u.c(),k(u,1),u.m(t,o)):u&&(he(),L(u,1,1,()=>{u=null}),ue());const M=w&258?nt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};s.$set(M),b[4]?p?(p.p(b,w),w&16&&k(p,1)):(p=nc(b),p.c(),k(p,1),p.m(t,a)):p&&(he(),L(p,1,1,()=>{p=null}),ue()),b[7]?v?(v.p(b,w),w&128&&k(v,1)):(v=ic(b),v.c(),k(v,1),v.m(t,null)):v&&(he(),L(v,1,1,()=>{v=null}),ue()),(!c||w&1&&l!==(l=Ne(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(b){c||(k(e.$$.fragment,b),k(u),k(s.$$.fragment,b),k(p),k(v),c=!0)},o(b){L(e.$$.fragment,b),L(u),L(s.$$.fragment,b),L(p),L(v),c=!1},d(b){b&&O(t),ne(e),u&&u.d(),ne(s),p&&p.d(),v&&v.d()}}}function zg(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:v}=t;const b=qs(void 0);return i.$$set=w=>{"isCurrent"in w&&e(0,n=w.isCurrent),"floorIndex"in w&&e(1,o=w.floorIndex),"highlightEnable"in w&&e(2,s=w.highlightEnable),"hoverEnable"in w&&e(3,r=w.hoverEnable),"roomLabelsEnable"in w&&e(4,a=w.roomLabelsEnable),"roomAreaEnable"in w&&e(5,l=w.roomAreaEnable),"roomNameEnable"in w&&e(6,c=w.roomNameEnable),"ruleLabelsEnable"in w&&e(7,d=w.ruleLabelsEnable),"floorplanData"in w&&e(8,h=w.floorplanData),"getRoomAreaText"in w&&e(9,u=w.getRoomAreaText),"getLabelElement"in w&&e(10,m=w.getLabelElement),"getRuleDistanceText"in w&&e(11,A=w.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in w&&e(12,p=w.adaptiveRoomLabelVisibleEnable),"highlightData"in w&&e(13,v=w.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,A,p,v,b]}let Og=class extends de{constructor(t){super(),ce(this,t,zg,jg,le,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Tg)}};function Vg(i){me(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function oc(i,t,e){const n=i.slice();return n[21]=t[e],n}function sc(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=rc(oc(i,r,h));const l=h=>L(a[h],1,1,()=>{a[h]=null});let c=i[5]&&ac(i),d=i[8]&&lc(i);return{c(){t=T("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ie(),c&&c.c(),n=ie(),d&&d.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,u){V(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);B(t,e),c&&c.m(t,null),B(t,n),d&&d.m(t,null),s=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=oc(i,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=rc(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(he(),m=r.length;m<a.length;m+=1)l(m);ue()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=ac(i),c.c(),k(c,1),c.m(t,n)):c&&(he(),L(c,1,1,()=>{c=null}),ue()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=lc(i),d.c(),k(d,1),d.m(t,null)):d&&(he(),L(d,1,1,()=>{d=null}),ue())},i(h){if(!s){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),o||tt(()=>{o=vn(t,bn,{duration:i[0],easing:tn}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)L(a[u]);L(c),L(d),s=!1},d(h){h&&O(t),Ft(a,h),c&&c.d(),d&&d.d()}}}function rc(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new Og({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2047696?nt(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function ac(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ym({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&57352?nt(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function lc(i){let t,e;return t=new km({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Bg(i){let t,e,n=i[1]&&sc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=sc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function _g(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:p}=t,{floorplanData:v}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:w}=t,{getRoomAreaText:P}=t,{getLabelElement:M}=t,{getRuleDistanceText:S}=t,{adaptiveRoomLabelVisibleEnable:C}=t,{highlightData:z}=t;return i.$$set=x=>{"duration"in x&&e(0,n=x.duration),"visible"in x&&e(1,o=x.visible),"northDesc"in x&&e(2,s=x.northDesc),"panoIndex"in x&&e(3,r=x.panoIndex),"floorIndex"in x&&e(4,a=x.floorIndex),"cameraEnable"in x&&e(5,l=x.cameraEnable),"hoverEnable"in x&&e(6,c=x.hoverEnable),"highlightEnable"in x&&e(7,d=x.highlightEnable),"compassEnable"in x&&e(8,h=x.compassEnable),"roomLabelsEnable"in x&&e(9,u=x.roomLabelsEnable),"roomAreaEnable"in x&&e(10,m=x.roomAreaEnable),"roomNameEnable"in x&&e(11,A=x.roomNameEnable),"ruleLabelsEnable"in x&&e(12,p=x.ruleLabelsEnable),"floorplanData"in x&&e(13,v=x.floorplanData),"lastPanoramaLongitude"in x&&e(14,b=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(15,w=x.cameraImageUrl),"getRoomAreaText"in x&&e(16,P=x.getRoomAreaText),"getLabelElement"in x&&e(17,M=x.getLabelElement),"getRuleDistanceText"in x&&e(18,S=x.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in x&&e(19,C=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,z=x.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,A,p,v,b,w,P,M,S,C,z]}let $s=class extends de{constructor(t){super(),ce(this,t,_g,Bg,le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Vg)}};const Ng="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Qg(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return U(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Rg(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Gg(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Rg),rules:i.rules}}function Wg(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Fg(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function dn(i){return U(this,null,function*(){const t=yield Qg(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Gg),o=i.computed_data.entrance?Fg(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Wg)}})}function Hg(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Ng,width:45,height:48},a=lg(s,t),l=rg(s,e),c=ag(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Yg(i,t){return t(i),i}function Qo(i,t){return Yg({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function cc(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function er(i,t,e=ln.BOUNDING_CENTER){const n=cc(i,t),o=cc(i,t+1);return e===ln.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===ln.CEILING?o:n}function tr(i,t,e,n){const o=er(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let ji=class{constructor(t,e){f(this,"VERSION","2.20.10-dev.0");f(this,"five");f(this,"hooks",new _n);f(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}absoluteUrl(t){return Vs(this.staticPrefix,t)}},yn=class extends ji{};var At=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(At||{});const dc=500,Ug=80;function nr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function ir(i,t){return U(this,null,function*(){const[e]=yield ti(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const o=i.getCurrentState();if(!Xg(n,o))throw new Error("pose 与预期不符")})}function Xg(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const o=i[e];return typeof n=="number"&&typeof o=="number"?nr(n,o,2):n===o})}function or(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!nr(e,s,2)||!nr(n,r,2)||o!==a)}function hc(i,t,e=!0){return U(this,null,function*(){if(or(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[d]=yield ti(ir(i,[t.mode,t,void 0,e]));if(d)throw new Error(At.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(At.UpdateCameraError)})}function ri(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Zg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Jg(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let qg=class extends yn{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>U(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!or(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,At.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(At.ModelNotLoaded);if(!this.data)throw new Error(At.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(hc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(At.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:dc;ri(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,At.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Jg(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Zg(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Ug/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const Kg=(i,t)=>new qg(i,t);function $g(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function ep(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let tp=class extends yn{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>U(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!or(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,At.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(At.ModelNotLoaded);if(!this.data)throw new Error(At.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ti(hc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(At.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:dc;ri(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,At.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);ri(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),$g(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(ep(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=er(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const np=(i,t)=>new tp(i,t);let ip=class extends yn{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=tr(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?Qo(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=er(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_show(e){return U(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield ir(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;ri(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return U(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;ri(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new $s({target:this.container,intro:!0,props:n})}};const op=(i,t)=>new ip(i,t);function sr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function sp(i){me(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function rp(i){let t,e,n;return{c(){t=T("div"),e=T("div"),n=T("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||cn)+")"),j(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){V(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&j(n,"background-image","url("+(o[0]||cn)+")"),(s&1||s&3)&&j(n,"transform",o[1]),s&4&&j(e,"transform",o[2])},i:K,o:K,d(o){o&&O(t)}}}function ap(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function lp(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,d=s.getCurrentState().longitude;function h(A,p){const v=A.bounding,b=A.observers[p];if(!b)return"";const w=(v.max.x-v.min.x)*r,P=(v.max.y-v.min.y)*r,M=Math.floor(b.positionInImage.x*w),S=Math.floor(b.positionInImage.y*P);return`translate(${M}px, ${S}px)`}function u(A){e(6,c=A)}const m=sr(A=>{e(7,d=A.longitude)},1e3/60);return Mt(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,s=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=ap(d))},[l,o,n,s,r,a,c,d]}class cp extends de{constructor(t){super(),ce(this,t,lp,rp,le,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},sp)}}function dp(i){me(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function uc(i,t,e){const n=i.slice();return n[1]=t[e],n}function fc(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=T("div"),n=T("div"),r=ie(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",o),j(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),j(e,"top",a),j(e,"left",l),this.first=e},m(c,d){V(c,e,d),B(e,n),B(e,r)},p(c,d){t=c,d&1&&j(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&j(n,"width",o),h&&j(n,"height",s),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&j(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&j(e,"left",l)},d(c){c&&O(e)}}}function hp(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=uc(i,o,r),l=s(a);n.set(l,e[r]=fc(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=kt(e,a,s,1,r,o,n,t,Xs,fc,null,uc))},i:K,o:K,d(r){r&&O(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function up(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class fp extends de{constructor(t){super(),ce(this,t,up,hp,le,{extraObjects:0},dp)}}function mc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5],hoveredRoom:void 0}];let o={};for(let s=0;s<n.length;s+=1)o=Ze(o,n[s]);return t=new ec({props:o}),{c(){oe(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&183?nt(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5],hoveredRoom:void 0}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function mp(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Ze(l,a[d]);t=new Ol({props:l}),n=new fp({props:{extraObjects:i[6]}});let c=i[3]&&mc(i);return{c(){oe(t.$$.fragment),e=ie(),oe(n.$$.fragment),o=ie(),c&&c.c(),s=Ee()},m(d,h){te(t,d,h),V(d,e,h),te(n,d,h),V(d,o,h),c&&c.m(d,h),V(d,s,h),r=!0},p(d,[h]){const u=h&20?nt(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),n.$set(m),d[3]?c?(c.p(d,h),h&8&&k(c,1)):(c=mc(d),c.c(),k(c,1),c.m(s.parentNode,s)):c&&(he(),L(c,1,1,()=>{c=null}),ue())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){L(t.$$.fragment,d),L(n.$$.fragment,d),L(c),r=!1},d(d){ne(t,d),d&&O(e),ne(n,d),d&&O(o),c&&c.d(d),d&&O(s)}}}function gp(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,o=u.five),"pxmm"in u&&e(1,s=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[o,s,r,a,l,d,n,h,c]}class pp extends de{constructor(t){super(),ce(this,t,gp,mp,le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Ap(i){me(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function gc(i){let t,e,n,o,s=i[7]!==0&&pc(i);return{c(){t=T("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){V(r,t,a),s&&s.m(t,null),e=!0,n||(o=[Wt(ei.call(null,t)),Me(t,"clientWidth",i[13]),Me(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&k(s,1)):(s=pc(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),L(s,1,1,()=>{s=null}),ue())},i(r){e||(k(s),e=!0)},o(r){L(s),e=!1},d(r){r&&O(t),s&&s.d(),n=!1,et(o)}}}function pc(i){let t,e,n,o,s=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Ze(c,l[u]);e=new pp({props:c});const d=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let u=0;u<d.length;u+=1)h=Ze(h,d[u]);return o=new cp({props:h}),{c(){t=T("div"),oe(e.$$.fragment),n=ie(),oe(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",s),j(t,"height",r)},m(u,m){V(u,t,m),te(e,t,null),B(t,n),te(o,t,null),a=!0},p(u,m){const A=m&3181?nt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(A);const p=m&1049?nt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(p),m&512&&s!==(s=`${u[9]}px`)&&j(t,"width",s),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(o.$$.fragment,u),a=!0)},o(u){L(e.$$.fragment,u),L(o.$$.fragment,u),a=!1},d(u){u&&O(t),ne(e),ne(o)}}}function vp(i){let t,e,n=i[1]&&gc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=gc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),L(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&O(t)}}}function bp(i,t,e){var P,M;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(P=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function v(S){e(11,h=n.work.observers[S].floorIndex)}Mt(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));const b=S=>{e(7,u=S.detail)},w=S=>{e(8,m=S.detail)};return i.$$set=S=>{"five"in S&&e(0,n=S.five),"visible"in S&&e(1,o=S.visible),"hoverEnable"in S&&e(2,s=S.hoverEnable),"floorplanData"in S&&e(3,r=S.floorplanData),"cameraImageUrl"in S&&e(4,a=S.cameraImageUrl),"extraObjects"in S&&e(5,l=S.extraObjects),"highlightData"in S&&e(6,c=S.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const S=Math.min(u,m),{max:C,min:z}=r.bounding,x=C.x-z.x,Y=C.y-z.y,J=function(){return x>Y?[S,S/x*Y]:[S/Y*x,S]}();e(9,A=J[0]),e(12,p=J[1]),e(10,d=A/x)}},[n,o,s,r,a,l,c,u,m,A,d,h,p,b,w]}class yp extends de{constructor(t){super(),ce(this,t,bp,vp,le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Ap)}}let wp=class extends yn{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:cn},s=n!=null&&n.configs?n.configs:{},r=W(W({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return U(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield dn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Hg(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=W(W({},this.state),e),!jt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=Ie(W({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new yp({target:this.wrapper,props:e})}};const Ip=(i,t)=>new wp(i,t),Cp=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Pp=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Ep=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],rr=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Mp=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(rr(o,0,0)),s&&i.applyMatrix4(rr(0,s,0)),r&&i.applyMatrix4(rr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Ac(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=W({map:o.material.map||{}},t);o.material=new _.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const kp=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,o={},s=h=>U(this,null,function*(){var Q;const u=(h==null?void 0:h.fbx_url)||e,m=(Q=h==null?void 0:h.north_rad)!=null?Q:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=i.model.bounding,p=A.max.x-A.min.x,v=A.max.z-A.min.z,b=Math.max(p,v),P=yield new co.FBXLoader().loadAsync(u);Ac(P,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const M=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:S,z:C},min:{x:z,y:x,z:Y}}}}=i;o.yBase=x;const J={x:(S+z)/2,y:x-1.6,z:(C+Y)/2},R=.0045*b;return Mp(P,{position:J,rotation:M,scale:R}),o.object=P,!0}),r=({latitude:h})=>{if(!o.object)return;const u=a(h);u&&(o.object.position.y=u)},a=h=>{if(o.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return o.yBase-(u+1.6);const m=h*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{o.object&&(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Dp(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new _.CanvasTexture(a)}const xp=({x:i,y:t,z:e})=>new _.Vector3(i,t,e),Sp=(i,t)=>{var p,v,b;const e={},n=(p=t.animationEnabled)!=null?p:!0,o=(v=t.position)!=null?v:void 0,s=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>U(this,null,function*(){var J,R,Q,G,N,F,Z,X;const P=(J=w==null?void 0:w.position)!=null?J:o;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=xp(P),S=(R=w==null?void 0:w.rad)!=null?R:s,C=(Q=w==null?void 0:w.fbx_url)!=null?Q:r;if(e.rad=S,S===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${S}`));const z=yield new co.FBXLoader().loadAsync(C);z.position.copy(M),z.rotation.z=S,z.scale.set(.8,.8,.8),Ac(z,{transparent:!0,side:E.DoubleSide});const x=(Z=(F=(N=(G=z.children)==null?void 0:G[0])==null?void 0:N.children)==null?void 0:F[3])==null?void 0:Z.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Y=(X=t.name)!=null?X:"入户门";return x.material=new _.MeshBasicMaterial({transparent:!0,map:Dp(Y)}),x.renderOrder=3,z.children[0].add(x),e.object=z,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,P=new _.AnimationMixer(e.object);a.push(P);const M=P.clipAction(e.object.animations[0]);M.timeScale=w;let S;const C=()=>{let J=0,R=0;const Q=1e3/30,G=N=>{J=requestAnimationFrame(G);const F=N-R;F<Q||(R=N,a.forEach(Z=>Z.update(F/1e3)),i.needsRender=!0)};return J=requestAnimationFrame(G),()=>{cancelAnimationFrame(J)}},Y={play:()=>{S||(M.play(),S=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),S==null||S(),S=void 0}};e.animation=Y},d=w=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=w==null?void 0:w.animationEnable)!=null?M:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=w=>w==="Floorplan"?d():h();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},Lp=Ct;function Tp(i,t,e,n=Lp.Linear.None){const o=new mo(i).to(t,e).easing(n);wo(()=>o.start(0));const s=Si(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function jp(i,t){return Tp({progress:0},{progress:1},i,t)}var vc=(i=>(i.Move="Move",i.Rotate="Rotate",i))(vc||{}),zt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(zt||{});const Ro=Math.PI*2;function bc(i){return(i%Ro+Ro)%Ro}function yc(i){return i%Ro}function ar(i,t,e){return i+(t-i)*e}const lr=(i,t,e)=>{const n=Math.PI,o=n*2;let s=bc(i),r=bc(t);return e===zt.Anticlockwise&&s<r&&(s+=o),e===zt.Clockwise&&r<s&&(r+=o),e===zt.Loop&&r-s>n?lr(s,r,zt.Anticlockwise):e===zt.Loop&&s-r>n?lr(s,r,zt.Clockwise):{from:s,to:r}},zp=i=>{const t={},e=(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,u)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,W({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},s)):u(new Error("unexpected error"))})}),n=s=>{const r=i.state,a=yc(r.latitude),l=yc(s.latitude),{from:c,to:d}=lr(r.longitude,s.longitude,s.rotation||zt.Loop),h=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ae.Five.Mode.Panorama&&(yield i.changeMode(Ae.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,A)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(s);return yield new Promise(m=>{const A=({progress:P})=>{const M={};M.longitude=ar(h.longitude,u.longitude,P),M.latitude=ar(h.latitude,u.latitude,P),M.fov=ar(h.fov,u.fov,P),i.setState(M,!0)},p=()=>{m(!0)},v=()=>{m(!1)},b=s.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/s.rotateSpeed*1e3):r,w=jp(b,Ct.Linear.None).onUpdate(A).onComplete(p).onDestroy(v);s.rotation===zt.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function wc(i,t){return i.x===t.x&&i.y===t.y}function Ic(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Go(i,t){return(t.y-i.y)/(t.x-i.x)}function Cc(i,t,e){const n=Go(i[1],i[0]),o=Go(t[1],t[0]);if(isNaN(n)||isNaN(o)||Ic(n,o))return!1;if(Wo(i[0],t))return i[0];if(Wo(i[1],t))return i[1];if(Wo(t[0],i))return t[0];if(Wo(t[1],i))return t[1];if(e&&!Op(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Wo(i,t){return wc(i,t[0])||wc(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Ic(Go(t[0],i),Go(i,t[1]))}function Fo(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Op(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&Fo(t[0],i[1],i[0])*Fo(i[1],t[1],i[0])>0&&Fo(i[0],t[1],t[0])*Fo(t[1],i[1],t[0])>0?1:0}function Pc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Pc(i,t-1))}const Vp=`<style type="text/css">
195
195
  .PanoRulerPlugin-rule-line {
196
196
  position: absolute;
197
197
  transform-origin: left center;
@@ -284,7 +284,7 @@ void main() {
284
284
  <div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(v)}</div>
285
285
  </div>
286
286
  </div>
287
- `,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",p),w.setAttribute("style","display: none"),w.innerHTML=b,w},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Vp,o.appendChild(s);const r={},a=(p,v)=>{if(e.loaded)throw new Error("标尺被重复初始化!");const b=_p(p,i),w=i.work;if(!w)return!1;for(const P in v){const M=v[P],{standingPosition:S}=w.observers[0],C=M.map(({x:z,z:x,observers:Y})=>{const J=Y.length>0?p.rooms[p.observers[Y[0]]].name:"",R=b[J]?b[J].floor:null;let Q=1/0,G={index:0,x:S.x,y:S.y,z:S.z};Y.forEach(ae=>{if(!w.observers[ae])return;const{standingPosition:se}=w.observers[ae],ye={index:ae,x:se.x,y:se.y,z:se.z},Ce=Bp({x:z,z:x},ye);R?Ce<Q&&Math.abs(ye.y-R)<.3&&(Q=Ce,G=ye):Ce<Q&&(Q=Ce,G=ye)});const N=new _.Vector3(z,G.y,x);Object.assign(N,{observers:Y});const F=b[J]?b[J].roof:null,Z=F?new _.Vector3(z,F,x):null;return Z&&Object.assign(Z,{observers:Y}),{origin:N,vertical:Z}});r[P]={origins:C.map(z=>z.origin),rules:[]};for(const{origin:z,vertical:x}of C){if(!x)continue;const Y=n(P,z.distanceTo(x));o.append(Y),r[P].rules.push({vertical:!0,rule:[z,x],$element:Y})}for(let z=0;z<C.length;z++){let x=z+1;x>=C.length&&(x=0);const{origin:Y}=C[z],{origin:J}=C[x],R=n(P,Y.distanceTo(J));o.append(R),r[P].rules.push({vertical:!1,rule:[Y,J],$element:R})}}return e.loaded=!0,!0},l=(p,v,b)=>U(this,null,function*(){const w=p||t.roomInfo,P=v||t.roomRules;if(!w||!P)throw new Error("标尺数据依赖不齐全!");return e.loaded=!1,e.options=W(W({},e.options),b||{}),i.model.loaded?a(w,P):yield new Promise(M=>i.once("modelLoaded",()=>M(a(w,P))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(p,v,b,w)=>{const P=[[{x:0,y:0},{x:b,y:0}],[{x:0,y:0},{x:0,y:w}],[{x:b,y:0},{x:b,y:w}],[{x:0,y:w},{x:b,y:w}]],M=[];for(let S=0;S<P.length;S++){const C=Cc([p,v],[P[S][0],P[S][1]],!0);C&&M.push(C)}return M.length===0?!1:M},d=()=>{var Y;const p=(Y=i.getElement())==null?void 0:Y.parentElement;if(!p||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:v,camera:b,currentMode:w}=i;if(v===void 0)return;let P;for(const J in r)J.split(",").indexOf(v.toString())>=0&&(P=J);if(!P){for(const J in r)for(const{$element:R}of r[J].rules)R.style.display="none";return}const M=b.position,S=b.getWorldDirection(new _.Vector3),C=p.clientWidth,z=p.clientHeight;if(w!==Ae.Five.Mode.Panorama){for(const J in r)for(const{$element:R}of r[J].rules)R.style.display="none";return}for(const J in r)for(const{$element:R}of r[J].rules)R.style.display=J===P?"block":"none";const[x]=r[P].origins.slice().filter(J=>J.observers.indexOf(v)>=0).sort((J,R)=>{const Q=J.clone().setY(0).sub(M).normalize().angleTo(S.clone().setY(0)),G=R.clone().setY(0).sub(M).normalize().angleTo(S.clone().setY(0));return Q-G});for(const{rule:J,vertical:R,$element:Q}of r[P].rules){const[G,N]=J,F=Q.querySelector(".PanoRulerPlugin-rule-line");if(!F)return;if(!x){Q.style.display="none";continue}if(G!==x&&N!==x){Q.style.display="none";continue}if(G.distanceTo(N)<.3){Q.style.display="none";continue}if(G.observers.indexOf(v)===-1||N.observers.indexOf(v)===-1){Q.style.display="none";continue}if(G.clone().sub(M).normalize().angleTo(S)>Math.PI/2){Q.style.display="none";continue}if(N.clone().sub(M).normalize().angleTo(S)>Math.PI/2){Q.style.display="none";continue}const q=G.distanceTo(N);if(N.clone().sub(N.clone().sub(G).divide(new _.Vector3(2,2,2))).distanceTo(M)/q>8){Q.style.display="none";continue}const ye=G.clone().project(b),Ce=(ye.x+1)/2*C,ve=(-ye.y+1)/2*z,Ve=N.clone().project(b),be=(Ve.x+1)/2*C,Fe=(-Ve.y+1)/2*z,fe=Math.sqrt(Math.pow(be-Ce,2)+Math.pow(Fe-ve,2));let we=fe,Te=50;const ge=c({x:~~Ce,y:~~ve},{x:~~be,y:~~Fe},C,z);if(ge&&ge.length===1&&(x===G?(we=Math.sqrt(Math.pow(ge[0].x-Ce,2)+Math.pow(ge[0].y-ve,2)),Te=we/fe*50):x===N&&(we=Math.sqrt(Math.pow(ge[0].x-be,2)+Math.pow(ge[0].y-Fe,2)),Te=100-we/fe*50)),ge&&ge.length===2){const re={x:(ge[0].x+ge[1].x)/2,y:(ge[0].y+ge[1].y)/2};Te=Math.sqrt(Math.pow(re.x-Ce,2)+Math.pow(re.y-ve,2))/fe*100}const dt=(Math.PI/2-Math.atan2(be-Ce,ve-Fe))/Math.PI*180,De=F.querySelector(".PanoRulerPlugin-rule-label"),ot=De.children[0].clientWidth;ot>=fe||ot/2>=Te/100*fe||ot/2>=(1-Te/100)*fe?F.style.display="none":(F.style.display="block",F.style.width=fe+"px",F.style.left=Ce+"px",F.style.top=ve+"px",F.style.transform=`rotate(${-dt}deg)`,De.style.left=`${Te}%`)}},h=()=>Pc(d),u=()=>{var p,v;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(v=(p=i.getElement())==null?void 0:p.parentElement)==null||v.append(o),d(),i.on("modeChange",d),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",d),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function A(p){if(p.distanceText&&p.distanceText!==e.options.distanceText){const v=p.distanceText;e.options.distanceText=v,Object.values(r).forEach(b=>{b.rules.forEach(w=>{const[P,M]=w.rule,S=P.distanceTo(M),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");C&&(C.innerText=v(S))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:A}};function Qp(i){me(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function Ec(i,t,e){const n=i.slice();return n[6]=t[e],n}function Rp(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Mc(Ec(i,e,o));return{c(){t=T("div");for(let o=0;o<n.length;o+=1)n[o].c();y(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(o,t,s);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=Ec(o,e,r);n[r]?n[r].p(a,s):(n[r]=Mc(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&O(t),Ft(n,o)}}}function Gp(i){let t,e;return{c(){t=T("em"),y(t,"class",e=Ne(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=Ne(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),o&8&&y(t,"style",n[3])},d(n){n&&O(t)}}}function Mc(i){let t,e,n=`${i[6].width}px`;return{c(){t=T("div"),y(t,"class",e=Ne(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3]),j(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=Ne(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),s&8&&y(t,"style",o[3]),(s&8||s&9&&n!==(n=`${o[6].width}px`))&&j(t,"width",n)},d(o){o&&O(t)}}}function Wp(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,d=`${i[0].left}px`,h=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(v,b){return v[0].children.length===0?Gp:Rp}let A=m(i),p=A(i);return{c(){t=T("div"),p.c(),e=ie(),n=T("div"),o=T("div"),r=Oe(s),y(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),tt(()=>i[4].call(o)),y(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),j(n,"left",l),y(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),j(t,"width",c),j(t,"left",d),j(t,"top",h),j(t,"transform",u),j(t,"display",i[0].visible&&i[2]?"block":"none")},m(v,b){V(v,t,b),p.m(t,null),B(t,e),B(t,n),B(n,o),B(o,r),a=Eo(o,i[4].bind(o))},p(v,[b]){A===(A=m(v))&&p?p.p(v,b):(p.d(1),p=A(v),p&&(p.c(),p.m(t,e))),b&1&&s!==(s=v[0].labelElement+"")&&Be(r,s),b&1&&l!==(l=`${v[0].labelOffset}%`)&&j(n,"left",l),b&1&&c!==(c=`${v[0].width}px`)&&j(t,"width",c),b&1&&d!==(d=`${v[0].left}px`)&&j(t,"left",d),b&1&&h!==(h=`${v[0].top}px`)&&j(t,"top",h),b&1&&u!==(u=`rotate(${v[0].rotateDeg}deg)`)&&j(t,"transform",u),b&5&&j(t,"display",v[0].visible&&v[2]?"block":"none")},i:K,o:K,d(v){v&&O(t),p.d(),a()}}}function Fp(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Hp extends de{constructor(t){super(),ce(this,t,Fp,Wp,le,{rulerItemProp:0},Qp)}}function kc(i,t,e){const n=i.slice();return n[12]=t[e],n}function Dc(i){let t,e;return t=new Hp({props:{rulerItemProp:i[12]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Yp(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Dc(kc(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=kc(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=Dc(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&O(t),Ft(o,r)}}}function Up(i,t,e){var p,v,b,w;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((v=(p=n.getElement())==null?void 0:p.parentElement)==null?void 0:v.clientWidth)||0,l=((w=(b=n.getElement())==null?void 0:b.parentElement)==null?void 0:w.clientHeight)||0,c=(P,M)=>{const S=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let z=0;z<S.length;z++){const x=Cc([P,M],[S[z][0],S[z][1]],!0);x&&C.push(x)}return C.length===0?!1:C},d=(P,M)=>{const S=P.clone().project(n.camera),C=(S.x+1)/2*a,z=(-S.y+1)/2*l,x=M.clone().project(n.camera),Y=(x.x+1)/2*a,J=(-x.y+1)/2*l,R=Math.sqrt(Math.pow(Y-C,2)+Math.pow(J-z,2));return{startLeft:C,startTop:z,endLeft:Y,endTop:J,distance:R}},h=(P,M,S)=>{const C=n.camera.position,z=n.camera.getWorldDirection(new _.Vector3),x=P.clone().sub(C).normalize().angleTo(z),Y=M.clone().sub(C).normalize().angleTo(z),J=P.distanceTo(M),Q=M.clone().sub(M.clone().sub(P).divide(new _.Vector3(2,2,2))).distanceTo(C),{startLeft:G,startTop:N,endLeft:F,endTop:Z,distance:X}=d(P,M),ae=-((Math.PI/2-Math.atan2(F-G,N-Z))/Math.PI)*180;let se=!0;S||(se=!1),!jt(P,S)&&!jt(M,S)&&(se=!1),J<.3&&(se=!1),x>Math.PI/2&&(se=!1),Y>Math.PI/2&&(se=!1),Q/J>8&&(se=!1);let ye=50,Ce=X;const ve=c({x:~~G,y:~~N},{x:~~F,y:~~Z});if(ve&&ve.length===1&&(jt(P,S)?(Ce=Math.sqrt(Math.pow(ve[0].x-G,2)+Math.pow(ve[0].y-N,2)),ye=Ce/X*50):jt(M,S)&&(Ce=Math.sqrt(Math.pow(ve[0].x-F,2)+Math.pow(ve[0].y-Z,2)),ye=100-Ce/X*50)),ve&&ve.length===2){const Ve={x:(ve[0].x+ve[1].x)/2,y:(ve[0].y+ve[1].y)/2};ye=Math.sqrt(Math.pow(Ve.x-G,2)+Math.pow(Ve.y-N,2))/X*100}return{startLeft:G,startTop:N,distance:X,deg:ae,visible:se,labelOffset:ye,ruleLength:J}},u=()=>{const P=n.panoIndex,M=o.find(R=>R.panoIndex===P);if(!M)return e(0,r=[]);if(n.currentMode!==Ae.Five.Mode.Panorama)return e(0,r=[]);const S=n.camera.position,C=n.camera.getWorldDirection(new _.Vector3),z=M.lines.map(R=>new _.Vector3(R.start[0],-R.start[1],-R.start[2])),x=M.lines.map(R=>new _.Vector3(R.end[0],-R.end[1],-R.end[2])),[Y]=z.concat(x).sort((R,Q)=>{const G=R.clone().setY(0).sub(S).normalize().angleTo(C.clone().setY(0)),N=Q.clone().setY(0).sub(S).normalize().angleTo(C.clone().setY(0));return G-N}),J=M.lines.map(R=>{var Ce,ve;const Q=R.start,G=R.end,{startLeft:N,startTop:F,distance:Z,deg:X,visible:q,labelOffset:ae,ruleLength:se}=h(new _.Vector3(Q[0],-Q[1],-Q[2]),new _.Vector3(G[0],-G[1],-G[2]),Y),ye=[];return R.children&&((Ce=R.children)==null?void 0:Ce.length)>0&&((ve=R.children)==null||ve.forEach(Ve=>{const be=Ve.start,Fe=Ve.end,{distance:fe}=d(new _.Vector3(be[0],-be[1],-be[2]),new _.Vector3(Fe[0],-Fe[1],-Fe[2]));ye.push({width:fe,state:Ve.state})})),{width:Z,left:N,top:F,rotateDeg:X,state:R.state,children:ye,labelOffset:ae,visible:q,labelElement:s.distanceText(se)}});e(0,r=J)},m=()=>wo(u),A=sr(u,80);return Mt(()=>{u(),n.on("panoArrived",u),n.on("modeChange",u),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>A()),n.on("pinchGesture",()=>A())}),on(()=>{n.off("panoArrived",u),n.off("modeChange",u),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>A()),n.off("pinchGesture",()=>A())}),i.$$set=P=>{"five"in P&&e(1,n=P.five),"rulerDatas"in P&&e(2,o=P.rulerDatas),"options"in P&&e(3,s=P.options)},[r,n,o,s]}class Xp extends de{constructor(t){super(),ce(this,t,Up,Yp,le,{five:1,rulerDatas:2,options:3})}}let Zp=class{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=W(W({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>U(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return U(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return U(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Xp({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}};const Jp=(i,t)=>new Zp(i,t),qp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAGfvXS06Zc5CFCePQt0y3EFaq61CX1ayjC56U8br24sKd+kAuJhkI55OSPi75pyIcvKNIEFgcgRDJ4hD3ewMZLDwDXqfOq9RNFCYOCAMPYx851BDjIXiWzky9Tpyvw0kOL/nc+Jh7DyGqko+P+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsxknztsDUnFvMfF8e+4X6j88F4hlTDT3de6BiAYsI0HgxgiESG4MYd8XkLEhrARZTKUxUWB0MXrkiA3wdYYQg8Xs2cmzaR977cCE8eSM6wYDsQiXSyOrulDPRUT3AbsxydAnYO9kz87HfH9Kxv3D976lNEk2ujf9ANE8GCe1OeEzgRLZD4EQyX44df8tGQ08iNdHCU+jnhGPDVG9bgAGGD3Iw8TB5xgjz3jr3CTxSEapxxAL7VxcCmGaQPe6n/qScWtSIcdLrD1FhxbtRZn4x/3rtanvlBtffq57UCcI5l6dVF9CaJEgcAWBEMkVOPo+0ODHwGNEIAxIwsRBea6vdxlMPsNwYFAcIoEsnB4WQ6hTqxOMqg1wU40rxEx/kCal6AKejEnGOSFKvE8mFiYaFV8S9AVP5oo3o+syKSA0ZoJxmTWZJvFSXSMLIzBnXBa+bS5/UwQ0oDECEIRDF87n+nSOMDAMkIUNU51v2TjM4SWo2pdi1E34L1W4mnRALFOJtZ0pQe/QNVItT3XNOzpxV8n5fdWjaxzrBqY8j8Cc0Zn/RT45OQIaoPQT3oUHMDnHUzPKuYFLqGJYZFXObNILroSmIi8jMIfjy9/s8EwhGu/0+s+4CdI5vBkmKngv6Bo5x3NbodFFQmQOk6l48VzXQdcgF6d7unePoU7aE5lBIEQyA8y5TmvgEZ5iwBJSeKMkBrHXJVS8lCljZ8IwaZgwFlswvqzNugpT2K6rhTtaI2PPBIN0hWSkn6zJmFSc7yIYSIj0Y6VBdA108nZJd5TjuSQsNqDT558QyZn7rQxMSKNO435hkE0NNEIXzPhIzPiY7cXDEBBHkE0TyRx+0i9vovhf/R3pMR6MPWWTB+syU+JQ2tvlQ8Ji6C/kArHcKfcpHydrHYGxwWq9vl3XT4MFr4JZHO4/3gbkMTXYxkYMEmHtAsJgNsegYxaH9xFZBgH6YMoLXOZunV+1TGCYxHzgpkjfCYPhrUAw5BAMJDLGlbAY44E0iH7LJAlSgVw+UuK5l6nJlD6KnBuBEMmCPaDBwACpiYOBwuCqB0S9xZYBxmfs4YcsGEjkiSsLhBML/VD304lv3//tykTnQ7WENIjGBDYHQoFcSEym2IaMWP/JCaG9VZKyi8f6LaRSE8t4wsX3ImdAIERyRNALcTBIGByeYY13v4yJg+P7SiaOhKcERgMSI7VAJ4hcWGjHwyANonFTh8UYO3gv440kjKPvlqTs4llFLEy4GDfpM5A5g4RIbgi6lNkeh8NV4wEwVm7CUSg+CfLAZR9/R6cjZ0YgfXKiDpD+e2F/CIuVCRnjyh4L5DLeLYbXUu8Sg1gYUwNJ6ZoPVI6cCAE6I3IAAlJW3HCTBl6H3fK5qxCmMnGwiMiWy0jjCKiff6kqDuNDffbbxqu7+uqpP3iAEkJx2mfcOQx2W32YV74sqCUhkmvAlQLjUjMzcqiKxcJdwuwKT2NIUmAWDSOdIaB+/4WrrD78ncvJ20BA/cMmFcalE+GxXcJmFa+x3FWf1iHmXb/LZ3sgkNDWBEhSUhb67DYzA6rDVeOQBy/3gzQGJZWC5nkNgbECGffzCpq0niaUCRqTtH/RqjJmPdmDXMYvtoR4SD9U4kHJOgyWMStQbiLxSISelAoc6rUOFG5O2MnD4ni9xpHdPXNodXpeOvG+qy6j9XuXk7ePQDWeIRQmgizeT9k6zjF2IaRhbUV5thkLhENlCtxDr9Hl96VseGMommcxu7wzwlUmDnaHxC3ustf3r7T04z1/W/39B5eT94eA+pLw9OtKJpZdYTB2ldUhsLzOZY8u32U89/h5X1+RQuHuQhyErVCsmkjrUAazlHtKkEeeshUIGxT0odaPDUKwjiaXiZ/JwWEwL9qP7QBh7DdLkskY3hWGt8KC/eX/qFkHMsdrxeoHihSBbYP2OnBx58RrHZBHvI45lDZyXnrzrpsqA/JHl5OvCwH1s70ViAWPZby2Ujf4vg4GQpJO5K0SFTKrJBIpB1sDUQwIZNcuK2Kjd0v6RMqRtQ6BERnWzX5uHKQXf3I5+XoRkN3AHrLNGEIh7Vor9S4wIhab31q8GiKpyAMCQRmmBKLgOQ68DrYAbl4BpkDKuYFIfiYchvEhPflzMNkeAsWmQCi2KXP2kgkpnspmSWUOmC60Rh3NGg+dTJrzPCAPZg+D5yGjkDinwIjsRkC69VN/QzrzF5eTbxMB6QMhL3sq2Jo524mt8drqZhbq58BoVlvUocQ0WeswebA45pAU7XGZVyTcI8kQbKZD1d7IERCQnr3jy0h//upy8iAg3WACyyI9iccGbEexPbZBnsBCKrype9U7PbvYtaWOgyyYBTAjgET8gCCdxe4ak4c9j9V3nNocWRaBehffsnfK1btCoExMh+dOqokttslRERMLIXbO8QAkC/VERT7W71enW26w2teeCPz6raB4IlPiV5JAHvE8phDKuYMRkO79xD+SXv3N5eRBYA4B6QwTcya6kMrcsyp4JkRKWKPFdq1CmiOSUWfMvZiNRXIYPv/caRVq2F4jpIdvu1Ya8H93OXkQ2AcB6Q+PHUAqpDk7xqtZIJXuJ8FNEIlApx64gYA+t5DFIjnrHrzCIO/GERCR5RCQTv5IVx9CptK3fyx3p1x57QhIl/x/7llPmXpOBT1jNymk0uVjCGclkoq1AXhqvQaAWffA+3ioAe21EB1GgsByCEg3f+CrS+/+6XLyIPCqCEinsLeEvHZNmAnPM2HuKtpyciIpYNr7AFTIwfVwGY8DMFe5MKV2RRpHQHr6lqsoIvnA5eRB4BgISL+8gYhJNB4LYvvnCTN2kEl0816KDTiNWFQEHC4doBG68q6r+p7sZMD7gDzy+oEamZRPjoD09fu66TA+pI//PnkFcsPNICBdYz0Fu3idbSSs3+RzcIsSiQDi+ngdAGTWVfGKsHOB+GBCV1dgycE5EZDufs/31+D9r8vJg8BSCFT2kojN3K4vvBQm3E3Zy0WIRICwVRcwSFPbdu194LKt+kEdtT/SIQLS4Tddbenohy4nDwKnQGAPG4rdZALehA09KpGo8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Kp(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${qp})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"㎡"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const $p=new E.TextureLoader;function zi(i){return U(this,null,function*(){return new Promise((t,e)=>{$p.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t))})}const Ho={userAction:!0};class e0 extends yn{constructor(e,n){super(e);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:this.absoluteUrl("/release/web/v3/north-point-circle.96498e69.png"),entryDoorImageUrl:this.absoluteUrl("/release/web/enterDoor.831b8208.png")}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,d;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=yo(1e3).onUpdate(({progress:h})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(d=this.entryDoorMesh)==null||d.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ae.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:W(W({},this.state.config),n||{})})}enable(e=Ho){this.setState({enabled:!0},e)}disable(e=Ho){this.setState({enabled:!1},e)}show(e=Ho){if(this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Ho){if(this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:W(W({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return U(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=W({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return U(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Kp(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return U(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield zi(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return U(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield zi(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Io(this.five).create3DDomContainer(e)}}const t0=(i,t)=>new e0(i,t);function Yo(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function n0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Yo(i,a*4+0,l*4+0),Yo(i,a*4+1,l*4+1),Yo(i,a*4+2,l*4+2),Yo(i,a*4+3,l*4+3)}}}class xc{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ae.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Kt(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left="90px"):s<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const v=this.renderCenter.clone().project(this.five.camera);return[(v.x+1)/2*s.x,(v.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,d=o/t,h=l*t,u=this.five.getPixels(r-c/2,a-c/2,c,d,h),m=Math.floor(n*l),A=Math.floor(o*l);n0(u,m,A);const p=new ImageData(m,A);p.data.set(u),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),d=Math.min(Math.max(l,o),r);return{translateX:c,translateY:d}}}class i0{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{this.five.model&&(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new _.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}const o0=1,s0=3,r0=new _.Color(16777215),a0=new _.Color(6522623),l0=new _.Color(16777215),c0=new _.Color(6522623),d0=6,h0=8,u0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Sc=new _.TextureLoader().load(u0),f0={pointTexture:Sc,pointSize:d0,lineWidth:o0,lineColor:r0,pointColor:l0,lineRenderOrder:20,pointsRenderOrder:20},m0={pointTexture:Sc,pointSize:h0,lineWidth:s0,lineColor:a0,pointColor:c0,lineRenderOrder:10,pointsRenderOrder:10};function g0(i,t,e){var d,h,u,m,A;const n=(d=e==null?void 0:e.lineWidth)!=null?d:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new _.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(A=e==null?void 0:e.lineRenderOrder)!=null?A:20,l=new lo.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Lc(i,t){const[e,n]=i.points,o=t==="light"?m0:f0,s=g0(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function Oi(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function cr(i){const{z:t}=i;return!(Math.abs(t)>1)}function p0(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function A0(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function v0(i){let t=!0;const{line:e}=i,n=e.id,o=p0(),s=A0(e),r=i.userDistanceItem,a=new _.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:u,appendTo:m,remove:A,highlight:d,unHighlight:h,getCurrentContent:p,setItemSelectable:v};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var b;(b=i.clickCallback)==null||b.call(i,l)}function d(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function u(b){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const w=b.getElement();if(!w)return;const P=w.clientWidth,M=w.clientHeight,S=P/2,C=M/2;if(e.points.length<2)return;const[z,x]=e.points,Y=z.position.clone().project(b.camera),J=x.position.clone().project(b.camera),R=Y.clone().lerp(J,.5),Q=new _.Vector2(Y.x*S,Y.y*C),G=new _.Vector2(J.x*S,J.y*C),N=Q.distanceTo(G);if((()=>!(Math.abs(Y.z)>1||Math.abs(J.z)>1||!cr(Y)&&!cr(J)||!cr(R)||N===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const Z=(R.x+1)/2*P,X=-(R.y-1)/2*M,ae=-(Math.atan((Q.y-G.y)/(Q.x-G.x))*180)/Math.PI,se=s.parentElement&&o.clientWidth>N?-20:0;s.style.transform=`translate(${Z}px, ${X}px) rotate(${ae}deg) translateY(${se}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const ye=p();o.innerText=ye}function m(b){b.appendChild(s),s.addEventListener("click",c)}function A(){o.removeEventListener("click",c),s.remove()}function p(){var z,x,Y;if(e.points.length<2)return"";const[b,w]=e.points,P=b.position.clone().distanceTo(w.position),M=(z=i.line.text)!=null?z:i.line.model.config.defaultText,S=(Y=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:Y.call(x,P),C=M!=null?M:S;return C!=null?C:P.toFixed(2)+"m"}function v(b){t=b}return l}class wn{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=lt(),this.model=n,t.id===e.id)throw new Error("无效的线段, 一个点无法构成线段");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ae.Subscribe,this.points=[t,e],this.mesh=Lc(this,"normal"),this.lightMesh=Lc(this,"light"),this.distanceItem=v0({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new wn(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}function b0(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Dt{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=lt(),this.lines=[],this.position=new _.Vector3,t instanceof _.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){b0(t,this.lines)}clone(){return new Dt(this.position)}}let Vi=class{constructor(t){f(this,"id",lt());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new Ae.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("不能重复添加线段"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("传入线段无法与当前折线进行连接")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){const t=this.lines.slice();this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length),t.reduceRight((e,n)=>this.hook.emit("lineRemoved",n),void 0)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,d=e(l),h=e(c);if(!d||!h)throw new Error("线上的点不存在");const u=new wn(d,h,this.model);return u.id=a.id,u.text=a.text,u}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(d){const h=a.get(d.id);if(h)return h;const u=new Dt(d.position);return u.id=d.id,a.set(d.id,u),u}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}};class Uo{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new Ae.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("不能重复添加 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline 不存在"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Vi({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Xo=i=>i.preventDefault();let Zo=class{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new wn(new Dt([0,0,0]),new Dt([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Xo),e.addEventListener("contextmenu",Xo))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Xo),t.removeEventListener("contextmenu",Xo))}};function dr(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new _.Vector2(t,e).sub(new _.Vector2(s.left,s.top)),a=new _.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function hr(i,t){const e=dr(t).ndcPoint,n=new _.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Jo extends Zo{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",sr((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);n&&(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=hr(this.five,e);if(!(n!=null&&n.face))return;const o=new Dt(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=hr(this.five,e);n!=null&&n.face&&this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{this.pressPoint&&this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=hr(this.five,e);this.updateMouseGroup(n);const o=new Dt(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new wn(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{this.lastPoint&&(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Uo(this.config),this.polyline=new Vi({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Kt(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Tc extends Zo{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&(n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)}))})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Kt(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const y0=`
287
+ `,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",p),w.setAttribute("style","display: none"),w.innerHTML=b,w},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Vp,o.appendChild(s);const r={},a=(p,v)=>{if(e.loaded)throw new Error("标尺被重复初始化!");const b=_p(p,i),w=i.work;if(!w)return!1;for(const P in v){const M=v[P],{standingPosition:S}=w.observers[0],C=M.map(({x:z,z:x,observers:Y})=>{const J=Y.length>0?p.rooms[p.observers[Y[0]]].name:"",R=b[J]?b[J].floor:null;let Q=1/0,G={index:0,x:S.x,y:S.y,z:S.z};Y.forEach(ae=>{if(!w.observers[ae])return;const{standingPosition:se}=w.observers[ae],ye={index:ae,x:se.x,y:se.y,z:se.z},Ce=Bp({x:z,z:x},ye);R?Ce<Q&&Math.abs(ye.y-R)<.3&&(Q=Ce,G=ye):Ce<Q&&(Q=Ce,G=ye)});const N=new _.Vector3(z,G.y,x);Object.assign(N,{observers:Y});const F=b[J]?b[J].roof:null,Z=F?new _.Vector3(z,F,x):null;return Z&&Object.assign(Z,{observers:Y}),{origin:N,vertical:Z}});r[P]={origins:C.map(z=>z.origin),rules:[]};for(const{origin:z,vertical:x}of C){if(!x)continue;const Y=n(P,z.distanceTo(x));o.append(Y),r[P].rules.push({vertical:!0,rule:[z,x],$element:Y})}for(let z=0;z<C.length;z++){let x=z+1;x>=C.length&&(x=0);const{origin:Y}=C[z],{origin:J}=C[x],R=n(P,Y.distanceTo(J));o.append(R),r[P].rules.push({vertical:!1,rule:[Y,J],$element:R})}}return e.loaded=!0,!0},l=(p,v,b)=>U(this,null,function*(){const w=p||t.roomInfo,P=v||t.roomRules;if(!w||!P)throw new Error("标尺数据依赖不齐全!");return e.loaded=!1,e.options=W(W({},e.options),b||{}),i.model.loaded?a(w,P):yield new Promise(M=>i.once("modelLoaded",()=>M(a(w,P))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(p,v,b,w)=>{const P=[[{x:0,y:0},{x:b,y:0}],[{x:0,y:0},{x:0,y:w}],[{x:b,y:0},{x:b,y:w}],[{x:0,y:w},{x:b,y:w}]],M=[];for(let S=0;S<P.length;S++){const C=Cc([p,v],[P[S][0],P[S][1]],!0);C&&M.push(C)}return M.length===0?!1:M},d=()=>{var Y;const p=(Y=i.getElement())==null?void 0:Y.parentElement;if(!p||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:v,camera:b,currentMode:w}=i;if(v===void 0)return;let P;for(const J in r)J.split(",").indexOf(v.toString())>=0&&(P=J);if(!P){for(const J in r)for(const{$element:R}of r[J].rules)R.style.display="none";return}const M=b.position,S=b.getWorldDirection(new _.Vector3),C=p.clientWidth,z=p.clientHeight;if(w!==Ae.Five.Mode.Panorama){for(const J in r)for(const{$element:R}of r[J].rules)R.style.display="none";return}for(const J in r)for(const{$element:R}of r[J].rules)R.style.display=J===P?"block":"none";const[x]=r[P].origins.slice().filter(J=>J.observers.indexOf(v)>=0).sort((J,R)=>{const Q=J.clone().setY(0).sub(M).normalize().angleTo(S.clone().setY(0)),G=R.clone().setY(0).sub(M).normalize().angleTo(S.clone().setY(0));return Q-G});for(const{rule:J,vertical:R,$element:Q}of r[P].rules){const[G,N]=J,F=Q.querySelector(".PanoRulerPlugin-rule-line");if(!F)return;if(!x){Q.style.display="none";continue}if(G!==x&&N!==x){Q.style.display="none";continue}if(G.distanceTo(N)<.3){Q.style.display="none";continue}if(G.observers.indexOf(v)===-1||N.observers.indexOf(v)===-1){Q.style.display="none";continue}if(G.clone().sub(M).normalize().angleTo(S)>Math.PI/2){Q.style.display="none";continue}if(N.clone().sub(M).normalize().angleTo(S)>Math.PI/2){Q.style.display="none";continue}const q=G.distanceTo(N);if(N.clone().sub(N.clone().sub(G).divide(new _.Vector3(2,2,2))).distanceTo(M)/q>8){Q.style.display="none";continue}const ye=G.clone().project(b),Ce=(ye.x+1)/2*C,ve=(-ye.y+1)/2*z,Ve=N.clone().project(b),be=(Ve.x+1)/2*C,Fe=(-Ve.y+1)/2*z,fe=Math.sqrt(Math.pow(be-Ce,2)+Math.pow(Fe-ve,2));let we=fe,Te=50;const ge=c({x:~~Ce,y:~~ve},{x:~~be,y:~~Fe},C,z);if(ge&&ge.length===1&&(x===G?(we=Math.sqrt(Math.pow(ge[0].x-Ce,2)+Math.pow(ge[0].y-ve,2)),Te=we/fe*50):x===N&&(we=Math.sqrt(Math.pow(ge[0].x-be,2)+Math.pow(ge[0].y-Fe,2)),Te=100-we/fe*50)),ge&&ge.length===2){const re={x:(ge[0].x+ge[1].x)/2,y:(ge[0].y+ge[1].y)/2};Te=Math.sqrt(Math.pow(re.x-Ce,2)+Math.pow(re.y-ve,2))/fe*100}const dt=(Math.PI/2-Math.atan2(be-Ce,ve-Fe))/Math.PI*180,De=F.querySelector(".PanoRulerPlugin-rule-label"),ot=De.children[0].clientWidth;ot>=fe||ot/2>=Te/100*fe||ot/2>=(1-Te/100)*fe?F.style.display="none":(F.style.display="block",F.style.width=fe+"px",F.style.left=Ce+"px",F.style.top=ve+"px",F.style.transform=`rotate(${-dt}deg)`,De.style.left=`${Te}%`)}},h=()=>Pc(d),u=()=>{var p,v;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(v=(p=i.getElement())==null?void 0:p.parentElement)==null||v.append(o),d(),i.on("modeChange",d),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",d),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function A(p){if(p.distanceText&&p.distanceText!==e.options.distanceText){const v=p.distanceText;e.options.distanceText=v,Object.values(r).forEach(b=>{b.rules.forEach(w=>{const[P,M]=w.rule,S=P.distanceTo(M),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");C&&(C.innerText=v(S))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:A}};function Qp(i){me(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function Ec(i,t,e){const n=i.slice();return n[6]=t[e],n}function Rp(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Mc(Ec(i,e,o));return{c(){t=T("div");for(let o=0;o<n.length;o+=1)n[o].c();y(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(o,t,s);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=Ec(o,e,r);n[r]?n[r].p(a,s):(n[r]=Mc(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&O(t),Ft(n,o)}}}function Gp(i){let t,e;return{c(){t=T("em"),y(t,"class",e=Ne(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=Ne(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),o&8&&y(t,"style",n[3])},d(n){n&&O(t)}}}function Mc(i){let t,e,n=`${i[6].width}px`;return{c(){t=T("div"),y(t,"class",e=Ne(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3]),j(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=Ne(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),s&8&&y(t,"style",o[3]),(s&8||s&9&&n!==(n=`${o[6].width}px`))&&j(t,"width",n)},d(o){o&&O(t)}}}function Wp(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,d=`${i[0].left}px`,h=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(v,b){return v[0].children.length===0?Gp:Rp}let A=m(i),p=A(i);return{c(){t=T("div"),p.c(),e=ie(),n=T("div"),o=T("div"),r=Oe(s),y(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),tt(()=>i[4].call(o)),y(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),j(n,"left",l),y(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),j(t,"width",c),j(t,"left",d),j(t,"top",h),j(t,"transform",u),j(t,"display",i[0].visible&&i[2]?"block":"none")},m(v,b){V(v,t,b),p.m(t,null),B(t,e),B(t,n),B(n,o),B(o,r),a=Eo(o,i[4].bind(o))},p(v,[b]){A===(A=m(v))&&p?p.p(v,b):(p.d(1),p=A(v),p&&(p.c(),p.m(t,e))),b&1&&s!==(s=v[0].labelElement+"")&&Be(r,s),b&1&&l!==(l=`${v[0].labelOffset}%`)&&j(n,"left",l),b&1&&c!==(c=`${v[0].width}px`)&&j(t,"width",c),b&1&&d!==(d=`${v[0].left}px`)&&j(t,"left",d),b&1&&h!==(h=`${v[0].top}px`)&&j(t,"top",h),b&1&&u!==(u=`rotate(${v[0].rotateDeg}deg)`)&&j(t,"transform",u),b&5&&j(t,"display",v[0].visible&&v[2]?"block":"none")},i:K,o:K,d(v){v&&O(t),p.d(),a()}}}function Fp(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Hp extends de{constructor(t){super(),ce(this,t,Fp,Wp,le,{rulerItemProp:0},Qp)}}function kc(i,t,e){const n=i.slice();return n[12]=t[e],n}function Dc(i){let t,e;return t=new Hp({props:{rulerItemProp:i[12]}}),{c(){oe(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Yp(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Dc(kc(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=kc(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=Dc(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&O(t),Ft(o,r)}}}function Up(i,t,e){var p,v,b,w;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((v=(p=n.getElement())==null?void 0:p.parentElement)==null?void 0:v.clientWidth)||0,l=((w=(b=n.getElement())==null?void 0:b.parentElement)==null?void 0:w.clientHeight)||0,c=(P,M)=>{const S=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let z=0;z<S.length;z++){const x=Cc([P,M],[S[z][0],S[z][1]],!0);x&&C.push(x)}return C.length===0?!1:C},d=(P,M)=>{const S=P.clone().project(n.camera),C=(S.x+1)/2*a,z=(-S.y+1)/2*l,x=M.clone().project(n.camera),Y=(x.x+1)/2*a,J=(-x.y+1)/2*l,R=Math.sqrt(Math.pow(Y-C,2)+Math.pow(J-z,2));return{startLeft:C,startTop:z,endLeft:Y,endTop:J,distance:R}},h=(P,M,S)=>{const C=n.camera.position,z=n.camera.getWorldDirection(new _.Vector3),x=P.clone().sub(C).normalize().angleTo(z),Y=M.clone().sub(C).normalize().angleTo(z),J=P.distanceTo(M),Q=M.clone().sub(M.clone().sub(P).divide(new _.Vector3(2,2,2))).distanceTo(C),{startLeft:G,startTop:N,endLeft:F,endTop:Z,distance:X}=d(P,M),ae=-((Math.PI/2-Math.atan2(F-G,N-Z))/Math.PI)*180;let se=!0;S||(se=!1),!jt(P,S)&&!jt(M,S)&&(se=!1),J<.3&&(se=!1),x>Math.PI/2&&(se=!1),Y>Math.PI/2&&(se=!1),Q/J>8&&(se=!1);let ye=50,Ce=X;const ve=c({x:~~G,y:~~N},{x:~~F,y:~~Z});if(ve&&ve.length===1&&(jt(P,S)?(Ce=Math.sqrt(Math.pow(ve[0].x-G,2)+Math.pow(ve[0].y-N,2)),ye=Ce/X*50):jt(M,S)&&(Ce=Math.sqrt(Math.pow(ve[0].x-F,2)+Math.pow(ve[0].y-Z,2)),ye=100-Ce/X*50)),ve&&ve.length===2){const Ve={x:(ve[0].x+ve[1].x)/2,y:(ve[0].y+ve[1].y)/2};ye=Math.sqrt(Math.pow(Ve.x-G,2)+Math.pow(Ve.y-N,2))/X*100}return{startLeft:G,startTop:N,distance:X,deg:ae,visible:se,labelOffset:ye,ruleLength:J}},u=()=>{const P=n.panoIndex,M=o.find(R=>R.panoIndex===P);if(!M)return e(0,r=[]);if(n.currentMode!==Ae.Five.Mode.Panorama)return e(0,r=[]);const S=n.camera.position,C=n.camera.getWorldDirection(new _.Vector3),z=M.lines.map(R=>new _.Vector3(R.start[0],-R.start[1],-R.start[2])),x=M.lines.map(R=>new _.Vector3(R.end[0],-R.end[1],-R.end[2])),[Y]=z.concat(x).sort((R,Q)=>{const G=R.clone().setY(0).sub(S).normalize().angleTo(C.clone().setY(0)),N=Q.clone().setY(0).sub(S).normalize().angleTo(C.clone().setY(0));return G-N}),J=M.lines.map(R=>{var Ce,ve;const Q=R.start,G=R.end,{startLeft:N,startTop:F,distance:Z,deg:X,visible:q,labelOffset:ae,ruleLength:se}=h(new _.Vector3(Q[0],-Q[1],-Q[2]),new _.Vector3(G[0],-G[1],-G[2]),Y),ye=[];return R.children&&((Ce=R.children)==null?void 0:Ce.length)>0&&((ve=R.children)==null||ve.forEach(Ve=>{const be=Ve.start,Fe=Ve.end,{distance:fe}=d(new _.Vector3(be[0],-be[1],-be[2]),new _.Vector3(Fe[0],-Fe[1],-Fe[2]));ye.push({width:fe,state:Ve.state})})),{width:Z,left:N,top:F,rotateDeg:X,state:R.state,children:ye,labelOffset:ae,visible:q,labelElement:s.distanceText(se)}});e(0,r=J)},m=()=>wo(u),A=sr(u,80);return Mt(()=>{u(),n.on("panoArrived",u),n.on("modeChange",u),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>A()),n.on("pinchGesture",()=>A())}),on(()=>{n.off("panoArrived",u),n.off("modeChange",u),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>A()),n.off("pinchGesture",()=>A())}),i.$$set=P=>{"five"in P&&e(1,n=P.five),"rulerDatas"in P&&e(2,o=P.rulerDatas),"options"in P&&e(3,s=P.options)},[r,n,o,s]}class Xp extends de{constructor(t){super(),ce(this,t,Up,Yp,le,{five:1,rulerDatas:2,options:3})}}let Zp=class{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=W(W({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>U(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return U(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return U(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Xp({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}};const Jp=(i,t)=>new Zp(i,t),qp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAGfvXS06Zc5CFCePQt0y3EFaq61CX1ayjC56U8br24sKd+kAuJhkI55OSPi75pyIcvKNIEFgcgRDJ4hD3ewMZLDwDXqfOq9RNFCYOCAMPYx851BDjIXiWzky9Tpyvw0kOL/nc+Jh7DyGqko+P+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsxknztsDUnFvMfF8e+4X6j88F4hlTDT3de6BiAYsI0HgxgiESG4MYd8XkLEhrARZTKUxUWB0MXrkiA3wdYYQg8Xs2cmzaR977cCE8eSM6wYDsQiXSyOrulDPRUT3AbsxydAnYO9kz87HfH9Kxv3D976lNEk2ujf9ANE8GCe1OeEzgRLZD4EQyX44df8tGQ08iNdHCU+jnhGPDVG9bgAGGD3Iw8TB5xgjz3jr3CTxSEapxxAL7VxcCmGaQPe6n/qScWtSIcdLrD1FhxbtRZn4x/3rtanvlBtffq57UCcI5l6dVF9CaJEgcAWBEMkVOPo+0ODHwGNEIAxIwsRBea6vdxlMPsNwYFAcIoEsnB4WQ6hTqxOMqg1wU40rxEx/kCal6AKejEnGOSFKvE8mFiYaFV8S9AVP5oo3o+syKSA0ZoJxmTWZJvFSXSMLIzBnXBa+bS5/UwQ0oDECEIRDF87n+nSOMDAMkIUNU51v2TjM4SWo2pdi1E34L1W4mnRALFOJtZ0pQe/QNVItT3XNOzpxV8n5fdWjaxzrBqY8j8Cc0Zn/RT45OQIaoPQT3oUHMDnHUzPKuYFLqGJYZFXObNILroSmIi8jMIfjy9/s8EwhGu/0+s+4CdI5vBkmKngv6Bo5x3NbodFFQmQOk6l48VzXQdcgF6d7unePoU7aE5lBIEQyA8y5TmvgEZ5iwBJSeKMkBrHXJVS8lCljZ8IwaZgwFlswvqzNugpT2K6rhTtaI2PPBIN0hWSkn6zJmFSc7yIYSIj0Y6VBdA108nZJd5TjuSQsNqDT558QyZn7rQxMSKNO435hkE0NNEIXzPhIzPiY7cXDEBBHkE0TyRx+0i9vovhf/R3pMR6MPWWTB+syU+JQ2tvlQ8Ji6C/kArHcKfcpHydrHYGxwWq9vl3XT4MFr4JZHO4/3gbkMTXYxkYMEmHtAsJgNsegYxaH9xFZBgH6YMoLXOZunV+1TGCYxHzgpkjfCYPhrUAw5BAMJDLGlbAY44E0iH7LJAlSgVw+UuK5l6nJlD6KnBuBEMmCPaDBwACpiYOBwuCqB0S9xZYBxmfs4YcsGEjkiSsLhBML/VD304lv3//tykTnQ7WENIjGBDYHQoFcSEym2IaMWP/JCaG9VZKyi8f6LaRSE8t4wsX3ImdAIERyRNALcTBIGByeYY13v4yJg+P7SiaOhKcERgMSI7VAJ4hcWGjHwyANonFTh8UYO3gv440kjKPvlqTs4llFLEy4GDfpM5A5g4RIbgi6lNkeh8NV4wEwVm7CUSg+CfLAZR9/R6cjZ0YgfXKiDpD+e2F/CIuVCRnjyh4L5DLeLYbXUu8Sg1gYUwNJ6ZoPVI6cCAE6I3IAAlJW3HCTBl6H3fK5qxCmMnGwiMiWy0jjCKiff6kqDuNDffbbxqu7+uqpP3iAEkJx2mfcOQx2W32YV74sqCUhkmvAlQLjUjMzcqiKxcJdwuwKT2NIUmAWDSOdIaB+/4WrrD78ncvJ20BA/cMmFcalE+GxXcJmFa+x3FWf1iHmXb/LZ3sgkNDWBEhSUhb67DYzA6rDVeOQBy/3gzQGJZWC5nkNgbECGffzCpq0niaUCRqTtH/RqjJmPdmDXMYvtoR4SD9U4kHJOgyWMStQbiLxSISelAoc6rUOFG5O2MnD4ni9xpHdPXNodXpeOvG+qy6j9XuXk7ePQDWeIRQmgizeT9k6zjF2IaRhbUV5thkLhENlCtxDr9Hl96VseGMommcxu7wzwlUmDnaHxC3ustf3r7T04z1/W/39B5eT94eA+pLw9OtKJpZdYTB2ldUhsLzOZY8u32U89/h5X1+RQuHuQhyErVCsmkjrUAazlHtKkEeeshUIGxT0odaPDUKwjiaXiZ/JwWEwL9qP7QBh7DdLkskY3hWGt8KC/eX/qFkHMsdrxeoHihSBbYP2OnBx58RrHZBHvI45lDZyXnrzrpsqA/JHl5OvCwH1s70ViAWPZby2Ujf4vg4GQpJO5K0SFTKrJBIpB1sDUQwIZNcuK2Kjd0v6RMqRtQ6BERnWzX5uHKQXf3I5+XoRkN3AHrLNGEIh7Vor9S4wIhab31q8GiKpyAMCQRmmBKLgOQ68DrYAbl4BpkDKuYFIfiYchvEhPflzMNkeAsWmQCi2KXP2kgkpnspmSWUOmC60Rh3NGg+dTJrzPCAPZg+D5yGjkDinwIjsRkC69VN/QzrzF5eTbxMB6QMhL3sq2Jo524mt8drqZhbq58BoVlvUocQ0WeswebA45pAU7XGZVyTcI8kQbKZD1d7IERCQnr3jy0h//upy8iAg3WACyyI9iccGbEexPbZBnsBCKrype9U7PbvYtaWOgyyYBTAjgET8gCCdxe4ak4c9j9V3nNocWRaBehffsnfK1btCoExMh+dOqokttslRERMLIXbO8QAkC/VERT7W71enW26w2teeCPz6raB4IlPiV5JAHvE8phDKuYMRkO79xD+SXv3N5eRBYA4B6QwTcya6kMrcsyp4JkRKWKPFdq1CmiOSUWfMvZiNRXIYPv/caRVq2F4jpIdvu1Ya8H93OXkQ2AcB6Q+PHUAqpDk7xqtZIJXuJ8FNEIlApx64gYA+t5DFIjnrHrzCIO/GERCR5RCQTv5IVx9CptK3fyx3p1x57QhIl/x/7llPmXpOBT1jNymk0uVjCGclkoq1AXhqvQaAWffA+3ioAe21EB1GgsByCEg3f+CrS+/+6XLyIPCqCEinsLeEvHZNmAnPM2HuKtpyciIpYNr7AFTIwfVwGY8DMFe5MKV2RRpHQHr6lqsoIvnA5eRB4BgISL+8gYhJNB4LYvvnCTN2kEl0816KDTiNWFQEHC4doBG68q6r+p7sZMD7gDzy+oEamZRPjoD09fu66TA+pI//PnkFcsPNICBdYz0Fu3idbSSs3+RzcIsSiQDi+ngdAGTWVfGKsHOB+GBCV1dgycE5EZDufs/31+D9r8vJg8BSCFT2kojN3K4vvBQm3E3Zy0WIRICwVRcwSFPbdu194LKt+kEdtT/SIQLS4Tddbenohy4nDwKnQGAPG4rdZALehA09KpGo8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Kp(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${qp})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"㎡"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const $p=new E.TextureLoader;function zi(i){return U(this,null,function*(){return new Promise((t,e)=>{$p.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t))})}const Ho={userAction:!0};class e0 extends yn{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:this.absoluteUrl("/release/web/v3/north-point-circle.96498e69.png"),entryDoorImageUrl:this.absoluteUrl("/release/web/enterDoor.831b8208.png")}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,d;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=yo(1e3).onUpdate(({progress:h})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(d=this.entryDoorMesh)==null||d.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ae.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:W(W({},this.state.config),n||{})})}enable(e=Ho){this.setState({enabled:!0},e)}disable(e=Ho){this.setState({enabled:!1},e)}show(e=Ho){if(this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Ho){if(this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:W(W({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return U(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=W({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return U(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Kp(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return U(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield zi(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return U(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield zi(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Io(this.five).create3DDomContainer(e)}}const t0=(i,t)=>new e0(i,t);function Yo(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function n0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Yo(i,a*4+0,l*4+0),Yo(i,a*4+1,l*4+1),Yo(i,a*4+2,l*4+2),Yo(i,a*4+3,l*4+3)}}}class xc{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ae.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Kt(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left="90px"):s<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const v=this.renderCenter.clone().project(this.five.camera);return[(v.x+1)/2*s.x,(v.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,d=o/t,h=l*t,u=this.five.getPixels(r-c/2,a-c/2,c,d,h),m=Math.floor(n*l),A=Math.floor(o*l);n0(u,m,A);const p=new ImageData(m,A);p.data.set(u),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),d=Math.min(Math.max(l,o),r);return{translateX:c,translateY:d}}}class i0{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{this.five.model&&(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new _.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}const o0=1,s0=3,r0=new _.Color(16777215),a0=new _.Color(6522623),l0=new _.Color(16777215),c0=new _.Color(6522623),d0=6,h0=8,u0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Sc=new _.TextureLoader().load(u0),f0={pointTexture:Sc,pointSize:d0,lineWidth:o0,lineColor:r0,pointColor:l0,lineRenderOrder:20,pointsRenderOrder:20},m0={pointTexture:Sc,pointSize:h0,lineWidth:s0,lineColor:a0,pointColor:c0,lineRenderOrder:10,pointsRenderOrder:10};function g0(i,t,e){var d,h,u,m,A;const n=(d=e==null?void 0:e.lineWidth)!=null?d:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new _.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(A=e==null?void 0:e.lineRenderOrder)!=null?A:20,l=new lo.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Lc(i,t){const[e,n]=i.points,o=t==="light"?m0:f0,s=g0(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function Oi(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function cr(i){const{z:t}=i;return!(Math.abs(t)>1)}function p0(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function A0(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function v0(i){let t=!0;const{line:e}=i,n=e.id,o=p0(),s=A0(e),r=i.userDistanceItem,a=new _.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:u,appendTo:m,remove:A,highlight:d,unHighlight:h,getCurrentContent:p,setItemSelectable:v};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var b;(b=i.clickCallback)==null||b.call(i,l)}function d(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function u(b){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const w=b.getElement();if(!w)return;const P=w.clientWidth,M=w.clientHeight,S=P/2,C=M/2;if(e.points.length<2)return;const[z,x]=e.points,Y=z.position.clone().project(b.camera),J=x.position.clone().project(b.camera),R=Y.clone().lerp(J,.5),Q=new _.Vector2(Y.x*S,Y.y*C),G=new _.Vector2(J.x*S,J.y*C),N=Q.distanceTo(G);if((()=>!(Math.abs(Y.z)>1||Math.abs(J.z)>1||!cr(Y)&&!cr(J)||!cr(R)||N===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const Z=(R.x+1)/2*P,X=-(R.y-1)/2*M,ae=-(Math.atan((Q.y-G.y)/(Q.x-G.x))*180)/Math.PI,se=s.parentElement&&o.clientWidth>N?-20:0;s.style.transform=`translate(${Z}px, ${X}px) rotate(${ae}deg) translateY(${se}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const ye=p();o.innerText=ye}function m(b){b.appendChild(s),s.addEventListener("click",c)}function A(){o.removeEventListener("click",c),s.remove()}function p(){var z,x,Y;if(e.points.length<2)return"";const[b,w]=e.points,P=b.position.clone().distanceTo(w.position),M=(z=i.line.text)!=null?z:i.line.model.config.defaultText,S=(Y=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:Y.call(x,P),C=M!=null?M:S;return C!=null?C:P.toFixed(2)+"m"}function v(b){t=b}return l}class wn{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=lt(),this.model=n,t.id===e.id)throw new Error("无效的线段, 一个点无法构成线段");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ae.Subscribe,this.points=[t,e],this.mesh=Lc(this,"normal"),this.lightMesh=Lc(this,"light"),this.distanceItem=v0({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new wn(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}function b0(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Dt{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=lt(),this.lines=[],this.position=new _.Vector3,t instanceof _.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){b0(t,this.lines)}clone(){return new Dt(this.position)}}let Vi=class{constructor(t){f(this,"id",lt());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new Ae.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("不能重复添加线段"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("传入线段无法与当前折线进行连接")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){const t=this.lines.slice();this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length),t.reduceRight((e,n)=>this.hook.emit("lineRemoved",n),void 0)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,d=e(l),h=e(c);if(!d||!h)throw new Error("线上的点不存在");const u=new wn(d,h,this.model);return u.id=a.id,u.text=a.text,u}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(d){const h=a.get(d.id);if(h)return h;const u=new Dt(d.position);return u.id=d.id,a.set(d.id,u),u}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}};class Uo{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new Ae.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("不能重复添加 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline 不存在"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Vi({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Xo=i=>i.preventDefault();let Zo=class{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new wn(new Dt([0,0,0]),new Dt([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Xo),e.addEventListener("contextmenu",Xo))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Xo),t.removeEventListener("contextmenu",Xo))}};function dr(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new _.Vector2(t,e).sub(new _.Vector2(s.left,s.top)),a=new _.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function hr(i,t){const e=dr(t).ndcPoint,n=new _.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Jo extends Zo{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",sr((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);n&&(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=hr(this.five,e);if(!(n!=null&&n.face))return;const o=new Dt(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=hr(this.five,e);n!=null&&n.face&&this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{this.pressPoint&&this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=hr(this.five,e);this.updateMouseGroup(n);const o=new Dt(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new wn(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{this.lastPoint&&(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Uo(this.config),this.polyline=new Vi({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Kt(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Tc extends Zo{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&(n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)}))})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Kt(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const y0=`
288
288
  <svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
289
289
  <defs>
290
290
  <linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">