@realsee/dnalogel 2.21.0-dev.12 → 2.21.0-dev.13

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 (308) hide show
  1. package/dist/index.cjs.js +3 -3
  2. package/dist/index.js +4 -4
  3. package/dist/index.umd.js +3 -3
  4. package/docs/classes/CSS3DRender.html +30 -30
  5. package/docs/classes/CruisePluginController.html +25 -25
  6. package/docs/classes/GuideLineItem.GuideLineItem.html +19 -19
  7. package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +34 -34
  8. package/docs/classes/Magnifier.html +19 -19
  9. package/docs/classes/ModelRoomLabelController.html +10 -10
  10. package/docs/classes/Object3DHelperController.html +24 -24
  11. package/docs/classes/PaintBrush.html +14 -14
  12. package/docs/classes/PanoMeasurePluginLine.html +26 -26
  13. package/docs/classes/PanoMeasurePluginModel.html +26 -26
  14. package/docs/classes/PanoMeasurePluginPoint.html +13 -13
  15. package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
  16. package/docs/classes/PanoTagPluginController.html +46 -46
  17. package/docs/classes/Util.BetterTween.html +8 -8
  18. package/docs/classes/Util.Interval.html +11 -11
  19. package/docs/classes/Util.Magnifier.html +19 -19
  20. package/docs/classes/Util.PointDomHelper.html +10 -10
  21. package/docs/classes/Util.PointHelper.html +10 -10
  22. package/docs/classes/Util.PointSelectorHelper.html +15 -15
  23. package/docs/classes/Util.Rectangle.html +12 -12
  24. package/docs/enums/CameraMovementEffect.html +6 -6
  25. package/docs/enums/ContentType.html +19 -19
  26. package/docs/enums/DIRECTION.html +8 -8
  27. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +8 -8
  28. package/docs/enums/DimensionType.html +6 -6
  29. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +7 -7
  30. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +8 -8
  31. package/docs/enums/PaintBrushTypeEnum.html +7 -7
  32. package/docs/enums/PointType.html +6 -6
  33. package/docs/enums/Rotation.html +7 -7
  34. package/docs/functions/CSS3DRenderPlugin.html +3 -3
  35. package/docs/functions/CameraMovementPlugin.html +3 -3
  36. package/docs/functions/CruisePlugin.html +3 -3
  37. package/docs/functions/GuideLinePlugin.html +4 -4
  38. package/docs/functions/ItemLabelPlugin.html +3 -3
  39. package/docs/functions/MapviewFloorplanPlugin.html +3 -3
  40. package/docs/functions/ModelChassisCompassPlugin.html +3 -3
  41. package/docs/functions/ModelEntryDoorGuidePlugin.html +3 -3
  42. package/docs/functions/ModelFloorplanPlugin.html +3 -3
  43. package/docs/functions/ModelItemLabelPlugin.html +3 -3
  44. package/docs/functions/ModelRoomLabelPlugin.html +3 -3
  45. package/docs/functions/ModelTVVideoPlugin.html +3 -3
  46. package/docs/functions/ModelViewPlugin.html +3 -3
  47. package/docs/functions/Object3DHelperPlugin.html +3 -3
  48. package/docs/functions/PanoCompassPlugin.html +3 -3
  49. package/docs/functions/PanoCursorRaycasterPlugin.html +3 -3
  50. package/docs/functions/PanoDoorLabelPlugin.html +3 -3
  51. package/docs/functions/PanoFloorplanRadarPlugin.html +3 -3
  52. package/docs/functions/PanoMeasurePlugin.html +3 -3
  53. package/docs/functions/PanoRulerPlugin.html +3 -3
  54. package/docs/functions/PanoRulerProPlugin.html +3 -3
  55. package/docs/functions/PanoSpatialTagPlugin.html +3 -3
  56. package/docs/functions/PanoTagPlugin.html +3 -3
  57. package/docs/functions/PanoVideoPlugin.html +3 -3
  58. package/docs/functions/TopviewFloorplanPlugin.html +3 -3
  59. package/docs/functions/Util.absoluteUrl.html +4 -4
  60. package/docs/functions/Util.getCoordsFromClient.html +4 -4
  61. package/docs/functions/Util.getCoordsFromElement.html +4 -4
  62. package/docs/functions/Util.getFrameTime.html +4 -4
  63. package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
  64. package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
  65. package/docs/functions/Util.isAbsoluteURL.html +4 -4
  66. package/docs/functions/Util.isModelLike.html +4 -4
  67. package/docs/functions/Util.isNil.html +4 -4
  68. package/docs/functions/Util.isPanoramaLike.html +4 -4
  69. package/docs/functions/Util.nextFrame.html +4 -4
  70. package/docs/functions/Util.notNil.html +4 -4
  71. package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
  72. package/docs/functions/Util.tweenProgress.html +4 -4
  73. package/docs/functions/Util.uuid.html +4 -4
  74. package/docs/functions/pluginFlag.html +4 -4
  75. package/docs/index.html +4 -4
  76. package/docs/interfaces/AddTagConfig.html +5 -5
  77. package/docs/interfaces/CSS3DRenderPluginEventMap.html +10 -10
  78. package/docs/interfaces/CSS3DRenderPluginState.html +7 -7
  79. package/docs/interfaces/CameraMovementPluginExportType.html +6 -6
  80. package/docs/interfaces/CruisePluginTypes.Config.html +7 -7
  81. package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +11 -11
  82. package/docs/interfaces/CruisePluginTypes.EventMap.html +19 -19
  83. package/docs/interfaces/CruisePluginTypes.MoveAction.html +11 -11
  84. package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +13 -13
  85. package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +13 -13
  86. package/docs/interfaces/CruisePluginTypes.PluginData.html +8 -8
  87. package/docs/interfaces/CruisePluginTypes.PluginServerData.html +6 -6
  88. package/docs/interfaces/CruisePluginTypes.PluginState.html +10 -10
  89. package/docs/interfaces/EventMap.html +14 -14
  90. package/docs/interfaces/FloorplanBounding.html +7 -7
  91. package/docs/interfaces/FloorplanData.html +9 -9
  92. package/docs/interfaces/FloorplanEntrance.html +10 -10
  93. package/docs/interfaces/FloorplanExtraObject.html +9 -9
  94. package/docs/interfaces/FloorplanExtraObject3D.html +7 -7
  95. package/docs/interfaces/FloorplanFloorData.html +8 -8
  96. package/docs/interfaces/FloorplanImagePosition.html +6 -6
  97. package/docs/interfaces/FloorplanObserver.html +8 -8
  98. package/docs/interfaces/FloorplanOutlineItem.html +8 -8
  99. package/docs/interfaces/FloorplanPosition.html +6 -6
  100. package/docs/interfaces/FloorplanRoomItem.html +12 -12
  101. package/docs/interfaces/FloorplanRoomLabelItem.html +6 -6
  102. package/docs/interfaces/FloorplanServerBounding.html +7 -7
  103. package/docs/interfaces/FloorplanServerComputedData.html +9 -9
  104. package/docs/interfaces/FloorplanServerData.html +6 -6
  105. package/docs/interfaces/FloorplanServerDoorItem.html +9 -9
  106. package/docs/interfaces/FloorplanServerDoorPosition.html +7 -7
  107. package/docs/interfaces/FloorplanServerEntrance.html +10 -10
  108. package/docs/interfaces/FloorplanServerFloorData.html +8 -8
  109. package/docs/interfaces/FloorplanServerImagePosition.html +6 -6
  110. package/docs/interfaces/FloorplanServerObserver.html +8 -8
  111. package/docs/interfaces/FloorplanServerOutlineItem.html +8 -8
  112. package/docs/interfaces/FloorplanServerPosition.html +6 -6
  113. package/docs/interfaces/FloorplanServerRoomItem.html +13 -13
  114. package/docs/interfaces/FloorplanServerRoomLabelItem.html +6 -6
  115. package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +7 -7
  116. package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +9 -9
  117. package/docs/interfaces/GuideLinePluginType.EventMap.html +12 -12
  118. package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +7 -7
  119. package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +5 -5
  120. package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +12 -12
  121. package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +7 -7
  122. package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +17 -17
  123. package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +6 -6
  124. package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +17 -17
  125. package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +4 -4
  126. package/docs/interfaces/GuideLinePluginType.PluginServerData.html +6 -6
  127. package/docs/interfaces/GuideLinePluginType.PluginState.html +7 -7
  128. package/docs/interfaces/GuideLinePluginType.Route.html +10 -10
  129. package/docs/interfaces/GuideLinePluginType.RouteConfig.html +8 -8
  130. package/docs/interfaces/HelperOffset.html +7 -7
  131. package/docs/interfaces/ImagePlaneGroup.html +5 -5
  132. package/docs/interfaces/ItemLabelPluginData.html +5 -5
  133. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +10 -10
  134. package/docs/interfaces/ItemLabelPluginParametersType.html +8 -8
  135. package/docs/interfaces/MinMax.html +6 -6
  136. package/docs/interfaces/ModelChassisCompassPluginData.html +6 -6
  137. package/docs/interfaces/ModelChassisCompassPluginExportType.html +7 -7
  138. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +6 -6
  139. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +7 -7
  140. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +7 -7
  141. package/docs/interfaces/ModelItemLabelPluginData.html +5 -5
  142. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +10 -10
  143. package/docs/interfaces/ModelItemLabelPluginParametersType.html +6 -6
  144. package/docs/interfaces/ModelRoomLabelPluginData.html +5 -5
  145. package/docs/interfaces/ModelTVVideoPluginData.html +8 -8
  146. package/docs/interfaces/ModelTVVideoPluginExportType.html +7 -7
  147. package/docs/interfaces/ModelTVVideoPluginParameterType.html +5 -5
  148. package/docs/interfaces/ModelViewPluginExportType.html +10 -10
  149. package/docs/interfaces/Object3DHelperState.html +7 -7
  150. package/docs/interfaces/ObjectHelperControllers.html +8 -8
  151. package/docs/interfaces/PaintBrushAction.html +11 -11
  152. package/docs/interfaces/PaintBrushConfigs.html +11 -11
  153. package/docs/interfaces/PaintBrushState.html +9 -9
  154. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +9 -9
  155. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
  156. package/docs/interfaces/PanoMeasureParameterType.html +14 -14
  157. package/docs/interfaces/PanoMeasurePluginLineJson.html +7 -7
  158. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +6 -6
  159. package/docs/interfaces/PanoMeasurePluginPointJson.html +6 -6
  160. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +7 -7
  161. package/docs/interfaces/PanoRulerPluginExportType.html +9 -9
  162. package/docs/interfaces/PanoRulerPluginOptions.html +6 -6
  163. package/docs/interfaces/PanoRulerPluginParameterType.html +7 -7
  164. package/docs/interfaces/PanoRulerProPluginExportType.html +8 -8
  165. package/docs/interfaces/PanoRulerProPluginOptions.html +6 -6
  166. package/docs/interfaces/PanoRulerProPluginParameterType.html +6 -6
  167. package/docs/interfaces/PanoRulerProPluginState.html +7 -7
  168. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
  169. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
  170. package/docs/interfaces/PanoSpatialTagPluginData.html +10 -10
  171. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +9 -9
  172. package/docs/interfaces/PanoSpatialTagPluginExportType.html +12 -12
  173. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +9 -9
  174. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +12 -12
  175. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +10 -10
  176. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +9 -9
  177. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +5 -5
  178. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +7 -7
  179. package/docs/interfaces/PanoVideoPluginType.PluginData.html +5 -5
  180. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +8 -8
  181. package/docs/interfaces/PanoVideoPluginType.PluginState.html +5 -5
  182. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +7 -7
  183. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +9 -9
  184. package/docs/interfaces/Point.html +7 -7
  185. package/docs/interfaces/Room.html +8 -8
  186. package/docs/interfaces/RoomInfo.html +6 -6
  187. package/docs/interfaces/RoomLabel.html +13 -13
  188. package/docs/interfaces/RoomRules.html +4 -4
  189. package/docs/interfaces/Rooms.html +4 -4
  190. package/docs/interfaces/Scissor.html +8 -8
  191. package/docs/interfaces/State.html +7 -7
  192. package/docs/interfaces/TagCacheInterface.html +11 -11
  193. package/docs/interfaces/TagConfig.html +12 -12
  194. package/docs/interfaces/TagGLTFObjectGroup.html +5 -5
  195. package/docs/interfaces/TagIconUrl.html +11 -11
  196. package/docs/interfaces/TagObjectGroup.html +5 -5
  197. package/docs/interfaces/TagStyle.html +5 -5
  198. package/docs/interfaces/Tags.html +8 -8
  199. package/docs/interfaces/TemporaryState.html +5 -5
  200. package/docs/interfaces/Util.MagnifierParameter.html +10 -10
  201. package/docs/interfaces/Util.MouseGroupParameter.html +7 -7
  202. package/docs/interfaces/Util.PointIntersection.html +7 -7
  203. package/docs/modules/CruisePluginTypes.html +4 -4
  204. package/docs/modules/GuideLineItem.html +4 -4
  205. package/docs/modules/GuideLineModeItem.html +4 -4
  206. package/docs/modules/GuideLinePluginType.html +4 -4
  207. package/docs/modules/PanoVideoPluginType.html +4 -4
  208. package/docs/modules/Util.html +4 -4
  209. package/docs/modules.html +4 -4
  210. package/docs/types/ArrayPosition.html +4 -4
  211. package/docs/types/AudioAppearance.html +4 -4
  212. package/docs/types/AudioTagTypeConfigKey.html +4 -4
  213. package/docs/types/CSS3DRenderExportType.html +4 -4
  214. package/docs/types/CSS3DRenderPluginExportType.html +4 -4
  215. package/docs/types/CSS3DRenderPluginParameterType.html +4 -4
  216. package/docs/types/ClassFunctionParameters.html +4 -4
  217. package/docs/types/Color.html +4 -4
  218. package/docs/types/ContentTypeConfigKey.html +4 -4
  219. package/docs/types/ContentTypeConfigKeySplit.html +4 -4
  220. package/docs/types/ContentTypeMap.html +4 -4
  221. package/docs/types/Create3DDomContainerReturnType.html +4 -4
  222. package/docs/types/Create3DElementReturnType.html +4 -4
  223. package/docs/types/CruisePluginExportType.html +4 -4
  224. package/docs/types/CruisePluginTypes.CruiseData.html +4 -4
  225. package/docs/types/CruisePluginTypes.MoveEffect.html +4 -4
  226. package/docs/types/DeprecatedMediaPlaneProperty.html +4 -4
  227. package/docs/types/DeprecatedTagProperty.html +4 -4
  228. package/docs/types/Direction-1.html +4 -4
  229. package/docs/types/Direction4.html +4 -4
  230. package/docs/types/ElementRenderer.html +4 -4
  231. package/docs/types/FloorplanRuleLabels.html +4 -4
  232. package/docs/types/FloorplanServerRuleLabels.html +4 -4
  233. package/docs/types/GuideLinePluginExportType.html +4 -4
  234. package/docs/types/GuideLinePluginType.GuideLineItem.html +4 -4
  235. package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +4 -4
  236. package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +4 -4
  237. package/docs/types/GuideLinePluginType.GuideLineStyle.html +4 -4
  238. package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +4 -4
  239. package/docs/types/GuideLinePluginType.PathItem.html +4 -4
  240. package/docs/types/GuideLinePluginType.PluginData.html +4 -4
  241. package/docs/types/HelperEventMap.html +4 -4
  242. package/docs/types/LoadTagConfig.html +4 -4
  243. package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
  244. package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
  245. package/docs/types/MediaData.html +4 -4
  246. package/docs/types/MediaStore.html +4 -4
  247. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
  248. package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
  249. package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
  250. package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
  251. package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
  252. package/docs/types/MoveArgs.html +4 -4
  253. package/docs/types/MoveOpts.html +4 -4
  254. package/docs/types/Object3DHelperEventMap.html +4 -4
  255. package/docs/types/ObjectFit.html +4 -4
  256. package/docs/types/PaintBrushEventMap.html +4 -4
  257. package/docs/types/PanoCompassPluginData.html +4 -4
  258. package/docs/types/PanoCompassPluginExportType.html +4 -4
  259. package/docs/types/PanoCompassPluginParameterType.html +4 -4
  260. package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
  261. package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
  262. package/docs/types/PanoIndex.html +4 -4
  263. package/docs/types/PanoMeasurePluginEvent.html +4 -4
  264. package/docs/types/PanoMeasureReturnType.html +4 -4
  265. package/docs/types/PanoSpatialTagPluginId.html +4 -4
  266. package/docs/types/PanoTagPluginExportInterface.html +4 -4
  267. package/docs/types/PanoTagPluginParamsInterface.html +4 -4
  268. package/docs/types/PanoVideoPluginParameterType.html +4 -4
  269. package/docs/types/PanoVideoPluginReturnType.html +4 -4
  270. package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +4 -4
  271. package/docs/types/PlaneTag.html +4 -4
  272. package/docs/types/Point2DTag.html +4 -4
  273. package/docs/types/Point3DTag.html +4 -4
  274. package/docs/types/PointTag.html +4 -4
  275. package/docs/types/PointTagInstance.html +4 -4
  276. package/docs/types/Position.html +4 -4
  277. package/docs/types/RotateArgs.html +4 -4
  278. package/docs/types/RotateOpts.html +4 -4
  279. package/docs/types/RuleLabelsKey.html +4 -4
  280. package/docs/types/RuleLabelsValue.html +4 -4
  281. package/docs/types/StickType.html +4 -4
  282. package/docs/types/Tag.html +4 -4
  283. package/docs/types/Tag2D.html +4 -4
  284. package/docs/types/Tag3D.html +4 -4
  285. package/docs/types/TagContentType.html +4 -4
  286. package/docs/types/TagDimensionType.html +4 -4
  287. package/docs/types/TagElement.html +4 -4
  288. package/docs/types/TagEvents.html +4 -4
  289. package/docs/types/TagGLTFObject.html +4 -4
  290. package/docs/types/TagHooks.html +4 -4
  291. package/docs/types/TagId.html +4 -4
  292. package/docs/types/TagInstance.html +4 -4
  293. package/docs/types/TagPointType.html +4 -4
  294. package/docs/types/TagRendererMap.html +4 -4
  295. package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
  296. package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
  297. package/docs/types/WorkCode.html +4 -4
  298. package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
  299. package/docs/variables/PLUGIN.html +4 -4
  300. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
  301. package/docs/variables/ROOM_TYPE_MAP.html +4 -4
  302. package/docs/variables/itemLabelPluginServerParams.html +4 -4
  303. package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
  304. package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
  305. package/libs/PanoMeasurePlugin/Modules/GuideController.js +2 -2
  306. package/libs/base/BasePlugin.js +1 -1
  307. package/libs/shared-utils/logger.js +1 -1
  308. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ku=Object.defineProperty,$u=Object.defineProperties;var ef=Object.getOwnPropertyDescriptors;var Xa=Object.getOwnPropertySymbols;var tf=Object.prototype.hasOwnProperty,nf=Object.prototype.propertyIsEnumerable;var Ar=(i,t,e)=>t in i?Ku(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,H=(i,t)=>{for(var e in t||(t={}))tf.call(t,e)&&Ar(i,e,t[e]);if(Xa)for(var e of Xa(t))nf.call(t,e)&&Ar(i,e,t[e]);return i},Ae=(i,t)=>$u(i,ef(t));var f=(i,t,e)=>(Ar(i,typeof t!="symbol"?t+"":t,e),e);var U=(i,t,e)=>new Promise((n,s)=>{var o=l=>{try{a(e.next(l))}catch(c){s(c)}},r=l=>{try{a(e.throw(l))}catch(c){s(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,r);a((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("@realsee/five"),R=require("three"),Us=require("three/examples/jsm/renderers/CSS3DRenderer"),is=require("hammerjs"),ih=require("@realsee/five/line"),sh=require("three/examples/jsm/loaders/FBXLoader"),sf=require("earcut"),Za=require("animejs"),of=require("@realsee/five/gltf-loader");function rf(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=rf(R);function af(){console.debug("%c %c@realsee/dnalogel %cv2.21.0-dev.12",["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 lf(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const s=document.createElement("canvas");return s.width=e,s.height=n,s}})}function oh(){}const Ja=()=>Promise.resolve(),qa={__queue:Promise.resolve()};function cf(i=Ja){qa.__queue=qa.__queue.then(i).catch(Ja)}function Cs(i,t,e){const n=i.x,s=i.y,o=Math.floor(n/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function vr(i,t,e){const{x:n,y:s}=i,o=n*t,r=s*e;return{x:o,y:r}}function Is(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 df(i,t,e=oh){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const hf=window,Ka=window.requestAnimationFrame||hf.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function Hs(i,t=0){t<=0?Ka(i):Ka(()=>Hs(i,t-1))}var xt=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-xt.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?xt.Bounce.In(i*2)*.5:xt.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}}}}),ei=function(){return performance.now()},rh=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=ei()),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 s=0;s<n.length;s++){var o=this._tweens[n[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[n[s]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),kn={Linear:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=kn.Utils.Linear;return t<0?o(i[0],i[1],n):t>1?o(i[e],i[e-1],e-n):o(i[s],i[s+1>e?e:s+1],n-s)},Bezier:function(i,t){for(var e=0,n=i.length-1,s=Math.pow,o=kn.Utils.Bernstein,r=0;r<=n;r++)e+=s(1-t,n-r)*s(t,r)*i[r]*o(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=kn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(s=Math.floor(n=e*(1+t))),o(i[(s-1+e)%e],i[s],i[(s+1)%e],i[(s+2)%e],n-s)):t<0?i[0]-(o(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(o(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):o(i[s?s-1:0],i[s],i[e<s+1?e:s+1],i[e<s+2?e:s+2],n-s)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=kn.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,s){var o=(e-i)*.5,r=(n-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},la=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Nr=new rh,mo=function(){function i(t,e){e===void 0&&(e=Nr),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=xt.Linear.None,this._interpolationFunction=kn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=la.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=ei()),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 s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}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,s,o){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 g=a;for(var b in g)e[r][b]=g[b];s[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var y={};for(var b in h)y[b]=h[b];n[r]=h=y}this._setupProperties(g,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=n[r].slice().reverse():s[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=ei()),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=ei()),!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=Nr),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=xt.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=kn.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=ei()),e===void 0&&(e=!0),this._isPaused)return!0;var n,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)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),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===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,s){for(var o in n)if(e[o]!==void 0){var r=e[o]||0,a=n[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},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}(),uf="20.0.3",ff=la.nextId,Ht=Nr,mf=Ht.getAll.bind(Ht),gf=Ht.removeAll.bind(Ht),pf=Ht.add.bind(Ht),ah=Ht.remove.bind(Ht),Af=Ht.update.bind(Ht),$a={Easing:xt,Group:rh,Interpolation:kn,now:ei,Sequence:la,nextId:ff,Tween:mo,VERSION:uf,getAll:mf,removeAll:gf,add:pf,remove:ah,update:Af};function vf(i,t,e,n=xt.Linear.None){const s=new mo(i).to(t,e).easing(n).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var qt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(qt||{});const Xi=Symbol("$$PAINT_BRUSH_EVENT$$");function Ps(i){return i[Xi]||(i[Xi]={}),i[Xi]}function bf(i){i[Xi]||delete i[Xi]}let yf=class{hasListener(t){const e=Ps(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const s=Ps(this);return s[t]||(s[t]=[]),s[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){bf(this);return}const n=Ps(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const o=Ps(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function an(){return((1+Math.random())*65536|0).toString(16).substring(1)}function at(){return(an()+an()+"-"+an()+"-4"+an().substr(0,3)+"-"+an()+"-"+an()+an()+an()).toLowerCase()}const wf=`
1
+ "use strict";var Ku=Object.defineProperty,$u=Object.defineProperties;var ef=Object.getOwnPropertyDescriptors;var Xa=Object.getOwnPropertySymbols;var tf=Object.prototype.hasOwnProperty,nf=Object.prototype.propertyIsEnumerable;var Ar=(i,t,e)=>t in i?Ku(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,H=(i,t)=>{for(var e in t||(t={}))tf.call(t,e)&&Ar(i,e,t[e]);if(Xa)for(var e of Xa(t))nf.call(t,e)&&Ar(i,e,t[e]);return i},Ae=(i,t)=>$u(i,ef(t));var f=(i,t,e)=>(Ar(i,typeof t!="symbol"?t+"":t,e),e);var U=(i,t,e)=>new Promise((n,s)=>{var o=l=>{try{a(e.next(l))}catch(c){s(c)}},r=l=>{try{a(e.throw(l))}catch(c){s(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,r);a((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("@realsee/five"),R=require("three"),Us=require("three/examples/jsm/renderers/CSS3DRenderer"),is=require("hammerjs"),ih=require("@realsee/five/line"),sh=require("three/examples/jsm/loaders/FBXLoader"),sf=require("earcut"),Za=require("animejs"),of=require("@realsee/five/gltf-loader");function rf(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=rf(R);function af(){console.debug("%c %c@realsee/dnalogel %cv2.21.0-dev.13",["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 lf(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const s=document.createElement("canvas");return s.width=e,s.height=n,s}})}function oh(){}const Ja=()=>Promise.resolve(),qa={__queue:Promise.resolve()};function cf(i=Ja){qa.__queue=qa.__queue.then(i).catch(Ja)}function Cs(i,t,e){const n=i.x,s=i.y,o=Math.floor(n/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function vr(i,t,e){const{x:n,y:s}=i,o=n*t,r=s*e;return{x:o,y:r}}function Is(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 df(i,t,e=oh){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const hf=window,Ka=window.requestAnimationFrame||hf.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function Hs(i,t=0){t<=0?Ka(i):Ka(()=>Hs(i,t-1))}var xt=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-xt.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?xt.Bounce.In(i*2)*.5:xt.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}}}}),ei=function(){return performance.now()},rh=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=ei()),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 s=0;s<n.length;s++){var o=this._tweens[n[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[n[s]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},i}(),kn={Linear:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=kn.Utils.Linear;return t<0?o(i[0],i[1],n):t>1?o(i[e],i[e-1],e-n):o(i[s],i[s+1>e?e:s+1],n-s)},Bezier:function(i,t){for(var e=0,n=i.length-1,s=Math.pow,o=kn.Utils.Bernstein,r=0;r<=n;r++)e+=s(1-t,n-r)*s(t,r)*i[r]*o(n,r);return e},CatmullRom:function(i,t){var e=i.length-1,n=e*t,s=Math.floor(n),o=kn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(s=Math.floor(n=e*(1+t))),o(i[(s-1+e)%e],i[s],i[(s+1)%e],i[(s+2)%e],n-s)):t<0?i[0]-(o(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(o(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):o(i[s?s-1:0],i[s],i[e<s+1?e:s+1],i[e<s+2?e:s+2],n-s)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Bernstein:function(i,t){var e=kn.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,s){var o=(e-i)*.5,r=(n-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},la=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Nr=new rh,mo=function(){function i(t,e){e===void 0&&(e=Nr),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=xt.Linear.None,this._interpolationFunction=kn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=la.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=ei()),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 s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}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,s,o){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 g=a;for(var b in g)e[r][b]=g[b];s[r]=l?[]:{};var h=n[r];if(!this._isDynamic){var y={};for(var b in h)y[b]=h[b];n[r]=h=y}this._setupProperties(g,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=n[r].slice().reverse():s[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=ei()),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=ei()),!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=Nr),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=xt.Linear.None),this._easingFunction=t,this},i.prototype.interpolation=function(t){return t===void 0&&(t=kn.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=ei()),e===void 0&&(e=!0),this._isPaused)return!0;var n,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)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),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===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,s){for(var o in n)if(e[o]!==void 0){var r=e[o]||0,a=n[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},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}(),uf="20.0.3",ff=la.nextId,Ht=Nr,mf=Ht.getAll.bind(Ht),gf=Ht.removeAll.bind(Ht),pf=Ht.add.bind(Ht),ah=Ht.remove.bind(Ht),Af=Ht.update.bind(Ht),$a={Easing:xt,Group:rh,Interpolation:kn,now:ei,Sequence:la,nextId:ff,Tween:mo,VERSION:uf,getAll:mf,removeAll:gf,add:pf,remove:ah,update:Af};function vf(i,t,e,n=xt.Linear.None){const s=new mo(i).to(t,e).easing(n).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var qt=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(qt||{});const Xi=Symbol("$$PAINT_BRUSH_EVENT$$");function Ps(i){return i[Xi]||(i[Xi]={}),i[Xi]}function bf(i){i[Xi]||delete i[Xi]}let yf=class{hasListener(t){const e=Ps(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const s=Ps(this);return s[t]||(s[t]=[]),s[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){bf(this);return}const n=Ps(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const o=Ps(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}};function an(){return((1+Math.random())*65536|0).toString(16).substring(1)}function at(){return(an()+an()+"-"+an()+"-4"+an().substr(0,3)+"-"+an()+"-"+an()+an()+an()).toLowerCase()}const wf=`
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=o=>{"content"in o&&e(0,n=o.content)},[n,s]}class vg extends le{constructor(t){super(),ae(this,t,Ag,pg,oe,{content:0},gg)}}function bg(i){ue(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function yg(i){let t,e;return t=new mg({props:{url:i[1].url}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.url=n[1].url),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wg(i){let t,e;return t=new vg({props:{content:i[0]}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.content=n[0]),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Cg(i){let t,e,n,s;const o=[wg,yg],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=o[e](i)),{c(){t=D("div"),n&&n.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(de(),z(r[d],1,1,()=>{r[d]=null}),he()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){s||(k(n),s=!0)},o(l){z(n),s=!1},d(l){l&&O(t),~e&&r[e].d()}}}function Ig(i,t,e){let n,s,{floorIndex:o}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[o]),i.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,n,o,r]}class Nh extends le{constructor(t){super(),ae(this,t,Ig,Cg,oe,{floorIndex:2,floorplanData:3},bg)}}function Pg(i){ue(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 Eg(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Zs(!1),n=Pe(),t.a=n},m(s,o){t.m(e,s,o),B(s,n,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&O(n),s&&t.d()}}}function Mg(i){let t,e,n=i[1]&&cl(i),s=i[0]&&dl(i);return{c(){n&&n.c(),t=ee(),s&&s.c(),e=Pe()},m(o,r){n&&n.m(o,r),B(o,t,r),s&&s.m(o,r),B(o,e,r)},p(o,r){o[1]?n?n.p(o,r):(n=cl(o),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),o[0]?s?s.p(o,r):(s=dl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){n&&n.d(o),o&&O(t),s&&s.d(o),o&&O(e)}}}function cl(i){let t,e=i[2].name+"",n;return{c(){t=D("span"),n=ke(e),w(t,"class","floorplan-plugin__room-name")},m(s,o){B(s,t,o),x(t,n)},p(s,o){o&4&&e!==(e=s[2].name+"")&&Oe(n,e)},d(s){s&&O(t)}}}function dl(i){let t,e;return{c(){t=D("span"),e=ke(i[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,s){B(n,t,s),x(t,e)},p(n,s){s&128&&Oe(e,n[7])},d(n){n&&O(t)}}}function kg(i){let t,e,n;function s(a,l){if(a[3]===void 0)return Mg;if(a[8])return Eg}let o=s(i),r=o&&o(i);return{c(){t=D("div"),r&&r.c(),w(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){B(a,t,l),r&&r.m(t,null),e||(n=[$t(Ii.call(null,t)),be(t,"clientWidth",i[19]),be(t,"clientHeight",i[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&O(t),r&&r.d(),e=!1,Je(n)}}}function Dg(i,t){const e=i[0],n=i[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function xg(i,t,e){let n,s,o,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 g(G,_){if(_.width===0||_.height===0)return()=>!1;const Q=G.path.map(({x:Ce,y:pe})=>[Ce,pe]),F=G.roomLabel.position,{x:Z,y:X}=F,{width:K,height:ce}=_,se=K/2,we=ce/2;return function(pe){const Be=Z*pe,ve=X*pe,We=Q.map(([ye,Le])=>[ye*pe,Le*pe]);return[[Be+se,ve-we],[Be-se,ve-we],[Be-se,ve+we],[Be+se,ve+we]].every(ye=>Dg(ye,We))}}const b=document.body.clientWidth,y=document.body.clientHeight,I=h.roomLabel,M=I.positionInImage.x*100+"%",T=I.positionInImage.y*100+"%",P=(b<500||y<500?10:14)+"px";let V=0,L=0,W=!1;u.subscribe(function(_){e(16,W=!!_&&_.id===h.id)});const q=G=>{e(4,V=G.detail)},N=G=>{e(5,L=G.detail)};return i.$$set=G=>{"pxmm"in G&&e(12,l=G.pxmm),"roomAreaEnable"in G&&e(0,c=G.roomAreaEnable),"roomNameEnable"in G&&e(1,d=G.roomNameEnable),"room"in G&&e(2,h=G.room),"hoveredRoom"in G&&e(13,u=G.hoveredRoom),"getRoomAreaText"in G&&e(14,m=G.getRoomAreaText),"getLabelElement"in G&&e(3,A=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,p=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(h)),i.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),i.$$.dirty&48&&e(18,o={width:V,height:L}),i.$$.dirty&262148&&e(17,r=o?g(h,o):void 0),i.$$.dirty&233472&&e(6,a=p?W?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,V,L,a,s,n,M,T,P,l,u,m,p,W,r,o,q,N]}class Sg extends le{constructor(t){super(),ae(this,t,xg,kg,oe,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Pg)}}function Tg(i){ue(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 hl(i,t,e){const n=i.slice();return n[12]=t[e],n}function ul(i){let t,e=[],n=new Map,s,o,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=hl(i,a,c),h=l(d);n.set(h,e[c]=fl(h,d))}return{c(){t=D("div");for(let c=0;c<e.length;c+=1)e[c].c();w(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){B(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[$t(Ii.call(null,t)),be(t,"clientWidth",i[11])],o=!0)},p(c,d){d&447&&(a=c[8],de(),e=zt(e,d,l,1,c,a,n,t,vn,fl,null,hl),he())},i(c){if(!s){for(let d=0;d<a.length;d+=1)k(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)z(e[d]);s=!1},d(c){c&&O(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Je(r)}}}function fl(i,t){let e,n,s;const o=[{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<o.length;a+=1)r=et(r,o[a]);return n=new Sg({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&447?lt(o,[{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){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function Lg(i){let t,e,n=i[8]&&ul(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[8]?n?(n.p(s,o),o&256&&k(n,1)):(n=ul(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function zg(i,t,e){let n,{floorIndex:s}=t,{roomAreaEnable:o}=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,s=p.floorIndex),"roomAreaEnable"in p&&e(0,o=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[s].rooms),i.$$.dirty&1088){const{max:p,min:g}=a.bounding,b=p.x-g.x;e(7,m=u/b)}},[o,r,l,c,d,h,u,m,n,s,a,A]}class jg extends le{constructor(t){super(),ae(this,t,zg,Lg,oe,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Tg)}}function Og(i){ue(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 ml(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 pl(i){let t;return{c(){t=D("div"),w(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){B(e,t,n)},p:J,d(e){e&&O(t)}}}function Al(i,t){let e,n,s=t[1](t[11].distance)+"",o,r;return{key:i,first:null,c(){e=D("div"),n=D("div"),o=ke(s),r=ee(),w(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),w(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){B(a,e,l),x(e,n),x(n,o),x(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Oe(o,s)},d(a){a&&O(e)}}}function Bg(i){let t,e,n,s,o,r,a=[],l=new Map,c,d=i[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=pl(gl(i,d,A));let u=i[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=ml(i,u,A),g=m(p);l.set(g,a[A]=Al(g,p))}return{c(){t=D("div"),e=D("div"),n=ee(),s=D("div");for(let A=0;A<h.length;A+=1)h[A].c();o=ee(),r=D("div");for(let A=0;A<a.length;A+=1)a[A].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(s,"is-row",i[2]),w(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),w(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){B(A,t,p),x(t,e),x(t,n),x(t,s);for(let g=0;g<h.length;g+=1)h[g]&&h[g].m(s,null);x(t,o),x(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(A,[p]){if(p&8){d=A[3];let g;for(g=0;g<d.length;g+=1){const b=gl(A,d,g);h[g]?h[g].p(b,p):(h[g]=pl(b),h[g].c(),h[g].m(s,null))}for(;g<h.length;g+=1)h[g].d(1);h.length=d.length}p&22&&(u=A[4],a=zt(a,p,m,1,A,u,l,r,wa,Al,null,ml)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&w(t,"class",c),p&5&&$(t,"is-row",A[2])},i:J,o:J,d(A){A&&O(t),Tt(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const qn=1e3,Kn=180;function Vg(i,t,e){let{type:n}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=o.max.x-o.min.x-(qn-Kn)*2,c=o.max.y-o.min.y-(qn-Kn)*2,d=s.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,g)=>p===0?!0:A!==g[p-1]),h=d.map(A=>{const p=a?(A-o.min.x-qn+Kn)/l:0,g=a?0:(A-o.min.y-qn+Kn)/c;return{left:p,bottom:g}});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,g)=>{const b=p===0?0:A-g[p-1],y=p===0?0:(A+g[p-1])/2,I=a?(y-o.min.x-qn+Kn)/l:0,M=a?0:(y-o.min.y-qn+Kn)/c;return{left:I,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,s=A.data),"bounding"in A&&e(6,o=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,h,m,s,o]}class Rg extends le{constructor(t){super(),ae(this,t,Vg,Bg,oe,{type:0,data:5,bounding:6,getRuleDistanceText:1},Og)}}function Qg(i){ue(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function vl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function bl(i,t){let e,n,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return n=new Rg({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&19?lt(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function Gg(i){let t,e=[],n=new Map,s,o=i[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=vl(i,o,a),c=r(l);n.set(c,e[a]=bl(c,l))}return{c(){t=D("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],de(),e=zt(e,l,r,1,a,o,n,t,vn,bl,null,vl),he()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)k(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&O(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const yl=1e3,wl=180;function Ng(i,t,e){let n,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return i.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,A=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,s=A.floorDatas[m].rules),i.$$.dirty&2048&&e(12,o=Object.keys(s)),i.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),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-(yl-wl)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(yl-wl)*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,s,o]}class Hg extends le{constructor(t){super(),ae(this,t,Ng,Gg,oe,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Qg)}}function Io(i,t={}){let e="";const{needZ:n,needA:s}=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):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Hh({x:i,y:t},e){const{max:n,min:s}=e;return{x:i-s.x,y:n.y-t}}function _g(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 Wg(i,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/s}}function Fg(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Yg(i){let t;return{c(){t=je("path"),w(t,"d",i[0]),w(t,"fill","#2F313A")},m(e,n){B(e,t,n)},p(e,[n]){n&1&&w(t,"d",e[0])},i:J,o:J,d(e){e&&O(t)}}}function Ug(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Io(s,{needZ:!0}))},[n,s]}class Xg extends le{constructor(t){super(),ae(this,t,Ug,Yg,oe,{path:1})}}function Zg(i){let t,e,n,s,o,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("path"),o=ee(),r=je("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width",i[1]),w(n,"height",i[1]),w(n,"fill","#323747"),w(s,"d",i[2]),w(s,"stroke","#ffffff"),w(s,"stroke-opacity","0.06"),w(s,"stroke-width","0.5"),w(s,"fill","none"),w(e,"id","fpm-room-pattern-0"),w(e,"x","0"),w(e,"y","0"),w(e,"width",i[1]),w(e,"height",i[1]),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(r,"d",i[0]),w(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),x(t,e),x(e,n),x(e,s),B(a,o,l),B(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:J,o:J,d(a){a&&O(t),a&&O(o),a&&O(r)}}}const Ir=6;function Jg(i,t,e){let n,{path:s}=t;const o=Ir*2,r=`M0 ${Ir} h ${o} M${Ir} 0 v ${o}`;return i.$$set=a=>{"path"in a&&e(3,s=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Io(s,{needZ:!0}))},[n,o,r,s]}class qg extends le{constructor(t){super(),ae(this,t,Jg,Zg,oe,{path:3})}}function Kg(i){let t,e,n,s,o,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("pattern"),o=je("rect"),r=ee(),a=je("path"),l=ee(),c=je("path"),d=ee(),h=je("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width","6"),w(n,"height","50"),w(n,"fill","none"),w(n,"stroke","#4B4B57"),w(n,"stroke-width","0.5"),w(e,"id","room-material-pattern-1"),w(e,"x","0"),w(e,"y","0"),w(e,"width","12"),w(e,"height","50"),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(o,"x","0"),w(o,"y","0"),w(o,"width","6"),w(o,"height","50"),w(o,"fill","none"),w(o,"stroke","#4B4B57"),w(o,"stroke-width","0.5"),w(s,"id","room-material-pattern-2"),w(s,"x","6"),w(s,"y","25"),w(s,"width","12"),w(s,"height","50"),w(s,"patternUnits","userSpaceOnUse"),w(s,"patternTransform","scale(50 50)"),w(a,"d",i[0]),w(a,"fill","#43434D"),w(c,"d",i[0]),w(c,"fill","url(#room-material-pattern-1)"),w(h,"d",i[0]),w(h,"fill","url(#room-material-pattern-2)")},m(u,m){B(u,t,m),x(t,e),x(e,n),x(t,s),x(s,o),B(u,r,m),B(u,a,m),B(u,l,m),B(u,c,m),B(u,d,m),B(u,h,m)},p(u,[m]){m&1&&w(a,"d",u[0]),m&1&&w(c,"d",u[0]),m&1&&w(h,"d",u[0])},i:J,o:J,d(u){u&&O(t),u&&O(r),u&&O(a),u&&O(l),u&&O(c),u&&O(d),u&&O(h)}}}function $g(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Io(s,{needZ:!0}))},[n,s]}class ep extends le{constructor(t){super(),ae(this,t,$g,Kg,oe,{path:1})}}function tp(i){ue(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 Cl(i,t,e){const n=i.slice();return n[5]=t[e],n}function np(i){let t,e;return t=new qg({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ip(i){let t,e;return t=new ep({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function sp(i){let t,e;return t=new Xg({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Il(i){let t,e,n,s;const o=[sp,ip,np],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=o[e](i),{c(){t=je("svg"),n.c(),w(t,"width","100%"),w(t,"height","100%"),w(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),w(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(de(),z(r[d],1,1,()=>{r[d]=null}),he(),n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),k(n,1),n.m(t,null))},i(l){s||(k(n),s=!0)},o(l){z(n),s=!1},d(l){l&&O(t),r[e].d()}}}function op(i){let t,e,n=i[0],s=[];for(let r=0;r<n.length;r+=1)s[r]=Il(Cl(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){t=D("div");for(let r=0;r<s.length;r+=1)s[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[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=Cl(r,n,l);s[l]?(s[l].p(c,a),k(s[l],1)):(s[l]=Il(c),s[l].c(),k(s[l],1),s[l].m(t,null))}for(de(),l=n.length;l<s.length;l+=1)o(l);he()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){r&&O(t),Tt(s,r)}}}function rp(i,t,e){let n,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=o.floorDatas[s].rooms.map(l=>Ae(H({},l),{path:l.path.map(c=>Hh(c,o.bounding))})))},[n,r,a,s,o]}class ap extends le{constructor(t){super(),ae(this,t,rp,op,oe,{floorIndex:3,floorplanData:4},tp)}}function lp(i){ue(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function cp(i){let t,e,n,s;return{c(){t=je("path"),w(t,"d",i[5]),w(t,"fill","#fff"),w(t,"style",i[2]),w(t,"id",e=`${i[1]}_${i[0].id}`),w(t,"class","svelte-qq2273")},m(o,r){B(o,t,r),n||(s=[be(t,"mouseenter",i[3]),be(t,"mouseleave",i[4])],n=!0)},p(o,[r]){r&4&&w(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&w(t,"id",e)},i:J,o:J,d(o){o&&O(t),n=!1,Je(s)}}}function dp(i,t,e){let n,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Io(o.path,{needZ:!0,format:A=>Hh(A,u)});return i.$$set=A=>{"room"in A&&e(0,o=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}_${o.id}`]),i.$$.dirty&512&&e(2,s=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,n]}class hp extends le{constructor(t){super(),ae(this,t,dp,cp,oe,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},lp)}}function up(i){ue(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 Pl(i,t,e){const n=i.slice();return n[6]=t[e],n}function El(i,t){let e,n,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return n=new hp({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&15?lt(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function fp(i){let t,e,n=[],s=new Map,o,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Pl(i,r,l),d=a(c);s.set(d,n[l]=El(d,c))}return{c(){t=D("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();w(e,"width","100%"),w(e,"height","100%"),w(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),w(e,"class","svelte-1kqo6e4"),w(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),x(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,de(),n=zt(n,c,a,1,l,r,s,e,vn,El,null,Pl),he())},i(l){if(!o){for(let c=0;c<r.length;c+=1)k(n[c]);o=!0}},o(l){for(let c=0;c<n.length;c+=1)z(n[c]);o=!1},d(l){l&&O(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function mp(i,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,s,o,r,a,l]}class _h extends le{constructor(t){super(),ae(this,t,mp,fp,oe,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},up)}}function gp(i){ue(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 Ml(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new _h({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&24834?lt(n,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function kl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new jg({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&22370?lt(n,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function Dl(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new Hg({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2306?lt(n,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function pp(i){let t,e,n,s,o,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=et(h,d[b]);e=new ap({props:h});let u=(i[2]||i[3])&&Ml(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let b=0;b<m.length;b+=1)A=et(A,m[b]);o=new Nh({props:A});let p=i[4]&&kl(i),g=i[7]&&Dl(i);return{c(){t=D("div"),ie(e.$$.fragment),n=ee(),u&&u.c(),s=ee(),ie(o.$$.fragment),r=ee(),p&&p.c(),a=ee(),g&&g.c(),w(t,"class",l=Re(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,y){B(b,t,y),te(e,t,null),x(t,n),u&&u.m(t,null),x(t,s),te(o,t,null),x(t,r),p&&p.m(t,null),x(t,a),g&&g.m(t,null),c=!0},p(b,[y]){const I=y&258?lt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(I),b[2]||b[3]?u?(u.p(b,y),y&12&&k(u,1)):(u=Ml(b),u.c(),k(u,1),u.m(t,s)):u&&(de(),z(u,1,1,()=>{u=null}),he());const M=y&258?lt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};o.$set(M),b[4]?p?(p.p(b,y),y&16&&k(p,1)):(p=kl(b),p.c(),k(p,1),p.m(t,a)):p&&(de(),z(p,1,1,()=>{p=null}),he()),b[7]?g?(g.p(b,y),y&128&&k(g,1)):(g=Dl(b),g.c(),k(g,1),g.m(t,null)):g&&(de(),z(g,1,1,()=>{g=null}),he()),(!c||y&1&&l!==(l=Re(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&w(t,"class",l)},i(b){c||(k(e.$$.fragment,b),k(u),k(o.$$.fragment,b),k(p),k(g),c=!0)},o(b){z(e.$$.fragment,b),z(u),z(o.$$.fragment,b),z(p),z(g),c=!1},d(b){b&&O(t),ne(e),u&&u.d(),ne(o),p&&p.d(),g&&g.d()}}}function Ap(i,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{highlightEnable:o}=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:g}=t;const b=Pa(void 0);return i.$$set=y=>{"isCurrent"in y&&e(0,n=y.isCurrent),"floorIndex"in y&&e(1,s=y.floorIndex),"highlightEnable"in y&&e(2,o=y.highlightEnable),"hoverEnable"in y&&e(3,r=y.hoverEnable),"roomLabelsEnable"in y&&e(4,a=y.roomLabelsEnable),"roomAreaEnable"in y&&e(5,l=y.roomAreaEnable),"roomNameEnable"in y&&e(6,c=y.roomNameEnable),"ruleLabelsEnable"in y&&e(7,d=y.ruleLabelsEnable),"floorplanData"in y&&e(8,h=y.floorplanData),"getRoomAreaText"in y&&e(9,u=y.getRoomAreaText),"getLabelElement"in y&&e(10,m=y.getLabelElement),"getRuleDistanceText"in y&&e(11,A=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,p=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,g=y.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,A,p,g,b]}let vp=class extends le{constructor(t){super(),ae(this,t,Ap,pp,oe,{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},gp)}};function bp(i){ue(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function xl(i,t,e){const n=i.slice();return n[21]=t[e],n}function Sl(i){let t,e,n,s,o,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Tl(xl(i,r,h));const l=h=>z(a[h],1,1,()=>{a[h]=null});let c=i[5]&&Ll(i),d=i[8]&&zl(i);return{c(){t=D("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ee(),c&&c.c(),n=ee(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){B(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);x(t,e),c&&c.m(t,null),x(t,n),d&&d.m(t,null),o=!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=xl(i,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=Tl(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(de(),m=r.length;m<a.length;m+=1)l(m);he()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=Ll(i),c.c(),k(c,1),c.m(t,n)):c&&(de(),z(c,1,1,()=>{c=null}),he()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=zl(i),d.c(),k(d,1),d.m(t,null)):d&&(de(),z(d,1,1,()=>{d=null}),he())},i(h){if(!o){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),s||Ne(()=>{s=On(t,tt,{duration:i[0],easing:en}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)z(a[u]);z(c),z(d),o=!1},d(h){h&&O(t),Tt(a,h),c&&c.d(),d&&d.d()}}}function Tl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new vp({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2047696?lt(n,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function Ll(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new ig({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&57352?lt(n,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function zl(i){let t,e;return t=new dg({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&8192&&(o.floorplanData=n[13]),s&4&&(o.northDesc=n[2]),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function yp(i){let t,e,n=i[1]&&Sl(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&k(n,1)):(n=Sl(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function wp(i,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:o}=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:g}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:y}=t,{getRoomAreaText:I}=t,{getLabelElement:M}=t,{getRuleDistanceText:T}=t,{adaptiveRoomLabelVisibleEnable:P}=t,{highlightData:V}=t;return i.$$set=L=>{"duration"in L&&e(0,n=L.duration),"visible"in L&&e(1,s=L.visible),"northDesc"in L&&e(2,o=L.northDesc),"panoIndex"in L&&e(3,r=L.panoIndex),"floorIndex"in L&&e(4,a=L.floorIndex),"cameraEnable"in L&&e(5,l=L.cameraEnable),"hoverEnable"in L&&e(6,c=L.hoverEnable),"highlightEnable"in L&&e(7,d=L.highlightEnable),"compassEnable"in L&&e(8,h=L.compassEnable),"roomLabelsEnable"in L&&e(9,u=L.roomLabelsEnable),"roomAreaEnable"in L&&e(10,m=L.roomAreaEnable),"roomNameEnable"in L&&e(11,A=L.roomNameEnable),"ruleLabelsEnable"in L&&e(12,p=L.ruleLabelsEnable),"floorplanData"in L&&e(13,g=L.floorplanData),"lastPanoramaLongitude"in L&&e(14,b=L.lastPanoramaLongitude),"cameraImageUrl"in L&&e(15,y=L.cameraImageUrl),"getRoomAreaText"in L&&e(16,I=L.getRoomAreaText),"getLabelElement"in L&&e(17,M=L.getLabelElement),"getRuleDistanceText"in L&&e(18,T=L.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in L&&e(19,P=L.adaptiveRoomLabelVisibleEnable),"highlightData"in L&&e(20,V=L.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,A,p,g,b,y,I,M,T,P,V]}let Ea=class extends le{constructor(t){super(),ae(this,t,wp,yp,oe,{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},bp)}};const Cp="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 Ip(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return U(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(i.map(e))})}function Pp(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 Ep(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Pp),rules:i.rules}}function Mp(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function kp(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 mn(i){return U(this,null,function*(){const t=yield Ip(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ep),s=i.computed_data.entrance?kp(i.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Mp)}})}function Dp(i,t,e){return i.map(s=>{const o=s.position,r=s.icon?s.icon:{url:Cp,width:45,height:48},a=Fg(o,t),l=_g(o,e),c=Wg(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function xp(i,t){return t(i),i}function Po(i,t){return xp({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function jl(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 Ma(i,t,e=dn.BOUNDING_CENTER){const n=jl(i,t),s=jl(i,t+1);return e===dn.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===dn.CEILING?s:n}function ka(i,t,e,n){const s=Ma(i,e,n==null?void 0:n.attachedTo),o=new E.Vector3(0,s,0),r=new E.Vector3(1,s,0),a=o.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let os=class{constructor(t,e){f(this,"VERSION","2.21.0-dev.12");f(this,"five");f(this,"hooks",new gi);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 ha(this.staticPrefix,t)}},Bn=class extends os{};var wt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(wt||{});const Wh=500,Sp=80;function Xr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Da(i,t){return U(this,null,function*(){const[e]=yield ci(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 s=i.getCurrentState();if(!Tp(n,s))throw new Error("pose 与预期不符")})}function Tp(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const s=i[e];return typeof n=="number"&&typeof s=="number"?Xr(n,s,2):n===s})}function xa(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:o,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Xr(e,o,2)||!Xr(n,r,2)||s!==a)}function Fh(i,t,e=!0){return U(this,null,function*(){if(xa(i,t)===!0)return;const s=i.getCurrentState();if(s.mode!==t.mode){const[d]=yield ci(Da(i,[t.mode,t,void 0,e]));if(d)throw new Error(wt.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ci(i.updateCamera(t,l,e));if(c)throw new Error(wt.UpdateCameraError)})}function hi(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(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function Lp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function zp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let jp=class extends Bn{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 s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),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||!xa(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,wt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$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(wt.ModelNotLoaded);if(!this.data)throw new Error(wt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=H(H({},n),e),o=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ci(Fh(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(wt.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:Wh;hi(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,wt.BreakOffByHide),this.showPromise=void 0;const s=H(H({},{userAction:!0,isAutoHide:!1}),e);hi(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.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 s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||zp(s)&&(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 s=this.five.getCurrentState();Lp(s)&&(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:Sp/((a=n==null?void 0:n.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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 mn(e.data)})}updateState(e,n){const s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Op=(i,t)=>new jp(i,t);function Bp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Vp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let Rp=class extends Bn{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 s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),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||!xa(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,wt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$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(wt.ModelNotLoaded);if(!this.data)throw new Error(wt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=H(H({},n),e),o=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ci(Fh(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(wt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:Wh;hi(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,wt.BreakOffByHide),this.showPromise=void 0;const s=H(H({},{userAction:!0,isAutoHide:!1}),e);hi(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.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 s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bp(s)&&(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 s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Vp(s)&&(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 s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Ma(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 s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield mn(e.data)})}updateState(e,n){const s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Qp=(i,t)=>new Rp(i,t);let Gp=class extends Bn{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,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.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 s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}updatePosition(){var a;const e=Ma(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 s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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 mn(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 Da(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;hi(this.five,o,s),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 s=1,o=0;hi(this.five,s,o),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 s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Np=(i,t)=>new Gp(i,t);function Sa(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Hp(i){ue(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 _p(i){let t,e,n;return{c(){t=D("div"),e=D("div"),n=D("div"),w(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||fn)+")"),j(n,"transform",i[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){B(s,t,o),x(t,e),x(e,n)},p(s,[o]){o&1&&j(n,"background-image","url("+(s[0]||fn)+")"),(o&1||o&3)&&j(n,"transform",s[1]),o&4&&j(e,"transform",s[2])},i:J,o:J,d(s){s&&O(t)}}}function Wp(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Fp(i,t,e){let n,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(A,p){const g=A.bounding,b=A.observers[p];if(!b)return"";const y=(g.max.x-g.min.x)*r,I=(g.max.y-g.min.y)*r,M=Math.floor(b.positionInImage.x*y),T=Math.floor(b.positionInImage.y*I);return`translate(${M}px, ${T}px)`}function u(A){e(6,c=A)}const m=Sa(A=>{e(7,d=A.longitude)},1e3/60);return vt(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,o=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,s=Wp(d))},[l,s,n,o,r,a,c,d]}class Yp extends le{constructor(t){super(),ae(this,t,Fp,_p,oe,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Hp)}}function Up(i){ue(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 Ol(i,t,e){const n=i.slice();return n[1]=t[e],n}function Bl(i,t){let e,n,s=`${t[1].icon.width/16}rem`,o=`${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=D("div"),n=D("div"),r=ee(),w(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",s),j(n,"height",o),w(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){B(c,e,d),x(e,n),x(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",s),h&&j(n,"height",o),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 Xp(i){let t,e=[],n=new Map,s=i[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Ol(i,s,r),l=o(a);n.set(l,e[r]=Bl(l,a))}return{c(){t=D("div");for(let r=0;r<e.length;r+=1)e[r].c();w(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=zt(e,a,o,1,r,s,n,t,wa,Bl,null,Ol))},i:J,o:J,d(r){r&&O(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Zp(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class Jp extends le{constructor(t){super(),ae(this,t,Zp,Xp,oe,{extraObjects:0},Up)}}function Vl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new _h({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&183?lt(n,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function qp(i){let t,e,n,s,o,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=et(l,a[d]);t=new Nh({props:l}),n=new Jp({props:{extraObjects:i[6]}});let c=i[3]&&Vl(i);return{c(){ie(t.$$.fragment),e=ee(),ie(n.$$.fragment),s=ee(),c&&c.c(),o=Pe()},m(d,h){te(t,d,h),B(d,e,h),te(n,d,h),B(d,s,h),c&&c.m(d,h),B(d,o,h),r=!0},p(d,[h]){const u=h&20?lt(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=Vl(d),c.c(),k(c,1),c.m(o.parentNode,o)):c&&(de(),z(c,1,1,()=>{c=null}),he())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){z(t.$$.fragment,d),z(n.$$.fragment,d),z(c),r=!1},d(d){ne(t,d),d&&O(e),ne(n,d),d&&O(s),c&&c.d(d),d&&O(o)}}}function Kp(i,t,e){let n,{five:s}=t,{pxmm:o}=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,s=u.five),"pxmm"in u&&e(1,o=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))},[s,o,r,a,l,d,n,h,c]}class $p extends le{constructor(t){super(),ae(this,t,Kp,qp,oe,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function eA(i){ue(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 Rl(i){let t,e,n,s,o=i[7]!==0&&Ql(i);return{c(){t=D("div"),o&&o.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){B(r,t,a),o&&o.m(t,null),e=!0,n||(s=[$t(Ii.call(null,t)),be(t,"clientWidth",i[13]),be(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&k(o,1)):(o=Ql(r),o.c(),k(o,1),o.m(t,null)):o&&(de(),z(o,1,1,()=>{o=null}),he())},i(r){e||(k(o),e=!0)},o(r){z(o),e=!1},d(r){r&&O(t),o&&o.d(),n=!1,Je(s)}}}function Ql(i){let t,e,n,s,o=`${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=et(c,l[u]);e=new $p({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=et(h,d[u]);return s=new Yp({props:h}),{c(){t=D("div"),ie(e.$$.fragment),n=ee(),ie(s.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",o),j(t,"height",r)},m(u,m){B(u,t,m),te(e,t,null),x(t,n),te(s,t,null),a=!0},p(u,m){const A=m&3181?lt(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?lt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(p),m&512&&o!==(o=`${u[9]}px`)&&j(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(s.$$.fragment,u),a=!0)},o(u){z(e.$$.fragment,u),z(s.$$.fragment,u),a=!1},d(u){u&&O(t),ne(e),ne(s)}}}function tA(i){let t,e,n=i[1]&&Rl(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&k(n,1)):(n=Rl(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function nA(i,t,e){var I,M;let{five:n}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(I=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:I.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function g(T){e(11,h=n.work.observers[T].floorIndex)}vt(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));const b=T=>{e(7,u=T.detail)},y=T=>{e(8,m=T.detail)};return i.$$set=T=>{"five"in T&&e(0,n=T.five),"visible"in T&&e(1,s=T.visible),"hoverEnable"in T&&e(2,o=T.hoverEnable),"floorplanData"in T&&e(3,r=T.floorplanData),"cameraImageUrl"in T&&e(4,a=T.cameraImageUrl),"extraObjects"in T&&e(5,l=T.extraObjects),"highlightData"in T&&e(6,c=T.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const T=Math.min(u,m),{max:P,min:V}=r.bounding,L=P.x-V.x,W=P.y-V.y,q=function(){return L>W?[T,T/L*W]:[T/W*L,T]}();e(9,A=q[0]),e(12,p=q[1]),e(10,d=A/L)}},[n,s,o,r,a,l,c,u,m,A,d,h,p,b,y]}class iA extends le{constructor(t){super(),ae(this,t,nA,tA,oe,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},eA)}}let sA=class extends Bn{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 s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:fn},o=n!=null&&n.configs?n.configs:{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield mn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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=Dp(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield mn(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 s=this.state;this.state=H(H({},this.state),e),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 iA({target:this.wrapper,props:e})}};const oA=(i,t)=>new sA(i,t),rA=[{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:"和室"}],aA=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],lA=[{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:"写字楼"}],Pr=(i,t,e)=>{const n=new E.Matrix4,s=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(s),n},cA=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[s,o,r]=e;s&&i.applyMatrix4(Pr(s,0,0)),o&&i.applyMatrix4(Pr(0,o,0)),r&&i.applyMatrix4(Pr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Yh(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,o=H({map:s.material.map||{}},t);s.material=new R.MeshBasicMaterial(o),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const dA=(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,s={},o=h=>U(exports,null,function*(){var G;const u=(h==null?void 0:h.fbx_url)||e,m=(G=h==null?void 0:h.north_rad)!=null?G:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=i.model.bounding,p=A.max.x-A.min.x,g=A.max.z-A.min.z,b=Math.max(p,g),I=yield new sh.FBXLoader().loadAsync(u);Yh(I,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const M=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:P},min:{x:V,y:L,z:W}}}}=i;s.yBase=L;const q={x:(T+V)/2,y:L-1.6,z:(P+W)/2},N=.0045*b;return cA(I,{position:q,rotation:M,scale:N}),s.object=I,!0}),r=({latitude:h})=>{if(!s.object)return;const u=a(h);u&&(s.object.position.y=u)},a=h=>{if(s.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return s.yBase-(u+1.6);const m=h*(4/Math.PI);return s.yBase-(u*m+1.6)};return{load:o,disable:()=>{s.object&&(i.scene.remove(s.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!s.object)return;const h=a(i.getPose().latitude);h&&(s.object.position.y=h),i.scene.add(s.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function hA(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,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(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=s,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(i,e/2,e*.7),new R.CanvasTexture(a)}const uA=({x:i,y:t,z:e})=>new R.Vector3(i,t,e),fA=(i,t)=>{var p,g,b;const e={},n=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>U(exports,null,function*(){var q,N,G,_,Q,F,Z,X;const I=(q=y==null?void 0:y.position)!=null?q:s;if(!I)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=uA(I),T=(N=y==null?void 0:y.rad)!=null?N:o,P=(G=y==null?void 0:y.fbx_url)!=null?G:r;if(e.rad=T,T===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`));const V=yield new sh.FBXLoader().loadAsync(P);V.position.copy(M),V.rotation.z=T,V.scale.set(.8,.8,.8),Yh(V,{transparent:!0,side:E.DoubleSide});const L=(Z=(F=(Q=(_=V.children)==null?void 0:_[0])==null?void 0:Q.children)==null?void 0:F[3])==null?void 0:Z.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const W=(X=t.name)!=null?X:"入户门";return L.material=new R.MeshBasicMaterial({transparent:!0,map:hA(W)}),L.renderOrder=3,V.children[0].add(L),e.object=V,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,I=new R.AnimationMixer(e.object);a.push(I);const M=I.clipAction(e.object.animations[0]);M.timeScale=y;let T;const P=()=>{let q=0,N=0;const G=1e3/30,_=Q=>{q=requestAnimationFrame(_);const F=Q-N;F<G||(N=Q,a.forEach(Z=>Z.update(F/1e3)),i.needsRender=!0)};return q=requestAnimationFrame(_),()=>{cancelAnimationFrame(q)}},W={play:()=>{T||(M.play(),T=P(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),T==null||T(),T=void 0}};e.animation=W},d=y=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=y==null?void 0:y.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=y=>y==="Floorplan"?d():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},mA=xt;function gA(i,t,e,n=mA.Linear.None){const s=new mo(i).to(t,e).easing(n);Ao(()=>s.start(0));const o=ss(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function pA(i,t){return gA({progress:0},{progress:1},i,t)}var Uh=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Uh||{}),Rt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Rt||{});const Ws=Math.PI*2;function Gl(i){return(i%Ws+Ws)%Ws}function Nl(i){return i%Ws}function Er(i,t,e){return i+(t-i)*e}const Zr=(i,t,e)=>{const n=Math.PI,s=n*2;let o=Gl(i),r=Gl(t);return e===Rt.Anticlockwise&&o<r&&(o+=s),e===Rt.Clockwise&&r<o&&(r+=s),e===Rt.Loop&&r-o>n?Zr(o,r,Rt.Anticlockwise):e===Rt.Loop&&o-r>n?Zr(o,r,Rt.Clockwise):{from:o,to:r}},AA=i=>{const t={},e=(l,c,...d)=>U(exports,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==i.currentMode&&(yield i.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(yield i.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,H({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),n=o=>{const r=i.state,a=Nl(r.latitude),l=Nl(o.latitude),{from:c,to:d}=Zr(r.longitude,o.longitude,o.rotation||Rt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(exports,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Te.Five.Mode.Panorama&&(yield i.changeMode(Te.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(o.panoIndex)),yield new Promise((m,A)=>{if(!o.panoIndex){m(!0);return}i.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(o);return yield new Promise(m=>{const A=({progress:I})=>{const M={};M.longitude=Er(h.longitude,u.longitude,I),M.latitude=Er(h.latitude,u.latitude,I),M.fov=Er(h.fov,u.fov,I),i.setState(M,!0)},p=()=>{m(!0)},g=()=>{m(!1)},b=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,y=pA(b,xt.Linear.None).onUpdate(A).onComplete(p).onDestroy(g);o.rotation===Rt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(I=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(I)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Hl(i,t){return i.x===t.x&&i.y===t.y}function Xh(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function oo(i,t){return(t.y-i.y)/(t.x-i.x)}function Zh(i,t,e){const n=oo(i[1],i[0]),s=oo(t[1],t[0]);if(isNaN(n)||isNaN(s)||Xh(n,s))return!1;if(xs(i[0],t))return i[0];if(xs(i[1],t))return i[1];if(xs(t[0],i))return t[0];if(xs(t[1],i))return t[1];if(e&&!vA(i,t))return!1;const o=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-o.y+n*o.x-s*r.x)/(n-s),l=n*a-n*o.x+o.y;return{x:a,y:l}}function xs(i,t){return Hl(i,t[0])||Hl(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&&Xh(oo(t[0],i),oo(i,t[1]))}function Ss(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function vA(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)&&Ss(t[0],i[1],i[0])*Ss(i[1],t[1],i[0])>0&&Ss(i[0],t[1],t[0])*Ss(t[1],i[1],t[0])>0?1:0}function Jh(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Jh(i,t-1))}const bA=`<style type="text/css">
194
+ `;return i.$$set=o=>{"content"in o&&e(0,n=o.content)},[n,s]}class vg extends le{constructor(t){super(),ae(this,t,Ag,pg,oe,{content:0},gg)}}function bg(i){ue(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function yg(i){let t,e;return t=new mg({props:{url:i[1].url}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&2&&(o.url=n[1].url),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wg(i){let t,e;return t=new vg({props:{content:i[0]}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.content=n[0]),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Cg(i){let t,e,n,s;const o=[wg,yg],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=o[e](i)),{c(){t=D("div"),n&&n.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(de(),z(r[d],1,1,()=>{r[d]=null}),he()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){s||(k(n),s=!0)},o(l){z(n),s=!1},d(l){l&&O(t),~e&&r[e].d()}}}function Ig(i,t,e){let n,s,{floorIndex:o}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[o]),i.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,n,o,r]}class Nh extends le{constructor(t){super(),ae(this,t,Ig,Cg,oe,{floorIndex:2,floorplanData:3},bg)}}function Pg(i){ue(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 Eg(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Zs(!1),n=Pe(),t.a=n},m(s,o){t.m(e,s,o),B(s,n,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&O(n),s&&t.d()}}}function Mg(i){let t,e,n=i[1]&&cl(i),s=i[0]&&dl(i);return{c(){n&&n.c(),t=ee(),s&&s.c(),e=Pe()},m(o,r){n&&n.m(o,r),B(o,t,r),s&&s.m(o,r),B(o,e,r)},p(o,r){o[1]?n?n.p(o,r):(n=cl(o),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),o[0]?s?s.p(o,r):(s=dl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){n&&n.d(o),o&&O(t),s&&s.d(o),o&&O(e)}}}function cl(i){let t,e=i[2].name+"",n;return{c(){t=D("span"),n=ke(e),w(t,"class","floorplan-plugin__room-name")},m(s,o){B(s,t,o),x(t,n)},p(s,o){o&4&&e!==(e=s[2].name+"")&&Oe(n,e)},d(s){s&&O(t)}}}function dl(i){let t,e;return{c(){t=D("span"),e=ke(i[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,s){B(n,t,s),x(t,e)},p(n,s){s&128&&Oe(e,n[7])},d(n){n&&O(t)}}}function kg(i){let t,e,n;function s(a,l){if(a[3]===void 0)return Mg;if(a[8])return Eg}let o=s(i),r=o&&o(i);return{c(){t=D("div"),r&&r.c(),w(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){B(a,t,l),r&&r.m(t,null),e||(n=[$t(Ii.call(null,t)),be(t,"clientWidth",i[19]),be(t,"clientHeight",i[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&j(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&O(t),r&&r.d(),e=!1,Je(n)}}}function Dg(i,t){const e=i[0],n=i[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function xg(i,t,e){let n,s,o,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 g(G,_){if(_.width===0||_.height===0)return()=>!1;const Q=G.path.map(({x:Ce,y:pe})=>[Ce,pe]),F=G.roomLabel.position,{x:Z,y:X}=F,{width:K,height:ce}=_,se=K/2,we=ce/2;return function(pe){const Be=Z*pe,ve=X*pe,We=Q.map(([ye,Le])=>[ye*pe,Le*pe]);return[[Be+se,ve-we],[Be-se,ve-we],[Be-se,ve+we],[Be+se,ve+we]].every(ye=>Dg(ye,We))}}const b=document.body.clientWidth,y=document.body.clientHeight,I=h.roomLabel,M=I.positionInImage.x*100+"%",T=I.positionInImage.y*100+"%",P=(b<500||y<500?10:14)+"px";let V=0,L=0,W=!1;u.subscribe(function(_){e(16,W=!!_&&_.id===h.id)});const q=G=>{e(4,V=G.detail)},N=G=>{e(5,L=G.detail)};return i.$$set=G=>{"pxmm"in G&&e(12,l=G.pxmm),"roomAreaEnable"in G&&e(0,c=G.roomAreaEnable),"roomNameEnable"in G&&e(1,d=G.roomNameEnable),"room"in G&&e(2,h=G.room),"hoveredRoom"in G&&e(13,u=G.hoveredRoom),"getRoomAreaText"in G&&e(14,m=G.getRoomAreaText),"getLabelElement"in G&&e(3,A=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,p=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(h)),i.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),i.$$.dirty&48&&e(18,o={width:V,height:L}),i.$$.dirty&262148&&e(17,r=o?g(h,o):void 0),i.$$.dirty&233472&&e(6,a=p?W?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,V,L,a,s,n,M,T,P,l,u,m,p,W,r,o,q,N]}class Sg extends le{constructor(t){super(),ae(this,t,xg,kg,oe,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Pg)}}function Tg(i){ue(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 hl(i,t,e){const n=i.slice();return n[12]=t[e],n}function ul(i){let t,e=[],n=new Map,s,o,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=hl(i,a,c),h=l(d);n.set(h,e[c]=fl(h,d))}return{c(){t=D("div");for(let c=0;c<e.length;c+=1)e[c].c();w(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){B(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[$t(Ii.call(null,t)),be(t,"clientWidth",i[11])],o=!0)},p(c,d){d&447&&(a=c[8],de(),e=zt(e,d,l,1,c,a,n,t,vn,fl,null,hl),he())},i(c){if(!s){for(let d=0;d<a.length;d+=1)k(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)z(e[d]);s=!1},d(c){c&&O(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Je(r)}}}function fl(i,t){let e,n,s;const o=[{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<o.length;a+=1)r=et(r,o[a]);return n=new Sg({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&447?lt(o,[{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){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function Lg(i){let t,e,n=i[8]&&ul(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[8]?n?(n.p(s,o),o&256&&k(n,1)):(n=ul(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function zg(i,t,e){let n,{floorIndex:s}=t,{roomAreaEnable:o}=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,s=p.floorIndex),"roomAreaEnable"in p&&e(0,o=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[s].rooms),i.$$.dirty&1088){const{max:p,min:g}=a.bounding,b=p.x-g.x;e(7,m=u/b)}},[o,r,l,c,d,h,u,m,n,s,a,A]}class jg extends le{constructor(t){super(),ae(this,t,zg,Lg,oe,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Tg)}}function Og(i){ue(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 ml(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 pl(i){let t;return{c(){t=D("div"),w(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){B(e,t,n)},p:J,d(e){e&&O(t)}}}function Al(i,t){let e,n,s=t[1](t[11].distance)+"",o,r;return{key:i,first:null,c(){e=D("div"),n=D("div"),o=ke(s),r=ee(),w(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),$(n,"is-row",t[2]),w(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){B(a,e,l),x(e,n),x(n,o),x(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&Oe(o,s)},d(a){a&&O(e)}}}function Bg(i){let t,e,n,s,o,r,a=[],l=new Map,c,d=i[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=pl(gl(i,d,A));let u=i[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=ml(i,u,A),g=m(p);l.set(g,a[A]=Al(g,p))}return{c(){t=D("div"),e=D("div"),n=ee(),s=D("div");for(let A=0;A<h.length;A+=1)h[A].c();o=ee(),r=D("div");for(let A=0;A<a.length;A+=1)a[A].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),$(s,"is-row",i[2]),w(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),w(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){B(A,t,p),x(t,e),x(t,n),x(t,s);for(let g=0;g<h.length;g+=1)h[g]&&h[g].m(s,null);x(t,o),x(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(A,[p]){if(p&8){d=A[3];let g;for(g=0;g<d.length;g+=1){const b=gl(A,d,g);h[g]?h[g].p(b,p):(h[g]=pl(b),h[g].c(),h[g].m(s,null))}for(;g<h.length;g+=1)h[g].d(1);h.length=d.length}p&22&&(u=A[4],a=zt(a,p,m,1,A,u,l,r,wa,Al,null,ml)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&w(t,"class",c),p&5&&$(t,"is-row",A[2])},i:J,o:J,d(A){A&&O(t),Tt(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const qn=1e3,Kn=180;function Vg(i,t,e){let{type:n}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=o.max.x-o.min.x-(qn-Kn)*2,c=o.max.y-o.min.y-(qn-Kn)*2,d=s.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,g)=>p===0?!0:A!==g[p-1]),h=d.map(A=>{const p=a?(A-o.min.x-qn+Kn)/l:0,g=a?0:(A-o.min.y-qn+Kn)/c;return{left:p,bottom:g}});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,g)=>{const b=p===0?0:A-g[p-1],y=p===0?0:(A+g[p-1])/2,I=a?(y-o.min.x-qn+Kn)/l:0,M=a?0:(y-o.min.y-qn+Kn)/c;return{left:I,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,s=A.data),"bounding"in A&&e(6,o=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,h,m,s,o]}class Rg extends le{constructor(t){super(),ae(this,t,Vg,Bg,oe,{type:0,data:5,bounding:6,getRuleDistanceText:1},Og)}}function Qg(i){ue(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function vl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function bl(i,t){let e,n,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return n=new Rg({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&19?lt(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function Gg(i){let t,e=[],n=new Map,s,o=i[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=vl(i,o,a),c=r(l);n.set(c,e[a]=bl(c,l))}return{c(){t=D("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),j(t,"width",i[3]),j(t,"height",i[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],de(),e=zt(e,l,r,1,a,o,n,t,vn,bl,null,vl),he()),l&8&&j(t,"width",a[3]),l&4&&j(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)k(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)z(e[l]);s=!1},d(a){a&&O(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const yl=1e3,wl=180;function Ng(i,t,e){let n,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return i.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,A=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,s=A.floorDatas[m].rules),i.$$.dirty&2048&&e(12,o=Object.keys(s)),i.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),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-(yl-wl)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(yl-wl)*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,s,o]}class Hg extends le{constructor(t){super(),ae(this,t,Ng,Gg,oe,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Qg)}}function Io(i,t={}){let e="";const{needZ:n,needA:s}=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):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Hh({x:i,y:t},e){const{max:n,min:s}=e;return{x:i-s.x,y:n.y-t}}function _g(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 Wg(i,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/s}}function Fg(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Yg(i){let t;return{c(){t=je("path"),w(t,"d",i[0]),w(t,"fill","#2F313A")},m(e,n){B(e,t,n)},p(e,[n]){n&1&&w(t,"d",e[0])},i:J,o:J,d(e){e&&O(t)}}}function Ug(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Io(s,{needZ:!0}))},[n,s]}class Xg extends le{constructor(t){super(),ae(this,t,Ug,Yg,oe,{path:1})}}function Zg(i){let t,e,n,s,o,r;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("path"),o=ee(),r=je("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width",i[1]),w(n,"height",i[1]),w(n,"fill","#323747"),w(s,"d",i[2]),w(s,"stroke","#ffffff"),w(s,"stroke-opacity","0.06"),w(s,"stroke-width","0.5"),w(s,"fill","none"),w(e,"id","fpm-room-pattern-0"),w(e,"x","0"),w(e,"y","0"),w(e,"width",i[1]),w(e,"height",i[1]),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(r,"d",i[0]),w(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),x(t,e),x(e,n),x(e,s),B(a,o,l),B(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:J,o:J,d(a){a&&O(t),a&&O(o),a&&O(r)}}}const Ir=6;function Jg(i,t,e){let n,{path:s}=t;const o=Ir*2,r=`M0 ${Ir} h ${o} M${Ir} 0 v ${o}`;return i.$$set=a=>{"path"in a&&e(3,s=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Io(s,{needZ:!0}))},[n,o,r,s]}class qg extends le{constructor(t){super(),ae(this,t,Jg,Zg,oe,{path:3})}}function Kg(i){let t,e,n,s,o,r,a,l,c,d,h;return{c(){t=je("defs"),e=je("pattern"),n=je("rect"),s=je("pattern"),o=je("rect"),r=ee(),a=je("path"),l=ee(),c=je("path"),d=ee(),h=je("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width","6"),w(n,"height","50"),w(n,"fill","none"),w(n,"stroke","#4B4B57"),w(n,"stroke-width","0.5"),w(e,"id","room-material-pattern-1"),w(e,"x","0"),w(e,"y","0"),w(e,"width","12"),w(e,"height","50"),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(o,"x","0"),w(o,"y","0"),w(o,"width","6"),w(o,"height","50"),w(o,"fill","none"),w(o,"stroke","#4B4B57"),w(o,"stroke-width","0.5"),w(s,"id","room-material-pattern-2"),w(s,"x","6"),w(s,"y","25"),w(s,"width","12"),w(s,"height","50"),w(s,"patternUnits","userSpaceOnUse"),w(s,"patternTransform","scale(50 50)"),w(a,"d",i[0]),w(a,"fill","#43434D"),w(c,"d",i[0]),w(c,"fill","url(#room-material-pattern-1)"),w(h,"d",i[0]),w(h,"fill","url(#room-material-pattern-2)")},m(u,m){B(u,t,m),x(t,e),x(e,n),x(t,s),x(s,o),B(u,r,m),B(u,a,m),B(u,l,m),B(u,c,m),B(u,d,m),B(u,h,m)},p(u,[m]){m&1&&w(a,"d",u[0]),m&1&&w(c,"d",u[0]),m&1&&w(h,"d",u[0])},i:J,o:J,d(u){u&&O(t),u&&O(r),u&&O(a),u&&O(l),u&&O(c),u&&O(d),u&&O(h)}}}function $g(i,t,e){let n,{path:s}=t;return i.$$set=o=>{"path"in o&&e(1,s=o.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Io(s,{needZ:!0}))},[n,s]}class ep extends le{constructor(t){super(),ae(this,t,$g,Kg,oe,{path:1})}}function tp(i){ue(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 Cl(i,t,e){const n=i.slice();return n[5]=t[e],n}function np(i){let t,e;return t=new qg({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ip(i){let t,e;return t=new ep({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function sp(i){let t,e;return t=new Xg({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.path=n[5].path),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Il(i){let t,e,n,s;const o=[sp,ip,np],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=o[e](i),{c(){t=je("svg"),n.c(),w(t,"width","100%"),w(t,"height","100%"),w(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),w(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(de(),z(r[d],1,1,()=>{r[d]=null}),he(),n=r[e],n?n.p(l,c):(n=r[e]=o[e](l),n.c()),k(n,1),n.m(t,null))},i(l){s||(k(n),s=!0)},o(l){z(n),s=!1},d(l){l&&O(t),r[e].d()}}}function op(i){let t,e,n=i[0],s=[];for(let r=0;r<n.length;r+=1)s[r]=Il(Cl(i,n,r));const o=r=>z(s[r],1,1,()=>{s[r]=null});return{c(){t=D("div");for(let r=0;r<s.length;r+=1)s[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[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=Cl(r,n,l);s[l]?(s[l].p(c,a),k(s[l],1)):(s[l]=Il(c),s[l].c(),k(s[l],1),s[l].m(t,null))}for(de(),l=n.length;l<s.length;l+=1)o(l);he()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)z(s[a]);e=!1},d(r){r&&O(t),Tt(s,r)}}}function rp(i,t,e){let n,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=o.floorDatas[s].rooms.map(l=>Ae(H({},l),{path:l.path.map(c=>Hh(c,o.bounding))})))},[n,r,a,s,o]}class ap extends le{constructor(t){super(),ae(this,t,rp,op,oe,{floorIndex:3,floorplanData:4},tp)}}function lp(i){ue(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function cp(i){let t,e,n,s;return{c(){t=je("path"),w(t,"d",i[5]),w(t,"fill","#fff"),w(t,"style",i[2]),w(t,"id",e=`${i[1]}_${i[0].id}`),w(t,"class","svelte-qq2273")},m(o,r){B(o,t,r),n||(s=[be(t,"mouseenter",i[3]),be(t,"mouseleave",i[4])],n=!0)},p(o,[r]){r&4&&w(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&w(t,"id",e)},i:J,o:J,d(o){o&&O(t),n=!1,Je(s)}}}function dp(i,t,e){let n,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Io(o.path,{needZ:!0,format:A=>Hh(A,u)});return i.$$set=A=>{"room"in A&&e(0,o=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}_${o.id}`]),i.$$.dirty&512&&e(2,s=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,n]}class hp extends le{constructor(t){super(),ae(this,t,dp,cp,oe,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},lp)}}function up(i){ue(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 Pl(i,t,e){const n=i.slice();return n[6]=t[e],n}function El(i,t){let e,n,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return n=new hp({props:r}),{key:i,first:null,c(){e=Pe(),ie(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),te(n,a,l),s=!0},p(a,l){t=a;const c=l&15?lt(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){z(n.$$.fragment,a),s=!1},d(a){a&&O(e),ne(n,a)}}}function fp(i){let t,e,n=[],s=new Map,o,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Pl(i,r,l),d=a(c);s.set(d,n[l]=El(d,c))}return{c(){t=D("div"),e=je("svg");for(let l=0;l<n.length;l+=1)n[l].c();w(e,"width","100%"),w(e,"height","100%"),w(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),w(e,"class","svelte-1kqo6e4"),w(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),x(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,de(),n=zt(n,c,a,1,l,r,s,e,vn,El,null,Pl),he())},i(l){if(!o){for(let c=0;c<r.length;c+=1)k(n[c]);o=!0}},o(l){for(let c=0;c<n.length;c+=1)z(n[c]);o=!1},d(l){l&&O(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function mp(i,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[n,s,o,r,a,l]}class _h extends le{constructor(t){super(),ae(this,t,mp,fp,oe,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},up)}}function gp(i){ue(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 Ml(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new _h({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&24834?lt(n,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function kl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new jg({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&22370?lt(n,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function Dl(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new Hg({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2306?lt(n,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function pp(i){let t,e,n,s,o,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=et(h,d[b]);e=new ap({props:h});let u=(i[2]||i[3])&&Ml(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let b=0;b<m.length;b+=1)A=et(A,m[b]);o=new Nh({props:A});let p=i[4]&&kl(i),g=i[7]&&Dl(i);return{c(){t=D("div"),ie(e.$$.fragment),n=ee(),u&&u.c(),s=ee(),ie(o.$$.fragment),r=ee(),p&&p.c(),a=ee(),g&&g.c(),w(t,"class",l=Re(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,y){B(b,t,y),te(e,t,null),x(t,n),u&&u.m(t,null),x(t,s),te(o,t,null),x(t,r),p&&p.m(t,null),x(t,a),g&&g.m(t,null),c=!0},p(b,[y]){const I=y&258?lt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(I),b[2]||b[3]?u?(u.p(b,y),y&12&&k(u,1)):(u=Ml(b),u.c(),k(u,1),u.m(t,s)):u&&(de(),z(u,1,1,()=>{u=null}),he());const M=y&258?lt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};o.$set(M),b[4]?p?(p.p(b,y),y&16&&k(p,1)):(p=kl(b),p.c(),k(p,1),p.m(t,a)):p&&(de(),z(p,1,1,()=>{p=null}),he()),b[7]?g?(g.p(b,y),y&128&&k(g,1)):(g=Dl(b),g.c(),k(g,1),g.m(t,null)):g&&(de(),z(g,1,1,()=>{g=null}),he()),(!c||y&1&&l!==(l=Re(`floorplan-plugin__floor${b[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&w(t,"class",l)},i(b){c||(k(e.$$.fragment,b),k(u),k(o.$$.fragment,b),k(p),k(g),c=!0)},o(b){z(e.$$.fragment,b),z(u),z(o.$$.fragment,b),z(p),z(g),c=!1},d(b){b&&O(t),ne(e),u&&u.d(),ne(o),p&&p.d(),g&&g.d()}}}function Ap(i,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{highlightEnable:o}=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:g}=t;const b=Pa(void 0);return i.$$set=y=>{"isCurrent"in y&&e(0,n=y.isCurrent),"floorIndex"in y&&e(1,s=y.floorIndex),"highlightEnable"in y&&e(2,o=y.highlightEnable),"hoverEnable"in y&&e(3,r=y.hoverEnable),"roomLabelsEnable"in y&&e(4,a=y.roomLabelsEnable),"roomAreaEnable"in y&&e(5,l=y.roomAreaEnable),"roomNameEnable"in y&&e(6,c=y.roomNameEnable),"ruleLabelsEnable"in y&&e(7,d=y.ruleLabelsEnable),"floorplanData"in y&&e(8,h=y.floorplanData),"getRoomAreaText"in y&&e(9,u=y.getRoomAreaText),"getLabelElement"in y&&e(10,m=y.getLabelElement),"getRuleDistanceText"in y&&e(11,A=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,p=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,g=y.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,A,p,g,b]}let vp=class extends le{constructor(t){super(),ae(this,t,Ap,pp,oe,{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},gp)}};function bp(i){ue(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function xl(i,t,e){const n=i.slice();return n[21]=t[e],n}function Sl(i){let t,e,n,s,o,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Tl(xl(i,r,h));const l=h=>z(a[h],1,1,()=>{a[h]=null});let c=i[5]&&Ll(i),d=i[8]&&zl(i);return{c(){t=D("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ee(),c&&c.c(),n=ee(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){B(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);x(t,e),c&&c.m(t,null),x(t,n),d&&d.m(t,null),o=!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=xl(i,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=Tl(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(de(),m=r.length;m<a.length;m+=1)l(m);he()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=Ll(i),c.c(),k(c,1),c.m(t,n)):c&&(de(),z(c,1,1,()=>{c=null}),he()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=zl(i),d.c(),k(d,1),d.m(t,null)):d&&(de(),z(d,1,1,()=>{d=null}),he())},i(h){if(!o){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),s||Ne(()=>{s=On(t,tt,{duration:i[0],easing:en}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)z(a[u]);z(c),z(d),o=!1},d(h){h&&O(t),Tt(a,h),c&&c.d(),d&&d.d()}}}function Tl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new vp({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2047696?lt(n,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function Ll(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new ig({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&57352?lt(n,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function zl(i){let t,e;return t=new dg({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&8192&&(o.floorplanData=n[13]),s&4&&(o.northDesc=n[2]),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function yp(i){let t,e,n=i[1]&&Sl(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&k(n,1)):(n=Sl(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function wp(i,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:o}=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:g}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:y}=t,{getRoomAreaText:I}=t,{getLabelElement:M}=t,{getRuleDistanceText:T}=t,{adaptiveRoomLabelVisibleEnable:P}=t,{highlightData:V}=t;return i.$$set=L=>{"duration"in L&&e(0,n=L.duration),"visible"in L&&e(1,s=L.visible),"northDesc"in L&&e(2,o=L.northDesc),"panoIndex"in L&&e(3,r=L.panoIndex),"floorIndex"in L&&e(4,a=L.floorIndex),"cameraEnable"in L&&e(5,l=L.cameraEnable),"hoverEnable"in L&&e(6,c=L.hoverEnable),"highlightEnable"in L&&e(7,d=L.highlightEnable),"compassEnable"in L&&e(8,h=L.compassEnable),"roomLabelsEnable"in L&&e(9,u=L.roomLabelsEnable),"roomAreaEnable"in L&&e(10,m=L.roomAreaEnable),"roomNameEnable"in L&&e(11,A=L.roomNameEnable),"ruleLabelsEnable"in L&&e(12,p=L.ruleLabelsEnable),"floorplanData"in L&&e(13,g=L.floorplanData),"lastPanoramaLongitude"in L&&e(14,b=L.lastPanoramaLongitude),"cameraImageUrl"in L&&e(15,y=L.cameraImageUrl),"getRoomAreaText"in L&&e(16,I=L.getRoomAreaText),"getLabelElement"in L&&e(17,M=L.getLabelElement),"getRuleDistanceText"in L&&e(18,T=L.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in L&&e(19,P=L.adaptiveRoomLabelVisibleEnable),"highlightData"in L&&e(20,V=L.highlightData)},[n,s,o,r,a,l,c,d,h,u,m,A,p,g,b,y,I,M,T,P,V]}let Ea=class extends le{constructor(t){super(),ae(this,t,wp,yp,oe,{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},bp)}};const Cp="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 Ip(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return U(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(i.map(e))})}function Pp(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 Ep(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Pp),rules:i.rules}}function Mp(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function kp(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 mn(i){return U(this,null,function*(){const t=yield Ip(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ep),s=i.computed_data.entrance?kp(i.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Mp)}})}function Dp(i,t,e){return i.map(s=>{const o=s.position,r=s.icon?s.icon:{url:Cp,width:45,height:48},a=Fg(o,t),l=_g(o,e),c=Wg(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function xp(i,t){return t(i),i}function Po(i,t){return xp({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function jl(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 Ma(i,t,e=dn.BOUNDING_CENTER){const n=jl(i,t),s=jl(i,t+1);return e===dn.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===dn.CEILING?s:n}function ka(i,t,e,n){const s=Ma(i,e,n==null?void 0:n.attachedTo),o=new E.Vector3(0,s,0),r=new E.Vector3(1,s,0),a=o.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let os=class{constructor(t,e){f(this,"VERSION","2.21.0-dev.13");f(this,"five");f(this,"hooks",new gi);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 ha(this.staticPrefix,t)}},Bn=class extends os{};var wt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(wt||{});const Wh=500,Sp=80;function Xr(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Da(i,t){return U(this,null,function*(){const[e]=yield ci(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 s=i.getCurrentState();if(!Tp(n,s))throw new Error("pose 与预期不符")})}function Tp(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const s=i[e];return typeof n=="number"&&typeof s=="number"?Xr(n,s,2):n===s})}function xa(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:o,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Xr(e,o,2)||!Xr(n,r,2)||s!==a)}function Fh(i,t,e=!0){return U(this,null,function*(){if(xa(i,t)===!0)return;const s=i.getCurrentState();if(s.mode!==t.mode){const[d]=yield ci(Da(i,[t.mode,t,void 0,e]));if(d)throw new Error(wt.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ci(i.updateCamera(t,l,e));if(c)throw new Error(wt.UpdateCameraError)})}function hi(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(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function Lp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function zp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let jp=class extends Bn{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 s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),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||!xa(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,wt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$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(wt.ModelNotLoaded);if(!this.data)throw new Error(wt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=H(H({},n),e),o=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ci(Fh(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(wt.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:Wh;hi(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,wt.BreakOffByHide),this.showPromise=void 0;const s=H(H({},{userAction:!0,isAutoHide:!1}),e);hi(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.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 s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||zp(s)&&(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 s=this.five.getCurrentState();Lp(s)&&(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:Sp/((a=n==null?void 0:n.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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 mn(e.data)})}updateState(e,n){const s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Op=(i,t)=>new jp(i,t);function Bp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Vp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}let Rp=class extends Bn{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 s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),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||!xa(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,wt.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$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(wt.ModelNotLoaded);if(!this.data)throw new Error(wt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=H(H({},n),e),o=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ci(Fh(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(wt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const d=s.modelOpacity,h=s.immediately?0:Wh;hi(this.five,d,h),this.render(h)});return this.showPromise=o().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,wt.BreakOffByHide),this.showPromise=void 0;const s=H(H({},{userAction:!0,isAutoHide:!1}),e);hi(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.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 s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bp(s)&&(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 s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Vp(s)&&(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 s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Ma(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 s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield mn(e.data)})}updateState(e,n){const s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Qp=(i,t)=>new Rp(i,t);let Gp=class extends Bn{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,s=n.x-e.x,o=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=ka(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*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 s,o;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.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 s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:fn,attachedTo:dn.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=n?Po(n,["selector","scale"]):{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(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=o(a)?a.data:a,c=this.data;this.data=yield mn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}updatePosition(){var a;const e=Ma(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 s=n.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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 mn(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 Da(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;hi(this.five,o,s),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 s=1,o=0;hi(this.five,s,o),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 s=this.state,o=e.config?H(H({},s.config),e.config):s.config;this.state=Ae(H(H({},this.state),e),{config:o}),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 Ea({target:this.container,intro:!0,props:n})}};const Np=(i,t)=>new Gp(i,t);function Sa(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Hp(i){ue(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 _p(i){let t,e,n;return{c(){t=D("div"),e=D("div"),n=D("div"),w(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),j(n,"background-image","url("+(i[0]||fn)+")"),j(n,"transform",i[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),j(e,"transform",i[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){B(s,t,o),x(t,e),x(e,n)},p(s,[o]){o&1&&j(n,"background-image","url("+(s[0]||fn)+")"),(o&1||o&3)&&j(n,"transform",s[1]),o&4&&j(e,"transform",s[2])},i:J,o:J,d(s){s&&O(t)}}}function Wp(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Fp(i,t,e){let n,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(A,p){const g=A.bounding,b=A.observers[p];if(!b)return"";const y=(g.max.x-g.min.x)*r,I=(g.max.y-g.min.y)*r,M=Math.floor(b.positionInImage.x*y),T=Math.floor(b.positionInImage.y*I);return`translate(${M}px, ${T}px)`}function u(A){e(6,c=A)}const m=Sa(A=>{e(7,d=A.longitude)},1e3/60);return vt(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,o=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,s=Wp(d))},[l,s,n,o,r,a,c,d]}class Yp extends le{constructor(t){super(),ae(this,t,Fp,_p,oe,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Hp)}}function Up(i){ue(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 Ol(i,t,e){const n=i.slice();return n[1]=t[e],n}function Bl(i,t){let e,n,s=`${t[1].icon.width/16}rem`,o=`${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=D("div"),n=D("div"),r=ee(),w(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),j(n,"background-image",`url(${t[1].icon.url})`),j(n,"width",s),j(n,"height",o),w(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){B(c,e,d),x(e,n),x(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",s),h&&j(n,"height",o),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 Xp(i){let t,e=[],n=new Map,s=i[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Ol(i,s,r),l=o(a);n.set(l,e[r]=Bl(l,a))}return{c(){t=D("div");for(let r=0;r<e.length;r+=1)e[r].c();w(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=zt(e,a,o,1,r,s,n,t,wa,Bl,null,Ol))},i:J,o:J,d(r){r&&O(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Zp(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class Jp extends le{constructor(t){super(),ae(this,t,Zp,Xp,oe,{extraObjects:0},Up)}}function Vl(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 s={};for(let o=0;o<n.length;o+=1)s=et(s,n[o]);return t=new _h({props:s}),{c(){ie(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&183?lt(n,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){z(t.$$.fragment,o),e=!1},d(o){ne(t,o)}}}function qp(i){let t,e,n,s,o,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=et(l,a[d]);t=new Nh({props:l}),n=new Jp({props:{extraObjects:i[6]}});let c=i[3]&&Vl(i);return{c(){ie(t.$$.fragment),e=ee(),ie(n.$$.fragment),s=ee(),c&&c.c(),o=Pe()},m(d,h){te(t,d,h),B(d,e,h),te(n,d,h),B(d,s,h),c&&c.m(d,h),B(d,o,h),r=!0},p(d,[h]){const u=h&20?lt(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=Vl(d),c.c(),k(c,1),c.m(o.parentNode,o)):c&&(de(),z(c,1,1,()=>{c=null}),he())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){z(t.$$.fragment,d),z(n.$$.fragment,d),z(c),r=!1},d(d){ne(t,d),d&&O(e),ne(n,d),d&&O(s),c&&c.d(d),d&&O(o)}}}function Kp(i,t,e){let n,{five:s}=t,{pxmm:o}=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,s=u.five),"pxmm"in u&&e(1,o=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))},[s,o,r,a,l,d,n,h,c]}class $p extends le{constructor(t){super(),ae(this,t,Kp,qp,oe,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function eA(i){ue(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 Rl(i){let t,e,n,s,o=i[7]!==0&&Ql(i);return{c(){t=D("div"),o&&o.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){B(r,t,a),o&&o.m(t,null),e=!0,n||(s=[$t(Ii.call(null,t)),be(t,"clientWidth",i[13]),be(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&k(o,1)):(o=Ql(r),o.c(),k(o,1),o.m(t,null)):o&&(de(),z(o,1,1,()=>{o=null}),he())},i(r){e||(k(o),e=!0)},o(r){z(o),e=!1},d(r){r&&O(t),o&&o.d(),n=!1,Je(s)}}}function Ql(i){let t,e,n,s,o=`${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=et(c,l[u]);e=new $p({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=et(h,d[u]);return s=new Yp({props:h}),{c(){t=D("div"),ie(e.$$.fragment),n=ee(),ie(s.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),j(t,"width",o),j(t,"height",r)},m(u,m){B(u,t,m),te(e,t,null),x(t,n),te(s,t,null),a=!0},p(u,m){const A=m&3181?lt(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?lt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(p),m&512&&o!==(o=`${u[9]}px`)&&j(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&j(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(s.$$.fragment,u),a=!0)},o(u){z(e.$$.fragment,u),z(s.$$.fragment,u),a=!1},d(u){u&&O(t),ne(e),ne(s)}}}function tA(i){let t,e,n=i[1]&&Rl(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&k(n,1)):(n=Rl(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function nA(i,t,e){var I,M;let{five:n}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(I=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:I.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function g(T){e(11,h=n.work.observers[T].floorIndex)}vt(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));const b=T=>{e(7,u=T.detail)},y=T=>{e(8,m=T.detail)};return i.$$set=T=>{"five"in T&&e(0,n=T.five),"visible"in T&&e(1,s=T.visible),"hoverEnable"in T&&e(2,o=T.hoverEnable),"floorplanData"in T&&e(3,r=T.floorplanData),"cameraImageUrl"in T&&e(4,a=T.cameraImageUrl),"extraObjects"in T&&e(5,l=T.extraObjects),"highlightData"in T&&e(6,c=T.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const T=Math.min(u,m),{max:P,min:V}=r.bounding,L=P.x-V.x,W=P.y-V.y,q=function(){return L>W?[T,T/L*W]:[T/W*L,T]}();e(9,A=q[0]),e(12,p=q[1]),e(10,d=A/L)}},[n,s,o,r,a,l,c,u,m,A,d,h,p,b,y]}class iA extends le{constructor(t){super(),ae(this,t,nA,tA,oe,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},eA)}}let sA=class extends Bn{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 s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:fn},o=n!=null&&n.configs?n.configs:{},r=H(H({},s),o);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,s=!0){return U(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield mn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,s),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 s=this.state,o=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};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=Dp(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield mn(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 s=this.state;this.state=H(H({},this.state),e),!Gt(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=Ae(H({},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 iA({target:this.wrapper,props:e})}};const oA=(i,t)=>new sA(i,t),rA=[{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:"和室"}],aA=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],lA=[{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:"写字楼"}],Pr=(i,t,e)=>{const n=new E.Matrix4,s=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(s),n},cA=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[s,o,r]=e;s&&i.applyMatrix4(Pr(s,0,0)),o&&i.applyMatrix4(Pr(0,o,0)),r&&i.applyMatrix4(Pr(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Yh(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,o=H({map:s.material.map||{}},t);s.material=new R.MeshBasicMaterial(o),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const dA=(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,s={},o=h=>U(exports,null,function*(){var G;const u=(h==null?void 0:h.fbx_url)||e,m=(G=h==null?void 0:h.north_rad)!=null?G:n;if(typeof m!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=i.model.bounding,p=A.max.x-A.min.x,g=A.max.z-A.min.z,b=Math.max(p,g),I=yield new sh.FBXLoader().loadAsync(u);Yh(I,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const M=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:P},min:{x:V,y:L,z:W}}}}=i;s.yBase=L;const q={x:(T+V)/2,y:L-1.6,z:(P+W)/2},N=.0045*b;return cA(I,{position:q,rotation:M,scale:N}),s.object=I,!0}),r=({latitude:h})=>{if(!s.object)return;const u=a(h);u&&(s.object.position.y=u)},a=h=>{if(s.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return s.yBase-(u+1.6);const m=h*(4/Math.PI);return s.yBase-(u*m+1.6)};return{load:o,disable:()=>{s.object&&(i.scene.remove(s.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!s.object)return;const h=a(i.getPose().latitude);h&&(s.object.position.y=h),i.scene.add(s.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function hA(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,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(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=s,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(i,e/2,e*.7),new R.CanvasTexture(a)}const uA=({x:i,y:t,z:e})=>new R.Vector3(i,t,e),fA=(i,t)=>{var p,g,b;const e={},n=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>U(exports,null,function*(){var q,N,G,_,Q,F,Z,X;const I=(q=y==null?void 0:y.position)!=null?q:s;if(!I)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=uA(I),T=(N=y==null?void 0:y.rad)!=null?N:o,P=(G=y==null?void 0:y.fbx_url)!=null?G:r;if(e.rad=T,T===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`));const V=yield new sh.FBXLoader().loadAsync(P);V.position.copy(M),V.rotation.z=T,V.scale.set(.8,.8,.8),Yh(V,{transparent:!0,side:E.DoubleSide});const L=(Z=(F=(Q=(_=V.children)==null?void 0:_[0])==null?void 0:Q.children)==null?void 0:F[3])==null?void 0:Z.clone();if(!L)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${L}`));const W=(X=t.name)!=null?X:"入户门";return L.material=new R.MeshBasicMaterial({transparent:!0,map:hA(W)}),L.renderOrder=3,V.children[0].add(L),e.object=V,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,I=new R.AnimationMixer(e.object);a.push(I);const M=I.clipAction(e.object.animations[0]);M.timeScale=y;let T;const P=()=>{let q=0,N=0;const G=1e3/30,_=Q=>{q=requestAnimationFrame(_);const F=Q-N;F<G||(N=Q,a.forEach(Z=>Z.update(F/1e3)),i.needsRender=!0)};return q=requestAnimationFrame(_),()=>{cancelAnimationFrame(q)}},W={play:()=>{T||(M.play(),T=P(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),T==null||T(),T=void 0}};e.animation=W},d=y=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=y==null?void 0:y.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=y=>y==="Floorplan"?d():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),d(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",u)),!0)}},mA=xt;function gA(i,t,e,n=mA.Linear.None){const s=new mo(i).to(t,e).easing(n);Ao(()=>s.start(0));const o=ss(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function pA(i,t){return gA({progress:0},{progress:1},i,t)}var Uh=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Uh||{}),Rt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Rt||{});const Ws=Math.PI*2;function Gl(i){return(i%Ws+Ws)%Ws}function Nl(i){return i%Ws}function Er(i,t,e){return i+(t-i)*e}const Zr=(i,t,e)=>{const n=Math.PI,s=n*2;let o=Gl(i),r=Gl(t);return e===Rt.Anticlockwise&&o<r&&(o+=s),e===Rt.Clockwise&&r<o&&(r+=s),e===Rt.Loop&&r-o>n?Zr(o,r,Rt.Anticlockwise):e===Rt.Loop&&o-r>n?Zr(o,r,Rt.Clockwise):{from:o,to:r}},AA=i=>{const t={},e=(l,c,...d)=>U(exports,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==i.currentMode&&(yield i.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(yield i.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,H({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),n=o=>{const r=i.state,a=Nl(r.latitude),l=Nl(o.latitude),{from:c,to:d}=Zr(r.longitude,o.longitude,o.rotation||Rt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(exports,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Te.Five.Mode.Panorama&&(yield i.changeMode(Te.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(o.panoIndex)),yield new Promise((m,A)=>{if(!o.panoIndex){m(!0);return}i.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(o);return yield new Promise(m=>{const A=({progress:I})=>{const M={};M.longitude=Er(h.longitude,u.longitude,I),M.latitude=Er(h.latitude,u.latitude,I),M.fov=Er(h.fov,u.fov,I),i.setState(M,!0)},p=()=>{m(!0)},g=()=>{m(!1)},b=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,y=pA(b,xt.Linear.None).onUpdate(A).onComplete(p).onDestroy(g);o.rotation===Rt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(I=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(I)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Hl(i,t){return i.x===t.x&&i.y===t.y}function Xh(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function oo(i,t){return(t.y-i.y)/(t.x-i.x)}function Zh(i,t,e){const n=oo(i[1],i[0]),s=oo(t[1],t[0]);if(isNaN(n)||isNaN(s)||Xh(n,s))return!1;if(xs(i[0],t))return i[0];if(xs(i[1],t))return i[1];if(xs(t[0],i))return t[0];if(xs(t[1],i))return t[1];if(e&&!vA(i,t))return!1;const o=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-o.y+n*o.x-s*r.x)/(n-s),l=n*a-n*o.x+o.y;return{x:a,y:l}}function xs(i,t){return Hl(i,t[0])||Hl(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&&Xh(oo(t[0],i),oo(i,t[1]))}function Ss(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function vA(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)&&Ss(t[0],i[1],i[0])*Ss(i[1],t[1],i[0])>0&&Ss(i[0],t[1],t[0])*Ss(t[1],i[1],t[0])>0?1:0}function Jh(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Jh(i,t-1))}const bA=`<style type="text/css">
195
195
  .PanoRulerPlugin-rule-line {
196
196
  position: absolute;
197
197
  transform-origin: left center;
@@ -516,7 +516,7 @@ void main() {
516
516
  撤销`),o=ee(),r=D("div"),a=D("div"),l=ke(`
517
517
  结束`),w(n,"class","icon svelte-nlls1v"),j(n,"background-image",`url(${au})`),w(e,"class","button svelte-nlls1v"),w(a,"class","icon svelte-nlls1v"),j(a,"background-image",`url(${lu})`),w(r,"class","button svelte-nlls1v"),w(t,"class","buttons svelte-nlls1v")},m(h,u){B(h,t,u),x(t,e),x(e,n),x(e,s),x(t,o),x(t,r),x(r,a),x(r,l),c||(d=[be(e,"click",i[5]),be(r,"click",i[4])],c=!0)},p:J,d(h){h&&O(t),c=!1,Je(d)}}}function Xv(i){let t,e,n,s,o,r,a,l,c,d,h,u=i[1]&&ic(i),m=i[3]&&sc(i);function A(g){i[7](g)}let p={options:[{key:"line",value:"测距离",icon:Fv},{key:"area",value:"测面积",icon:Yv}],onChange:i[6]};return i[2]!==void 0&&(p.setIndex=i[2]),c=new Nv({props:p}),Qe.push(()=>Ca(c,"setIndex",A)),{c(){t=D("div"),u&&u.c(),e=ee(),n=D("div"),s=D("div"),o=ee(),r=D("div"),m&&m.c(),a=ee(),l=D("div"),ie(c.$$.fragment),w(s,"class","mask svelte-nlls1v"),w(l,"class","mode-switcher svelte-nlls1v"),w(r,"class","center svelte-nlls1v"),w(n,"class","bottom svelte-nlls1v"),w(t,"class","Measure-Controller svelte-nlls1v")},m(g,b){B(g,t,b),u&&u.m(t,null),x(t,e),x(t,n),x(n,s),x(n,o),x(n,r),m&&m.m(r,null),x(r,a),x(r,l),te(c,l,null),h=!0},p(g,[b]){g[1]?u?(u.p(g,b),b&2&&k(u,1)):(u=ic(g),u.c(),k(u,1),u.m(t,e)):u&&(de(),z(u,1,1,()=>{u=null}),he()),g[3]?m?m.p(g,b):(m=sc(g),m.c(),m.m(r,a)):m&&(m.d(1),m=null);const y={};b&1&&(y.onChange=g[6]),!d&&b&4&&(d=!0,y.setIndex=g[2],Aa(()=>d=!1)),c.$set(y)},i(g){h||(k(u),k(c.$$.fragment,g),h=!0)},o(g){z(u),z(c.$$.fragment,g),h=!1},d(g){g&&O(t),u&&u.d(),m&&m.d(),ne(c)}}}function Zv(i,t,e){let{measureController:n}=t,{showExit:s=!1}=t,o;function r(u){u==="Edit"?e(3,l=!0):(o(null),e(3,l=!1))}function a(){n.controller instanceof cn&&n.controller.complete(),n.save({mode:"Watch"})}vt(()=>{n.hook.on("modeChange",r)}),Lt(()=>{n.hook.off("modeChange",r)});let l=!1;const c=()=>n.revoke(),d=u=>{n.save().changeMode("Edit"),n.changeMeasureType(u)};function h(u){o=u,e(2,o)}return i.$$set=u=>{"measureController"in u&&e(0,n=u.measureController),"showExit"in u&&e(1,s=u.showExit)},[n,s,o,l,a,c,d,h]}class Jv extends le{constructor(t){super(),ae(this,t,Zv,Xv,oe,{measureController:0,showExit:1},Uv)}}function qv(i){ue(i,"svelte-1mfj5mk",'.Switcher.svelte-1mfj5mk.svelte-1mfj5mk{pointer-events:all;position:relative;margin-bottom:1.5rem;box-sizing:border-box;width:-moz-max-content;width:max-content}.Switcher.svelte-1mfj5mk .svelte-1mfj5mk{transition-duration:300ms;transition-timing-function:ease-out}.Switcher.svelte-1mfj5mk .content.svelte-1mfj5mk{transition-property:opacity}.Switcher.svelte-1mfj5mk .highlight.svelte-1mfj5mk{transition-property:width}.Switcher.svelte-1mfj5mk .Switcher-buttons.svelte-1mfj5mk{transition-property:transform}.Switcher.svelte-1mfj5mk .Switcher-buttons.svelte-1mfj5mk{position:absolute;top:50%;left:0;transform:translate(0, -50%);width:-moz-max-content;width:max-content}.Switcher.svelte-1mfj5mk .Switcher-buttons .button.svelte-1mfj5mk{display:inline-block;margin:0 0.5625rem}.Switcher.svelte-1mfj5mk .highlight.svelte-1mfj5mk{height:2rem;background:rgba(0, 0, 0, 0.3);border-radius:624.9375rem}.Switcher.svelte-1mfj5mk .content.svelte-1mfj5mk{position:relative;padding:0 0.75rem}.Switcher.svelte-1mfj5mk .button:not(.active) .content.svelte-1mfj5mk::before{content:"";position:absolute;top:50%;left:10%;width:80%;transform:translateY(-50%);height:0;box-shadow:0 0 0.9375rem 0.3125rem rgba(0, 0, 0, 0.3)}')}function oc(i,t,e){const n=i.slice();return n[13]=t[e],n[14]=t,n[15]=e,n}function rc(i){let t;return{c(){t=D("span"),w(t,"class","icon svelte-1mfj5mk"),j(t,"background-image",i[13].icon)},m(e,n){B(e,t,n)},p(e,n){n&1&&j(t,"background-image",e[13].icon)},d(e){e&&O(t)}}}function ac(i){let t,e,n,s=i[13].value+"",o,r,a=i[15],l,c,d=i[13].icon&&rc(i);const h=()=>i[9](t,a),u=()=>i[9](null,a);function m(){return i[10](i[13],i[15])}return{c(){t=D("div"),e=D("div"),d&&d.c(),n=ee(),o=ke(s),r=ee(),w(e,"class","content svelte-1mfj5mk"),w(t,"class","button svelte-1mfj5mk"),$(t,"active",i[4]===i[15])},m(A,p){B(A,t,p),x(t,e),d&&d.m(e,null),x(e,n),x(e,o),x(t,r),h(),l||(c=be(t,"click",m),l=!0)},p(A,p){i=A,i[13].icon?d?d.p(i,p):(d=rc(i),d.c(),d.m(e,n)):d&&(d.d(1),d=null),p&1&&s!==(s=i[13].value+"")&&Oe(o,s),a!==i[15]&&(u(),a=i[15],h()),p&16&&$(t,"active",i[4]===i[15])},d(A){A&&O(t),d&&d.d(),u(),l=!1,c()}}}function Kv(i){let t,e,n,s,o=i[0],r=[];for(let a=0;a<o.length;a+=1)r[a]=ac(oc(i,o,a));return{c(){t=D("div"),e=D("div"),n=ee(),s=D("div");for(let a=0;a<r.length;a+=1)r[a].c();w(e,"class","highlight svelte-1mfj5mk"),j(e,"width",i[5]?`${i[5]}px`:void 0),w(s,"class","Switcher-buttons svelte-1mfj5mk"),j(s,"transform",`translate(${i[6]}px, -50%)`),w(t,"class","Switcher svelte-1mfj5mk")},m(a,l){B(a,t,l),x(t,e),x(t,n),x(t,s);for(let c=0;c<r.length;c+=1)r[c]&&r[c].m(s,null);i[11](t)},p(a,[l]){if(l&32&&j(e,"width",a[5]?`${a[5]}px`:void 0),l&23){o=a[0];let c;for(c=0;c<o.length;c+=1){const d=oc(a,o,c);r[c]?r[c].p(d,l):(r[c]=ac(d),r[c].c(),r[c].m(s,null))}for(;c<r.length;c+=1)r[c].d(1);r.length=o.length}l&64&&j(s,"transform",`translate(${a[6]}px, -50%)`)},i:J,o:J,d(a){a&&O(t),Tt(r,a),i[11](null)}}}function $v(i,t,e){let n,s,{options:o}=t,{defaultKey:r=null}=t,{onChange:a}=t;const l=[];let c,d,h=0;function u(){if(s&&c){e(5,d=s.clientWidth);const g=h+c.getBoundingClientRect().left-s.getBoundingClientRect().left;e(6,h=g)}}function m(g,b){Qe[g?"unshift":"push"](()=>{l[b]=g,e(2,l)})}const A=(g,b)=>{a(g.key),e(4,n=b)};function p(g){Qe[g?"unshift":"push"](()=>{c=g,e(3,c)})}return i.$$set=g=>{"options"in g&&e(0,o=g.options),"defaultKey"in g&&e(7,r=g.defaultKey),"onChange"in g&&e(1,a=g.onChange)},i.$$.update=()=>{i.$$.dirty&129&&e(4,n=r?o.findIndex(g=>g.key===r):0),i.$$.dirty&20&&e(8,s=l[n]),i.$$.dirty&264&&s&&c&&setTimeout(()=>u(),0)},[o,a,l,c,n,d,h,r,s,m,A,p]}class e0 extends le{constructor(t){super(),ae(this,t,$v,Kv,oe,{options:0,defaultKey:7,onChange:1},qv)}}function t0(i){ue(i,"svelte-82ysdl",".CircleButton.svelte-82ysdl.svelte-82ysdl{position:relative;display:flex;justify-content:center;align-items:center;width:4.5rem;height:4.5rem;background-image:inherit;background-size:100% auto;background-repeat:no-repeat;transition:transform 200ms ease-in-out}.CircleButton.svelte-82ysdl.svelte-82ysdl:active{transform:scale(0.8)}.CircleButton.svelte-82ysdl .text.svelte-82ysdl{position:absolute}")}function lc(i){let t,e,n,s;return{c(){t=D("div"),e=ke(i[0]),w(t,"class","text svelte-82ysdl")},m(o,r){B(o,t,r),x(t,e),s=!0},p(o,r){(!s||r&1)&&Oe(e,o[0])},i(o){s||(Ne(()=>{s&&(n||(n=_t(t,tt,{duration:300},!0)),n.run(1))}),s=!0)},o(o){n||(n=_t(t,tt,{duration:300},!1)),n.run(0),s=!1},d(o){o&&O(t),o&&n&&n.end()}}}function n0(i){let t,e=i[0],n,s,o,r=lc(i);return{c(){t=D("div"),r.c(),w(t,"class","CircleButton svelte-82ysdl"),j(t,"background-image",`url(${i[2]})`)},m(a,l){B(a,t,l),r.m(t,null),n=!0,s||(o=be(t,"click",function(){nn(i[1])&&i[1].apply(this,arguments)}),s=!0)},p(a,[l]){i=a,l&1&&oe(e,e=i[0])?(de(),z(r,1,1,J),he(),r=lc(i),r.c(),k(r,1),r.m(t,null)):r.p(i,l),l&4&&j(t,"background-image",`url(${i[2]})`)},i(a){n||(k(r),n=!0)},o(a){z(r),n=!1},d(a){a&&O(t),r.d(a),s=!1,o()}}}function i0(i,t,e){let n,{text:s}=t,{onClick:o=null}=t,{color:r="white"}=t;return i.$$set=a=>{"text"in a&&e(0,s=a.text),"onClick"in a&&e(1,o=a.onClick),"color"in a&&e(3,r=a.color)},i.$$.update=()=>{i.$$.dirty&8&&e(2,n=(()=>r==="white"?ao:r==="blue"?ja:ao)())},[s,o,n,r]}class s0 extends le{constructor(t){super(),ae(this,t,i0,n0,oe,{text:0,onClick:1,color:3},t0)}}function o0(i){ue(i,"svelte-1ulunhy","*.forbid.svelte-1ulunhy.svelte-1ulunhy{pointer-events:none !important;opacity:0.5}.Measure-Controller.svelte-1ulunhy.svelte-1ulunhy{pointer-events:none;color:white}.Measure-Controller.svelte-1ulunhy .mode-switcher.svelte-1ulunhy{margin-top:2.25rem}.Measure-Controller.svelte-1ulunhy .bottom.svelte-1ulunhy{position:absolute;width:100%;bottom:0}.Measure-Controller.svelte-1ulunhy .bottom .mask.svelte-1ulunhy{position:absolute;bottom:0;width:100%;height:12.5rem;background-size:100%;background-image:linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5))}.Measure-Controller.svelte-1ulunhy .bottom .center.svelte-1ulunhy{display:flex;flex-direction:column;align-items:center;margin-bottom:2.5rem}.Measure-Controller.svelte-1ulunhy .controller.svelte-1ulunhy{pointer-events:all;display:flex;align-items:center}.Measure-Controller.svelte-1ulunhy .controller .button.svelte-1ulunhy{cursor:pointer;display:flex;align-items:center;height:2.5rem;padding-left:1rem;padding-right:1rem;border-radius:624.9375rem;font-size:0.875rem;background-color:rgba(0, 0, 0, 0.2)}.Measure-Controller.svelte-1ulunhy .controller .button .icon.svelte-1ulunhy{width:1.5rem;height:1.5rem;background-repeat:no-repeat;background-size:100%;margin:0 0.25rem}.Measure-Controller.svelte-1ulunhy .controller .main-button.svelte-1ulunhy{margin-left:1.75rem;margin-right:1.75rem;font-size:0.875rem;font-weight:bold}")}function cc(i){let t,e;return t=new ru({props:{onClick:i[0].disable}}),{c(){ie(t.$$.fragment)},m(n,s){te(t,n,s),e=!0},p(n,s){const o={};s&1&&(o.onClick=n[0].disable),t.$set(o)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){z(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function dc(i){let t,e,n,s;return e=new e0({props:{options:[{key:"line",value:"测距离"},{key:"area",value:"测面积"}],defaultKey:i[0].currentMeasureType,onChange:i[0].changeMeasureType}}),{c(){t=D("div"),ie(e.$$.fragment),w(t,"class","mode-switcher svelte-1ulunhy")},m(o,r){B(o,t,r),te(e,t,null),s=!0},p(o,r){i=o;const a={};r&1&&(a.defaultKey=i[0].currentMeasureType),r&1&&(a.onChange=i[0].changeMeasureType),e.$set(a)},i(o){s||(k(e.$$.fragment,o),o&&Ne(()=>{s&&(n||(n=_t(t,tt,{duration:ui},!0)),n.run(1))}),s=!0)},o(o){z(e.$$.fragment,o),o&&(n||(n=_t(t,tt,{duration:ui},!1)),n.run(0)),s=!1},d(o){o&&O(t),ne(e),o&&n&&n.end()}}}function hc(i){let t,e,n,s,o,r,a;return{c(){t=D("div"),e=D("div"),n=ke(`
518
518
  撤销`),w(e,"class","icon svelte-1ulunhy"),j(e,"background-image",`url(${au})`),w(t,"class","button svelte-1ulunhy"),$(t,"forbid",i[2]==="start")},m(l,c){B(l,t,c),x(t,e),x(t,n),o=!0,r||(a=be(t,"click",i[13]),r=!0)},p(l,c){i=l,(!o||c&4)&&$(t,"forbid",i[2]==="start")},i(l){o||(l&&Ne(()=>{o&&(s||(s=_t(t,tt,{duration:ui},!0)),s.run(1))}),o=!0)},o(l){l&&(s||(s=_t(t,tt,{duration:ui},!1)),s.run(0)),o=!1},d(l){l&&O(t),l&&s&&s.end(),r=!1,a()}}}function uc(i){let t,e,n,s,o,r,a;return{c(){t=D("div"),e=D("div"),n=ke(`
519
- 结束`),w(e,"class","icon svelte-1ulunhy"),j(e,"background-image",`url(${lu})`),w(t,"class","button svelte-1ulunhy")},m(l,c){B(l,t,c),x(t,e),x(t,n),o=!0,r||(a=be(t,"click",i[11]),r=!0)},p(l,c){i=l},i(l){o||(l&&Ne(()=>{o&&(s||(s=_t(t,tt,{duration:ui},!0)),s.run(1))}),o=!0)},o(l){l&&(s||(s=_t(t,tt,{duration:ui},!1)),s.run(0)),o=!1},d(l){l&&O(t),l&&s&&s.end(),r=!1,a()}}}function r0(i){let t,e,n,s,o,r,a,l,c,d,h,u,m,A=i[1]&&cc(i),p=i[0].allowMeasureType.length>=2&&i[2]==="start"&&dc(i),g=i[4]&&hc(i);h=new s0({props:{onClick:i[14],text:i[3]==="area"?i[6][i[2]]:i[7][i[2]],color:i[8][i[2]]}});let b=i[4]&&uc(i);return{c(){t=D("div"),A&&A.c(),e=ee(),n=D("div"),s=D("div"),o=ee(),r=D("div"),p&&p.c(),a=ee(),l=D("div"),g&&g.c(),c=ee(),d=D("div"),ie(h.$$.fragment),u=ee(),b&&b.c(),w(s,"class","mask svelte-1ulunhy"),w(d,"class","main-button svelte-1ulunhy"),$(d,"forbid",!i[5]),w(l,"class","controller svelte-1ulunhy"),w(r,"class","center svelte-1ulunhy"),w(n,"class","bottom svelte-1ulunhy"),w(t,"class","Measure-Controller svelte-1ulunhy")},m(y,I){B(y,t,I),A&&A.m(t,null),x(t,e),x(t,n),x(n,s),x(n,o),x(n,r),p&&p.m(r,null),x(r,a),x(r,l),g&&g.m(l,null),x(l,c),x(l,d),te(h,d,null),x(l,u),b&&b.m(l,null),m=!0},p(y,[I]){y[1]?A?(A.p(y,I),I&2&&k(A,1)):(A=cc(y),A.c(),k(A,1),A.m(t,e)):A&&(de(),z(A,1,1,()=>{A=null}),he()),y[0].allowMeasureType.length>=2&&y[2]==="start"?p?(p.p(y,I),I&5&&k(p,1)):(p=dc(y),p.c(),k(p,1),p.m(r,a)):p&&(de(),z(p,1,1,()=>{p=null}),he()),y[4]?g?(g.p(y,I),I&16&&k(g,1)):(g=hc(y),g.c(),k(g,1),g.m(l,c)):g&&(de(),z(g,1,1,()=>{g=null}),he());const M={};I&4&&(M.onClick=y[14]),I&12&&(M.text=y[3]==="area"?y[6][y[2]]:y[7][y[2]]),I&4&&(M.color=y[8][y[2]]),h.$set(M),(!m||I&32)&&$(d,"forbid",!y[5]),y[4]?b?(b.p(y,I),I&16&&k(b,1)):(b=uc(y),b.c(),k(b,1),b.m(l,null)):b&&(de(),z(b,1,1,()=>{b=null}),he())},i(y){m||(k(A),k(p),k(g),k(h.$$.fragment,y),k(b),m=!0)},o(y){z(A),z(p),z(g),z(h.$$.fragment,y),z(b),m=!1},d(y){y&&O(t),A&&A.d(),p&&p.d(),g&&g.d(),ne(h),b&&b.d()}}}const ui=100;function a0(i,t,e){let{measureController:n}=t,{showExit:s=!1}=t;const o={start:"开始",add:"添加",end:"结束"},r={start:"开始",add:"添加",end:"完成"},a={start:"white",add:"white",end:"blue"};let l=!1,c=!0,d="start",h=n.currentMeasureType;const u=()=>{n.getCurrentMode()!=="Edit"?n.changeMode("Edit"):(p("add"),m())},m=()=>{n.controller instanceof cn&&n.controller.selectPoint()},A=()=>{n.controller instanceof cn&&n.controller.complete()},p=W=>{console.log("changeButtonState",W),e(2,d=W)},g=()=>{m(),M("allow")},b=()=>{p("end")},y=()=>{d==="end"&&p("add")},I=()=>{p("start"),M("allow")},M=W=>{e(5,c=W==="allow")},T=W=>{e(3,h=W)},P=W=>{W.isEmpty&&p("start")};vt(()=>{n.hook.on("revoke",P),n.hook.on("measureTypeChange",T),n.hook.on("modeChange",I),n.hook.on("allowAddPointStateChange",M),n.hook.on("readyComplete",b),n.hook.on("notReadyComplete",y),n.hook.on("complete",I)}),Lt(()=>{n.hook.off("measureTypeChange",T),n.hook.off("modeChange",I),n.hook.off("allowAddPointStateChange",M),n.hook.off("readyComplete",b),n.hook.off("notReadyComplete",y),n.hook.off("complete",I)});const V=()=>n.revoke(),L=()=>{d==="start"?u():d==="add"?m():d==="end"&&g()};return i.$$set=W=>{"measureController"in W&&e(0,n=W.measureController),"showExit"in W&&e(1,s=W.showExit)},i.$$.update=()=>{i.$$.dirty&12&&e(4,l=h==="area"&&d!=="start")},[n,s,d,h,l,c,o,r,a,u,m,A,g,V,L]}class l0 extends le{constructor(t){super(),ae(this,t,a0,r0,oe,{measureController:0,showExit:1},o0)}}class c0{constructor(t,e){f(this,"revoke");f(this,"container");f(this,"mainController");f(this,"disposers",[]);f(this,"measureController");f(this,"mode");f(this,"svelteDom");f(this,"_params");f(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Lv),Object.assign(t==null?void 0:t.style,zv));const n=()=>{e.style.opacity="1"},s=()=>{e.style.opacity="0.85"},o=()=>{this.measureController.disable()};return e.addEventListener("click",o),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("click",o),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",s)}});var s,o;this._params=e,this.measureController=t,this.mode=(s=e.mode)!=null?s:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Ev:Dv,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)";const n=(o=e.useNewUI)!=null?o:!1;if(n&&(e.pointSelectorMode==="cursor"?this.svelteDom=new Jv({target:e.container,props:{measureController:this.measureController,showExit:e.showExit}}):e.pointSelectorMode==="fixed"&&(this.svelteDom=new l0({target:e.container,props:{measureController:this.measureController,showExit:e.showExit}}))),!n){e.container.appendChild(this.container);const r=this.container.querySelectorAll(".fpm__text"),a=this.container.querySelector(".fpm_ui-bg"),l=this.container.querySelector(".fpm_operating-space");Object.assign(a==null?void 0:a.style,Tv),Object.assign(l==null?void 0:l.style,Sv),Object.assign(this.container.style,xv),r.forEach(c=>Object.assign(c.style,jv))}}dispose(){var t;this.hide(),(t=this.svelteDom)==null||t.$destroy(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Vv(this.measureController,this.container),this.mainController=new Ov(this.measureController,this.container,this._params)):this.mainController=new Bv(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}var It=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Xe={},d0={get exports(){return Xe},set exports(i){Xe=i}};function lo(i){return i===null?"null":typeof i=="undefined"?"undefined":typeof i=="object"?Array.isArray(i)?"array":"object":typeof i}function cu(i){return lo(i)==="object"?$r(i):lo(i)==="array"?Kr(i):i}function Kr(i){return i.map(cu)}function $r(i){const t={};for(const e in i)i.hasOwnProperty(e)&&(t[e]=cu(i[e]));return t}function Mo(i,t=[],e={}){const n={arrayBehaviour:e.arrayBehaviour||"replace"},s=t.map(r=>r||{}),o=i||{};for(let r=0;r<s.length;r++){const a=s[r],l=Object.keys(a);for(let c=0;c<l.length;c++){const d=l[c],h=a[d],u=lo(h),m=lo(o[d]);if(u==="object")if(m!=="undefined"){const A=m==="object"?o[d]:{};o[d]=Mo({},[A,$r(h)],n)}else o[d]=$r(h);else if(u==="array")if(m==="array"){const A=Kr(h);o[d]=n.arrayBehaviour==="merge"?o[d].concat(A):A}else o[d]=Kr(h);else o[d]=h}}return o}d0.exports=function(t,...e){return Mo(t,e)};Xe.noMutate=function(...t){return Mo({},t)};Xe.withOptions=function(t,e,n){return Mo(t,e,n)};function h0(i){ue(i,"svelte-18z4ai8",".Measure-Tips.svelte-18z4ai8.svelte-18z4ai8{box-sizing:border-box;position:absolute;pointer-events:none;width:100%;padding:0 2.5rem}.Measure-Tips.svelte-18z4ai8 .text.svelte-18z4ai8{position:relative;margin:auto;width:-moz-max-content;width:max-content;max-width:100%;top:1.875rem;color:#fff;word-break:break-all;word-wrap:break-word}")}function fc(i){let t,e,n,s,o;return{c(){t=D("div"),e=D("div"),n=ke(i[2]),w(e,"class","text svelte-18z4ai8"),w(t,"class","Measure-Tips svelte-18z4ai8")},m(r,a){B(r,t,a),x(t,e),x(e,n),i[6](e),o=!0},p(r,a){(!o||a&4)&&Oe(n,r[2])},i(r){o||(Ne(()=>{o&&(s||(s=_t(t,tt,{},!0)),s.run(1))}),o=!0)},o(r){s||(s=_t(t,tt,{},!1)),s.run(0),o=!1},d(r){r&&O(t),i[6](null),r&&s&&s.end()}}}function u0(i){let t,e,n=i[0]&&fc(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[0]?n?(n.p(s,o),o&1&&k(n,1)):(n=fc(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function f0(i,t,e){let{measureController:n}=t,{tips:s}=t,{tipStyle:o={}}=t,{visible:r=!0}=t,a=null;const l=g=>{const b=n.currentMeasureType;let y="";return y=s[g],y===void 0&&(y=s[b][g]),y},c=g=>{e(2,h=l(g))},d=()=>{e(2,h="")};let h="";const u=g=>{g==="Edit"?n.changeMeasureType?c("start"):c("select"):g==="Watch"?c("select"):d()},m=()=>{c("select")},A=g=>{n.currentMeasureType==="area"&&(g.length>=2?c("close"):g.length===0?c("start"):d())};vt(()=>{u(n.getCurrentMode()),n.hook.on("modeChange",u),n.hook.on("complete",m),n.hook.on("pointsChange",A)}),Lt(()=>{n.hook.off("modeChange",u),n.hook.off("complete",m),n.hook.off("pointsChange",A),d()});function p(g){Qe[g?"unshift":"push"](()=>{a=g,e(1,a),e(5,o)})}return i.$$set=g=>{"measureController"in g&&e(3,n=g.measureController),"tips"in g&&e(4,s=g.tips),"tipStyle"in g&&e(5,o=g.tipStyle),"visible"in g&&e(0,r=g.visible)},i.$$.update=()=>{if(i.$$.dirty&34&&a)for(const g in o)o.hasOwnProperty(g)&&e(1,a.style[g]=o[g],a);i.$$.dirty&4&&console.log({tip:h})},[r,a,h,n,s,o,p]}class m0 extends le{constructor(t){super(),ae(this,t,f0,u0,oe,{measureController:3,tips:4,tipStyle:5,visible:0},h0)}}const g0={select:"点击按钮选择功能",line:{start:"点击开始测量"},area:{start:"点击开始测量",close:"选择三个点后将闭合平面,点击结束自动闭合"}},p0={select:"点击按钮选择功能",line:{start:"点击开始按钮打点"},area:{start:"点击开始按钮打点",close:"选择三个点后将闭合平面,点击结束自动闭合"}};class A0{constructor(t,e){f(this,"tipSvelteDom");this.tipSvelteDom=new m0({target:e.container,props:{measureController:t,tips:Xe({},e.pointSelectorMode==="fixed"?p0:g0,e.tips),visible:!0}})}dispose(){var t;(t=this.tipSvelteDom)==null||t.$destroy()}show(){var t;return(t=this.tipSvelteDom)==null||t.set({visible:!0}),this}hide(){var t;return(t=this.tipSvelteDom)==null||t.set({visible:!1}),this}}class v0{constructor(t,e){f(this,"five");f(this,"measureController");f(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});f(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();n&&(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();t&&(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.save().changeMode("Watch")}}function mc(i){return typeof i=="object"?i===null?{}:i:{}}class b0{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new Te.Subscribe);f(this,"magnifier");f(this,"controller",null);f(this,"allowMeasureType");f(this,"currentMeasureType");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"isMobile");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"disable",()=>{var t,e,n,s;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(s=this.shortcutKeyController)==null||s.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)});f(this,"getCurrentMode",()=>this.controller instanceof cn?"Edit":this.controller instanceof Kl?"Watch":this.controller instanceof Ni?"Mixed":this.controller instanceof ql?"View":null);f(this,"changeMode",t=>{var s;if(!this.hasOpen||this.getCurrentMode()===t)return;(s=this.controller)==null||s.dispose();const e={View:ql,Watch:Kl,Edit:cn,Mixed:Ni};if(!e[t])throw new Error("不存在的 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});f(this,"changeMeasureType",t=>{this.currentMeasureType=t,this.hook.emit("measureTypeChange",t)});var o,r,a,l,c,d,h,u,m;this.five=t,this.params=e,this.config=Po(e,["openParams","magnifierParams"]),this.model=new za(this.config),this.fiveHelper=new QA(t),this.isMobile=(r=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?r:!1,this.magnifier=new da(t,(a=e.magnifierParams)!=null?a:{width:190,height:190,scale:2}),this.allowMeasureType=Array.from(new Set((c=(l=e.editParams)==null?void 0:l.allowMeasureType)!=null?c:["line"])),this.currentMeasureType=(d=this.allowMeasureType[0])!=null?d:"line",this.group=new R.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(u=(h=e.editParams)==null?void 0:h.pointSelectorMode)!=null?u:nu?"fixed":"cursor",s=(m=this.params.openParams)!=null?m:{};if(this.params.useUIController!==!1){const A=H({container:this.container,openParams:s,pointSelectorMode:n},mc(this.params.useUIController));this.useUIController=new c0(this,A)}if(this.params.useGuideController!==!1){const A=H({container:this.container,pointSelectorMode:n},mc(this.params.useGuideController));this.useGuideController=new A0(this,A)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new v0(this,this.five),this.hook.emit("enable",!0))}edit(t){t&&this.changeMeasureType(t);const e=this.isMobile?"Mixed":"Edit";this.changeMode(e)}revoke(){this.controller instanceof cn&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removeArea(t){this.model.removeArea(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof cn)&&!(this.controller instanceof Ni))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.model.polylines,s=this.controller.model.areas;return n.forEach(r=>{this.model.addPolyline(r)}),this.controller instanceof cn?this.controller.complete():s.forEach(r=>{r.showArea(),this.model.addArea(r)}),this.changeMode(e),this}addStartPoint(){this.controller instanceof Ni&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof Ni&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var s;const n=this.model.getLineByID(t);if(!n)throw new Error("不存在的线段");n.setText(e),(s=this.controller)==null||s.updateDistanceUI()}createControllerParams(){var n,s;const t=(n=this.params.openParams)!=null?n:{},e=(s=this.params.editParams)!=null?s:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,editParams:e,magnifierParams:this.params.magnifierParams,getMeasureType:()=>this.currentMeasureType,mouseGroup:iu(H({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}function Bs(i,t,e){const n=i[t],s=i[e];n===void 0||s===void 0||(i[t]=s,i[e]=n)}function y0(i,t,e){const n=e/2;for(let s=1;s<=n;s++){const o=e-(s-1);for(let r=1;r<=t;r++){const a=(s-1)*t+r-1,l=(o-1)*t+r-1;Bs(i,a*4+0,l*4+0),Bs(i,a*4+1,l*4+1),Bs(i,a*4+2,l*4+2),Bs(i,a*4+3,l*4+3)}}}class w0{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Te.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:s}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${s}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 s,o,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(o=e==null?void 0:e.width)!=null?o: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 is(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(),s=n.right-e.right,o=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:s,y:o}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,s,o]=(()=>{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"):o<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):s<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, ${o}px, 10px)`,this.offset={x:n,y:o}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:s}=this,o=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const g=this.renderCenter.clone().project(this.five.camera);return[(g.x+1)/2*o.x,(g.y+1)/2*o.y]}else return[this.renderCenter.x,o.y-this.renderCenter.y]})(),l=1,c=n/t,d=s/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(s*l);y0(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:s},max:{x:o,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),o),d=Math.min(Math.max(l,s),r);return{translateX:c,translateY:d}}}const C0=function(t,e){return new b0(t,e)},du=Pa(null);function I0(i){ue(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function gc(i,t,e){const n=i.slice();return n[3]=t[e],n}function pc(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,s,o;function r(){return i[2](i[3])}return{c(){t=D("i"),w(t,"class","svelte-19zi46m"),$(t,"PanoSpatialTagPlugin__tag-origin",!0),$(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),j(t,"top",e),j(t,"left",n),j(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){B(a,t,l),s||(o=be(t,"click",r),s=!0)},p(a,l){i=a,l&1&&$(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&j(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&j(t,"left",n),l&1&&j(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&O(t),s=!1,o()}}}function P0(i){let t,e=i[0],n=[];for(let s=0;s<e.length;s+=1)n[s]=pc(gc(i,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=Pe()},m(s,o){for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(s,o);B(s,t,o)},p(s,[o]){if(o&3){e=s[0];let r;for(r=0;r<e.length;r+=1){const a=gc(s,e,r);n[r]?n[r].p(a,o):(n[r]=pc(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:J,o:J,d(s){Tt(n,s),s&&O(t)}}}function E0(i,t,e){let{origins:n}=t;const s=r=>{du.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},o=r=>s(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,s,o]}class M0 extends le{constructor(t){super(),ae(this,t,E0,P0,oe,{origins:0},I0)}}function k0(i){ue(i,"svelte-9m6drd",`.PanoSpatialTagPlugin__tag-x.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#fff;transform:translate(0, -100%);transition:height 0.5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-9m6drd.svelte-9m6drd{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity 0.8s 0.6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-9m6drd.svelte-9m6drd{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:0.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.1));box-shadow:0 0.1rem 0.5rem rgba(0, 0, 0, 0.2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform 0.4s cubic-bezier(0.44, 0.44, 0.74, 0.98), opacity 0.4s cubic-bezier(0.44, 0.44, 0.74, 0.98), width 0.5s linear,
519
+ 结束`),w(e,"class","icon svelte-1ulunhy"),j(e,"background-image",`url(${lu})`),w(t,"class","button svelte-1ulunhy")},m(l,c){B(l,t,c),x(t,e),x(t,n),o=!0,r||(a=be(t,"click",i[11]),r=!0)},p(l,c){i=l},i(l){o||(l&&Ne(()=>{o&&(s||(s=_t(t,tt,{duration:ui},!0)),s.run(1))}),o=!0)},o(l){l&&(s||(s=_t(t,tt,{duration:ui},!1)),s.run(0)),o=!1},d(l){l&&O(t),l&&s&&s.end(),r=!1,a()}}}function r0(i){let t,e,n,s,o,r,a,l,c,d,h,u,m,A=i[1]&&cc(i),p=i[0].allowMeasureType.length>=2&&i[2]==="start"&&dc(i),g=i[4]&&hc(i);h=new s0({props:{onClick:i[14],text:i[3]==="area"?i[6][i[2]]:i[7][i[2]],color:i[8][i[2]]}});let b=i[4]&&uc(i);return{c(){t=D("div"),A&&A.c(),e=ee(),n=D("div"),s=D("div"),o=ee(),r=D("div"),p&&p.c(),a=ee(),l=D("div"),g&&g.c(),c=ee(),d=D("div"),ie(h.$$.fragment),u=ee(),b&&b.c(),w(s,"class","mask svelte-1ulunhy"),w(d,"class","main-button svelte-1ulunhy"),$(d,"forbid",!i[5]),w(l,"class","controller svelte-1ulunhy"),w(r,"class","center svelte-1ulunhy"),w(n,"class","bottom svelte-1ulunhy"),w(t,"class","Measure-Controller svelte-1ulunhy")},m(y,I){B(y,t,I),A&&A.m(t,null),x(t,e),x(t,n),x(n,s),x(n,o),x(n,r),p&&p.m(r,null),x(r,a),x(r,l),g&&g.m(l,null),x(l,c),x(l,d),te(h,d,null),x(l,u),b&&b.m(l,null),m=!0},p(y,[I]){y[1]?A?(A.p(y,I),I&2&&k(A,1)):(A=cc(y),A.c(),k(A,1),A.m(t,e)):A&&(de(),z(A,1,1,()=>{A=null}),he()),y[0].allowMeasureType.length>=2&&y[2]==="start"?p?(p.p(y,I),I&5&&k(p,1)):(p=dc(y),p.c(),k(p,1),p.m(r,a)):p&&(de(),z(p,1,1,()=>{p=null}),he()),y[4]?g?(g.p(y,I),I&16&&k(g,1)):(g=hc(y),g.c(),k(g,1),g.m(l,c)):g&&(de(),z(g,1,1,()=>{g=null}),he());const M={};I&4&&(M.onClick=y[14]),I&12&&(M.text=y[3]==="area"?y[6][y[2]]:y[7][y[2]]),I&4&&(M.color=y[8][y[2]]),h.$set(M),(!m||I&32)&&$(d,"forbid",!y[5]),y[4]?b?(b.p(y,I),I&16&&k(b,1)):(b=uc(y),b.c(),k(b,1),b.m(l,null)):b&&(de(),z(b,1,1,()=>{b=null}),he())},i(y){m||(k(A),k(p),k(g),k(h.$$.fragment,y),k(b),m=!0)},o(y){z(A),z(p),z(g),z(h.$$.fragment,y),z(b),m=!1},d(y){y&&O(t),A&&A.d(),p&&p.d(),g&&g.d(),ne(h),b&&b.d()}}}const ui=100;function a0(i,t,e){let{measureController:n}=t,{showExit:s=!1}=t;const o={start:"开始",add:"添加",end:"结束"},r={start:"开始",add:"添加",end:"完成"},a={start:"white",add:"white",end:"blue"};let l=!1,c=!0,d="start",h=n.currentMeasureType;const u=()=>{n.getCurrentMode()!=="Edit"?n.changeMode("Edit"):(p("add"),m())},m=()=>{n.controller instanceof cn&&n.controller.selectPoint()},A=()=>{n.controller instanceof cn&&n.controller.complete()},p=W=>{console.log("changeButtonState",W),e(2,d=W)},g=()=>{m(),M("allow")},b=()=>{p("end")},y=()=>{d==="end"&&p("add")},I=()=>{p("start"),M("allow")},M=W=>{e(5,c=W==="allow")},T=W=>{e(3,h=W)},P=W=>{W.isEmpty&&p("start")};vt(()=>{n.hook.on("revoke",P),n.hook.on("measureTypeChange",T),n.hook.on("modeChange",I),n.hook.on("allowAddPointStateChange",M),n.hook.on("readyComplete",b),n.hook.on("notReadyComplete",y),n.hook.on("complete",I)}),Lt(()=>{n.hook.off("measureTypeChange",T),n.hook.off("modeChange",I),n.hook.off("allowAddPointStateChange",M),n.hook.off("readyComplete",b),n.hook.off("notReadyComplete",y),n.hook.off("complete",I)});const V=()=>n.revoke(),L=()=>{d==="start"?u():d==="add"?m():d==="end"&&g()};return i.$$set=W=>{"measureController"in W&&e(0,n=W.measureController),"showExit"in W&&e(1,s=W.showExit)},i.$$.update=()=>{i.$$.dirty&12&&e(4,l=h==="area"&&d!=="start")},[n,s,d,h,l,c,o,r,a,u,m,A,g,V,L]}class l0 extends le{constructor(t){super(),ae(this,t,a0,r0,oe,{measureController:0,showExit:1},o0)}}class c0{constructor(t,e){f(this,"revoke");f(this,"container");f(this,"mainController");f(this,"disposers",[]);f(this,"measureController");f(this,"mode");f(this,"svelteDom");f(this,"_params");f(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Lv),Object.assign(t==null?void 0:t.style,zv));const n=()=>{e.style.opacity="1"},s=()=>{e.style.opacity="0.85"},o=()=>{this.measureController.disable()};return e.addEventListener("click",o),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("click",o),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",s)}});var s,o;this._params=e,this.measureController=t,this.mode=(s=e.mode)!=null?s:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Ev:Dv,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)";const n=(o=e.useNewUI)!=null?o:!1;if(n&&(e.pointSelectorMode==="cursor"?this.svelteDom=new Jv({target:e.container,props:{measureController:this.measureController,showExit:e.showExit}}):e.pointSelectorMode==="fixed"&&(this.svelteDom=new l0({target:e.container,props:{measureController:this.measureController,showExit:e.showExit}}))),!n){e.container.appendChild(this.container);const r=this.container.querySelectorAll(".fpm__text"),a=this.container.querySelector(".fpm_ui-bg"),l=this.container.querySelector(".fpm_operating-space");Object.assign(a==null?void 0:a.style,Tv),Object.assign(l==null?void 0:l.style,Sv),Object.assign(this.container.style,xv),r.forEach(c=>Object.assign(c.style,jv))}}dispose(){var t;this.hide(),(t=this.svelteDom)==null||t.$destroy(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Vv(this.measureController,this.container),this.mainController=new Ov(this.measureController,this.container,this._params)):this.mainController=new Bv(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}var It=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Xe={},d0={get exports(){return Xe},set exports(i){Xe=i}};function lo(i){return i===null?"null":typeof i=="undefined"?"undefined":typeof i=="object"?Array.isArray(i)?"array":"object":typeof i}function cu(i){return lo(i)==="object"?$r(i):lo(i)==="array"?Kr(i):i}function Kr(i){return i.map(cu)}function $r(i){const t={};for(const e in i)i.hasOwnProperty(e)&&(t[e]=cu(i[e]));return t}function Mo(i,t=[],e={}){const n={arrayBehaviour:e.arrayBehaviour||"replace"},s=t.map(r=>r||{}),o=i||{};for(let r=0;r<s.length;r++){const a=s[r],l=Object.keys(a);for(let c=0;c<l.length;c++){const d=l[c],h=a[d],u=lo(h),m=lo(o[d]);if(u==="object")if(m!=="undefined"){const A=m==="object"?o[d]:{};o[d]=Mo({},[A,$r(h)],n)}else o[d]=$r(h);else if(u==="array")if(m==="array"){const A=Kr(h);o[d]=n.arrayBehaviour==="merge"?o[d].concat(A):A}else o[d]=Kr(h);else o[d]=h}}return o}d0.exports=function(t,...e){return Mo(t,e)};Xe.noMutate=function(...t){return Mo({},t)};Xe.withOptions=function(t,e,n){return Mo(t,e,n)};function h0(i){ue(i,"svelte-18z4ai8",".Measure-Tips.svelte-18z4ai8.svelte-18z4ai8{box-sizing:border-box;position:absolute;pointer-events:none;width:100%;padding:0 2.5rem}.Measure-Tips.svelte-18z4ai8 .text.svelte-18z4ai8{position:relative;margin:auto;width:-moz-max-content;width:max-content;max-width:100%;top:1.875rem;color:#fff;word-break:break-all;word-wrap:break-word}")}function fc(i){let t,e,n,s,o;return{c(){t=D("div"),e=D("div"),n=ke(i[2]),w(e,"class","text svelte-18z4ai8"),w(t,"class","Measure-Tips svelte-18z4ai8")},m(r,a){B(r,t,a),x(t,e),x(e,n),i[6](e),o=!0},p(r,a){(!o||a&4)&&Oe(n,r[2])},i(r){o||(Ne(()=>{o&&(s||(s=_t(t,tt,{},!0)),s.run(1))}),o=!0)},o(r){s||(s=_t(t,tt,{},!1)),s.run(0),o=!1},d(r){r&&O(t),i[6](null),r&&s&&s.end()}}}function u0(i){let t,e,n=i[0]&&fc(i);return{c(){n&&n.c(),t=Pe()},m(s,o){n&&n.m(s,o),B(s,t,o),e=!0},p(s,[o]){s[0]?n?(n.p(s,o),o&1&&k(n,1)):(n=fc(s),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(de(),z(n,1,1,()=>{n=null}),he())},i(s){e||(k(n),e=!0)},o(s){z(n),e=!1},d(s){n&&n.d(s),s&&O(t)}}}function f0(i,t,e){let{measureController:n}=t,{tips:s}=t,{tipStyle:o={}}=t,{visible:r=!0}=t,a=null;const l=g=>{const b=n.currentMeasureType;let y="";return y=s[g],y===void 0&&(y=s[b][g]),y},c=g=>{e(2,h=l(g))},d=()=>{e(2,h="")};let h="";const u=g=>{g==="Edit"?n.changeMeasureType?c("start"):c("select"):g==="Watch"?c("select"):d()},m=()=>{c("select")},A=g=>{n.currentMeasureType==="area"&&(g.length>=2?c("close"):g.length===0?c("start"):d())};vt(()=>{u(n.getCurrentMode()),n.hook.on("modeChange",u),n.hook.on("complete",m),n.hook.on("pointsChange",A)}),Lt(()=>{n.hook.off("modeChange",u),n.hook.off("complete",m),n.hook.off("pointsChange",A),d()});function p(g){Qe[g?"unshift":"push"](()=>{a=g,e(1,a),e(5,o)})}return i.$$set=g=>{"measureController"in g&&e(3,n=g.measureController),"tips"in g&&e(4,s=g.tips),"tipStyle"in g&&e(5,o=g.tipStyle),"visible"in g&&e(0,r=g.visible)},i.$$.update=()=>{if(i.$$.dirty&34&&a)for(const g in o)o.hasOwnProperty(g)&&e(1,a.style[g]=o[g],a);i.$$.dirty&4&&console.log({tip:h})},[r,a,h,n,s,o,p]}class m0 extends le{constructor(t){super(),ae(this,t,f0,u0,oe,{measureController:3,tips:4,tipStyle:5,visible:0},h0)}}const g0={select:"点击按钮选择功能",line:{start:"点击开始测量"},area:{start:"点击开始测量",close:"选择三个点后将闭合平面,点击结束自动闭合"}},p0={select:"点击按钮选择功能",line:{start:"点击开始按钮打点"},area:{start:"点击开始按钮打点",close:"选择三个点后将闭合平面,点击结束自动闭合"}};class A0{constructor(t,e){f(this,"tipSvelteDom");this.tipSvelteDom=new m0({target:e.container,props:{measureController:t,tips:Xe({},e.pointSelectorMode==="fixed"?p0:g0,e.tips),visible:!0}})}dispose(){var t;(t=this.tipSvelteDom)==null||t.$destroy()}show(){var t;return(t=this.tipSvelteDom)==null||t.$set({visible:!0}),this}hide(){var t;return(t=this.tipSvelteDom)==null||t.$set({visible:!1}),this}}class v0{constructor(t,e){f(this,"five");f(this,"measureController");f(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});f(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();n&&(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();t&&(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.save().changeMode("Watch")}}function mc(i){return typeof i=="object"?i===null?{}:i:{}}class b0{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new Te.Subscribe);f(this,"magnifier");f(this,"controller",null);f(this,"allowMeasureType");f(this,"currentMeasureType");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"isMobile");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"disable",()=>{var t,e,n,s;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(s=this.shortcutKeyController)==null||s.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)});f(this,"getCurrentMode",()=>this.controller instanceof cn?"Edit":this.controller instanceof Kl?"Watch":this.controller instanceof Ni?"Mixed":this.controller instanceof ql?"View":null);f(this,"changeMode",t=>{var s;if(!this.hasOpen||this.getCurrentMode()===t)return;(s=this.controller)==null||s.dispose();const e={View:ql,Watch:Kl,Edit:cn,Mixed:Ni};if(!e[t])throw new Error("不存在的 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});f(this,"changeMeasureType",t=>{this.currentMeasureType=t,this.hook.emit("measureTypeChange",t)});var o,r,a,l,c,d,h,u,m;this.five=t,this.params=e,this.config=Po(e,["openParams","magnifierParams"]),this.model=new za(this.config),this.fiveHelper=new QA(t),this.isMobile=(r=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?r:!1,this.magnifier=new da(t,(a=e.magnifierParams)!=null?a:{width:190,height:190,scale:2}),this.allowMeasureType=Array.from(new Set((c=(l=e.editParams)==null?void 0:l.allowMeasureType)!=null?c:["line"])),this.currentMeasureType=(d=this.allowMeasureType[0])!=null?d:"line",this.group=new R.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(u=(h=e.editParams)==null?void 0:h.pointSelectorMode)!=null?u:nu?"fixed":"cursor",s=(m=this.params.openParams)!=null?m:{};if(this.params.useUIController!==!1){const A=H({container:this.container,openParams:s,pointSelectorMode:n},mc(this.params.useUIController));this.useUIController=new c0(this,A)}if(this.params.useGuideController!==!1){const A=H({container:this.container,pointSelectorMode:n},mc(this.params.useGuideController));this.useGuideController=new A0(this,A)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new v0(this,this.five),this.hook.emit("enable",!0))}edit(t){t&&this.changeMeasureType(t);const e=this.isMobile?"Mixed":"Edit";this.changeMode(e)}revoke(){this.controller instanceof cn&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removeArea(t){this.model.removeArea(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof cn)&&!(this.controller instanceof Ni))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.model.polylines,s=this.controller.model.areas;return n.forEach(r=>{this.model.addPolyline(r)}),this.controller instanceof cn?this.controller.complete():s.forEach(r=>{r.showArea(),this.model.addArea(r)}),this.changeMode(e),this}addStartPoint(){this.controller instanceof Ni&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof Ni&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var s;const n=this.model.getLineByID(t);if(!n)throw new Error("不存在的线段");n.setText(e),(s=this.controller)==null||s.updateDistanceUI()}createControllerParams(){var n,s;const t=(n=this.params.openParams)!=null?n:{},e=(s=this.params.editParams)!=null?s:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,editParams:e,magnifierParams:this.params.magnifierParams,getMeasureType:()=>this.currentMeasureType,mouseGroup:iu(H({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}function Bs(i,t,e){const n=i[t],s=i[e];n===void 0||s===void 0||(i[t]=s,i[e]=n)}function y0(i,t,e){const n=e/2;for(let s=1;s<=n;s++){const o=e-(s-1);for(let r=1;r<=t;r++){const a=(s-1)*t+r-1,l=(o-1)*t+r-1;Bs(i,a*4+0,l*4+0),Bs(i,a*4+1,l*4+1),Bs(i,a*4+2,l*4+2),Bs(i,a*4+3,l*4+3)}}}class w0{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Te.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:s}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${s}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 s,o,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(o=e==null?void 0:e.width)!=null?o: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 is(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(),s=n.right-e.right,o=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:s,y:o}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,s,o]=(()=>{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"):o<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):s<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, ${o}px, 10px)`,this.offset={x:n,y:o}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:s}=this,o=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const g=this.renderCenter.clone().project(this.five.camera);return[(g.x+1)/2*o.x,(g.y+1)/2*o.y]}else return[this.renderCenter.x,o.y-this.renderCenter.y]})(),l=1,c=n/t,d=s/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(s*l);y0(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:s},max:{x:o,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),o),d=Math.min(Math.max(l,s),r);return{translateX:c,translateY:d}}}const C0=function(t,e){return new b0(t,e)},du=Pa(null);function I0(i){ue(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function gc(i,t,e){const n=i.slice();return n[3]=t[e],n}function pc(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,s,o;function r(){return i[2](i[3])}return{c(){t=D("i"),w(t,"class","svelte-19zi46m"),$(t,"PanoSpatialTagPlugin__tag-origin",!0),$(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),j(t,"top",e),j(t,"left",n),j(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){B(a,t,l),s||(o=be(t,"click",r),s=!0)},p(a,l){i=a,l&1&&$(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&j(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&j(t,"left",n),l&1&&j(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&O(t),s=!1,o()}}}function P0(i){let t,e=i[0],n=[];for(let s=0;s<e.length;s+=1)n[s]=pc(gc(i,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=Pe()},m(s,o){for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(s,o);B(s,t,o)},p(s,[o]){if(o&3){e=s[0];let r;for(r=0;r<e.length;r+=1){const a=gc(s,e,r);n[r]?n[r].p(a,o):(n[r]=pc(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:J,o:J,d(s){Tt(n,s),s&&O(t)}}}function E0(i,t,e){let{origins:n}=t;const s=r=>{du.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},o=r=>s(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,s,o]}class M0 extends le{constructor(t){super(),ae(this,t,E0,P0,oe,{origins:0},I0)}}function k0(i){ue(i,"svelte-9m6drd",`.PanoSpatialTagPlugin__tag-x.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#fff;transform:translate(0, -100%);transition:height 0.5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-9m6drd.svelte-9m6drd{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity 0.8s 0.6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-9m6drd.svelte-9m6drd{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:0.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.1));box-shadow:0 0.1rem 0.5rem rgba(0, 0, 0, 0.2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform 0.4s cubic-bezier(0.44, 0.44, 0.74, 0.98), opacity 0.4s cubic-bezier(0.44, 0.44, 0.74, 0.98), width 0.5s linear,
520
520
  height 0.5s linear;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:0.3rem;height:1.8rem;width:0.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-9m6drd.svelte-9m6drd{position:absolute;top:0;left:0.5rem;height:1.8rem;width:0.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-9m6drd .PanoSpatialTagPlugin__tag-line1.svelte-9m6drd{animation:svelte-9m6drd-PanoSpatialTagPlugin__tag-line1 linear 0.5s forwards 0.45s}.PanoSpatialTagPlugin__tag-show.svelte-9m6drd .PanoSpatialTagPlugin__tag-line2.svelte-9m6drd{animation:svelte-9m6drd-PanoSpatialTagPlugin__tag-line2 linear 0.5s forwards 0.65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-9m6drd.svelte-9m6drd{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-9m6drd .PanoSpatialTagPlugin__tag-line.svelte-9m6drd{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-9m6drd.svelte-9m6drd{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform 0.5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-9m6drd .PanoSpatialTagPlugin__tag-animate.svelte-9m6drd{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-9m6drd.svelte-9m6drd{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform 0.9s cubic-bezier(0, 0.65, 0.16, 1.08) 0.6s;padding-left:0.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-9m6drd .PanoSpatialTagPlugin__tag-content.svelte-9m6drd{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-9m6drd .PanoSpatialTagPlugin__tag-flagpole.svelte-9m6drd{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-9m6drd .PanoSpatialTagPlugin__tag-shadow.svelte-9m6drd{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-9m6drd .PanoSpatialTagPlugin__tag-shadow.svelte-9m6drd{opacity:0.32}.PanoSpatialTagPlugin__tag-show.svelte-9m6drd .PanoSpatialTagPlugin__tag-content.svelte-9m6drd{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-flagpole.svelte-9m6drd{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform 0.5s 0.55s, opacity 0.4s 0.55s}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-shadow.svelte-9m6drd{opacity:0;transition:opacity 0.8s}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-content.svelte-9m6drd{transform:translate(-100%, 0);transition:transform 0.6s cubic-bezier(0.53, 0.06, 0.88, 0.59)}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-content .svelte-9m6drd{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-line1.svelte-9m6drd{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-9m6drd-PanoSpatialTagPlugin__tag-line1-hide linear 0.28s forwards 0.3s}.PanoSpatialTagPlugin__tag-hide.svelte-9m6drd .PanoSpatialTagPlugin__tag-line2.svelte-9m6drd{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-9m6drd-PanoSpatialTagPlugin__tag-line2-hide linear 0.28s forwards 0.45s}@keyframes svelte-9m6drd-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-9m6drd-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-9m6drd-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-9m6drd-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}`)}function D0(i){let t,e,n,s,o,r,a,l,c,d,h,u,m,A,p;return{c(){t=D("div"),e=D("div"),n=ee(),s=D("div"),o=D("i"),r=ee(),a=D("i"),l=ee(),c=D("i"),d=ee(),h=D("div"),u=D("div"),w(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-9m6drd"),j(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),w(o,"class","PanoSpatialTagPlugin__tag-flagpole svelte-9m6drd"),j(o,"width",i[4]+"rem"),w(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-9m6drd"),w(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-9m6drd"),w(s,"class","PanoSpatialTagPlugin__tag-line svelte-9m6drd"),w(u,"class","PanoSpatialTagPlugin__tag-content svelte-9m6drd"),w(h,"class","PanoSpatialTagPlugin__tag-animate svelte-9m6drd"),j(h,"transform","scale("+i[3]*3+")"),w(t,"id",m="PanoSpatialTagPlugin__"+i[0]),j(t,"height",20*i[5]+"rem"),w(t,"class","svelte-9m6drd"),$(t,"PanoSpatialTagPlugin__tag-x",!0),$(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),$(t,"PanoSpatialTagPlugin__tag-show",i[10]),$(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(g,b){B(g,t,b),x(t,e),x(t,n),x(t,s),x(s,o),x(s,r),x(s,a),x(s,l),x(s,c),x(t,d),x(t,h),x(h,u),u.innerHTML=i[2],i[16](u),A||(p=be(u,"click",i[11]),A=!0)},p(g,[b]){b&394&&j(e,"transform","translate("+g[7]/2*g[3]*3+"px, "+g[8]/2*(g[1]?-1:1)*g[3]*3+"px) scale("+1/g[3]+")"),b&16&&j(o,"width",g[4]+"rem"),b&4&&(u.innerHTML=g[2]),b&8&&j(h,"transform","scale("+g[3]*3+")"),b&1&&m!==(m="PanoSpatialTagPlugin__"+g[0])&&w(t,"id",m),b&32&&j(t,"height",20*g[5]+"rem"),b&2&&$(t,"PanoSpatialTagPlugin__tag-upside-down",g[1]),b&1024&&$(t,"PanoSpatialTagPlugin__tag-show",g[10]),b&1088&&$(t,"PanoSpatialTagPlugin__tag-hide",g[10]===!1||g[6])},i:J,o:J,d(g){g&&O(t),i[16](null),A=!1,p()}}}function x0(i,t,e){let{id:n}=t,{upsideDown:s}=t,{content:o}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:d}=t,{dispose:h}=t,{events:u}=t,{hooks:m}=t,A=0,p=0,g,b,y=setTimeout(()=>{d||e(10,b=!0),y=void 0},100);const I=P=>{const V=Object.keys(u);let L=P.target;for(;L;){const W=L.getAttribute("class");if(!W){L=L.parentNode;continue}if(W.includes("PanoSpatialTagPlugin__tag-content")){L=null;break}V.forEach(q=>{W.includes(q)&&u[q](n)}),L=L.parentNode}};vt(()=>{m.emit("initTag",{id:n})});const M=du.subscribe(P=>{if(P===null)return;const[V,L]=P.split("-PanoSpatialTagPlugin-");n===V&&(m.emit("clickOrigin",{id:n,show:b}),y||(e(10,b=d),e(12,d=!d),y=setTimeout(()=>{y=void 0},1500)))});xh(()=>{e(7,A=g.offsetWidth),e(8,p=g.offsetHeight),!y&&e(10,b=!d)}),Lt(()=>{m.emit("destroyTag",{id:n}),M(),h()});function T(P){Qe[P?"unshift":"push"](()=>{g=P,e(9,g)})}return i.$$set=P=>{"id"in P&&e(0,n=P.id),"upsideDown"in P&&e(1,s=P.upsideDown),"content"in P&&e(2,o=P.content),"contentZoom"in P&&e(3,r=P.contentZoom),"lineWidthZoom"in P&&e(4,a=P.lineWidthZoom),"lineHeightZoom"in P&&e(5,l=P.lineHeightZoom),"destroying"in P&&e(6,c=P.destroying),"folded"in P&&e(12,d=P.folded),"dispose"in P&&e(13,h=P.dispose),"events"in P&&e(14,u=P.events),"hooks"in P&&e(15,m=P.hooks)},[n,s,o,r,a,l,c,A,p,g,b,I,d,h,u,m,T]}let S0=class extends le{constructor(t){super(),ae(this,t,x0,D0,oe,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},k0)}};const T0={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Ac="<",vc=">",bc="%",yc="locals",L0="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",z0={"&":"&amp","<":"&lt",">":"&gt",'"':"&#34","'":"&#39"},ht={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function wc(i){return i.replace(/;(\s*$)/,"$1")}function j0(i,t){return new O0(i).compileFunction()(t)}class O0{constructor(t){f(this,"templateText");f(this,"mode",null);f(this,"truncate",!1);f(this,"currentLine",1);f(this,"source","");f(this,"regex",new RegExp(L0));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
521
521
  function __append(s) { if (s !== undefined && s !== null) __output += s }
522
522
  with (`+yc+` || {}) {