@realsee/dnalogel 2.16.0-13 → 2.16.0-14

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 (313) hide show
  1. package/dist/GuideLinePlugin/GuideLineModeItem.d.ts +8 -4
  2. package/dist/GuideLinePlugin/typing.d.ts +7 -3
  3. package/dist/index.cjs.js +49 -33
  4. package/dist/index.js +708 -677
  5. package/dist/index.umd.js +38 -22
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/CSS3DRender.html +30 -30
  8. package/docs/classes/CruisePluginController.html +25 -25
  9. package/docs/classes/GuideLineItem.GuideLineItem.html +15 -15
  10. package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +62 -28
  11. package/docs/classes/Magnifier.html +19 -19
  12. package/docs/classes/ModelRoomLabelController.html +10 -10
  13. package/docs/classes/Object3DHelperController.html +24 -24
  14. package/docs/classes/PaintBrush.html +14 -14
  15. package/docs/classes/PanoMeasurePluginLine.html +22 -22
  16. package/docs/classes/PanoMeasurePluginModel.html +21 -21
  17. package/docs/classes/PanoMeasurePluginPoint.html +13 -13
  18. package/docs/classes/PanoMeasurePluginPolyline.html +25 -25
  19. package/docs/classes/PanoTagPluginController.html +46 -46
  20. package/docs/classes/Util.BetterTween.html +8 -8
  21. package/docs/classes/Util.FivePointSelector.html +11 -11
  22. package/docs/classes/Util.Interval.html +11 -11
  23. package/docs/classes/Util.Magnifier.html +16 -16
  24. package/docs/classes/Util.PointDomHelper.html +10 -10
  25. package/docs/classes/Util.PointHelper.html +10 -10
  26. package/docs/classes/Util.Rectangle.html +12 -12
  27. package/docs/enums/CameraMovementEffect.html +6 -6
  28. package/docs/enums/ContentType.html +18 -18
  29. package/docs/enums/DIRECTION.html +8 -8
  30. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +8 -8
  31. package/docs/enums/DimensionType.html +6 -6
  32. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +7 -7
  33. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +8 -8
  34. package/docs/enums/PaintBrushTypeEnum.html +7 -7
  35. package/docs/enums/Rotation.html +7 -7
  36. package/docs/functions/CSS3DRenderPlugin.html +3 -3
  37. package/docs/functions/CameraMovementPlugin.html +3 -3
  38. package/docs/functions/CruisePlugin.html +3 -3
  39. package/docs/functions/GuideLinePlugin.html +4 -4
  40. package/docs/functions/ItemLabelPlugin.html +3 -3
  41. package/docs/functions/MapviewFloorplanPlugin.html +3 -3
  42. package/docs/functions/ModelChassisCompassPlugin.html +3 -3
  43. package/docs/functions/ModelEntryDoorGuidePlugin.html +3 -3
  44. package/docs/functions/ModelFloorplanPlugin.html +3 -3
  45. package/docs/functions/ModelItemLabelPlugin.html +3 -3
  46. package/docs/functions/ModelRoomLabelPlugin.html +3 -3
  47. package/docs/functions/ModelTVVideoPlugin.html +3 -3
  48. package/docs/functions/ModelViewPlugin.html +3 -3
  49. package/docs/functions/Object3DHelperPlugin.html +3 -3
  50. package/docs/functions/PanoCompassPlugin.html +3 -3
  51. package/docs/functions/PanoCursorRaycasterPlugin.html +3 -3
  52. package/docs/functions/PanoDoorLabelPlugin.html +3 -3
  53. package/docs/functions/PanoFloorplanRadarPlugin.html +3 -3
  54. package/docs/functions/PanoMeasurePlugin.html +3 -3
  55. package/docs/functions/PanoRulerPlugin.html +3 -3
  56. package/docs/functions/PanoRulerProPlugin.html +3 -3
  57. package/docs/functions/PanoSpatialTagPlugin.html +3 -3
  58. package/docs/functions/PanoTagPlugin.html +3 -3
  59. package/docs/functions/PanoVideoPlugin.html +3 -3
  60. package/docs/functions/TopviewFloorplanPlugin.html +3 -3
  61. package/docs/functions/Util.getCoordsFromClient.html +4 -4
  62. package/docs/functions/Util.getCoordsFromElement.html +4 -4
  63. package/docs/functions/Util.getFrameTime.html +4 -4
  64. package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
  65. package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
  66. package/docs/functions/Util.isAbsoluteURL.html +4 -4
  67. package/docs/functions/Util.isModelLike.html +4 -4
  68. package/docs/functions/Util.isNil.html +4 -4
  69. package/docs/functions/Util.isPanoramaLike.html +4 -4
  70. package/docs/functions/Util.nextFrame.html +4 -4
  71. package/docs/functions/Util.notNil.html +4 -4
  72. package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
  73. package/docs/functions/Util.tweenProgress.html +4 -4
  74. package/docs/functions/Util.uuid.html +4 -4
  75. package/docs/functions/pluginFlag.html +4 -4
  76. package/docs/index.html +4 -4
  77. package/docs/interfaces/AddTagConfig.html +5 -5
  78. package/docs/interfaces/CSS3DRenderPluginEventMap.html +10 -10
  79. package/docs/interfaces/CSS3DRenderPluginState.html +7 -7
  80. package/docs/interfaces/CameraMovementPluginExportType.html +6 -6
  81. package/docs/interfaces/CruisePluginTypes.Config.html +7 -7
  82. package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +11 -11
  83. package/docs/interfaces/CruisePluginTypes.EventMap.html +19 -19
  84. package/docs/interfaces/CruisePluginTypes.MoveAction.html +11 -11
  85. package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +13 -13
  86. package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +13 -13
  87. package/docs/interfaces/CruisePluginTypes.PluginData.html +8 -8
  88. package/docs/interfaces/CruisePluginTypes.PluginServerData.html +6 -6
  89. package/docs/interfaces/CruisePluginTypes.PluginState.html +10 -10
  90. package/docs/interfaces/EventMap.html +14 -14
  91. package/docs/interfaces/FloorplanBounding.html +7 -7
  92. package/docs/interfaces/FloorplanData.html +9 -9
  93. package/docs/interfaces/FloorplanEntrance.html +10 -10
  94. package/docs/interfaces/FloorplanExtraObject.html +9 -9
  95. package/docs/interfaces/FloorplanExtraObject3D.html +7 -7
  96. package/docs/interfaces/FloorplanFloorData.html +8 -8
  97. package/docs/interfaces/FloorplanImagePosition.html +6 -6
  98. package/docs/interfaces/FloorplanObserver.html +8 -8
  99. package/docs/interfaces/FloorplanOutlineItem.html +8 -8
  100. package/docs/interfaces/FloorplanPosition.html +6 -6
  101. package/docs/interfaces/FloorplanRoomItem.html +12 -12
  102. package/docs/interfaces/FloorplanRoomLabelItem.html +6 -6
  103. package/docs/interfaces/FloorplanServerBounding.html +7 -7
  104. package/docs/interfaces/FloorplanServerComputedData.html +9 -9
  105. package/docs/interfaces/FloorplanServerData.html +6 -6
  106. package/docs/interfaces/FloorplanServerDoorItem.html +9 -9
  107. package/docs/interfaces/FloorplanServerDoorPosition.html +7 -7
  108. package/docs/interfaces/FloorplanServerEntrance.html +10 -10
  109. package/docs/interfaces/FloorplanServerFloorData.html +8 -8
  110. package/docs/interfaces/FloorplanServerImagePosition.html +6 -6
  111. package/docs/interfaces/FloorplanServerObserver.html +8 -8
  112. package/docs/interfaces/FloorplanServerOutlineItem.html +8 -8
  113. package/docs/interfaces/FloorplanServerPosition.html +6 -6
  114. package/docs/interfaces/FloorplanServerRoomItem.html +13 -13
  115. package/docs/interfaces/FloorplanServerRoomLabelItem.html +6 -6
  116. package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +6 -6
  117. package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +9 -9
  118. package/docs/interfaces/GuideLinePluginType.EventMap.html +12 -12
  119. package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +7 -7
  120. package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +5 -5
  121. package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +31 -13
  122. package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +7 -7
  123. package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +38 -18
  124. package/docs/interfaces/GuideLinePluginType.ModelGuideLineTag.html +18 -18
  125. package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +38 -18
  126. package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +4 -4
  127. package/docs/interfaces/GuideLinePluginType.PluginServerData.html +6 -6
  128. package/docs/interfaces/GuideLinePluginType.PluginState.html +7 -7
  129. package/docs/interfaces/GuideLinePluginType.Route.html +10 -10
  130. package/docs/interfaces/GuideLinePluginType.RouteConfig.html +8 -8
  131. package/docs/interfaces/HelperOffset.html +7 -7
  132. package/docs/interfaces/ImagePlaneGroup.html +5 -5
  133. package/docs/interfaces/ItemLabelPluginData.html +5 -5
  134. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +10 -10
  135. package/docs/interfaces/ItemLabelPluginParametersType.html +8 -8
  136. package/docs/interfaces/MinMax.html +6 -6
  137. package/docs/interfaces/ModelChassisCompassPluginData.html +6 -6
  138. package/docs/interfaces/ModelChassisCompassPluginExportType.html +7 -7
  139. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +6 -6
  140. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +7 -7
  141. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +7 -7
  142. package/docs/interfaces/ModelItemLabelPluginData.html +5 -5
  143. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +10 -10
  144. package/docs/interfaces/ModelItemLabelPluginParametersType.html +6 -6
  145. package/docs/interfaces/ModelRoomLabelPluginData.html +5 -5
  146. package/docs/interfaces/ModelTVVideoPluginData.html +8 -8
  147. package/docs/interfaces/ModelTVVideoPluginExportType.html +7 -7
  148. package/docs/interfaces/ModelTVVideoPluginParameterType.html +5 -5
  149. package/docs/interfaces/ModelViewPluginExportType.html +10 -10
  150. package/docs/interfaces/Object3DHelperState.html +7 -7
  151. package/docs/interfaces/ObjectHelperControllers.html +8 -8
  152. package/docs/interfaces/PaintBrushAction.html +11 -11
  153. package/docs/interfaces/PaintBrushConfigs.html +11 -11
  154. package/docs/interfaces/PaintBrushState.html +9 -9
  155. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +9 -9
  156. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
  157. package/docs/interfaces/PanoMeasureParameterType.html +13 -13
  158. package/docs/interfaces/PanoMeasurePluginLineJson.html +7 -7
  159. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +6 -6
  160. package/docs/interfaces/PanoMeasurePluginPointJson.html +6 -6
  161. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +7 -7
  162. package/docs/interfaces/PanoRulerPluginExportType.html +9 -9
  163. package/docs/interfaces/PanoRulerPluginOptions.html +6 -6
  164. package/docs/interfaces/PanoRulerPluginParameterType.html +7 -7
  165. package/docs/interfaces/PanoRulerProPluginExportType.html +8 -8
  166. package/docs/interfaces/PanoRulerProPluginOptions.html +6 -6
  167. package/docs/interfaces/PanoRulerProPluginParameterType.html +6 -6
  168. package/docs/interfaces/PanoRulerProPluginState.html +7 -7
  169. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
  170. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
  171. package/docs/interfaces/PanoSpatialTagPluginData.html +10 -10
  172. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +9 -9
  173. package/docs/interfaces/PanoSpatialTagPluginExportType.html +12 -12
  174. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +9 -9
  175. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +12 -12
  176. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +10 -10
  177. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +9 -9
  178. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +5 -5
  179. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +7 -7
  180. package/docs/interfaces/PanoVideoPluginType.PluginData.html +5 -5
  181. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +8 -8
  182. package/docs/interfaces/PanoVideoPluginType.PluginState.html +5 -5
  183. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +7 -7
  184. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +9 -9
  185. package/docs/interfaces/Point.html +7 -7
  186. package/docs/interfaces/Room.html +8 -8
  187. package/docs/interfaces/RoomInfo.html +6 -6
  188. package/docs/interfaces/RoomLabel.html +13 -13
  189. package/docs/interfaces/RoomRules.html +4 -4
  190. package/docs/interfaces/Rooms.html +4 -4
  191. package/docs/interfaces/Scissor.html +8 -8
  192. package/docs/interfaces/State.html +7 -7
  193. package/docs/interfaces/TagCacheInterface.html +11 -11
  194. package/docs/interfaces/TagConfig.html +10 -10
  195. package/docs/interfaces/TagGLTFObjectGroup.html +5 -5
  196. package/docs/interfaces/TagIconUrl.html +11 -11
  197. package/docs/interfaces/TagObjectGroup.html +5 -5
  198. package/docs/interfaces/TagStyle.html +5 -5
  199. package/docs/interfaces/Tags.html +8 -8
  200. package/docs/interfaces/TemporaryState.html +5 -5
  201. package/docs/interfaces/Util.MagnifierParameter.html +10 -10
  202. package/docs/interfaces/Util.MouseGroupParameter.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/Direction-1.html +4 -4
  227. package/docs/types/Direction4.html +4 -4
  228. package/docs/types/FloorplanRuleLabels.html +4 -4
  229. package/docs/types/FloorplanServerRuleLabels.html +4 -4
  230. package/docs/types/GuideLinePluginExportType.html +4 -4
  231. package/docs/types/GuideLinePluginType.GuideLineItem.html +4 -4
  232. package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +4 -4
  233. package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +4 -4
  234. package/docs/types/GuideLinePluginType.GuideLineStyle.html +4 -4
  235. package/docs/types/GuideLinePluginType.PathItem.html +4 -4
  236. package/docs/types/GuideLinePluginType.PluginData.html +4 -4
  237. package/docs/types/HelperEventMap.html +4 -4
  238. package/docs/types/LoadTagConfig.html +4 -4
  239. package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
  240. package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
  241. package/docs/types/MediaData.html +4 -4
  242. package/docs/types/MediaStore.html +4 -4
  243. package/docs/types/ModelElement.html +4 -4
  244. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
  245. package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
  246. package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
  247. package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
  248. package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
  249. package/docs/types/MoveArgs.html +4 -4
  250. package/docs/types/MoveOpts.html +4 -4
  251. package/docs/types/Object3DHelperEventMap.html +4 -4
  252. package/docs/types/ObjectFit.html +4 -4
  253. package/docs/types/PaintBrushEventMap.html +4 -4
  254. package/docs/types/PanoCompassPluginData.html +4 -4
  255. package/docs/types/PanoCompassPluginExportType.html +4 -4
  256. package/docs/types/PanoCompassPluginParameterType.html +4 -4
  257. package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
  258. package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
  259. package/docs/types/PanoIndex.html +4 -4
  260. package/docs/types/PanoMeasurePluginEvent.html +4 -4
  261. package/docs/types/PanoMeasureReturnType.html +4 -4
  262. package/docs/types/PanoSpatialTagPluginId.html +4 -4
  263. package/docs/types/PanoTagPluginExportInterface.html +4 -4
  264. package/docs/types/PanoTagPluginParamsInterface.html +4 -4
  265. package/docs/types/PanoVideoPluginParameterType.html +4 -4
  266. package/docs/types/PanoVideoPluginReturnType.html +4 -4
  267. package/docs/types/PlaneTag.html +4 -4
  268. package/docs/types/PlaneTagElement.html +4 -4
  269. package/docs/types/Point2DElement.html +4 -4
  270. package/docs/types/Point2DTag.html +4 -4
  271. package/docs/types/Point3DElement.html +4 -4
  272. package/docs/types/Point3DTag.html +4 -4
  273. package/docs/types/PointTag.html +4 -4
  274. package/docs/types/PointTagElement.html +4 -4
  275. package/docs/types/Position.html +4 -4
  276. package/docs/types/RotateArgs.html +4 -4
  277. package/docs/types/RotateOpts.html +4 -4
  278. package/docs/types/RuleLabelsKey.html +4 -4
  279. package/docs/types/RuleLabelsValue.html +4 -4
  280. package/docs/types/StickType.html +4 -4
  281. package/docs/types/Tag.html +4 -4
  282. package/docs/types/Tag2D.html +4 -4
  283. package/docs/types/Tag3D.html +4 -4
  284. package/docs/types/TagContentType.html +4 -4
  285. package/docs/types/TagDimensionType.html +4 -4
  286. package/docs/types/TagElement.html +4 -4
  287. package/docs/types/TagEvents.html +4 -4
  288. package/docs/types/TagGLTFObject.html +4 -4
  289. package/docs/types/TagHooks.html +4 -4
  290. package/docs/types/TagIconSize.html +4 -4
  291. package/docs/types/TagId.html +4 -4
  292. package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
  293. package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
  294. package/docs/types/WorkCode.html +4 -4
  295. package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
  296. package/docs/variables/PLUGIN.html +4 -4
  297. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
  298. package/docs/variables/ROOM_TYPE_MAP.html +4 -4
  299. package/docs/variables/itemLabelPluginServerParams.html +4 -4
  300. package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
  301. package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
  302. package/libs/CruisePlugin/Controller.js +1 -1
  303. package/libs/CruisePlugin/index.js +1 -1
  304. package/libs/GuideLinePlugin/Controller.js +18 -17
  305. package/libs/GuideLinePlugin/GuideLineItem/index.js +53 -54
  306. package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
  307. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +89 -59
  308. package/libs/GuideLinePlugin/GuideLineModeItem.d.ts +8 -4
  309. package/libs/GuideLinePlugin/index.js +1 -1
  310. package/libs/GuideLinePlugin/typing.d.ts +7 -3
  311. package/libs/base/BasePlugin.js +1 -1
  312. package/libs/index.js +1 -1
  313. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -191,7 +191,7 @@ void main() {
191
191
  svg [type='lineItemGroup'] g g g g {
192
192
  stroke: #ffffff;
193
193
  }</style>
194
- `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class vm extends de{constructor(t){super(),ce(this,t,gm,pm,le,{content:0},mm)}}function Am(i){me(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function bm(i){let t,e;return t=new fm({props:{url:i[1].url}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ym(i){let t,e;return t=new vm({props:{content:i[0]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wm(i){let t,e,n,o;const s=[ym,bm],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=V("div"),n&&n.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(he(),M(r[d],1,1,()=>{r[d]=null}),ue()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){o||(k(n),o=!0)},o(l){M(n),o=!1},d(l){l&&_(t),~e&&r[e].d()}}}function Pm(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class kl extends de{constructor(t){super(),ce(this,t,Pm,wm,le,{floorIndex:2,floorplanData:3},Am)}}function Cm(i){me(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Im(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new wo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),O(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&_(n),o&&t.d()}}}function Em(i){let t,e,n=i[1]&&xl(i),o=i[0]&&Dl(i);return{c(){n&&n.c(),t=se(),o&&o.c(),e=Ee()},m(s,r){n&&n.m(s,r),O(s,t,r),o&&o.m(s,r),O(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=xl(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Dl(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&_(t),o&&o.d(s),s&&_(e)}}}function xl(i){let t,e=i[2].name+"",n;return{c(){t=V("span"),n=Be(e),w(t,"class","floorplan-plugin__room-name")},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Re(n,e)},d(o){o&&_(t)}}}function Dl(i){let t,e;return{c(){t=V("span"),e=Be(i[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){O(n,t,o),Q(t,e)},p(n,o){o&128&&Re(e,n[7])},d(n){n&&_(t)}}}function km(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Em;if(a[8])return Im}let s=o(i),r=s&&s(i);return{c(){t=V("div"),r&&r.c(),w(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(n=[Wt($n.call(null,t)),ke(t,"clientWidth",i[19]),ke(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&_(t),r&&r.d(),e=!1,$e(n)}}}function xm(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Dm(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function A(G,j){if(j.width===0||j.height===0)return()=>!1;const R=G.path.map(({x:Pe,y:Ae})=>[Pe,Ae]),Z=G.roomLabel.position,{x:q,y:Y}=Z,{width:K,height:ae}=j,oe=K/2,ye=ae/2;return function(Ae){const _e=q*Ae,be=Y*Ae,Fe=R.map(([we,Te])=>[we*Ae,Te*Ae]);return[[_e+oe,be-ye],[_e-oe,be-ye],[_e-oe,be+ye],[_e+oe,be+ye]].every(we=>xm(we,Fe))}}const b=document.body.clientWidth,y=document.body.clientHeight,C=h.roomLabel,D=C.positionInImage.x*100+"%",x=C.positionInImage.y*100+"%",I=(b<500||y<500?10:14)+"px";let T=0,S=0,H=!1;u.subscribe(function(j){e(16,H=!!j&&j.id===h.id)});const X=G=>{e(4,T=G.detail)},N=G=>{e(5,S=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,g=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,v=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:T,height:S}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=v?H?!0:!!(r!=null&&r(l)):!0)},[c,d,h,g,T,S,a,o,n,D,x,I,l,u,m,v,H,r,s,X,N]}class Sm extends de{constructor(t){super(),ce(this,t,Dm,km,le,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Cm)}}function Lm(i){me(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Sl(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ll(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Sl(i,a,c),h=l(d);n.set(h,e[c]=Ml(h,d))}return{c(){t=V("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){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);o=!0,s||(r=[Wt($n.call(null,t)),ke(t,"clientWidth",i[11])],s=!0)},p(c,d){d&447&&(a=c[8],he(),e=xt(e,d,l,1,c,a,n,t,an,Ml,null,Sl),ue())},i(c){if(!o){for(let d=0;d<a.length;d+=1)k(e[d]);o=!0}},o(c){for(let d=0;d<e.length;d+=1)M(e[d]);o=!1},d(c){c&&_(t);for(let d=0;d<e.length;d+=1)e[d].d();s=!1,$e(r)}}}function Ml(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new Sm({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&447?tt(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function Mm(i){let t,e,n=i[8]&&Ll(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&k(n,1)):(n=Ll(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Tm(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const g=v=>{e(6,u=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,d=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:A}=a.bounding,b=v.x-A.x;e(7,m=u/b)}},[s,r,l,c,d,h,u,m,n,o,a,g]}class zm extends de{constructor(t){super(),ce(this,t,Tm,Mm,le,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Lm)}}function jm(i){me(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Tl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function zl(i,t,e){const n=i.slice();return n[14]=t[e],n}function jl(i){let t;return{c(){t=V("div"),w(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){O(e,t,n)},p:J,d(e){e&&_(t)}}}function _l(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=V("div"),n=V("div"),s=Be(o),r=se(),w(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),ee(n,"is-row",t[2]),w(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Re(s,o)},d(a){a&&_(e)}}}function _m(i){let t,e,n,o,s,r,a=[],l=new Map,c,d=i[3],h=[];for(let g=0;g<d.length;g+=1)h[g]=jl(zl(i,d,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=Tl(i,u,g),A=m(v);l.set(A,a[g]=_l(A,v))}return{c(){t=V("div"),e=V("div"),n=se(),o=V("div");for(let g=0;g<h.length;g+=1)h[g].c();s=se(),r=V("div");for(let g=0;g<a.length;g+=1)a[g].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),ee(o,"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"),ee(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){O(g,t,v),Q(t,e),Q(t,n),Q(t,o);for(let A=0;A<h.length;A+=1)h[A]&&h[A].m(o,null);Q(t,s),Q(t,r);for(let A=0;A<a.length;A+=1)a[A]&&a[A].m(r,null)},p(g,[v]){if(v&8){d=g[3];let A;for(A=0;A<d.length;A+=1){const b=zl(g,d,A);h[A]?h[A].p(b,v):(h[A]=jl(b),h[A].c(),h[A].m(o,null))}for(;A<h.length;A+=1)h[A].d(1);h.length=d.length}v&22&&(u=g[4],a=xt(a,v,m,1,g,u,l,r,Hs,_l,null,Tl)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&w(t,"class",c),v&5&&ee(t,"is-row",g[2])},i:J,o:J,d(g){g&&_(t),Ft(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const ii=1e3,oi=180;function Vm(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(ii-oi)*2,c=s.max.y-s.min.y-(ii-oi)*2,d=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,A)=>v===0?!0:g!==A[v-1]),h=d.map(g=>{const v=a?(g-s.min.x-ii+oi)/l:0,A=a?0:(g-s.min.y-ii+oi)/c;return{left:v,bottom:A}});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((g,v,A)=>{const b=v===0?0:g-A[v-1],y=v===0?0:(g+A[v-1])/2,C=a?(y-s.min.x-ii+oi)/l:0,D=a?0:(y-s.min.y-ii+oi)/c;return{left:C,bottom:D,distance:b}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,o,s]}class Om extends de{constructor(t){super(),ce(this,t,Vm,_m,le,{type:0,data:5,bounding:6,getRuleDistanceText:1},jm)}}function Bm(i){me(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Vl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Ol(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new Om({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&19?tt(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function Qm(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Vl(i,s,a),c=r(l);n.set(c,e[a]=Ol(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],he(),e=xt(e,l,r,1,a,s,n,t,an,Ol,null,Vl),ue()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Bl=1e3,Ql=180;function Rm(i,t,e){let n,o,s,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,m=A.floorIndex),"floorplanData"in A&&e(6,g=A.floorplanData),"getRuleDistanceText"in A&&e(0,v=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),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-(Bl-Ql)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(Bl-Ql)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[v,n,u,h,r,m,g,l,d,a,c,o,s]}class Gm extends de{constructor(t){super(),ce(this,t,Rm,Qm,le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Bm)}}function jo(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):o!=null&&o[a]?(e+="A"+o[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Rl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Nm(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 Wm(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function Fm(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Hm(i){let t;return{c(){t=ze("path"),w(t,"d",i[0]),w(t,"fill","#2F313A")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&w(t,"d",e[0])},i:J,o:J,d(e){e&&_(t)}}}function Xm(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=jo(o,{needZ:!0}))},[n,o]}class Ym extends de{constructor(t){super(),ce(this,t,Xm,Hm,le,{path:1})}}function Um(i){let t,e,n,o,s,r;return{c(){t=ze("defs"),e=ze("pattern"),n=ze("rect"),o=ze("path"),s=se(),r=ze("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width",i[1]),w(n,"height",i[1]),w(n,"fill","#323747"),w(o,"d",i[2]),w(o,"stroke","#ffffff"),w(o,"stroke-opacity","0.06"),w(o,"stroke-width","0.5"),w(o,"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){O(a,t,l),Q(t,e),Q(e,n),Q(e,o),O(a,s,l),O(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:J,o:J,d(a){a&&_(t),a&&_(s),a&&_(r)}}}const qs=6;function qm(i,t,e){let n,{path:o}=t;const s=qs*2,r=`M0 ${qs} h ${s} M${qs} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=jo(o,{needZ:!0}))},[n,s,r,o]}class Jm extends de{constructor(t){super(),ce(this,t,qm,Um,le,{path:3})}}function Zm(i){let t,e,n,o,s,r,a,l,c,d,h;return{c(){t=ze("defs"),e=ze("pattern"),n=ze("rect"),o=ze("pattern"),s=ze("rect"),r=se(),a=ze("path"),l=se(),c=ze("path"),d=se(),h=ze("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(s,"x","0"),w(s,"y","0"),w(s,"width","6"),w(s,"height","50"),w(s,"fill","none"),w(s,"stroke","#4B4B57"),w(s,"stroke-width","0.5"),w(o,"id","room-material-pattern-2"),w(o,"x","6"),w(o,"y","25"),w(o,"width","12"),w(o,"height","50"),w(o,"patternUnits","userSpaceOnUse"),w(o,"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){O(u,t,m),Q(t,e),Q(e,n),Q(t,o),Q(o,s),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(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&&_(t),u&&_(r),u&&_(a),u&&_(l),u&&_(c),u&&_(d),u&&_(h)}}}function Km(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=jo(o,{needZ:!0}))},[n,o]}class $m extends de{constructor(t){super(),ce(this,t,Km,Zm,le,{path:1})}}function ep(i){me(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Gl(i,t,e){const n=i.slice();return n[5]=t[e],n}function tp(i){let t,e;return t=new Jm({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function np(i){let t,e;return t=new $m({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ip(i){let t,e;return t=new Ym({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Nl(i){let t,e,n,o;const s=[ip,np,tp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ze("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){O(l,t,c),r[e].m(t,null),o=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(he(),M(r[d],1,1,()=>{r[d]=null}),ue(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null))},i(l){o||(k(n),o=!0)},o(l){M(n),o=!1},d(l){l&&_(t),r[e].d()}}}function op(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Nl(Gl(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){t=V("div");for(let r=0;r<o.length;r+=1)o[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Gl(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=Nl(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){r&&_(t),Ft(o,r)}}}function sp(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>Ie(W({},l),{path:l.path.map(c=>Rl(c,s.bounding))})))},[n,r,a,o,s]}class rp extends de{constructor(t){super(),ce(this,t,sp,op,le,{floorIndex:3,floorplanData:4},ep)}}function ap(i){me(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function lp(i){let t,e,n,o;return{c(){t=ze("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(s,r){O(s,t,r),n||(o=[ke(t,"mouseenter",i[3]),ke(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&w(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&w(t,"id",e)},i:J,o:J,d(s){s&&_(t),n=!1,$e(o)}}}function cp(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function d(){l.set(s)}function h(){l.set(void 0)}const{bounding:u}=a,m=jo(s.path,{needZ:!0,format:g=>Rl(g,u)});return i.$$set=g=>{"room"in g&&e(0,s=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"hoveredRoom"in g&&e(7,l=g.hoveredRoom),"highlightData"in g&&e(8,c=g.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,d,h,m,a,l,c,n]}class dp extends de{constructor(t){super(),ce(this,t,cp,lp,le,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},ap)}}function hp(i){me(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Wl(i,t,e){const n=i.slice();return n[6]=t[e],n}function Fl(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new dp({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&15?tt(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function up(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Wl(i,r,l),d=a(c);o.set(d,n[l]=Fl(d,c))}return{c(){t=V("div"),e=ze("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){O(l,t,c),Q(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,he(),n=xt(n,c,a,1,l,r,o,e,an,Fl,null,Wl),ue())},i(l){if(!s){for(let c=0;c<r.length;c+=1)k(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)M(n[c]);s=!1},d(l){l&&_(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function fp(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Hl extends de{constructor(t){super(),ce(this,t,fp,up,le,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},hp)}}function mp(i){me(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xl(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Hl({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&24834?tt(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Yl(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new zm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&22370?tt(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Ul(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Gm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2306?tt(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function pp(i){let t,e,n,o,s,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Ue(h,d[b]);e=new rp({props:h});let u=(i[2]||i[3])&&Xl(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let b=0;b<m.length;b+=1)g=Ue(g,m[b]);s=new kl({props:g});let v=i[4]&&Yl(i),A=i[7]&&Ul(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),u&&u.c(),o=se(),ie(s.$$.fragment),r=se(),v&&v.c(),a=se(),A&&A.c(),w(t,"class",l=Oe(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,y){O(b,t,y),te(e,t,null),Q(t,n),u&&u.m(t,null),Q(t,o),te(s,t,null),Q(t,r),v&&v.m(t,null),Q(t,a),A&&A.m(t,null),c=!0},p(b,[y]){const C=y&258?tt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(C),b[2]||b[3]?u?(u.p(b,y),y&12&&k(u,1)):(u=Xl(b),u.c(),k(u,1),u.m(t,o)):u&&(he(),M(u,1,1,()=>{u=null}),ue());const D=y&258?tt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};s.$set(D),b[4]?v?(v.p(b,y),y&16&&k(v,1)):(v=Yl(b),v.c(),k(v,1),v.m(t,a)):v&&(he(),M(v,1,1,()=>{v=null}),ue()),b[7]?A?(A.p(b,y),y&128&&k(A,1)):(A=Ul(b),A.c(),k(A,1),A.m(t,null)):A&&(he(),M(A,1,1,()=>{A=null}),ue()),(!c||y&1&&l!==(l=Oe(`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(s.$$.fragment,b),k(v),k(A),c=!0)},o(b){M(e.$$.fragment,b),M(u),M(s.$$.fragment,b),M(v),M(A),c=!1},d(b){b&&_(t),ne(e),u&&u.d(),ne(s),v&&v.d(),A&&A.d()}}}function gp(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:A}=t;const b=Us(void 0);return i.$$set=y=>{"isCurrent"in y&&e(0,n=y.isCurrent),"floorIndex"in y&&e(1,o=y.floorIndex),"highlightEnable"in y&&e(2,s=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,g=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,v=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,A=y.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,g,v,A,b]}let vp=class extends de{constructor(t){super(),ce(this,t,gp,pp,le,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},mp)}};function Ap(i){me(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ql(i,t,e){const n=i.slice();return n[21]=t[e],n}function Jl(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Zl(ql(i,r,h));const l=h=>M(a[h],1,1,()=>{a[h]=null});let c=i[5]&&Kl(i),d=i[8]&&$l(i);return{c(){t=V("div");for(let h=0;h<a.length;h+=1)a[h].c();e=se(),c&&c.c(),n=se(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);Q(t,e),c&&c.m(t,null),Q(t,n),d&&d.m(t,null),s=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=ql(i,r,m);a[m]?(a[m].p(g,u),k(a[m],1)):(a[m]=Zl(g),a[m].c(),k(a[m],1),a[m].m(t,e))}for(he(),m=r.length;m<a.length;m+=1)l(m);ue()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=Kl(i),c.c(),k(c,1),c.m(t,n)):c&&(he(),M(c,1,1,()=>{c=null}),ue()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=$l(i),d.c(),k(d,1),d.m(t,null)):d&&(he(),M(d,1,1,()=>{d=null}),ue())},i(h){if(!s){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),o||et(()=>{o=vn(t,An,{duration:i[0],easing:tn}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)M(a[u]);M(c),M(d),s=!1},d(h){h&&_(t),Ft(a,h),c&&c.d(),d&&d.d()}}}function Zl(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new vp({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2047696?tt(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Kl(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new nm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&57352?tt(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function $l(i){let t,e;return t=new cm({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function bp(i){let t,e,n=i[1]&&Jl(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=Jl(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function yp(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:v}=t,{floorplanData:A}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:y}=t,{getRoomAreaText:C}=t,{getLabelElement:D}=t,{getRuleDistanceText:x}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:T}=t;return i.$$set=S=>{"duration"in S&&e(0,n=S.duration),"visible"in S&&e(1,o=S.visible),"northDesc"in S&&e(2,s=S.northDesc),"panoIndex"in S&&e(3,r=S.panoIndex),"floorIndex"in S&&e(4,a=S.floorIndex),"cameraEnable"in S&&e(5,l=S.cameraEnable),"hoverEnable"in S&&e(6,c=S.hoverEnable),"highlightEnable"in S&&e(7,d=S.highlightEnable),"compassEnable"in S&&e(8,h=S.compassEnable),"roomLabelsEnable"in S&&e(9,u=S.roomLabelsEnable),"roomAreaEnable"in S&&e(10,m=S.roomAreaEnable),"roomNameEnable"in S&&e(11,g=S.roomNameEnable),"ruleLabelsEnable"in S&&e(12,v=S.ruleLabelsEnable),"floorplanData"in S&&e(13,A=S.floorplanData),"lastPanoramaLongitude"in S&&e(14,b=S.lastPanoramaLongitude),"cameraImageUrl"in S&&e(15,y=S.cameraImageUrl),"getRoomAreaText"in S&&e(16,C=S.getRoomAreaText),"getLabelElement"in S&&e(17,D=S.getLabelElement),"getRuleDistanceText"in S&&e(18,x=S.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in S&&e(19,I=S.adaptiveRoomLabelVisibleEnable),"highlightData"in S&&e(20,T=S.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,g,v,A,b,y,C,D,x,I,T]}let Js=class extends de{constructor(t){super(),ce(this,t,yp,bp,le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Ap)}};const wp="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 Pp(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return U(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Cp(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 Ip(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Cp),rules:i.rules}}function Ep(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 dn(i){return U(this,null,function*(){const t=yield Pp(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ip),o=i.computed_data.entrance?kp(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ep)}})}function xp(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:wp,width:45,height:48},a=Fm(s,t),l=Nm(s,e),c=Wm(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Dp(i,t){return t(i),i}function _o(i,t){return Dp({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ec(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 Zs(i,t,e=ln.BOUNDING_CENTER){const n=ec(i,t),o=ec(i,t+1);return e===ln.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===ln.CEILING?o:n}function Ks(i,t,e,n){const o=Zs(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let zi=class{constructor(t,e){f(this,"VERSION","2.16.0-13");f(this,"five");f(this,"hooks",new On);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return Ts(t)?t:`${this.staticPrefix}${t}`}},bn=class extends zi{};var vt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(vt||{});const tc=500,Sp=80;function $s(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function er(i,t){return U(this,null,function*(){const[e]=yield ei(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const o=i.getCurrentState();if(!Lp(n,o))throw new Error("pose 与预期不符")})}function Lp(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const o=i[e];return typeof n=="number"&&typeof o=="number"?$s(n,o,2):n===o})}function tr(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!$s(e,s,2)||!$s(n,r,2)||o!==a)}function nc(i,t,e=!0){return U(this,null,function*(){if(tr(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[d]=yield ei(er(i,[t.mode,t,void 0,e]));if(d)throw new Error(vt.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ei(i.updateCamera(t,l,e));if(c)throw new Error(vt.UpdateCameraError)})}function si(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Mp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Tp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let zp=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 o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!tr(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,vt.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(vt.ModelNotLoaded);if(!this.data)throw new Error(vt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ei(nc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(vt.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:tc;si(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,vt.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);si(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Tp(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Mp(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Sp/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const jp=(i,t)=>new zp(i,t);function _p(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Vp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let Op=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 o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!tr(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,vt.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(vt.ModelNotLoaded);if(!this.data)throw new Error(vt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ei(nc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(vt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:tc;si(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,vt.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);si(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),_p(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Vp(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Zs(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const Bp=(i,t)=>new Op(i,t);let Qp=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,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Zs(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_show(e){return U(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield er(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;si(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return U(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;si(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const Rp=(i,t)=>new Qp(i,t);function nr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Gp(i){me(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Np(i){let t,e,n;return{c(){t=V("div"),e=V("div"),n=V("div"),w(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||cn)+")"),z(n,"transform",i[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){O(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||cn)+")"),(s&1||s&3)&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:J,o:J,d(o){o&&_(t)}}}function Wp(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Fp(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,d=s.getCurrentState().longitude;function h(g,v){const A=g.bounding,b=g.observers[v];if(!b)return"";const y=(A.max.x-A.min.x)*r,C=(A.max.y-A.min.y)*r,D=Math.floor(b.positionInImage.x*y),x=Math.floor(b.positionInImage.y*C);return`translate(${D}px, ${x}px)`}function u(g){e(6,c=g)}const m=nr(g=>{e(7,d=g.longitude)},1e3/60);return kt(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=Wp(d))},[l,o,n,s,r,a,c,d]}class Hp extends de{constructor(t){super(),ce(this,t,Fp,Np,le,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Gp)}}function Xp(i){me(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function ic(i,t,e){const n=i.slice();return n[1]=t[e],n}function oc(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=V("div"),n=V("div"),r=se(),w(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),w(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,d){O(c,e,d),Q(e,n),Q(e,r)},p(c,d){t=c,d&1&&z(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&z(n,"width",o),h&&z(n,"height",s),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&_(e)}}}function Yp(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=ic(i,o,r),l=s(a);n.set(l,e[r]=oc(l,a))}return{c(){t=V("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){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=xt(e,a,s,1,r,o,n,t,Hs,oc,null,ic))},i:J,o:J,d(r){r&&_(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Up(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class qp extends de{constructor(t){super(),ce(this,t,Up,Yp,le,{extraObjects:0},Xp)}}function sc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Hl({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&183?tt(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Jp(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Ue(l,a[d]);t=new kl({props:l}),n=new qp({props:{extraObjects:i[6]}});let c=i[3]&&sc(i);return{c(){ie(t.$$.fragment),e=se(),ie(n.$$.fragment),o=se(),c&&c.c(),s=Ee()},m(d,h){te(t,d,h),O(d,e,h),te(n,d,h),O(d,o,h),c&&c.m(d,h),O(d,s,h),r=!0},p(d,[h]){const u=h&20?tt(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=sc(d),c.c(),k(c,1),c.m(s.parentNode,s)):c&&(he(),M(c,1,1,()=>{c=null}),ue())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){M(t.$$.fragment,d),M(n.$$.fragment,d),M(c),r=!1},d(d){ne(t,d),d&&_(e),ne(n,d),d&&_(o),c&&c.d(d),d&&_(s)}}}function Zp(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,o=u.five),"pxmm"in u&&e(1,s=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[o,s,r,a,l,d,n,h,c]}class Kp extends de{constructor(t){super(),ce(this,t,Zp,Jp,le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function $p(i){me(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function rc(i){let t,e,n,o,s=i[7]!==0&&ac(i);return{c(){t=V("div"),s&&s.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),s&&s.m(t,null),e=!0,n||(o=[Wt($n.call(null,t)),ke(t,"clientWidth",i[13]),ke(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&k(s,1)):(s=ac(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),M(s,1,1,()=>{s=null}),ue())},i(r){e||(k(s),e=!0)},o(r){M(s),e=!1},d(r){r&&_(t),s&&s.d(),n=!1,$e(o)}}}function ac(i){let t,e,n,o,s=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Ue(c,l[u]);e=new Kp({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=Ue(h,d[u]);return o=new Hp({props:h}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),ie(o.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(u,m){O(u,t,m),te(e,t,null),Q(t,n),te(o,t,null),a=!0},p(u,m){const g=m&3181?tt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(g);const v=m&1049?tt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&512&&s!==(s=`${u[9]}px`)&&z(t,"width",s),m&4096&&r!==(r=`${u[12]}px`)&&z(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(o.$$.fragment,u),a=!0)},o(u){M(e.$$.fragment,u),M(o.$$.fragment,u),a=!1},d(u){u&&_(t),ne(e),ne(o)}}}function eg(i){let t,e,n=i[1]&&rc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=rc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function tg(i,t,e){var C,D;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(D=(C=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:C.floorIndex)!=null?D:0,u=0,m=0,g=0,v=0;function A(x){e(11,h=n.work.observers[x].floorIndex)}kt(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));const b=x=>{e(7,u=x.detail)},y=x=>{e(8,m=x.detail)};return i.$$set=x=>{"five"in x&&e(0,n=x.five),"visible"in x&&e(1,o=x.visible),"hoverEnable"in x&&e(2,s=x.hoverEnable),"floorplanData"in x&&e(3,r=x.floorplanData),"cameraImageUrl"in x&&e(4,a=x.cameraImageUrl),"extraObjects"in x&&e(5,l=x.extraObjects),"highlightData"in x&&e(6,c=x.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const x=Math.min(u,m),{max:I,min:T}=r.bounding,S=I.x-T.x,H=I.y-T.y,X=function(){return S>H?[x,x/S*H]:[x/H*S,x]}();e(9,g=X[0]),e(12,v=X[1]),e(10,d=g/S)}},[n,o,s,r,a,l,c,u,m,g,d,h,v,b,y]}class ng extends de{constructor(t){super(),ce(this,t,tg,eg,le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},$p)}}let ig=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 o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:cn},s=n!=null&&n.configs?n.configs:{},r=W(W({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return U(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield dn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=xp(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=W(W({},this.state),e),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=Ie(W({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new ng({target:this.wrapper,props:e})}};const og=(i,t)=>new ig(i,t),sg=[{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:"和室"}],rg=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],ag=[{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:"写字楼"}],ir=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},lg=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ir(o,0,0)),s&&i.applyMatrix4(ir(0,s,0)),r&&i.applyMatrix4(ir(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function lc(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=W({map:o.material.map||{}},t);o.material=new B.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const cg=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,o={},s=h=>U(this,null,function*(){var 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 g=i.model.bounding,v=g.max.x-g.min.x,A=g.max.z-g.min.z,b=Math.max(v,A),C=yield new so.FBXLoader().loadAsync(u);lc(C,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const D=[0,m-Math.PI/2,0],{model:{bounding:{max:{x,z:I},min:{x:T,y:S,z:H}}}}=i;o.yBase=S;const X={x:(x+T)/2,y:S-1.6,z:(I+H)/2},N=.0045*b;return lg(C,{position:X,rotation:D,scale:N}),o.object=C,!0}),r=({latitude:h})=>{if(!o.object)return;const u=a(h);u&&(o.object.position.y=u)},a=h=>{if(o.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return o.yBase-(u+1.6);const m=h*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{o.object&&(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function dg(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new B.CanvasTexture(a)}const hg=({x:i,y:t,z:e})=>new B.Vector3(i,t,e),ug=(i,t)=>{var v,A,b;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(A=t.position)!=null?A:void 0,s=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>U(this,null,function*(){var X,N,G,j,R,Z,q,Y;const C=(X=y==null?void 0:y.position)!=null?X:o;if(!C)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const D=hg(C),x=(N=y==null?void 0:y.rad)!=null?N:s,I=(G=y==null?void 0:y.fbx_url)!=null?G:r;if(e.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const T=yield new so.FBXLoader().loadAsync(I);T.position.copy(D),T.rotation.z=x,T.scale.set(.8,.8,.8),lc(T,{transparent:!0,side:E.DoubleSide});const S=(q=(Z=(R=(j=T.children)==null?void 0:j[0])==null?void 0:R.children)==null?void 0:Z[3])==null?void 0:q.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const H=(Y=t.name)!=null?Y:"入户门";return S.material=new B.MeshBasicMaterial({transparent:!0,map:dg(H)}),S.renderOrder=3,T.children[0].add(S),e.object=T,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,C=new B.AnimationMixer(e.object);a.push(C);const D=C.clipAction(e.object.animations[0]);D.timeScale=y;let x;const I=()=>{let X=0,N=0;const G=1e3/30,j=R=>{X=requestAnimationFrame(j);const Z=R-N;Z<G||(N=R,a.forEach(q=>q.update(Z/1e3)),i.needsRender=!0)};return X=requestAnimationFrame(j),()=>{cancelAnimationFrame(X)}},H={play:()=>{x||(D.play(),x=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{D.stop(),x==null||x(),x=void 0}};e.animation=H},d=y=>{var D;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((D=y==null?void 0:y.animationEnable)!=null?D: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)}},fg=Ct;function mg(i,t,e,n=fg.Linear.None){const o=new co(i).to(t,e).easing(n);go(()=>o.start(0));const s=Li(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function pg(i,t){return mg({progress:0},{progress:1},i,t)}var cc=(i=>(i.Move="Move",i.Rotate="Rotate",i))(cc||{}),jt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(jt||{});const Vo=Math.PI*2;function dc(i){return(i%Vo+Vo)%Vo}function hc(i){return i%Vo}function or(i,t,e){return i+(t-i)*e}const sr=(i,t,e)=>{const n=Math.PI,o=n*2;let s=dc(i),r=dc(t);return e===jt.Anticlockwise&&s<r&&(s+=o),e===jt.Clockwise&&r<s&&(r+=o),e===jt.Loop&&r-s>n?sr(s,r,jt.Anticlockwise):e===jt.Loop&&s-r>n?sr(s,r,jt.Clockwise):{from:s,to:r}},gg=i=>{const t={},e=(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,u)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,W({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},s)):u(new Error("unexpected error"))})}),n=s=>{const r=i.state,a=hc(r.latitude),l=hc(s.latitude),{from:c,to:d}=sr(r.longitude,s.longitude,s.rotation||jt.Loop),h=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==ve.Five.Mode.Panorama&&(yield i.changeMode(ve.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,g)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(s);return yield new Promise(m=>{const g=({progress:C})=>{const D={};D.longitude=or(h.longitude,u.longitude,C),D.latitude=or(h.latitude,u.latitude,C),D.fov=or(h.fov,u.fov,C),i.setState(D,!0)},v=()=>{m(!0)},A=()=>{m(!1)},b=s.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=pg(b,Ct.Linear.None).onUpdate(g).onComplete(v).onDestroy(A);s.rotation===jt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(C=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(C)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function uc(i,t){return i.x===t.x&&i.y===t.y}function fc(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 mc(i,t,e){const n=Oo(i[1],i[0]),o=Oo(t[1],t[0]);if(isNaN(n)||isNaN(o)||fc(n,o))return!1;if(Bo(i[0],t))return i[0];if(Bo(i[1],t))return i[1];if(Bo(t[0],i))return t[0];if(Bo(t[1],i))return t[1];if(e&&!vg(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Bo(i,t){return uc(i,t[0])||uc(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&&fc(Oo(t[0],i),Oo(i,t[1]))}function Qo(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function vg(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)&&Qo(t[0],i[1],i[0])*Qo(i[1],t[1],i[0])>0&&Qo(i[0],t[1],t[0])*Qo(t[1],i[1],t[0])>0?1:0}function pc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>pc(i,t-1))}const Ag=`<style type="text/css">
194
+ `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class vm extends de{constructor(t){super(),ce(this,t,gm,pm,le,{content:0},mm)}}function Am(i){me(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function bm(i){let t,e;return t=new fm({props:{url:i[1].url}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ym(i){let t,e;return t=new vm({props:{content:i[0]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function wm(i){let t,e,n,o;const s=[ym,bm],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=V("div"),n&&n.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(n&&(he(),M(r[d],1,1,()=>{r[d]=null}),ue()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null)):n=null)},i(l){o||(k(n),o=!0)},o(l){M(n),o=!1},d(l){l&&_(t),~e&&r[e].d()}}}function Pm(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class kl extends de{constructor(t){super(),ce(this,t,Pm,wm,le,{floorIndex:2,floorplanData:3},Am)}}function Cm(i){me(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Im(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new wo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),O(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&_(n),o&&t.d()}}}function Em(i){let t,e,n=i[1]&&xl(i),o=i[0]&&Dl(i);return{c(){n&&n.c(),t=se(),o&&o.c(),e=Ee()},m(s,r){n&&n.m(s,r),O(s,t,r),o&&o.m(s,r),O(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=xl(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Dl(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&_(t),o&&o.d(s),s&&_(e)}}}function xl(i){let t,e=i[2].name+"",n;return{c(){t=V("span"),n=Be(e),w(t,"class","floorplan-plugin__room-name")},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Re(n,e)},d(o){o&&_(t)}}}function Dl(i){let t,e;return{c(){t=V("span"),e=Be(i[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){O(n,t,o),Q(t,e)},p(n,o){o&128&&Re(e,n[7])},d(n){n&&_(t)}}}function km(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Em;if(a[8])return Im}let s=o(i),r=s&&s(i);return{c(){t=V("div"),r&&r.c(),w(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(n=[Wt($n.call(null,t)),ke(t,"clientWidth",i[19]),ke(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:J,o:J,d(a){a&&_(t),r&&r.d(),e=!1,$e(n)}}}function xm(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],d=t[r][1];l>n!=d>n&&e<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Dm(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function A(G,j){if(j.width===0||j.height===0)return()=>!1;const R=G.path.map(({x:Pe,y:Ae})=>[Pe,Ae]),Z=G.roomLabel.position,{x:q,y:Y}=Z,{width:K,height:ae}=j,oe=K/2,ye=ae/2;return function(Ae){const _e=q*Ae,be=Y*Ae,Fe=R.map(([we,Te])=>[we*Ae,Te*Ae]);return[[_e+oe,be-ye],[_e-oe,be-ye],[_e-oe,be+ye],[_e+oe,be+ye]].every(we=>xm(we,Fe))}}const b=document.body.clientWidth,y=document.body.clientHeight,C=h.roomLabel,D=C.positionInImage.x*100+"%",x=C.positionInImage.y*100+"%",I=(b<500||y<500?10:14)+"px";let T=0,S=0,H=!1;u.subscribe(function(j){e(16,H=!!j&&j.id===h.id)});const X=G=>{e(4,T=G.detail)},N=G=>{e(5,S=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,g=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,v=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:T,height:S}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=v?H?!0:!!(r!=null&&r(l)):!0)},[c,d,h,g,T,S,a,o,n,D,x,I,l,u,m,v,H,r,s,X,N]}class Sm extends de{constructor(t){super(),ce(this,t,Dm,km,le,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Cm)}}function Lm(i){me(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Sl(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ll(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Sl(i,a,c),h=l(d);n.set(h,e[c]=Ml(h,d))}return{c(){t=V("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){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);o=!0,s||(r=[Wt($n.call(null,t)),ke(t,"clientWidth",i[11])],s=!0)},p(c,d){d&447&&(a=c[8],he(),e=xt(e,d,l,1,c,a,n,t,an,Ml,null,Sl),ue())},i(c){if(!o){for(let d=0;d<a.length;d+=1)k(e[d]);o=!0}},o(c){for(let d=0;d<e.length;d+=1)M(e[d]);o=!1},d(c){c&&_(t);for(let d=0;d<e.length;d+=1)e[d].d();s=!1,$e(r)}}}function Ml(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new Sm({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&447?tt(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function Mm(i){let t,e,n=i[8]&&Ll(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&k(n,1)):(n=Ll(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Tm(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const g=v=>{e(6,u=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,d=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,h=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:A}=a.bounding,b=v.x-A.x;e(7,m=u/b)}},[s,r,l,c,d,h,u,m,n,o,a,g]}class zm extends de{constructor(t){super(),ce(this,t,Tm,Mm,le,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Lm)}}function jm(i){me(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Tl(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function zl(i,t,e){const n=i.slice();return n[14]=t[e],n}function jl(i){let t;return{c(){t=V("div"),w(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){O(e,t,n)},p:J,d(e){e&&_(t)}}}function _l(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=V("div"),n=V("div"),s=Be(o),r=se(),w(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),ee(n,"is-row",t[2]),w(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Re(s,o)},d(a){a&&_(e)}}}function _m(i){let t,e,n,o,s,r,a=[],l=new Map,c,d=i[3],h=[];for(let g=0;g<d.length;g+=1)h[g]=jl(zl(i,d,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=Tl(i,u,g),A=m(v);l.set(A,a[g]=_l(A,v))}return{c(){t=V("div"),e=V("div"),n=se(),o=V("div");for(let g=0;g<h.length;g+=1)h[g].c();s=se(),r=V("div");for(let g=0;g<a.length;g+=1)a[g].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),ee(o,"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"),ee(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){O(g,t,v),Q(t,e),Q(t,n),Q(t,o);for(let A=0;A<h.length;A+=1)h[A]&&h[A].m(o,null);Q(t,s),Q(t,r);for(let A=0;A<a.length;A+=1)a[A]&&a[A].m(r,null)},p(g,[v]){if(v&8){d=g[3];let A;for(A=0;A<d.length;A+=1){const b=zl(g,d,A);h[A]?h[A].p(b,v):(h[A]=jl(b),h[A].c(),h[A].m(o,null))}for(;A<h.length;A+=1)h[A].d(1);h.length=d.length}v&22&&(u=g[4],a=xt(a,v,m,1,g,u,l,r,Hs,_l,null,Tl)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&w(t,"class",c),v&5&&ee(t,"is-row",g[2])},i:J,o:J,d(g){g&&_(t),Ft(h,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const ii=1e3,oi=180;function Vm(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(ii-oi)*2,c=s.max.y-s.min.y-(ii-oi)*2,d=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,A)=>v===0?!0:g!==A[v-1]),h=d.map(g=>{const v=a?(g-s.min.x-ii+oi)/l:0,A=a?0:(g-s.min.y-ii+oi)/c;return{left:v,bottom:A}});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((g,v,A)=>{const b=v===0?0:g-A[v-1],y=v===0?0:(g+A[v-1])/2,C=a?(y-s.min.x-ii+oi)/l:0,D=a?0:(y-s.min.y-ii+oi)/c;return{left:C,bottom:D,distance:b}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,o,s]}class Om extends de{constructor(t){super(),ce(this,t,Vm,_m,le,{type:0,data:5,bounding:6,getRuleDistanceText:1},jm)}}function Bm(i){me(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Vl(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Ol(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new Om({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&19?tt(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function Qm(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Vl(i,s,a),c=r(l);n.set(c,e[a]=Ol(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],he(),e=xt(e,l,r,1,a,s,n,t,an,Ol,null,Vl),ue()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Bl=1e3,Ql=180;function Rm(i,t,e){let n,o,s,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,m=A.floorIndex),"floorplanData"in A&&e(6,g=A.floorplanData),"getRuleDistanceText"in A&&e(0,v=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),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-(Bl-Ql)*2),i.$$.dirty&2&&e(8,d=n.max.y-n.min.y-(Bl-Ql)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,u=d/l*100+"%")},[v,n,u,h,r,m,g,l,d,a,c,o,s]}class Gm extends de{constructor(t){super(),ce(this,t,Rm,Qm,le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Bm)}}function jo(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):o!=null&&o[a]?(e+="A"+o[a]+","+d,e):(e+="L"+d,e)}),e+(n?"Z":"")}function Rl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Nm(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 Wm(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function Fm(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Hm(i){let t;return{c(){t=ze("path"),w(t,"d",i[0]),w(t,"fill","#2F313A")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&w(t,"d",e[0])},i:J,o:J,d(e){e&&_(t)}}}function Xm(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=jo(o,{needZ:!0}))},[n,o]}class Ym extends de{constructor(t){super(),ce(this,t,Xm,Hm,le,{path:1})}}function Um(i){let t,e,n,o,s,r;return{c(){t=ze("defs"),e=ze("pattern"),n=ze("rect"),o=ze("path"),s=se(),r=ze("path"),w(n,"x","0"),w(n,"y","0"),w(n,"width",i[1]),w(n,"height",i[1]),w(n,"fill","#323747"),w(o,"d",i[2]),w(o,"stroke","#ffffff"),w(o,"stroke-opacity","0.06"),w(o,"stroke-width","0.5"),w(o,"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){O(a,t,l),Q(t,e),Q(e,n),Q(e,o),O(a,s,l),O(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:J,o:J,d(a){a&&_(t),a&&_(s),a&&_(r)}}}const qs=6;function qm(i,t,e){let n,{path:o}=t;const s=qs*2,r=`M0 ${qs} h ${s} M${qs} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=jo(o,{needZ:!0}))},[n,s,r,o]}class Jm extends de{constructor(t){super(),ce(this,t,qm,Um,le,{path:3})}}function Zm(i){let t,e,n,o,s,r,a,l,c,d,h;return{c(){t=ze("defs"),e=ze("pattern"),n=ze("rect"),o=ze("pattern"),s=ze("rect"),r=se(),a=ze("path"),l=se(),c=ze("path"),d=se(),h=ze("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(s,"x","0"),w(s,"y","0"),w(s,"width","6"),w(s,"height","50"),w(s,"fill","none"),w(s,"stroke","#4B4B57"),w(s,"stroke-width","0.5"),w(o,"id","room-material-pattern-2"),w(o,"x","6"),w(o,"y","25"),w(o,"width","12"),w(o,"height","50"),w(o,"patternUnits","userSpaceOnUse"),w(o,"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){O(u,t,m),Q(t,e),Q(e,n),Q(t,o),Q(o,s),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(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&&_(t),u&&_(r),u&&_(a),u&&_(l),u&&_(c),u&&_(d),u&&_(h)}}}function Km(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=jo(o,{needZ:!0}))},[n,o]}class $m extends de{constructor(t){super(),ce(this,t,Km,Zm,le,{path:1})}}function ep(i){me(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Gl(i,t,e){const n=i.slice();return n[5]=t[e],n}function tp(i){let t,e;return t=new Jm({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function np(i){let t,e;return t=new $m({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function ip(i){let t,e;return t=new Ym({props:{path:i[5].path}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Nl(i){let t,e,n,o;const s=[ip,np,tp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ze("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){O(l,t,c),r[e].m(t,null),o=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(he(),M(r[d],1,1,()=>{r[d]=null}),ue(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null))},i(l){o||(k(n),o=!0)},o(l){M(n),o=!1},d(l){l&&_(t),r[e].d()}}}function op(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Nl(Gl(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){t=V("div");for(let r=0;r<o.length;r+=1)o[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Gl(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=Nl(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){r&&_(t),Ft(o,r)}}}function sp(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>Ie(W({},l),{path:l.path.map(c=>Rl(c,s.bounding))})))},[n,r,a,o,s]}class rp extends de{constructor(t){super(),ce(this,t,sp,op,le,{floorIndex:3,floorplanData:4},ep)}}function ap(i){me(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function lp(i){let t,e,n,o;return{c(){t=ze("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(s,r){O(s,t,r),n||(o=[ke(t,"mouseenter",i[3]),ke(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&w(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&w(t,"id",e)},i:J,o:J,d(s){s&&_(t),n=!1,$e(o)}}}function cp(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function d(){l.set(s)}function h(){l.set(void 0)}const{bounding:u}=a,m=jo(s.path,{needZ:!0,format:g=>Rl(g,u)});return i.$$set=g=>{"room"in g&&e(0,s=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"hoveredRoom"in g&&e(7,l=g.hoveredRoom),"highlightData"in g&&e(8,c=g.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,d,h,m,a,l,c,n]}class dp extends de{constructor(t){super(),ce(this,t,cp,lp,le,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},ap)}}function hp(i){me(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Wl(i,t,e){const n=i.slice();return n[6]=t[e],n}function Fl(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Ue(r,s[a]);return n=new dp({props:r}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(n,a,l),o=!0},p(a,l){t=a;const c=l&15?tt(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(k(n.$$.fragment,a),o=!0)},o(a){M(n.$$.fragment,a),o=!1},d(a){a&&_(e),ne(n,a)}}}function up(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Wl(i,r,l),d=a(c);o.set(d,n[l]=Fl(d,c))}return{c(){t=V("div"),e=ze("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){O(l,t,c),Q(t,e);for(let d=0;d<n.length;d+=1)n[d]&&n[d].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,he(),n=xt(n,c,a,1,l,r,o,e,an,Fl,null,Wl),ue())},i(l){if(!s){for(let c=0;c<r.length;c+=1)k(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)M(n[c]);s=!1},d(l){l&&_(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function fp(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Hl extends de{constructor(t){super(),ce(this,t,fp,up,le,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},hp)}}function mp(i){me(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xl(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Hl({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&24834?tt(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Yl(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new zm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&22370?tt(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Ul(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Gm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2306?tt(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function pp(i){let t,e,n,o,s,r,a,l,c;const d=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let b=0;b<d.length;b+=1)h=Ue(h,d[b]);e=new rp({props:h});let u=(i[2]||i[3])&&Xl(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let b=0;b<m.length;b+=1)g=Ue(g,m[b]);s=new kl({props:g});let v=i[4]&&Yl(i),A=i[7]&&Ul(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),u&&u.c(),o=se(),ie(s.$$.fragment),r=se(),v&&v.c(),a=se(),A&&A.c(),w(t,"class",l=Oe(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(b,y){O(b,t,y),te(e,t,null),Q(t,n),u&&u.m(t,null),Q(t,o),te(s,t,null),Q(t,r),v&&v.m(t,null),Q(t,a),A&&A.m(t,null),c=!0},p(b,[y]){const C=y&258?tt(d,[{floorIndex:b[1],floorplanData:b[8]}]):{};e.$set(C),b[2]||b[3]?u?(u.p(b,y),y&12&&k(u,1)):(u=Xl(b),u.c(),k(u,1),u.m(t,o)):u&&(he(),M(u,1,1,()=>{u=null}),ue());const D=y&258?tt(m,[{floorplanData:b[8],floorIndex:b[1]}]):{};s.$set(D),b[4]?v?(v.p(b,y),y&16&&k(v,1)):(v=Yl(b),v.c(),k(v,1),v.m(t,a)):v&&(he(),M(v,1,1,()=>{v=null}),ue()),b[7]?A?(A.p(b,y),y&128&&k(A,1)):(A=Ul(b),A.c(),k(A,1),A.m(t,null)):A&&(he(),M(A,1,1,()=>{A=null}),ue()),(!c||y&1&&l!==(l=Oe(`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(s.$$.fragment,b),k(v),k(A),c=!0)},o(b){M(e.$$.fragment,b),M(u),M(s.$$.fragment,b),M(v),M(A),c=!1},d(b){b&&_(t),ne(e),u&&u.d(),ne(s),v&&v.d(),A&&A.d()}}}function gp(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:A}=t;const b=Us(void 0);return i.$$set=y=>{"isCurrent"in y&&e(0,n=y.isCurrent),"floorIndex"in y&&e(1,o=y.floorIndex),"highlightEnable"in y&&e(2,s=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,g=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,v=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,A=y.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,g,v,A,b]}let vp=class extends de{constructor(t){super(),ce(this,t,gp,pp,le,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},mp)}};function Ap(i){me(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ql(i,t,e){const n=i.slice();return n[21]=t[e],n}function Jl(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Zl(ql(i,r,h));const l=h=>M(a[h],1,1,()=>{a[h]=null});let c=i[5]&&Kl(i),d=i[8]&&$l(i);return{c(){t=V("div");for(let h=0;h<a.length;h+=1)a[h].c();e=se(),c&&c.c(),n=se(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);Q(t,e),c&&c.m(t,null),Q(t,n),d&&d.m(t,null),s=!0},p(h,u){if(i=h,u&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=ql(i,r,m);a[m]?(a[m].p(g,u),k(a[m],1)):(a[m]=Zl(g),a[m].c(),k(a[m],1),a[m].m(t,e))}for(he(),m=r.length;m<a.length;m+=1)l(m);ue()}i[5]?c?(c.p(i,u),u&32&&k(c,1)):(c=Kl(i),c.c(),k(c,1),c.m(t,n)):c&&(he(),M(c,1,1,()=>{c=null}),ue()),i[8]?d?(d.p(i,u),u&256&&k(d,1)):(d=$l(i),d.c(),k(d,1),d.m(t,null)):d&&(he(),M(d,1,1,()=>{d=null}),ue())},i(h){if(!s){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),o||et(()=>{o=vn(t,An,{duration:i[0],easing:tn}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)M(a[u]);M(c),M(d),s=!1},d(h){h&&_(t),Ft(a,h),c&&c.d(),d&&d.d()}}}function Zl(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new vp({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&2047696?tt(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Kl(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new nm({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&57352?tt(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function $l(i){let t,e;return t=new cm({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function bp(i){let t,e,n=i[1]&&Jl(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=Jl(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function yp(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:v}=t,{floorplanData:A}=t,{lastPanoramaLongitude:b}=t,{cameraImageUrl:y}=t,{getRoomAreaText:C}=t,{getLabelElement:D}=t,{getRuleDistanceText:x}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:T}=t;return i.$$set=S=>{"duration"in S&&e(0,n=S.duration),"visible"in S&&e(1,o=S.visible),"northDesc"in S&&e(2,s=S.northDesc),"panoIndex"in S&&e(3,r=S.panoIndex),"floorIndex"in S&&e(4,a=S.floorIndex),"cameraEnable"in S&&e(5,l=S.cameraEnable),"hoverEnable"in S&&e(6,c=S.hoverEnable),"highlightEnable"in S&&e(7,d=S.highlightEnable),"compassEnable"in S&&e(8,h=S.compassEnable),"roomLabelsEnable"in S&&e(9,u=S.roomLabelsEnable),"roomAreaEnable"in S&&e(10,m=S.roomAreaEnable),"roomNameEnable"in S&&e(11,g=S.roomNameEnable),"ruleLabelsEnable"in S&&e(12,v=S.ruleLabelsEnable),"floorplanData"in S&&e(13,A=S.floorplanData),"lastPanoramaLongitude"in S&&e(14,b=S.lastPanoramaLongitude),"cameraImageUrl"in S&&e(15,y=S.cameraImageUrl),"getRoomAreaText"in S&&e(16,C=S.getRoomAreaText),"getLabelElement"in S&&e(17,D=S.getLabelElement),"getRuleDistanceText"in S&&e(18,x=S.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in S&&e(19,I=S.adaptiveRoomLabelVisibleEnable),"highlightData"in S&&e(20,T=S.highlightData)},[n,o,s,r,a,l,c,d,h,u,m,g,v,A,b,y,C,D,x,I,T]}let Js=class extends de{constructor(t){super(),ce(this,t,yp,bp,le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Ap)}};const wp="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 Pp(i){return U(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return U(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Cp(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 Ip(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Cp),rules:i.rules}}function Ep(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 dn(i){return U(this,null,function*(){const t=yield Pp(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ip),o=i.computed_data.entrance?kp(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ep)}})}function xp(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:wp,width:45,height:48},a=Fm(s,t),l=Nm(s,e),c=Wm(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Dp(i,t){return t(i),i}function _o(i,t){return Dp({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ec(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 Zs(i,t,e=ln.BOUNDING_CENTER){const n=ec(i,t),o=ec(i,t+1);return e===ln.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===ln.CEILING?o:n}function Ks(i,t,e,n){const o=Zs(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let zi=class{constructor(t,e){f(this,"VERSION","2.16.0-14");f(this,"five");f(this,"hooks",new On);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return Ts(t)?t:`${this.staticPrefix}${t}`}},bn=class extends zi{};var vt=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(vt||{});const tc=500,Sp=80;function $s(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function er(i,t){return U(this,null,function*(){const[e]=yield ei(i.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{i.once("initAnimationWillStart",()=>{i.once("initAnimationEnded",()=>r())})});const n=t[1];if(!n)return!0;const o=i.getCurrentState();if(!Lp(n,o))throw new Error("pose 与预期不符")})}function Lp(i,t){return Object.keys(i).every(e=>{const n=t[e];if(n===void 0)return!0;const o=i[e];return typeof n=="number"&&typeof o=="number"?$s(n,o,2):n===o})}function tr(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!$s(e,s,2)||!$s(n,r,2)||o!==a)}function nc(i,t,e=!0){return U(this,null,function*(){if(tr(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[d]=yield ei(er(i,[t.mode,t,void 0,e]));if(d)throw new Error(vt.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ei(i.updateCamera(t,l,e));if(c)throw new Error(vt.UpdateCameraError)})}function si(i,t,e=300){const n=i.getElement();n&&(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Mp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Tp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let zp=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 o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!tr(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,vt.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(vt.ModelNotLoaded);if(!this.data)throw new Error(vt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ei(nc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(vt.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:tc;si(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,vt.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);si(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Tp(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Mp(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Sp/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const jp=(i,t)=>new zp(i,t);function _p(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Vp(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}let Op=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 o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>U(this,[...n],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!tr(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,vt.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>U(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(vt.ModelNotLoaded);if(!this.data)throw new Error(vt.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=W(W({},n),e),s=()=>U(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield ei(nc(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(vt.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const d=o.modelOpacity,h=o.immediately?0:tc;si(this.five,d,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,vt.BreakOffByHide),this.showPromise=void 0;const o=W(W({},{userAction:!0,isAutoHide:!1}),e);si(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),_p(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Vp(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Zs(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const Bp=(i,t)=>new Op(i,t);let Qp=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,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Ks(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;(n=this.five)!=null&&n.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const o={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:cn,attachedTo:ln.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},s=n?_o(n,["selector","scale"]):{},r=W(W({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return U(this,null,function*(){function s(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield dn(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Zs(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_show(e){return U(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield er(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;si(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return U(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;si(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?W(W({},o.config),e.config):o.config;this.state=Ie(W(W({},this.state),e),{config:s}),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=Ie(W({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Js({target:this.container,intro:!0,props:n})}};const Rp=(i,t)=>new Qp(i,t);function nr(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Gp(i){me(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Np(i){let t,e,n;return{c(){t=V("div"),e=V("div"),n=V("div"),w(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||cn)+")"),z(n,"transform",i[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){O(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||cn)+")"),(s&1||s&3)&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:J,o:J,d(o){o&&_(t)}}}function Wp(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Fp(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,d=s.getCurrentState().longitude;function h(g,v){const A=g.bounding,b=g.observers[v];if(!b)return"";const y=(A.max.x-A.min.x)*r,C=(A.max.y-A.min.y)*r,D=Math.floor(b.positionInImage.x*y),x=Math.floor(b.positionInImage.y*C);return`translate(${D}px, ${x}px)`}function u(g){e(6,c=g)}const m=nr(g=>{e(7,d=g.longitude)},1e3/60);return kt(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=Wp(d))},[l,o,n,s,r,a,c,d]}class Hp extends de{constructor(t){super(),ce(this,t,Fp,Np,le,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Gp)}}function Xp(i){me(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function ic(i,t,e){const n=i.slice();return n[1]=t[e],n}function oc(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=V("div"),n=V("div"),r=se(),w(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),w(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,d){O(c,e,d),Q(e,n),Q(e,r)},p(c,d){t=c,d&1&&z(n,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&z(n,"width",o),h&&z(n,"height",s),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&_(e)}}}function Yp(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=ic(i,o,r),l=s(a);n.set(l,e[r]=oc(l,a))}return{c(){t=V("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){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=xt(e,a,s,1,r,o,n,t,Hs,oc,null,ic))},i:J,o:J,d(r){r&&_(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Up(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class qp extends de{constructor(t){super(),ce(this,t,Up,Yp,le,{extraObjects:0},Xp)}}function sc(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5]}];let o={};for(let s=0;s<n.length;s+=1)o=Ue(o,n[s]);return t=new Hl({props:o}),{c(){ie(t.$$.fragment)},m(s,r){te(t,s,r),e=!0},p(s,r){const a=r&183?tt(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5]}]):{};t.$set(a)},i(s){e||(k(t.$$.fragment,s),e=!0)},o(s){M(t.$$.fragment,s),e=!1},d(s){ne(t,s)}}}function Jp(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let d=0;d<a.length;d+=1)l=Ue(l,a[d]);t=new kl({props:l}),n=new qp({props:{extraObjects:i[6]}});let c=i[3]&&sc(i);return{c(){ie(t.$$.fragment),e=se(),ie(n.$$.fragment),o=se(),c&&c.c(),s=Ee()},m(d,h){te(t,d,h),O(d,e,h),te(n,d,h),O(d,o,h),c&&c.m(d,h),O(d,s,h),r=!0},p(d,[h]){const u=h&20?tt(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=sc(d),c.c(),k(c,1),c.m(s.parentNode,s)):c&&(he(),M(c,1,1,()=>{c=null}),ue())},i(d){r||(k(t.$$.fragment,d),k(n.$$.fragment,d),k(c),r=!0)},o(d){M(t.$$.fragment,d),M(n.$$.fragment,d),M(c),r=!1},d(d){ne(t,d),d&&_(e),ne(n,d),d&&_(o),c&&c.d(d),d&&_(s)}}}function Zp(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return i.$$set=u=>{"five"in u&&e(0,o=u.five),"pxmm"in u&&e(1,s=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(u=>u.floorIndex===r))},[o,s,r,a,l,d,n,h,c]}class Kp extends de{constructor(t){super(),ce(this,t,Zp,Jp,le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function $p(i){me(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function rc(i){let t,e,n,o,s=i[7]!==0&&ac(i);return{c(){t=V("div"),s&&s.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),s&&s.m(t,null),e=!0,n||(o=[Wt($n.call(null,t)),ke(t,"clientWidth",i[13]),ke(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&k(s,1)):(s=ac(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),M(s,1,1,()=>{s=null}),ue())},i(r){e||(k(s),e=!0)},o(r){M(s),e=!1},d(r){r&&_(t),s&&s.d(),n=!1,$e(o)}}}function ac(i){let t,e,n,o,s=`${i[9]}px`,r=`${i[12]}px`,a;const l=[{five:i[0],pxmm:i[10],floorIndex:i[11],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5],highlightData:i[6]}];let c={};for(let u=0;u<l.length;u+=1)c=Ue(c,l[u]);e=new Kp({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=Ue(h,d[u]);return o=new Hp({props:h}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),ie(o.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(u,m){O(u,t,m),te(e,t,null),Q(t,n),te(o,t,null),a=!0},p(u,m){const g=m&3181?tt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(g);const v=m&1049?tt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&512&&s!==(s=`${u[9]}px`)&&z(t,"width",s),m&4096&&r!==(r=`${u[12]}px`)&&z(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(o.$$.fragment,u),a=!0)},o(u){M(e.$$.fragment,u),M(o.$$.fragment,u),a=!1},d(u){u&&_(t),ne(e),ne(o)}}}function eg(i){let t,e,n=i[1]&&rc(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=rc(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function tg(i,t,e){var C,D;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(D=(C=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:C.floorIndex)!=null?D:0,u=0,m=0,g=0,v=0;function A(x){e(11,h=n.work.observers[x].floorIndex)}kt(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));const b=x=>{e(7,u=x.detail)},y=x=>{e(8,m=x.detail)};return i.$$set=x=>{"five"in x&&e(0,n=x.five),"visible"in x&&e(1,o=x.visible),"hoverEnable"in x&&e(2,s=x.hoverEnable),"floorplanData"in x&&e(3,r=x.floorplanData),"cameraImageUrl"in x&&e(4,a=x.cameraImageUrl),"extraObjects"in x&&e(5,l=x.extraObjects),"highlightData"in x&&e(6,c=x.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const x=Math.min(u,m),{max:I,min:T}=r.bounding,S=I.x-T.x,H=I.y-T.y,X=function(){return S>H?[x,x/S*H]:[x/H*S,x]}();e(9,g=X[0]),e(12,v=X[1]),e(10,d=g/S)}},[n,o,s,r,a,l,c,u,m,g,d,h,v,b,y]}class ng extends de{constructor(t){super(),ce(this,t,tg,eg,le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},$p)}}let ig=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 o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:cn},s=n!=null&&n.configs?n.configs:{},r=W(W({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return U(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield dn(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return U(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return U(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=xp(e,this.five,this.data),this.render())}formatData(e){return U(this,null,function*(){return yield dn(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=W(W({},this.state),e),!zt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=Ie(W({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new ng({target:this.wrapper,props:e})}};const og=(i,t)=>new ig(i,t),sg=[{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:"和室"}],rg=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],ag=[{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:"写字楼"}],ir=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},lg=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ir(o,0,0)),s&&i.applyMatrix4(ir(0,s,0)),r&&i.applyMatrix4(ir(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function lc(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=W({map:o.material.map||{}},t);o.material=new B.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const cg=(i,t)=>{var d;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(d=t.north_rad)!=null?d:void 0,o={},s=h=>U(this,null,function*(){var 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 g=i.model.bounding,v=g.max.x-g.min.x,A=g.max.z-g.min.z,b=Math.max(v,A),C=yield new so.FBXLoader().loadAsync(u);lc(C,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const D=[0,m-Math.PI/2,0],{model:{bounding:{max:{x,z:I},min:{x:T,y:S,z:H}}}}=i;o.yBase=S;const X={x:(x+T)/2,y:S-1.6,z:(I+H)/2},N=.0045*b;return lg(C,{position:X,rotation:D,scale:N}),o.object=C,!0}),r=({latitude:h})=>{if(!o.object)return;const u=a(h);u&&(o.object.position.y=u)},a=h=>{if(o.yBase===void 0)return;const u=.6;if(h>=Math.PI/4)return o.yBase-(u+1.6);const m=h*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{o.object&&(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function dg(i,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "微软雅黑"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new B.CanvasTexture(a)}const hg=({x:i,y:t,z:e})=>new B.Vector3(i,t,e),ug=(i,t)=>{var v,A,b;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(A=t.position)!=null?A:void 0,s=(b=t.rad)!=null?b:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>U(this,null,function*(){var X,N,G,j,R,Z,q,Y;const C=(X=y==null?void 0:y.position)!=null?X:o;if(!C)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const D=hg(C),x=(N=y==null?void 0:y.rad)!=null?N:s,I=(G=y==null?void 0:y.fbx_url)!=null?G:r;if(e.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const T=yield new so.FBXLoader().loadAsync(I);T.position.copy(D),T.rotation.z=x,T.scale.set(.8,.8,.8),lc(T,{transparent:!0,side:E.DoubleSide});const S=(q=(Z=(R=(j=T.children)==null?void 0:j[0])==null?void 0:R.children)==null?void 0:Z[3])==null?void 0:q.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const H=(Y=t.name)!=null?Y:"入户门";return S.material=new B.MeshBasicMaterial({transparent:!0,map:dg(H)}),S.renderOrder=3,T.children[0].add(S),e.object=T,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,C=new B.AnimationMixer(e.object);a.push(C);const D=C.clipAction(e.object.animations[0]);D.timeScale=y;let x;const I=()=>{let X=0,N=0;const G=1e3/30,j=R=>{X=requestAnimationFrame(j);const Z=R-N;Z<G||(N=R,a.forEach(q=>q.update(Z/1e3)),i.needsRender=!0)};return X=requestAnimationFrame(j),()=>{cancelAnimationFrame(X)}},H={play:()=>{x||(D.play(),x=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{D.stop(),x==null||x(),x=void 0}};e.animation=H},d=y=>{var D;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((D=y==null?void 0:y.animationEnable)!=null?D: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)}},fg=Ct;function mg(i,t,e,n=fg.Linear.None){const o=new co(i).to(t,e).easing(n);go(()=>o.start(0));const s=Li(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function pg(i,t){return mg({progress:0},{progress:1},i,t)}var cc=(i=>(i.Move="Move",i.Rotate="Rotate",i))(cc||{}),jt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(jt||{});const Vo=Math.PI*2;function dc(i){return(i%Vo+Vo)%Vo}function hc(i){return i%Vo}function or(i,t,e){return i+(t-i)*e}const sr=(i,t,e)=>{const n=Math.PI,o=n*2;let s=dc(i),r=dc(t);return e===jt.Anticlockwise&&s<r&&(s+=o),e===jt.Clockwise&&r<s&&(r+=o),e===jt.Loop&&r-s>n?sr(s,r,jt.Anticlockwise):e===jt.Loop&&s-r>n?sr(s,r,jt.Clockwise):{from:s,to:r}},gg=i=>{const t={},e=(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,u)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,W({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},s)):u(new Error("unexpected error"))})}),n=s=>{const r=i.state,a=hc(r.latitude),l=hc(s.latitude),{from:c,to:d}=sr(r.longitude,s.longitude,s.rotation||jt.Loop),h=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>U(this,[l,c,...d],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==ve.Five.Mode.Panorama&&(yield i.changeMode(ve.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,g)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=n(s);return yield new Promise(m=>{const g=({progress:C})=>{const D={};D.longitude=or(h.longitude,u.longitude,C),D.latitude=or(h.latitude,u.latitude,C),D.fov=or(h.fov,u.fov,C),i.setState(D,!0)},v=()=>{m(!0)},A=()=>{m(!1)},b=s.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=pg(b,Ct.Linear.None).onUpdate(g).onComplete(v).onDestroy(A);s.rotation===jt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(C=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(C)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function uc(i,t){return i.x===t.x&&i.y===t.y}function fc(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 mc(i,t,e){const n=Oo(i[1],i[0]),o=Oo(t[1],t[0]);if(isNaN(n)||isNaN(o)||fc(n,o))return!1;if(Bo(i[0],t))return i[0];if(Bo(i[1],t))return i[1];if(Bo(t[0],i))return t[0];if(Bo(t[1],i))return t[1];if(e&&!vg(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Bo(i,t){return uc(i,t[0])||uc(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&&fc(Oo(t[0],i),Oo(i,t[1]))}function Qo(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function vg(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)&&Qo(t[0],i[1],i[0])*Qo(i[1],t[1],i[0])>0&&Qo(i[0],t[1],t[0])*Qo(t[1],i[1],t[0])>0?1:0}function pc(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>pc(i,t-1))}const Ag=`<style type="text/css">
195
195
  .PanoRulerPlugin-rule-line {
196
196
  position: absolute;
197
197
  transform-origin: left center;
@@ -284,7 +284,7 @@ void main() {
284
284
  <div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(A)}</div>
285
285
  </div>
286
286
  </div>
287
- `,y=document.createElement("div");return y.setAttribute("class","PanoRulerPlugin-rule"),y.setAttribute("data-name",v),y.setAttribute("style","display: none"),y.innerHTML=b,y},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Ag,o.appendChild(s);const r={},a=(v,A)=>{if(e.loaded)throw new Error("标尺被重复初始化!");const b=yg(v,i),y=i.work;if(!y)return!1;for(const C in A){const D=A[C],{standingPosition:x}=y.observers[0],I=D.map(({x:T,z:S,observers:H})=>{const X=H.length>0?v.rooms[v.observers[H[0]]].name:"",N=b[X]?b[X].floor:null;let G=1/0,j={index:0,x:x.x,y:x.y,z:x.z};H.forEach(ae=>{if(!y.observers[ae])return;const{standingPosition:oe}=y.observers[ae],ye={index:ae,x:oe.x,y:oe.y,z:oe.z},Pe=bg({x:T,z:S},ye);N?Pe<G&&Math.abs(ye.y-N)<.3&&(G=Pe,j=ye):Pe<G&&(G=Pe,j=ye)});const R=new B.Vector3(T,j.y,S);Object.assign(R,{observers:H});const Z=b[X]?b[X].roof:null,q=Z?new B.Vector3(T,Z,S):null;return q&&Object.assign(q,{observers:H}),{origin:R,vertical:q}});r[C]={origins:I.map(T=>T.origin),rules:[]};for(const{origin:T,vertical:S}of I){if(!S)continue;const H=n(C,T.distanceTo(S));o.append(H),r[C].rules.push({vertical:!0,rule:[T,S],$element:H})}for(let T=0;T<I.length;T++){let S=T+1;S>=I.length&&(S=0);const{origin:H}=I[T],{origin:X}=I[S],N=n(C,H.distanceTo(X));o.append(N),r[C].rules.push({vertical:!1,rule:[H,X],$element:N})}}return e.loaded=!0,!0},l=(v,A,b)=>U(this,null,function*(){const y=v||t.roomInfo,C=A||t.roomRules;if(!y||!C)throw new Error("标尺数据依赖不齐全!");return e.loaded=!1,e.options=W(W({},e.options),b||{}),i.model.loaded?a(y,C):yield new Promise(D=>i.once("modelLoaded",()=>D(a(y,C))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,A,b,y)=>{const C=[[{x:0,y:0},{x:b,y:0}],[{x:0,y:0},{x:0,y}],[{x:b,y:0},{x:b,y}],[{x:0,y},{x:b,y}]],D=[];for(let x=0;x<C.length;x++){const I=mc([v,A],[C[x][0],C[x][1]],!0);I&&D.push(I)}return D.length===0?!1:D},d=()=>{var H;const v=(H=i.getElement())==null?void 0:H.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:b,currentMode:y}=i;if(A===void 0)return;let C;for(const X in r)X.split(",").indexOf(A.toString())>=0&&(C=X);if(!C){for(const X in r)for(const{$element:N}of r[X].rules)N.style.display="none";return}const D=b.position,x=b.getWorldDirection(new B.Vector3),I=v.clientWidth,T=v.clientHeight;if(y!==ve.Five.Mode.Panorama){for(const X in r)for(const{$element:N}of r[X].rules)N.style.display="none";return}for(const X in r)for(const{$element:N}of r[X].rules)N.style.display=X===C?"block":"none";const[S]=r[C].origins.slice().filter(X=>X.observers.indexOf(A)>=0).sort((X,N)=>{const G=X.clone().setY(0).sub(D).normalize().angleTo(x.clone().setY(0)),j=N.clone().setY(0).sub(D).normalize().angleTo(x.clone().setY(0));return G-j});for(const{rule:X,vertical:N,$element:G}of r[C].rules){const[j,R]=X,Z=G.querySelector(".PanoRulerPlugin-rule-line");if(!Z)return;if(!S){G.style.display="none";continue}if(j!==S&&R!==S){G.style.display="none";continue}if(j.distanceTo(R)<.3){G.style.display="none";continue}if(j.observers.indexOf(A)===-1||R.observers.indexOf(A)===-1){G.style.display="none";continue}if(j.clone().sub(D).normalize().angleTo(x)>Math.PI/2){G.style.display="none";continue}if(R.clone().sub(D).normalize().angleTo(x)>Math.PI/2){G.style.display="none";continue}const K=j.distanceTo(R);if(R.clone().sub(R.clone().sub(j).divide(new B.Vector3(2,2,2))).distanceTo(D)/K>8){G.style.display="none";continue}const ye=j.clone().project(b),Pe=(ye.x+1)/2*I,Ae=(-ye.y+1)/2*T,_e=R.clone().project(b),be=(_e.x+1)/2*I,Fe=(-_e.y+1)/2*T,fe=Math.sqrt(Math.pow(be-Pe,2)+Math.pow(Fe-Ae,2));let we=fe,Te=50;const pe=c({x:~~Pe,y:~~Ae},{x:~~be,y:~~Fe},I,T);if(pe&&pe.length===1&&(S===j?(we=Math.sqrt(Math.pow(pe[0].x-Pe,2)+Math.pow(pe[0].y-Ae,2)),Te=we/fe*50):S===R&&(we=Math.sqrt(Math.pow(pe[0].x-be,2)+Math.pow(pe[0].y-Fe,2)),Te=100-we/fe*50)),pe&&pe.length===2){const re={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};Te=Math.sqrt(Math.pow(re.x-Pe,2)+Math.pow(re.y-Ae,2))/fe*100}const dt=(Math.PI/2-Math.atan2(be-Pe,Ae-Fe))/Math.PI*180,De=Z.querySelector(".PanoRulerPlugin-rule-label"),st=De.children[0].clientWidth;st>=fe||st/2>=Te/100*fe||st/2>=(1-Te/100)*fe?Z.style.display="none":(Z.style.display="block",Z.style.width=fe+"px",Z.style.left=Pe+"px",Z.style.top=Ae+"px",Z.style.transform=`rotate(${-dt}deg)`,De.style.left=`${Te}%`)}},h=()=>pc(d),u=()=>{var v,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(v=i.getElement())==null?void 0:v.parentElement)==null||A.append(o),d(),i.on("modeChange",d),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",d),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const A=v.distanceText;e.options.distanceText=A,Object.values(r).forEach(b=>{b.rules.forEach(y=>{const[C,D]=y.rule,x=C.distanceTo(D),I=y.$element.querySelector(".PanoRulerPlugin-rule-label-name");I&&(I.innerText=A(x))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function Pg(i){me(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function gc(i,t,e){const n=i.slice();return n[6]=t[e],n}function Cg(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=vc(gc(i,e,o));return{c(){t=V("div");for(let o=0;o<n.length;o+=1)n[o].c();w(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){O(o,t,s);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=gc(o,e,r);n[r]?n[r].p(a,s):(n[r]=vc(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&_(t),Ft(n,o)}}}function Ig(i){let t,e;return{c(){t=V("em"),w(t,"class",e=Oe(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),w(t,"style",i[3])},m(n,o){O(n,t,o)},p(n,o){o&1&&e!==(e=Oe(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&w(t,"class",e),o&8&&w(t,"style",n[3])},d(n){n&&_(t)}}}function vc(i){let t,e,n=`${i[6].width}px`;return{c(){t=V("div"),w(t,"class",e=Oe(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),w(t,"style",i[3]),z(t,"width",n)},m(o,s){O(o,t,s)},p(o,s){s&1&&e!==(e=Oe(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&w(t,"class",e),s&8&&w(t,"style",o[3]),(s&8||s&9&&n!==(n=`${o[6].width}px`))&&z(t,"width",n)},d(o){o&&_(t)}}}function Eg(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,d=`${i[0].left}px`,h=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(A,b){return A[0].children.length===0?Ig:Cg}let g=m(i),v=g(i);return{c(){t=V("div"),v.c(),e=se(),n=V("div"),o=V("div"),r=Be(s),w(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),et(()=>i[4].call(o)),w(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),z(n,"left",l),w(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),z(t,"width",c),z(t,"left",d),z(t,"top",h),z(t,"transform",u),z(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,b){O(A,t,b),v.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=yo(o,i[4].bind(o))},p(A,[b]){g===(g=m(A))&&v?v.p(A,b):(v.d(1),v=g(A),v&&(v.c(),v.m(t,e))),b&1&&s!==(s=A[0].labelElement+"")&&Re(r,s),b&1&&l!==(l=`${A[0].labelOffset}%`)&&z(n,"left",l),b&1&&c!==(c=`${A[0].width}px`)&&z(t,"width",c),b&1&&d!==(d=`${A[0].left}px`)&&z(t,"left",d),b&1&&h!==(h=`${A[0].top}px`)&&z(t,"top",h),b&1&&u!==(u=`rotate(${A[0].rotateDeg}deg)`)&&z(t,"transform",u),b&5&&z(t,"display",A[0].visible&&A[2]?"block":"none")},i:J,o:J,d(A){A&&_(t),v.d(),a()}}}function kg(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class xg extends de{constructor(t){super(),ce(this,t,kg,Eg,le,{rulerItemProp:0},Pg)}}function Ac(i,t,e){const n=i.slice();return n[12]=t[e],n}function bc(i){let t,e;return t=new xg({props:{rulerItemProp:i[12]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Dg(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=bc(Ac(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){t=V("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){O(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Ac(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=bc(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){r&&_(t),Ft(o,r)}}}function Sg(i,t,e){var v,A,b,y;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:A.clientWidth)||0,l=((y=(b=n.getElement())==null?void 0:b.parentElement)==null?void 0:y.clientHeight)||0,c=(C,D)=>{const x=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],I=[];for(let T=0;T<x.length;T++){const S=mc([C,D],[x[T][0],x[T][1]],!0);S&&I.push(S)}return I.length===0?!1:I},d=(C,D)=>{const x=C.clone().project(n.camera),I=(x.x+1)/2*a,T=(-x.y+1)/2*l,S=D.clone().project(n.camera),H=(S.x+1)/2*a,X=(-S.y+1)/2*l,N=Math.sqrt(Math.pow(H-I,2)+Math.pow(X-T,2));return{startLeft:I,startTop:T,endLeft:H,endTop:X,distance:N}},h=(C,D,x)=>{const I=n.camera.position,T=n.camera.getWorldDirection(new B.Vector3),S=C.clone().sub(I).normalize().angleTo(T),H=D.clone().sub(I).normalize().angleTo(T),X=C.distanceTo(D),G=D.clone().sub(D.clone().sub(C).divide(new B.Vector3(2,2,2))).distanceTo(I),{startLeft:j,startTop:R,endLeft:Z,endTop:q,distance:Y}=d(C,D),ae=-((Math.PI/2-Math.atan2(Z-j,R-q))/Math.PI)*180;let oe=!0;x||(oe=!1),!zt(C,x)&&!zt(D,x)&&(oe=!1),X<.3&&(oe=!1),S>Math.PI/2&&(oe=!1),H>Math.PI/2&&(oe=!1),G/X>8&&(oe=!1);let ye=50,Pe=Y;const Ae=c({x:~~j,y:~~R},{x:~~Z,y:~~q});if(Ae&&Ae.length===1&&(zt(C,x)?(Pe=Math.sqrt(Math.pow(Ae[0].x-j,2)+Math.pow(Ae[0].y-R,2)),ye=Pe/Y*50):zt(D,x)&&(Pe=Math.sqrt(Math.pow(Ae[0].x-Z,2)+Math.pow(Ae[0].y-q,2)),ye=100-Pe/Y*50)),Ae&&Ae.length===2){const _e={x:(Ae[0].x+Ae[1].x)/2,y:(Ae[0].y+Ae[1].y)/2};ye=Math.sqrt(Math.pow(_e.x-j,2)+Math.pow(_e.y-R,2))/Y*100}return{startLeft:j,startTop:R,distance:Y,deg:ae,visible:oe,labelOffset:ye,ruleLength:X}},u=()=>{const C=n.panoIndex,D=o.find(N=>N.panoIndex===C);if(!D)return e(0,r=[]);if(n.currentMode!==ve.Five.Mode.Panorama)return e(0,r=[]);const x=n.camera.position,I=n.camera.getWorldDirection(new B.Vector3),T=D.lines.map(N=>new B.Vector3(N.start[0],-N.start[1],-N.start[2])),S=D.lines.map(N=>new B.Vector3(N.end[0],-N.end[1],-N.end[2])),[H]=T.concat(S).sort((N,G)=>{const j=N.clone().setY(0).sub(x).normalize().angleTo(I.clone().setY(0)),R=G.clone().setY(0).sub(x).normalize().angleTo(I.clone().setY(0));return j-R}),X=D.lines.map(N=>{var Pe,Ae;const G=N.start,j=N.end,{startLeft:R,startTop:Z,distance:q,deg:Y,visible:K,labelOffset:ae,ruleLength:oe}=h(new B.Vector3(G[0],-G[1],-G[2]),new B.Vector3(j[0],-j[1],-j[2]),H),ye=[];return N.children&&((Pe=N.children)==null?void 0:Pe.length)>0&&((Ae=N.children)==null||Ae.forEach(_e=>{const be=_e.start,Fe=_e.end,{distance:fe}=d(new B.Vector3(be[0],-be[1],-be[2]),new B.Vector3(Fe[0],-Fe[1],-Fe[2]));ye.push({width:fe,state:_e.state})})),{width:q,left:R,top:Z,rotateDeg:Y,state:N.state,children:ye,labelOffset:ae,visible:K,labelElement:s.distanceText(oe)}});e(0,r=X)},m=()=>go(u),g=nr(u,80);return kt(()=>{u(),n.on("panoArrived",u),n.on("modeChange",u),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),on(()=>{n.off("panoArrived",u),n.off("modeChange",u),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=C=>{"five"in C&&e(1,n=C.five),"rulerDatas"in C&&e(2,o=C.rulerDatas),"options"in C&&e(3,s=C.options)},[r,n,o,s]}class Lg extends de{constructor(t){super(),ce(this,t,Sg,Dg,le,{five:1,rulerDatas:2,options:3})}}let Mg=class{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=W(W({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>U(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return U(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return U(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Lg({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}};const Tg=(i,t)=>new Mg(i,t),zg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAGfvXS06Zc5CFCePQt0y3EFaq61CX1ayjC56U8br24sKd+kAuJhkI55OSPi75pyIcvKNIEFgcgRDJ4hD3ewMZLDwDXqfOq9RNFCYOCAMPYx851BDjIXiWzky9Tpyvw0kOL/nc+Jh7DyGqko+P+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsxknztsDUnFvMfF8e+4X6j88F4hlTDT3de6BiAYsI0HgxgiESG4MYd8XkLEhrARZTKUxUWB0MXrkiA3wdYYQg8Xs2cmzaR977cCE8eSM6wYDsQiXSyOrulDPRUT3AbsxydAnYO9kz87HfH9Kxv3D976lNEk2ujf9ANE8GCe1OeEzgRLZD4EQyX44df8tGQ08iNdHCU+jnhGPDVG9bgAGGD3Iw8TB5xgjz3jr3CTxSEapxxAL7VxcCmGaQPe6n/qScWtSIcdLrD1FhxbtRZn4x/3rtanvlBtffq57UCcI5l6dVF9CaJEgcAWBEMkVOPo+0ODHwGNEIAxIwsRBea6vdxlMPsNwYFAcIoEsnB4WQ6hTqxOMqg1wU40rxEx/kCal6AKejEnGOSFKvE8mFiYaFV8S9AVP5oo3o+syKSA0ZoJxmTWZJvFSXSMLIzBnXBa+bS5/UwQ0oDECEIRDF87n+nSOMDAMkIUNU51v2TjM4SWo2pdi1E34L1W4mnRALFOJtZ0pQe/QNVItT3XNOzpxV8n5fdWjaxzrBqY8j8Cc0Zn/RT45OQIaoPQT3oUHMDnHUzPKuYFLqGJYZFXObNILroSmIi8jMIfjy9/s8EwhGu/0+s+4CdI5vBkmKngv6Bo5x3NbodFFQmQOk6l48VzXQdcgF6d7unePoU7aE5lBIEQyA8y5TmvgEZ5iwBJSeKMkBrHXJVS8lCljZ8IwaZgwFlswvqzNugpT2K6rhTtaI2PPBIN0hWSkn6zJmFSc7yIYSIj0Y6VBdA108nZJd5TjuSQsNqDT558QyZn7rQxMSKNO435hkE0NNEIXzPhIzPiY7cXDEBBHkE0TyRx+0i9vovhf/R3pMR6MPWWTB+syU+JQ2tvlQ8Ji6C/kArHcKfcpHydrHYGxwWq9vl3XT4MFr4JZHO4/3gbkMTXYxkYMEmHtAsJgNsegYxaH9xFZBgH6YMoLXOZunV+1TGCYxHzgpkjfCYPhrUAw5BAMJDLGlbAY44E0iH7LJAlSgVw+UuK5l6nJlD6KnBuBEMmCPaDBwACpiYOBwuCqB0S9xZYBxmfs4YcsGEjkiSsLhBML/VD304lv3//tykTnQ7WENIjGBDYHQoFcSEym2IaMWP/JCaG9VZKyi8f6LaRSE8t4wsX3ImdAIERyRNALcTBIGByeYY13v4yJg+P7SiaOhKcERgMSI7VAJ4hcWGjHwyANonFTh8UYO3gv440kjKPvlqTs4llFLEy4GDfpM5A5g4RIbgi6lNkeh8NV4wEwVm7CUSg+CfLAZR9/R6cjZ0YgfXKiDpD+e2F/CIuVCRnjyh4L5DLeLYbXUu8Sg1gYUwNJ6ZoPVI6cCAE6I3IAAlJW3HCTBl6H3fK5qxCmMnGwiMiWy0jjCKiff6kqDuNDffbbxqu7+uqpP3iAEkJx2mfcOQx2W32YV74sqCUhkmvAlQLjUjMzcqiKxcJdwuwKT2NIUmAWDSOdIaB+/4WrrD78ncvJ20BA/cMmFcalE+GxXcJmFa+x3FWf1iHmXb/LZ3sgkNDWBEhSUhb67DYzA6rDVeOQBy/3gzQGJZWC5nkNgbECGffzCpq0niaUCRqTtH/RqjJmPdmDXMYvtoR4SD9U4kHJOgyWMStQbiLxSISelAoc6rUOFG5O2MnD4ni9xpHdPXNodXpeOvG+qy6j9XuXk7ePQDWeIRQmgizeT9k6zjF2IaRhbUV5thkLhENlCtxDr9Hl96VseGMommcxu7wzwlUmDnaHxC3ustf3r7T04z1/W/39B5eT94eA+pLw9OtKJpZdYTB2ldUhsLzOZY8u32U89/h5X1+RQuHuQhyErVCsmkjrUAazlHtKkEeeshUIGxT0odaPDUKwjiaXiZ/JwWEwL9qP7QBh7DdLkskY3hWGt8KC/eX/qFkHMsdrxeoHihSBbYP2OnBx58RrHZBHvI45lDZyXnrzrpsqA/JHl5OvCwH1s70ViAWPZby2Ujf4vg4GQpJO5K0SFTKrJBIpB1sDUQwIZNcuK2Kjd0v6RMqRtQ6BERnWzX5uHKQXf3I5+XoRkN3AHrLNGEIh7Vor9S4wIhab31q8GiKpyAMCQRmmBKLgOQ68DrYAbl4BpkDKuYFIfiYchvEhPflzMNkeAsWmQCi2KXP2kgkpnspmSWUOmC60Rh3NGg+dTJrzPCAPZg+D5yGjkDinwIjsRkC69VN/QzrzF5eTbxMB6QMhL3sq2Jo524mt8drqZhbq58BoVlvUocQ0WeswebA45pAU7XGZVyTcI8kQbKZD1d7IERCQnr3jy0h//upy8iAg3WACyyI9iccGbEexPbZBnsBCKrype9U7PbvYtaWOgyyYBTAjgET8gCCdxe4ak4c9j9V3nNocWRaBehffsnfK1btCoExMh+dOqokttslRERMLIXbO8QAkC/VERT7W71enW26w2teeCPz6raB4IlPiV5JAHvE8phDKuYMRkO79xD+SXv3N5eRBYA4B6QwTcya6kMrcsyp4JkRKWKPFdq1CmiOSUWfMvZiNRXIYPv/caRVq2F4jpIdvu1Ya8H93OXkQ2AcB6Q+PHUAqpDk7xqtZIJXuJ8FNEIlApx64gYA+t5DFIjnrHrzCIO/GERCR5RCQTv5IVx9CptK3fyx3p1x57QhIl/x/7llPmXpOBT1jNymk0uVjCGclkoq1AXhqvQaAWffA+3ioAe21EB1GgsByCEg3f+CrS+/+6XLyIPCqCEinsLeEvHZNmAnPM2HuKtpyciIpYNr7AFTIwfVwGY8DMFe5MKV2RRpHQHr6lqsoIvnA5eRB4BgISL+8gYhJNB4LYvvnCTN2kEl0816KDTiNWFQEHC4doBG68q6r+p7sZMD7gDzy+oEamZRPjoD09fu66TA+pI//PnkFcsPNICBdYz0Fu3idbSSs3+RzcIsSiQDi+ngdAGTWVfGKsHOB+GBCV1dgycE5EZDufs/31+D9r8vJg8BSCFT2kojN3K4vvBQm3E3Zy0WIRICwVRcwSFPbdu194LKt+kEdtT/SIQLS4Tddbenohy4nDwKnQGAPG4rdZALehA09KpGo8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function jg(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${zg})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"㎡"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const _g=new E.TextureLoader;function Ro(i){return U(this,null,function*(){return new Promise((t,e)=>{_g.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,t.wrapS=E.ClampToEdgeWrapping,t.wrapT=E.ClampToEdgeWrapping,setTimeout(()=>{t.wrapS!==E.ClampToEdgeWrapping&&console.warn("ios 16.4 texture 不支持 ClampToEdgeWrapping 以外的方式")}),t))})}const Go={userAction:!0};class Vg extends bn{constructor(e,n){super(e);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,d;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=zs(1e3).onUpdate(({progress:h})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(d=this.entryDoorMesh)==null||d.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===ve.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:W(W({},this.state.config),n||{})})}enable(e=Go){this.setState({enabled:!0},e)}disable(e=Go){this.setState({enabled:!1},e)}show(e=Go){if(this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Go){if(this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:W(W({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return U(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=W({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return U(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=jg(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return U(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield Ro(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return U(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield Ro(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return vo(this.five).create3DDomContainer(e)}}const Og=(i,t)=>new Vg(i,t);function No(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function Bg(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;No(i,a*4+0,l*4+0),No(i,a*4+1,l*4+1),No(i,a*4+2,l*4+2),No(i,a*4+3,l*4+3)}}}class yc{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new ve.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Kt(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left="90px"):s<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const A=this.renderCenter.clone().project(this.five.camera);return[(A.x+1)/2*s.x,(A.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,d=o/t,h=l*t,u=this.five.getPixels(r-c/2,a-c/2,c,d,h),m=Math.floor(n*l),g=Math.floor(o*l);Bg(u,m,g);const v=new ImageData(m,g);v.data.set(u),e.putImageData(v,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),d=Math.min(Math.max(l,o),r);return{translateX:c,translateY:d}}}class Qg{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{this.five.model&&(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new B.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}const Rg=1,Gg=3,Ng=new B.Color(16777215),Wg=new B.Color(6522623),Fg=new B.Color(16777215),Hg=new B.Color(6522623),Xg=6,Yg=8,Ug="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",wc=new B.TextureLoader().load(Ug),qg={pointTexture:wc,pointSize:Xg,lineWidth:Rg,lineColor:Ng,pointColor:Fg,lineRenderOrder:20,pointsRenderOrder:20},Jg={pointTexture:wc,pointSize:Yg,lineWidth:Gg,lineColor:Wg,pointColor:Hg,lineRenderOrder:10,pointsRenderOrder:10};function Zg(i,t,e){var d,h,u,m,g;const n=(d=e==null?void 0:e.lineWidth)!=null?d:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new B.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new oo.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Pc(i,t){const[e,n]=i.points,o=t==="light"?Jg:qg,s=Zg(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function ji(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function rr(i){const{z:t}=i;return!(Math.abs(t)>1)}function Kg(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function $g(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function e0(i){let t=!0;const{line:e}=i,n=e.id,o=Kg(),s=$g(e),r=i.userDistanceItem,a=new B.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:u,appendTo:m,remove:g,highlight:d,unHighlight:h,getCurrentContent:v,setItemSelectable:A};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var b;(b=i.clickCallback)==null||b.call(i,l)}function d(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function u(b){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const y=b.getElement();if(!y)return;const C=y.clientWidth,D=y.clientHeight,x=C/2,I=D/2;if(e.points.length<2)return;const[T,S]=e.points,H=T.position.clone().project(b.camera),X=S.position.clone().project(b.camera),N=H.clone().lerp(X,.5),G=new B.Vector2(H.x*x,H.y*I),j=new B.Vector2(X.x*x,X.y*I),R=G.distanceTo(j);if((()=>!(Math.abs(H.z)>1||Math.abs(X.z)>1||!rr(H)&&!rr(X)||!rr(N)||R===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const q=(N.x+1)/2*C,Y=-(N.y-1)/2*D,ae=-(Math.atan((G.y-j.y)/(G.x-j.x))*180)/Math.PI,oe=s.parentElement&&o.clientWidth>R?-20:0;s.style.transform=`translate(${q}px, ${Y}px) rotate(${ae}deg) translateY(${oe}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const ye=v();o.innerText=ye}function m(b){b.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function v(){var T,S,H;if(e.points.length<2)return"";const[b,y]=e.points,C=b.position.clone().distanceTo(y.position),D=(T=i.line.text)!=null?T:i.line.model.config.defaultText,x=(H=(S=i.line.model.config)==null?void 0:S.getDistanceText)==null?void 0:H.call(S,C),I=D!=null?D:x;return I!=null?I:C.toFixed(2)+"m"}function A(b){t=b}return l}class yn{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=ut(),this.model=n,t.id===e.id)throw new Error("无效的线段, 一个点无法构成线段");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new ve.Subscribe,this.points=[t,e],this.mesh=Pc(this,"normal"),this.lightMesh=Pc(this,"light"),this.distanceItem=e0({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new yn(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}function t0(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Dt{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=ut(),this.lines=[],this.position=new B.Vector3,t instanceof B.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){t0(t,this.lines)}clone(){return new Dt(this.position)}}let Wo=class{constructor(t){f(this,"id",ut());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new ve.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("不能重复添加线段"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("传入线段无法与当前折线进行连接")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,d=e(l),h=e(c);if(!d||!h)throw new Error("线上的点不存在");const u=new yn(d,h,this.model);return u.id=a.id,u.text=a.text,u}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(d){const h=a.get(d.id);if(h)return h;const u=new Dt(d.position);return u.id=d.id,a.set(d.id,u),u}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}};class Fo{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new ve.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("不能重复添加 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline 不存在"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Wo({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Ho=i=>i.preventDefault();let Xo=class{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new yn(new Dt([0,0,0]),new Dt([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Ho),e.addEventListener("contextmenu",Ho))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ho),t.removeEventListener("contextmenu",Ho))}};function ar(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new B.Vector2(t,e).sub(new B.Vector2(s.left,s.top)),a=new B.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function lr(i,t){const e=ar(t).ndcPoint,n=new B.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Yo extends Xo{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",nr((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);n&&(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=lr(this.five,e);if(!(n!=null&&n.face))return;const o=new Dt(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=lr(this.five,e);n!=null&&n.face&&this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{this.pressPoint&&this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=lr(this.five,e);this.updateMouseGroup(n);const o=new Dt(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new yn(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{this.lastPoint&&(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Fo(this.config),this.polyline=new Wo({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Kt(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Cc extends Xo{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&(n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)}))})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Kt(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const n0=`
287
+ `,y=document.createElement("div");return y.setAttribute("class","PanoRulerPlugin-rule"),y.setAttribute("data-name",v),y.setAttribute("style","display: none"),y.innerHTML=b,y},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Ag,o.appendChild(s);const r={},a=(v,A)=>{if(e.loaded)throw new Error("标尺被重复初始化!");const b=yg(v,i),y=i.work;if(!y)return!1;for(const C in A){const D=A[C],{standingPosition:x}=y.observers[0],I=D.map(({x:T,z:S,observers:H})=>{const X=H.length>0?v.rooms[v.observers[H[0]]].name:"",N=b[X]?b[X].floor:null;let G=1/0,j={index:0,x:x.x,y:x.y,z:x.z};H.forEach(ae=>{if(!y.observers[ae])return;const{standingPosition:oe}=y.observers[ae],ye={index:ae,x:oe.x,y:oe.y,z:oe.z},Pe=bg({x:T,z:S},ye);N?Pe<G&&Math.abs(ye.y-N)<.3&&(G=Pe,j=ye):Pe<G&&(G=Pe,j=ye)});const R=new B.Vector3(T,j.y,S);Object.assign(R,{observers:H});const Z=b[X]?b[X].roof:null,q=Z?new B.Vector3(T,Z,S):null;return q&&Object.assign(q,{observers:H}),{origin:R,vertical:q}});r[C]={origins:I.map(T=>T.origin),rules:[]};for(const{origin:T,vertical:S}of I){if(!S)continue;const H=n(C,T.distanceTo(S));o.append(H),r[C].rules.push({vertical:!0,rule:[T,S],$element:H})}for(let T=0;T<I.length;T++){let S=T+1;S>=I.length&&(S=0);const{origin:H}=I[T],{origin:X}=I[S],N=n(C,H.distanceTo(X));o.append(N),r[C].rules.push({vertical:!1,rule:[H,X],$element:N})}}return e.loaded=!0,!0},l=(v,A,b)=>U(this,null,function*(){const y=v||t.roomInfo,C=A||t.roomRules;if(!y||!C)throw new Error("标尺数据依赖不齐全!");return e.loaded=!1,e.options=W(W({},e.options),b||{}),i.model.loaded?a(y,C):yield new Promise(D=>i.once("modelLoaded",()=>D(a(y,C))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,A,b,y)=>{const C=[[{x:0,y:0},{x:b,y:0}],[{x:0,y:0},{x:0,y}],[{x:b,y:0},{x:b,y}],[{x:0,y},{x:b,y}]],D=[];for(let x=0;x<C.length;x++){const I=mc([v,A],[C[x][0],C[x][1]],!0);I&&D.push(I)}return D.length===0?!1:D},d=()=>{var H;const v=(H=i.getElement())==null?void 0:H.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:b,currentMode:y}=i;if(A===void 0)return;let C;for(const X in r)X.split(",").indexOf(A.toString())>=0&&(C=X);if(!C){for(const X in r)for(const{$element:N}of r[X].rules)N.style.display="none";return}const D=b.position,x=b.getWorldDirection(new B.Vector3),I=v.clientWidth,T=v.clientHeight;if(y!==ve.Five.Mode.Panorama){for(const X in r)for(const{$element:N}of r[X].rules)N.style.display="none";return}for(const X in r)for(const{$element:N}of r[X].rules)N.style.display=X===C?"block":"none";const[S]=r[C].origins.slice().filter(X=>X.observers.indexOf(A)>=0).sort((X,N)=>{const G=X.clone().setY(0).sub(D).normalize().angleTo(x.clone().setY(0)),j=N.clone().setY(0).sub(D).normalize().angleTo(x.clone().setY(0));return G-j});for(const{rule:X,vertical:N,$element:G}of r[C].rules){const[j,R]=X,Z=G.querySelector(".PanoRulerPlugin-rule-line");if(!Z)return;if(!S){G.style.display="none";continue}if(j!==S&&R!==S){G.style.display="none";continue}if(j.distanceTo(R)<.3){G.style.display="none";continue}if(j.observers.indexOf(A)===-1||R.observers.indexOf(A)===-1){G.style.display="none";continue}if(j.clone().sub(D).normalize().angleTo(x)>Math.PI/2){G.style.display="none";continue}if(R.clone().sub(D).normalize().angleTo(x)>Math.PI/2){G.style.display="none";continue}const K=j.distanceTo(R);if(R.clone().sub(R.clone().sub(j).divide(new B.Vector3(2,2,2))).distanceTo(D)/K>8){G.style.display="none";continue}const ye=j.clone().project(b),Pe=(ye.x+1)/2*I,Ae=(-ye.y+1)/2*T,_e=R.clone().project(b),be=(_e.x+1)/2*I,Fe=(-_e.y+1)/2*T,fe=Math.sqrt(Math.pow(be-Pe,2)+Math.pow(Fe-Ae,2));let we=fe,Te=50;const pe=c({x:~~Pe,y:~~Ae},{x:~~be,y:~~Fe},I,T);if(pe&&pe.length===1&&(S===j?(we=Math.sqrt(Math.pow(pe[0].x-Pe,2)+Math.pow(pe[0].y-Ae,2)),Te=we/fe*50):S===R&&(we=Math.sqrt(Math.pow(pe[0].x-be,2)+Math.pow(pe[0].y-Fe,2)),Te=100-we/fe*50)),pe&&pe.length===2){const re={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};Te=Math.sqrt(Math.pow(re.x-Pe,2)+Math.pow(re.y-Ae,2))/fe*100}const dt=(Math.PI/2-Math.atan2(be-Pe,Ae-Fe))/Math.PI*180,De=Z.querySelector(".PanoRulerPlugin-rule-label"),ot=De.children[0].clientWidth;ot>=fe||ot/2>=Te/100*fe||ot/2>=(1-Te/100)*fe?Z.style.display="none":(Z.style.display="block",Z.style.width=fe+"px",Z.style.left=Pe+"px",Z.style.top=Ae+"px",Z.style.transform=`rotate(${-dt}deg)`,De.style.left=`${Te}%`)}},h=()=>pc(d),u=()=>{var v,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(v=i.getElement())==null?void 0:v.parentElement)==null||A.append(o),d(),i.on("modeChange",d),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",d),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const A=v.distanceText;e.options.distanceText=A,Object.values(r).forEach(b=>{b.rules.forEach(y=>{const[C,D]=y.rule,x=C.distanceTo(D),I=y.$element.querySelector(".PanoRulerPlugin-rule-label-name");I&&(I.innerText=A(x))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function Pg(i){me(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function gc(i,t,e){const n=i.slice();return n[6]=t[e],n}function Cg(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=vc(gc(i,e,o));return{c(){t=V("div");for(let o=0;o<n.length;o+=1)n[o].c();w(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){O(o,t,s);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=gc(o,e,r);n[r]?n[r].p(a,s):(n[r]=vc(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&_(t),Ft(n,o)}}}function Ig(i){let t,e;return{c(){t=V("em"),w(t,"class",e=Oe(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),w(t,"style",i[3])},m(n,o){O(n,t,o)},p(n,o){o&1&&e!==(e=Oe(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&w(t,"class",e),o&8&&w(t,"style",n[3])},d(n){n&&_(t)}}}function vc(i){let t,e,n=`${i[6].width}px`;return{c(){t=V("div"),w(t,"class",e=Oe(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),w(t,"style",i[3]),z(t,"width",n)},m(o,s){O(o,t,s)},p(o,s){s&1&&e!==(e=Oe(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&w(t,"class",e),s&8&&w(t,"style",o[3]),(s&8||s&9&&n!==(n=`${o[6].width}px`))&&z(t,"width",n)},d(o){o&&_(t)}}}function Eg(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,d=`${i[0].left}px`,h=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(A,b){return A[0].children.length===0?Ig:Cg}let g=m(i),v=g(i);return{c(){t=V("div"),v.c(),e=se(),n=V("div"),o=V("div"),r=Be(s),w(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),et(()=>i[4].call(o)),w(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),z(n,"left",l),w(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),z(t,"width",c),z(t,"left",d),z(t,"top",h),z(t,"transform",u),z(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,b){O(A,t,b),v.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=yo(o,i[4].bind(o))},p(A,[b]){g===(g=m(A))&&v?v.p(A,b):(v.d(1),v=g(A),v&&(v.c(),v.m(t,e))),b&1&&s!==(s=A[0].labelElement+"")&&Re(r,s),b&1&&l!==(l=`${A[0].labelOffset}%`)&&z(n,"left",l),b&1&&c!==(c=`${A[0].width}px`)&&z(t,"width",c),b&1&&d!==(d=`${A[0].left}px`)&&z(t,"left",d),b&1&&h!==(h=`${A[0].top}px`)&&z(t,"top",h),b&1&&u!==(u=`rotate(${A[0].rotateDeg}deg)`)&&z(t,"transform",u),b&5&&z(t,"display",A[0].visible&&A[2]?"block":"none")},i:J,o:J,d(A){A&&_(t),v.d(),a()}}}function kg(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class xg extends de{constructor(t){super(),ce(this,t,kg,Eg,le,{rulerItemProp:0},Pg)}}function Ac(i,t,e){const n=i.slice();return n[12]=t[e],n}function bc(i){let t,e;return t=new xg({props:{rulerItemProp:i[12]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Dg(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=bc(Ac(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){t=V("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){O(r,t,a);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Ac(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=bc(c),o[l].c(),k(o[l],1),o[l].m(t,null))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){r&&_(t),Ft(o,r)}}}function Sg(i,t,e){var v,A,b,y;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:A.clientWidth)||0,l=((y=(b=n.getElement())==null?void 0:b.parentElement)==null?void 0:y.clientHeight)||0,c=(C,D)=>{const x=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],I=[];for(let T=0;T<x.length;T++){const S=mc([C,D],[x[T][0],x[T][1]],!0);S&&I.push(S)}return I.length===0?!1:I},d=(C,D)=>{const x=C.clone().project(n.camera),I=(x.x+1)/2*a,T=(-x.y+1)/2*l,S=D.clone().project(n.camera),H=(S.x+1)/2*a,X=(-S.y+1)/2*l,N=Math.sqrt(Math.pow(H-I,2)+Math.pow(X-T,2));return{startLeft:I,startTop:T,endLeft:H,endTop:X,distance:N}},h=(C,D,x)=>{const I=n.camera.position,T=n.camera.getWorldDirection(new B.Vector3),S=C.clone().sub(I).normalize().angleTo(T),H=D.clone().sub(I).normalize().angleTo(T),X=C.distanceTo(D),G=D.clone().sub(D.clone().sub(C).divide(new B.Vector3(2,2,2))).distanceTo(I),{startLeft:j,startTop:R,endLeft:Z,endTop:q,distance:Y}=d(C,D),ae=-((Math.PI/2-Math.atan2(Z-j,R-q))/Math.PI)*180;let oe=!0;x||(oe=!1),!zt(C,x)&&!zt(D,x)&&(oe=!1),X<.3&&(oe=!1),S>Math.PI/2&&(oe=!1),H>Math.PI/2&&(oe=!1),G/X>8&&(oe=!1);let ye=50,Pe=Y;const Ae=c({x:~~j,y:~~R},{x:~~Z,y:~~q});if(Ae&&Ae.length===1&&(zt(C,x)?(Pe=Math.sqrt(Math.pow(Ae[0].x-j,2)+Math.pow(Ae[0].y-R,2)),ye=Pe/Y*50):zt(D,x)&&(Pe=Math.sqrt(Math.pow(Ae[0].x-Z,2)+Math.pow(Ae[0].y-q,2)),ye=100-Pe/Y*50)),Ae&&Ae.length===2){const _e={x:(Ae[0].x+Ae[1].x)/2,y:(Ae[0].y+Ae[1].y)/2};ye=Math.sqrt(Math.pow(_e.x-j,2)+Math.pow(_e.y-R,2))/Y*100}return{startLeft:j,startTop:R,distance:Y,deg:ae,visible:oe,labelOffset:ye,ruleLength:X}},u=()=>{const C=n.panoIndex,D=o.find(N=>N.panoIndex===C);if(!D)return e(0,r=[]);if(n.currentMode!==ve.Five.Mode.Panorama)return e(0,r=[]);const x=n.camera.position,I=n.camera.getWorldDirection(new B.Vector3),T=D.lines.map(N=>new B.Vector3(N.start[0],-N.start[1],-N.start[2])),S=D.lines.map(N=>new B.Vector3(N.end[0],-N.end[1],-N.end[2])),[H]=T.concat(S).sort((N,G)=>{const j=N.clone().setY(0).sub(x).normalize().angleTo(I.clone().setY(0)),R=G.clone().setY(0).sub(x).normalize().angleTo(I.clone().setY(0));return j-R}),X=D.lines.map(N=>{var Pe,Ae;const G=N.start,j=N.end,{startLeft:R,startTop:Z,distance:q,deg:Y,visible:K,labelOffset:ae,ruleLength:oe}=h(new B.Vector3(G[0],-G[1],-G[2]),new B.Vector3(j[0],-j[1],-j[2]),H),ye=[];return N.children&&((Pe=N.children)==null?void 0:Pe.length)>0&&((Ae=N.children)==null||Ae.forEach(_e=>{const be=_e.start,Fe=_e.end,{distance:fe}=d(new B.Vector3(be[0],-be[1],-be[2]),new B.Vector3(Fe[0],-Fe[1],-Fe[2]));ye.push({width:fe,state:_e.state})})),{width:q,left:R,top:Z,rotateDeg:Y,state:N.state,children:ye,labelOffset:ae,visible:K,labelElement:s.distanceText(oe)}});e(0,r=X)},m=()=>go(u),g=nr(u,80);return kt(()=>{u(),n.on("panoArrived",u),n.on("modeChange",u),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),on(()=>{n.off("panoArrived",u),n.off("modeChange",u),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=C=>{"five"in C&&e(1,n=C.five),"rulerDatas"in C&&e(2,o=C.rulerDatas),"options"in C&&e(3,s=C.options)},[r,n,o,s]}class Lg extends de{constructor(t){super(),ce(this,t,Sg,Dg,le,{five:1,rulerDatas:2,options:3})}}let Mg=class{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=W(W({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>U(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return U(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return U(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Lg({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}};const Tg=(i,t)=>new Mg(i,t),zg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAGfvXS06Zc5CFCePQt0y3EFaq61CX1ayjC56U8br24sKd+kAuJhkI55OSPi75pyIcvKNIEFgcgRDJ4hD3ewMZLDwDXqfOq9RNFCYOCAMPYx851BDjIXiWzky9Tpyvw0kOL/nc+Jh7DyGqko+P+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsxknztsDUnFvMfF8e+4X6j88F4hlTDT3de6BiAYsI0HgxgiESG4MYd8XkLEhrARZTKUxUWB0MXrkiA3wdYYQg8Xs2cmzaR977cCE8eSM6wYDsQiXSyOrulDPRUT3AbsxydAnYO9kz87HfH9Kxv3D976lNEk2ujf9ANE8GCe1OeEzgRLZD4EQyX44df8tGQ08iNdHCU+jnhGPDVG9bgAGGD3Iw8TB5xgjz3jr3CTxSEapxxAL7VxcCmGaQPe6n/qScWtSIcdLrD1FhxbtRZn4x/3rtanvlBtffq57UCcI5l6dVF9CaJEgcAWBEMkVOPo+0ODHwGNEIAxIwsRBea6vdxlMPsNwYFAcIoEsnB4WQ6hTqxOMqg1wU40rxEx/kCal6AKejEnGOSFKvE8mFiYaFV8S9AVP5oo3o+syKSA0ZoJxmTWZJvFSXSMLIzBnXBa+bS5/UwQ0oDECEIRDF87n+nSOMDAMkIUNU51v2TjM4SWo2pdi1E34L1W4mnRALFOJtZ0pQe/QNVItT3XNOzpxV8n5fdWjaxzrBqY8j8Cc0Zn/RT45OQIaoPQT3oUHMDnHUzPKuYFLqGJYZFXObNILroSmIi8jMIfjy9/s8EwhGu/0+s+4CdI5vBkmKngv6Bo5x3NbodFFQmQOk6l48VzXQdcgF6d7unePoU7aE5lBIEQyA8y5TmvgEZ5iwBJSeKMkBrHXJVS8lCljZ8IwaZgwFlswvqzNugpT2K6rhTtaI2PPBIN0hWSkn6zJmFSc7yIYSIj0Y6VBdA108nZJd5TjuSQsNqDT558QyZn7rQxMSKNO435hkE0NNEIXzPhIzPiY7cXDEBBHkE0TyRx+0i9vovhf/R3pMR6MPWWTB+syU+JQ2tvlQ8Ji6C/kArHcKfcpHydrHYGxwWq9vl3XT4MFr4JZHO4/3gbkMTXYxkYMEmHtAsJgNsegYxaH9xFZBgH6YMoLXOZunV+1TGCYxHzgpkjfCYPhrUAw5BAMJDLGlbAY44E0iH7LJAlSgVw+UuK5l6nJlD6KnBuBEMmCPaDBwACpiYOBwuCqB0S9xZYBxmfs4YcsGEjkiSsLhBML/VD304lv3//tykTnQ7WENIjGBDYHQoFcSEym2IaMWP/JCaG9VZKyi8f6LaRSE8t4wsX3ImdAIERyRNALcTBIGByeYY13v4yJg+P7SiaOhKcERgMSI7VAJ4hcWGjHwyANonFTh8UYO3gv440kjKPvlqTs4llFLEy4GDfpM5A5g4RIbgi6lNkeh8NV4wEwVm7CUSg+CfLAZR9/R6cjZ0YgfXKiDpD+e2F/CIuVCRnjyh4L5DLeLYbXUu8Sg1gYUwNJ6ZoPVI6cCAE6I3IAAlJW3HCTBl6H3fK5qxCmMnGwiMiWy0jjCKiff6kqDuNDffbbxqu7+uqpP3iAEkJx2mfcOQx2W32YV74sqCUhkmvAlQLjUjMzcqiKxcJdwuwKT2NIUmAWDSOdIaB+/4WrrD78ncvJ20BA/cMmFcalE+GxXcJmFa+x3FWf1iHmXb/LZ3sgkNDWBEhSUhb67DYzA6rDVeOQBy/3gzQGJZWC5nkNgbECGffzCpq0niaUCRqTtH/RqjJmPdmDXMYvtoR4SD9U4kHJOgyWMStQbiLxSISelAoc6rUOFG5O2MnD4ni9xpHdPXNodXpeOvG+qy6j9XuXk7ePQDWeIRQmgizeT9k6zjF2IaRhbUV5thkLhENlCtxDr9Hl96VseGMommcxu7wzwlUmDnaHxC3ustf3r7T04z1/W/39B5eT94eA+pLw9OtKJpZdYTB2ldUhsLzOZY8u32U89/h5X1+RQuHuQhyErVCsmkjrUAazlHtKkEeeshUIGxT0odaPDUKwjiaXiZ/JwWEwL9qP7QBh7DdLkskY3hWGt8KC/eX/qFkHMsdrxeoHihSBbYP2OnBx58RrHZBHvI45lDZyXnrzrpsqA/JHl5OvCwH1s70ViAWPZby2Ujf4vg4GQpJO5K0SFTKrJBIpB1sDUQwIZNcuK2Kjd0v6RMqRtQ6BERnWzX5uHKQXf3I5+XoRkN3AHrLNGEIh7Vor9S4wIhab31q8GiKpyAMCQRmmBKLgOQ68DrYAbl4BpkDKuYFIfiYchvEhPflzMNkeAsWmQCi2KXP2kgkpnspmSWUOmC60Rh3NGg+dTJrzPCAPZg+D5yGjkDinwIjsRkC69VN/QzrzF5eTbxMB6QMhL3sq2Jo524mt8drqZhbq58BoVlvUocQ0WeswebA45pAU7XGZVyTcI8kQbKZD1d7IERCQnr3jy0h//upy8iAg3WACyyI9iccGbEexPbZBnsBCKrype9U7PbvYtaWOgyyYBTAjgET8gCCdxe4ak4c9j9V3nNocWRaBehffsnfK1btCoExMh+dOqokttslRERMLIXbO8QAkC/VERT7W71enW26w2teeCPz6raB4IlPiV5JAHvE8phDKuYMRkO79xD+SXv3N5eRBYA4B6QwTcya6kMrcsyp4JkRKWKPFdq1CmiOSUWfMvZiNRXIYPv/caRVq2F4jpIdvu1Ya8H93OXkQ2AcB6Q+PHUAqpDk7xqtZIJXuJ8FNEIlApx64gYA+t5DFIjnrHrzCIO/GERCR5RCQTv5IVx9CptK3fyx3p1x57QhIl/x/7llPmXpOBT1jNymk0uVjCGclkoq1AXhqvQaAWffA+3ioAe21EB1GgsByCEg3f+CrS+/+6XLyIPCqCEinsLeEvHZNmAnPM2HuKtpyciIpYNr7AFTIwfVwGY8DMFe5MKV2RRpHQHr6lqsoIvnA5eRB4BgISL+8gYhJNB4LYvvnCTN2kEl0816KDTiNWFQEHC4doBG68q6r+p7sZMD7gDzy+oEamZRPjoD09fu66TA+pI//PnkFcsPNICBdYz0Fu3idbSSs3+RzcIsSiQDi+ngdAGTWVfGKsHOB+GBCV1dgycE5EZDufs/31+D9r8vJg8BSCFT2kojN3K4vvBQm3E3Zy0WIRICwVRcwSFPbdu194LKt+kEdtT/SIQLS4Tddbenohy4nDwKnQGAPG4rdZALehA09KpGo8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function jg(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${zg})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"㎡"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const _g=new E.TextureLoader;function Ro(i){return U(this,null,function*(){return new Promise((t,e)=>{_g.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,t.wrapS=E.ClampToEdgeWrapping,t.wrapT=E.ClampToEdgeWrapping,setTimeout(()=>{t.wrapS!==E.ClampToEdgeWrapping&&console.warn("ios 16.4 texture 不支持 ClampToEdgeWrapping 以外的方式")}),t))})}const Go={userAction:!0};class Vg extends bn{constructor(e,n){super(e);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,d;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=zs(1e3).onUpdate(({progress:h})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(d=this.entryDoorMesh)==null||d.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===ve.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:W(W({},this.state.config),n||{})})}enable(e=Go){this.setState({enabled:!0},e)}disable(e=Go){this.setState({enabled:!1},e)}show(e=Go){if(this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Go){if(this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:W(W({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return U(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=W({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return U(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=jg(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return U(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield Ro(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return U(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield Ro(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return vo(this.five).create3DDomContainer(e)}}const Og=(i,t)=>new Vg(i,t);function No(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function Bg(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;No(i,a*4+0,l*4+0),No(i,a*4+1,l*4+1),No(i,a*4+2,l*4+2),No(i,a*4+3,l*4+3)}}}class yc{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new ve.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render 未初始化");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Kt(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){this.containerDom&&this.state.enabled&&(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left="90px"):s<183?(this.canvas.style.top="90px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const A=this.renderCenter.clone().project(this.five.camera);return[(A.x+1)/2*s.x,(A.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,d=o/t,h=l*t,u=this.five.getPixels(r-c/2,a-c/2,c,d,h),m=Math.floor(n*l),g=Math.floor(o*l);Bg(u,m,g);const v=new ImageData(m,g);v.data.set(u),e.putImageData(v,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),d=Math.min(Math.max(l,o),r);return{translateX:c,translateY:d}}}class Qg{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{this.five.model&&(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new B.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}const Rg=1,Gg=3,Ng=new B.Color(16777215),Wg=new B.Color(6522623),Fg=new B.Color(16777215),Hg=new B.Color(6522623),Xg=6,Yg=8,Ug="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",wc=new B.TextureLoader().load(Ug),qg={pointTexture:wc,pointSize:Xg,lineWidth:Rg,lineColor:Ng,pointColor:Fg,lineRenderOrder:20,pointsRenderOrder:20},Jg={pointTexture:wc,pointSize:Yg,lineWidth:Gg,lineColor:Wg,pointColor:Hg,lineRenderOrder:10,pointsRenderOrder:10};function Zg(i,t,e){var d,h,u,m,g;const n=(d=e==null?void 0:e.lineWidth)!=null?d:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new B.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new oo.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Pc(i,t){const[e,n]=i.points,o=t==="light"?Jg:qg,s=Zg(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function ji(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function rr(i){const{z:t}=i;return!(Math.abs(t)>1)}function Kg(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function $g(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function e0(i){let t=!0;const{line:e}=i,n=e.id,o=Kg(),s=$g(e),r=i.userDistanceItem,a=new B.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:u,appendTo:m,remove:g,highlight:d,unHighlight:h,getCurrentContent:v,setItemSelectable:A};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var b;(b=i.clickCallback)==null||b.call(i,l)}function d(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function u(b){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const y=b.getElement();if(!y)return;const C=y.clientWidth,D=y.clientHeight,x=C/2,I=D/2;if(e.points.length<2)return;const[T,S]=e.points,H=T.position.clone().project(b.camera),X=S.position.clone().project(b.camera),N=H.clone().lerp(X,.5),G=new B.Vector2(H.x*x,H.y*I),j=new B.Vector2(X.x*x,X.y*I),R=G.distanceTo(j);if((()=>!(Math.abs(H.z)>1||Math.abs(X.z)>1||!rr(H)&&!rr(X)||!rr(N)||R===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const q=(N.x+1)/2*C,Y=-(N.y-1)/2*D,ae=-(Math.atan((G.y-j.y)/(G.x-j.x))*180)/Math.PI,oe=s.parentElement&&o.clientWidth>R?-20:0;s.style.transform=`translate(${q}px, ${Y}px) rotate(${ae}deg) translateY(${oe}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const ye=v();o.innerText=ye}function m(b){b.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function v(){var T,S,H;if(e.points.length<2)return"";const[b,y]=e.points,C=b.position.clone().distanceTo(y.position),D=(T=i.line.text)!=null?T:i.line.model.config.defaultText,x=(H=(S=i.line.model.config)==null?void 0:S.getDistanceText)==null?void 0:H.call(S,C),I=D!=null?D:x;return I!=null?I:C.toFixed(2)+"m"}function A(b){t=b}return l}class yn{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=ut(),this.model=n,t.id===e.id)throw new Error("无效的线段, 一个点无法构成线段");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new ve.Subscribe,this.points=[t,e],this.mesh=Pc(this,"normal"),this.lightMesh=Pc(this,"light"),this.distanceItem=e0({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new yn(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}function t0(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Dt{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=ut(),this.lines=[],this.position=new B.Vector3,t instanceof B.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){t0(t,this.lines)}clone(){return new Dt(this.position)}}let Wo=class{constructor(t){f(this,"id",ut());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new ve.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("不能重复添加线段"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("传入线段无法与当前折线进行连接")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,d=e(l),h=e(c);if(!d||!h)throw new Error("线上的点不存在");const u=new yn(d,h,this.model);return u.id=a.id,u.text=a.text,u}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(d){const h=a.get(d.id);if(h)return h;const u=new Dt(d.position);return u.id=d.id,a.set(d.id,u),u}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}};class Fo{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new ve.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("不能重复添加 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline 不存在"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Wo({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Ho=i=>i.preventDefault();let Xo=class{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new yn(new Dt([0,0,0]),new Dt([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Ho),e.addEventListener("contextmenu",Ho))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ho),t.removeEventListener("contextmenu",Ho))}};function ar(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new B.Vector2(t,e).sub(new B.Vector2(s.left,s.top)),a=new B.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function lr(i,t){const e=ar(t).ndcPoint,n=new B.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Yo extends Xo{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",nr((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);n&&(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=lr(this.five,e);if(!(n!=null&&n.face))return;const o=new Dt(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=lr(this.five,e);n!=null&&n.face&&this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{this.pressPoint&&this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=lr(this.five,e);this.updateMouseGroup(n);const o=new Dt(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new yn(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{this.lastPoint&&(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Fo(this.config),this.polyline=new Wo({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Kt(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Cc extends Xo{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&(n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)}))})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{n.visiblePanoIndexes&&n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Kt(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const n0=`
288
288
  <svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
289
289
  <defs>
290
290
  <linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
@@ -513,7 +513,7 @@ void main() {
513
513
  </div>
514
514
  </div>
515
515
  `,v0={display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",transform:"translate(0, 10px)",transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out"},A0={position:"absolute",left:"50%",bottom:"32px",transform:"translateX(-50%)",height:"89px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",pointerEvents:"all",color:"#fff",zIndex:"10"},b0={position:"absolute",bottom:"0",left:"0",opacity:"0.5",width:"100%",height:"184px",background:"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",zIndex:"0"},Mc={margin:"0 64px"},y0={opacity:"0.85"},Tc={width:"72px",height:"72px",backgroundSize:"100%",cursor:"pointer",transition:"all 200ms ease-in-out"},w0={width:"24px",height:"24px",marginRight:"4px",backgroundSize:"100%",cursor:"pointer"},P0={userSelect:"none",pointerEvents:"none"};class C0{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"开始",end:"结束",revoke:"撤销",exit:"退出"});f(this,"onMouseEnter",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="1"});f(this,"onMouseLeave",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="0.85"});f(this,"onClick",()=>{this.measureController.getCurrentMode()!=="Edit"?this.measureController.changeMode("Edit"):this.measureController.save().changeMode("Watch")});f(this,"modeChangeHandler",t=>{t==="Edit"?this.change2Done():this.change2Add()});var r,a,l,c;this._params=n,this._btnTexts={start:(r=this._params.startButtonText)!=null?r:this._btnTexts.start,end:(a=this._params.endButtonText)!=null?a:this._btnTexts.end,revoke:(l=this._params.revokeButtonText)!=null?l:this._btnTexts.revoke,exit:(c=this._params.exitButtonText)!=null?c:this._btnTexts.exit},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),Object.assign(this.mainElement.mainIcon.style,Tc),Object.assign(this.mainElement.mainItem.style,Mc);const{revokeTextDom:o,exitTextDom:s}=this._getTextElement();o&&(o.innerText=this._btnTexts.revoke),s&&(s.innerText=this._btnTexts.exit),this.change2Add(),this.measureController.hook.on("modeChange",this.modeChangeHandler),this.mainElement.mainItem.addEventListener("click",this.onClick),this.mainElement.mainItem.addEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.addEventListener("mouseleave",this.onMouseLeave)}dispose(){this.measureController.hook.off("modeChange",this.modeChangeHandler),this.mainElement.mainItem.removeEventListener("click",this.onClick),this.mainElement.mainItem.removeEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.removeEventListener("mouseleave",this.onMouseLeave)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}_getTextElement(){const t=this.container.querySelector(".fpm__revoke-text"),e=this.container.querySelector(".fpm__exit-text");return{revokeTextDom:t,exitTextDom:e}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.getMainElement();t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class I0{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"开始",end:"结束"});f(this,"onClick",()=>{var t;this.mainElement.mainTextDom.innerText===((t=this._params.startButtonText)!=null?t:"开始")?(this.measureController.hook.emit("willChangeState","watching","editing"),this.change2Done()):(this.measureController.hook.emit("willChangeState","editing","watching"),this.change2Add())});var o,s;this._params=n,this._btnTexts={start:(o=this._params.startButtonText)!=null?o:this._btnTexts.start,end:(s=this._params.endButtonText)!=null?s:this._btnTexts.end},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),this.mainElement.mainIcon.setAttribute("style","-webkit-tap-highlight-color: rgba(0,0,0,0);"),Object.assign(this.mainElement.mainIcon.style,Tc),Object.assign(this.mainElement.mainItem.style,Mc),this.change2Add(),this.mainElement.mainItem.addEventListener("click",this.onClick)}dispose(){this.mainElement.mainItem.removeEventListener("click",this.onClick)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.mainElement;t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class E0{constructor(t,e){f(this,"container");f(this,"revokeIcon");f(this,"revokeItem");f(this,"measureController");f(this,"onClick",()=>{this.measureController.revoke()});f(this,"onModeChange",t=>{if(t!=="Edit"&&this.revokeItem.className.includes("enabled")){this.revokeItem.classList.remove("enabled"),this.measureController.hook.off("anchorChange",this.onAnchorChange);return}this.measureController.hook.on("anchorChange",this.onAnchorChange)});f(this,"onAnchorChange",t=>{t&&this.revokeItem.classList.add("enabled")});this.measureController=t,this.container=e;const n=this.container.querySelector(".fpm__revoke-icon"),o=this.container.querySelector(".fpm__revoke");if(!n||!o)throw new Error("不正确的选择器");this.revokeIcon=n,this.revokeItem=o,this.revokeItem.addEventListener("click",this.onClick),t.hook.on("modeChange",this.onModeChange)}dispose(){this.revokeItem.removeEventListener("click",this.onClick),this.measureController.hook.off("modeChange",this.onModeChange)}}class zc{constructor(t,e){f(this,"revoke");f(this,"container");f(this,"mainController");f(this,"disposers",[]);f(this,"measureController");f(this,"mode");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,y0),Object.assign(t==null?void 0:t.style,w0));const n=()=>{e.style.opacity="1"},o=()=>{e.style.opacity="0.85"},s=()=>{this.measureController.disable()};return e.addEventListener("click",s),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("click",s),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",o)}});var r;this._params=e,this.measureController=t,this.mode=(r=e.mode)!=null?r:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?p0:g0,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)",e.container.appendChild(this.container);const n=this.container.querySelectorAll(".fpm__text"),o=this.container.querySelector(".fpm_ui-bg"),s=this.container.querySelector(".fpm_operating-space");Object.assign(o==null?void 0:o.style,b0),Object.assign(s==null?void 0:s.style,A0),Object.assign(this.container.style,v0),n.forEach(a=>Object.assign(a.style,P0))}dispose(){this.hide(),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 E0(this.measureController,this.container),this.mainController=new C0(this.measureController,this.container,this._params)):this.mainController=new I0(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}}class k0{constructor(t,e){f(this,"measureController");f(this,"textDom",document.createElement("span"));f(this,"container",document.createElement("div"));f(this,"hasAnchor",!1);f(this,"hasChangedToWatch",!1);f(this,"_params");f(this,"onModelChange",t=>{var e;if(t==="View"){this.hide();return}if(t==="Watch"){this.hasChangedToWatch?(this.textDom.innerText="",this.hide()):(this.show(),this.hasChangedToWatch=!0);return}t==="Edit"&&(this.textDom.innerText=(e=this._params.firstPointTip)!=null?e:"请选择第一个测量点,Esc或单击鼠标右键可取消选择",this.show())});f(this,"anchorChange",t=>{var e,n;!this.hasAnchor&&t?(this.hasAnchor=!0,this.textDom.innerText=(e=this._params.nextPointTip)!=null?e:"选择下一个测量点,Esc或单击鼠标右键取消选择"):t||(this.hasAnchor=!1,this.textDom.innerText=(n=this._params.firstPointTip)!=null?n:"请选择第一个测量点,Esc或单击鼠标右键可取消选择")});f(this,"onEditedLineChange",t=>{var e;t.lines.length===1&&(this.textDom.innerText=(e=this._params.endTip)!=null?e:"可以连续选择测量点,或点击下方“结束”按钮完成测量(Esc取消,Command+S保存)")});this._params=e,this.initDom(),e.container.append(this.container),this.measureController=t,t.hook.on("modeChange",this.onModelChange),t.hook.on("anchorChange",this.anchorChange),t.hook.on("editedPolylineChange",this.onEditedLineChange)}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this}hide(){return this.container.style.opacity="0",this.container.style.transform="translate(0, -10px)",this.measureController.hook.off("modeChange",this.onModelChange),this.measureController.hook.off("anchorChange",this.anchorChange),this.measureController.hook.off("editedPolylineChange",this.onEditedLineChange),this}initDom(){var n;const t=this.container,e=this.textDom;t.classList.add("fpm__guide-container"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="110px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.transform="translate(0, -10px)",t.style.background="linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.00) 100%)",t.style.transition="opacity 500ms ease-in-out, transform 500ms ease-in-out",t.style.opacity="0",e.classList.add("fpm__guide-text"),e.style.color="#fff",e.style.fontSize="20px",e.innerText=(n=this._params.startTip)!=null?n:"点击下方“开始”按钮开始测距",t.appendChild(e)}}class x0{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.changeMode("Watch")}}class D0{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new ve.Subscribe);f(this,"magnifier");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,"controller",null);f(this,"getCurrentMode",()=>this.controller instanceof Yo?"Edit":this.controller instanceof xc?"Watch":this.controller instanceof _i?"Mixed":this.controller instanceof Cc?"View":null);f(this,"changeMode",t=>{var o;if(!this.hasOpen||this.getCurrentMode()===t)return;(o=this.controller)==null||o.dispose();const e={View:Cc,Watch:xc,Edit:Yo,Mixed:_i};if(!e[t])throw new Error("不存在的 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});var o,s,r,a;this.five=t,this.params=e,this.config=_o(e,["openParams","magnifierParams"]),this.model=new Fo(this.config),this.fiveHelper=new Qg(t),this.isMobile=(s=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?s:!1,this.magnifier=new yc(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new B.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=(a=this.params.openParams)!=null?a:{};if(this.params.useUIController!==!1){const l=W({container:this.container,openParams:n},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new zc(this,l)}if(this.params.useGuideController!==!1){const l=W({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new k0(this,l)}}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 x0(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o;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(),(o=this.shortcutKeyController)==null||o.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}edit(){const t=this.isMobile?"Mixed":"Edit";this.changeMode(t)}revoke(){this.controller instanceof Yo&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(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 Yo)&&!(this.controller instanceof _i))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.polyline;return this.model.addPolyline(n),this.changeMode(e),this}addStartPoint(){this.controller instanceof _i&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof _i&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){var e;if(this.isMobile=t,this.params.useUIController!==!1){(e=this.useUIController)==null||e.dispose();const n=W({container:this.container,mode:this.isMobile?"mobile":"pc"},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new zc(this,n)}}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var o;const n=this.model.getLineByID(t);if(!n)throw new Error("不存在的线段");n.setText(e),(o=this.controller)==null||o.updateDistanceUI()}createControllerParams(){var e;const t=(e=this.params.openParams)!=null?e:{};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,mouseGroup:Dc(W({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}const S0=function(t,e){return new D0(t,e)},jc=Us(null);function L0(i){me(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 _c(i,t,e){const n=i.slice();return n[3]=t[e],n}function Vc(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=V("i"),w(t,"class","svelte-19zi46m"),ee(t,"PanoSpatialTagPlugin__tag-origin",!0),ee(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),z(t,"top",e),z(t,"left",n),z(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){O(a,t,l),o||(s=ke(t,"click",r),o=!0)},p(a,l){i=a,l&1&&ee(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&z(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&z(t,"left",n),l&1&&z(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&_(t),o=!1,s()}}}function M0(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=Vc(_c(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=Ee()},m(o,s){for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(o,s);O(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=_c(o,e,r);n[r]?n[r].p(a,s):(n[r]=Vc(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(o){Ft(n,o),o&&_(t)}}}function T0(i,t,e){let{origins:n}=t;const o=r=>{jc.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class z0 extends de{constructor(t){super(),ce(this,t,T0,M0,le,{origins:0},L0)}}function j0(i){me(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,
516
- 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 _0(i){let t,e,n,o,s,r,a,l,c,d,h,u,m,g,v;return{c(){t=V("div"),e=V("div"),n=se(),o=V("div"),s=V("i"),r=se(),a=V("i"),l=se(),c=V("i"),d=se(),h=V("div"),u=V("div"),w(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-9m6drd"),z(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(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-9m6drd"),z(s,"width",i[4]+"rem"),w(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-9m6drd"),w(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-9m6drd"),w(o,"class","PanoSpatialTagPlugin__tag-line svelte-9m6drd"),w(u,"class","PanoSpatialTagPlugin__tag-content svelte-9m6drd"),w(h,"class","PanoSpatialTagPlugin__tag-animate svelte-9m6drd"),z(h,"transform","scale("+i[3]*3+")"),w(t,"id",m="PanoSpatialTagPlugin__"+i[0]),z(t,"height",20*i[5]+"rem"),w(t,"class","svelte-9m6drd"),ee(t,"PanoSpatialTagPlugin__tag-x",!0),ee(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),ee(t,"PanoSpatialTagPlugin__tag-show",i[10]),ee(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,b){O(A,t,b),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,d),Q(t,h),Q(h,u),u.innerHTML=i[2],i[16](u),g||(v=ke(u,"click",i[11]),g=!0)},p(A,[b]){b&394&&z(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),b&16&&z(s,"width",A[4]+"rem"),b&4&&(u.innerHTML=A[2]),b&8&&z(h,"transform","scale("+A[3]*3+")"),b&1&&m!==(m="PanoSpatialTagPlugin__"+A[0])&&w(t,"id",m),b&32&&z(t,"height",20*A[5]+"rem"),b&2&&ee(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),b&1024&&ee(t,"PanoSpatialTagPlugin__tag-show",A[10]),b&1088&&ee(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:J,o:J,d(A){A&&_(t),i[16](null),g=!1,v()}}}function V0(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=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,g=0,v=0,A,b,y=setTimeout(()=>{d||e(10,b=!0),y=void 0},100);const C=I=>{const T=Object.keys(u);let S=I.target;for(;S;){const H=S.getAttribute("class");if(!H){S=S.parentNode;continue}if(H.includes("PanoSpatialTagPlugin__tag-content")){S=null;break}T.forEach(X=>{H.includes(X)&&u[X](n)}),S=S.parentNode}};kt(()=>{m.emit("initTag",{id:n})});const D=jc.subscribe(I=>{if(I===null)return;const[T,S]=I.split("-PanoSpatialTagPlugin-");n===T&&(m.emit("clickOrigin",{id:n,show:b}),y||(e(10,b=d),e(12,d=!d),y=setTimeout(()=>{y=void 0},1500)))});sl(()=>{e(7,g=A.offsetWidth),e(8,v=A.offsetHeight),!y&&e(10,b=!d)}),on(()=>{m.emit("destroyTag",{id:n}),D(),h()});function x(I){qe[I?"unshift":"push"](()=>{A=I,e(9,A)})}return i.$$set=I=>{"id"in I&&e(0,n=I.id),"upsideDown"in I&&e(1,o=I.upsideDown),"content"in I&&e(2,s=I.content),"contentZoom"in I&&e(3,r=I.contentZoom),"lineWidthZoom"in I&&e(4,a=I.lineWidthZoom),"lineHeightZoom"in I&&e(5,l=I.lineHeightZoom),"destroying"in I&&e(6,c=I.destroying),"folded"in I&&e(12,d=I.folded),"dispose"in I&&e(13,h=I.dispose),"events"in I&&e(14,u=I.events),"hooks"in I&&e(15,m=I.hooks)},[n,o,s,r,a,l,c,g,v,A,b,C,d,h,u,m,x]}let O0=class extends de{constructor(t){super(),ce(this,t,V0,_0,le,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},j0)}};const B0={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Oc="<",Bc=">",Qc="%",Rc="locals",Q0="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",R0={"&":"&amp","<":"&lt",">":"&gt",'"':"&#34","'":"&#39"},ct={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Gc(i){return i.replace(/;(\s*$)/,"$1")}function G0(i,t){return new N0(i).compileFunction()(t)}class N0{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(Q0));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
516
+ 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 _0(i){let t,e,n,o,s,r,a,l,c,d,h,u,m,g,v;return{c(){t=V("div"),e=V("div"),n=se(),o=V("div"),s=V("i"),r=se(),a=V("i"),l=se(),c=V("i"),d=se(),h=V("div"),u=V("div"),w(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-9m6drd"),z(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(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-9m6drd"),z(s,"width",i[4]+"rem"),w(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-9m6drd"),w(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-9m6drd"),w(o,"class","PanoSpatialTagPlugin__tag-line svelte-9m6drd"),w(u,"class","PanoSpatialTagPlugin__tag-content svelte-9m6drd"),w(h,"class","PanoSpatialTagPlugin__tag-animate svelte-9m6drd"),z(h,"transform","scale("+i[3]*3+")"),w(t,"id",m="PanoSpatialTagPlugin__"+i[0]),z(t,"height",20*i[5]+"rem"),w(t,"class","svelte-9m6drd"),ee(t,"PanoSpatialTagPlugin__tag-x",!0),ee(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),ee(t,"PanoSpatialTagPlugin__tag-show",i[10]),ee(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,b){O(A,t,b),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,d),Q(t,h),Q(h,u),u.innerHTML=i[2],i[16](u),g||(v=ke(u,"click",i[11]),g=!0)},p(A,[b]){b&394&&z(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),b&16&&z(s,"width",A[4]+"rem"),b&4&&(u.innerHTML=A[2]),b&8&&z(h,"transform","scale("+A[3]*3+")"),b&1&&m!==(m="PanoSpatialTagPlugin__"+A[0])&&w(t,"id",m),b&32&&z(t,"height",20*A[5]+"rem"),b&2&&ee(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),b&1024&&ee(t,"PanoSpatialTagPlugin__tag-show",A[10]),b&1088&&ee(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:J,o:J,d(A){A&&_(t),i[16](null),g=!1,v()}}}function V0(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=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,g=0,v=0,A,b,y=setTimeout(()=>{d||e(10,b=!0),y=void 0},100);const C=I=>{const T=Object.keys(u);let S=I.target;for(;S;){const H=S.getAttribute("class");if(!H){S=S.parentNode;continue}if(H.includes("PanoSpatialTagPlugin__tag-content")){S=null;break}T.forEach(X=>{H.includes(X)&&u[X](n)}),S=S.parentNode}};kt(()=>{m.emit("initTag",{id:n})});const D=jc.subscribe(I=>{if(I===null)return;const[T,S]=I.split("-PanoSpatialTagPlugin-");n===T&&(m.emit("clickOrigin",{id:n,show:b}),y||(e(10,b=d),e(12,d=!d),y=setTimeout(()=>{y=void 0},1500)))});sl(()=>{e(7,g=A.offsetWidth),e(8,v=A.offsetHeight),!y&&e(10,b=!d)}),on(()=>{m.emit("destroyTag",{id:n}),D(),h()});function x(I){qe[I?"unshift":"push"](()=>{A=I,e(9,A)})}return i.$$set=I=>{"id"in I&&e(0,n=I.id),"upsideDown"in I&&e(1,o=I.upsideDown),"content"in I&&e(2,s=I.content),"contentZoom"in I&&e(3,r=I.contentZoom),"lineWidthZoom"in I&&e(4,a=I.lineWidthZoom),"lineHeightZoom"in I&&e(5,l=I.lineHeightZoom),"destroying"in I&&e(6,c=I.destroying),"folded"in I&&e(12,d=I.folded),"dispose"in I&&e(13,h=I.dispose),"events"in I&&e(14,u=I.events),"hooks"in I&&e(15,m=I.hooks)},[n,o,s,r,a,l,c,g,v,A,b,C,d,h,u,m,x]}let O0=class extends de{constructor(t){super(),ce(this,t,V0,_0,le,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},j0)}};const B0={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Oc="<",Bc=">",Qc="%",Rc="locals",Q0="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",R0={"&":"&amp","<":"&lt",">":"&gt",'"':"&#34","'":"&#39"},lt={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Gc(i){return i.replace(/;(\s*$)/,"$1")}function G0(i,t){return new N0(i).compileFunction()(t)}class N0{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(Q0));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
517
517
  function __append(s) { if (s !== undefined && s !== null) __output += s }
518
518
  with (`+Rc+` || {}) {
519
519
  `,n=` }
@@ -521,14 +521,14 @@ void main() {
521
521
  `,o=function(s){return s==null?"":String(s).replace(/[&<>'"]/g,function(r){return R0[r]||r})};return this._generateSource(),this.source=e+this.source+n,t=this.source,t="escapeFn = escapeFn || "+o.toString()+`;
522
522
  `+t,new Function(Rc+", escapeFn",t)}_generateSource(){this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");const t=this._parseTemplateText(),e=Qc,n=Oc,o=Bc;t&&t.length&&t.forEach((s,r)=>{let a;if(s.indexOf(n+e)===0&&s.indexOf(n+e+e)!==0&&(a=t[r+2],!(a==e+o||a=="-"+e+o||a=="_"+e+o)))throw new Error('Could not find matching close tag for "'+s+'".');this._scanLine(s)})}_parseTemplateText(){let t=this.templateText;const e=this.regex;let n=e.exec(t);const o=[];let s;for(;n;)s=n.index,s!==0&&(o.push(t.substring(0,s)),t=t.slice(s)),o.push(n[0]),t=t.slice(n[0].length),n=e.exec(t);return t&&o.push(t),o}_addOutput(t){if(this.truncate&&(t=t.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!t)return t;t=t.replace(/\\/g,"\\\\"),t=t.replace(/\n/g,"\\n"),t=t.replace(/\r/g,"\\r"),t=t.replace(/"/g,'\\"'),this.source+=' ; __append("'+t+`")
523
523
  `}_scanLine(t){const e=Qc,n=Oc,o=Bc;switch(t.split(`
524
- `).length-1,t){case n+e:case n+e+"_":this.mode=ct.EVAL;break;case n+e+"=":this.mode=ct.ESCAPED;break;case n+e+"-":this.mode=ct.RAW;break;case n+e+"#":this.mode=ct.COMMENT;break;case n+e+e:this.mode=ct.LITERAL,this.source+=' ; __append("'+t.replace(n+e+e,n+e)+`")
525
- `;break;case e+e+o:this.mode=ct.LITERAL,this.source+=' ; __append("'+t.replace(e+e+o,e+o)+`")
526
- `;break;case e+o:case"-"+e+o:case"_"+e+o:this.mode==ct.LITERAL&&this._addOutput(t),this.mode=null,this.truncate=t.indexOf("-")===0||t.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case ct.EVAL:case ct.ESCAPED:case ct.RAW:t.lastIndexOf("//")>t.lastIndexOf(`
524
+ `).length-1,t){case n+e:case n+e+"_":this.mode=lt.EVAL;break;case n+e+"=":this.mode=lt.ESCAPED;break;case n+e+"-":this.mode=lt.RAW;break;case n+e+"#":this.mode=lt.COMMENT;break;case n+e+e:this.mode=lt.LITERAL,this.source+=' ; __append("'+t.replace(n+e+e,n+e)+`")
525
+ `;break;case e+e+o:this.mode=lt.LITERAL,this.source+=' ; __append("'+t.replace(e+e+o,e+o)+`")
526
+ `;break;case e+o:case"-"+e+o:case"_"+e+o:this.mode==lt.LITERAL&&this._addOutput(t),this.mode=null,this.truncate=t.indexOf("-")===0||t.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case lt.EVAL:case lt.ESCAPED:case lt.RAW:t.lastIndexOf("//")>t.lastIndexOf(`
527
527
  `)&&(t+=`
528
- `)}switch(this.mode){case ct.EVAL:this.source+=" ; "+t+`
529
- `;break;case ct.ESCAPED:this.source+=" ; __append(escapeFn("+Gc(t)+`))
530
- `;break;case ct.RAW:this.source+=" ; __append("+Gc(t)+`)
531
- `;break;case ct.COMMENT:break;case ct.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const dr=.001,Nc=.01,W0="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",F0=(i,t)=>{var ae,oe,ye,Pe,Ae,_e,be,Fe;let e=t==null?void 0:t.container,n=1.4;const o=(ae=t==null?void 0:t.wait)!=null?ae:200,s=(oe=t==null?void 0:t.maxNumberOnScreen)!=null?oe:3,r=(ye=t==null?void 0:t.minRad)!=null?ye:Math.PI/4,a=(Pe=t==null?void 0:t.nearTolerance)!=null?Pe:100,l=(Ae=t==null?void 0:t.upsideHeight)!=null?Ae:1.6,c=(_e=t==null?void 0:t.minDistance)!=null?_e:1.2,d=(be=t==null?void 0:t.maxDistance)!=null?be:3.5,h=vo(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,B0);const m=new ve.Subscribe;let g=new Image;g.src=W0;const v={points:[],origins:[],tags:[],template:"",events:{},render:G0,folded:!1,enabled:!0,forbidden:!0},A=new z0({target:u,props:{origins:v.origins}}),b=(fe,we)=>{x(),we&&I()},y=()=>{v.forbidden&&(v.forbidden=!1,I())},C=(fe,we)=>{if(v.tags.length===0)return;const Te=we.longitude-i.state.longitude,pe=i.camera.clone();pe.position.copy(we.offset),pe.rotateOnWorldAxis(new E.Vector3(0,1,0),Te),pe.updateProjectionMatrix(),pe.updateMatrixWorld(!0);const Je=new E.Frustum,dt=new E.Matrix4;dt.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),Je.setFromProjectionMatrix(dt),v.tags.forEach(De=>{const st=pe.position.clone().setY(n).distanceTo(De.position);if(st<c||st>d||!Je.containsPoint(De.position))return De.destroying=!0;const re=De.position.clone().sub(pe.position).setY(0);if(re.angleTo(De.normal)>Math.PI/2-r&&re.angleTo(De.normal)<Math.PI/2+r)return De.destroying=!0}),v.tags.forEach(De=>{De.destroying?De.app.$set({contentZoom:.1+pe.position.distanceTo(De.position)/d,lineWidthZoom:.38*(.01+pe.position.distanceTo(De.position)/d),destroying:De.destroying}):De.app.$set({lineWidthZoom:.38*(.01+pe.position.distanceTo(De.position)/d),lineHeightZoom:.4+(pe.position.distanceTo(De.position)-c)/d*.6,contentZoom:.1+pe.position.distanceTo(De.position)/d})}),setTimeout(()=>{v.tags.forEach(De=>{De.destroying&&(De.app.$destroy(),De=null)}),v.tags=v.tags.filter(De=>!De.destroying),x()},1900)},D=fe=>{fe!==ve.Five.Mode.Panorama&&!v.forbidden&&(A.$set({origins:[]}),v.tags.forEach(we=>{we.app.$destroy(),we=null}),v.origins=[],v.tags=[],v.forbidden=!0)},x=()=>{if(v.forbidden||!v.enabled)return;const fe=i.camera,we=fe.getWorldDirection(new E.Vector3);v.origins=v.tags.map(Te=>{const pe=Te.position.clone().project(fe),Je=Te.position.clone().sub(fe.position).setY(0).angleTo(we.setY(0))<Math.PI/2;return{id:Te.id,front:Je,left:(pe.x+1)/2*100,top:(-pe.y+1)/2*100,destroying:Te.destroying}}),A.$set({origins:v.origins})},I=()=>{v.forbidden||!v.enabled||(v.timeoutId&&clearTimeout(v.timeoutId),v.timeoutId=setTimeout(()=>{v.timeoutId=void 0;const fe=T();fe.length&&(v.tags=v.tags.concat(fe),x())},o))},T=()=>{const{clientWidth:fe,clientHeight:we}=i.getElement(),Te=[],pe=i.camera,Je=new E.Frustum,dt=new E.Matrix4,De=pe.getWorldDirection(new E.Vector3);dt.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),Je.setFromProjectionMatrix(dt);const st=v.tags.filter(xe=>Je.containsPoint(xe.position)&&!xe.destroying).length,re=v.points.reduce((xe,Ne)=>{if(v.tags.find(Qe=>Ne.id===Qe.id&&!Qe.destroying))return xe;const ft=pe.position.clone().setY(n).distanceTo(Ne.position);if(ft<c||ft>d||!Je.containsPoint(Ne.position))return xe;const Yt=Ne.position.clone().sub(pe.position).setY(0);if(Yt.angleTo(Ne.normal)>Math.PI/2-r&&Yt.angleTo(Ne.normal)<Math.PI/2+r)return xe;const At=Ne.position.clone().project(pe);if(!v.tags.every(Qe=>{if(Qe.position.clone().sub(pe.position).setY(0).angleTo(De.setY(0))>Math.PI/2)return!0;const Ye=Qe.position.clone().project(pe);return Math.sqrt(Math.pow((At.x-Ye.x)/2*fe,2)+Math.pow((At.y-Ye.y)/2*we,2))>a}))return xe;const bt={id:Ne.id,position:Ne.position,normal:Ne.normal,replacement:Ne.replacement,weight:Ne.weight,distance:ft};let Ve;for(let Qe=0,Ye=xe.length;Qe<Ye;Qe++){const St=xe[Qe];if(bt.weight>St.weight){Ve=Qe;break}if(bt.distance<St.distance){Ve=Qe;break}}return Ve!==void 0?xe.splice(Ve,0,bt):xe.push(bt),xe},[]);for(let xe=0,Ne=re.length;xe<Ne&&!(st+Te.length>=s);xe++){const ft=re[xe];if(Te.find(Ve=>ft.id===Ve.id))continue;const Yt=ft.position.clone().project(pe);if(!v.tags.concat(Te).every(Ve=>{if(Ve.position.clone().sub(pe.position).setY(0).angleTo(De.setY(0))>Math.PI/2)return!0;const Qe=Ve.position.clone().project(pe);return Math.sqrt(Math.pow((Yt.x-Qe.x)/2*fe,2)+Math.pow((Yt.y-Qe.y)/2*we,2))>a}))continue;const At=new E.Raycaster(pe.position.clone().setY(n),ft.position.clone().sub(pe.position.clone().setY(n)).normalize(),0,ft.distance+Nc),[bt]=v.intersectObjects?At.intersectObjects(v.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(At):At.intersectObjects(i.model.children,!0);if(bt&&ft.distance-bt.distance<Nc){const{position:Ve,normal:Qe,id:Ye,replacement:St}=ft,Fi=new E.Plane().setFromNormalAndCoplanarPoint(Qe,Ve),Ot=Ve.clone().sub(pe.position).cross(new E.Vector3(0,1,0)).setLength(dr),fn=[Ve.clone(),Ve.clone().add(Ot),Ve.clone().add(new E.Vector3(0,dr,0)).add(Ot),Ve.clone().add(new E.Vector3(0,dr,0))].map(mi=>Fi.projectPoint(mi,new E.Vector3)),{container:xn,dispose:mt}=h.create3DDomContainer(fn)||{},fi=new O0({target:xn,props:{id:Ye,content:v.render(v.template,St),lineWidthZoom:.38*(.01+pe.position.distanceTo(Ve)/d),lineHeightZoom:.4+(pe.position.distanceTo(Ve)-c)/d*.6,contentZoom:.1+pe.position.distanceTo(Ve)/d,upsideDown:Ve.y>l,folded:v.folded,events:v.events,hooks:m,dispose:mt}});Te.push({position:Ve,normal:Qe,id:Ye,app:fi})}}return Te},S=fe=>{v.points=fe.points.map(we=>{var Te,pe;return{id:we.id,position:new E.Vector3().fromArray(we.position),normal:new E.Vector3().fromArray(we.normal),replacement:(Te=we.replacement)!=null?Te:{},weight:(pe=we.weight)!=null?pe:-1}}),fe.render&&(v.render=fe.render),fe.template&&(v.template=fe.template),fe.events&&(v.events=fe.events),fe.enabled===!1&&(v.enabled=fe.enabled),fe.folded===!0&&(v.folded=fe.folded)},H=fe=>{v.intersectObjects=fe,I()},X=()=>{v.enabled=!0,I()},N=()=>{v.enabled=!1,A.$set({origins:[]}),v.tags.forEach(fe=>{fe.app.$destroy(),fe=null}),v.origins=[],v.tags=[]},G=()=>{v.folded=!1,v.tags.forEach(fe=>{fe.app.$set({folded:v.folded})})},j=()=>{v.folded=!0,v.tags.forEach(fe=>{fe.app.$set({folded:v.folded})})},R=fe=>{v.tags.forEach(we=>{we.id===fe&&we.app.$set({folded:!1})})},Z=fe=>{v.tags.forEach(we=>{we.id===fe&&we.app.$set({folded:!0})})},q=()=>{i.once("renderFrame",x)},Y=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(u),v.forbidden=!1,n=i.model.bounding.getCenter(new E.Vector3).y,I(),i.on("panoWillArrive",C),i.on("panoArrived",y),i.on("modeChange",D),i.on("cameraUpdate",b)},K=()=>{g=null,h.disposeAll(),A.$destroy(),v.tags.forEach(fe=>{fe.app.$destroy(),fe=null}),v.origins=[],v.tags=[],i.off("modelLoaded",Y),i.off("renderFrame",x),i.off("panoWillArrive",C),i.off("panoArrived",y),i.off("modeChange",D),i.off("cameraUpdate",b),i.off("dispose",K),window.removeEventListener("resize",q,!1)};return window.addEventListener("resize",q,!1),(Fe=i==null?void 0:i.model)!=null&&Fe.loaded?Y():i.once("modelLoaded",Y),i.on("dispose",K),{load:S,setIntersectObjects:H,unfoldAll:G,foldAll:j,unfold:R,fold:Z,enable:X,disable:N,hooks:m,dispose:K}};var wn=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(wn||{}),wt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},hr={},H0={get exports(){return hr},set exports(i){hr=i}};/*!
528
+ `)}switch(this.mode){case lt.EVAL:this.source+=" ; "+t+`
529
+ `;break;case lt.ESCAPED:this.source+=" ; __append(escapeFn("+Gc(t)+`))
530
+ `;break;case lt.RAW:this.source+=" ; __append("+Gc(t)+`)
531
+ `;break;case lt.COMMENT:break;case lt.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const dr=.001,Nc=.01,W0="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",F0=(i,t)=>{var ae,oe,ye,Pe,Ae,_e,be,Fe;let e=t==null?void 0:t.container,n=1.4;const o=(ae=t==null?void 0:t.wait)!=null?ae:200,s=(oe=t==null?void 0:t.maxNumberOnScreen)!=null?oe:3,r=(ye=t==null?void 0:t.minRad)!=null?ye:Math.PI/4,a=(Pe=t==null?void 0:t.nearTolerance)!=null?Pe:100,l=(Ae=t==null?void 0:t.upsideHeight)!=null?Ae:1.6,c=(_e=t==null?void 0:t.minDistance)!=null?_e:1.2,d=(be=t==null?void 0:t.maxDistance)!=null?be:3.5,h=vo(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,B0);const m=new ve.Subscribe;let g=new Image;g.src=W0;const v={points:[],origins:[],tags:[],template:"",events:{},render:G0,folded:!1,enabled:!0,forbidden:!0},A=new z0({target:u,props:{origins:v.origins}}),b=(fe,we)=>{x(),we&&I()},y=()=>{v.forbidden&&(v.forbidden=!1,I())},C=(fe,we)=>{if(v.tags.length===0)return;const Te=we.longitude-i.state.longitude,pe=i.camera.clone();pe.position.copy(we.offset),pe.rotateOnWorldAxis(new E.Vector3(0,1,0),Te),pe.updateProjectionMatrix(),pe.updateMatrixWorld(!0);const Je=new E.Frustum,dt=new E.Matrix4;dt.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),Je.setFromProjectionMatrix(dt),v.tags.forEach(De=>{const ot=pe.position.clone().setY(n).distanceTo(De.position);if(ot<c||ot>d||!Je.containsPoint(De.position))return De.destroying=!0;const re=De.position.clone().sub(pe.position).setY(0);if(re.angleTo(De.normal)>Math.PI/2-r&&re.angleTo(De.normal)<Math.PI/2+r)return De.destroying=!0}),v.tags.forEach(De=>{De.destroying?De.app.$set({contentZoom:.1+pe.position.distanceTo(De.position)/d,lineWidthZoom:.38*(.01+pe.position.distanceTo(De.position)/d),destroying:De.destroying}):De.app.$set({lineWidthZoom:.38*(.01+pe.position.distanceTo(De.position)/d),lineHeightZoom:.4+(pe.position.distanceTo(De.position)-c)/d*.6,contentZoom:.1+pe.position.distanceTo(De.position)/d})}),setTimeout(()=>{v.tags.forEach(De=>{De.destroying&&(De.app.$destroy(),De=null)}),v.tags=v.tags.filter(De=>!De.destroying),x()},1900)},D=fe=>{fe!==ve.Five.Mode.Panorama&&!v.forbidden&&(A.$set({origins:[]}),v.tags.forEach(we=>{we.app.$destroy(),we=null}),v.origins=[],v.tags=[],v.forbidden=!0)},x=()=>{if(v.forbidden||!v.enabled)return;const fe=i.camera,we=fe.getWorldDirection(new E.Vector3);v.origins=v.tags.map(Te=>{const pe=Te.position.clone().project(fe),Je=Te.position.clone().sub(fe.position).setY(0).angleTo(we.setY(0))<Math.PI/2;return{id:Te.id,front:Je,left:(pe.x+1)/2*100,top:(-pe.y+1)/2*100,destroying:Te.destroying}}),A.$set({origins:v.origins})},I=()=>{v.forbidden||!v.enabled||(v.timeoutId&&clearTimeout(v.timeoutId),v.timeoutId=setTimeout(()=>{v.timeoutId=void 0;const fe=T();fe.length&&(v.tags=v.tags.concat(fe),x())},o))},T=()=>{const{clientWidth:fe,clientHeight:we}=i.getElement(),Te=[],pe=i.camera,Je=new E.Frustum,dt=new E.Matrix4,De=pe.getWorldDirection(new E.Vector3);dt.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),Je.setFromProjectionMatrix(dt);const ot=v.tags.filter(xe=>Je.containsPoint(xe.position)&&!xe.destroying).length,re=v.points.reduce((xe,Ne)=>{if(v.tags.find(Qe=>Ne.id===Qe.id&&!Qe.destroying))return xe;const ft=pe.position.clone().setY(n).distanceTo(Ne.position);if(ft<c||ft>d||!Je.containsPoint(Ne.position))return xe;const Yt=Ne.position.clone().sub(pe.position).setY(0);if(Yt.angleTo(Ne.normal)>Math.PI/2-r&&Yt.angleTo(Ne.normal)<Math.PI/2+r)return xe;const At=Ne.position.clone().project(pe);if(!v.tags.every(Qe=>{if(Qe.position.clone().sub(pe.position).setY(0).angleTo(De.setY(0))>Math.PI/2)return!0;const Ye=Qe.position.clone().project(pe);return Math.sqrt(Math.pow((At.x-Ye.x)/2*fe,2)+Math.pow((At.y-Ye.y)/2*we,2))>a}))return xe;const bt={id:Ne.id,position:Ne.position,normal:Ne.normal,replacement:Ne.replacement,weight:Ne.weight,distance:ft};let Ve;for(let Qe=0,Ye=xe.length;Qe<Ye;Qe++){const St=xe[Qe];if(bt.weight>St.weight){Ve=Qe;break}if(bt.distance<St.distance){Ve=Qe;break}}return Ve!==void 0?xe.splice(Ve,0,bt):xe.push(bt),xe},[]);for(let xe=0,Ne=re.length;xe<Ne&&!(ot+Te.length>=s);xe++){const ft=re[xe];if(Te.find(Ve=>ft.id===Ve.id))continue;const Yt=ft.position.clone().project(pe);if(!v.tags.concat(Te).every(Ve=>{if(Ve.position.clone().sub(pe.position).setY(0).angleTo(De.setY(0))>Math.PI/2)return!0;const Qe=Ve.position.clone().project(pe);return Math.sqrt(Math.pow((Yt.x-Qe.x)/2*fe,2)+Math.pow((Yt.y-Qe.y)/2*we,2))>a}))continue;const At=new E.Raycaster(pe.position.clone().setY(n),ft.position.clone().sub(pe.position.clone().setY(n)).normalize(),0,ft.distance+Nc),[bt]=v.intersectObjects?At.intersectObjects(v.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(At):At.intersectObjects(i.model.children,!0);if(bt&&ft.distance-bt.distance<Nc){const{position:Ve,normal:Qe,id:Ye,replacement:St}=ft,Fi=new E.Plane().setFromNormalAndCoplanarPoint(Qe,Ve),Ot=Ve.clone().sub(pe.position).cross(new E.Vector3(0,1,0)).setLength(dr),fn=[Ve.clone(),Ve.clone().add(Ot),Ve.clone().add(new E.Vector3(0,dr,0)).add(Ot),Ve.clone().add(new E.Vector3(0,dr,0))].map(mi=>Fi.projectPoint(mi,new E.Vector3)),{container:xn,dispose:mt}=h.create3DDomContainer(fn)||{},fi=new O0({target:xn,props:{id:Ye,content:v.render(v.template,St),lineWidthZoom:.38*(.01+pe.position.distanceTo(Ve)/d),lineHeightZoom:.4+(pe.position.distanceTo(Ve)-c)/d*.6,contentZoom:.1+pe.position.distanceTo(Ve)/d,upsideDown:Ve.y>l,folded:v.folded,events:v.events,hooks:m,dispose:mt}});Te.push({position:Ve,normal:Qe,id:Ye,app:fi})}}return Te},S=fe=>{v.points=fe.points.map(we=>{var Te,pe;return{id:we.id,position:new E.Vector3().fromArray(we.position),normal:new E.Vector3().fromArray(we.normal),replacement:(Te=we.replacement)!=null?Te:{},weight:(pe=we.weight)!=null?pe:-1}}),fe.render&&(v.render=fe.render),fe.template&&(v.template=fe.template),fe.events&&(v.events=fe.events),fe.enabled===!1&&(v.enabled=fe.enabled),fe.folded===!0&&(v.folded=fe.folded)},H=fe=>{v.intersectObjects=fe,I()},X=()=>{v.enabled=!0,I()},N=()=>{v.enabled=!1,A.$set({origins:[]}),v.tags.forEach(fe=>{fe.app.$destroy(),fe=null}),v.origins=[],v.tags=[]},G=()=>{v.folded=!1,v.tags.forEach(fe=>{fe.app.$set({folded:v.folded})})},j=()=>{v.folded=!0,v.tags.forEach(fe=>{fe.app.$set({folded:v.folded})})},R=fe=>{v.tags.forEach(we=>{we.id===fe&&we.app.$set({folded:!1})})},Z=fe=>{v.tags.forEach(we=>{we.id===fe&&we.app.$set({folded:!0})})},q=()=>{i.once("renderFrame",x)},Y=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(u),v.forbidden=!1,n=i.model.bounding.getCenter(new E.Vector3).y,I(),i.on("panoWillArrive",C),i.on("panoArrived",y),i.on("modeChange",D),i.on("cameraUpdate",b)},K=()=>{g=null,h.disposeAll(),A.$destroy(),v.tags.forEach(fe=>{fe.app.$destroy(),fe=null}),v.origins=[],v.tags=[],i.off("modelLoaded",Y),i.off("renderFrame",x),i.off("panoWillArrive",C),i.off("panoArrived",y),i.off("modeChange",D),i.off("cameraUpdate",b),i.off("dispose",K),window.removeEventListener("resize",q,!1)};return window.addEventListener("resize",q,!1),(Fe=i==null?void 0:i.model)!=null&&Fe.loaded?Y():i.once("modelLoaded",Y),i.on("dispose",K),{load:S,setIntersectObjects:H,unfoldAll:G,foldAll:j,unfold:R,fold:Z,enable:X,disable:N,hooks:m,dispose:K}};var wn=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(wn||{}),wt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},hr={},H0={get exports(){return hr},set exports(i){hr=i}};/*!
532
532
  Copyright (c) 2018 Jed Watson.
533
533
  Licensed under the MIT License (MIT), see
534
534
  http://jedwatson.github.io/classnames
@@ -548,7 +548,7 @@ void main() {
548
548
  width: 100%;
549
549
  height: 100%;
550
550
  z-index: 5;
551
- `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=yv(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var A;if(e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new bv({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},d=()=>{i.off("modeChange",h)},h=A=>{if(A!==ve.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Cv={name:"ItemLabelPlugin",version:0};class Iv extends zi{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(Ie(W({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(Ie(W({},e),{userAction:!0}))}show(e){if(this.state.enabled)return this.setState(Ie(W({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(this.state.enabled)return this.setState(Ie(W({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=W({},this.state);this.state=W(W(W({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===ve.Five.Mode.Panorama}appendTo(e){this.enabled&&(this.container=e,this.render())}updateState(e){this.setState(Ie(W({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Ev(i){me(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function kv(i){let t,e,n,o,s,r,a,l;return{c(){t=V("div"),e=V("div"),n=V("span"),n.textContent=`${i[8]}`,o=se(),s=V("i"),w(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),w(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),w(e,"class",r=Oe(nt("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),w(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),w(e,"data-camera-toward",i[7]),w(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),w(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){O(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=ke(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=Oe(nt("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&w(e,"class",r)},i:J,o:J,d(c){c&&_(t),i[10](null),a=!1,l()}}}function xv(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:h,name:u}=n;const m=()=>{if(!r||!a||!l||!s)return;const A=s.current.clientWidth/window.innerWidth*100,b=s.current.clientHeight/window.innerHeight*100;r<=A/2||r>=100-A/2||a<=b/2||a>=100-b/2},g=A=>{o&&o()};function v(A){qe[A?"unshift":"push"](()=>{s=A,e(2,s)})}return i.$$set=A=>{"props"in A&&e(0,n=A.props),"onClick"in A&&e(1,o=A.onClick)},m(),[n,o,s,r,a,l,c,h,u,g,v]}class Dv extends de{constructor(t){super(),ce(this,t,xv,kv,le,{props:0,onClick:1},Ev)}}function Sv(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Lv(i){const{camera:t}=i,e=t.getWorldDirection(new B.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function Mv(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Tv(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const zv={userAction:!0};class jv extends Iv{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,d=e==null?void 0:e.find(h=>h.floor_index===c);if(d){const h=d.rooms.find(u=>u.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const d=l.position.clone(),h=d.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const u=new B.Raycaster,m=d.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var d,h,u,m,g,v,A,b,y,C,D,x;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new B.Vector3),l=[],c=[...this.labelItems];if(c.forEach((I,T)=>{if(I.visible){const S=n.position.distanceTo(I.position),H=I.position.clone().add(new B.Vector3(0,this.OffsetHeight,0)),N=H.clone().sub(n.position).normalize().angleTo(a),G=H.clone().project(n),j=(G.x+1)/2.2*100,R=(-G.y+1)/2.2*100,Z=j>=0&&j<=100&&R>=0&&R<=100&&S>this.MinVisibledistance&&S<=this.MaxVisibledistance;I.left=j,I.top=R,I.inSight=Z&&N<Math.PI/2,I.cameraToward=Lv(this.five),Z?l.push({disFromCameraToLabel:S,left:j,top:R,index:T}):I.transform="translate(-50%, -50%)"}else I.inSight=!1}),l.length>1){let I=0;l.sort((T,S)=>S.disFromCameraToLabel-T.disFromCameraToLabel);for(let T=1;T<l.length;T++){const{index:S,left:H,top:X}=l[T-1],{index:N,left:G,top:j}=l[T],R=this.container.children[S],Z=this.container.children[N];if(!R||!Z)return;const q={left:s*H/100,top:r*X/100,width:(u=(h=(d=R.children)==null?void 0:d[0])==null?void 0:h.clientWidth)!=null?u:0,height:(v=(g=(m=R.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?v:0},Y={left:s*G/100,top:r*j/100,width:(y=(b=(A=Z.children)==null?void 0:A[0])==null?void 0:b.clientWidth)!=null?y:0,height:(x=(D=(C=Z.children)==null?void 0:C[0])==null?void 0:D.clientHeight)!=null?x:0};Sv(q,Y)&&(I++,c[S].transform=`translate(-50%, ${(I-1)*100-50}%)`,c[N].transform=`translate(-50%, ${I*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(d=>d.panoIndex===l.panoIndex&&d.name===e)){const d=l.standingPosition,h=n.distanceTo(d);h<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const d=new B.Vector3(0,0,-1),h=r.clone(),u=new B.Quaternion;u.setFromUnitVectors(d,h);const m=new B.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(d=>!!(d&&d.name===r.name)),l=this.five.work.observers.filter((d,h)=>!!r.observer_indexs.find(u=>u===h));a&&a.forEach(d=>{const h=d.position;let u=1/0,m;l.forEach(v=>{const A=v.standingPosition,b={x:A.x,y:A.y,z:A.z},y=Mv(h,b);y<u&&(u=y,m=b)}),m&&(h.y=m.y+.01);const g=new B.Vector3(h.x,h.y,h.z);g.add(new B.Vector3(-.2,1.8,0).applyEuler(new B.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:g,toward:Tv(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>Ie(W({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:zv.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Dv({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const _v=i=>new jv(i);var it={},Vv={get exports(){return it},set exports(i){it=i}};function Uo(i){return i===null?"null":typeof i=="undefined"?"undefined":typeof i=="object"?Array.isArray(i)?"array":"object":typeof i}function $c(i){return Uo(i)==="object"?fr(i):Uo(i)==="array"?ur(i):i}function ur(i){return i.map($c)}function fr(i){const t={};for(const e in i)i.hasOwnProperty(e)&&(t[e]=$c(i[e]));return t}function qo(i,t=[],e={}){const n={arrayBehaviour:e.arrayBehaviour||"replace"},o=t.map(r=>r||{}),s=i||{};for(let r=0;r<o.length;r++){const a=o[r],l=Object.keys(a);for(let c=0;c<l.length;c++){const d=l[c],h=a[d],u=Uo(h),m=Uo(s[d]);if(u==="object")if(m!=="undefined"){const g=m==="object"?s[d]:{};s[d]=qo({},[g,fr(h)],n)}else s[d]=fr(h);else if(u==="array")if(m==="array"){const g=ur(h);s[d]=n.arrayBehaviour==="merge"?s[d].concat(g):g}else s[d]=ur(h);else s[d]=h}}return s}Vv.exports=function(t,...e){return qo(t,e)},it.noMutate=function(...t){return qo({},t)},it.withOptions=function(t,e,n){return qo(t,e,n)};function Ov(i,t){console.warn(`⛔ ==> [${i}]: ${t}`)}function ed(i,t){console.warn(`🚫 ==> [${i}]: ${t}`)}var Jo={},Bv=Qv;function Qv(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Rv=Gv;function Gv(i,t,e){return i[0]=t,i[1]=e,i}var Nv=Wv;function Wv(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var Fv=Hv;function Hv(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var Xv=Yv;function Yv(i,t){return i[0]*t[0]+i[1]*t[1]}var Uv=Bv,mr=Rv,td=Nv,qv=Fv,Jv=Xv,nd=[0,0];Jo.computeMiter=function(t,e,n,o,s){return Uv(t,n,o),td(t,t),mr(e,-t[1],t[0]),mr(nd,-n[1],n[0]),s/Jv(e,nd)},Jo.normal=function(t,e){return mr(t,-e[1],e[0]),t},Jo.direction=function(t,e,n){return qv(t,e,n),td(t,t),t};var Xt=Jo,Cn=[0,0],Zo=[0,0],id=[0,0],Vi=[0,0],Zv=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(Xt.direction(Cn,a,r),e||(e=[0,0],Xt.normal(e,Cn)),s===1&&pr(n,e,1),!l)Xt.normal(e,Cn),pr(n,e,1);else{Xt.direction(Zo,l,a);var c=Xt.computeMiter(id,Vi,Cn,Zo,1);pr(n,Vi,c)}}if(i.length>2&&t){var d=i[o-2],h=i[0],u=i[1];Xt.direction(Cn,h,d),Xt.direction(Zo,u,h),Xt.normal(e,Cn);var m=Xt.computeMiter(id,Vi,Cn,Zo,1);n[0][0]=Vi.slice(),n[o-1][0]=Vi.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function pr(i,t,e){i.push([[t[0],t[1]],e])}const Kv=2,$v=3,eA=3,tA=2;function nA(i){const t=i.width,n=i.unitLength/t,o=t/2,s=i.path;if(s.length===0)return{geometry:new E.BufferGeometry,maxU:0};const r=new E.CurvePath;s.forEach(I=>{const T=iA(I);T&&r.add(T)});const a=Math.ceil(r.getLength()*100),l=r.getPoints(a),c=l.length,d=Zv(l.map(I=>[I.x,I.z])),u=(c-1)*Kv*$v,m=2*c,g=m*eA,v=m*tA,A=new Uint32Array(u),b=new Float32Array(g),y=new Float32Array(v);let C=0,D=0;for(let I=0;I<l.length;I++){const[T,S]=d[I][0],H=l[I],{x:X,y:N,z:G}=H,j=new B.Vector3(X+T*o,N+.05,G+S*o);b[I*6+0]=j.x,b[I*6+1]=j.y,b[I*6+2]=j.z;const R=new B.Vector3(X-T*o,N+.05,G-S*o);b[I*6+3]=R.x,b[I*6+4]=R.y,b[I*6+5]=R.z,C+=I>0?l[I-1].clone().sub(l[I]).length():0;const Z=C/t/n;if(D=Z,y[I*4+0]=0,y[I*4+1]=Z,y[I*4+2]=1,y[I*4+3]=Z,i.skipPositions){const q=new E.Vector3().lerpVectors(j,R,.5);if(i.skipPositions.some(K=>K.distanceTo(q)<.26))continue}I!==l.length-1&&(A[I*6+0]=I*2+0,A[I*6+1]=I*2+2,A[I*6+2]=I*2+1,A[I*6+3]=I*2+2,A[I*6+4]=I*2+3,A[I*6+5]=I*2+1)}const x=new E.BufferGeometry;return x.setAttribute("position",new E.BufferAttribute(b,3)),x.setAttribute("uv",new E.BufferAttribute(y,2)),x.setIndex(new E.BufferAttribute(A,1)),{geometry:x,maxU:D}}function iA(i){if(oA(i)){const t=[i.closed,i.curve_type,i.tension],e=i.points.map(o=>new E.Vector3().fromArray(o));return new E.CatmullRomCurve3(e,...t)}}function oA(i){return i.type==="CatmullRomCurve3"}function sA(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(It(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(It(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Ge=i=>i;function gr(i){if(i.length<3)return;const t=i.map(ki),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function rA(i){return i.stickType==="Plane"}function aA(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function ot(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function lA(i){return i.stickType==="Plane"&&i.contentType==="MediaPlane"}function Ko(i){if(i)if(Array.isArray(i)&&i.length===4){const e=i.map(ki);return xi(e[0],e[2])}else return ki(i)}function cA(i){if(ot(i)&&i.matrix){const t=new B.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new B.Vector3().fromArray(n).applyMatrix4(t));return xi(e[0],e[2])}else return Ko(i.position)}function Oi(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function dA(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function hA(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const od=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function uA(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function fA(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function sd(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function mA(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const ai="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Bi={};var vr=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(vr||{});function pA(i,t){const e=(t==null?void 0:t.namespace)||"default",n=Bi[e]||(Bi[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===ai);return o||(console.warn("未找到缓存音频,已新建",Bi),o=new rd(ai),n.push(o)),i&&(o.src=i),o}function gA(i,t){const e=(t==null?void 0:t.namespace)||"default",n=Bi[e]||(Bi[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new rd(ai))}class rd extends Audio{constructor(e){super(e);f(this,"preload","auto");f(this,"crossOrigin","anonymous");f(this,"realSrc","");f(this,"inited",!1);f(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const n=()=>vA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===ai||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=ai}}function vA(i){i&&(i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===ai&&i.play()))}const AA={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class bA extends zi{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,d,h,u;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(d=s.work)==null?void 0:d.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const m=l.get(n);return m||(l.set(n,{}),l.get(n))}return(u=l.get(n))==null?void 0:u[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const yA=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;function Le(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}Le.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},Le.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],Le.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}},Le.prototype._objectCtxInit=function(i){i._3xDomEvent={}},Le.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent},Le.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent},Le.prototype._objectCtxGet=function(i){return i._3xDomEvent},Le.prototype.camera=function(i){return i&&(this._camera=i),this._camera},Le.prototype.bind=function(i,t,e,n){console.assert(Le.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)},Le.prototype.addEventListener=Le.prototype.bind,Le.prototype.unbind=function(i,t,e,n){console.assert(Le.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)},Le.prototype.removeEventListener=Le.prototype.unbind,Le.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1},Le.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,d,h=r[0],u=h.object;this._selected=u,d=this._bound("mousemove",u),a!=u&&(l=this._bound("mouseover",u),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;d&&this._notify("mousemove",u,n,h),l&&this._notify("mouseover",u,n,h),c&&this._notify("mouseout",a,n,h)}},Le.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),d=l.parent;typeof c=="undefined"&&d;)c=this._objectCtxGet(d),d=d.parent;c&&this._notify(i,l,n,a)}}},Le.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}},Le.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)},Le.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)},Le.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)},Le.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)},Le.prototype._onClick=function(i){this._onMouseEvent("click",i)},Le.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)},Le.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)},Le.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)},Le.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)},Le.prototype._onTouchMove=function(i){if(i.touches.length==1){var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}},Le.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class wA extends bA{constructor(e){super(e);f(this,"tags",[]);f(this,"config",AA);f(this,"mediaStore",Us({currentMediaElement:null}));f(this,"css3DRenderPlugin");f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"domEvents");f(this,"mouseInfo");f(this,"preventWhenMouseDown",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new Le(this.five.camera,n)),this.five.on("wantsMoveToPano",this.preventWhenMouseDown),this.five.on("wantsTapGesture",this.preventWhenMouseDown),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.preventWhenMouseDown),this.five.off("wantsTapGesture",this.preventWhenMouseDown)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[d]=c;e.contentType===d&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[d="Any",h="Any"]=c;(e.stickType===d||d==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[d="Any",h,u]=c;if(h==="Audio"&&e.contentType==="Audio"){const m=e;(m.stickType===d||d==="Any")&&m.data.appearance===u&&(n[l]=this.config.contentTypeConfig[l])}}});const o=it({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){yA&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}return!0}getRenderType(e){const n=this.getTagConfig(e);if(!n||typeof n!="object"||!n.renderType)return"Dom";const o=e.data.mediaData;if(!o||o.length===0)return"Dom";if(n.renderType==="Mesh"){if(lA(e))if(o.length===1){if(o[0].type==="Image")return"Mesh";if(o[0].type==="Video")return"Dom"}else return"Dom";else if(ot(e))return o.length===1&&o[0].type==="Image"?"Mesh":"BehindDom"}else return"Dom"}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const d=(()=>e.stickType==="3DPoint"?ki(e.normal):gr(e.position))();if(!d)return;const h=Ko(e.position);if(!h)return;const u=new E.Vector3().copy(c).sub(h),m=d.angleTo(u)*180/Math.PI;return s.angle=m,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const d=cA(e);if(!d)return-1;const h=c.distanceTo(d);return s.distance=h,h}}getPositions(e){if(rA(e))return e.position;if(ot(e))return e.data.mediaPosition;const n=e;return hA(this.five.camera.position,It(n.position),It(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=()=>!(!e.state.visible||!this.state.visible||ot(e)&&!e.mediaVisible),r=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo={x:h.clientX,y:h.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo&&(this.mouseInfo.isDown&&this.mouseInfo.x===h.clientX&&this.mouseInfo.y===h.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)},l=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo={x:Math.floor(h.touches[0].clientX),y:Math.floor(h.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo&&(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(h.changedTouches[h.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(h.changedTouches[h.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{this.domEvents&&(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return It(e.normal);if(e.stickType==="Plane")return gr(e.position);if(e.stickType==="Model")return gr(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.getRenderType(e)==="Mesh")}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filterCSS3DTag(){return this.tags.filter(n=>n.stickType==="3DPoint"||n.stickType==="Plane"||n.stickType==="Model").filter(n=>{const o=this.getRenderType(n);return o==="BehindDom"||o==="Dom"})}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class PA extends wA{constructor(e){super(e);f(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(ot(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var d,h,u;const l=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(u=e.fiveState)==null?void 0:u.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Oi(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const m=this.getRaycasterFromPanoIndex(e,s);if(!m)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${m}`};const g=this.getTagEnableByIntersect(e,m);if(g.value===!1)return g}if(l.angleRange&&aA(e)){const m=this.getAngle(e);if(Oi(m,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${m}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=ot(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&Oi(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Oi(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const d=this.filterPointTag.filter(u=>this.getVisibleByPanoIndex(u)).filter(u=>{const m=this.getTagProject(u);if(!m)return!1;const{x:g,y:v,z:A}=m;return!(Math.abs(A)>1||Math.abs(g)>1||Math.abs(v)>1)}).map(u=>({tag:u,id:u.id,tagConfig:this.getTagConfig(u).unfoldedConfig})).filter(({tag:u,tagConfig:m})=>{var g,v;return!(typeof m!="object"||m.keep||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((v=m.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance")}).map(u=>Ie(W({},u),{distance:this.getDistance(u.tag)})).filter(({distance:u,tagConfig:m})=>{var g,v;return!(u===void 0||typeof m!="object"||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((v=m.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance"||m.autoUnfold.distance&&Oi(u,m.autoUnfold.distance)===!1)}).sort((u,m)=>u.distance-m.distance).findIndex(u=>u.id===e.id);if(d===-1||d<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisible(){this.tags.forEach(e=>{const n=this.getVisible(e);e.state&&(e.state.visible=n)})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!ot(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Ko(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var d,h,u;const o=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!ot(e))return;const m=this.tags.filter(ot).map(v=>{var A;return(A=v.model)==null?void 0:A.object}).filter(Rn);return n.intersectObjects(m,!0)[0]})(),l=(()=>{var m;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(m=o.intersectRaycaster.distanceAccuracy)!=null?m:.01})(),c=Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(u=a==null?void 0:a.distance)!=null?u:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
551
+ `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=yv(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var A;if(e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new bv({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},d=()=>{i.off("modeChange",h)},h=A=>{if(A!==ve.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Cv={name:"ItemLabelPlugin",version:0};class Iv extends zi{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(Ie(W({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(Ie(W({},e),{userAction:!0}))}show(e){if(this.state.enabled)return this.setState(Ie(W({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(this.state.enabled)return this.setState(Ie(W({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=W({},this.state);this.state=W(W(W({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===ve.Five.Mode.Panorama}appendTo(e){this.enabled&&(this.container=e,this.render())}updateState(e){this.setState(Ie(W({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Ev(i){me(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function kv(i){let t,e,n,o,s,r,a,l;return{c(){t=V("div"),e=V("div"),n=V("span"),n.textContent=`${i[8]}`,o=se(),s=V("i"),w(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),w(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),w(e,"class",r=Oe(nt("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),w(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),w(e,"data-camera-toward",i[7]),w(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),w(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){O(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=ke(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=Oe(nt("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&w(e,"class",r)},i:J,o:J,d(c){c&&_(t),i[10](null),a=!1,l()}}}function xv(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:h,name:u}=n;const m=()=>{if(!r||!a||!l||!s)return;const A=s.current.clientWidth/window.innerWidth*100,b=s.current.clientHeight/window.innerHeight*100;r<=A/2||r>=100-A/2||a<=b/2||a>=100-b/2},g=A=>{o&&o()};function v(A){qe[A?"unshift":"push"](()=>{s=A,e(2,s)})}return i.$$set=A=>{"props"in A&&e(0,n=A.props),"onClick"in A&&e(1,o=A.onClick)},m(),[n,o,s,r,a,l,c,h,u,g,v]}class Dv extends de{constructor(t){super(),ce(this,t,xv,kv,le,{props:0,onClick:1},Ev)}}function Sv(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Lv(i){const{camera:t}=i,e=t.getWorldDirection(new B.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function Mv(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Tv(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const zv={userAction:!0};class jv extends Iv{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,d=e==null?void 0:e.find(h=>h.floor_index===c);if(d){const h=d.rooms.find(u=>u.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const d=l.position.clone(),h=d.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const u=new B.Raycaster,m=d.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var d,h,u,m,g,v,A,b,y,C,D,x;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new B.Vector3),l=[],c=[...this.labelItems];if(c.forEach((I,T)=>{if(I.visible){const S=n.position.distanceTo(I.position),H=I.position.clone().add(new B.Vector3(0,this.OffsetHeight,0)),N=H.clone().sub(n.position).normalize().angleTo(a),G=H.clone().project(n),j=(G.x+1)/2.2*100,R=(-G.y+1)/2.2*100,Z=j>=0&&j<=100&&R>=0&&R<=100&&S>this.MinVisibledistance&&S<=this.MaxVisibledistance;I.left=j,I.top=R,I.inSight=Z&&N<Math.PI/2,I.cameraToward=Lv(this.five),Z?l.push({disFromCameraToLabel:S,left:j,top:R,index:T}):I.transform="translate(-50%, -50%)"}else I.inSight=!1}),l.length>1){let I=0;l.sort((T,S)=>S.disFromCameraToLabel-T.disFromCameraToLabel);for(let T=1;T<l.length;T++){const{index:S,left:H,top:X}=l[T-1],{index:N,left:G,top:j}=l[T],R=this.container.children[S],Z=this.container.children[N];if(!R||!Z)return;const q={left:s*H/100,top:r*X/100,width:(u=(h=(d=R.children)==null?void 0:d[0])==null?void 0:h.clientWidth)!=null?u:0,height:(v=(g=(m=R.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?v:0},Y={left:s*G/100,top:r*j/100,width:(y=(b=(A=Z.children)==null?void 0:A[0])==null?void 0:b.clientWidth)!=null?y:0,height:(x=(D=(C=Z.children)==null?void 0:C[0])==null?void 0:D.clientHeight)!=null?x:0};Sv(q,Y)&&(I++,c[S].transform=`translate(-50%, ${(I-1)*100-50}%)`,c[N].transform=`translate(-50%, ${I*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(d=>d.panoIndex===l.panoIndex&&d.name===e)){const d=l.standingPosition,h=n.distanceTo(d);h<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const d=new B.Vector3(0,0,-1),h=r.clone(),u=new B.Quaternion;u.setFromUnitVectors(d,h);const m=new B.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(d=>!!(d&&d.name===r.name)),l=this.five.work.observers.filter((d,h)=>!!r.observer_indexs.find(u=>u===h));a&&a.forEach(d=>{const h=d.position;let u=1/0,m;l.forEach(v=>{const A=v.standingPosition,b={x:A.x,y:A.y,z:A.z},y=Mv(h,b);y<u&&(u=y,m=b)}),m&&(h.y=m.y+.01);const g=new B.Vector3(h.x,h.y,h.z);g.add(new B.Vector3(-.2,1.8,0).applyEuler(new B.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:g,toward:Tv(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>Ie(W({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:zv.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Dv({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const _v=i=>new jv(i);function Vv(i,t){console.warn(`⛔ ==> [${i}]: ${t}`)}function $c(i,t){console.warn(`🚫 ==> [${i}]: ${t}`)}var Uo={},Ov=Bv;function Bv(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Qv=Rv;function Rv(i,t,e){return i[0]=t,i[1]=e,i}var Gv=Nv;function Nv(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var Wv=Fv;function Fv(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var Hv=Xv;function Xv(i,t){return i[0]*t[0]+i[1]*t[1]}var Yv=Ov,ur=Qv,ed=Gv,Uv=Wv,qv=Hv,td=[0,0];Uo.computeMiter=function(t,e,n,o,s){return Yv(t,n,o),ed(t,t),ur(e,-t[1],t[0]),ur(td,-n[1],n[0]),s/qv(e,td)},Uo.normal=function(t,e){return ur(t,-e[1],e[0]),t},Uo.direction=function(t,e,n){return Uv(t,e,n),ed(t,t),t};var Xt=Uo,Cn=[0,0],qo=[0,0],nd=[0,0],Vi=[0,0],Jv=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(Xt.direction(Cn,a,r),e||(e=[0,0],Xt.normal(e,Cn)),s===1&&fr(n,e,1),!l)Xt.normal(e,Cn),fr(n,e,1);else{Xt.direction(qo,l,a);var c=Xt.computeMiter(nd,Vi,Cn,qo,1);fr(n,Vi,c)}}if(i.length>2&&t){var d=i[o-2],h=i[0],u=i[1];Xt.direction(Cn,h,d),Xt.direction(qo,u,h),Xt.normal(e,Cn);var m=Xt.computeMiter(nd,Vi,Cn,qo,1);n[0][0]=Vi.slice(),n[o-1][0]=Vi.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function fr(i,t,e){i.push([[t[0],t[1]],e])}const Zv=2,Kv=3,$v=3,eA=2;function tA(i){const t=i.width,n=i.unitLength/t,o=t/2,s=i.path;if(s.length===0)return{geometry:new E.BufferGeometry,maxU:0};const r=new E.CurvePath;s.forEach(I=>{const T=nA(I);T&&r.add(T)});const a=Math.ceil(r.getLength()*100),l=r.getPoints(a),c=l.length,d=Jv(l.map(I=>[I.x,I.z])),u=(c-1)*Zv*Kv,m=2*c,g=m*$v,v=m*eA,A=new Uint32Array(u),b=new Float32Array(g),y=new Float32Array(v);let C=0,D=0;for(let I=0;I<l.length;I++){const[T,S]=d[I][0],H=l[I],{x:X,y:N,z:G}=H,j=new B.Vector3(X+T*o,N+.05,G+S*o);b[I*6+0]=j.x,b[I*6+1]=j.y,b[I*6+2]=j.z;const R=new B.Vector3(X-T*o,N+.05,G-S*o);b[I*6+3]=R.x,b[I*6+4]=R.y,b[I*6+5]=R.z,C+=I>0?l[I-1].clone().sub(l[I]).length():0;const Z=C/t/n;if(D=Z,y[I*4+0]=0,y[I*4+1]=Z,y[I*4+2]=1,y[I*4+3]=Z,i.skipPositions){const q=new E.Vector3().lerpVectors(j,R,.5);if(i.skipPositions.some(K=>K.distanceTo(q)<.26))continue}I!==l.length-1&&(A[I*6+0]=I*2+0,A[I*6+1]=I*2+2,A[I*6+2]=I*2+1,A[I*6+3]=I*2+2,A[I*6+4]=I*2+3,A[I*6+5]=I*2+1)}const x=new E.BufferGeometry;return x.setAttribute("position",new E.BufferAttribute(b,3)),x.setAttribute("uv",new E.BufferAttribute(y,2)),x.setIndex(new E.BufferAttribute(A,1)),{geometry:x,maxU:D}}function nA(i){if(iA(i)){const t=[i.closed,i.curve_type,i.tension],e=i.points.map(o=>new E.Vector3().fromArray(o));return new E.CatmullRomCurve3(e,...t)}}function iA(i){return i.type==="CatmullRomCurve3"}var ct={},oA={get exports(){return ct},set exports(i){ct=i}};function Jo(i){return i===null?"null":typeof i=="undefined"?"undefined":typeof i=="object"?Array.isArray(i)?"array":"object":typeof i}function id(i){return Jo(i)==="object"?pr(i):Jo(i)==="array"?mr(i):i}function mr(i){return i.map(id)}function pr(i){const t={};for(const e in i)i.hasOwnProperty(e)&&(t[e]=id(i[e]));return t}function Zo(i,t=[],e={}){const n={arrayBehaviour:e.arrayBehaviour||"replace"},o=t.map(r=>r||{}),s=i||{};for(let r=0;r<o.length;r++){const a=o[r],l=Object.keys(a);for(let c=0;c<l.length;c++){const d=l[c],h=a[d],u=Jo(h),m=Jo(s[d]);if(u==="object")if(m!=="undefined"){const g=m==="object"?s[d]:{};s[d]=Zo({},[g,pr(h)],n)}else s[d]=pr(h);else if(u==="array")if(m==="array"){const g=mr(h);s[d]=n.arrayBehaviour==="merge"?s[d].concat(g):g}else s[d]=mr(h);else s[d]=h}}return s}oA.exports=function(t,...e){return Zo(t,e)},ct.noMutate=function(...t){return Zo({},t)},ct.withOptions=function(t,e,n){return Zo(t,e,n)};function sA(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(It(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(It(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Ge=i=>i;function gr(i){if(i.length<3)return;const t=i.map(ki),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function rA(i){return i.stickType==="Plane"}function aA(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function it(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function lA(i){return i.stickType==="Plane"&&i.contentType==="MediaPlane"}function Ko(i){if(i)if(Array.isArray(i)&&i.length===4){const e=i.map(ki);return xi(e[0],e[2])}else return ki(i)}function cA(i){if(it(i)&&i.matrix){const t=new B.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new B.Vector3().fromArray(n).applyMatrix4(t));return xi(e[0],e[2])}else return Ko(i.position)}function Oi(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function dA(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function hA(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const od=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function uA(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function fA(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function sd(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function mA(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const ai="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Bi={};var vr=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(vr||{});function pA(i,t){const e=(t==null?void 0:t.namespace)||"default",n=Bi[e]||(Bi[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===ai);return o||(console.warn("未找到缓存音频,已新建",Bi),o=new rd(ai),n.push(o)),i&&(o.src=i),o}function gA(i,t){const e=(t==null?void 0:t.namespace)||"default",n=Bi[e]||(Bi[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new rd(ai))}class rd extends Audio{constructor(e){super(e);f(this,"preload","auto");f(this,"crossOrigin","anonymous");f(this,"realSrc","");f(this,"inited",!1);f(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const n=()=>vA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===ai||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=ai}}function vA(i){i&&(i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===ai&&i.play()))}const AA={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class bA extends zi{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,d,h,u;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(d=s.work)==null?void 0:d.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const m=l.get(n);return m||(l.set(n,{}),l.get(n))}return(u=l.get(n))==null?void 0:u[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const yA=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;function Le(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}Le.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},Le.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],Le.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}},Le.prototype._objectCtxInit=function(i){i._3xDomEvent={}},Le.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent},Le.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent},Le.prototype._objectCtxGet=function(i){return i._3xDomEvent},Le.prototype.camera=function(i){return i&&(this._camera=i),this._camera},Le.prototype.bind=function(i,t,e,n){console.assert(Le.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)},Le.prototype.addEventListener=Le.prototype.bind,Le.prototype.unbind=function(i,t,e,n){console.assert(Le.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)},Le.prototype.removeEventListener=Le.prototype.unbind,Le.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1},Le.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,d,h=r[0],u=h.object;this._selected=u,d=this._bound("mousemove",u),a!=u&&(l=this._bound("mouseover",u),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;d&&this._notify("mousemove",u,n,h),l&&this._notify("mouseover",u,n,h),c&&this._notify("mouseout",a,n,h)}},Le.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),d=l.parent;typeof c=="undefined"&&d;)c=this._objectCtxGet(d),d=d.parent;c&&this._notify(i,l,n,a)}}},Le.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}},Le.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)},Le.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)},Le.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)},Le.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)},Le.prototype._onClick=function(i){this._onMouseEvent("click",i)},Le.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)},Le.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)},Le.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)},Le.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)},Le.prototype._onTouchMove=function(i){if(i.touches.length==1){var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}},Le.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class wA extends bA{constructor(e){super(e);f(this,"tags",[]);f(this,"config",AA);f(this,"mediaStore",Us({currentMediaElement:null}));f(this,"css3DRenderPlugin");f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"domEvents");f(this,"mouseInfo");f(this,"preventWhenMouseDown",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new Le(this.five.camera,n)),this.five.on("wantsMoveToPano",this.preventWhenMouseDown),this.five.on("wantsTapGesture",this.preventWhenMouseDown),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.preventWhenMouseDown),this.five.off("wantsTapGesture",this.preventWhenMouseDown)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[d]=c;e.contentType===d&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[d="Any",h="Any"]=c;(e.stickType===d||d==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[d="Any",h,u]=c;if(h==="Audio"&&e.contentType==="Audio"){const m=e;(m.stickType===d||d==="Any")&&m.data.appearance===u&&(n[l]=this.config.contentTypeConfig[l])}}});const o=ct({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){yA&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}return!0}getRenderType(e){const n=this.getTagConfig(e);if(!n||typeof n!="object"||!n.renderType)return"Dom";const o=e.data.mediaData;if(!o||o.length===0)return"Dom";if(n.renderType==="Mesh"){if(lA(e))if(o.length===1){if(o[0].type==="Image")return"Mesh";if(o[0].type==="Video")return"Dom"}else return"Dom";else if(it(e))return o.length===1&&o[0].type==="Image"?"Mesh":"BehindDom"}else return"Dom"}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const d=(()=>e.stickType==="3DPoint"?ki(e.normal):gr(e.position))();if(!d)return;const h=Ko(e.position);if(!h)return;const u=new E.Vector3().copy(c).sub(h),m=d.angleTo(u)*180/Math.PI;return s.angle=m,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const d=cA(e);if(!d)return-1;const h=c.distanceTo(d);return s.distance=h,h}}getPositions(e){if(rA(e))return e.position;if(it(e))return e.data.mediaPosition;const n=e;return hA(this.five.camera.position,It(n.position),It(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=()=>!(!e.state.visible||!this.state.visible||it(e)&&!e.mediaVisible),r=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo={x:h.clientX,y:h.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo&&(this.mouseInfo.isDown&&this.mouseInfo.x===h.clientX&&this.mouseInfo.y===h.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)},l=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo={x:Math.floor(h.touches[0].clientX),y:Math.floor(h.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=d=>{if(!s()){this.mouseInfo=void 0;return}const h=d.origDomEvent;this.mouseInfo&&(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(h.changedTouches[h.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(h.changedTouches[h.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{this.domEvents&&(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return It(e.normal);if(e.stickType==="Plane")return gr(e.position);if(e.stickType==="Model")return gr(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.getRenderType(e)==="Mesh")}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filterCSS3DTag(){return this.tags.filter(n=>n.stickType==="3DPoint"||n.stickType==="Plane"||n.stickType==="Model").filter(n=>{const o=this.getRenderType(n);return o==="BehindDom"||o==="Dom"})}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class PA extends wA{constructor(e){super(e);f(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(it(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var d,h,u;const l=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(u=e.fiveState)==null?void 0:u.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Oi(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const m=this.getRaycasterFromPanoIndex(e,s);if(!m)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${m}`};const g=this.getTagEnableByIntersect(e,m);if(g.value===!1)return g}if(l.angleRange&&aA(e)){const m=this.getAngle(e);if(Oi(m,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${m}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=it(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&Oi(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Oi(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const d=this.filterPointTag.filter(u=>this.getVisibleByPanoIndex(u)).filter(u=>{const m=this.getTagProject(u);if(!m)return!1;const{x:g,y:v,z:A}=m;return!(Math.abs(A)>1||Math.abs(g)>1||Math.abs(v)>1)}).map(u=>({tag:u,id:u.id,tagConfig:this.getTagConfig(u).unfoldedConfig})).filter(({tag:u,tagConfig:m})=>{var g,v;return!(typeof m!="object"||m.keep||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((v=m.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance")}).map(u=>Ie(W({},u),{distance:this.getDistance(u.tag)})).filter(({distance:u,tagConfig:m})=>{var g,v;return!(u===void 0||typeof m!="object"||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((v=m.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance"||m.autoUnfold.distance&&Oi(u,m.autoUnfold.distance)===!1)}).sort((u,m)=>u.distance-m.distance).findIndex(u=>u.id===e.id);if(d===-1||d<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisible(){this.tags.forEach(e=>{const n=this.getVisible(e);e.state&&(e.state.visible=n)})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!it(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Ko(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var d,h,u;const o=(d=this.getTagConfig(e).visibleConfig)!=null?d:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!it(e))return;const m=this.tags.filter(it).map(v=>{var A;return(A=v.model)==null?void 0:A.object}).filter(Rn);return n.intersectObjects(m,!0)[0]})(),l=(()=>{var m;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(m=o.intersectRaycaster.distanceAccuracy)!=null?m:.01})(),c=Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(u=a==null?void 0:a.distance)!=null?u:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
552
552
  customModelIntersection.point is ${a==null?void 0:a.point.toArray()}, minIntersectionDistance is ${c}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var a;const o=(a=this.five.work.observers[n])==null?void 0:a.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=Ko(e.position);if(!s)return;const r=s.sub(o).normalize();return this.raycaster.set(o,r),this.raycaster}}function CA(i){me(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function ad(i){let t,e,n,o,s,r,a,l=i[3]&&ld(i);return{c(){t=V("div"),e=ze("svg"),n=ze("defs"),o=ze("linearGradient"),s=ze("stop"),r=ze("stop"),l&&l.c(),w(s,"offset","25%"),w(s,"stop-color",i[5]),w(s,"stop-opacity","1"),w(r,"offset","100%"),w(r,"stop-color",i[5]),w(r,"stop-opacity","0.5"),w(o,"x1",.5),w(o,"y1",.5),w(o,"x2",i[8]),w(o,"y2",.5),w(o,"id",i[10]),w(o,"gradientUnits","userSpaceOnUse"),w(e,"class","straight-line svelte-xuejcm"),w(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),w(e,"preserveAspectRatio","none"),w(t,"class","line svelte-xuejcm"),ee(t,"vertical",i[9]),ee(t,"horizontal",!i[9]),z(t,"width",i[8]+"px"),z(t,"height",i[7]+"px")},m(c,d){O(c,t,d),Q(t,e),Q(e,n),Q(n,o),Q(o,s),Q(o,r),l&&l.m(e,null)},p(c,d){d&32&&w(s,"stop-color",c[5]),d&32&&w(r,"stop-color",c[5]),d&256&&w(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=ld(c),l.c(),k(l,1),l.m(e,null)):l&&(he(),M(l,1,1,()=>{l=null}),ue()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&w(e,"viewBox",a),d&512&&ee(t,"vertical",c[9]),d&512&&ee(t,"horizontal",!c[9]),d&256&&z(t,"width",c[8]+"px"),d&128&&z(t,"height",c[7]+"px")},d(c){c&&_(t),l&&l.d()}}}function ld(i){let t,e,n,o,s;return{c(){t=ze("path"),w(t,"fill","none"),w(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),w(t,"stroke-width",1),w(t,"d",i[6])},m(r,a){O(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&w(t,"stroke",e),(!s||a&64)&&w(t,"d",i[6])},i(r){s||(r&&et(()=>{s&&(o&&o.end(1),n=vn(t,zo,{duration:i[2],delay:i[0],easing:tn}),n.start())}),s=!0)},o(r){n&&n.invalidate(),r&&(o=Zn(t,zo,{duration:i[2],delay:i[1],easing:tn})),s=!1},d(r){r&&_(t),r&&o&&o.end()}}}function IA(i){let t,e=i[8]&&ad(i);return{c(){e&&e.c(),t=Ee()},m(n,o){e&&e.m(n,o),O(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=ad(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:J,o:J,d(n){e&&e.d(n),n&&_(t)}}}function EA(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:h}=t,{direction:u="horizontal"}=t,{useLinearColor:m=!1}=t,{color:g="white"}=t;const v=ut();return i.$$set=A=>{"inDelay"in A&&e(0,a=A.inDelay),"outDelay"in A&&e(1,l=A.outDelay),"duration"in A&&e(2,c=A.duration),"unfolded"in A&&e(3,d=A.unfolded),"length"in A&&e(11,h=A.length),"direction"in A&&e(12,u=A.direction),"useLinearColor"in A&&e(4,m=A.useLinearColor),"color"in A&&e(5,g=A.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=h),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${h}`)},e(7,s=1),[a,l,c,d,m,g,r,s,o,n,v,h,u]}class Ar extends de{constructor(t){super(),ce(this,t,EA,IA,le,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},CA)}}function kA(i){me(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function cd(i){let t,e,n,o,s;return{c(){t=V("div"),w(t,"class","shadow svelte-faoauy"),w(t,"style",e=`
553
553
  left:${Pt(i[5])};
554
554
  bottom:${Pt(i[6])};
@@ -565,7 +565,7 @@ void main() {
565
565
  ${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
566
566
  `))&&w(t,"style",e);const l=a&8160;(l||a&8168)&&z(t,"width",Pt(i[3])),(l||a&8176)&&z(t,"height",Pt(i[4])),(l||a&16352)&&z(t,"z-index",i[13])},i(r){s||(r&&et(()=>{s&&(o&&o.end(1),n=vn(t,An,{duration:i[0]}),n.start())}),s=!0)},o(r){n&&n.invalidate(),r&&(o=Zn(t,An,{duration:i[1]})),s=!1},d(r){r&&_(t),r&&o&&o.end()}}}function xA(i){let t,e=i[2]&&cd(i);return{c(){e&&e.c(),t=Ee()},m(n,o){e&&e.m(n,o),O(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&k(e,1)):(e=cd(n),e.c(),k(e,1),e.m(t.parentNode,t)):e&&(he(),M(e,1,1,()=>{e=null}),ue())},i(n){k(e)},o(n){M(e)},d(n){e&&e.d(n),n&&_(t)}}}function Pt(i){return typeof i=="number"?i/16+"rem":i}function DA(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:d=!1}=t,{horizontalCenter:h=!1}=t,{verticalCenter:u=!1}=t,{blurRadius:m}=t,{spreadRadius:g}=t,{opacity:v=.15}=t,{zIndex:A=-1}=t;return i.$$set=b=>{"inDelay"in b&&e(0,n=b.inDelay),"outDelay"in b&&e(1,o=b.outDelay),"visible"in b&&e(2,s=b.visible),"width"in b&&e(3,r=b.width),"height"in b&&e(4,a=b.height),"left"in b&&e(5,l=b.left),"bottom"in b&&e(6,c=b.bottom),"center"in b&&e(7,d=b.center),"horizontalCenter"in b&&e(8,h=b.horizontalCenter),"verticalCenter"in b&&e(9,u=b.verticalCenter),"blurRadius"in b&&e(10,m=b.blurRadius),"spreadRadius"in b&&e(11,g=b.spreadRadius),"opacity"in b&&e(12,v=b.opacity),"zIndex"in b&&e(13,A=b.zIndex)},[n,o,s,r,a,l,c,d,h,u,m,g,v,A]}class _t extends de{constructor(t){super(),ce(this,t,DA,xA,le,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},kA)}}function SA(){return Math.random().toString(36).slice(-6)}const br=SA();function LA(i){me(i,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function dd(i,t,e){const n=i.slice();return n[18]=t[e].id,n[0]=t[e].content,n[19]=t,n[20]=e,n}function MA(i){let t,e=i[0]+"",n,o=i[20];const s=()=>i[9](t,o),r=()=>i[9](null,o);return{c(){t=V("span"),n=Be(e),w(t,"class","text-char svelte-1b2n9wi")},m(a,l){O(a,t,l),Q(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Re(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&_(t),r()}}}function TA(i){let t,e=i[20];const n=()=>i[8](t,e),o=()=>i[8](null,e);return{c(){t=V("span"),t.textContent=" ",w(t,"class","text-char svelte-1b2n9wi")},m(s,r){O(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&_(t),o()}}}function hd(i,t){let e,n;function o(a,l){return a[0]===a[3]?TA:MA}let s=o(t),r=s(t);return{key:i,first:null,c(){e=Ee(),r.c(),n=Ee(),this.first=e},m(a,l){O(a,e,l),r.m(a,l),O(a,n,l)},p(a,l){t=a,s===(s=o(t))&&r?r.p(t,l):(r.d(1),r=s(t),r&&(r.c(),r.m(n.parentNode,n)))},d(a){a&&_(e),r.d(a),a&&_(n)}}}function zA(i){let t=[],e=new Map,n,o=i[2];const s=r=>r[18];for(let r=0;r<o.length;r+=1){let a=dd(i,o,r),l=s(a);e.set(l,t[r]=hd(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=Ee()},m(r,a){for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(r,a);O(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=xt(t,a,s,1,r,o,e,n.parentNode,Hs,hd,n,dd))},i:J,o:J,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&_(n)}}}function jA(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,{isFistUnfoldedUpdate:l=!0}=t;const c=`__EMOJI_SPLIT_${br}__`,d=`__EMOJI_${br}__`,h=`__SPACE_${br}__`;let u,m,g=[];function v(x){const I=[],T=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu"));return x.slice().replace(T,S=>`${c}${d}${S}${c}`).split(c).forEach(S=>S.startsWith(d)?I.push({id:ut(),content:S.slice(d.length)}):I.push(...S.split("").map(H=>H===" "?h:H).map(H=>({id:ut(),content:H})))),I}function A(){if(!m)return;const x=!a;m.reversed!==x&&m.reverse(),m.play()}function b(x){if(l){e(4,l=!1);return}clearTimeout(u),u=setTimeout(A,x?o:s)}function y(x){const I=function(){const T=fA(S=>x[S].getBoundingClientRect().x,[Math.min(x.length-1,10),Math.min(x.length-1,30)]);if(T>0)return T}();m=_n({targets:x.slice(0,I).filter(Rn),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:_n.stagger(50),easing:"easeInOutCubic"}),a&&m.seek(m.duration)}function C(x,I){qe[x?"unshift":"push"](()=>{g[I]=x,e(1,g)})}function D(x,I){qe[x?"unshift":"push"](()=>{g[I]=x,e(1,g)})}return i.$$set=x=>{"inDelay"in x&&e(5,o=x.inDelay),"outDelay"in x&&e(6,s=x.outDelay),"content"in x&&e(0,r=x.content),"unfolded"in x&&e(7,a=x.unfolded),"isFistUnfoldedUpdate"in x&&e(4,l=x.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=v(r)),i.$$.dirty&128&&b(a),i.$$.dirty&2&&y(g.filter(x=>!!x))},[r,g,n,h,l,o,s,a,C,D]}class ud extends de{constructor(t){super(),ce(this,t,jA,zA,le,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},LA)}}const _A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm5/nYmMkBq+TqBs7LNgTlZH6EnWlPmORdk+pHQipUNfTxtg7p3NIXWRMvXfoqusmXsNhpC6crIS1Zf9C6yAOdlxpK5BW18CiT7A/G93gE+P0FY/RoO+RWqS62YhB2r4YhlixArECsQKxArECvzjCnwAOr0wF44ggHAAAAAASUVORK5CYII=",VA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAACoCAMAAAD6pITnAAABQVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACvr68AAAAAAAAAAAB5eXkAAAA8PDzr6+sLCwuenp4UFBT////8/PyLi4umpqZycnKxsbHMzMykpKTy8vKoqKhcXFwpKSmwsLD+/v7k5OSCgoLw8PDo6Oi0tLRkZGSrq6syMjL6+vrn5+eYmJj29vbd3d3Q0NCwsLDDw8Pz8/PT09P09PSwsLB/f39OTk739/fh4eHY2NiFhYX4+PjGxsZkZGSkpKS3t7eRkZG/v78eHh6CgoKKiorr6+uysrL+/v77+/vb29v9/f2wsLCysrKxsbFdXV39/f3u7u7t7e3j4+OoqKj5+fmrq6vp6elqamqVlZWtra0+Pj7w8PDW1tbJycnNzc27u7v29vba2tqXl5cjIyNsbGzf399ubm7d3d3///8pT4ZyAAAAanRSTlMzAAYIDA8KFRIccB8XIlIZPr80ZDb88FppT2iLaNJrRzpW+LNWzrp0Sm086rdg26WST4LVltltU0Pfq51X44UoJHdcfjcuHMFF++6i82RiWxX2x8SvSOc7vEs1LiHKmYiOe92gLCMfqE2kqsY2dQAAEBhJREFUeNrs2MFqq0AUxvHT28xdnEWQGNBKMHGnARdutIsspARxU+NOiu//HrdUZFozYTxMbltn5v8IPw7fxMCD7Vuy0OIs9FKz0OIs9FKz0OIs9FKz0OKWCf3nl/fw37sz9O8n/Tl+dWj9hO/nrQ5tCLICtiq0HPlRi1Sw7w+tIfA0ZWt1aLHxX2165NGt6dByZqHwasEJvRWoVaAnyjrwivqKTaVWh/6iPCFm2sS5OTaBWh16osyRq7Krs+jSBDkuvDxoLlFWd2XFsbm1gJoMTWcezrjqswbf8930xTsV64VXnLyX1PXxvSbrq+G41ag5NJGZK7d9/Yroe+u9swWt2jr7tecjvtZ9y63p1HRoAXOZ5Rh68QG07RB7IeZZOaHm0lRoOjOr6gD9wgHtcwofg7piCtRAdebMZYaJ9wyG9OwlmJWcmioN5HMemSMMnzQbZclkP4UYjdTkowai8zgaF/TfNmBYmzcfL+OACKTVoSfMbY1+bBzzB3XsY91OqAnQFGe26gMsjBqNz20LDPoVI0sDZTaGc44wPYLBHVOMhqOmzAfMdB7PmZVBEoPhxUlQsuGoZ0sDbTZYh67R5zx0dLFjkvkgQl/NxsnIR3Da5nQ1HwRoiTNjVZPswfbRPmkqxuZLA8U5CA343J6bEwYUaZjvXOY7jf87onfY5aVEmgLNndE9g+1TZxe5NAFa5pwa+5Fyq206XxpmOle5a52vpd28mikNsoEe38Gd3Q1B5934IspmGmY5t01o30Fhh7BpJ9JkaO7MosT+rruRk0SMS0ugZc4d2u+Um+2xmyMNsoeQMVbiP/bMhSdtKIrjJ3sEcrMsFagFpqC4ifIaviY4MAONPHQ6xDgX49vodr7/B9i5lnpb0setddFFfonaXhDw58n/nNvWYIQjNfaNJImG6Fe0COhkdHR9w4VINPnDu6RBJqBH1+tcycnENHh6PmYv/vqzF3Ps2GLav+i3PDiKMMKDIg+Pt+6iPQo63Gaj4PAkx9phc0nLi6YGqnveYqswwpNVtqWbJnGSoq3BEd6Ljy5xSBCL74XN4SEpWgTHt1EnlO2H30R4SIm2FvR0fDRCSxGJT7uXNHgU9C8YIcUvj5IGl4IOhxdSo4KWJJJaCIddShrcCnqLJWCEJAm25VbS4FbQ7fkY+GF9vzUPL5XYfNutpMGloMNJDfxQRuLgxe5vtGTYpaTBpaCvWQX8cIicahNeJhV2bSlpGdF6QS/EwReooy5HgvdwTdMUuSaUIBzfMJ3NZjVwYKr52/LcjULUErrrRQX8EF/QS1pOtCjoH19WfYo2+BR4KCwgIgMZFCQchWQRccam+LTs+UxJxSUQnCLiEZg4p4Vt8MHqlx+ipF1FWwv6mCkPFI07F89MdCQ+zxoXG+vlq4Ojk1IPDRbhnvcqopoGwSwiboAPFHZsKWkv0UYrbKfAH2iioDwr0VBCWy5NY9UYnZ8OtZwE+CHVNtqht2iRHKHvWgDReBgNKrqwbOV9ENHLOIR6eHLVsGR0kVbzQnyaTrvgC+17yDE7wDE5bthcENGofo0FEz0MCyI6gZ3eeL5eXVnKkM7Fid82H+4EERtgcEFnY36vLN04Zgc4JscxmwoimlhK/BvRxc8m1pBYM68kHJthDogq4goQMyfrFcPphzsKSA/dHfEWc0RnrUWBRBZOsWPH7ADH5KDhLqBo7C3+E9Fn6ErUXnSMjfUqQnS6gzgJOis4RAkgl0ErCakBT2SHt+g3uuhdLahoYqzycNHlqJWKT9EH/X6fK8z3+wd0GqXDZSGaT3MTLqIb+ADR2q4u+o276FcW0ex9YNFEPvXIU4e86LpYqgPRQjyMGKI3u4h9cBE99hDR75lJNOEm2kiOG5YOIlrwefOxRacnTDAkmHlFcRDNB2VmiN6gVe0+YCiC6dmZRYMsJFS+xS1z+jx+ymUFvEmzGyM7PESLiL5mSiDRglLtKeZoq+hKniB3vbvvaj7f49+JbRgwSQ+CYE3sE//QYVF2y3ItQlpS9E8WCyZakPkAUjABn7S+MhOaf9EKwQu3QD8r6MCBveh0R2RQiw5/gxQx9lNStIjodhz8go7sS8WQis7MBtsZeotesoi+Ne1WqnQsO+nG207dEOyn6FBoIRpctKCbfVrRue07jhC74/TFO6G+0jA1xB0wKKpI1PQq7SCOgyTRhVDIfpIGh14Ymi4GFW3lIPd0og3i46hO8GbY3BF5JhJ9J6UzMVVFzhVwEsi7pyTF6ZBDNwSHiA7tNR9XNFabEqI7H2yYMYs+H7PSR6I/tFi2FV1WEcv61DHRGc6zLt4zvm2aVWBevIQ3zT0h+rWc6F3tkUVjp+wtOgM2NMyiCyjBmFV0hP8ttRYfJIzxrqGS0GUF7smYRPPfWjJmjQ90sA6SaLu+RSdrjyyaWH8a0azUgmYLiVbOEA3ZHaSw2DaqOoKCLpxiq0Lmb4HYp5UmSFJLyokWQ8e7L6uPL3rpSUR3yOy+HroR00WlxAoSna8i6i/PiC4XDX8UmKXSzgHM8U8Vk7/J8m4wdvz3ouc+WikiURxanDP/KpFHInMBFqZmkDgbvKyRxHUu2sjmc/3Wfh/+oejnGh0+po7E+YmKnN5ZgdueHCaDeLg56GJ8hzQQndfDJE9Hm3Dp64ZWLekl2npJKRR691ybobTojUvjfW/TUKnX0YbCacN0mf/MIhqueGnwf0BGAflm+C4UuhdNeIt+mvFO/WRDdVj0Gi1u2oqmB2bETWwdfWEWbViz3ANngzuFh/pSOoNYv+UtFKRp7vkW/Zw3LJN8U2wrmo5LRnEhkbGILnNK9JQycWoRXTBmizzZBZ3PtMY/0zxIU5z2Lfo5b8GlREfGM4VUwyxaBc7RYChRLKL52FwZbFyqIEpatHDJLbhv0X/ZOaPetGEgAEd7K0LLYBAadQXagcogndAQEiorFQsoCs0eKAG1qHSsPKzL//8By9mxEzMy26jNHpp7gCgoEf7sO/vOd/4PQSXtH+JKg1YO/btnoqCnxDRr4RsgQCo1oCGoJA062TApX6RBg7CgPR1k5vc7fJeioHVqiqeRIXwnOaAhTCoNOvnAf20Q17X59ad9QQtOhj9gQ5G44scEG/ImHfT3hQP/0qCT38qyvMVghM+kxPZubdziHuh4k8rLggbPsUxc8Zuge4NHWsT9EdrK2gLNd1jUpDdnzz3s87a7RU8nAXe4KFxC458D9CkILCLRRQR00yZzYTN04F2aNyas228zqrRnqCadblAPtHdDXMg2UedDeFN7f9D8yRCF62gimEEXd97iAT7rVWF/RR509jkSaMTCizS04ACwMlnMNYpAjbTZ/vaCoA0U1wD5Gtyt5JA+Pil9NF6qohnSWQJaOEyaXSaaEvbukuRyVn2dnlDDWUO3HkGBRwzoZh4LBp0PRBZ0mLHrYUts4r9haogzNOAjcmuF1LuaWWal49HZZJMcDTygQVaE7xcS6FFKNjIjIeh4YUFvGBvdAfERavDdDUHDb/WwvweNGfay0CxVWMG1vRZLctwDtJpk2u5PeOSIugn4skG3k5ACn+pyoC/quRsYqhveqqOEI4vW8Wxlo8spbkEtULauqNNV+q4Kgn4TBT1PLhH9zoExlVeo9lp0ox+b5uoCmioH+iG4YfJAX0OHFpQL8oLCZxSLoi1oGuQ9HCnPKWj+LjhdSKvL5EorCv2iN9VJTBdekCfZFb/DUKkxioC2cruEccGDqGGBgu5H5ZqCHvkgh3STYPEE+ZDakFE4B/qe764sATQ33WB72XGfZLHQh9YRpW57jy7q44w3uSXjaKUNd646WImCbjqOo3V/9ZRwMgyFXXX0YW3Xc636zDWhN91tO6F3tIrA9sp93KIDQMcb6T3L3+y9yt964UPviSZV9UhTIw09Gwxi3HX/h2FMXM00Wd0f+TfOKfWt5cPfOlcSWdyFlkMKtGxBZ+vVF3QKg2ZnQzUtUZYrUVYBtFDaLmuk1bls0f3KKiuvVfyie5Ux0b5wSivokL5Kj5EQFz1zBQOaU1qx20gfnKQHo4gfjHJywJpofvlbaDvG6VE/4kf9jMFyCJe/sbbjID28SvjwKjygOQWdcbZDHafHsf1h74xxGISBIJjWdhOFF6RLeAOSm7ikpEH+/zviQ4LTWTbrB+w9YbRaBBI7Y/cpgW40B/rpXiPNgcHRgUENNPjpvt0dkZOZY5OZ0TQHAl13RyG9cQQW3+y3wrnZHAoaRDpz1nhk1jjXgcag60jvfB7iJ+FuAo1Ba3dopB2n5/H0vNNAd+fYYKQzZQpIppBRoAU0jnSiHuReD5JgoAU0jrSj8OZeeONgoAU0jHQhTYVT955HQYNAg6FuLY+8UkrWk5KtWYsDDHWDSAvpSM1eT7MXtTjA9DyOtJCmOLItjhTOONBYD3KRTlShtlSo6eLc0INg0LY8jpp2iXLf6n6TcJaCNsXRB43LQ0iHRF11ratOQTjD4sCgLelIAbsVsEfLGYBGpLWmQ1y/fHM531O+awymoLFmD9f0STq//cLvHuVei39n4QwLelyFakiHzU/8lveYJ78Fw3lAhQojbUn/27Gf1kaBOIzju2kWktH8oQ1oPaTrzSzk4CX2UBAKHiUnKfXu+38Lu78Js08rA89h2sOMfl+B82F4RJvsNPn/08Upa+BsGWgKzaX1fJwnfan/nPVsMGfEoe3SUZ+parIfL4dKZX1kdybQiErHN+mhU2kxyZfifZGqbrg5x9yZQ2M8xtJ6qKP6qtL3yVHfv6fqWkd6nsfOGA4GzaVXRlqom1wdHyc1IIfHo8obYTbOK+rMobl0VOfqlDz/mEjPyUnldUScHaBH0p+pu0yl1QQ+y/dVqrLuE/PY2QGaSGvqoSkv6pgUAf9t+l0kR3Upm0EzU2cOzaWt1Juh71ql0mT7tA9ssg/7p22SKtV2/bCxMFudOTSXXkIa1GK9qfuyVf9KH86vyUu19bzqJXk9P6Ryorbs640ogxnOS4szg+bSmA9QG2vBHurmrSvza5tdlOddsvaal91bUw+CbJTBjNmAM4Xm0pKWxnwYalgLdnBFH5UNM2ZDOy/gTKC5NObDSm2sA/KO0NrCjNkgzgSazIdIG2pYi3ZgrddQBrM409ng0Fwa1P+tDXYY4msJyFAGM3Em0ETaQg1rwRbugNrpYijbmeHsDg3pMbVYA1u0db6q75AYA1mUR8zMmUPzS22oYW200c7T4lswhjKY+XXm0Fwa1LDW2Cj2OpxDkKEMZpszh3aghrXhDqiVCcqE2Rka0iNqWEPbZ3U8O4yhDGbi7A4Naqu1cAfTLwRlwuwAzanFWmsH2VISZcLsAE2pYS3YwXHLaYAMZc7sDg1qWBtszR1Y5lx3UCbMDtCMWqyBHQI5TgFkKBNmB2hGDWvtHUx3aOHA7AgNa2gH2QI5KLtBwzpA8AVyVHaHBnbwOeA4Qk8I2wHla6GD9f4yFA7tnh/8P789gZ6zNUP72gxtb4b2tRna3gztazO0vRna1/4CjIBfFd68JpIAAAAASUVORK5CYII=",OA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAVKADAAQAAAABAAAAVAAAAAC3aM1AAAAKo0lEQVR4Ae2cW2wU1xmAxxcutqFxRJ04jWW5NBelIJUKcX1ARaWoAp4QEiAFaFBAPIBElDcQEkg0Sh6IokjNQ1NxKw9IjaUg1X1IXQl4AIGEQh4IFQHkGhsMhnKLL1Bj9//G+4/Pzs7OztpzW9u/9O+5zJlzznz7n/+cMzO7ZVY6ZLp0o1qUsCqjlRJWGCpR64WhAxLvy2i/hL2ihIlKWUKtT5V2a0VfyijpMOS5VPI4o48kJB2rxAkUa5slWicKyDgEuN2iD0Sx7sglDqAM4ddFfypaHvkVeTcwKNn3RTtFcRORSZRAa6TXDaJYZZoEa+0Q7YmiU1EAxR82iWKRaRYstk00VD8bJlDqqhdtFMVfloLgV9tFu0SHwuhwWEBZ7rwlOiOMTiVQx4/S5jXRMS+7wrAkfOQvRYFaqoKbekUUoGOatMYCFOv+uWiTaFKztzQdmnAN+H02FCy3RiWjBUrjb4vyrY43mSkXxArlv6JF+9XRAOUbfEeUnc54FdbOPxEFKmvYwFIsUGDOFS3VyScwGCk4TfRlUZZXgaEWA5RhjmVOBJhymbZMkU9cAFADDf+gQJmA8JnjeZjL5XkKlsqdMHZYBSUoUGbz8TgBFQSUKYBPxd1xB8tXggBlndnkW8vEOMjQ556r7zq10PqRxfobE4NXoKuEhe8Gxg8ofpPtZBArDtSbcVAIFjCBjaf4wXpNznjV86yJnck2lccv7P9zJJ+FchJ3jSbFmwBsYJQj+YA2SUk/682paIJlwKbJ65q9gLKPTfvNYa9riTsPRrDKEi+gPLaIXLZs2fJae3v7oVu3bn129OjRJZE3GE0DOazcsxUL2F9H0/ZIrYsWLao5e/Zsy9SpU6cMDQ1ZZWVlQ/fu3bu2devWD1taWh6OlCyJ2LfSS2dt6gbKOivyHdGZM2c2LVu2bMf9+/etvr4+q7a21poxY4b1QuTSpUt/Xbx48ZclgXK4k/ckuK79NYc8jjYW3ykAeTZvPX/+3MJCHz58aN29e9caHBysEOv9w5MnT77ev38/671SEJg5E7gJlC2mmY71YoALVODW1NTU7du37/CNGzcOzpw5M7E+BQRA/5xH5WZnbasJWEkkxbDWp0+fWnfu3LGePXtWNnv27OXd3d3fNDc3/zaSBsOr1GGnQFmkxvV6TMHLEFdq4V8fPHhgVVZWVq1du/aAgD28evVqbvimUWBnL/QVaOruc8rMb/X391sy+1s9PT1ls2bNevvUqVNfX7x48f00EpU+2QwVaGqsE1jAVCWNG8C3yqRVOX/+/Pdk0mo+cODAmxxLkdgMUwMUgIiCNNPl5eXWwMCA9fjxY6u3t9eqrq6u37t37+GbN2/uS9Gk5QDl/p7nRt++wpg+Mgt8ByjNKlwzLpOVbbHiZ8sbGxt/L7717ydPnlwWUzf9moHhdCyU5yWpEgWpIZ1Ti8VaETYEwK2oqHhp3bp1H8mS6/OVK1cm7bqq6Z3vHWi79xF/KDhCBebOM9MaZzUAVAmZtObLtrX5/PnzGyPurl/1toWyf09UGO4IoBCgKjTSmq+h5mkZ/CsqUrVw4cKdMmkd37NnTxMZMUsVFpoIUIXIBSsYDRWCpglNyGY+ZdWqZRVgb2Vlp/WLgwcPHpWd1gcxT1o20Eq9gBjDQS+g2r4CJE1cQzdIrzT1ZuqeIjutdTJpfXXs2LEFdiXRf1Rioc7GPvr2hluQC0bshGl5xDXNQS9g5Gk5LUOo52lIOWTatGmvbt68+VPZzv5x6dKlUb/1UpEIUBmaDlAvaIBQcPmOU8YNjzxEYQ6n7M/y+vr637S2th5paGjg9ZqoJBmgStO8cBOcguKq3flKwjzXXc59TM+pqqr62ZEjR36n6QjCiiT8Jz7OZqqwAIiYIPSY5usxhU1azzPztJxdofdHoJe+vE8tnMuVxPKDKFdXsoByzA1FgZqh1mFCU6jkaVzLuUPZDLRt27btX+78ENMvEgEqNO33LSV0hjQXpaBMMJrHcYXuFSfPRwY7Ojq+Wb58+fa2trZQf0bjavMFQz4xCwUQa0egKTiFSVoB6vF8IRel57kukC3qrRMnTny8ffv2y+5jEaRtoPYWI4LK/ap0/Fg+SOQjZmiWNSvXMmaefFHPrl69enLBggVfClSnPbNMBPEBhrzzCDSCBjyrZNnEAUCYlqXA3MfUUjVfy5FvHuM4IvdOv9u1a9e7c+fO/XOMMGm6jyEfO1BmJBEbKKFCUUtTYPTQL85xU2Q//0geUX+xYsWKFjM/xrgNdMy/HhtFhx0LNc9VeCZgjVPODVzLyyEmndb169cfOnfu3I9mnTHH+7FQ3sqNVcQq7VleGzXA5FikllGwlCWOEGfSOX78+Mc7duyIY9LR7uQLewGKhbKUiPOuvT3k6ZUbFJAQhWyGmp8J+69cucKk85eY/STNewkM+4e/6jH8FM+r5kJ55qRkAtTzyFMrJE/LKHx5tnR5586dm2TSiXMG1+7lC+2fM2KhCAnnYb2dE+1Hlg9VUApSARKaefJFPDp9+vQX8qgjqUnHj0oW0Ed+JcM+ZloodZsAtS2FKc+MOD54+/btf27YsOHThCcd7Z5XaDNUC2X8QziWh1wCyFloK0zTSskjjcozo3bZ6XySkknHCyR5sLO3tAqUzG7RWIDqLA8wRKESV5CSZ086S5YsScukQ/fyCexs0UmJBD+9y1rO2CUi+NAhb1YNVHmPyQYqD9ku7969e9O8efPSNOmY3TXjMHN+tmhaKDdJ+JFo5C/cdnV1ddIjrJGdkoKUx8HsdP60atWqf3C8RARmzg2m4UXfSM9jeSW8rq6u8vr163+TV8JfyQx3e9LZuHHjoQsXLvSMdKckYt9KL53tu/sBHXeeeJMk0rdJ5P2kQXkvqXXOnDnlEr8pTyUPrVmz5qvOzs7/lQTCkU4y1LtGkjIfmIlMnJ+K/MojfzIrl8B3kpU1osxJSYtTAL8wKf4EYJQFk+JeQMlvE3UcLRmTkkUANm1ZOZmE24dqGU5gOfCyZkyGWQT+IykW8zmSz0IpiLNN8t5iTmdTkgGTrInI7JcfULaH10Qnh/4IMVjAxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=",BA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABcVBMVEUAAAAAAAD////////+/v45OTn////////39/fp6enPz8/7+/vw8PD+/v7x8fHc3NzHx8f////////+/v77+/vr6+v////7+/v5+fn////z8/P////////q6uqgoKD+/v79/f3m5ub+/v7////////////////39/f39/f////z8/P////t7e3s7Oz29vb////5+fn////h4eH////g4ODV1dX////////BwcH///////////+Ojo5zc3MlJSX////////////////////////7+/v////////////v7+/u7u7n5+f////39/f////09PT6+vr09PT+/v76+vr////5+fnv7+/09PTk5OT////////////////Jycn///++vr7///////+0tLT///9TU1P///8SEhL////////+/v76+vr////8/Pz39/ft7e3t7e36+vr////////X19fV1dX///+xsbF9fX1iYmL///////+K8mOEAAAAenRSTlMaAIDy8CD41cWRX9uk7Kl1VVEw6dWT/M/NvKyVkY475eWIgx0Z39rHv7axnZyZmIuKhn56emZjX1FEPTU0Kx4PCAX69fTgxcKkopWL7crJuri2sa6rnIyHhX54bVtZVU9NSUcsJSIcFROno6Hcwp+ekHVxbWhnRC8nDLc9s8oAAAOGSURBVEjHpdd3X9pAGAfwkBBDAoQmBJmWvUWWiIDIHoJb66x7a4d78Op7pBQ1J5DY33987vnyXEIu3CGy/0hvnDthM+l0hj3JScSudDKOdhNPpl1i8Ut624Gi6+trI3zW1tcdqGM7/SIC5/ZRR2SNJEm7JkHt7FAJjR18WIs40P3cAFxIOaIRna6ZOHxGunk+TDR1ukjUkSr0w86bcKShiz1OI4JMP8YAD9+4emM2Gm407IfIhzm0NxrhKNsLH4SvQ+RktyvUfZIMXYcPPsSFCcvY6EYW6ZPsxuiYZaLwAW5bDY70Da5paxjvm8d+UcjAUL/GzPtCnDF/mwFWhJ75Zs68x05gxxFRGQfa+RYXokHVCC4O4yOqYLTwBjNB+ncWEZnsbzrIvOLz4CW9g4jODn0ZPO/iZN0UmhaPp0Omq+Q/nLu6NO0hErJnurjKdTBzEdAhkqILXDAdbFkJ7EnDe4EVy198srpiwhE4X1RKDFOqviBwcNPK6gmPmeWlGDz+VdHqRPEVHo0tLTM8RpcX4G+flLe6kU/Cs1pYRnm8uriQhfoC+0ZDvbMLi6ttfO5fDCDCKFrvooAKAov+c4BZvy8EzaolCHRdIZ+fBThl9G0Ih1RCrBJWbPiMKYAZ409oMSqFWAktzJ9GBuDvRoVGOIQJMSas0CiM39u45v0M9tbaeLc6F5M+7dhcbRfgg+pcU/oNa85VDwDOzBtmpP9UKsN8BuCzeb1P+kPi08+fASyr6fVPUh/PJ72+xj/bZk5PSV0YlJ4z83iC4EipS5LkiAkeHxGcQerLwMARRzyW+QklhUgKpST8nXfYg+fHkjS89MPz0MFnhKdCSWpc8RBnPAZB3RUvLt7i3oob7f5juDzuikY81tjcHlcHg9xabdyUWDvF2ay3slecr1ptimNx9lhhs1bzXQxy5NZa6VMx9pS2Wt1H77cVjFartYvBdlDICDc0cbVa3Twd2NcOyuLwVqo+K1ebjgdcr0k+O1uXwThfl8vlhqm+99kASup5GINsYhhmG8d7UXzcBgo2e21cd9WlUll5/7G958ql8uxu7y0zS5SGSkOGBA51TRiGQAi232Y9v4kVQZGavpt6c6l3tLpNsc38gGOC01IeLg4Xi8NaLz1KkqO0VzvcTrFscYo4oLjiRAsKEXeJPRqxW0bsFWLGLVbiocyZSm5vbW0nU9BsIfyp/AGqAvfOkBaFawAAAABJRU5ErkJggg==";function QA(i){me(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function fd(i){let t,e,n,o,s,r,a,l,c,d;return e=new _t({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),w(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),z(o,"background-image","url("+_A+")"),w(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,u){O(h,t,u),te(e,t,null),Q(t,n),Q(t,o),l=!0,c||(d=ke(o,"click",i[5]),c=!0)},p(h,u){i=h,(!l||u&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&w(o,"class",s)},i(h){l||(k(e.$$.fragment,h),h&&et(()=>{l&&(a&&a.end(1),r=vn(o,An,{duration:i[2],delay:i[3],easing:ti}),r.start())}),l=!0)},o(h){M(e.$$.fragment,h),r&&r.invalidate(),h&&(a=Zn(o,An,{duration:i[2],delay:i[4],easing:ti})),l=!1},d(h){h&&_(t),ne(e),h&&a&&a.end(),c=!1,d()}}}function RA(i){let t,e,n=i[1]&&fd(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&k(n,1)):(n=fd(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function GA(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){Yn.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}let NA=class extends de{constructor(t){super(),ce(this,t,GA,RA,le,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},QA)}};function WA(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function FA(i){me(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function md(i){let t,e,n;return e=new ud({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","text svelte-1fuzm7v"),z(t,"transform",i[7])},m(o,s){O(o,t,s),te(e,t,null),i[10](t),n=!0},p(o,s){const r={};s&1&&(r.unfolded=o[0]),s&2&&(r.content=o[1]),s&32&&(r.outDelay=o[5]),e.$set(r),s&128&&z(t,"transform",o[7])},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e),i[10](null)}}}function pd(i){let t,e,n;return e=new NA({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","arrow svelte-1fuzm7v")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function HA(i){let t,e,n,o=i[1]&&md(i),s=i[3]<i[4]&&pd(i);return{c(){o&&o.c(),t=se(),s&&s.c(),e=Ee()},m(r,a){o&&o.m(r,a),O(r,t,a),s&&s.m(r,a),O(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&k(o,1)):(o=md(r),o.c(),k(o,1),o.m(t.parentNode,t)):o&&(he(),M(o,1,1,()=>{o=null}),ue()),r[3]<r[4]?s?(s.p(r,a),a&24&&k(s,1)):(s=pd(r),s.c(),k(s,1),s.m(e.parentNode,e)):s&&(he(),M(s,1,1,()=>{s=null}),ue())},i(r){n||(k(o),k(s),n=!0)},o(r){M(o),M(s),n=!1},d(r){o&&o.d(r),r&&_(t),s&&s.d(r),r&&_(e)}}}function XA(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{content:l}=t,c,d=0,h=0,u=0;function m(g){qe[g?"unshift":"push"](()=>{c=g,e(2,c)})}return i.$$set=g=>{"visible"in g&&e(0,r=g.visible),"textUnfolded"in g&&e(8,a=g.textUnfolded),"content"in g&&e(1,l=g.content)},i.$$.update=()=>{if(i.$$.dirty&7&&c&&r&&l){const{lineHeight:g}=getComputedStyle(c);e(4,u=c.offsetHeight),WA(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,u=c.offsetHeight)}),e(3,h=Number(g.replace("px","")))}i.$$.dirty&280&&e(9,d=a?h-u:0),i.$$.dirty&512&&e(7,n=`translateY(${d}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,h,u,s,o,n,a,d,m]}class gd extends de{constructor(t){super(),ce(this,t,XA,HA,le,{visible:0,textUnfolded:8,content:1},FA)}}function YA(i){me(i,"svelte-nlvd3x",".content.svelte-nlvd3x{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function vd(i){var d,h;let t,e,n,o,s,r,a,l,c;return t=new _t({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new Ar({props:{unfolded:i[2],length:i[3],outDelay:i[4]+40*Math.min((h=(d=i[6][0])==null?void 0:d.content.length)!=null?h:10,15),useLinearColor:!0}}),r=new gd({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){ie(t.$$.fragment),e=se(),ie(n.$$.fragment),o=se(),s=V("div"),ie(r.$$.fragment),w(s,"class","content svelte-nlvd3x")},m(u,m){te(t,u,m),O(u,e,m),te(n,u,m),O(u,o,m),O(u,s,m),te(r,s,null),a=!0,l||(c=[Wt($n.call(null,s)),ke(s,"clientWidth",i[8]),ke(s,"click",i[7])],l=!0)},p(u,m){var b,y;const g={};m&4&&(g.visible=u[2]),m&8&&(g.left=u[3]/2+"px"),t.$set(g);const v={};m&4&&(v.unfolded=u[2]),m&8&&(v.length=u[3]),m&16&&(v.outDelay=u[4]+40*Math.min((y=(b=u[6][0])==null?void 0:b.content.length)!=null?y:10,15)),n.$set(v);const A={};m&4&&(A.visible=u[2]),m&2&&(A.textUnfolded=u[1]),m&32&&(A.content=u[5]),r.$set(A)},i(u){a||(k(t.$$.fragment,u),k(n.$$.fragment,u),k(r.$$.fragment,u),a=!0)},o(u){M(t.$$.fragment,u),M(n.$$.fragment,u),M(r.$$.fragment,u),a=!1},d(u){ne(t,u),u&&_(e),ne(n,u),u&&_(o),u&&_(s),ne(r),l=!1,$e(c)}}}function UA(i){let t,e,n=i[0].state&&vd(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=vd(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function qA(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function d(){e(1,l=!l)}const h=u=>{e(3,a=u.detail)};return i.$$set=u=>{"tag"in u&&e(0,r=u.tag)},i.$$.update=()=>{var u,m,g;i.$$.dirty&1&&e(2,n=!!((u=r.state)!=null&&u.unfolded)),i.$$.dirty&1&&e(5,o=(g=(m=r.data.title)!=null?m:r.data.text)!=null?g:""),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(4,s=l?450:0)},[r,l,n,a,s,o,c,d,h]}class JA extends de{constructor(t){super(),ce(this,t,qA,UA,le,{tag:0},YA)}}function Vt(i){return typeof i=="number"?i/16+"rem":i}function ZA(i){me(i,"svelte-i9wdo4",".text.svelte-i9wdo4{display:-webkit-box;display:-ms-box;display:-moz-box;position:relative;width:-moz-max-content;width:max-content;max-width:100%;-webkit-box-orient:vertical;-ms-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes svelte-i9wdo4-blink{0%{opacity:1}50%{opacity:0}100%{opacity:1}}.caret.svelte-i9wdo4{position:absolute;width:0.0625rem;height:100%;background-color:#fff;animation:svelte-i9wdo4-blink 1.2s infinite}.placeholder.svelte-i9wdo4{opacity:0.5}")}function KA(i){let t;const e=i[6].default,n=Nn(e,i,i[5],null);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&32)&&Fn(n,e,o,o[5],t?Wn(e,o[5],s,null):Hn(o[5]),null)},i(o){t||(k(n,o),t=!0)},o(o){M(n,o),t=!1},d(o){n&&n.d(o)}}}function $A(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&Ad(),o=((r=i[3])==null?void 0:r.placeholder)&&bd(i);return{c(){n&&n.c(),t=se(),o&&o.c(),e=Ee()},m(a,l){n&&n.m(a,l),O(a,t,l),o&&o.m(a,l),O(a,e,l)},p(a,l){var c,d;(c=a[3])!=null&&c.inputting?n||(n=Ad(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),(d=a[3])!=null&&d.placeholder?o?o.p(a,l):(o=bd(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},i:J,o:J,d(a){n&&n.d(a),a&&_(t),o&&o.d(a),a&&_(e)}}}function eb(i){let t;return{c(){t=Be(i[2])},m(e,n){O(e,t,n)},p(e,n){n&4&&Re(t,e[2])},i:J,o:J,d(e){e&&_(t)}}}function Ad(i){let t;return{c(){t=V("div"),w(t,"class","caret svelte-i9wdo4")},m(e,n){O(e,t,n)},d(e){e&&_(t)}}}function bd(i){let t,e=i[3].placeholder+"",n;return{c(){t=V("span"),n=Be(e),w(t,"class","placeholder svelte-i9wdo4")},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Re(n,e)},d(o){o&&_(t)}}}function tb(i){let t,e,n,o;const s=[eb,$A,KA],r=[];function a(l,c){return l[2]?0:l[4]?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=V("div"),n.c(),w(t,"class","text svelte-i9wdo4"),z(t,"max-width",typeof i[1]=="number"?Vt(i[1]):i[1]),z(t,"-webkit-line-clamp",i[0])},m(l,c){O(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let d=e;e=a(l),e===d?r[e].p(l,c):(he(),M(r[d],1,1,()=>{r[d]=null}),ue(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),k(n,1),n.m(t,null)),c&2&&z(t,"max-width",typeof l[1]=="number"?Vt(l[1]):l[1]),c&1&&z(t,"-webkit-line-clamp",l[0])},i(l){o||(k(n),o=!0)},o(l){M(n),o=!1},d(l){l&&_(t),r[e].d()}}}function nb(i,t,e){let n,{$$slots:o={},$$scope:s}=t,{maxLine:r=1}=t,{maxWidth:a=null}=t,{text:l=null}=t,{edit:c=null}=t;return i.$$set=d=>{"maxLine"in d&&e(0,r=d.maxLine),"maxWidth"in d&&e(1,a=d.maxWidth),"text"in d&&e(2,l=d.text),"edit"in d&&e(3,c=d.edit),"$$scope"in d&&e(5,s=d.$$scope)},i.$$.update=()=>{i.$$.dirty&8&&e(4,n=(c==null?void 0:c.placeholder)||(c==null?void 0:c.inputting))},[r,a,l,c,n,s,o]}class yr extends de{constructor(t){super(),ce(this,t,nb,tb,le,{maxLine:0,maxWidth:1,text:2,edit:3},ZA)}}function ib(i){me(i,"svelte-1oxrkr1",".plane__container.svelte-1oxrkr1.svelte-1oxrkr1{position:absolute;left:50%;transform:translate(-50%, -100%);width:-moz-max-content;width:max-content}.plane__wrapper.svelte-1oxrkr1.svelte-1oxrkr1{transition:transform 500ms linear, opacity 200ms linear;padding:0.625rem;background-color:rgba(0, 0, 0, 0.5);border:0.03125rem solid rgba(255, 255, 255, 0.3);border-radius:0.25rem}.unfolded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{transition-delay:200ms, 500ms;opacity:1}.folded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{opacity:0}.plane.svelte-1oxrkr1.svelte-1oxrkr1{max-width:11.75rem}.title.svelte-1oxrkr1.svelte-1oxrkr1{white-space:pre-wrap;font-weight:bold;font-size:0.75rem;line-height:1.125rem}.description.svelte-1oxrkr1.svelte-1oxrkr1{margin-top:0.25rem;white-space:pre-wrap;font-size:0.6875rem;line-height:1rem}")}function yd(i){var h,u;let t,e,n,o,s,r,a,l,c;t=new Ar({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new yr({props:{text:i[2],edit:(h=i[0].data.edit)==null?void 0:h.title}});let d=(i[0].data.description||((u=i[0].data.edit)==null?void 0:u.description))&&wd(i);return{c(){ie(t.$$.fragment),e=se(),n=V("div"),o=V("div"),s=V("div"),r=V("div"),ie(a.$$.fragment),l=se(),d&&d.c(),w(r,"class","title svelte-1oxrkr1"),w(s,"class","plane svelte-1oxrkr1"),w(o,"class","plane__wrapper svelte-1oxrkr1"),z(o,"transform",i[1]?"translateY(-15px)":"translateY(0)"),w(n,"class","plane__container svelte-1oxrkr1"),ee(n,"unfolded",i[1]),ee(n,"folded",i[3])},m(m,g){te(t,m,g),O(m,e,g),O(m,n,g),Q(n,o),Q(o,s),Q(s,r),te(a,r,null),Q(s,l),d&&d.m(s,null),c=!0},p(m,g){var b,y;const v={};g&2&&(v.unfolded=m[1]),t.$set(v);const A={};g&4&&(A.text=m[2]),g&1&&(A.edit=(b=m[0].data.edit)==null?void 0:b.title),a.$set(A),m[0].data.description||(y=m[0].data.edit)!=null&&y.description?d?(d.p(m,g),g&1&&k(d,1)):(d=wd(m),d.c(),k(d,1),d.m(s,null)):d&&(he(),M(d,1,1,()=>{d=null}),ue()),g&2&&z(o,"transform",m[1]?"translateY(-15px)":"translateY(0)"),(!c||g&2)&&ee(n,"unfolded",m[1]),(!c||g&8)&&ee(n,"folded",m[3])},i(m){c||(k(t.$$.fragment,m),k(a.$$.fragment,m),k(d),c=!0)},o(m){M(t.$$.fragment,m),M(a.$$.fragment,m),M(d),c=!1},d(m){ne(t,m),m&&_(e),m&&_(n),ne(a),d&&d.d()}}}function wd(i){var o;let t,e,n;return e=new yr({props:{text:i[0].data.description,edit:(o=i[0].data.edit)==null?void 0:o.description,maxLine:3}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","description svelte-1oxrkr1")},m(s,r){O(s,t,r),te(e,t,null),n=!0},p(s,r){var l;const a={};r&1&&(a.text=s[0].data.description),r&1&&(a.edit=(l=s[0].data.edit)==null?void 0:l.description),e.$set(a)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){M(e.$$.fragment,s),n=!1},d(s){s&&_(t),ne(e)}}}function ob(i){let t,e,n=i[0].state&&yd(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=yd(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function sb(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l,c;i.$$.dirty&1&&e(1,n=!!((a=r.state)!=null&&a.unfolded)),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=(c=(l=r.data.title)!=null?l:r.data.text)!=null?c:"")},[r,n,s,o]}class rb extends de{constructor(t){super(),ce(this,t,sb,ob,le,{tag:0},ib)}}function ab(i){let t,e;return t=new rb({props:{tag:i[0]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function lb(i){let t,e;return t=new JA({props:{tag:i[0]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function cb(i){let t,e,n,o;const s=[lb,ab],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=Ee()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(he(),M(r[d],1,1,()=>{r[d]=null}),ue()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(k(e),o=!0)},o(l){M(e),o=!1},d(l){~t&&r[t].d(l),l&&_(n)}}}function db(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s;i.$$.dirty&1&&e(1,n=(s=o.data.appearance)!=null?s:"line")},[o,n]}class hb extends de{constructor(t){super(),ce(this,t,db,cb,le,{tag:0})}}function ub(i){me(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function Pd(i){let t,e,n,o;return{c(){t=ze("path"),w(t,"fill","none"),w(t,"stroke","url(#"+i[4]+")"),w(t,"stroke-width","1"),w(t,"d","M0 21 L14 0.5 L105 0.5")},m(s,r){O(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&et(()=>{o&&(n&&n.end(1),e=vn(t,zo,{duration:i[1],delay:i[0],easing:Cl}),e.start())}),o=!0)},o(s){e&&e.invalidate(),s&&(n=Zn(t,zo,{duration:i[1],delay:i[2],easing:ti})),o=!1},d(s){s&&_(t),s&&n&&n.end()}}}function fb(i){let t,e,n,o,s,r=i[3]&&Pd(i);return{c(){t=ze("svg"),e=ze("defs"),n=ze("linearGradient"),o=ze("stop"),s=ze("stop"),r&&r.c(),w(o,"offset","25%"),w(o,"stop-color","white"),w(o,"stop-opacity","1"),w(s,"offset","100%"),w(s,"stop-color","white"),w(s,"stop-opacity","0.5"),w(n,"id",i[4]),w(n,"gradientUnits","userSpaceOnUse"),w(t,"class","line svelte-blgtit"),w(t,"viewBox","0 0 105 21")},m(a,l){O(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&k(r,1)):(r=Pd(a),r.c(),k(r,1),r.m(t,null)):r&&(he(),M(r,1,1,()=>{r=null}),ue())},i(a){k(r)},o(a){M(r)},d(a){a&&_(t),r&&r.d()}}}function mb(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=ut();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class pb extends de{constructor(t){super(),ce(this,t,mb,fb,le,{inDelay:0,duration:1,outDelay:2,unfolded:3},ub)}}function gb(i){me(i,"svelte-1mgyhhn",`:root{--sc-dot-size:6px;--sc-active-dot-size:8px;--sc-dot-size-animation-time:250ms}.sc-carousel-dot__dot.svelte-1mgyhhn{background-color:var(--sc-color-rgb-light);border-radius:50%;display:inline-block;opacity:0.5;transition:opacity 100ms ease,\r
567
567
  height var(--sc-dot-size-animation-time) ease,\r
568
- width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function vb(i){let t,e,n;return{c(){t=V("button"),w(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),ee(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){O(o,t,s),e||(n=ke(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&ee(t,"sc-carousel-dot__dot_active",o[0])},i:J,o:J,d(o){o&&_(t),e=!1,n()}}}function Ab(i,t,e){let{active:n=!1}=t;function o(s){Yn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class bb extends de{constructor(t){super(),ce(this,t,Ab,vb,le,{active:0},gb)}}function yb(i){me(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function Cd(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function Id(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new bb({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=V("div"),ie(n.$$.fragment),o=se(),w(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){O(a,e,l),te(n,e,null),Q(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){M(n.$$.fragment,a),s=!1},d(a){a&&_(e),ne(n)}}}function wb(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=Cd(i,s,a),c=r(l);n.set(c,e[a]=Id(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","sc-carousel-dots__container svelte-670fde")},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&7&&(s=Array(a[0]),he(),e=xt(e,l,r,1,a,s,n,t,an,Id,null,Cd),ue())},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Pb(i,t,e){const n=Io();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class Cb extends de{constructor(t){super(),ce(this,t,Pb,wb,le,{pagesCount:0,currentPageIndex:1},yb)}}const li="prev",hn="next";function Ib(i){me(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function Eb(i){let t,e,n,o;return{c(){t=V("button"),e=V("i"),w(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),ee(e,"sc-carousel-arrow__arrow-next",i[0]===hn),ee(e,"sc-carousel-arrow__arrow-prev",i[0]===li),w(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),ee(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){O(s,t,r),Q(t,e),n||(o=ke(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&ee(e,"sc-carousel-arrow__arrow-next",s[0]===hn),r&1&&ee(e,"sc-carousel-arrow__arrow-prev",s[0]===li),r&2&&ee(t,"sc-carousel-arrow__circle_disabled",s[1])},i:J,o:J,d(s){s&&_(t),n=!1,o()}}}function kb(i,t,e){let{direction:n=hn}=t,{disabled:o=!1}=t;function s(r){Yn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class Ed extends de{constructor(t){super(),ce(this,t,kb,Eb,le,{direction:0,disabled:1},Ib)}}function xb(i){me(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function Db(i){let t;return{c(){t=V("div"),w(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),z(t,"width",i[0]+"%")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&z(t,"width",e[0]+"%")},i:J,o:J,d(e){e&&_(t)}}}const kd=100;function Sb(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*kd,0),kd))},[n,o]}class Lb extends de{constructor(t){super(),ce(this,t,Sb,Db,le,{value:1},xb)}}function Mb(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function Tb(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function zb(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function xd(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function jb(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function Dd(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function wr(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const _b=110,Vb=9,Ob=111,Bb=20;function Pr(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function Qb(i,{thresholdProvider:t}){const e=wr(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Ob&&Math.abs(s)>=Bb}function c(u){r=Date.now(),s=0,a=!0;const m=Pr(u);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),jb(window,d),zb(window,h)}function d(u){if(!a)return;const m=Pr(u),g=m.x-n,v=m.y-o;n=m.x,o=m.y,e("swipeMove",{x:n,y:o,dx:g,dy:v}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?li:hn}),xd(window,h),Dd(window,d))}function h(u){if(xd(window,h),Dd(window,d),a=!1,!l()){e("swipeFailed");return}const m=Pr(u);e("swipeEnd",{x:m.x,y:m.y})}return Mb(i,c),{destroy(){Tb(i,c)}}}function Rb(i,t){i.addEventListener("mouseenter",t)}function Gb(i,t){i.removeEventListener("mouseenter",t)}function Nb(i,t){i.addEventListener("mouseleave",t)}function Sd(i,t){i.removeEventListener("mouseleave",t)}function Wb(i){const t=wr(i);function e(){Nb(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),Sd(i,n)}return Rb(i,e),{destroy(){Gb(i,e),Sd(i,n)}}}const Fb=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function ci(i,t,e){return Math.max(i,Math.min(t,e))}function Hb(i,t){i.addEventListener("touchstart",t,{passive:!0})}function Xb(i,t){i.removeEventListener("touchstart",t)}function Yb(i,t){i.addEventListener("touchend",t)}function Ld(i,t){i.removeEventListener("touchend",t)}function Ub(i){const t=wr(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,d=Fb(n,l);return c<=_b&&d<=Vb}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Yb(i,r)}function r(a){Ld(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return Hb(i,s),{destroy(){Xb(i,s),Ld(i,r)}}}function qb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Md({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function Jb({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Zb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?qb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):Jb({currentParticleIndex:i,particlesToScroll:s})}function Md({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function Kb({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Td({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function $b({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Md({particlesCountWithoutClones:t,particlesToScroll:e}):Kb({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function e1({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return ci(0,Math.min(t+i*n,o-e),o-1)}function t1({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return ci(0,Math.min(i*t,e-n),e-1)}function Cr({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?e1({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):t1({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function n1({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function Td({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function i1(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function o1({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function s1({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function r1({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return Ie(W({},n),{total:n.head+n.tail})}const Qi=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Ir=i=>t=>{i[t]&&i[t]()};var a1="Expected a function",zd="__lodash_hash_undefined__",jd=1/0,l1="[object Function]",c1="[object GeneratorFunction]",d1="[object Symbol]",h1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u1=/^\w*$/,f1=/^\./,m1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p1=/[\\^$.*+?()[\]{}|]/g,g1=/\\(\\)?/g,v1=/^\[object .+?Constructor\]$/,A1=typeof wt=="object"&&wt&&wt.Object===Object&&wt,b1=typeof self=="object"&&self&&self.Object===Object&&self,Er=A1||b1||Function("return this")();function y1(i,t){return i==null?void 0:i[t]}function w1(i){var t=!1;if(i!=null&&typeof i.toString!="function")try{t=!!(i+"")}catch(e){}return t}var P1=Array.prototype,C1=Function.prototype,_d=Object.prototype,kr=Er["__core-js_shared__"],Vd=function(){var i=/[^.]+$/.exec(kr&&kr.keys&&kr.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Od=C1.toString,xr=_d.hasOwnProperty,Bd=_d.toString,I1=RegExp("^"+Od.call(xr).replace(p1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qd=Er.Symbol,E1=P1.splice,k1=Nd(Er,"Map"),Ri=Nd(Object,"create"),Rd=Qd?Qd.prototype:void 0,Gd=Rd?Rd.toString:void 0;function In(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function x1(){this.__data__=Ri?Ri(null):{}}function D1(i){return this.has(i)&&delete this.__data__[i]}function S1(i){var t=this.__data__;if(Ri){var e=t[i];return e===zd?void 0:e}return xr.call(t,i)?t[i]:void 0}function L1(i){var t=this.__data__;return Ri?t[i]!==void 0:xr.call(t,i)}function M1(i,t){var e=this.__data__;return e[i]=Ri&&t===void 0?zd:t,this}In.prototype.clear=x1,In.prototype.delete=D1,In.prototype.get=S1,In.prototype.has=L1,In.prototype.set=M1;function di(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function T1(){this.__data__=[]}function z1(i){var t=this.__data__,e=$o(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():E1.call(t,e,1),!0}function j1(i){var t=this.__data__,e=$o(t,i);return e<0?void 0:t[e][1]}function _1(i){return $o(this.__data__,i)>-1}function V1(i,t){var e=this.__data__,n=$o(e,i);return n<0?e.push([i,t]):e[n][1]=t,this}di.prototype.clear=T1,di.prototype.delete=z1,di.prototype.get=j1,di.prototype.has=_1,di.prototype.set=V1;function En(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function O1(){this.__data__={hash:new In,map:new(k1||di),string:new In}}function B1(i){return es(this,i).delete(i)}function Q1(i){return es(this,i).get(i)}function R1(i){return es(this,i).has(i)}function G1(i,t){return es(this,i).set(i,t),this}En.prototype.clear=O1,En.prototype.delete=B1,En.prototype.get=Q1,En.prototype.has=R1,En.prototype.set=G1;function $o(i,t){for(var e=i.length;e--;)if(K1(i[e][0],t))return e;return-1}function N1(i,t){t=X1(t,i)?[t]:H1(t);for(var e=0,n=t.length;i!=null&&e<n;)i=i[J1(t[e++])];return e&&e==n?i:void 0}function W1(i){if(!Fd(i)||U1(i))return!1;var t=$1(i)||w1(i)?I1:v1;return t.test(Z1(i))}function F1(i){if(typeof i=="string")return i;if(Sr(i))return Gd?Gd.call(i):"";var t=i+"";return t=="0"&&1/i==-jd?"-0":t}function H1(i){return Wd(i)?i:q1(i)}function es(i,t){var e=i.__data__;return Y1(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Nd(i,t){var e=y1(i,t);return W1(e)?e:void 0}function X1(i,t){if(Wd(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||Sr(i)?!0:u1.test(i)||!h1.test(i)||t!=null&&i in Object(t)}function Y1(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function U1(i){return!!Vd&&Vd in i}var q1=Dr(function(i){i=ty(i);var t=[];return f1.test(i)&&t.push(""),i.replace(m1,function(e,n,o,s){t.push(o?s.replace(g1,"$1"):n||e)}),t});function J1(i){if(typeof i=="string"||Sr(i))return i;var t=i+"";return t=="0"&&1/i==-jd?"-0":t}function Z1(i){if(i!=null){try{return Od.call(i)}catch(t){}try{return i+""}catch(t){}}return""}function Dr(i,t){if(typeof i!="function"||t&&typeof t!="function")throw new TypeError(a1);var e=function(){var n=arguments,o=t?t.apply(this,n):n[0],s=e.cache;if(s.has(o))return s.get(o);var r=i.apply(this,n);return e.cache=s.set(o,r),r};return e.cache=new(Dr.Cache||En),e}Dr.Cache=En;function K1(i,t){return i===t||i!==i&&t!==t}var Wd=Array.isArray;function $1(i){var t=Fd(i)?Bd.call(i):"";return t==l1||t==c1}function Fd(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function ey(i){return!!i&&typeof i=="object"}function Sr(i){return typeof i=="symbol"||ey(i)&&Bd.call(i)==d1}function ty(i){return i==null?"":F1(i)}function ny(i,t,e){var n=i==null?void 0:N1(i,t);return n===void 0?e:n}var ts=ny,ns={},iy={get exports(){return ns},set exports(i){ns=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",o=9007199254740991,s="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",u="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",A="[object RegExp]",b="[object Set]",y="[object String]",C="[object Symbol]",D="[object WeakMap]",x="[object ArrayBuffer]",I="[object DataView]",T="[object Float32Array]",S="[object Float64Array]",H="[object Int8Array]",X="[object Int16Array]",N="[object Int32Array]",G="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",Z="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,Y=/\w*$/,K=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,oe={};oe[s]=oe[r]=oe[x]=oe[I]=oe[a]=oe[l]=oe[T]=oe[S]=oe[H]=oe[X]=oe[N]=oe[u]=oe[m]=oe[g]=oe[A]=oe[b]=oe[y]=oe[C]=oe[G]=oe[j]=oe[R]=oe[Z]=!0,oe[c]=oe[d]=oe[D]=!1;var ye=typeof wt=="object"&&wt&&wt.Object===Object&&wt,Pe=typeof self=="object"&&self&&self.Object===Object&&self,Ae=ye||Pe||Function("return this")(),_e=t&&!t.nodeType&&t,be=_e&&!0&&i&&!i.nodeType&&i,Fe=be&&be.exports===_e;function fe(p,P){return p.set(P[0],P[1]),p}function we(p,P){return p.add(P),p}function Te(p,P){for(var L=-1,F=p?p.length:0;++L<F&&P(p[L],L,p)!==!1;);return p}function pe(p,P){for(var L=-1,F=P.length,Ce=p.length;++L<F;)p[Ce+L]=P[L];return p}function Je(p,P,L,F){var Ce=-1,ge=p?p.length:0;for(F&&ge&&(L=p[++Ce]);++Ce<ge;)L=P(L,p[Ce],Ce,p);return L}function dt(p,P){for(var L=-1,F=Array(p);++L<p;)F[L]=P(L);return F}function De(p,P){return p==null?void 0:p[P]}function st(p){var P=!1;if(p!=null&&typeof p.toString!="function")try{P=!!(p+"")}catch(L){}return P}function re(p){var P=-1,L=Array(p.size);return p.forEach(function(F,Ce){L[++P]=[Ce,F]}),L}function xe(p,P){return function(L){return p(P(L))}}function Ne(p){var P=-1,L=Array(p.size);return p.forEach(function(F){L[++P]=F}),L}var ft=Array.prototype,Yt=Function.prototype,At=Object.prototype,bt=Ae["__core-js_shared__"],Ve=function(){var p=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Qe=Yt.toString,Ye=At.hasOwnProperty,St=At.toString,Fi=RegExp("^"+Qe.call(Ye).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=Fe?Ae.Buffer:void 0,fn=Ae.Symbol,xn=Ae.Uint8Array,mt=xe(Object.getPrototypeOf,Object),fi=Object.create,mi=At.propertyIsEnumerable,Gr=ft.splice,Hi=Object.getOwnPropertySymbols,pi=Ot?Ot.isBuffer:void 0,hs=xe(Object.keys,Object),gi=Mt(Ae,"DataView"),Dn=Mt(Ae,"Map"),Lt=Mt(Ae,"Promise"),vi=Mt(Ae,"Set"),Xi=Mt(Ae,"WeakMap"),Sn=Mt(Object,"create"),Yi=ht(gi),Ln=ht(Dn),Ui=ht(Lt),qi=ht(vi),Ji=ht(Xi),mn=fn?fn.prototype:void 0,us=mn?mn.valueOf:void 0;function Ut(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Nr(){this.__data__=Sn?Sn(null):{}}function Wr(p){return this.has(p)&&delete this.__data__[p]}function Fr(p){var P=this.__data__;if(Sn){var L=P[p];return L===n?void 0:L}return Ye.call(P,p)?P[p]:void 0}function fs(p){var P=this.__data__;return Sn?P[p]!==void 0:Ye.call(P,p)}function Zi(p,P){var L=this.__data__;return L[p]=Sn&&P===void 0?n:P,this}Ut.prototype.clear=Nr,Ut.prototype.delete=Wr,Ut.prototype.get=Fr,Ut.prototype.has=fs,Ut.prototype.set=Zi;function Ze(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Hr(){this.__data__=[]}function Xr(p){var P=this.__data__,L=bi(P,p);if(L<0)return!1;var F=P.length-1;return L==F?P.pop():Gr.call(P,L,1),!0}function Yr(p){var P=this.__data__,L=bi(P,p);return L<0?void 0:P[L][1]}function Ur(p){return bi(this.__data__,p)>-1}function qr(p,P){var L=this.__data__,F=bi(L,p);return F<0?L.push([p,P]):L[F][1]=P,this}Ze.prototype.clear=Hr,Ze.prototype.delete=Xr,Ze.prototype.get=Yr,Ze.prototype.has=Ur,Ze.prototype.set=qr;function rt(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Jr(){this.__data__={hash:new Ut,map:new(Dn||Ze),string:new Ut}}function Zr(p){return Tn(this,p).delete(p)}function Kr(p){return Tn(this,p).get(p)}function $r(p){return Tn(this,p).has(p)}function ea(p,P){return Tn(this,p).set(p,P),this}rt.prototype.clear=Jr,rt.prototype.delete=Zr,rt.prototype.get=Kr,rt.prototype.has=$r,rt.prototype.set=ea;function pt(p){this.__data__=new Ze(p)}function ta(){this.__data__=new Ze}function na(p){return this.__data__.delete(p)}function ia(p){return this.__data__.get(p)}function oa(p){return this.__data__.has(p)}function sa(p,P){var L=this.__data__;if(L instanceof Ze){var F=L.__data__;if(!Dn||F.length<e-1)return F.push([p,P]),this;L=this.__data__=new rt(F)}return L.set(p,P),this}pt.prototype.clear=ta,pt.prototype.delete=na,pt.prototype.get=ia,pt.prototype.has=oa,pt.prototype.set=sa;function Ai(p,P){var L=to(p)||wi(p)?dt(p.length,String):[],F=L.length,Ce=!!F;for(var ge in p)(P||Ye.call(p,ge))&&!(Ce&&(ge=="length"||ba(ge,F)))&&L.push(ge);return L}function ms(p,P,L){var F=p[P];(!(Ye.call(p,P)&&bs(F,L))||L===void 0&&!(P in p))&&(p[P]=L)}function bi(p,P){for(var L=p.length;L--;)if(bs(p[L][0],P))return L;return-1}function Bt(p,P){return p&&eo(P,io(P),p)}function Ki(p,P,L,F,Ce,ge,Se){var Me;if(F&&(Me=ge?F(p,Ce,ge,Se):F(p)),Me!==void 0)return Me;if(!Rt(p))return p;var He=to(p);if(He){if(Me=va(p),!P)return ma(p,Me)}else{var je=Jt(p),at=je==d||je==h;if(ys(p))return yi(p,P);if(je==g||je==s||at&&!ge){if(st(p))return ge?p:{};if(Me=Qt(at?{}:p),!P)return pa(p,Bt(Me,p))}else{if(!oe[je])return ge?p:{};Me=Aa(p,je,Ki,P)}}Se||(Se=new pt);var gt=Se.get(p);if(gt)return gt;if(Se.set(p,Me),!He)var Xe=L?ga(p):io(p);return Te(Xe||p,function(lt,Ke){Xe&&(Ke=lt,lt=p[Ke]),ms(Me,Ke,Ki(lt,P,L,F,Ke,p,Se))}),Me}function ra(p){return Rt(p)?fi(p):{}}function aa(p,P,L){var F=P(p);return to(p)?F:pe(F,L(p))}function la(p){return St.call(p)}function ca(p){if(!Rt(p)||wa(p))return!1;var P=no(p)||st(p)?Fi:K;return P.test(ht(p))}function da(p){if(!vs(p))return hs(p);var P=[];for(var L in Object(p))Ye.call(p,L)&&L!="constructor"&&P.push(L);return P}function yi(p,P){if(P)return p.slice();var L=new p.constructor(p.length);return p.copy(L),L}function $i(p){var P=new p.constructor(p.byteLength);return new xn(P).set(new xn(p)),P}function Mn(p,P){var L=P?$i(p.buffer):p.buffer;return new p.constructor(L,p.byteOffset,p.byteLength)}function ps(p,P,L){var F=P?L(re(p),!0):re(p);return Je(F,fe,new p.constructor)}function gs(p){var P=new p.constructor(p.source,Y.exec(p));return P.lastIndex=p.lastIndex,P}function ha(p,P,L){var F=P?L(Ne(p),!0):Ne(p);return Je(F,we,new p.constructor)}function ua(p){return us?Object(us.call(p)):{}}function fa(p,P){var L=P?$i(p.buffer):p.buffer;return new p.constructor(L,p.byteOffset,p.length)}function ma(p,P){var L=-1,F=p.length;for(P||(P=Array(F));++L<F;)P[L]=p[L];return P}function eo(p,P,L,F){L||(L={});for(var Ce=-1,ge=P.length;++Ce<ge;){var Se=P[Ce],Me=F?F(L[Se],p[Se],Se,L,p):void 0;ms(L,Se,Me===void 0?p[Se]:Me)}return L}function pa(p,P){return eo(p,qt(p),P)}function ga(p){return aa(p,io,qt)}function Tn(p,P){var L=p.__data__;return ya(P)?L[typeof P=="string"?"string":"hash"]:L.map}function Mt(p,P){var L=De(p,P);return ca(L)?L:void 0}var qt=Hi?xe(Hi,Object):Ca,Jt=la;(gi&&Jt(new gi(new ArrayBuffer(1)))!=I||Dn&&Jt(new Dn)!=u||Lt&&Jt(Lt.resolve())!=v||vi&&Jt(new vi)!=b||Xi&&Jt(new Xi)!=D)&&(Jt=function(p){var P=St.call(p),L=P==g?p.constructor:void 0,F=L?ht(L):void 0;if(F)switch(F){case Yi:return I;case Ln:return u;case Ui:return v;case qi:return b;case Ji:return D}return P});function va(p){var P=p.length,L=p.constructor(P);return P&&typeof p[0]=="string"&&Ye.call(p,"index")&&(L.index=p.index,L.input=p.input),L}function Qt(p){return typeof p.constructor=="function"&&!vs(p)?ra(mt(p)):{}}function Aa(p,P,L,F){var Ce=p.constructor;switch(P){case x:return $i(p);case a:case l:return new Ce(+p);case I:return Mn(p,F);case T:case S:case H:case X:case N:case G:case j:case R:case Z:return fa(p,F);case u:return ps(p,F,L);case m:case y:return new Ce(p);case A:return gs(p);case b:return ha(p,F,L);case C:return ua(p)}}function ba(p,P){return P=P==null?o:P,!!P&&(typeof p=="number"||ae.test(p))&&p>-1&&p%1==0&&p<P}function ya(p){var P=typeof p;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?p!=="__proto__":p===null}function wa(p){return!!Ve&&Ve in p}function vs(p){var P=p&&p.constructor,L=typeof P=="function"&&P.prototype||At;return p===L}function ht(p){if(p!=null){try{return Qe.call(p)}catch(P){}try{return p+""}catch(P){}}return""}function As(p){return Ki(p,!0,!0)}function bs(p,P){return p===P||p!==p&&P!==P}function wi(p){return Pa(p)&&Ye.call(p,"callee")&&(!mi.call(p,"callee")||St.call(p)==s)}var to=Array.isArray;function Pi(p){return p!=null&&ws(p.length)&&!no(p)}function Pa(p){return Ps(p)&&Pi(p)}var ys=pi||Ia;function no(p){var P=Rt(p)?St.call(p):"";return P==d||P==h}function ws(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=o}function Rt(p){var P=typeof p;return!!p&&(P=="object"||P=="function")}function Ps(p){return!!p&&typeof p=="object"}function io(p){return Pi(p)?Ai(p):da(p)}function Ca(){return[]}function Ia(){return!1}i.exports=As})(iy,ns);const oy=ns;var is={},sy={get exports(){return is},set exports(i){is=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",o=1,s=2,r=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",u="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",A="[object Number]",b="[object Null]",y="[object Object]",C="[object Promise]",D="[object Proxy]",x="[object RegExp]",I="[object Set]",T="[object String]",S="[object Symbol]",H="[object Undefined]",X="[object WeakMap]",N="[object ArrayBuffer]",G="[object DataView]",j="[object Float32Array]",R="[object Float64Array]",Z="[object Int8Array]",q="[object Int16Array]",Y="[object Int32Array]",K="[object Uint8Array]",ae="[object Uint8ClampedArray]",oe="[object Uint16Array]",ye="[object Uint32Array]",Pe=/[\\^$.*+?()[\]{}|]/g,Ae=/^\[object .+?Constructor\]$/,_e=/^(?:0|[1-9]\d*)$/,be={};be[j]=be[R]=be[Z]=be[q]=be[Y]=be[K]=be[ae]=be[oe]=be[ye]=!0,be[a]=be[l]=be[N]=be[d]=be[G]=be[h]=be[u]=be[m]=be[v]=be[A]=be[y]=be[x]=be[I]=be[T]=be[X]=!1;var Fe=typeof wt=="object"&&wt&&wt.Object===Object&&wt,fe=typeof self=="object"&&self&&self.Object===Object&&self,we=Fe||fe||Function("return this")(),Te=t&&!t.nodeType&&t,pe=Te&&!0&&i&&!i.nodeType&&i,Je=pe&&pe.exports===Te,dt=Je&&Fe.process,De=function(){try{return dt&&dt.binding&&dt.binding("util")}catch(p){}}(),st=De&&De.isTypedArray;function re(p,P){for(var L=-1,F=p==null?0:p.length,Ce=0,ge=[];++L<F;){var Se=p[L];P(Se,L,p)&&(ge[Ce++]=Se)}return ge}function xe(p,P){for(var L=-1,F=P.length,Ce=p.length;++L<F;)p[Ce+L]=P[L];return p}function Ne(p,P){for(var L=-1,F=p==null?0:p.length;++L<F;)if(P(p[L],L,p))return!0;return!1}function ft(p,P){for(var L=-1,F=Array(p);++L<p;)F[L]=P(L);return F}function Yt(p){return function(P){return p(P)}}function At(p,P){return p.has(P)}function bt(p,P){return p==null?void 0:p[P]}function Ve(p){var P=-1,L=Array(p.size);return p.forEach(function(F,Ce){L[++P]=[Ce,F]}),L}function Qe(p,P){return function(L){return p(P(L))}}function Ye(p){var P=-1,L=Array(p.size);return p.forEach(function(F){L[++P]=F}),L}var St=Array.prototype,Fi=Function.prototype,Ot=Object.prototype,fn=we["__core-js_shared__"],xn=Fi.toString,mt=Ot.hasOwnProperty,fi=function(){var p=/[^.]+$/.exec(fn&&fn.keys&&fn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),mi=Ot.toString,Gr=RegExp("^"+xn.call(mt).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hi=Je?we.Buffer:void 0,pi=we.Symbol,hs=we.Uint8Array,gi=Ot.propertyIsEnumerable,Dn=St.splice,Lt=pi?pi.toStringTag:void 0,vi=Object.getOwnPropertySymbols,Xi=Hi?Hi.isBuffer:void 0,Sn=Qe(Object.keys,Object),Yi=qt(we,"DataView"),Ln=qt(we,"Map"),Ui=qt(we,"Promise"),qi=qt(we,"Set"),Ji=qt(we,"WeakMap"),mn=qt(Object,"create"),us=ht(Yi),Ut=ht(Ln),Nr=ht(Ui),Wr=ht(qi),Fr=ht(Ji),fs=pi?pi.prototype:void 0,Zi=fs?fs.valueOf:void 0;function Ze(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Hr(){this.__data__=mn?mn(null):{},this.size=0}function Xr(p){var P=this.has(p)&&delete this.__data__[p];return this.size-=P?1:0,P}function Yr(p){var P=this.__data__;if(mn){var L=P[p];return L===n?void 0:L}return mt.call(P,p)?P[p]:void 0}function Ur(p){var P=this.__data__;return mn?P[p]!==void 0:mt.call(P,p)}function qr(p,P){var L=this.__data__;return this.size+=this.has(p)?0:1,L[p]=mn&&P===void 0?n:P,this}Ze.prototype.clear=Hr,Ze.prototype.delete=Xr,Ze.prototype.get=Yr,Ze.prototype.has=Ur,Ze.prototype.set=qr;function rt(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Jr(){this.__data__=[],this.size=0}function Zr(p){var P=this.__data__,L=yi(P,p);if(L<0)return!1;var F=P.length-1;return L==F?P.pop():Dn.call(P,L,1),--this.size,!0}function Kr(p){var P=this.__data__,L=yi(P,p);return L<0?void 0:P[L][1]}function $r(p){return yi(this.__data__,p)>-1}function ea(p,P){var L=this.__data__,F=yi(L,p);return F<0?(++this.size,L.push([p,P])):L[F][1]=P,this}rt.prototype.clear=Jr,rt.prototype.delete=Zr,rt.prototype.get=Kr,rt.prototype.has=$r,rt.prototype.set=ea;function pt(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function ta(){this.size=0,this.__data__={hash:new Ze,map:new(Ln||rt),string:new Ze}}function na(p){var P=Mt(this,p).delete(p);return this.size-=P?1:0,P}function ia(p){return Mt(this,p).get(p)}function oa(p){return Mt(this,p).has(p)}function sa(p,P){var L=Mt(this,p),F=L.size;return L.set(p,P),this.size+=L.size==F?0:1,this}pt.prototype.clear=ta,pt.prototype.delete=na,pt.prototype.get=ia,pt.prototype.has=oa,pt.prototype.set=sa;function Ai(p){var P=-1,L=p==null?0:p.length;for(this.__data__=new pt;++P<L;)this.add(p[P])}function ms(p){return this.__data__.set(p,n),this}function bi(p){return this.__data__.has(p)}Ai.prototype.add=Ai.prototype.push=ms,Ai.prototype.has=bi;function Bt(p){var P=this.__data__=new rt(p);this.size=P.size}function Ki(){this.__data__=new rt,this.size=0}function ra(p){var P=this.__data__,L=P.delete(p);return this.size=P.size,L}function aa(p){return this.__data__.get(p)}function la(p){return this.__data__.has(p)}function ca(p,P){var L=this.__data__;if(L instanceof rt){var F=L.__data__;if(!Ln||F.length<e-1)return F.push([p,P]),this.size=++L.size,this;L=this.__data__=new pt(F)}return L.set(p,P),this.size=L.size,this}Bt.prototype.clear=Ki,Bt.prototype.delete=ra,Bt.prototype.get=aa,Bt.prototype.has=la,Bt.prototype.set=ca;function da(p,P){var L=wi(p),F=!L&&bs(p),Ce=!L&&!F&&Pi(p),ge=!L&&!F&&!Ce&&Ps(p),Se=L||F||Ce||ge,Me=Se?ft(p.length,String):[],He=Me.length;for(var je in p)(P||mt.call(p,je))&&!(Se&&(je=="length"||Ce&&(je=="offset"||je=="parent")||ge&&(je=="buffer"||je=="byteLength"||je=="byteOffset")||Aa(je,He)))&&Me.push(je);return Me}function yi(p,P){for(var L=p.length;L--;)if(As(p[L][0],P))return L;return-1}function $i(p,P,L){var F=P(p);return wi(p)?F:xe(F,L(p))}function Mn(p){return p==null?p===void 0?H:b:Lt&&Lt in Object(p)?Jt(p):vs(p)}function ps(p){return Rt(p)&&Mn(p)==a}function gs(p,P,L,F,Ce){return p===P?!0:p==null||P==null||!Rt(p)&&!Rt(P)?p!==p&&P!==P:ha(p,P,L,F,gs,Ce)}function ha(p,P,L,F,Ce,ge){var Se=wi(p),Me=wi(P),He=Se?l:Qt(p),je=Me?l:Qt(P);He=He==a?y:He,je=je==a?y:je;var at=He==y,gt=je==y,Xe=He==je;if(Xe&&Pi(p)){if(!Pi(P))return!1;Se=!0,at=!1}if(Xe&&!at)return ge||(ge=new Bt),Se||Ps(p)?eo(p,P,L,F,Ce,ge):pa(p,P,He,L,F,Ce,ge);if(!(L&o)){var lt=at&&mt.call(p,"__wrapped__"),Ke=gt&&mt.call(P,"__wrapped__");if(lt||Ke){var pn=lt?p.value():p,Zt=Ke?P.value():P;return ge||(ge=new Bt),Ce(pn,Zt,L,F,ge)}}return Xe?(ge||(ge=new Bt),ga(p,P,L,F,Ce,ge)):!1}function ua(p){if(!ws(p)||ya(p))return!1;var P=ys(p)?Gr:Ae;return P.test(ht(p))}function fa(p){return Rt(p)&&no(p.length)&&!!be[Mn(p)]}function ma(p){if(!wa(p))return Sn(p);var P=[];for(var L in Object(p))mt.call(p,L)&&L!="constructor"&&P.push(L);return P}function eo(p,P,L,F,Ce,ge){var Se=L&o,Me=p.length,He=P.length;if(Me!=He&&!(Se&&He>Me))return!1;var je=ge.get(p);if(je&&ge.get(P))return je==P;var at=-1,gt=!0,Xe=L&s?new Ai:void 0;for(ge.set(p,P),ge.set(P,p);++at<Me;){var lt=p[at],Ke=P[at];if(F)var pn=Se?F(Ke,lt,at,P,p,ge):F(lt,Ke,at,p,P,ge);if(pn!==void 0){if(pn)continue;gt=!1;break}if(Xe){if(!Ne(P,function(Zt,zn){if(!At(Xe,zn)&&(lt===Zt||Ce(lt,Zt,L,F,ge)))return Xe.push(zn)})){gt=!1;break}}else if(!(lt===Ke||Ce(lt,Ke,L,F,ge))){gt=!1;break}}return ge.delete(p),ge.delete(P),gt}function pa(p,P,L,F,Ce,ge,Se){switch(L){case G:if(p.byteLength!=P.byteLength||p.byteOffset!=P.byteOffset)return!1;p=p.buffer,P=P.buffer;case N:return!(p.byteLength!=P.byteLength||!ge(new hs(p),new hs(P)));case d:case h:case A:return As(+p,+P);case u:return p.name==P.name&&p.message==P.message;case x:case T:return p==P+"";case v:var Me=Ve;case I:var He=F&o;if(Me||(Me=Ye),p.size!=P.size&&!He)return!1;var je=Se.get(p);if(je)return je==P;F|=s,Se.set(p,P);var at=eo(Me(p),Me(P),F,Ce,ge,Se);return Se.delete(p),at;case S:if(Zi)return Zi.call(p)==Zi.call(P)}return!1}function ga(p,P,L,F,Ce,ge){var Se=L&o,Me=Tn(p),He=Me.length,je=Tn(P),at=je.length;if(He!=at&&!Se)return!1;for(var gt=He;gt--;){var Xe=Me[gt];if(!(Se?Xe in P:mt.call(P,Xe)))return!1}var lt=ge.get(p);if(lt&&ge.get(P))return lt==P;var Ke=!0;ge.set(p,P),ge.set(P,p);for(var pn=Se;++gt<He;){Xe=Me[gt];var Zt=p[Xe],zn=P[Xe];if(F)var ou=Se?F(zn,Zt,Xe,P,p,ge):F(Zt,zn,Xe,p,P,ge);if(!(ou===void 0?Zt===zn||Ce(Zt,zn,L,F,ge):ou)){Ke=!1;break}pn||(pn=Xe=="constructor")}if(Ke&&!pn){var Cs=p.constructor,Is=P.constructor;Cs!=Is&&"constructor"in p&&"constructor"in P&&!(typeof Cs=="function"&&Cs instanceof Cs&&typeof Is=="function"&&Is instanceof Is)&&(Ke=!1)}return ge.delete(p),ge.delete(P),Ke}function Tn(p){return $i(p,io,va)}function Mt(p,P){var L=p.__data__;return ba(P)?L[typeof P=="string"?"string":"hash"]:L.map}function qt(p,P){var L=bt(p,P);return ua(L)?L:void 0}function Jt(p){var P=mt.call(p,Lt),L=p[Lt];try{p[Lt]=void 0;var F=!0}catch(ge){}var Ce=mi.call(p);return F&&(P?p[Lt]=L:delete p[Lt]),Ce}var va=vi?function(p){return p==null?[]:(p=Object(p),re(vi(p),function(P){return gi.call(p,P)}))}:Ca,Qt=Mn;(Yi&&Qt(new Yi(new ArrayBuffer(1)))!=G||Ln&&Qt(new Ln)!=v||Ui&&Qt(Ui.resolve())!=C||qi&&Qt(new qi)!=I||Ji&&Qt(new Ji)!=X)&&(Qt=function(p){var P=Mn(p),L=P==y?p.constructor:void 0,F=L?ht(L):"";if(F)switch(F){case us:return G;case Ut:return v;case Nr:return C;case Wr:return I;case Fr:return X}return P});function Aa(p,P){return P=P==null?r:P,!!P&&(typeof p=="number"||_e.test(p))&&p>-1&&p%1==0&&p<P}function ba(p){var P=typeof p;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?p!=="__proto__":p===null}function ya(p){return!!fi&&fi in p}function wa(p){var P=p&&p.constructor,L=typeof P=="function"&&P.prototype||Ot;return p===L}function vs(p){return mi.call(p)}function ht(p){if(p!=null){try{return xn.call(p)}catch(P){}try{return p+""}catch(P){}}return""}function As(p,P){return p===P||p!==p&&P!==P}var bs=ps(function(){return arguments}())?ps:function(p){return Rt(p)&&mt.call(p,"callee")&&!gi.call(p,"callee")},wi=Array.isArray;function to(p){return p!=null&&no(p.length)&&!ys(p)}var Pi=Xi||Ia;function Pa(p,P){return gs(p,P)}function ys(p){if(!ws(p))return!1;var P=Mn(p);return P==m||P==g||P==c||P==D}function no(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=r}function ws(p){var P=typeof p;return p!=null&&(P=="object"||P=="function")}function Rt(p){return p!=null&&typeof p=="object"}var Ps=st?Yt(st):fa;function io(p){return to(p)?da(p):ma(p)}function Ca(){return[]}function Ia(){return!1}i.exports=Pa})(sy,is);const ry=is,ay=(i,t)=>ry(i,t),ly=i=>Object.keys(i||{}),cy=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},dy=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=ly(s);if(a.includes(n)){const l=cy(a,e);ay(s,l)||(i[o].deps=l,r())}})}}},hy=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function uy(i,t){const e=ts(i,"data",{}),n=ts(i,"watch",{}),o=ts(i,"methods",{}),s=ts(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=dy(),{targetWatcher:c,getTarget:d}=hy();let h;const u={},m=()=>({data:h,methods:u});let g=!1;const v=b=>(...y)=>{g=!0;const C=b(...y);return g=!1,C};Object.entries(o).forEach(([b,y])=>{u[b]=v((...C)=>y(m(),...C)),Object.defineProperty(u[b],"name",{value:b})}),h=new Proxy(oy(e),{get(b,y){return d()&&!g&&r(d(),{prop:y,value:b[y]}),Reflect.get(...arguments)},set(b,y,C){return b[y]===C||(Reflect.set(...arguments),d()||(s&&s(y,C),a(h,y))),!0}}),Object.entries(n).forEach(([b,y])=>{c(b,()=>{y(m())})});const A=[h,u];return A._internal={_getSubscribers(){return l}},A}function fy({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function my({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=ci(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,u)=>h-u),d=c.flatMap(h=>fy({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(d)].sort((h,u)=>h-u)}}const py=(i,t)=>(i(),setInterval(i,t)),gy=35,Hd=1;class vy{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(gy,Math.max(this._autoplayDuration,1));let o=-n;this._interval=py(()=>U(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>Hd&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Hd)}}function Ay(i){const t=new vy({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=uy({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=my({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Zb({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Td({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=r1({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=$b({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=ci(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=ci(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Cr({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=Cr({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=ci(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return U(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===hn&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===li&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Ir({[hn]:()=>U(this,null,function*(){return a.showNextPage()}),[li]:()=>U(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return U(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(d,h,u){return U(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:Qi(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,d){return U(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,d){return U(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,d,h){return U(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Cr({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,d,h){return U(this,arguments,function*({methods:r},a,l){const u=r._getParticleIndexByPageIndex(a);yield r.showParticle(u,l)})},offsetPage({data:r},a){const l=Qi(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,o]=e;return[{data:n,progressManager:t},o,e._internal]}function by(i){me(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const yy=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Xd=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),wy=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Yd=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),Py=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Ud=i=>({loaded:i[6],currentPageIndex:i[5]}),Cy=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),qd=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Jd(i){let t;const e=i[37].prev,n=Nn(e,i,i[36],qd),o=n||Iy(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,Cy):Hn(s[36]),qd):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function Iy(i){let t,e,n;return e=new Ed({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Zd(i){let t,e,n;return e=new Lb({props:{value:i[7]}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Kd(i){let t;const e=i[37].next,n=Nn(e,i,i[36],Yd),o=n||Ey(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,wy):Hn(s[36]),Yd):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function Ey(i){let t,e,n;return e=new Ed({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function $d(i){let t;const e=i[37].dots,n=Nn(e,i,i[36],Xd),o=n||ky(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,yy):Hn(s[36]),Xd):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function ky(i){let t,e;return t=new Cb({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function xy(i){let t,e,n,o,s,r,a,l,c,d,h,u,m=i[1]&&Jd(i);const g=i[37].default,v=Nn(g,i,i[36],Ud);let A=i[3]&&Zd(i),b=i[1]&&Kd(i),y=i[4]&&$d(i);return{c(){t=V("div"),e=V("div"),m&&m.c(),n=se(),o=V("div"),s=V("div"),v&&v.c(),a=se(),A&&A.c(),l=se(),b&&b.c(),c=se(),y&&y.c(),w(s,"class","sc-carousel__pages-container svelte-sme1z4"),z(s,"transform","translateX("+i[8]+"px)"),z(s,"transition-duration",i[9]+"ms"),z(s,"transition-timing-function",i[0]),w(o,"class","sc-carousel__pages-window svelte-sme1z4"),w(e,"class","sc-carousel__content-container svelte-sme1z4"),w(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(C,D){O(C,t,D),Q(t,e),m&&m.m(e,null),Q(e,n),Q(e,o),Q(o,s),v&&v.m(s,null),i[39](s),Q(o,a),A&&A.m(o,null),i[40](o),Q(e,l),b&&b.m(e,null),Q(t,c),y&&y.m(t,null),d=!0,h||(u=[Wt(r=Qb.call(null,s,{thresholdProvider:i[38]})),ke(s,"swipeStart",i[16]),ke(s,"swipeMove",i[18]),ke(s,"swipeEnd",i[19]),ke(s,"swipeFailed",i[20]),ke(s,"swipeThresholdReached",i[17]),Wt(Wb.call(null,o)),ke(o,"hovered",i[21]),Wt(Ub.call(null,o)),ke(o,"tapped",i[22])],h=!0)},p(C,D){C[1]?m?(m.p(C,D),D[0]&2&&k(m,1)):(m=Jd(C),m.c(),k(m,1),m.m(e,n)):m&&(he(),M(m,1,1,()=>{m=null}),ue()),v&&v.p&&(!d||D[0]&96|D[1]&32)&&Fn(v,g,C,C[36],d?Wn(g,C[36],D,Py):Hn(C[36]),Ud),(!d||D[0]&256)&&z(s,"transform","translateX("+C[8]+"px)"),(!d||D[0]&512)&&z(s,"transition-duration",C[9]+"ms"),(!d||D[0]&1)&&z(s,"transition-timing-function",C[0]),r&&Gn(r.update)&&D[0]&2048&&r.update.call(null,{thresholdProvider:C[38]}),C[3]?A?(A.p(C,D),D[0]&8&&k(A,1)):(A=Zd(C),A.c(),k(A,1),A.m(o,null)):A&&(he(),M(A,1,1,()=>{A=null}),ue()),C[1]?b?(b.p(C,D),D[0]&2&&k(b,1)):(b=Kd(C),b.c(),k(b,1),b.m(e,null)):b&&(he(),M(b,1,1,()=>{b=null}),ue()),C[4]?y?(y.p(C,D),D[0]&16&&k(y,1)):(y=$d(C),y.c(),k(y,1),y.m(t,null)):y&&(he(),M(y,1,1,()=>{y=null}),ue())},i(C){d||(k(m),k(v,C),k(A),k(b),k(y),d=!0)},o(C){M(m),M(v,C),M(A),M(b),M(y),d=!1},d(C){C&&_(t),m&&m.d(),v&&v.d(C),i[39](null),A&&A.d(),i[40](null),b&&b.d(),y&&y.d(),h=!1,$e(u)}}}function Dy(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,d=1;const[{data:h,progressManager:u},m,g]=Ay((re,xe)=>{Ir({currentPageIndex:()=>e(5,r=xe),progressValue:()=>e(7,a=xe),offset:()=>e(8,l=xe),durationMs:()=>e(9,c=xe),pagesCount:()=>e(10,d=xe),loaded:()=>e(6,s=xe)})(re)}),v=Io();let{timingFunction:A="ease-in-out"}=t,{arrows:b=!0}=t,{infinite:y=!0}=t,{initialPageIndex:C=0}=t,{duration:D=500}=t,{autoplay:x=!1}=t,{autoplayDuration:I=3e3}=t,{autoplayDirection:T=hn}=t,{pauseOnFocus:S=!1}=t,{autoplayProgressVisible:H=!1}=t,{dots:X=!0}=t,{swiping:N=!0}=t,{particlesToShow:G=1}=t,{particlesToScroll:j=1}=t;function R(re,xe){return U(this,null,function*(){const Ne=Qi(xe,"animated",!0);if(typeof re!="number")throw new Error("pageIndex should be a number");yield m.showPage(re,{animated:Ne})})}function Z(re){return U(this,null,function*(){const xe=Qi(re,"animated",!0);yield m.showPrevPage({animated:xe})})}function q(re){return U(this,null,function*(){const xe=Qi(re,"animated",!0);yield m.showNextPage({animated:xe})})}let Y=0,K,ae;const oe=i1(({width:re})=>{e(11,Y=re),h.particleWidth=Y/h.particlesToShow,n1({particlesContainerChildren:ae.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function ye(){const{clonesToAppend:re,clonesToPrepend:xe}=o1({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:ae.children});s1({particlesContainer:ae,clonesToAppend:re,clonesToPrepend:xe})}kt(()=>{U(this,null,function*(){yield ll(),ae&&K&&(h.particlesCountWithoutClones=ae.children.length,yield ll(),h.infinite&&ye(),h.particlesCount=ae.children.length,m.showPage(C,{animated:!1}),oe.observe(K))})}),on(()=>{oe.disconnect(),u.reset()});function Pe(re){return U(this,null,function*(){yield m.showPage(re,{animated:!0})})}function Ae(){N&&(h.durationMs=0)}function _e(re){return U(this,null,function*(){N&&(yield Ir({[hn]:m.showNextPage,[li]:m.showPrevPage})(re.detail.direction))})}function be(re){N&&(h.offset+=re.detail.dx)}function Fe(){N&&m.showParticle(h.currentParticleIndex)}function fe(){return U(this,null,function*(){N&&(yield m.offsetPage({animated:!0}))})}function we(re){h.focused=re.detail.value}function Te(){m.toggleFocused()}function pe(){m.showPrevPage()}const Je=()=>Y/3;function dt(re){qe[re?"unshift":"push"](()=>{ae=re,e(13,ae)})}function De(re){qe[re?"unshift":"push"](()=>{K=re,e(12,K)})}const st=re=>Pe(re.detail);return i.$$set=re=>{"timingFunction"in re&&e(0,A=re.timingFunction),"arrows"in re&&e(1,b=re.arrows),"infinite"in re&&e(2,y=re.infinite),"initialPageIndex"in re&&e(24,C=re.initialPageIndex),"duration"in re&&e(25,D=re.duration),"autoplay"in re&&e(26,x=re.autoplay),"autoplayDuration"in re&&e(27,I=re.autoplayDuration),"autoplayDirection"in re&&e(28,T=re.autoplayDirection),"pauseOnFocus"in re&&e(29,S=re.pauseOnFocus),"autoplayProgressVisible"in re&&e(3,H=re.autoplayProgressVisible),"dots"in re&&e(4,X=re.dots),"swiping"in re&&e(30,N=re.swiping),"particlesToShow"in re&&e(31,G=re.particlesToShow),"particlesToScroll"in re&&e(32,j=re.particlesToScroll),"$$scope"in re&&e(36,o=re.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&v("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=y),i.$$.dirty[0]&33554432&&(h.durationMsInit=D),i.$$.dirty[0]&67108864&&(h.autoplay=x),i.$$.dirty[0]&134217728&&(h.autoplayDuration=I),i.$$.dirty[0]&268435456&&(h.autoplayDirection=T),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=S),i.$$.dirty[1]&1&&(h.particlesToShowInit=G),i.$$.dirty[1]&2&&(h.particlesToScrollInit=j)},[A,b,y,H,X,r,s,a,l,c,d,Y,K,ae,m,Pe,Ae,_e,be,Fe,fe,we,Te,pe,C,D,x,I,T,S,N,G,j,R,Z,q,o,n,Je,dt,De,st]}class Sy extends de{constructor(t){super(),ce(this,t,Dy,xy,le,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},by,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function Ly(i){me(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function eh(i){let t;function e(s,r){if(s[2].type==="Image")return Ty;if(s[2].type==="Video")return My}let n=e(i),o=n&&n(i);return{c(){t=V("div"),o&&o.c(),w(t,"class","media-item svelte-159ski6"),w(t,"draggable","false")},m(s,r){O(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&_(t),o&&o.d()}}}function My(i){let t,e,n,o,s,r;function a(d,h){return d[7]&&d[2].videoCoverUrl?jy:zy}let l=a(i),c=l(i);return{c(){c.c(),t=se(),e=V("div"),n=V("div"),o=V("div"),w(o,"class","video-icon-img svelte-159ski6"),z(o,"background-image","url("+i[20]()+")"),ee(o,"canPlay",i[5]),w(n,"class","video-icon svelte-159ski6"),ee(n,"large",i[4]==="large"),ee(n,"small",i[4]==="small"),w(e,"class","video-play-button-container svelte-159ski6"),ee(e,"showPlayButton",i[10])},m(d,h){c.m(d,h),O(d,t,h),O(d,e,h),Q(e,n),Q(n,o),s||(r=ke(o,"click",i[21]),s=!0)},p(d,h){l===(l=a(d))&&c?c.p(d,h):(c.d(1),c=l(d),c&&(c.c(),c.m(t.parentNode,t))),h&8&&z(o,"background-image","url("+d[20]()+")"),h&32&&ee(o,"canPlay",d[5]),h&16&&ee(n,"large",d[4]==="large"),h&16&&ee(n,"small",d[4]==="small"),h&1024&&ee(e,"showPlayButton",d[10])},d(d){c.d(d),d&&_(t),d&&_(e),s=!1,r()}}}function Ty(i){let t,e,n,o;return{c(){t=V("img"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].url)||w(t,"src",n),w(t,"alt",o=i[2].name),w(t,"draggable",!1)},m(s,r){O(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&w(t,"style",e),r&4&&!yt(t.src,n=s[2].url)&&w(t,"src",n),r&4&&o!==(o=s[2].name)&&w(t,"alt",o)},d(s){s&&_(t)}}}function zy(i){let t,e,n,o,s,r,a;return{c(){t=V("video"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||w(t,"src",n),w(t,"poster",o=i[2].videoCoverUrl),w(t,"preload",s=i[2].videoCoverUrl?"none":"auto"),w(t,"disablepictureinpicture",""),t.playsInline=!0,w(t,"paused",""),t.muted=!0,w(t,"draggable",!1),t.loop=!1,w(t,"crossorigin",""),t.controls=!1,ee(t,"showPlayButton",i[10])},m(l,c){O(l,t,c),i[19](t),r||(a=[ke(t,"play",i[14]),ke(t,"pause",i[15]),ke(t,"error",i[16]),ke(t,"ended",i[17]),ke(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&w(t,"style",e),c&4&&!yt(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&w(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&w(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&w(t,"preload",s),c&1024&&ee(t,"showPlayButton",l[10])},d(l){l&&_(t),i[19](null),r=!1,$e(a)}}}function jy(i){let t,e,n,o;return{c(){t=V("img"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].videoCoverUrl)||w(t,"src",n),w(t,"alt",o=i[2].name),w(t,"draggable",!1)},m(s,r){O(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&w(t,"style",e),r&4&&!yt(t.src,n=s[2].videoCoverUrl)&&w(t,"src",n),r&4&&o!==(o=s[2].name)&&w(t,"alt",o)},d(s){s&&_(t)}}}function _y(i){let t,e=i[2]&&eh(i);return{c(){e&&e.c(),t=Ee()},m(n,o){e&&e.m(n,o),O(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=eh(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:J,o:J,d(n){e&&e.d(n),n&&_(t)}}}function Vy(i,t,e){let n,o,{mediaInstance:s={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:d=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:u=!1}=t,m=!0,g=!1;function v(){e(8,g=(a==null?void 0:a.type)==="Video"&&!!a.videoCoverUrl)}const A=sn("mediaStore"),b=sn("hooks"),y=()=>{console.debug("loadPoster"),!g&&n&&(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0),console.debug("loadPoster end"))};b.on("loadVideoFirstFrame",y),kt(()=>{A.subscribe(({currentMediaElement:N})=>{N!==n&&(n==null||n.pause())})});const C=N=>{e(10,m=!1),e(0,s.paused=!1,s),e(8,g=!0),n&&A.set({currentMediaElement:n}),b.emit("playStateChange",{event:N,state:"playing",tag:r,mediaInstance:n})},D=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},x=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},I=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},T=N=>{n&&n.pause()};function S(N){qe[N?"unshift":"push"](()=>{s.videoInstance=N,e(0,s)})}const H=()=>l==="withText"?VA:l==="withoutText"?OA:l,X=N=>{d&&n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=N=>{"mediaInstance"in N&&e(0,s=N.mediaInstance),"tag"in N&&e(1,r=N.tag),"media"in N&&e(2,a=N.media),"playButtonIfNeed"in N&&e(3,l=N.playButtonIfNeed),"playButtonSizeIfNeed"in N&&e(4,c=N.playButtonSizeIfNeed),"canPlay"in N&&e(5,d=N.canPlay),"objectFit"in N&&e(6,h=N.objectFit),"disableVideoIfHavePoster"in N&&e(7,u=N.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=s.videoInstance),i.$$.dirty&4&&e(13,o=a==null?void 0:a.url),i.$$.dirty&8192&&o&&v(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const N=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,j=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&N;n&&j&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",y),document.removeEventListener("touchstart",y),document.removeEventListener("click",y),document.addEventListener("WeixinJSBridgeReady",y),document.addEventListener("touchstart",y),document.addEventListener("click",y))}},[s,r,a,l,c,d,h,u,g,n,m,A,b,o,C,D,x,I,T,S,H,X]}class th extends de{constructor(t){super(),ce(this,t,Vy,_y,le,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},Ly)}}function Oy(i){me(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function nh(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function ih(i){let t,e,n,o,s,r,a;const l=[Qy,By],c=[];function d(h,u){return h[13]&&h[10].length>1?0:1}return n=d(i),o=c[n]=l[n](i),{c(){t=V("div"),e=V("div"),o.c(),w(e,"class","media-list svelte-1mrbqlg"),ee(e,"carouselEnabled",i[13]),w(t,"class","media-list-wrapper svelte-1mrbqlg"),ee(t,"unfolded",i[5])},m(h,u){O(h,t,u),Q(t,e),c[n].m(e,null),a=!0},p(h,u){i=h;let m=n;n=d(i),n===m?c[n].p(i,u):(he(),M(c[m],1,1,()=>{c[m]=null}),ue(),o=c[n],o?o.p(i,u):(o=c[n]=l[n](i),o.c()),k(o,1),o.m(e,null)),(!a||u&8192)&&ee(e,"carouselEnabled",i[13]),(!a||u&32)&&ee(t,"unfolded",i[5])},i(h){a||(k(o),h&&et(()=>{a&&(r&&r.end(1),s=vn(t,Il,i[6]?{y:4,duration:i[4],delay:i[2],easing:tn}:void 0),s.start())}),a=!0)},o(h){M(o),s&&s.invalidate(),h&&(r=Zn(t,Il,i[6]?{y:4,duration:i[4],delay:i[3],easing:tn}:void 0)),a=!1},d(h){h&&_(t),c[n].d(),h&&r&&r.end()}}}function By(i){let t,e,n;const o=[{media:i[1][0]},i[7],{tag:i[0]}];function s(a){i[20](a)}let r={};for(let a=0;a<o.length;a+=1)r=Ue(r,o[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new th({props:r}),qe.push(()=>ml(t,"mediaInstance",s)),{c(){ie(t.$$.fragment)},m(a,l){te(t,a,l),n=!0},p(a,l){const c=l&131?tt(o,[l&2&&{media:a[1][0]},l&128&&fl(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],cl(()=>e=!1)),t.$set(c)},i(a){n||(k(t.$$.fragment,a),n=!0)},o(a){M(t.$$.fragment,a),n=!1},d(a){ne(t,a)}}}function Qy(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[Ry]},$$scope:{ctx:i}};return t=new Sy({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){ie(t.$$.fragment)},m(o,s){te(t,o,s),e=!0},p(o,s){const r={};s&268436865&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){M(t.$$.fragment,o),e=!1},d(o){i[18](null),ne(t,o)}}}function oh(i){let t,e,n;const o=[i[7],{media:i[25]},{tag:i[0]}];function s(a){i[17](a,i[27])}let r={};for(let a=0;a<o.length;a+=1)r=Ue(r,o[a]);return i[8][i[27]]!==void 0&&(r.mediaInstance=i[8][i[27]]),t=new th({props:r}),qe.push(()=>ml(t,"mediaInstance",s)),{c(){ie(t.$$.fragment)},m(a,l){te(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?tt(o,[l&128&&fl(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],cl(()=>e=!1)),t.$set(c)},i(a){n||(k(t.$$.fragment,a),n=!0)},o(a){M(t.$$.fragment,a),n=!1},d(a){ne(t,a)}}}function Ry(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=oh(nh(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=Ee()},m(r,a){for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(r,a);O(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=nh(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=oh(c),o[l].c(),k(o[l],1),o[l].m(t.parentNode,t))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){Ft(o,r),r&&_(t)}}}function Gy(i){let t,e,n=i[5]&&ih(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&k(n,1)):(n=ih(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Ny(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:h=0}=t,{unfolded:u=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:v=!0}=t,{autoplayConfig:A={autoplay:!0,autoplayVideo:!1}}=t,b=[],y=0,C,D=null;const x=sn("hooks"),I=sn("mediaStore");function T(){const G=b[y],j=G==null?void 0:G.videoInstance;j&&(j.paused?(j.muted=!1,j.play()):j.pause())}kt(()=>{x.on("click",G=>{var j,R,Z;(Z=(R=(j=a.tag3DContentSvelte)==null?void 0:j.domContainer)==null?void 0:R.css3DObject)!=null&&Z.opacityMesh&&G.tag.id===a.id&&T()}),D=setInterval(()=>{r&&(C==null||C.goToNext())},3e3)}),on(()=>{clearInterval(D),x.off("click",T)});function S(G,j){i.$$.not_equal(b[j],G)&&(b[j]=G,e(8,b))}function H(G){qe[G?"unshift":"push"](()=>{C=G,e(12,C)})}const X=G=>{n||I.set({currentMediaElement:null}),e(11,y=G.detail)};function N(G){i.$$.not_equal(b[0],G)&&(b[0]=G,e(8,b))}return i.$$set=G=>{"tag"in G&&e(0,a=G.tag),"mediaData"in G&&e(1,l=G.mediaData),"inDelay"in G&&e(2,c=G.inDelay),"outDelay"in G&&e(3,d=G.outDelay),"duration"in G&&e(4,h=G.duration),"unfolded"in G&&e(5,u=G.unfolded),"animation"in G&&e(6,m=G.animation),"mediaItemConfig"in G&&e(7,g=G.mediaItemConfig),"enableCarousel"in G&&e(15,v=G.enableCarousel),"autoplayConfig"in G&&e(16,A=G.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=b.every(G=>G.paused)),i.$$.dirty&32770&&e(13,o=v&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&67072&&(r=s.length>1&&A.autoplay&&n)},[a,l,c,d,h,u,m,g,b,n,s,y,C,o,I,v,A,S,H,X,N]}class sh extends de{constructor(t){super(),ce(this,t,Ny,Gy,le,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},Oy)}}function Wy(i){me(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function rh(i){let t,e,n,o,s,r,a,l;t=new _t({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new pb({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&ah(i),d=i[1]&&lh(i);return{c(){ie(t.$$.fragment),e=se(),n=V("div"),ie(o.$$.fragment),s=se(),c&&c.c(),r=se(),d&&d.c(),a=Ee(),w(n,"class","line svelte-1f7m1lj")},m(h,u){te(t,h,u),O(h,e,u),O(h,n,u),te(o,n,null),O(h,s,u),c&&c.m(h,u),O(h,r,u),d&&d.m(h,u),O(h,a,u),l=!0},p(h,u){const m={};u&8&&(m.visible=h[3]),t.$set(m);const g={};u&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,u),u&4&&k(c,1)):(c=ah(h),c.c(),k(c,1),c.m(r.parentNode,r)):c&&(he(),M(c,1,1,()=>{c=null}),ue()),h[1]?d?(d.p(h,u),u&2&&k(d,1)):(d=lh(h),d.c(),k(d,1),d.m(a.parentNode,a)):d&&(he(),M(d,1,1,()=>{d=null}),ue())},i(h){l||(k(t.$$.fragment,h),k(o.$$.fragment,h),k(c),k(d),l=!0)},o(h){M(t.$$.fragment,h),M(o.$$.fragment,h),M(c),M(d),l=!1},d(h){ne(t,h),h&&_(e),h&&_(n),ne(o),h&&_(s),c&&c.d(h),h&&_(r),d&&d.d(h),h&&_(a)}}}function ah(i){let t,e,n;return e=new ud({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","text svelte-1f7m1lj")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function lh(i){let t,e,n;return e=new sh({props:{autoplayConfig:{autoplay:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Fy(i){let t,e,n=i[0].state&&rh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=rh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Hy(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((d=o.length)!=null?d:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class Xy extends de{constructor(t){super(),ce(this,t,Hy,Fy,le,{tag:0},Wy)}}function Yy(i){me(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function ch(i,t,e){const n=i.slice();return n[0]=t[e],n}function dh(i,t,e){const n=i.slice();return n[0]=t[e],n}function hh(i){let t,e;return{c(){t=V("img"),w(t,"class","headerImage svelte-sezqcq"),yt(t.src,e=i[3].headerPictureUrl)||w(t,"src",e),w(t,"alt","")},m(n,o){O(n,t,o)},p(n,o){o&8&&!yt(t.src,e=n[3].headerPictureUrl)&&w(t,"src",e)},d(n){n&&_(t)}}}function uh(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=fh(dh(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=mh(ch(i,a,c));return{c(){t=V("div"),e=V("div");for(let c=0;c<r.length;c+=1)r[c].c();n=se();for(let c=0;c<l.length;c+=1)l[c].c();w(e,"class","tags svelte-sezqcq"),et(()=>i[11].call(e)),w(t,"class","tags-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),Q(t,e);for(let h=0;h<r.length;h+=1)r[h]&&r[h].m(e,null);Q(e,n);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(e,null);o=yo(e,i[11].bind(e))},p(c,d){if(d&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const u=dh(c,s,h);r[h]?r[h].p(u,d):(r[h]=fh(u),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(d&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const u=ch(c,a,h);l[h]?l[h].p(u,d):(l[h]=mh(u),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&_(t),Ft(r,c),Ft(l,c),o()}}}function fh(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Be(e),w(t,"class","tag primary-tag svelte-sezqcq"),z(t,"min-width",Lr)},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Re(n,e)},d(o){o&&_(t)}}}function mh(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Be(e),w(t,"class","tag secondary-tag svelte-sezqcq"),z(t,"min-width",Lr)},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Re(n,e)},d(o){o&&_(t)}}}function ph(i){let t,e,n=i[7]&&gh(i),o=i[3].highlightText&&Ah(i);return{c(){t=V("div"),n&&n.c(),e=se(),o&&o.c(),w(t,"class","footer svelte-sezqcq")},m(s,r){O(s,t,r),n&&n.m(t,null),Q(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=gh(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Ah(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&_(t),n&&n.d(),o&&o.d()}}}function gh(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&vh(i);return{c(){t=V("div"),e=V("span"),o=Be(n),s=se(),r&&r.c(),w(e,"class","value svelte-sezqcq"),w(t,"class","price svelte-sezqcq")},m(a,l){O(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Re(o,n),a[3].price.unit?r?r.p(a,l):(r=vh(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&_(t),r&&r.d()}}}function vh(i){let t,e=i[3].price.unit+"",n;return{c(){t=V("span"),n=Be(e),w(t,"class","unit svelte-sezqcq")},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Re(n,e)},d(o){o&&_(t)}}}function Ah(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=V("div"),e=V("div"),n=se(),o=V("span"),r=Be(s),a=se(),l=V("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',w(e,"class","gap svelte-sezqcq"),w(o,"class","text svelte-sezqcq"),w(t,"class","goto-button goto-icon svelte-sezqcq"),w(l,"class","arrow-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),Q(t,e),Q(t,n),Q(t,o),Q(o,r),O(c,a,d),O(c,l,d)},p(c,d){d&8&&s!==(s=c[3].highlightText+"")&&Re(r,s)},d(c){c&&_(t),c&&_(a),c&&_(l)}}}function Uy(i){var D,x;let t,e,n,o,s,r,a,l,c,d,h=i[3].title+"",u,m,g,v,A;e=new _t({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let b=i[3].headerPictureUrl&&hh(i),y=((D=i[2].length)!=null?D:0)+((x=i[5].length)!=null?x:0)>0&&uh(i),C=(i[7]||i[3].highlightText)&&ph(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=se(),r=V("div"),b&&b.c(),a=se(),l=V("div"),c=V("div"),d=V("div"),u=Be(h),m=se(),y&&y.c(),g=se(),C&&C.c(),w(o,"class","line svelte-sezqcq"),z(o,"transition-delay",i[4]?os+"ms":ss+yh-bh-40+"ms"),w(d,"class","text svelte-sezqcq"),w(c,"class","title svelte-sezqcq"),w(l,"class","title-wrapper svelte-sezqcq"),w(r,"class","content svelte-sezqcq"),z(r,"max-width",Vt(i[9])),z(r,"transition-delay",i[4]?os+ss+"ms":"0ms"),w(t,"class",v=Oe(`marketing ${i[6]}`)+" svelte-sezqcq"),ee(t,"unfolded",i[4]),ee(t,"folded",i[8])},m(I,T){O(I,t,T),te(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),b&&b.m(r,null),Q(r,a),Q(r,l),Q(l,c),Q(c,d),Q(d,u),Q(r,m),y&&y.m(r,null),Q(r,g),C&&C.m(r,null),A=!0},p(I,[T]){var H,X;const S={};T&16&&(S.visible=I[4]),e.$set(S),T&16&&z(o,"transition-delay",I[4]?os+"ms":ss+yh-bh-40+"ms"),I[3].headerPictureUrl?b?b.p(I,T):(b=hh(I),b.c(),b.m(r,a)):b&&(b.d(1),b=null),(!A||T&8)&&h!==(h=I[3].title+"")&&Re(u,h),((H=I[2].length)!=null?H:0)+((X=I[5].length)!=null?X:0)>0?y?y.p(I,T):(y=uh(I),y.c(),y.m(r,g)):y&&(y.d(1),y=null),I[7]||I[3].highlightText?C?C.p(I,T):(C=ph(I),C.c(),C.m(r,null)):C&&(C.d(1),C=null),T&16&&z(r,"transition-delay",I[4]?os+ss+"ms":"0ms"),(!A||T&64&&v!==(v=Oe(`marketing ${I[6]}`)+" svelte-sezqcq"))&&w(t,"class",v),(!A||T&80)&&ee(t,"unfolded",I[4]),(!A||T&320)&&ee(t,"folded",I[8])},i(I){A||(k(e.$$.fragment,I),A=!0)},o(I){M(e.$$.fragment,I),A=!1},d(I){I&&_(t),ne(e),b&&b.d(),y&&y.d(),C&&C.d()}}}const Lr=40,os=400,bh=500,ss=180,yh=500;function qy(i,t,e){let n,o,s,r,a,l,c,d,{tag:h}=t,u,m=(()=>{var A;const v=(A=h.data.limitWidth)!=null?A:!0;if(typeof v=="number")return v;if(v===!0)return 172})();function g(){u=this.offsetHeight,e(1,u)}return i.$$set=v=>{"tag"in v&&e(0,h=v.tag)},i.$$.update=()=>{var v,A,b,y,C,D;i.$$.dirty&1&&e(4,n=(A=(v=h.state)==null?void 0:v.unfolded)!=null?A:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=Rn((b=s.price)==null?void 0:b.value)&&((y=s.price)==null?void 0:y.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&u>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((C=s.brandTags)==null?void 0:C.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,d=((D=s.tags)==null?void 0:D.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/Lr),[h,u,c,s,n,d,a,r,o,m,l,g]}class Jy extends de{constructor(t){super(),ce(this,t,qy,Uy,le,{tag:0},Yy)}}class Zy extends Audio{constructor(e){super();f(this,"sharedAudioSrc");f(this,"sharedAudioPaused",!0);f(this,"sharedAudioCurrentTime",0);f(this,"tryplaying",!1);f(this,"audioInstance");f(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return U(this,null,function*(){var n,o,s;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=pA(this.sharedAudioSrc,{namespace:vr.PlayAudio})),(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(s=this.currentTime)!=null?s:0;const e=this.audioInstance.currentTime!==this.currentTime;this.audioInstance.play().then(()=>{var r;this.audioInstance.muted=!1,e&&(this.audioInstance.currentTime=(r=this.currentTime)!=null?r:0),this.sharedAudioPaused=!1}).catch(r=>{var a;r.message==="The operation is not supported."?console.error("Error: 音频文件可能损坏或修改过文件后缀",r):console.error("Error: error playing media in Safari",r),this.endedHandler(),(a=this.onerror)==null||a.call(this,r)}).finally(()=>{this.tryplaying=!1})})}pause(e){var n;if(this.audioInstance&&!this.paused){if(this.sharedAudioPaused=!0,(n=this.eventListenerDisposer)==null||n.call(this),this.audioInstance.ended){this.endedHandler();return}this.audioInstance.paused||this.audioInstance.pause(),this.onpause(e!=null?e:new Event("pause")),this.clear()}}dispose(){var e;(e=this.eventListenerDisposer)==null||e.call(this),this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}endedHandler(e){var n,o;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(o=this.eventListenerDisposer)==null||o.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,u)},o=u=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,u))},s=u=>{this.pause(u)},r=u=>{this.endedHandler(u)},a=u=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,u)},l=u=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,u)},c=u=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,u)},d=u=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,u)},h=u=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",h)}}}function Ky(i){me(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function $y(i){let t,e,n,o;const s=i[8].default,r=Nn(s,i,i[7],null);return{c(){t=V("div"),r&&r.c(),w(t,"class","audio svelte-13e7hxv"),w(t,"style",i[0])},m(a,l){O(a,t,l),r&&r.m(t,null),e=!0,n||(o=ke(t,"click",tl(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&Fn(r,s,a,a[7],e?Wn(s,a[7],l,null):Hn(a[7]),null),(!e||l&1)&&w(t,"style",a[0])},i(a){e||(k(r,a),e=!0)},o(a){M(r,a),e=!1},d(a){a&&_(t),r&&r.d(a),n=!1,o()}}}function ew(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Io(),d=sn("hooks"),h=sn("mediaStore");let u,m=!0;function g(){e(5,u.onplay=A=>{d.emit("playStateChange",W({event:A,state:"playing",mediaInstance:u},l)),c("play"),e(6,m=!1)},u),e(5,u.onpause=A=>{d.emit("playStateChange",W({event:A,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onended=A=>{d.emit("playStateChange",W({event:A,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onloadedmetadata=A=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.onerror=A=>{c("pause"),e(6,m=!0)},u),e(5,u.ontimeupdate=A=>{c("timeupdate",u.currentTime)},u)}h.subscribe(({currentMediaElement:A})=>{A!==u&&(m||u==null||u.pause())});function v(A){u&&(d.emit("click",W({event:A,target:"AudioTagPlayIcon",audioInstance:u},l)),h.set({currentMediaElement:u}),d.emit("playStateChange",W({event:A,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=A=>{"url"in A&&e(2,s=A.url),"enable"in A&&e(3,r=A.enable),"style"in A&&e(0,a=A.style),"hooksInfo"in A&&e(4,l=A.hooksInfo),"$$scope"in A&&e(7,o=A.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new Zy(s)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),g()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,v,s,r,l,u,m,o,n]}let wh=class extends de{constructor(t){super(),ce(this,t,ew,$y,le,{url:2,enable:3,style:0,hooksInfo:4},Ky)}};function tw(i){me(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Ph(i){let t,e;return t=new _t({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function nw(i){let t,e,n,o,s,r=i[1]&&Ph();return{c(){t=V("div"),r&&r.c(),e=se(),n=V("div"),o=V("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',w(o,"class","sound-wave__container svelte-srt2pi"),w(n,"class","audio-icon svelte-srt2pi"),ee(n,"playing",i[0]),w(t,"class","audio-icon__wrapper svelte-srt2pi"),w(t,"style",i[2]),z(t,"width",i[5]),z(t,"height",i[5])},m(a,l){O(a,t,l),r&&r.m(t,null),Q(t,e),Q(t,n),Q(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&k(r,1):(r=Ph(),r.c(),k(r,1),r.m(t,e)):r&&(he(),M(r,1,1,()=>{r=null}),ue()),(!s||l&1)&&ee(n,"playing",a[0]),(!s||l&4)&&w(t,"style",a[2]);const c=l&4;(c||l&36)&&z(t,"width",a[5]),(c||l&36)&&z(t,"height",a[5])},i(a){s||(k(r),s=!0)},o(a){M(r),s=!1},d(a){a&&_(t),r&&r.d(),i[7](null),i[8](null)}}}function iw(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){qe[u?"unshift":"push"](()=>{c=u,e(4,c)})}function h(u){qe[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,o=u.playing),"shadow"in u&&e(1,s=u.shadow),"style"in u&&e(2,r=u.style),"width"in u&&e(6,a=u.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?Vt(a):a)},[o,s,r,l,c,n,a,d,h]}class Ch extends de{constructor(t){super(),ce(this,t,iw,nw,le,{playing:0,shadow:1,style:2,width:6},tw)}}function ow(i){me(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Ih(i){var A,b;let t,e,n,o,s,r,a,l,c,d,h,u,m,g;e=new _t({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let v=i[6]&&Eh(i);return c=new gd({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new Ar({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((b=(A=i[5])==null?void 0:A.length)!=null?b:10,15),useLinearColor:!0}}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=V("div"),r=V("div"),v&&v.c(),a=se(),l=V("div"),ie(c.$$.fragment),d=se(),ie(h.$$.fragment),w(r,"class","audio-icon svelte-1s6gk4a"),z(l,"display","inline-block"),w(s,"class","wrapper svelte-1s6gk4a"),w(o,"class","content svelte-1s6gk4a"),w(t,"class","audio-tag svelte-1s6gk4a"),ee(t,"unfolded",i[6])},m(y,C){O(y,t,C),te(e,t,null),Q(t,n),Q(t,o),Q(o,s),Q(s,r),v&&v.m(r,null),Q(s,a),Q(s,l),te(c,l,null),Q(t,d),te(h,t,null),u=!0,m||(g=[ke(l,"click",i[7]),Wt($n.call(null,l)),ke(l,"clientWidth",i[12])],m=!0)},p(y,C){var T,S;const D={};C&64&&(D.visible=y[6]),C&8&&(D.left=y[3]/2+"px"),e.$set(D),y[6]?v?(v.p(y,C),C&64&&k(v,1)):(v=Eh(y),v.c(),k(v,1),v.m(r,null)):v&&(he(),M(v,1,1,()=>{v=null}),ue());const x={};C&64&&(x.visible=y[6]),C&2&&(x.textUnfolded=y[1]),C&32&&(x.content=y[5]),c.$set(x);const I={};C&64&&(I.unfolded=y[6]),C&8&&(I.length=y[3]),C&48&&(I.outDelay=y[4]+20*Math.min((S=(T=y[5])==null?void 0:T.length)!=null?S:10,15)),h.$set(I),(!u||C&64)&&ee(t,"unfolded",y[6])},i(y){u||(k(e.$$.fragment,y),k(v),k(c.$$.fragment,y),k(h.$$.fragment,y),u=!0)},o(y){M(e.$$.fragment,y),M(v),M(c.$$.fragment,y),M(h.$$.fragment,y),u=!1},d(y){y&&_(t),ne(e),v&&v.d(),ne(c),ne(h),m=!1,$e(g)}}}function Eh(i){let t,e,n,o,s,r,a;return e=new _t({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new wh({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[sw]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("error",i[10]),o.$on("audioRef",i[11]),{c(){t=V("div"),ie(e.$$.fragment),n=se(),ie(o.$$.fragment),w(t,"class","audio svelte-1s6gk4a")},m(l,c){O(l,t,c),te(e,t,null),Q(t,n),te(o,t,null),a=!0},p(l,c){i=l;const d={};c&64&&(d.enable=i[6]),c&1&&(d.url=i[0].data.audioUrl),c&1&&(d.hooksInfo={tag:i[0]}),c&8196&&(d.$$scope={dirty:c,ctx:i}),o.$set(d)},i(l){a||(k(e.$$.fragment,l),k(o.$$.fragment,l),l&&et(()=>{a&&(r&&r.end(1),s=vn(t,An,{duration:1e3,delay:0,easing:ti}),s.start())}),a=!0)},o(l){var c,d;M(e.$$.fragment,l),M(o.$$.fragment,l),s&&s.invalidate(),l&&(r=Zn(t,An,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:ti})),a=!1},d(l){l&&_(t),ne(e),ne(o),l&&r&&r.end()}}}function sw(i){let t,e,n;return e=new Ch({props:{playing:i[2]}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function rw(i){let t,e,n=i[0].state&&Ih(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Ih(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function aw(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const h=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(A){Yn.call(this,i,A)}const v=A=>{e(3,c=A.detail)};return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,b,y;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(y=(b=r.data.title)!=null?b:r.data.text)!=null?y:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,d,h,u,m,g,v]}class lw extends de{constructor(t){super(),ce(this,t,aw,rw,le,{tag:0},ow)}}function cw(i){me(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function kh(i){let t,e,n,o;return n=new wh({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[hw]},$$scope:{ctx:i}}}),n.$on("play",i[6]),n.$on("pause",i[7]),n.$on("error",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=V("div"),e=V("div"),ie(n.$$.fragment),w(e,"class","audio-tag svelte-58hfjf"),z(e,"background-color",i[4].bgColor),z(e,"color",i[4].fontColor),w(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){O(s,t,r),Q(t,e),te(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8232&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&16&&z(e,"background-color",s[4].bgColor),r&16&&z(e,"color",s[4].fontColor)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){M(n.$$.fragment,s),o=!1},d(s){s&&_(t),ne(n)}}}function dw(i){let t;return{c(){t=Be(i[5])},m(e,n){O(e,t,n)},p(e,n){n&32&&Re(t,e[5])},d(e){e&&_(t)}}}function hw(i){let t,e,n,o,s,r,a;return n=new Ch({props:{playing:i[3]}}),r=new yr({props:{maxWidth:72,$$slots:{default:[dw]},$$scope:{ctx:i}}}),{c(){t=V("div"),e=V("div"),ie(n.$$.fragment),o=se(),s=V("div"),ie(r.$$.fragment),w(e,"class","audio-icon__wrapper svelte-58hfjf"),w(s,"class","text svelte-58hfjf"),w(t,"class","audio__inner svelte-58hfjf")},m(l,c){O(l,t,c),Q(t,e),te(n,e,null),Q(t,o),Q(t,s),te(r,s,null),a=!0},p(l,c){const d={};c&8&&(d.playing=l[3]),n.$set(d);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(k(n.$$.fragment,l),k(r.$$.fragment,l),a=!0)},o(l){M(n.$$.fragment,l),M(r.$$.fragment,l),a=!1},d(l){l&&_(t),ne(n),ne(r)}}}function uw(i){let t,e,n=i[0].state&&kh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=kh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function fw(i,t,e){let n,o,{tag:s}=t;const r={light:{bgColor:"rgba(255, 255, 255, 0.3)",fontColor:"rgba(0, 0, 0, 0.6)"},dark:{bgColor:"rgba(0, 0, 0, 0.3)",fontColor:"white"}};let a=0,l=0,c=!1;const d=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},u=()=>{e(3,c=!1)},m=A=>{e(1,a=A.detail)},g=A=>{e(2,l=A.detail)};function v(A){Yn.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,s=A.tag)},i.$$.update=()=>{var A,b,y;i.$$.dirty&1&&e(5,n=(b=(A=s.data.title)!=null?A:s.data.text)!=null?b:""),i.$$.dirty&1&&e(4,o=(y=r[s.data.theme||"light"])!=null?y:r.light)},[s,a,l,c,o,n,d,h,u,m,g,v]}class mw extends de{constructor(t){super(),ce(this,t,fw,uw,le,{tag:0},cw)}}function pw(i){let t,e;return t=new mw({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function gw(i){let t,e;return t=new lw({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function vw(i){let t,e,n,o;const s=[gw,pw],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=Ee()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(he(),M(r[d],1,1,()=>{r[d]=null}),ue()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(k(e),o=!0)},o(l){M(e),o=!1},d(l){~t&&r[t].d(l),l&&_(n)}}}function Aw(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class bw extends de{constructor(t){super(),ce(this,t,Aw,vw,le,{tag:0})}}function yw(i){me(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function xh(i){var o;let t,e,n;return e=new sh({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","media-wrapper svelte-10cw0el")},m(s,r){O(s,t,r),te(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){M(e.$$.fragment,s),n=!1},d(s){s&&_(t),ne(e)}}}function ww(i){let t,e,n=i[0].state&&i[5]&&xh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&k(n,1)):(n=xh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Pw(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class Cw extends de{constructor(t){super(),ce(this,t,Pw,ww,le,{tag:0},yw)}}function Dh(i){return U(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function Iw(i){return U(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Dh(t);return Ie(W({},i),{width:n/e,height:o/e})})}function Ew(i){return U(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Dh(e),a=s/n,l=r/n,c=a/t,d=l,h=1/o*t+"s";return Ie(W({},i),{width:c,height:d,duration:h})})}function kw(i){me(i,"svelte-316sq3","@keyframes svelte-316sq3-sprites-animation{0%{background-position:0 0}100%{background-position:100% 0}}.icon-image.svelte-316sq3{display:block;width:auto}.icon-keyframe.svelte-316sq3{background-repeat:no-repeat;background-size:auto 100%;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-316sq3-sprites-animation;animation-delay:0}")}function Sh(i){i[1]=i[19].width}function Lh(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function Mh(i){let t,e,n,o=i[0]&&Th();function s(l,c){return l[8]?Dw:xw}let r=s(i),a=r(i);return{c(){t=V("div"),o&&o.c(),e=se(),a.c(),w(t,"class","icon"),z(t,"width",i[1])},m(l,c){O(l,t,c),o&&o.m(t,null),Q(t,e),a.m(t,null),n=!0},p(l,c){l[0]?o?c&1&&k(o,1):(o=Th(),o.c(),k(o,1),o.m(t,e)):o&&(he(),M(o,1,1,()=>{o=null}),ue()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&z(t,"width",l[1])},i(l){n||(k(o),n=!0)},o(l){M(o),n=!1},d(l){l&&_(t),o&&o.d(),a.d()}}}function Th(i){let t,e;return t=new _t({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function xw(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Mw,then:Lw,catch:Sw,value:19};return xo(e=i[11](Ge({url:i[7],ratio:i[5]})),n),{c(){t=Ee(),n.block.c()},m(o,s){O(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Ge({url:i[7],ratio:i[5]})))&&xo(e,n)||ul(n,i,s)},d(o){o&&_(t),n.block.d(o),n.token=null,n=null}}}function Dw(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:jw,then:zw,catch:Tw,value:19};return xo(e=i[10](Ge({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=Ee(),n.block.c()},m(o,s){O(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Ge({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&xo(e,n)||ul(n,i,s)},d(o){o&&_(t),n.block.d(o),n.token=null,n=null}}}function Sw(i){return{c:J,m:J,p:J,d:J}}function Lw(i){Sh(i);let t,e;return{c(){t=V("img"),w(t,"alt","tag-icon"),w(t,"class","icon-image svelte-316sq3"),yt(t.src,e=i[7])||w(t,"src",e),z(t,"width",Vt(hi({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){O(n,t,o)},p(n,o){Sh(n),o&128&&!yt(t.src,e=n[7])&&w(t,"src",e),o&184&&z(t,"width",Vt(hi({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&_(t)}}}function Mw(i){return{c:J,m:J,p:J,d:J}}function Tw(i){return{c:J,m:J,p:J,d:J}}function zw(i){Lh(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=V("div"),w(t,"class","icon-keyframe svelte-316sq3"),z(t,"width",Vt(hi({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),z(t,"height",Vt(hi({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),z(t,"background-image",e),z(t,"animation-duration",i[18]),z(t,"animation-timing-function",n)},m(o,s){O(o,t,s)},p(o,s){Lh(o),s&252&&z(t,"width",Vt(hi({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&z(t,"height",Vt(hi({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&z(t,"background-image",e),s&228&&z(t,"animation-duration",o[18]),s&228&&n!==(n=`steps(${o[17]}, jump-none)`)&&z(t,"animation-timing-function",n)},d(o){o&&_(t)}}}function jw(i){return{c:J,m:J,p:J,d:J}}function _w(i){let t,e,n=i[9]&&Mh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&k(n,1)):(n=Mh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function hi(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:o}=i,s=(o!=null?o:t)*n,r=typeof e=="number"?s*(e/t):void 0;return Ie(W({},i),{width:s,height:r})}function Vw(i,t,e){let n,o,s,r,a,l,c,d,h,{width:u=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const v=Io();function A(C){return U(this,null,function*(){const D=yield Ew(C);return v("iconLoaded",D),D})}function b(C){return U(this,null,function*(){if(typeof h=="number")return Ie(W({},C),{width:h});const D=yield Iw(C);return v("iconLoaded",D),D})}function y(){d||v("iconLoaded")}return kt(()=>{y()}),i.$$set=C=>{"width"in C&&e(1,u=C.width),"icon"in C&&e(12,m=C.icon),"shadow"in C&&e(0,g=C.shadow)},i.$$.update=()=>{var C,D;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,o=(C=m==null?void 0:m.steps)!=null?C:1),i.$$.dirty&4096&&e(6,s=m==null?void 0:m.fps),i.$$.dirty&4096&&e(5,r=m==null?void 0:m.ratio),i.$$.dirty&4096&&e(4,a=(D=m==null?void 0:m.scale)!=null?D:1),i.$$.dirty&4096&&e(3,l=m==null?void 0:m.width),i.$$.dirty&252&&e(9,c=Ge({url:n,steps:o,fps:s,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,d=o>1),i.$$.dirty&2&&(h=u)},y(),[g,u,o,l,a,r,s,n,d,c,A,b,m]}class zh extends de{constructor(t){super(),ce(this,t,Vw,_w,le,{width:1,icon:12,shadow:0},kw)}}function Ow(i){me(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function jh(i){let t,e,n,o,s,r;return e=new _t({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=Be(i[1]),w(o,"class","text svelte-e58ijk"),w(t,"class","text-wrapper svelte-e58ijk")},m(a,l){O(a,t,l),te(e,t,null),Q(t,n),Q(t,o),Q(o,s),r=!0},p(a,l){(!r||l&2)&&Re(s,a[1])},i(a){r||(k(e.$$.fragment,a),r=!0)},o(a){M(e.$$.fragment,a),r=!1},d(a){a&&_(t),ne(e)}}}function Bw(i){let t,e,n,o;e=new zh({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&jh(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),s&&s.c(),w(t,"class","wrapper svelte-e58ijk")},m(r,a){O(r,t,a),te(e,t,null),Q(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&k(s,1)):(s=jh(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),M(s,1,1,()=>{s=null}),ue())},i(r){o||(k(e.$$.fragment,r),k(s),o=!0)},o(r){M(e.$$.fragment,r),M(s),o=!1},d(r){r&&_(t),ne(e),s&&s.d()}}}function Qw(i,t,e){let n,o,s,{tag:r}=t;const a=()=>{e(2,n=!0)};return i.$$set=l=>{"tag"in l&&e(3,r=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&8&&e(1,o=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,s=(d=r.data.icon)!=null?d:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[s,o,n,r,a]}class Rw extends de{constructor(t){super(),ce(this,t,Qw,Bw,le,{tag:3},Ow)}}function Gw(i){me(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function _h(i){let t,e=i[0].element+"",n;return{c(){t=new wo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),O(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&_(n),o&&t.d()}}}function Nw(i){let t,e=typeof i[0].element=="string"&&_h(i);return{c(){t=V("div"),e&&e.c(),w(t,"class","customElement__container svelte-kzl2aj")},m(n,o){O(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=_h(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:J,o:J,d(n){n&&_(t),e&&e.d(),i[2](null)}}}function Ww(i,t,e){let{tag:n}=t,o,s;kt(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),on(()=>{s==null||s()});function r(a){qe[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class Fw extends de{constructor(t){super(),ce(this,t,Ww,Nw,le,{tag:0},Gw)}}function Hw(i){me(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function Xw(i){let t,e;return{c(){t=V("div"),w(t,"data-info","tag content is keep folded"),w(t,"data-id",e=i[1].id)},m(n,o){O(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&w(t,"data-id",e)},i:J,o:J,d(n){n&&_(t)}}}function Yw(i){let t,e,n,o,s,r,a,l,c,d;const h=[eP,$w,Kw,Zw,Jw,qw],u=[];function m(g,v){return g[1].contentType==="Text"?0:g[1].contentType==="ImageText"||g[1].contentType==="Image"||g[1].contentType==="Video"?1:g[1].contentType==="Audio"?2:g[1].contentType==="Marketing"?3:g[1].contentType==="Link"||g[1].contentType==="VRLink"||g[1].contentType==="PanoLink"||g[1].contentType==="Sticker"?4:g[1].contentType==="MediaPlane"||g[1].contentType==="MediaModel"?5:-1}return~(o=m(i))&&(s=u[o]=h[o](i)),{c(){var g;t=V("div"),e=V("div"),n=V("div"),s&&s.c(),w(n,"class","content svelte-1r4fqvg"),ee(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),w(e,"class","content__wrapper svelte-1r4fqvg"),w(t,"class",r=Oe(nt("content__container",i[1].className))+" svelte-1r4fqvg"),w(t,"data-id",a=i[1].id),ee(t,"disable",i[1].enabled===!1),ee(t,"hide",i[4]),ee(t,"withAnimation",i[0]),ee(t,"unClickable",i[1].mergedConfig.clickable===!1),z(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),z(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,v){O(g,t,v),Q(t,e),Q(e,n),~o&&u[o].m(n,null),l=!0,c||(d=ke(t,"click",tl(i[14])),c=!0)},p(g,v){var b;let A=o;o=m(g),o===A?~o&&u[o].p(g,v):(s&&(he(),M(u[A],1,1,()=>{u[A]=null}),ue()),~o?(s=u[o],s?s.p(g,v):(s=u[o]=h[o](g),s.c()),k(s,1),s.m(n,null)):s=null),(!l||v&2)&&ee(n,"unfolded",(b=g[1].state)==null?void 0:b.unfolded),(!l||v&2&&r!==(r=Oe(nt("content__container",g[1].className))+" svelte-1r4fqvg"))&&w(t,"class",r),(!l||v&2&&a!==(a=g[1].id))&&w(t,"data-id",a),(!l||v&2)&&ee(t,"disable",g[1].enabled===!1),(!l||v&18)&&ee(t,"hide",g[4]),(!l||v&3)&&ee(t,"withAnimation",g[0]),(!l||v&2)&&ee(t,"unClickable",g[1].mergedConfig.clickable===!1),v&2&&z(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),v&2&&z(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(k(s),l=!0)},o(g){M(s),l=!1},d(g){g&&_(t),~o&&u[o].d(),c=!1,d()}}}function Uw(i){let t,e,n,o,s,r,a;return e=new Fw({props:{tag:Ge(i[1])}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class",n=Oe(nt("content__container",i[1].className))+" svelte-1r4fqvg"),w(t,"data-id",o=i[1].id),ee(t,"custom-tag-disable",i[1].enabled===!1),ee(t,"custom-tag-hide",i[4])},m(l,c){O(l,t,c),te(e,t,null),s=!0,r||(a=ke(t,"click",i[13]),r=!0)},p(l,c){const d={};c&2&&(d.tag=Ge(l[1])),e.$set(d),(!s||c&2&&n!==(n=Oe(nt("content__container",l[1].className))+" svelte-1r4fqvg"))&&w(t,"class",n),(!s||c&2&&o!==(o=l[1].id))&&w(t,"data-id",o),(!s||c&2)&&ee(t,"custom-tag-disable",l[1].enabled===!1),(!s||c&18)&&ee(t,"custom-tag-hide",l[4])},i(l){s||(k(e.$$.fragment,l),s=!0)},o(l){M(e.$$.fragment,l),s=!1},d(l){l&&_(t),ne(e),r=!1,a()}}}function qw(i){let t,e;return t=new Cw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Jw(i){let t,e;return t=new Rw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Zw(i){let t,e;return t=new Jy({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Kw(i){let t,e;return t=new bw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function $w(i){let t,e;return t=new Xy({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function eP(i){let t,e;return t=new hb({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function tP(i){let t,e,n,o;const s=[Uw,Yw,Xw],r=[];function a(l,c){return l[1].element?0:l[3]?1:2}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=Ee()},m(l,c){r[t].m(l,c),O(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?r[t].p(l,c):(he(),M(r[d],1,1,()=>{r[d]=null}),ue(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n))},i(l){o||(k(e),o=!0)},o(l){M(e),o=!1},d(l){r[t].d(l),l&&_(n)}}}function nP(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:d}=t,{hooks:h}=t,{state:u}=t,{mediaStore:m}=t,{temporaryState:g}=t;Rs("hooks",h),Rs("mediaStore",m);let v,A;function b(x){x?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(x,I,T){var S,H;return!(!I.visible||!I.enabled||!T.visible||!((S=x.state)!=null&&S.visible)||((H=x.temporaryState)==null?void 0:H.visible)===!1||ot(x)&&!x.mediaVisible)}const C=x=>h.emit("click",{event:x,target:"TagContent",tag:d}),D=x=>h.emit("click",{event:x,target:"TagContent",tag:d});return i.$$set=x=>{"withAnimation"in x&&e(0,c=x.withAnimation),"tag"in x&&e(1,d=x.tag),"hooks"in x&&e(2,h=x.hooks),"state"in x&&e(5,u=x.state),"mediaStore"in x&&e(6,m=x.mediaStore),"temporaryState"in x&&e(7,g=x.temporaryState)},i.$$.update=()=>{var x,I,T,S,H,X,N,G,j,R,Z;i.$$.dirty&2&&e(11,n=(x=d.state)==null?void 0:x.unfolded),i.$$.dirty&2&&e(10,o=(I=d.state)==null?void 0:I.visible),i.$$.dirty&162&&e(12,s=u.visible&&g.visible&&((T=d.state)==null?void 0:T.visible)),i.$$.dirty&2&&(r=d.id),i.$$.dirty&162&&e(4,a=!y(d,u,g)),i.$$.dirty&4096&&b(s),i.$$.dirty&3842&&d.hooks&&(n!==void 0&&n!==A&&(e(9,A=n),n?(H=(S=d.hooks).emit)==null||H.call(S,"unfolded"):(N=d==null?void 0:(X=d.hooks).emit)==null||N.call(X,"folded")),o!==void 0&&o!==v&&(e(8,v=o),o?(j=(G=d.hooks).emit)==null||j.call(G,"show"):(Z=(R=d.hooks).emit)==null||Z.call(R,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof d.mergedConfig.unfoldedConfig=="object"&&d.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,d,h,l,a,u,m,g,v,A,o,n,s,C,D]}let Vh=class extends de{constructor(t){super(),ce(this,t,nP,tP,le,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},Hw)}};function iP(i){me(i,"svelte-1jkrwn7",'@charset "UTF-8";.tag-point-click-helper.svelte-1jkrwn7.svelte-1jkrwn7{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-1jkrwn7.svelte-1jkrwn7{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-1jkrwn7.svelte-1jkrwn7,.tag-unfolded-point.svelte-1jkrwn7.svelte-1jkrwn7{transition:all 0.5s}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:1;scale:1}')}function oP(i){let t,e,n,o,s,r,a,l,c,d,h,u;return o=new _t({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new zh({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=V("div"),e=V("div"),n=se(),ie(o.$$.fragment),s=se(),r=V("div"),a=se(),l=V("div"),ie(c.$$.fragment),w(e,"class","tag-point-click-helper svelte-1jkrwn7"),w(r,"class","tag-unfolded-point svelte-1jkrwn7"),z(r,"transition-delay",(i[3]?i[5]:0)+"ms"),w(l,"class","tag-folded-point svelte-1jkrwn7"),z(l,"transition-delay",(i[3]?i[5]:0)+"ms"),w(t,"class","tag-point-wrapper svelte-1jkrwn7"),ee(t,"unfolded",i[0]),ee(t,"folded",i[3])},m(m,g){O(m,t,g),Q(t,e),Q(t,n),te(o,t,null),Q(t,s),Q(t,r),Q(t,a),Q(t,l),te(c,l,null),d=!0,h||(u=ke(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&z(r,"transition-delay",(m[3]?m[5]:0)+"ms");const v={};g&4&&(v.icon=m[2]),g&2&&(v.width=m[1]),c.$set(v),g&8&&z(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!d||g&1)&&ee(t,"unfolded",m[0]),(!d||g&8)&&ee(t,"folded",m[3])},i(m){d||(k(o.$$.fragment,m),k(c.$$.fragment,m),d=!0)},o(m){M(o.$$.fragment,m),M(c.$$.fragment,m),d=!1},d(m){m&&_(t),ne(o),ne(c),h=!1,u()}}}function sP(i,t,e){let n,o,s,r;const a=sn("hooks");let{tag:l}=t,c,d=!1;const h=()=>{l.style.point.enabled!==!1&&(c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800))},u=v=>{l.style.point.enabled!==!1&&(d||a.emit("click",{event:v,target:"TagPoint",tag:l}))},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(v){Yn.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(6,l=v.tag)},i.$$.update=()=>{var v,A,b,y;i.$$.dirty&64&&e(0,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(b=(A=l.style)==null?void 0:A.point)!=null&&b.url?(y=l.style)==null?void 0:y.point:{url:BA}),i.$$.dirty&64&&e(1,r=(()=>{var x,I,T,S;const C=(I=(x=l.style)==null?void 0:x.point)==null?void 0:I.width;if(typeof C=="number")return C;const D=(S=(T=l.style)==null?void 0:T.point)==null?void 0:S.size;if(typeof D=="number")return D;if(D==="S")return 18;if(D==="M")return 20;if(D==="L")return 24;if(D==="XL")return 28})())},h(),[n,r,s,o,u,m,l,g]}class rP extends de{constructor(t){super(),ce(this,t,sP,oP,le,{tag:6},iP)}}function aP(i){me(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function lP(i){let t;return{c(){t=V("div"),w(t,"data-info","tag content is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&_(t)}}}function cP(i){let t,e;return t=new Vh({props:{mediaStore:i[2],withAnimation:i[0],tag:Ge(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Ge(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function dP(i){let t;return{c(){t=V("div"),w(t,"data-info","tag point is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&_(t)}}}function hP(i){let t,e;return t=new rP({props:{tag:i[1]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function uP(i){let t,e,n,o,s,r,a,l,c,d;const h=[cP,lP],u=[];function m(b,y){return b[12]?0:1}n=m(i),o=u[n]=h[n](i);const g=[hP,dP],v=[];function A(b,y){return b[13]?0:1}return r=A(i),a=v[r]=g[r](i),{c(){t=V("div"),e=V("div"),o.c(),s=se(),a.c(),w(e,"class",l=Oe(nt("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),w(e,"data-tag-unfolded",i[8]),w(e,"data-tag-id",i[11]),w(e,"data-content-type",c=i[1].contentType),z(e,"left",i[7]),z(e,"top",i[6]),z(e,"z-index",i[5]),w(t,"class","tag svelte-pzwdws"),w(t,"data-tag-id",i[11]),ee(t,"unClickable",i[1].mergedConfig.clickable===!1),ee(t,"disable",i[10]),ee(t,"hide",i[9]),ee(t,"withAnimation",i[0])},m(b,y){O(b,t,y),Q(t,e),u[n].m(e,null),Q(e,s),v[r].m(e,null),d=!0},p(b,[y]){let C=n;n=m(b),n===C?u[n].p(b,y):(he(),M(u[C],1,1,()=>{u[C]=null}),ue(),o=u[n],o?o.p(b,y):(o=u[n]=h[n](b),o.c()),k(o,1),o.m(e,s));let D=r;r=A(b),r===D?v[r].p(b,y):(he(),M(v[D],1,1,()=>{v[D]=null}),ue(),a=v[r],a?a.p(b,y):(a=v[r]=g[r](b),a.c()),k(a,1),a.m(e,null)),(!d||y&2&&l!==(l=Oe(nt("wrapper",b[1].className?`${b[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&w(e,"class",l),(!d||y&256)&&w(e,"data-tag-unfolded",b[8]),(!d||y&2048)&&w(e,"data-tag-id",b[11]),(!d||y&2&&c!==(c=b[1].contentType))&&w(e,"data-content-type",c),y&128&&z(e,"left",b[7]),y&64&&z(e,"top",b[6]),y&32&&z(e,"z-index",b[5]),(!d||y&2048)&&w(t,"data-tag-id",b[11]),(!d||y&2)&&ee(t,"unClickable",b[1].mergedConfig.clickable===!1),(!d||y&1024)&&ee(t,"disable",b[10]),(!d||y&512)&&ee(t,"hide",b[9]),(!d||y&1)&&ee(t,"withAnimation",b[0])},i(b){d||(k(o),k(a),d=!0)},o(b){M(o),M(a),d=!1},d(b){b&&_(t),u[n].d(),v[r].d()}}}function fP(i,t,e){let n,o,s,r,a,l,c,d,h,{withAnimation:u=!1}=t,{tag:m}=t,{mediaStore:g}=t,{state:v}=t,{temporaryState:A}=t;const b=sn("hooks");return i.$$set=y=>{"withAnimation"in y&&e(0,u=y.withAnimation),"tag"in y&&e(1,m=y.tag),"mediaStore"in y&&e(2,g=y.mediaStore),"state"in y&&e(3,v=y.state),"temporaryState"in y&&e(4,A=y.temporaryState)},i.$$.update=()=>{var y,C,D,x,I,T,S,H;i.$$.dirty&2&&e(13,n=(()=>{var X,N;return!(((N=(X=m.style)==null?void 0:X.point)==null?void 0:N.enabled)===!1||m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane")})()),i.$$.dirty&2&&e(12,o=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=m.id),i.$$.dirty&2&&e(10,r=!((y=m.pointTagStyle)!=null&&y.leftPercent)||!((C=m.pointTagStyle)!=null&&C.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(9,a=!((D=m.state)!=null&&D.visible)||((x=m.temporaryState)==null?void 0:x.visible)===!1),i.$$.dirty&2&&e(8,l=(I=m.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(7,c=((T=m.pointTagStyle)==null?void 0:T.leftPercent)+"%"),i.$$.dirty&2&&e(6,d=((S=m.pointTagStyle)==null?void 0:S.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(H=m.state)!=null&&H.unfolded?1:0)},[u,m,g,v,A,h,d,c,l,a,r,s,o,n,b]}class mP extends de{constructor(t){super(),ce(this,t,fP,uP,le,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},aP)}}function pP(i){me(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function Oh(i,t,e){const n=i.slice();return n[6]=t[e],n}function Bh(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Oh(i,s,a),c=r(l);n.set(c,e[a]=Qh(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","tag--container svelte-uq11d5"),ee(t,"hide",!i[3].visible||!i[4].visible),ee(t,"withAnimation",i[0])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],he(),e=xt(e,l,r,1,a,s,n,t,an,Qh,null,Oh),ue()),(!o||l&24)&&ee(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&ee(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Qh(i,t){let e,n,o;return n=new mP({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(s,r){O(s,e,r),te(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){M(n.$$.fragment,s),o=!1},d(s){s&&_(e),ne(n,s)}}}function gP(i){let t,e,n=i[3].enabled&&Bh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&k(n,1)):(n=Bh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function vP(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Rs("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class AP extends de{constructor(t){super(),ce(this,t,vP,gP,le,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},pP)}}const bP=new Gt.GLTFLoader;function yP(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}bP.load(i,n,void 0,o)})}class Rh extends E.Mesh{constructor(e,n){super();f(this,"name","PanoTagPluginImagePlane");f(this,"imageSrc");this.imageSrc=e,Ro(e).then(o=>{const s=o.image.width,r=o.image.height,a=new E.MeshBasicMaterial({map:o,transparent:!0}),l=new E.PlaneGeometry(s,r);this.geometry=l,this.material=a;const c=n[0].distanceTo(n[1]),d=n[1].distanceTo(n[2]);this.scale.set(c/s,d/r,1);const h=s/r,u=c/d;h>u?this.scale.set(c/s,c/s,1):h<u?this.scale.set(d/r,d/r,1):this.scale.set(c/s,d/r,1)}).catch(o=>{console.error({e:o})})}setMatrixByCornerPoints(e){const n=new B.Vector3().subVectors(e[1],e[0]),o=new B.Vector3().subVectors(e[3],e[0]),s=xi(...e),r=new B.Vector3().crossVectors(n,o).normalize();this.lookAt(r);const a=this.up.clone().applyQuaternion(this.quaternion),l=o.clone(),c=new B.Vector3().crossVectors(a,l).normalize();this.rotateOnWorldAxis(c,a.angleTo(l)),this.position.copy(s)}}class wP extends PA{constructor(e){super(e);f(this,"group",new B.Group);f(this,"imagePlaneGroup",new B.Group);f(this,"gltfObjectGroup",new B.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>U(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=yP(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=this.getCurrentVisibleState(e),new B.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),s.visible=this.getVisibleByFloorIndex(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.imagePlane){const c=e.data.mediaPosition.map(It);e.imagePlane=new Rh(e.data.mediaData[0].url,e.data.mediaPosition.map(It));const d=new B.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.imagePlane.position.copy(d),s.add(e.imagePlane)}}else this.updateTagCss3DObjectMatrix(e,s);return this.gltfObjectGroup.add(s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}clearTags(){this.tags.forEach(e=>{var n,o;(o=(n=e.imagePlane)==null?void 0:n.parent)==null||o.remove(e.imagePlane)}),this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRender3DDomTag(),this.updateRenderModelTag(),this.updateRenderImagePlane()}updateRenderImagePlane(){this.sort(this.filterImagePlane).forEach(n=>{var r,a,l,c;const o=(r=n.data.mediaData[0])==null?void 0:r.url;if(!o||(n.imagePlane&&(n.imagePlane.visible=(l=(a=n.state)==null?void 0:a.visible)!=null?l:!0),((c=n.imagePlane)==null?void 0:c.imageSrc)===o))return;const s=n.position.map(It);n.imagePlane=new Rh(o,s),n.imagePlane.setMatrixByCornerPoints(s),this.imagePlaneGroup.add(n.imagePlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const d=new B.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(d)}return}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=_s(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const r=this.getPositions(n);if(!r)return;const a=this.getTagNormal(n);if(!a)return;const c=(s=this.getTagConfig(n).tag3DConfig)!=null?s:{};if(this.getRenderType(n)==="BehindDom"){c.mode="behind",c.container=document.createElement("div");const h="black";c.container.style.backgroundColor=h,c.container.style.border=`3px solid ${h}`,this.css3DRenderPlugin.hooks.on("render",()=>{var u;if(d.css3DObject.opacityMesh){const m=this.addObjectClickHandler(n,d.css3DObject.opacityMesh,g=>{this.hooks.emit("click",{event:g,target:"TagContent",tag:n})});(u=this.store.css3DRenderDisposer.get(n.id))==null||u.push(m)}})}const d=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!d)return;this.store.css3DRenderDisposer.set(n.id,[d.dispose]),n.tag3DContentSvelte={svelteApp:new Vh({target:d.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:d,initialNormal:a,currentNormal:a}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(ot).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=this.getCurrentVisibleState(o)})})}updateTagModelVisible(){this.tags.forEach(e=>{var n;e.imagePlane&&(e.imagePlane.visible=this.getCurrentVisibleState(e)),(n=e.model)!=null&&n.object&&(e.model.object.visible=this.getCurrentVisibleState(e))})}updateTagCss3DObjectMatrix(e,n){var v,A,b,y;const o=(b=(A=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:A.ratio)!=null?b:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=ot(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new B.Vector3().fromArray(r[0]),c=new B.Vector3().fromArray(r[2]),d=xi(l,c).add(new B.Vector3(0,0,5e-4)),h=new B.Matrix4().setPosition(d),u=new B.Matrix4().makeScale(o,o,o),m=new B.Matrix4().multiply(a).multiply(h).multiply(u);m.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return U(this,null,function*(){const n=e.filter(ot).map(o=>this.loadModel(o));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag);if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new AP({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var o,s,r,a,l;(a=(s=(o=n.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null||a.setVisible((this.state.visible&&((r=n.state)==null?void 0:r.visible))!==!1),(l=n.tag3DContentSvelte)==null||l.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n.forEach(o=>o==null?void 0:o());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const Gh="Dnalogel-PanoTagPlugin",PP=i=>`${Gh}--${i}`;class rs extends wP{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>U(this,null,function*(){e.data=it({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{ot(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{ot(e)&&(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});this.params=W({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,gA(1,{namespace:vr.PlayAudio});try{const o=window;Array.isArray(o.__PANOTAGPLUGIN_DEBUG_LIST__)||(o.__PANOTAGPLUGIN_DEBUG_LIST__=[]),o.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),o.__PANOTAGPLUGIN_DEBUG__=this}catch(o){}}load(e,n){return U(this,null,function*(){var s,r;this.clearTags(),console.info(Gh," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=it({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{sA(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return U(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return Ie(W({},r),{state:W({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new ve.Subscribe,mergedConfig:a,unfold:()=>this.changeUnfoldedById(r.id,!0),fold:()=>this.changeUnfoldedById(r.id,!1),enable:()=>this.changeEnabledById(r.id,!0),disable:()=>this.changeEnabledById(r.id,!1),destroy:()=>this.destroyTagById(r.id)})}).filter(r=>r.position);return s.forEach(mA),this.tags.push(...s),dA(this.five).then(()=>U(this,null,function*(){var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),yield this.addMediaModelTag(s)}))})}changeConfig(e,n=!0){n?this.config=it({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=it({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=it({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache(),this.updateRenderAllTags()}show(e){return U(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return U(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}setState(e,n){if(this.checkDisposed())return;const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=W({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filterCSS3DTag.forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}changeUnfoldedById(e,n){var a;const o=this.getTagById(e);if(!o)return;const s=this.can("fold",o),r=this.can("unfold",o);if(s&&r){o.state.unfolded=n;const l=this.filterPointTag;(a=this.TagContainerSvelte)==null||a.$set({tags:l})}else console.warn(`tag ${e} cannot be ${n?"unfolded":"folded"}`)}changeEnabledById(e,n){const o=this.getTagById(e);o&&(o.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const o=this.getTagById(e);o&&o.tag3DContentSvelte&&(o.tag3DContentSvelte.currentNormal=It(n))}changeDataById(e,n,o=!0){const s=this.getTagById(e);s&&(o?s.data=it({},s.data,n):s.data=W(W({},s.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);n&&(o?it(s,n):Object.assign(s,n),s!=null&&s.tag3DContentSvelte&&(n!=null&&n.normal)&&(s.tag3DContentSvelte.currentNormal=It(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return U(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(this.isPanorama)return this.setVisible(),e?new Promise(n=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.updateRenderAllTags(),this.five.needsRender=!0}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),d=this.clickhandler.bind(this),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{this.state.enabled&&(this.show(),this.updateRenderAllTags())},o=()=>{this.state.enabled&&this.hide()},{observe:s,unobserve:r}=sd(uA(()=>{this.store.resizeObserverDisposer&&o()},500),e),{observe:a,unobserve:l}=sd(od(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{ot(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=Ie(W({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=Ie(W({},e.temporaryState),{visible:!!n.visibleConfig.alwaysShowWhenMovePano}))}),this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return od(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return U(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=Ie(W({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);n.state&&o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var o,s,r,a,l,c;((o=this.getTagConfig(e))==null?void 0:o.renderType)!=="Mesh"&&((a=(r=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer)==null?void 0:r.css3DObject)==null?void 0:a.mode)!==n&&((l=e.config)!=null&&l.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(c=this.store.css3DRenderDisposer.get(e.id))==null||c.forEach(d=>d==null?void 0:d()),e.tag3DContentSvelte=void 0)}}var Nh=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(Nh||{}),Wh=(i=>(i.Two="2D",i.Three="3D",i))(Wh||{});const CP=(i,t)=>new rs(i,t);function IP(i){me(i,"svelte-1i0lthz",".guide-line__tag.svelte-1i0lthz{position:relative}.guide-line__tag-point.svelte-1i0lthz{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-1i0lthz{position:absolute;left:50%;bottom:0.0625rem;width:0.125rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-1i0lthz{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-1i0lthz{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-1i0lthz{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-source:url('https://vrlab-static.ljcdn.com/release/web/jsl/test2.2ea9ddee.png');border-image-slice:6 25 6 18 fill;color:#fff}")}function EP(i){let t,e,n,o,s,r,a,l,c,d;return{c(){t=V("div"),e=V("div"),n=se(),o=V("div"),s=se(),r=V("div"),a=V("div"),l=se(),c=V("div"),d=Be(i[0]),w(e,"class","guide-line__tag-point svelte-1i0lthz"),w(o,"class","guide-line__tag-line svelte-1i0lthz"),w(a,"class","guide-line__tag-icon svelte-1i0lthz"),z(a,"background-image",`url(${i[1]})`),w(c,"class","guide-line__tag-text svelte-1i0lthz"),z(c,"border-image-source",`url(${i[2]})`),w(r,"class","guide-line__tag-content svelte-1i0lthz"),w(t,"class","guide-line__tag svelte-1i0lthz")},m(h,u){O(h,t,u),Q(t,e),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,l),Q(r,c),Q(c,d)},p(h,[u]){u&2&&z(a,"background-image",`url(${h[1]})`),u&1&&Re(d,h[0])},i:J,o:J,d(h){h&&_(t)}}}function kP(i,t,e){let{text:n=""}=t,{icon_url:o=""}=t;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uLifn5/Dw8O6urqQkJC6urro6Ojt7e3o6OjU1NS3t7fBwcGjo6Ozs7Orq6u1tbXAwMCurq6rq6vy8vLx8fHr6+vp6enZ2dnd3d3a2trX19fV1dW/v7/IyMihoaGampqVlZWLi4uCgoK+vr6urq7m5ubw8PDk5OTu7u7i4uLg4ODe3t7q6urS0tLi4uLOzs7e3t7Hx8fa2tqrq6vExMTAwMCnp6efn5+WlpaHh4ezs7OoqKiJiYm6urqZmZmurq59fX29vb23t7e4uLipqanp6enc3Nza2trW1tbT09Pm5ubj4+PQ0NDg4ODExMTCwsK7u7vBwcG8vLy5ubm8vLy+vr64uLiysrKdnZ3CwsJoaGisrKzHx8ekpKTExMTv7+/i4uLa2trm5ubk5OTLy8vKysrExMTQ0NDX19ecnJzT09N/f3+dnZ12dnaQkJCXl5etra3Pz8+4uLiXl5fGxsaqqqrr6+vQ0NDKysrNzc3W1takpKShoaGsrKysrKyduRZkAAAAsHRSTlMATE1NTExMTUxNTExMTExNTExMTU1MTU1MTICFc313fnl0iIWAe3h3aYqIgXx7eXZzcnFwaGggxLiog4J0dG9mZF82FMfEtK2pkYqKh3x4cm1rZmEmH8G/vry6trOxoZ2clpKOe3ptbWZjYmFgXFpaVlFPSDYlx7CspaSjoJ6akY6HfXt4bGpmY1xUU0g2LSzCuK6lopiWhoF3YmFaVlZUUU5KPyEJCcl/fXNdXFxZUIUrIQsAAAV6SURBVFjDvZj3VxNBEMePBBIOQgmEQGghISSASSBBUQFBVIpUEaR3aVJExN4F6fbee6//opPN2507E3P7fD4+b54z+935zt7lvPsBYbZ5lyXT7R5xms2ppaVpV615eVeuXL48PPzw4YPBwYsX+/vPnT1bW1t75u7p0729PT13urs7O9vbt2/ffurUp1OQ2ts7O7u77/T09PaevnvmTG3t2XPn+vsvDg4+GH5UVjl/SAjGe29La2vr5EFgm4+WlpYDgNfrbW7etQuuKDPTPTIy4nSa4bJ8lKYBV69arXmA1WpN81FamgqYzU6n0+12ZwI+qzPtyvDlR0dPCoGsecW4FEZcShwEyUDIGvtD+DcOZlrzFvcE3qylFXZ1cTqIgGk0K1xRSL84abaWtwl/8KM5kTiok04B2BpAPUWXAoGnQK3gn0xNW90ryDhpafXvJsYlJuoSdRCyTJHqBOxR9IvbUl1/PN5pL9tFR4gTJJmi7N+wl8qf7k33S+YQE0VRJwZz42RogDZcAxx+sTn1jSDho6VFBKAbp9K1XqfXi3oRgmSqQ2AGePziNpfs2GN2lV5Pp+IJkkwIrDFz+Y+Y90h/Yvtz+f0o1YGnc/lVXvshASk8IHUm6ZMIYhI6YAEyqyHkE/n8Kkuh5AX6ZVdBlypJpRJVIgTJ0IluEGCb1BDYCzWFx79h/yl5ZV3PVUSVAQIDFhCyLO/h9E9KfuOPriOqzUFjmRYYueOqTWLGfhPfHZcGrkOlgcAGskZdAV7/eIVA2eN6qZGA3Yhcxxozn3+mkD3ZQ64Z3EnQJEBouMB+Xr+68LpAuTZBOokDoPXfNIK85vZP5AqUreNqdYI6AUINkBrAtUatgaA67mEft38GvxRThWopOAFrBbj9kYXsa3z0mnrTsLAHe3yRzxGhjoBQ0BT848foqfONkT6FAAWrce3PeEpA5vZPsDf23aIhgpfIiEiIiH/mKftPfKJxTjaNv8bM6zlSzk5dmIsMDk7EGrMEbj+e+q5xLjoyOrQbGiCCaZh5/PgLzy8YiIrgNPmaZtQovP6J3ezNafTvxEfHQ2An8v/2K47hV4J0ExVBDbNCD4e/nH0lKj1+1RBvMEQboiEMUJI1BOmmGq0pVOP1z3nYF3G53EAIN4SHx4djNyxAkutQA1QnGeD2z3rY199RIZ+EtVxDPaDm9VdspYcWj65pteFaonIDBghpzeXyzNNTbyy8CpgCyCehjnvYx+uf9RTTU9cbo7SbRPmKQBnzaKMI2igthD8jVAvIuM/rXytjfyz4MFqBDgLWPGuA05/sqRQobaOzsBMbFQsRhaAWco/A6Z92FAuU446wWL+aHJWcHJtMOzEDwWrU+PyvHEcFRlkutELInT4NFiCRGqA6yQDWfH5jWdFegXLL8V3qDIsNIySHoRsWIGMN/wBY8/mXRosFxrrDCE20EwJzCGQ9XP7crBN46AdHbthmkPvluICccLzgchnDjBD/eqaxKOOtIKGyiEzDqSFOCt7D4X/dlHFDkNCWPu3fjTHGQBgpbI06TkeIpuQ37bbltAlSKstM/g6EdYcEr0jJv2rLfrZXkFKcPhVjMsWY0GGSrTn00H7TakbD11sChd7qa+gCSKdJVitpyvWLlab6uifsieKtLk1N7QZWtvpYXl4aGxsrAtIJBQVNWVlZOTkZGRm2z7bHW0q2lJRkZ2c3NOTn19fV19fn5zfAsmQL8Nhmg66cHOhvKigoSC/Iysk+vH9//jd2n8g6TG7yjbXZYCAMq6s7fBiah4aGLl0aGLhw4f758zuBmpq+vurq6h07dnR1dXTcrqqq2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return i.$$set=r=>{"text"in r&&e(0,n=r.text),"icon_url"in r&&e(1,o=r.icon_url)},[n,o,s]}class xP extends de{constructor(t){super(),ce(this,t,kP,EP,le,{text:0,icon_url:1},IP)}}function DP(i){return i.length===0?[]:i.filter((t,e)=>t!==i[e-1])}const SP=`
568
+ width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function vb(i){let t,e,n;return{c(){t=V("button"),w(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),ee(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){O(o,t,s),e||(n=ke(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&ee(t,"sc-carousel-dot__dot_active",o[0])},i:J,o:J,d(o){o&&_(t),e=!1,n()}}}function Ab(i,t,e){let{active:n=!1}=t;function o(s){Yn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class bb extends de{constructor(t){super(),ce(this,t,Ab,vb,le,{active:0},gb)}}function yb(i){me(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function Cd(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function Id(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new bb({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=V("div"),ie(n.$$.fragment),o=se(),w(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){O(a,e,l),te(n,e,null),Q(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(k(n.$$.fragment,a),s=!0)},o(a){M(n.$$.fragment,a),s=!1},d(a){a&&_(e),ne(n)}}}function wb(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=Cd(i,s,a),c=r(l);n.set(c,e[a]=Id(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","sc-carousel-dots__container svelte-670fde")},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,[l]){l&7&&(s=Array(a[0]),he(),e=xt(e,l,r,1,a,s,n,t,an,Id,null,Cd),ue())},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Pb(i,t,e){const n=Io();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class Cb extends de{constructor(t){super(),ce(this,t,Pb,wb,le,{pagesCount:0,currentPageIndex:1},yb)}}const li="prev",hn="next";function Ib(i){me(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function Eb(i){let t,e,n,o;return{c(){t=V("button"),e=V("i"),w(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),ee(e,"sc-carousel-arrow__arrow-next",i[0]===hn),ee(e,"sc-carousel-arrow__arrow-prev",i[0]===li),w(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),ee(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){O(s,t,r),Q(t,e),n||(o=ke(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&ee(e,"sc-carousel-arrow__arrow-next",s[0]===hn),r&1&&ee(e,"sc-carousel-arrow__arrow-prev",s[0]===li),r&2&&ee(t,"sc-carousel-arrow__circle_disabled",s[1])},i:J,o:J,d(s){s&&_(t),n=!1,o()}}}function kb(i,t,e){let{direction:n=hn}=t,{disabled:o=!1}=t;function s(r){Yn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class Ed extends de{constructor(t){super(),ce(this,t,kb,Eb,le,{direction:0,disabled:1},Ib)}}function xb(i){me(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function Db(i){let t;return{c(){t=V("div"),w(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),z(t,"width",i[0]+"%")},m(e,n){O(e,t,n)},p(e,[n]){n&1&&z(t,"width",e[0]+"%")},i:J,o:J,d(e){e&&_(t)}}}const kd=100;function Sb(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*kd,0),kd))},[n,o]}class Lb extends de{constructor(t){super(),ce(this,t,Sb,Db,le,{value:1},xb)}}function Mb(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function Tb(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function zb(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function xd(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function jb(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function Dd(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function wr(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const _b=110,Vb=9,Ob=111,Bb=20;function Pr(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function Qb(i,{thresholdProvider:t}){const e=wr(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Ob&&Math.abs(s)>=Bb}function c(u){r=Date.now(),s=0,a=!0;const m=Pr(u);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),jb(window,d),zb(window,h)}function d(u){if(!a)return;const m=Pr(u),g=m.x-n,v=m.y-o;n=m.x,o=m.y,e("swipeMove",{x:n,y:o,dx:g,dy:v}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?li:hn}),xd(window,h),Dd(window,d))}function h(u){if(xd(window,h),Dd(window,d),a=!1,!l()){e("swipeFailed");return}const m=Pr(u);e("swipeEnd",{x:m.x,y:m.y})}return Mb(i,c),{destroy(){Tb(i,c)}}}function Rb(i,t){i.addEventListener("mouseenter",t)}function Gb(i,t){i.removeEventListener("mouseenter",t)}function Nb(i,t){i.addEventListener("mouseleave",t)}function Sd(i,t){i.removeEventListener("mouseleave",t)}function Wb(i){const t=wr(i);function e(){Nb(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),Sd(i,n)}return Rb(i,e),{destroy(){Gb(i,e),Sd(i,n)}}}const Fb=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function ci(i,t,e){return Math.max(i,Math.min(t,e))}function Hb(i,t){i.addEventListener("touchstart",t,{passive:!0})}function Xb(i,t){i.removeEventListener("touchstart",t)}function Yb(i,t){i.addEventListener("touchend",t)}function Ld(i,t){i.removeEventListener("touchend",t)}function Ub(i){const t=wr(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,d=Fb(n,l);return c<=_b&&d<=Vb}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Yb(i,r)}function r(a){Ld(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return Hb(i,s),{destroy(){Xb(i,s),Ld(i,r)}}}function qb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Md({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function Jb({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Zb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?qb({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):Jb({currentParticleIndex:i,particlesToScroll:s})}function Md({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function Kb({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Td({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function $b({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Md({particlesCountWithoutClones:t,particlesToScroll:e}):Kb({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function e1({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return ci(0,Math.min(t+i*n,o-e),o-1)}function t1({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return ci(0,Math.min(i*t,e-n),e-1)}function Cr({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?e1({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):t1({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function n1({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function Td({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function i1(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function o1({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function s1({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function r1({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return Ie(W({},n),{total:n.head+n.tail})}const Qi=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Ir=i=>t=>{i[t]&&i[t]()};var a1="Expected a function",zd="__lodash_hash_undefined__",jd=1/0,l1="[object Function]",c1="[object GeneratorFunction]",d1="[object Symbol]",h1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u1=/^\w*$/,f1=/^\./,m1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p1=/[\\^$.*+?()[\]{}|]/g,g1=/\\(\\)?/g,v1=/^\[object .+?Constructor\]$/,A1=typeof wt=="object"&&wt&&wt.Object===Object&&wt,b1=typeof self=="object"&&self&&self.Object===Object&&self,Er=A1||b1||Function("return this")();function y1(i,t){return i==null?void 0:i[t]}function w1(i){var t=!1;if(i!=null&&typeof i.toString!="function")try{t=!!(i+"")}catch(e){}return t}var P1=Array.prototype,C1=Function.prototype,_d=Object.prototype,kr=Er["__core-js_shared__"],Vd=function(){var i=/[^.]+$/.exec(kr&&kr.keys&&kr.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Od=C1.toString,xr=_d.hasOwnProperty,Bd=_d.toString,I1=RegExp("^"+Od.call(xr).replace(p1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qd=Er.Symbol,E1=P1.splice,k1=Nd(Er,"Map"),Ri=Nd(Object,"create"),Rd=Qd?Qd.prototype:void 0,Gd=Rd?Rd.toString:void 0;function In(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function x1(){this.__data__=Ri?Ri(null):{}}function D1(i){return this.has(i)&&delete this.__data__[i]}function S1(i){var t=this.__data__;if(Ri){var e=t[i];return e===zd?void 0:e}return xr.call(t,i)?t[i]:void 0}function L1(i){var t=this.__data__;return Ri?t[i]!==void 0:xr.call(t,i)}function M1(i,t){var e=this.__data__;return e[i]=Ri&&t===void 0?zd:t,this}In.prototype.clear=x1,In.prototype.delete=D1,In.prototype.get=S1,In.prototype.has=L1,In.prototype.set=M1;function di(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function T1(){this.__data__=[]}function z1(i){var t=this.__data__,e=$o(t,i);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():E1.call(t,e,1),!0}function j1(i){var t=this.__data__,e=$o(t,i);return e<0?void 0:t[e][1]}function _1(i){return $o(this.__data__,i)>-1}function V1(i,t){var e=this.__data__,n=$o(e,i);return n<0?e.push([i,t]):e[n][1]=t,this}di.prototype.clear=T1,di.prototype.delete=z1,di.prototype.get=j1,di.prototype.has=_1,di.prototype.set=V1;function En(i){var t=-1,e=i?i.length:0;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function O1(){this.__data__={hash:new In,map:new(k1||di),string:new In}}function B1(i){return es(this,i).delete(i)}function Q1(i){return es(this,i).get(i)}function R1(i){return es(this,i).has(i)}function G1(i,t){return es(this,i).set(i,t),this}En.prototype.clear=O1,En.prototype.delete=B1,En.prototype.get=Q1,En.prototype.has=R1,En.prototype.set=G1;function $o(i,t){for(var e=i.length;e--;)if(K1(i[e][0],t))return e;return-1}function N1(i,t){t=X1(t,i)?[t]:H1(t);for(var e=0,n=t.length;i!=null&&e<n;)i=i[J1(t[e++])];return e&&e==n?i:void 0}function W1(i){if(!Fd(i)||U1(i))return!1;var t=$1(i)||w1(i)?I1:v1;return t.test(Z1(i))}function F1(i){if(typeof i=="string")return i;if(Sr(i))return Gd?Gd.call(i):"";var t=i+"";return t=="0"&&1/i==-jd?"-0":t}function H1(i){return Wd(i)?i:q1(i)}function es(i,t){var e=i.__data__;return Y1(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Nd(i,t){var e=y1(i,t);return W1(e)?e:void 0}function X1(i,t){if(Wd(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||Sr(i)?!0:u1.test(i)||!h1.test(i)||t!=null&&i in Object(t)}function Y1(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}function U1(i){return!!Vd&&Vd in i}var q1=Dr(function(i){i=ty(i);var t=[];return f1.test(i)&&t.push(""),i.replace(m1,function(e,n,o,s){t.push(o?s.replace(g1,"$1"):n||e)}),t});function J1(i){if(typeof i=="string"||Sr(i))return i;var t=i+"";return t=="0"&&1/i==-jd?"-0":t}function Z1(i){if(i!=null){try{return Od.call(i)}catch(t){}try{return i+""}catch(t){}}return""}function Dr(i,t){if(typeof i!="function"||t&&typeof t!="function")throw new TypeError(a1);var e=function(){var n=arguments,o=t?t.apply(this,n):n[0],s=e.cache;if(s.has(o))return s.get(o);var r=i.apply(this,n);return e.cache=s.set(o,r),r};return e.cache=new(Dr.Cache||En),e}Dr.Cache=En;function K1(i,t){return i===t||i!==i&&t!==t}var Wd=Array.isArray;function $1(i){var t=Fd(i)?Bd.call(i):"";return t==l1||t==c1}function Fd(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function ey(i){return!!i&&typeof i=="object"}function Sr(i){return typeof i=="symbol"||ey(i)&&Bd.call(i)==d1}function ty(i){return i==null?"":F1(i)}function ny(i,t,e){var n=i==null?void 0:N1(i,t);return n===void 0?e:n}var ts=ny,ns={},iy={get exports(){return ns},set exports(i){ns=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",o=9007199254740991,s="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",u="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",A="[object RegExp]",b="[object Set]",y="[object String]",C="[object Symbol]",D="[object WeakMap]",x="[object ArrayBuffer]",I="[object DataView]",T="[object Float32Array]",S="[object Float64Array]",H="[object Int8Array]",X="[object Int16Array]",N="[object Int32Array]",G="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",Z="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,Y=/\w*$/,K=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,oe={};oe[s]=oe[r]=oe[x]=oe[I]=oe[a]=oe[l]=oe[T]=oe[S]=oe[H]=oe[X]=oe[N]=oe[u]=oe[m]=oe[g]=oe[A]=oe[b]=oe[y]=oe[C]=oe[G]=oe[j]=oe[R]=oe[Z]=!0,oe[c]=oe[d]=oe[D]=!1;var ye=typeof wt=="object"&&wt&&wt.Object===Object&&wt,Pe=typeof self=="object"&&self&&self.Object===Object&&self,Ae=ye||Pe||Function("return this")(),_e=t&&!t.nodeType&&t,be=_e&&!0&&i&&!i.nodeType&&i,Fe=be&&be.exports===_e;function fe(p,P){return p.set(P[0],P[1]),p}function we(p,P){return p.add(P),p}function Te(p,P){for(var L=-1,F=p?p.length:0;++L<F&&P(p[L],L,p)!==!1;);return p}function pe(p,P){for(var L=-1,F=P.length,Ce=p.length;++L<F;)p[Ce+L]=P[L];return p}function Je(p,P,L,F){var Ce=-1,ge=p?p.length:0;for(F&&ge&&(L=p[++Ce]);++Ce<ge;)L=P(L,p[Ce],Ce,p);return L}function dt(p,P){for(var L=-1,F=Array(p);++L<p;)F[L]=P(L);return F}function De(p,P){return p==null?void 0:p[P]}function ot(p){var P=!1;if(p!=null&&typeof p.toString!="function")try{P=!!(p+"")}catch(L){}return P}function re(p){var P=-1,L=Array(p.size);return p.forEach(function(F,Ce){L[++P]=[Ce,F]}),L}function xe(p,P){return function(L){return p(P(L))}}function Ne(p){var P=-1,L=Array(p.size);return p.forEach(function(F){L[++P]=F}),L}var ft=Array.prototype,Yt=Function.prototype,At=Object.prototype,bt=Ae["__core-js_shared__"],Ve=function(){var p=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Qe=Yt.toString,Ye=At.hasOwnProperty,St=At.toString,Fi=RegExp("^"+Qe.call(Ye).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=Fe?Ae.Buffer:void 0,fn=Ae.Symbol,xn=Ae.Uint8Array,mt=xe(Object.getPrototypeOf,Object),fi=Object.create,mi=At.propertyIsEnumerable,Gr=ft.splice,Hi=Object.getOwnPropertySymbols,pi=Ot?Ot.isBuffer:void 0,hs=xe(Object.keys,Object),gi=Mt(Ae,"DataView"),Dn=Mt(Ae,"Map"),Lt=Mt(Ae,"Promise"),vi=Mt(Ae,"Set"),Xi=Mt(Ae,"WeakMap"),Sn=Mt(Object,"create"),Yi=ht(gi),Ln=ht(Dn),Ui=ht(Lt),qi=ht(vi),Ji=ht(Xi),mn=fn?fn.prototype:void 0,us=mn?mn.valueOf:void 0;function Ut(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Nr(){this.__data__=Sn?Sn(null):{}}function Wr(p){return this.has(p)&&delete this.__data__[p]}function Fr(p){var P=this.__data__;if(Sn){var L=P[p];return L===n?void 0:L}return Ye.call(P,p)?P[p]:void 0}function fs(p){var P=this.__data__;return Sn?P[p]!==void 0:Ye.call(P,p)}function Zi(p,P){var L=this.__data__;return L[p]=Sn&&P===void 0?n:P,this}Ut.prototype.clear=Nr,Ut.prototype.delete=Wr,Ut.prototype.get=Fr,Ut.prototype.has=fs,Ut.prototype.set=Zi;function Ze(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Hr(){this.__data__=[]}function Xr(p){var P=this.__data__,L=bi(P,p);if(L<0)return!1;var F=P.length-1;return L==F?P.pop():Gr.call(P,L,1),!0}function Yr(p){var P=this.__data__,L=bi(P,p);return L<0?void 0:P[L][1]}function Ur(p){return bi(this.__data__,p)>-1}function qr(p,P){var L=this.__data__,F=bi(L,p);return F<0?L.push([p,P]):L[F][1]=P,this}Ze.prototype.clear=Hr,Ze.prototype.delete=Xr,Ze.prototype.get=Yr,Ze.prototype.has=Ur,Ze.prototype.set=qr;function st(p){var P=-1,L=p?p.length:0;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Jr(){this.__data__={hash:new Ut,map:new(Dn||Ze),string:new Ut}}function Zr(p){return Tn(this,p).delete(p)}function Kr(p){return Tn(this,p).get(p)}function $r(p){return Tn(this,p).has(p)}function ea(p,P){return Tn(this,p).set(p,P),this}st.prototype.clear=Jr,st.prototype.delete=Zr,st.prototype.get=Kr,st.prototype.has=$r,st.prototype.set=ea;function pt(p){this.__data__=new Ze(p)}function ta(){this.__data__=new Ze}function na(p){return this.__data__.delete(p)}function ia(p){return this.__data__.get(p)}function oa(p){return this.__data__.has(p)}function sa(p,P){var L=this.__data__;if(L instanceof Ze){var F=L.__data__;if(!Dn||F.length<e-1)return F.push([p,P]),this;L=this.__data__=new st(F)}return L.set(p,P),this}pt.prototype.clear=ta,pt.prototype.delete=na,pt.prototype.get=ia,pt.prototype.has=oa,pt.prototype.set=sa;function Ai(p,P){var L=to(p)||wi(p)?dt(p.length,String):[],F=L.length,Ce=!!F;for(var ge in p)(P||Ye.call(p,ge))&&!(Ce&&(ge=="length"||ba(ge,F)))&&L.push(ge);return L}function ms(p,P,L){var F=p[P];(!(Ye.call(p,P)&&bs(F,L))||L===void 0&&!(P in p))&&(p[P]=L)}function bi(p,P){for(var L=p.length;L--;)if(bs(p[L][0],P))return L;return-1}function Bt(p,P){return p&&eo(P,io(P),p)}function Ki(p,P,L,F,Ce,ge,Se){var Me;if(F&&(Me=ge?F(p,Ce,ge,Se):F(p)),Me!==void 0)return Me;if(!Rt(p))return p;var He=to(p);if(He){if(Me=va(p),!P)return ma(p,Me)}else{var je=Jt(p),rt=je==d||je==h;if(ys(p))return yi(p,P);if(je==g||je==s||rt&&!ge){if(ot(p))return ge?p:{};if(Me=Qt(rt?{}:p),!P)return pa(p,Bt(Me,p))}else{if(!oe[je])return ge?p:{};Me=Aa(p,je,Ki,P)}}Se||(Se=new pt);var gt=Se.get(p);if(gt)return gt;if(Se.set(p,Me),!He)var Xe=L?ga(p):io(p);return Te(Xe||p,function(at,Ke){Xe&&(Ke=at,at=p[Ke]),ms(Me,Ke,Ki(at,P,L,F,Ke,p,Se))}),Me}function ra(p){return Rt(p)?fi(p):{}}function aa(p,P,L){var F=P(p);return to(p)?F:pe(F,L(p))}function la(p){return St.call(p)}function ca(p){if(!Rt(p)||wa(p))return!1;var P=no(p)||ot(p)?Fi:K;return P.test(ht(p))}function da(p){if(!vs(p))return hs(p);var P=[];for(var L in Object(p))Ye.call(p,L)&&L!="constructor"&&P.push(L);return P}function yi(p,P){if(P)return p.slice();var L=new p.constructor(p.length);return p.copy(L),L}function $i(p){var P=new p.constructor(p.byteLength);return new xn(P).set(new xn(p)),P}function Mn(p,P){var L=P?$i(p.buffer):p.buffer;return new p.constructor(L,p.byteOffset,p.byteLength)}function ps(p,P,L){var F=P?L(re(p),!0):re(p);return Je(F,fe,new p.constructor)}function gs(p){var P=new p.constructor(p.source,Y.exec(p));return P.lastIndex=p.lastIndex,P}function ha(p,P,L){var F=P?L(Ne(p),!0):Ne(p);return Je(F,we,new p.constructor)}function ua(p){return us?Object(us.call(p)):{}}function fa(p,P){var L=P?$i(p.buffer):p.buffer;return new p.constructor(L,p.byteOffset,p.length)}function ma(p,P){var L=-1,F=p.length;for(P||(P=Array(F));++L<F;)P[L]=p[L];return P}function eo(p,P,L,F){L||(L={});for(var Ce=-1,ge=P.length;++Ce<ge;){var Se=P[Ce],Me=F?F(L[Se],p[Se],Se,L,p):void 0;ms(L,Se,Me===void 0?p[Se]:Me)}return L}function pa(p,P){return eo(p,qt(p),P)}function ga(p){return aa(p,io,qt)}function Tn(p,P){var L=p.__data__;return ya(P)?L[typeof P=="string"?"string":"hash"]:L.map}function Mt(p,P){var L=De(p,P);return ca(L)?L:void 0}var qt=Hi?xe(Hi,Object):Ca,Jt=la;(gi&&Jt(new gi(new ArrayBuffer(1)))!=I||Dn&&Jt(new Dn)!=u||Lt&&Jt(Lt.resolve())!=v||vi&&Jt(new vi)!=b||Xi&&Jt(new Xi)!=D)&&(Jt=function(p){var P=St.call(p),L=P==g?p.constructor:void 0,F=L?ht(L):void 0;if(F)switch(F){case Yi:return I;case Ln:return u;case Ui:return v;case qi:return b;case Ji:return D}return P});function va(p){var P=p.length,L=p.constructor(P);return P&&typeof p[0]=="string"&&Ye.call(p,"index")&&(L.index=p.index,L.input=p.input),L}function Qt(p){return typeof p.constructor=="function"&&!vs(p)?ra(mt(p)):{}}function Aa(p,P,L,F){var Ce=p.constructor;switch(P){case x:return $i(p);case a:case l:return new Ce(+p);case I:return Mn(p,F);case T:case S:case H:case X:case N:case G:case j:case R:case Z:return fa(p,F);case u:return ps(p,F,L);case m:case y:return new Ce(p);case A:return gs(p);case b:return ha(p,F,L);case C:return ua(p)}}function ba(p,P){return P=P==null?o:P,!!P&&(typeof p=="number"||ae.test(p))&&p>-1&&p%1==0&&p<P}function ya(p){var P=typeof p;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?p!=="__proto__":p===null}function wa(p){return!!Ve&&Ve in p}function vs(p){var P=p&&p.constructor,L=typeof P=="function"&&P.prototype||At;return p===L}function ht(p){if(p!=null){try{return Qe.call(p)}catch(P){}try{return p+""}catch(P){}}return""}function As(p){return Ki(p,!0,!0)}function bs(p,P){return p===P||p!==p&&P!==P}function wi(p){return Pa(p)&&Ye.call(p,"callee")&&(!mi.call(p,"callee")||St.call(p)==s)}var to=Array.isArray;function Pi(p){return p!=null&&ws(p.length)&&!no(p)}function Pa(p){return Ps(p)&&Pi(p)}var ys=pi||Ia;function no(p){var P=Rt(p)?St.call(p):"";return P==d||P==h}function ws(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=o}function Rt(p){var P=typeof p;return!!p&&(P=="object"||P=="function")}function Ps(p){return!!p&&typeof p=="object"}function io(p){return Pi(p)?Ai(p):da(p)}function Ca(){return[]}function Ia(){return!1}i.exports=As})(iy,ns);const oy=ns;var is={},sy={get exports(){return is},set exports(i){is=i}};(function(i,t){var e=200,n="__lodash_hash_undefined__",o=1,s=2,r=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",u="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",A="[object Number]",b="[object Null]",y="[object Object]",C="[object Promise]",D="[object Proxy]",x="[object RegExp]",I="[object Set]",T="[object String]",S="[object Symbol]",H="[object Undefined]",X="[object WeakMap]",N="[object ArrayBuffer]",G="[object DataView]",j="[object Float32Array]",R="[object Float64Array]",Z="[object Int8Array]",q="[object Int16Array]",Y="[object Int32Array]",K="[object Uint8Array]",ae="[object Uint8ClampedArray]",oe="[object Uint16Array]",ye="[object Uint32Array]",Pe=/[\\^$.*+?()[\]{}|]/g,Ae=/^\[object .+?Constructor\]$/,_e=/^(?:0|[1-9]\d*)$/,be={};be[j]=be[R]=be[Z]=be[q]=be[Y]=be[K]=be[ae]=be[oe]=be[ye]=!0,be[a]=be[l]=be[N]=be[d]=be[G]=be[h]=be[u]=be[m]=be[v]=be[A]=be[y]=be[x]=be[I]=be[T]=be[X]=!1;var Fe=typeof wt=="object"&&wt&&wt.Object===Object&&wt,fe=typeof self=="object"&&self&&self.Object===Object&&self,we=Fe||fe||Function("return this")(),Te=t&&!t.nodeType&&t,pe=Te&&!0&&i&&!i.nodeType&&i,Je=pe&&pe.exports===Te,dt=Je&&Fe.process,De=function(){try{return dt&&dt.binding&&dt.binding("util")}catch(p){}}(),ot=De&&De.isTypedArray;function re(p,P){for(var L=-1,F=p==null?0:p.length,Ce=0,ge=[];++L<F;){var Se=p[L];P(Se,L,p)&&(ge[Ce++]=Se)}return ge}function xe(p,P){for(var L=-1,F=P.length,Ce=p.length;++L<F;)p[Ce+L]=P[L];return p}function Ne(p,P){for(var L=-1,F=p==null?0:p.length;++L<F;)if(P(p[L],L,p))return!0;return!1}function ft(p,P){for(var L=-1,F=Array(p);++L<p;)F[L]=P(L);return F}function Yt(p){return function(P){return p(P)}}function At(p,P){return p.has(P)}function bt(p,P){return p==null?void 0:p[P]}function Ve(p){var P=-1,L=Array(p.size);return p.forEach(function(F,Ce){L[++P]=[Ce,F]}),L}function Qe(p,P){return function(L){return p(P(L))}}function Ye(p){var P=-1,L=Array(p.size);return p.forEach(function(F){L[++P]=F}),L}var St=Array.prototype,Fi=Function.prototype,Ot=Object.prototype,fn=we["__core-js_shared__"],xn=Fi.toString,mt=Ot.hasOwnProperty,fi=function(){var p=/[^.]+$/.exec(fn&&fn.keys&&fn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),mi=Ot.toString,Gr=RegExp("^"+xn.call(mt).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hi=Je?we.Buffer:void 0,pi=we.Symbol,hs=we.Uint8Array,gi=Ot.propertyIsEnumerable,Dn=St.splice,Lt=pi?pi.toStringTag:void 0,vi=Object.getOwnPropertySymbols,Xi=Hi?Hi.isBuffer:void 0,Sn=Qe(Object.keys,Object),Yi=qt(we,"DataView"),Ln=qt(we,"Map"),Ui=qt(we,"Promise"),qi=qt(we,"Set"),Ji=qt(we,"WeakMap"),mn=qt(Object,"create"),us=ht(Yi),Ut=ht(Ln),Nr=ht(Ui),Wr=ht(qi),Fr=ht(Ji),fs=pi?pi.prototype:void 0,Zi=fs?fs.valueOf:void 0;function Ze(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Hr(){this.__data__=mn?mn(null):{},this.size=0}function Xr(p){var P=this.has(p)&&delete this.__data__[p];return this.size-=P?1:0,P}function Yr(p){var P=this.__data__;if(mn){var L=P[p];return L===n?void 0:L}return mt.call(P,p)?P[p]:void 0}function Ur(p){var P=this.__data__;return mn?P[p]!==void 0:mt.call(P,p)}function qr(p,P){var L=this.__data__;return this.size+=this.has(p)?0:1,L[p]=mn&&P===void 0?n:P,this}Ze.prototype.clear=Hr,Ze.prototype.delete=Xr,Ze.prototype.get=Yr,Ze.prototype.has=Ur,Ze.prototype.set=qr;function st(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function Jr(){this.__data__=[],this.size=0}function Zr(p){var P=this.__data__,L=yi(P,p);if(L<0)return!1;var F=P.length-1;return L==F?P.pop():Dn.call(P,L,1),--this.size,!0}function Kr(p){var P=this.__data__,L=yi(P,p);return L<0?void 0:P[L][1]}function $r(p){return yi(this.__data__,p)>-1}function ea(p,P){var L=this.__data__,F=yi(L,p);return F<0?(++this.size,L.push([p,P])):L[F][1]=P,this}st.prototype.clear=Jr,st.prototype.delete=Zr,st.prototype.get=Kr,st.prototype.has=$r,st.prototype.set=ea;function pt(p){var P=-1,L=p==null?0:p.length;for(this.clear();++P<L;){var F=p[P];this.set(F[0],F[1])}}function ta(){this.size=0,this.__data__={hash:new Ze,map:new(Ln||st),string:new Ze}}function na(p){var P=Mt(this,p).delete(p);return this.size-=P?1:0,P}function ia(p){return Mt(this,p).get(p)}function oa(p){return Mt(this,p).has(p)}function sa(p,P){var L=Mt(this,p),F=L.size;return L.set(p,P),this.size+=L.size==F?0:1,this}pt.prototype.clear=ta,pt.prototype.delete=na,pt.prototype.get=ia,pt.prototype.has=oa,pt.prototype.set=sa;function Ai(p){var P=-1,L=p==null?0:p.length;for(this.__data__=new pt;++P<L;)this.add(p[P])}function ms(p){return this.__data__.set(p,n),this}function bi(p){return this.__data__.has(p)}Ai.prototype.add=Ai.prototype.push=ms,Ai.prototype.has=bi;function Bt(p){var P=this.__data__=new st(p);this.size=P.size}function Ki(){this.__data__=new st,this.size=0}function ra(p){var P=this.__data__,L=P.delete(p);return this.size=P.size,L}function aa(p){return this.__data__.get(p)}function la(p){return this.__data__.has(p)}function ca(p,P){var L=this.__data__;if(L instanceof st){var F=L.__data__;if(!Ln||F.length<e-1)return F.push([p,P]),this.size=++L.size,this;L=this.__data__=new pt(F)}return L.set(p,P),this.size=L.size,this}Bt.prototype.clear=Ki,Bt.prototype.delete=ra,Bt.prototype.get=aa,Bt.prototype.has=la,Bt.prototype.set=ca;function da(p,P){var L=wi(p),F=!L&&bs(p),Ce=!L&&!F&&Pi(p),ge=!L&&!F&&!Ce&&Ps(p),Se=L||F||Ce||ge,Me=Se?ft(p.length,String):[],He=Me.length;for(var je in p)(P||mt.call(p,je))&&!(Se&&(je=="length"||Ce&&(je=="offset"||je=="parent")||ge&&(je=="buffer"||je=="byteLength"||je=="byteOffset")||Aa(je,He)))&&Me.push(je);return Me}function yi(p,P){for(var L=p.length;L--;)if(As(p[L][0],P))return L;return-1}function $i(p,P,L){var F=P(p);return wi(p)?F:xe(F,L(p))}function Mn(p){return p==null?p===void 0?H:b:Lt&&Lt in Object(p)?Jt(p):vs(p)}function ps(p){return Rt(p)&&Mn(p)==a}function gs(p,P,L,F,Ce){return p===P?!0:p==null||P==null||!Rt(p)&&!Rt(P)?p!==p&&P!==P:ha(p,P,L,F,gs,Ce)}function ha(p,P,L,F,Ce,ge){var Se=wi(p),Me=wi(P),He=Se?l:Qt(p),je=Me?l:Qt(P);He=He==a?y:He,je=je==a?y:je;var rt=He==y,gt=je==y,Xe=He==je;if(Xe&&Pi(p)){if(!Pi(P))return!1;Se=!0,rt=!1}if(Xe&&!rt)return ge||(ge=new Bt),Se||Ps(p)?eo(p,P,L,F,Ce,ge):pa(p,P,He,L,F,Ce,ge);if(!(L&o)){var at=rt&&mt.call(p,"__wrapped__"),Ke=gt&&mt.call(P,"__wrapped__");if(at||Ke){var pn=at?p.value():p,Zt=Ke?P.value():P;return ge||(ge=new Bt),Ce(pn,Zt,L,F,ge)}}return Xe?(ge||(ge=new Bt),ga(p,P,L,F,Ce,ge)):!1}function ua(p){if(!ws(p)||ya(p))return!1;var P=ys(p)?Gr:Ae;return P.test(ht(p))}function fa(p){return Rt(p)&&no(p.length)&&!!be[Mn(p)]}function ma(p){if(!wa(p))return Sn(p);var P=[];for(var L in Object(p))mt.call(p,L)&&L!="constructor"&&P.push(L);return P}function eo(p,P,L,F,Ce,ge){var Se=L&o,Me=p.length,He=P.length;if(Me!=He&&!(Se&&He>Me))return!1;var je=ge.get(p);if(je&&ge.get(P))return je==P;var rt=-1,gt=!0,Xe=L&s?new Ai:void 0;for(ge.set(p,P),ge.set(P,p);++rt<Me;){var at=p[rt],Ke=P[rt];if(F)var pn=Se?F(Ke,at,rt,P,p,ge):F(at,Ke,rt,p,P,ge);if(pn!==void 0){if(pn)continue;gt=!1;break}if(Xe){if(!Ne(P,function(Zt,zn){if(!At(Xe,zn)&&(at===Zt||Ce(at,Zt,L,F,ge)))return Xe.push(zn)})){gt=!1;break}}else if(!(at===Ke||Ce(at,Ke,L,F,ge))){gt=!1;break}}return ge.delete(p),ge.delete(P),gt}function pa(p,P,L,F,Ce,ge,Se){switch(L){case G:if(p.byteLength!=P.byteLength||p.byteOffset!=P.byteOffset)return!1;p=p.buffer,P=P.buffer;case N:return!(p.byteLength!=P.byteLength||!ge(new hs(p),new hs(P)));case d:case h:case A:return As(+p,+P);case u:return p.name==P.name&&p.message==P.message;case x:case T:return p==P+"";case v:var Me=Ve;case I:var He=F&o;if(Me||(Me=Ye),p.size!=P.size&&!He)return!1;var je=Se.get(p);if(je)return je==P;F|=s,Se.set(p,P);var rt=eo(Me(p),Me(P),F,Ce,ge,Se);return Se.delete(p),rt;case S:if(Zi)return Zi.call(p)==Zi.call(P)}return!1}function ga(p,P,L,F,Ce,ge){var Se=L&o,Me=Tn(p),He=Me.length,je=Tn(P),rt=je.length;if(He!=rt&&!Se)return!1;for(var gt=He;gt--;){var Xe=Me[gt];if(!(Se?Xe in P:mt.call(P,Xe)))return!1}var at=ge.get(p);if(at&&ge.get(P))return at==P;var Ke=!0;ge.set(p,P),ge.set(P,p);for(var pn=Se;++gt<He;){Xe=Me[gt];var Zt=p[Xe],zn=P[Xe];if(F)var ou=Se?F(zn,Zt,Xe,P,p,ge):F(Zt,zn,Xe,p,P,ge);if(!(ou===void 0?Zt===zn||Ce(Zt,zn,L,F,ge):ou)){Ke=!1;break}pn||(pn=Xe=="constructor")}if(Ke&&!pn){var Cs=p.constructor,Is=P.constructor;Cs!=Is&&"constructor"in p&&"constructor"in P&&!(typeof Cs=="function"&&Cs instanceof Cs&&typeof Is=="function"&&Is instanceof Is)&&(Ke=!1)}return ge.delete(p),ge.delete(P),Ke}function Tn(p){return $i(p,io,va)}function Mt(p,P){var L=p.__data__;return ba(P)?L[typeof P=="string"?"string":"hash"]:L.map}function qt(p,P){var L=bt(p,P);return ua(L)?L:void 0}function Jt(p){var P=mt.call(p,Lt),L=p[Lt];try{p[Lt]=void 0;var F=!0}catch(ge){}var Ce=mi.call(p);return F&&(P?p[Lt]=L:delete p[Lt]),Ce}var va=vi?function(p){return p==null?[]:(p=Object(p),re(vi(p),function(P){return gi.call(p,P)}))}:Ca,Qt=Mn;(Yi&&Qt(new Yi(new ArrayBuffer(1)))!=G||Ln&&Qt(new Ln)!=v||Ui&&Qt(Ui.resolve())!=C||qi&&Qt(new qi)!=I||Ji&&Qt(new Ji)!=X)&&(Qt=function(p){var P=Mn(p),L=P==y?p.constructor:void 0,F=L?ht(L):"";if(F)switch(F){case us:return G;case Ut:return v;case Nr:return C;case Wr:return I;case Fr:return X}return P});function Aa(p,P){return P=P==null?r:P,!!P&&(typeof p=="number"||_e.test(p))&&p>-1&&p%1==0&&p<P}function ba(p){var P=typeof p;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?p!=="__proto__":p===null}function ya(p){return!!fi&&fi in p}function wa(p){var P=p&&p.constructor,L=typeof P=="function"&&P.prototype||Ot;return p===L}function vs(p){return mi.call(p)}function ht(p){if(p!=null){try{return xn.call(p)}catch(P){}try{return p+""}catch(P){}}return""}function As(p,P){return p===P||p!==p&&P!==P}var bs=ps(function(){return arguments}())?ps:function(p){return Rt(p)&&mt.call(p,"callee")&&!gi.call(p,"callee")},wi=Array.isArray;function to(p){return p!=null&&no(p.length)&&!ys(p)}var Pi=Xi||Ia;function Pa(p,P){return gs(p,P)}function ys(p){if(!ws(p))return!1;var P=Mn(p);return P==m||P==g||P==c||P==D}function no(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=r}function ws(p){var P=typeof p;return p!=null&&(P=="object"||P=="function")}function Rt(p){return p!=null&&typeof p=="object"}var Ps=ot?Yt(ot):fa;function io(p){return to(p)?da(p):ma(p)}function Ca(){return[]}function Ia(){return!1}i.exports=Pa})(sy,is);const ry=is,ay=(i,t)=>ry(i,t),ly=i=>Object.keys(i||{}),cy=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},dy=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=ly(s);if(a.includes(n)){const l=cy(a,e);ay(s,l)||(i[o].deps=l,r())}})}}},hy=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function uy(i,t){const e=ts(i,"data",{}),n=ts(i,"watch",{}),o=ts(i,"methods",{}),s=ts(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=dy(),{targetWatcher:c,getTarget:d}=hy();let h;const u={},m=()=>({data:h,methods:u});let g=!1;const v=b=>(...y)=>{g=!0;const C=b(...y);return g=!1,C};Object.entries(o).forEach(([b,y])=>{u[b]=v((...C)=>y(m(),...C)),Object.defineProperty(u[b],"name",{value:b})}),h=new Proxy(oy(e),{get(b,y){return d()&&!g&&r(d(),{prop:y,value:b[y]}),Reflect.get(...arguments)},set(b,y,C){return b[y]===C||(Reflect.set(...arguments),d()||(s&&s(y,C),a(h,y))),!0}}),Object.entries(n).forEach(([b,y])=>{c(b,()=>{y(m())})});const A=[h,u];return A._internal={_getSubscribers(){return l}},A}function fy({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function my({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=ci(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,u)=>h-u),d=c.flatMap(h=>fy({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(d)].sort((h,u)=>h-u)}}const py=(i,t)=>(i(),setInterval(i,t)),gy=35,Hd=1;class vy{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(gy,Math.max(this._autoplayDuration,1));let o=-n;this._interval=py(()=>U(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>Hd&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Hd)}}function Ay(i){const t=new vy({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=uy({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=my({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Zb({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Td({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=r1({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=$b({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=ci(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=ci(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Cr({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=Cr({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=ci(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return U(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===hn&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===li&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Ir({[hn]:()=>U(this,null,function*(){return a.showNextPage()}),[li]:()=>U(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return U(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(d,h,u){return U(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:Qi(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,d){return U(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,d){return U(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,d,h){return U(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Cr({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,d,h){return U(this,arguments,function*({methods:r},a,l){const u=r._getParticleIndexByPageIndex(a);yield r.showParticle(u,l)})},offsetPage({data:r},a){const l=Qi(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,o]=e;return[{data:n,progressManager:t},o,e._internal]}function by(i){me(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const yy=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Xd=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),wy=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Yd=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),Py=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Ud=i=>({loaded:i[6],currentPageIndex:i[5]}),Cy=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),qd=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Jd(i){let t;const e=i[37].prev,n=Nn(e,i,i[36],qd),o=n||Iy(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,Cy):Hn(s[36]),qd):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function Iy(i){let t,e,n;return e=new Ed({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Zd(i){let t,e,n;return e=new Lb({props:{value:i[7]}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Kd(i){let t;const e=i[37].next,n=Nn(e,i,i[36],Yd),o=n||Ey(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,wy):Hn(s[36]),Yd):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function Ey(i){let t,e,n;return e=new Ed({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function $d(i){let t;const e=i[37].dots,n=Nn(e,i,i[36],Xd),o=n||ky(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&Fn(n,e,s,s[36],t?Wn(e,s[36],r,yy):Hn(s[36]),Xd):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(k(o,s),t=!0)},o(s){M(o,s),t=!1},d(s){o&&o.d(s)}}}function ky(i){let t,e;return t=new Cb({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function xy(i){let t,e,n,o,s,r,a,l,c,d,h,u,m=i[1]&&Jd(i);const g=i[37].default,v=Nn(g,i,i[36],Ud);let A=i[3]&&Zd(i),b=i[1]&&Kd(i),y=i[4]&&$d(i);return{c(){t=V("div"),e=V("div"),m&&m.c(),n=se(),o=V("div"),s=V("div"),v&&v.c(),a=se(),A&&A.c(),l=se(),b&&b.c(),c=se(),y&&y.c(),w(s,"class","sc-carousel__pages-container svelte-sme1z4"),z(s,"transform","translateX("+i[8]+"px)"),z(s,"transition-duration",i[9]+"ms"),z(s,"transition-timing-function",i[0]),w(o,"class","sc-carousel__pages-window svelte-sme1z4"),w(e,"class","sc-carousel__content-container svelte-sme1z4"),w(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(C,D){O(C,t,D),Q(t,e),m&&m.m(e,null),Q(e,n),Q(e,o),Q(o,s),v&&v.m(s,null),i[39](s),Q(o,a),A&&A.m(o,null),i[40](o),Q(e,l),b&&b.m(e,null),Q(t,c),y&&y.m(t,null),d=!0,h||(u=[Wt(r=Qb.call(null,s,{thresholdProvider:i[38]})),ke(s,"swipeStart",i[16]),ke(s,"swipeMove",i[18]),ke(s,"swipeEnd",i[19]),ke(s,"swipeFailed",i[20]),ke(s,"swipeThresholdReached",i[17]),Wt(Wb.call(null,o)),ke(o,"hovered",i[21]),Wt(Ub.call(null,o)),ke(o,"tapped",i[22])],h=!0)},p(C,D){C[1]?m?(m.p(C,D),D[0]&2&&k(m,1)):(m=Jd(C),m.c(),k(m,1),m.m(e,n)):m&&(he(),M(m,1,1,()=>{m=null}),ue()),v&&v.p&&(!d||D[0]&96|D[1]&32)&&Fn(v,g,C,C[36],d?Wn(g,C[36],D,Py):Hn(C[36]),Ud),(!d||D[0]&256)&&z(s,"transform","translateX("+C[8]+"px)"),(!d||D[0]&512)&&z(s,"transition-duration",C[9]+"ms"),(!d||D[0]&1)&&z(s,"transition-timing-function",C[0]),r&&Gn(r.update)&&D[0]&2048&&r.update.call(null,{thresholdProvider:C[38]}),C[3]?A?(A.p(C,D),D[0]&8&&k(A,1)):(A=Zd(C),A.c(),k(A,1),A.m(o,null)):A&&(he(),M(A,1,1,()=>{A=null}),ue()),C[1]?b?(b.p(C,D),D[0]&2&&k(b,1)):(b=Kd(C),b.c(),k(b,1),b.m(e,null)):b&&(he(),M(b,1,1,()=>{b=null}),ue()),C[4]?y?(y.p(C,D),D[0]&16&&k(y,1)):(y=$d(C),y.c(),k(y,1),y.m(t,null)):y&&(he(),M(y,1,1,()=>{y=null}),ue())},i(C){d||(k(m),k(v,C),k(A),k(b),k(y),d=!0)},o(C){M(m),M(v,C),M(A),M(b),M(y),d=!1},d(C){C&&_(t),m&&m.d(),v&&v.d(C),i[39](null),A&&A.d(),i[40](null),b&&b.d(),y&&y.d(),h=!1,$e(u)}}}function Dy(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,d=1;const[{data:h,progressManager:u},m,g]=Ay((re,xe)=>{Ir({currentPageIndex:()=>e(5,r=xe),progressValue:()=>e(7,a=xe),offset:()=>e(8,l=xe),durationMs:()=>e(9,c=xe),pagesCount:()=>e(10,d=xe),loaded:()=>e(6,s=xe)})(re)}),v=Io();let{timingFunction:A="ease-in-out"}=t,{arrows:b=!0}=t,{infinite:y=!0}=t,{initialPageIndex:C=0}=t,{duration:D=500}=t,{autoplay:x=!1}=t,{autoplayDuration:I=3e3}=t,{autoplayDirection:T=hn}=t,{pauseOnFocus:S=!1}=t,{autoplayProgressVisible:H=!1}=t,{dots:X=!0}=t,{swiping:N=!0}=t,{particlesToShow:G=1}=t,{particlesToScroll:j=1}=t;function R(re,xe){return U(this,null,function*(){const Ne=Qi(xe,"animated",!0);if(typeof re!="number")throw new Error("pageIndex should be a number");yield m.showPage(re,{animated:Ne})})}function Z(re){return U(this,null,function*(){const xe=Qi(re,"animated",!0);yield m.showPrevPage({animated:xe})})}function q(re){return U(this,null,function*(){const xe=Qi(re,"animated",!0);yield m.showNextPage({animated:xe})})}let Y=0,K,ae;const oe=i1(({width:re})=>{e(11,Y=re),h.particleWidth=Y/h.particlesToShow,n1({particlesContainerChildren:ae.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function ye(){const{clonesToAppend:re,clonesToPrepend:xe}=o1({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:ae.children});s1({particlesContainer:ae,clonesToAppend:re,clonesToPrepend:xe})}kt(()=>{U(this,null,function*(){yield ll(),ae&&K&&(h.particlesCountWithoutClones=ae.children.length,yield ll(),h.infinite&&ye(),h.particlesCount=ae.children.length,m.showPage(C,{animated:!1}),oe.observe(K))})}),on(()=>{oe.disconnect(),u.reset()});function Pe(re){return U(this,null,function*(){yield m.showPage(re,{animated:!0})})}function Ae(){N&&(h.durationMs=0)}function _e(re){return U(this,null,function*(){N&&(yield Ir({[hn]:m.showNextPage,[li]:m.showPrevPage})(re.detail.direction))})}function be(re){N&&(h.offset+=re.detail.dx)}function Fe(){N&&m.showParticle(h.currentParticleIndex)}function fe(){return U(this,null,function*(){N&&(yield m.offsetPage({animated:!0}))})}function we(re){h.focused=re.detail.value}function Te(){m.toggleFocused()}function pe(){m.showPrevPage()}const Je=()=>Y/3;function dt(re){qe[re?"unshift":"push"](()=>{ae=re,e(13,ae)})}function De(re){qe[re?"unshift":"push"](()=>{K=re,e(12,K)})}const ot=re=>Pe(re.detail);return i.$$set=re=>{"timingFunction"in re&&e(0,A=re.timingFunction),"arrows"in re&&e(1,b=re.arrows),"infinite"in re&&e(2,y=re.infinite),"initialPageIndex"in re&&e(24,C=re.initialPageIndex),"duration"in re&&e(25,D=re.duration),"autoplay"in re&&e(26,x=re.autoplay),"autoplayDuration"in re&&e(27,I=re.autoplayDuration),"autoplayDirection"in re&&e(28,T=re.autoplayDirection),"pauseOnFocus"in re&&e(29,S=re.pauseOnFocus),"autoplayProgressVisible"in re&&e(3,H=re.autoplayProgressVisible),"dots"in re&&e(4,X=re.dots),"swiping"in re&&e(30,N=re.swiping),"particlesToShow"in re&&e(31,G=re.particlesToShow),"particlesToScroll"in re&&e(32,j=re.particlesToScroll),"$$scope"in re&&e(36,o=re.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&v("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=y),i.$$.dirty[0]&33554432&&(h.durationMsInit=D),i.$$.dirty[0]&67108864&&(h.autoplay=x),i.$$.dirty[0]&134217728&&(h.autoplayDuration=I),i.$$.dirty[0]&268435456&&(h.autoplayDirection=T),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=S),i.$$.dirty[1]&1&&(h.particlesToShowInit=G),i.$$.dirty[1]&2&&(h.particlesToScrollInit=j)},[A,b,y,H,X,r,s,a,l,c,d,Y,K,ae,m,Pe,Ae,_e,be,Fe,fe,we,Te,pe,C,D,x,I,T,S,N,G,j,R,Z,q,o,n,Je,dt,De,ot]}class Sy extends de{constructor(t){super(),ce(this,t,Dy,xy,le,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},by,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function Ly(i){me(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function eh(i){let t;function e(s,r){if(s[2].type==="Image")return Ty;if(s[2].type==="Video")return My}let n=e(i),o=n&&n(i);return{c(){t=V("div"),o&&o.c(),w(t,"class","media-item svelte-159ski6"),w(t,"draggable","false")},m(s,r){O(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&_(t),o&&o.d()}}}function My(i){let t,e,n,o,s,r;function a(d,h){return d[7]&&d[2].videoCoverUrl?jy:zy}let l=a(i),c=l(i);return{c(){c.c(),t=se(),e=V("div"),n=V("div"),o=V("div"),w(o,"class","video-icon-img svelte-159ski6"),z(o,"background-image","url("+i[20]()+")"),ee(o,"canPlay",i[5]),w(n,"class","video-icon svelte-159ski6"),ee(n,"large",i[4]==="large"),ee(n,"small",i[4]==="small"),w(e,"class","video-play-button-container svelte-159ski6"),ee(e,"showPlayButton",i[10])},m(d,h){c.m(d,h),O(d,t,h),O(d,e,h),Q(e,n),Q(n,o),s||(r=ke(o,"click",i[21]),s=!0)},p(d,h){l===(l=a(d))&&c?c.p(d,h):(c.d(1),c=l(d),c&&(c.c(),c.m(t.parentNode,t))),h&8&&z(o,"background-image","url("+d[20]()+")"),h&32&&ee(o,"canPlay",d[5]),h&16&&ee(n,"large",d[4]==="large"),h&16&&ee(n,"small",d[4]==="small"),h&1024&&ee(e,"showPlayButton",d[10])},d(d){c.d(d),d&&_(t),d&&_(e),s=!1,r()}}}function Ty(i){let t,e,n,o;return{c(){t=V("img"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].url)||w(t,"src",n),w(t,"alt",o=i[2].name),w(t,"draggable",!1)},m(s,r){O(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&w(t,"style",e),r&4&&!yt(t.src,n=s[2].url)&&w(t,"src",n),r&4&&o!==(o=s[2].name)&&w(t,"alt",o)},d(s){s&&_(t)}}}function zy(i){let t,e,n,o,s,r,a;return{c(){t=V("video"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||w(t,"src",n),w(t,"poster",o=i[2].videoCoverUrl),w(t,"preload",s=i[2].videoCoverUrl?"none":"auto"),w(t,"disablepictureinpicture",""),t.playsInline=!0,w(t,"paused",""),t.muted=!0,w(t,"draggable",!1),t.loop=!1,w(t,"crossorigin",""),t.controls=!1,ee(t,"showPlayButton",i[10])},m(l,c){O(l,t,c),i[19](t),r||(a=[ke(t,"play",i[14]),ke(t,"pause",i[15]),ke(t,"error",i[16]),ke(t,"ended",i[17]),ke(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&w(t,"style",e),c&4&&!yt(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&w(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&w(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&w(t,"preload",s),c&1024&&ee(t,"showPlayButton",l[10])},d(l){l&&_(t),i[19](null),r=!1,$e(a)}}}function jy(i){let t,e,n,o;return{c(){t=V("img"),w(t,"class","media-content svelte-159ski6"),w(t,"style",e=`object-fit: ${i[6]};`),yt(t.src,n=i[2].videoCoverUrl)||w(t,"src",n),w(t,"alt",o=i[2].name),w(t,"draggable",!1)},m(s,r){O(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&w(t,"style",e),r&4&&!yt(t.src,n=s[2].videoCoverUrl)&&w(t,"src",n),r&4&&o!==(o=s[2].name)&&w(t,"alt",o)},d(s){s&&_(t)}}}function _y(i){let t,e=i[2]&&eh(i);return{c(){e&&e.c(),t=Ee()},m(n,o){e&&e.m(n,o),O(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=eh(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:J,o:J,d(n){e&&e.d(n),n&&_(t)}}}function Vy(i,t,e){let n,o,{mediaInstance:s={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:d=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:u=!1}=t,m=!0,g=!1;function v(){e(8,g=(a==null?void 0:a.type)==="Video"&&!!a.videoCoverUrl)}const A=sn("mediaStore"),b=sn("hooks"),y=()=>{console.debug("loadPoster"),!g&&n&&(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0),console.debug("loadPoster end"))};b.on("loadVideoFirstFrame",y),kt(()=>{A.subscribe(({currentMediaElement:N})=>{N!==n&&(n==null||n.pause())})});const C=N=>{e(10,m=!1),e(0,s.paused=!1,s),e(8,g=!0),n&&A.set({currentMediaElement:n}),b.emit("playStateChange",{event:N,state:"playing",tag:r,mediaInstance:n})},D=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},x=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},I=N=>{e(10,m=!0),e(0,s.paused=!0,s),b.emit("playStateChange",{event:N,state:"paused",tag:r,mediaInstance:n})},T=N=>{n&&n.pause()};function S(N){qe[N?"unshift":"push"](()=>{s.videoInstance=N,e(0,s)})}const H=()=>l==="withText"?VA:l==="withoutText"?OA:l,X=N=>{d&&n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=N=>{"mediaInstance"in N&&e(0,s=N.mediaInstance),"tag"in N&&e(1,r=N.tag),"media"in N&&e(2,a=N.media),"playButtonIfNeed"in N&&e(3,l=N.playButtonIfNeed),"playButtonSizeIfNeed"in N&&e(4,c=N.playButtonSizeIfNeed),"canPlay"in N&&e(5,d=N.canPlay),"objectFit"in N&&e(6,h=N.objectFit),"disableVideoIfHavePoster"in N&&e(7,u=N.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=s.videoInstance),i.$$.dirty&4&&e(13,o=a==null?void 0:a.url),i.$$.dirty&8192&&o&&v(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const N=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,j=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&N;n&&j&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",y),document.removeEventListener("touchstart",y),document.removeEventListener("click",y),document.addEventListener("WeixinJSBridgeReady",y),document.addEventListener("touchstart",y),document.addEventListener("click",y))}},[s,r,a,l,c,d,h,u,g,n,m,A,b,o,C,D,x,I,T,S,H,X]}class th extends de{constructor(t){super(),ce(this,t,Vy,_y,le,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},Ly)}}function Oy(i){me(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function nh(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function ih(i){let t,e,n,o,s,r,a;const l=[Qy,By],c=[];function d(h,u){return h[13]&&h[10].length>1?0:1}return n=d(i),o=c[n]=l[n](i),{c(){t=V("div"),e=V("div"),o.c(),w(e,"class","media-list svelte-1mrbqlg"),ee(e,"carouselEnabled",i[13]),w(t,"class","media-list-wrapper svelte-1mrbqlg"),ee(t,"unfolded",i[5])},m(h,u){O(h,t,u),Q(t,e),c[n].m(e,null),a=!0},p(h,u){i=h;let m=n;n=d(i),n===m?c[n].p(i,u):(he(),M(c[m],1,1,()=>{c[m]=null}),ue(),o=c[n],o?o.p(i,u):(o=c[n]=l[n](i),o.c()),k(o,1),o.m(e,null)),(!a||u&8192)&&ee(e,"carouselEnabled",i[13]),(!a||u&32)&&ee(t,"unfolded",i[5])},i(h){a||(k(o),h&&et(()=>{a&&(r&&r.end(1),s=vn(t,Il,i[6]?{y:4,duration:i[4],delay:i[2],easing:tn}:void 0),s.start())}),a=!0)},o(h){M(o),s&&s.invalidate(),h&&(r=Zn(t,Il,i[6]?{y:4,duration:i[4],delay:i[3],easing:tn}:void 0)),a=!1},d(h){h&&_(t),c[n].d(),h&&r&&r.end()}}}function By(i){let t,e,n;const o=[{media:i[1][0]},i[7],{tag:i[0]}];function s(a){i[20](a)}let r={};for(let a=0;a<o.length;a+=1)r=Ue(r,o[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new th({props:r}),qe.push(()=>ml(t,"mediaInstance",s)),{c(){ie(t.$$.fragment)},m(a,l){te(t,a,l),n=!0},p(a,l){const c=l&131?tt(o,[l&2&&{media:a[1][0]},l&128&&fl(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],cl(()=>e=!1)),t.$set(c)},i(a){n||(k(t.$$.fragment,a),n=!0)},o(a){M(t.$$.fragment,a),n=!1},d(a){ne(t,a)}}}function Qy(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[Ry]},$$scope:{ctx:i}};return t=new Sy({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){ie(t.$$.fragment)},m(o,s){te(t,o,s),e=!0},p(o,s){const r={};s&268436865&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){M(t.$$.fragment,o),e=!1},d(o){i[18](null),ne(t,o)}}}function oh(i){let t,e,n;const o=[i[7],{media:i[25]},{tag:i[0]}];function s(a){i[17](a,i[27])}let r={};for(let a=0;a<o.length;a+=1)r=Ue(r,o[a]);return i[8][i[27]]!==void 0&&(r.mediaInstance=i[8][i[27]]),t=new th({props:r}),qe.push(()=>ml(t,"mediaInstance",s)),{c(){ie(t.$$.fragment)},m(a,l){te(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?tt(o,[l&128&&fl(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],cl(()=>e=!1)),t.$set(c)},i(a){n||(k(t.$$.fragment,a),n=!0)},o(a){M(t.$$.fragment,a),n=!1},d(a){ne(t,a)}}}function Ry(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=oh(nh(i,n,r));const s=r=>M(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=Ee()},m(r,a){for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(r,a);O(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=nh(r,n,l);o[l]?(o[l].p(c,a),k(o[l],1)):(o[l]=oh(c),o[l].c(),k(o[l],1),o[l].m(t.parentNode,t))}for(he(),l=n.length;l<o.length;l+=1)s(l);ue()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)k(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)M(o[a]);e=!1},d(r){Ft(o,r),r&&_(t)}}}function Gy(i){let t,e,n=i[5]&&ih(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&k(n,1)):(n=ih(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Ny(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:h=0}=t,{unfolded:u=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:v=!0}=t,{autoplayConfig:A={autoplay:!0,autoplayVideo:!1}}=t,b=[],y=0,C,D=null;const x=sn("hooks"),I=sn("mediaStore");function T(){const G=b[y],j=G==null?void 0:G.videoInstance;j&&(j.paused?(j.muted=!1,j.play()):j.pause())}kt(()=>{x.on("click",G=>{var j,R,Z;(Z=(R=(j=a.tag3DContentSvelte)==null?void 0:j.domContainer)==null?void 0:R.css3DObject)!=null&&Z.opacityMesh&&G.tag.id===a.id&&T()}),D=setInterval(()=>{r&&(C==null||C.goToNext())},3e3)}),on(()=>{clearInterval(D),x.off("click",T)});function S(G,j){i.$$.not_equal(b[j],G)&&(b[j]=G,e(8,b))}function H(G){qe[G?"unshift":"push"](()=>{C=G,e(12,C)})}const X=G=>{n||I.set({currentMediaElement:null}),e(11,y=G.detail)};function N(G){i.$$.not_equal(b[0],G)&&(b[0]=G,e(8,b))}return i.$$set=G=>{"tag"in G&&e(0,a=G.tag),"mediaData"in G&&e(1,l=G.mediaData),"inDelay"in G&&e(2,c=G.inDelay),"outDelay"in G&&e(3,d=G.outDelay),"duration"in G&&e(4,h=G.duration),"unfolded"in G&&e(5,u=G.unfolded),"animation"in G&&e(6,m=G.animation),"mediaItemConfig"in G&&e(7,g=G.mediaItemConfig),"enableCarousel"in G&&e(15,v=G.enableCarousel),"autoplayConfig"in G&&e(16,A=G.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=b.every(G=>G.paused)),i.$$.dirty&32770&&e(13,o=v&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&67072&&(r=s.length>1&&A.autoplay&&n)},[a,l,c,d,h,u,m,g,b,n,s,y,C,o,I,v,A,S,H,X,N]}class sh extends de{constructor(t){super(),ce(this,t,Ny,Gy,le,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},Oy)}}function Wy(i){me(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function rh(i){let t,e,n,o,s,r,a,l;t=new _t({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new pb({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&ah(i),d=i[1]&&lh(i);return{c(){ie(t.$$.fragment),e=se(),n=V("div"),ie(o.$$.fragment),s=se(),c&&c.c(),r=se(),d&&d.c(),a=Ee(),w(n,"class","line svelte-1f7m1lj")},m(h,u){te(t,h,u),O(h,e,u),O(h,n,u),te(o,n,null),O(h,s,u),c&&c.m(h,u),O(h,r,u),d&&d.m(h,u),O(h,a,u),l=!0},p(h,u){const m={};u&8&&(m.visible=h[3]),t.$set(m);const g={};u&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,u),u&4&&k(c,1)):(c=ah(h),c.c(),k(c,1),c.m(r.parentNode,r)):c&&(he(),M(c,1,1,()=>{c=null}),ue()),h[1]?d?(d.p(h,u),u&2&&k(d,1)):(d=lh(h),d.c(),k(d,1),d.m(a.parentNode,a)):d&&(he(),M(d,1,1,()=>{d=null}),ue())},i(h){l||(k(t.$$.fragment,h),k(o.$$.fragment,h),k(c),k(d),l=!0)},o(h){M(t.$$.fragment,h),M(o.$$.fragment,h),M(c),M(d),l=!1},d(h){ne(t,h),h&&_(e),h&&_(n),ne(o),h&&_(s),c&&c.d(h),h&&_(r),d&&d.d(h),h&&_(a)}}}function ah(i){let t,e,n;return e=new ud({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","text svelte-1f7m1lj")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function lh(i){let t,e,n;return e=new sh({props:{autoplayConfig:{autoplay:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function Fy(i){let t,e,n=i[0].state&&rh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=rh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Hy(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((d=o.length)!=null?d:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class Xy extends de{constructor(t){super(),ce(this,t,Hy,Fy,le,{tag:0},Wy)}}function Yy(i){me(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function ch(i,t,e){const n=i.slice();return n[0]=t[e],n}function dh(i,t,e){const n=i.slice();return n[0]=t[e],n}function hh(i){let t,e;return{c(){t=V("img"),w(t,"class","headerImage svelte-sezqcq"),yt(t.src,e=i[3].headerPictureUrl)||w(t,"src",e),w(t,"alt","")},m(n,o){O(n,t,o)},p(n,o){o&8&&!yt(t.src,e=n[3].headerPictureUrl)&&w(t,"src",e)},d(n){n&&_(t)}}}function uh(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=fh(dh(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=mh(ch(i,a,c));return{c(){t=V("div"),e=V("div");for(let c=0;c<r.length;c+=1)r[c].c();n=se();for(let c=0;c<l.length;c+=1)l[c].c();w(e,"class","tags svelte-sezqcq"),et(()=>i[11].call(e)),w(t,"class","tags-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),Q(t,e);for(let h=0;h<r.length;h+=1)r[h]&&r[h].m(e,null);Q(e,n);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(e,null);o=yo(e,i[11].bind(e))},p(c,d){if(d&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const u=dh(c,s,h);r[h]?r[h].p(u,d):(r[h]=fh(u),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(d&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const u=ch(c,a,h);l[h]?l[h].p(u,d):(l[h]=mh(u),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&_(t),Ft(r,c),Ft(l,c),o()}}}function fh(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Be(e),w(t,"class","tag primary-tag svelte-sezqcq"),z(t,"min-width",Lr)},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Re(n,e)},d(o){o&&_(t)}}}function mh(i){let t,e=i[0]+"",n;return{c(){t=V("div"),n=Be(e),w(t,"class","tag secondary-tag svelte-sezqcq"),z(t,"min-width",Lr)},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Re(n,e)},d(o){o&&_(t)}}}function ph(i){let t,e,n=i[7]&&gh(i),o=i[3].highlightText&&Ah(i);return{c(){t=V("div"),n&&n.c(),e=se(),o&&o.c(),w(t,"class","footer svelte-sezqcq")},m(s,r){O(s,t,r),n&&n.m(t,null),Q(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=gh(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Ah(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&_(t),n&&n.d(),o&&o.d()}}}function gh(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&vh(i);return{c(){t=V("div"),e=V("span"),o=Be(n),s=se(),r&&r.c(),w(e,"class","value svelte-sezqcq"),w(t,"class","price svelte-sezqcq")},m(a,l){O(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Re(o,n),a[3].price.unit?r?r.p(a,l):(r=vh(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&_(t),r&&r.d()}}}function vh(i){let t,e=i[3].price.unit+"",n;return{c(){t=V("span"),n=Be(e),w(t,"class","unit svelte-sezqcq")},m(o,s){O(o,t,s),Q(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Re(n,e)},d(o){o&&_(t)}}}function Ah(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=V("div"),e=V("div"),n=se(),o=V("span"),r=Be(s),a=se(),l=V("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',w(e,"class","gap svelte-sezqcq"),w(o,"class","text svelte-sezqcq"),w(t,"class","goto-button goto-icon svelte-sezqcq"),w(l,"class","arrow-wrapper svelte-sezqcq")},m(c,d){O(c,t,d),Q(t,e),Q(t,n),Q(t,o),Q(o,r),O(c,a,d),O(c,l,d)},p(c,d){d&8&&s!==(s=c[3].highlightText+"")&&Re(r,s)},d(c){c&&_(t),c&&_(a),c&&_(l)}}}function Uy(i){var D,x;let t,e,n,o,s,r,a,l,c,d,h=i[3].title+"",u,m,g,v,A;e=new _t({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let b=i[3].headerPictureUrl&&hh(i),y=((D=i[2].length)!=null?D:0)+((x=i[5].length)!=null?x:0)>0&&uh(i),C=(i[7]||i[3].highlightText)&&ph(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=se(),r=V("div"),b&&b.c(),a=se(),l=V("div"),c=V("div"),d=V("div"),u=Be(h),m=se(),y&&y.c(),g=se(),C&&C.c(),w(o,"class","line svelte-sezqcq"),z(o,"transition-delay",i[4]?os+"ms":ss+yh-bh-40+"ms"),w(d,"class","text svelte-sezqcq"),w(c,"class","title svelte-sezqcq"),w(l,"class","title-wrapper svelte-sezqcq"),w(r,"class","content svelte-sezqcq"),z(r,"max-width",Vt(i[9])),z(r,"transition-delay",i[4]?os+ss+"ms":"0ms"),w(t,"class",v=Oe(`marketing ${i[6]}`)+" svelte-sezqcq"),ee(t,"unfolded",i[4]),ee(t,"folded",i[8])},m(I,T){O(I,t,T),te(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),b&&b.m(r,null),Q(r,a),Q(r,l),Q(l,c),Q(c,d),Q(d,u),Q(r,m),y&&y.m(r,null),Q(r,g),C&&C.m(r,null),A=!0},p(I,[T]){var H,X;const S={};T&16&&(S.visible=I[4]),e.$set(S),T&16&&z(o,"transition-delay",I[4]?os+"ms":ss+yh-bh-40+"ms"),I[3].headerPictureUrl?b?b.p(I,T):(b=hh(I),b.c(),b.m(r,a)):b&&(b.d(1),b=null),(!A||T&8)&&h!==(h=I[3].title+"")&&Re(u,h),((H=I[2].length)!=null?H:0)+((X=I[5].length)!=null?X:0)>0?y?y.p(I,T):(y=uh(I),y.c(),y.m(r,g)):y&&(y.d(1),y=null),I[7]||I[3].highlightText?C?C.p(I,T):(C=ph(I),C.c(),C.m(r,null)):C&&(C.d(1),C=null),T&16&&z(r,"transition-delay",I[4]?os+ss+"ms":"0ms"),(!A||T&64&&v!==(v=Oe(`marketing ${I[6]}`)+" svelte-sezqcq"))&&w(t,"class",v),(!A||T&80)&&ee(t,"unfolded",I[4]),(!A||T&320)&&ee(t,"folded",I[8])},i(I){A||(k(e.$$.fragment,I),A=!0)},o(I){M(e.$$.fragment,I),A=!1},d(I){I&&_(t),ne(e),b&&b.d(),y&&y.d(),C&&C.d()}}}const Lr=40,os=400,bh=500,ss=180,yh=500;function qy(i,t,e){let n,o,s,r,a,l,c,d,{tag:h}=t,u,m=(()=>{var A;const v=(A=h.data.limitWidth)!=null?A:!0;if(typeof v=="number")return v;if(v===!0)return 172})();function g(){u=this.offsetHeight,e(1,u)}return i.$$set=v=>{"tag"in v&&e(0,h=v.tag)},i.$$.update=()=>{var v,A,b,y,C,D;i.$$.dirty&1&&e(4,n=(A=(v=h.state)==null?void 0:v.unfolded)!=null?A:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=Rn((b=s.price)==null?void 0:b.value)&&((y=s.price)==null?void 0:y.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&u>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((C=s.brandTags)==null?void 0:C.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,d=((D=s.tags)==null?void 0:D.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/Lr),[h,u,c,s,n,d,a,r,o,m,l,g]}class Jy extends de{constructor(t){super(),ce(this,t,qy,Uy,le,{tag:0},Yy)}}class Zy extends Audio{constructor(e){super();f(this,"sharedAudioSrc");f(this,"sharedAudioPaused",!0);f(this,"sharedAudioCurrentTime",0);f(this,"tryplaying",!1);f(this,"audioInstance");f(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return U(this,null,function*(){var n,o,s;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=pA(this.sharedAudioSrc,{namespace:vr.PlayAudio})),(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(s=this.currentTime)!=null?s:0;const e=this.audioInstance.currentTime!==this.currentTime;this.audioInstance.play().then(()=>{var r;this.audioInstance.muted=!1,e&&(this.audioInstance.currentTime=(r=this.currentTime)!=null?r:0),this.sharedAudioPaused=!1}).catch(r=>{var a;r.message==="The operation is not supported."?console.error("Error: 音频文件可能损坏或修改过文件后缀",r):console.error("Error: error playing media in Safari",r),this.endedHandler(),(a=this.onerror)==null||a.call(this,r)}).finally(()=>{this.tryplaying=!1})})}pause(e){var n;if(this.audioInstance&&!this.paused){if(this.sharedAudioPaused=!0,(n=this.eventListenerDisposer)==null||n.call(this),this.audioInstance.ended){this.endedHandler();return}this.audioInstance.paused||this.audioInstance.pause(),this.onpause(e!=null?e:new Event("pause")),this.clear()}}dispose(){var e;(e=this.eventListenerDisposer)==null||e.call(this),this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}endedHandler(e){var n,o;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(o=this.eventListenerDisposer)==null||o.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=u=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,u)},o=u=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,u))},s=u=>{this.pause(u)},r=u=>{this.endedHandler(u)},a=u=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,u)},l=u=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,u)},c=u=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,u)},d=u=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,u)},h=u=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,u)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",d),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",d),e.removeEventListener("loadedmetadata",h)}}}function Ky(i){me(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function $y(i){let t,e,n,o;const s=i[8].default,r=Nn(s,i,i[7],null);return{c(){t=V("div"),r&&r.c(),w(t,"class","audio svelte-13e7hxv"),w(t,"style",i[0])},m(a,l){O(a,t,l),r&&r.m(t,null),e=!0,n||(o=ke(t,"click",tl(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&Fn(r,s,a,a[7],e?Wn(s,a[7],l,null):Hn(a[7]),null),(!e||l&1)&&w(t,"style",a[0])},i(a){e||(k(r,a),e=!0)},o(a){M(r,a),e=!1},d(a){a&&_(t),r&&r.d(a),n=!1,o()}}}function ew(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Io(),d=sn("hooks"),h=sn("mediaStore");let u,m=!0;function g(){e(5,u.onplay=A=>{d.emit("playStateChange",W({event:A,state:"playing",mediaInstance:u},l)),c("play"),e(6,m=!1)},u),e(5,u.onpause=A=>{d.emit("playStateChange",W({event:A,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onended=A=>{d.emit("playStateChange",W({event:A,state:"paused",mediaInstance:u},l)),c("pause"),e(6,m=!0)},u),e(5,u.onloadedmetadata=A=>{typeof u.duration=="number"&&!Number.isNaN(u.duration)&&c("duration",u.duration)},u),e(5,u.onerror=A=>{c("pause"),e(6,m=!0)},u),e(5,u.ontimeupdate=A=>{c("timeupdate",u.currentTime)},u)}h.subscribe(({currentMediaElement:A})=>{A!==u&&(m||u==null||u.pause())});function v(A){u&&(d.emit("click",W({event:A,target:"AudioTagPlayIcon",audioInstance:u},l)),h.set({currentMediaElement:u}),d.emit("playStateChange",W({event:A,state:u.paused?"playing":"paused",mediaInstance:u},l)),u.paused?u.play():u.pause())}return i.$$set=A=>{"url"in A&&e(2,s=A.url),"enable"in A&&e(3,r=A.enable),"style"in A&&e(0,a=A.style),"hooksInfo"in A&&e(4,l=A.hooksInfo),"$$scope"in A&&e(7,o=A.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(u==null||u.dispose(),e(5,u=new Zy(s)),c("audioRef",u),setTimeout(()=>c("audioRef",u),200),g()),i.$$.dirty&40&&(r||u==null||u.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,v,s,r,l,u,m,o,n]}let wh=class extends de{constructor(t){super(),ce(this,t,ew,$y,le,{url:2,enable:3,style:0,hooksInfo:4},Ky)}};function tw(i){me(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Ph(i){let t,e;return t=new _t({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function nw(i){let t,e,n,o,s,r=i[1]&&Ph();return{c(){t=V("div"),r&&r.c(),e=se(),n=V("div"),o=V("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',w(o,"class","sound-wave__container svelte-srt2pi"),w(n,"class","audio-icon svelte-srt2pi"),ee(n,"playing",i[0]),w(t,"class","audio-icon__wrapper svelte-srt2pi"),w(t,"style",i[2]),z(t,"width",i[5]),z(t,"height",i[5])},m(a,l){O(a,t,l),r&&r.m(t,null),Q(t,e),Q(t,n),Q(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&k(r,1):(r=Ph(),r.c(),k(r,1),r.m(t,e)):r&&(he(),M(r,1,1,()=>{r=null}),ue()),(!s||l&1)&&ee(n,"playing",a[0]),(!s||l&4)&&w(t,"style",a[2]);const c=l&4;(c||l&36)&&z(t,"width",a[5]),(c||l&36)&&z(t,"height",a[5])},i(a){s||(k(r),s=!0)},o(a){M(r),s=!1},d(a){a&&_(t),r&&r.d(),i[7](null),i[8](null)}}}function iw(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function d(u){qe[u?"unshift":"push"](()=>{c=u,e(4,c)})}function h(u){qe[u?"unshift":"push"](()=>{l=u,e(3,l)})}return i.$$set=u=>{"playing"in u&&e(0,o=u.playing),"shadow"in u&&e(1,s=u.shadow),"style"in u&&e(2,r=u.style),"width"in u&&e(6,a=u.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?Vt(a):a)},[o,s,r,l,c,n,a,d,h]}class Ch extends de{constructor(t){super(),ce(this,t,iw,nw,le,{playing:0,shadow:1,style:2,width:6},tw)}}function ow(i){me(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Ih(i){var A,b;let t,e,n,o,s,r,a,l,c,d,h,u,m,g;e=new _t({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let v=i[6]&&Eh(i);return c=new gd({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new Ar({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((b=(A=i[5])==null?void 0:A.length)!=null?b:10,15),useLinearColor:!0}}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=V("div"),r=V("div"),v&&v.c(),a=se(),l=V("div"),ie(c.$$.fragment),d=se(),ie(h.$$.fragment),w(r,"class","audio-icon svelte-1s6gk4a"),z(l,"display","inline-block"),w(s,"class","wrapper svelte-1s6gk4a"),w(o,"class","content svelte-1s6gk4a"),w(t,"class","audio-tag svelte-1s6gk4a"),ee(t,"unfolded",i[6])},m(y,C){O(y,t,C),te(e,t,null),Q(t,n),Q(t,o),Q(o,s),Q(s,r),v&&v.m(r,null),Q(s,a),Q(s,l),te(c,l,null),Q(t,d),te(h,t,null),u=!0,m||(g=[ke(l,"click",i[7]),Wt($n.call(null,l)),ke(l,"clientWidth",i[12])],m=!0)},p(y,C){var T,S;const D={};C&64&&(D.visible=y[6]),C&8&&(D.left=y[3]/2+"px"),e.$set(D),y[6]?v?(v.p(y,C),C&64&&k(v,1)):(v=Eh(y),v.c(),k(v,1),v.m(r,null)):v&&(he(),M(v,1,1,()=>{v=null}),ue());const x={};C&64&&(x.visible=y[6]),C&2&&(x.textUnfolded=y[1]),C&32&&(x.content=y[5]),c.$set(x);const I={};C&64&&(I.unfolded=y[6]),C&8&&(I.length=y[3]),C&48&&(I.outDelay=y[4]+20*Math.min((S=(T=y[5])==null?void 0:T.length)!=null?S:10,15)),h.$set(I),(!u||C&64)&&ee(t,"unfolded",y[6])},i(y){u||(k(e.$$.fragment,y),k(v),k(c.$$.fragment,y),k(h.$$.fragment,y),u=!0)},o(y){M(e.$$.fragment,y),M(v),M(c.$$.fragment,y),M(h.$$.fragment,y),u=!1},d(y){y&&_(t),ne(e),v&&v.d(),ne(c),ne(h),m=!1,$e(g)}}}function Eh(i){let t,e,n,o,s,r,a;return e=new _t({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new wh({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[sw]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("error",i[10]),o.$on("audioRef",i[11]),{c(){t=V("div"),ie(e.$$.fragment),n=se(),ie(o.$$.fragment),w(t,"class","audio svelte-1s6gk4a")},m(l,c){O(l,t,c),te(e,t,null),Q(t,n),te(o,t,null),a=!0},p(l,c){i=l;const d={};c&64&&(d.enable=i[6]),c&1&&(d.url=i[0].data.audioUrl),c&1&&(d.hooksInfo={tag:i[0]}),c&8196&&(d.$$scope={dirty:c,ctx:i}),o.$set(d)},i(l){a||(k(e.$$.fragment,l),k(o.$$.fragment,l),l&&et(()=>{a&&(r&&r.end(1),s=vn(t,An,{duration:1e3,delay:0,easing:ti}),s.start())}),a=!0)},o(l){var c,d;M(e.$$.fragment,l),M(o.$$.fragment,l),s&&s.invalidate(),l&&(r=Zn(t,An,{duration:1e3,delay:20*Math.min((d=(c=i[5])==null?void 0:c.length)!=null?d:10,15),easing:ti})),a=!1},d(l){l&&_(t),ne(e),ne(o),l&&r&&r.end()}}}function sw(i){let t,e,n;return e=new Ch({props:{playing:i[2]}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){O(o,t,s),te(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(k(e.$$.fragment,o),n=!0)},o(o){M(e.$$.fragment,o),n=!1},d(o){o&&_(t),ne(e)}}}function rw(i){let t,e,n=i[0].state&&Ih(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=Ih(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function aw(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function d(){e(1,a=!a)}const h=()=>{e(2,l=!0)},u=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(A){Yn.call(this,i,A)}const v=A=>{e(3,c=A.detail)};return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,b,y;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(y=(b=r.data.title)!=null?b:r.data.text)!=null?y:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,d,h,u,m,g,v]}class lw extends de{constructor(t){super(),ce(this,t,aw,rw,le,{tag:0},ow)}}function cw(i){me(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function kh(i){let t,e,n,o;return n=new wh({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[hw]},$$scope:{ctx:i}}}),n.$on("play",i[6]),n.$on("pause",i[7]),n.$on("error",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=V("div"),e=V("div"),ie(n.$$.fragment),w(e,"class","audio-tag svelte-58hfjf"),z(e,"background-color",i[4].bgColor),z(e,"color",i[4].fontColor),w(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){O(s,t,r),Q(t,e),te(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8232&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&16&&z(e,"background-color",s[4].bgColor),r&16&&z(e,"color",s[4].fontColor)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){M(n.$$.fragment,s),o=!1},d(s){s&&_(t),ne(n)}}}function dw(i){let t;return{c(){t=Be(i[5])},m(e,n){O(e,t,n)},p(e,n){n&32&&Re(t,e[5])},d(e){e&&_(t)}}}function hw(i){let t,e,n,o,s,r,a;return n=new Ch({props:{playing:i[3]}}),r=new yr({props:{maxWidth:72,$$slots:{default:[dw]},$$scope:{ctx:i}}}),{c(){t=V("div"),e=V("div"),ie(n.$$.fragment),o=se(),s=V("div"),ie(r.$$.fragment),w(e,"class","audio-icon__wrapper svelte-58hfjf"),w(s,"class","text svelte-58hfjf"),w(t,"class","audio__inner svelte-58hfjf")},m(l,c){O(l,t,c),Q(t,e),te(n,e,null),Q(t,o),Q(t,s),te(r,s,null),a=!0},p(l,c){const d={};c&8&&(d.playing=l[3]),n.$set(d);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(k(n.$$.fragment,l),k(r.$$.fragment,l),a=!0)},o(l){M(n.$$.fragment,l),M(r.$$.fragment,l),a=!1},d(l){l&&_(t),ne(n),ne(r)}}}function uw(i){let t,e,n=i[0].state&&kh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&k(n,1)):(n=kh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function fw(i,t,e){let n,o,{tag:s}=t;const r={light:{bgColor:"rgba(255, 255, 255, 0.3)",fontColor:"rgba(0, 0, 0, 0.6)"},dark:{bgColor:"rgba(0, 0, 0, 0.3)",fontColor:"white"}};let a=0,l=0,c=!1;const d=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},u=()=>{e(3,c=!1)},m=A=>{e(1,a=A.detail)},g=A=>{e(2,l=A.detail)};function v(A){Yn.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,s=A.tag)},i.$$.update=()=>{var A,b,y;i.$$.dirty&1&&e(5,n=(b=(A=s.data.title)!=null?A:s.data.text)!=null?b:""),i.$$.dirty&1&&e(4,o=(y=r[s.data.theme||"light"])!=null?y:r.light)},[s,a,l,c,o,n,d,h,u,m,g,v]}class mw extends de{constructor(t){super(),ce(this,t,fw,uw,le,{tag:0},cw)}}function pw(i){let t,e;return t=new mw({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function gw(i){let t,e;return t=new lw({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function vw(i){let t,e,n,o;const s=[gw,pw],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=Ee()},m(l,c){~t&&r[t].m(l,c),O(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?~t&&r[t].p(l,c):(e&&(he(),M(r[d],1,1,()=>{r[d]=null}),ue()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(k(e),o=!0)},o(l){M(e),o=!1},d(l){~t&&r[t].d(l),l&&_(n)}}}function Aw(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class bw extends de{constructor(t){super(),ce(this,t,Aw,vw,le,{tag:0})}}function yw(i){me(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function xh(i){var o;let t,e,n;return e=new sh({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class","media-wrapper svelte-10cw0el")},m(s,r){O(s,t,r),te(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){M(e.$$.fragment,s),n=!1},d(s){s&&_(t),ne(e)}}}function ww(i){let t,e,n=i[0].state&&i[5]&&xh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&k(n,1)):(n=xh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function Pw(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=d=>{"tag"in d&&e(0,c=d.tag)},i.$$.update=()=>{var d,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class Cw extends de{constructor(t){super(),ce(this,t,Pw,ww,le,{tag:0},yw)}}function Dh(i){return U(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function Iw(i){return U(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Dh(t);return Ie(W({},i),{width:n/e,height:o/e})})}function Ew(i){return U(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Dh(e),a=s/n,l=r/n,c=a/t,d=l,h=1/o*t+"s";return Ie(W({},i),{width:c,height:d,duration:h})})}function kw(i){me(i,"svelte-316sq3","@keyframes svelte-316sq3-sprites-animation{0%{background-position:0 0}100%{background-position:100% 0}}.icon-image.svelte-316sq3{display:block;width:auto}.icon-keyframe.svelte-316sq3{background-repeat:no-repeat;background-size:auto 100%;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-316sq3-sprites-animation;animation-delay:0}")}function Sh(i){i[1]=i[19].width}function Lh(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function Mh(i){let t,e,n,o=i[0]&&Th();function s(l,c){return l[8]?Dw:xw}let r=s(i),a=r(i);return{c(){t=V("div"),o&&o.c(),e=se(),a.c(),w(t,"class","icon"),z(t,"width",i[1])},m(l,c){O(l,t,c),o&&o.m(t,null),Q(t,e),a.m(t,null),n=!0},p(l,c){l[0]?o?c&1&&k(o,1):(o=Th(),o.c(),k(o,1),o.m(t,e)):o&&(he(),M(o,1,1,()=>{o=null}),ue()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&z(t,"width",l[1])},i(l){n||(k(o),n=!0)},o(l){M(o),n=!1},d(l){l&&_(t),o&&o.d(),a.d()}}}function Th(i){let t,e;return t=new _t({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function xw(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Mw,then:Lw,catch:Sw,value:19};return xo(e=i[11](Ge({url:i[7],ratio:i[5]})),n),{c(){t=Ee(),n.block.c()},m(o,s){O(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Ge({url:i[7],ratio:i[5]})))&&xo(e,n)||ul(n,i,s)},d(o){o&&_(t),n.block.d(o),n.token=null,n=null}}}function Dw(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:jw,then:zw,catch:Tw,value:19};return xo(e=i[10](Ge({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=Ee(),n.block.c()},m(o,s){O(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Ge({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&xo(e,n)||ul(n,i,s)},d(o){o&&_(t),n.block.d(o),n.token=null,n=null}}}function Sw(i){return{c:J,m:J,p:J,d:J}}function Lw(i){Sh(i);let t,e;return{c(){t=V("img"),w(t,"alt","tag-icon"),w(t,"class","icon-image svelte-316sq3"),yt(t.src,e=i[7])||w(t,"src",e),z(t,"width",Vt(hi({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){O(n,t,o)},p(n,o){Sh(n),o&128&&!yt(t.src,e=n[7])&&w(t,"src",e),o&184&&z(t,"width",Vt(hi({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&_(t)}}}function Mw(i){return{c:J,m:J,p:J,d:J}}function Tw(i){return{c:J,m:J,p:J,d:J}}function zw(i){Lh(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=V("div"),w(t,"class","icon-keyframe svelte-316sq3"),z(t,"width",Vt(hi({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),z(t,"height",Vt(hi({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),z(t,"background-image",e),z(t,"animation-duration",i[18]),z(t,"animation-timing-function",n)},m(o,s){O(o,t,s)},p(o,s){Lh(o),s&252&&z(t,"width",Vt(hi({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&z(t,"height",Vt(hi({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&z(t,"background-image",e),s&228&&z(t,"animation-duration",o[18]),s&228&&n!==(n=`steps(${o[17]}, jump-none)`)&&z(t,"animation-timing-function",n)},d(o){o&&_(t)}}}function jw(i){return{c:J,m:J,p:J,d:J}}function _w(i){let t,e,n=i[9]&&Mh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&k(n,1)):(n=Mh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function hi(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:o}=i,s=(o!=null?o:t)*n,r=typeof e=="number"?s*(e/t):void 0;return Ie(W({},i),{width:s,height:r})}function Vw(i,t,e){let n,o,s,r,a,l,c,d,h,{width:u=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const v=Io();function A(C){return U(this,null,function*(){const D=yield Ew(C);return v("iconLoaded",D),D})}function b(C){return U(this,null,function*(){if(typeof h=="number")return Ie(W({},C),{width:h});const D=yield Iw(C);return v("iconLoaded",D),D})}function y(){d||v("iconLoaded")}return kt(()=>{y()}),i.$$set=C=>{"width"in C&&e(1,u=C.width),"icon"in C&&e(12,m=C.icon),"shadow"in C&&e(0,g=C.shadow)},i.$$.update=()=>{var C,D;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,o=(C=m==null?void 0:m.steps)!=null?C:1),i.$$.dirty&4096&&e(6,s=m==null?void 0:m.fps),i.$$.dirty&4096&&e(5,r=m==null?void 0:m.ratio),i.$$.dirty&4096&&e(4,a=(D=m==null?void 0:m.scale)!=null?D:1),i.$$.dirty&4096&&e(3,l=m==null?void 0:m.width),i.$$.dirty&252&&e(9,c=Ge({url:n,steps:o,fps:s,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,d=o>1),i.$$.dirty&2&&(h=u)},y(),[g,u,o,l,a,r,s,n,d,c,A,b,m]}class zh extends de{constructor(t){super(),ce(this,t,Vw,_w,le,{width:1,icon:12,shadow:0},kw)}}function Ow(i){me(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function jh(i){let t,e,n,o,s,r;return e=new _t({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=V("div"),ie(e.$$.fragment),n=se(),o=V("div"),s=Be(i[1]),w(o,"class","text svelte-e58ijk"),w(t,"class","text-wrapper svelte-e58ijk")},m(a,l){O(a,t,l),te(e,t,null),Q(t,n),Q(t,o),Q(o,s),r=!0},p(a,l){(!r||l&2)&&Re(s,a[1])},i(a){r||(k(e.$$.fragment,a),r=!0)},o(a){M(e.$$.fragment,a),r=!1},d(a){a&&_(t),ne(e)}}}function Bw(i){let t,e,n,o;e=new zh({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&jh(i);return{c(){t=V("div"),ie(e.$$.fragment),n=se(),s&&s.c(),w(t,"class","wrapper svelte-e58ijk")},m(r,a){O(r,t,a),te(e,t,null),Q(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&k(s,1)):(s=jh(r),s.c(),k(s,1),s.m(t,null)):s&&(he(),M(s,1,1,()=>{s=null}),ue())},i(r){o||(k(e.$$.fragment,r),k(s),o=!0)},o(r){M(e.$$.fragment,r),M(s),o=!1},d(r){r&&_(t),ne(e),s&&s.d()}}}function Qw(i,t,e){let n,o,s,{tag:r}=t;const a=()=>{e(2,n=!0)};return i.$$set=l=>{"tag"in l&&e(3,r=l.tag)},i.$$.update=()=>{var l,c,d;i.$$.dirty&8&&e(1,o=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,s=(d=r.data.icon)!=null?d:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[s,o,n,r,a]}class Rw extends de{constructor(t){super(),ce(this,t,Qw,Bw,le,{tag:3},Ow)}}function Gw(i){me(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function _h(i){let t,e=i[0].element+"",n;return{c(){t=new wo(!1),n=Ee(),t.a=n},m(o,s){t.m(e,o,s),O(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&_(n),o&&t.d()}}}function Nw(i){let t,e=typeof i[0].element=="string"&&_h(i);return{c(){t=V("div"),e&&e.c(),w(t,"class","customElement__container svelte-kzl2aj")},m(n,o){O(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=_h(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:J,o:J,d(n){n&&_(t),e&&e.d(),i[2](null)}}}function Ww(i,t,e){let{tag:n}=t,o,s;kt(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),on(()=>{s==null||s()});function r(a){qe[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class Fw extends de{constructor(t){super(),ce(this,t,Ww,Nw,le,{tag:0},Gw)}}function Hw(i){me(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function Xw(i){let t,e;return{c(){t=V("div"),w(t,"data-info","tag content is keep folded"),w(t,"data-id",e=i[1].id)},m(n,o){O(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&w(t,"data-id",e)},i:J,o:J,d(n){n&&_(t)}}}function Yw(i){let t,e,n,o,s,r,a,l,c,d;const h=[eP,$w,Kw,Zw,Jw,qw],u=[];function m(g,v){return g[1].contentType==="Text"?0:g[1].contentType==="ImageText"||g[1].contentType==="Image"||g[1].contentType==="Video"?1:g[1].contentType==="Audio"?2:g[1].contentType==="Marketing"?3:g[1].contentType==="Link"||g[1].contentType==="VRLink"||g[1].contentType==="PanoLink"||g[1].contentType==="Sticker"?4:g[1].contentType==="MediaPlane"||g[1].contentType==="MediaModel"?5:-1}return~(o=m(i))&&(s=u[o]=h[o](i)),{c(){var g;t=V("div"),e=V("div"),n=V("div"),s&&s.c(),w(n,"class","content svelte-1r4fqvg"),ee(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),w(e,"class","content__wrapper svelte-1r4fqvg"),w(t,"class",r=Oe(nt("content__container",i[1].className))+" svelte-1r4fqvg"),w(t,"data-id",a=i[1].id),ee(t,"disable",i[1].enabled===!1),ee(t,"hide",i[4]),ee(t,"withAnimation",i[0]),ee(t,"unClickable",i[1].mergedConfig.clickable===!1),z(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),z(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,v){O(g,t,v),Q(t,e),Q(e,n),~o&&u[o].m(n,null),l=!0,c||(d=ke(t,"click",tl(i[14])),c=!0)},p(g,v){var b;let A=o;o=m(g),o===A?~o&&u[o].p(g,v):(s&&(he(),M(u[A],1,1,()=>{u[A]=null}),ue()),~o?(s=u[o],s?s.p(g,v):(s=u[o]=h[o](g),s.c()),k(s,1),s.m(n,null)):s=null),(!l||v&2)&&ee(n,"unfolded",(b=g[1].state)==null?void 0:b.unfolded),(!l||v&2&&r!==(r=Oe(nt("content__container",g[1].className))+" svelte-1r4fqvg"))&&w(t,"class",r),(!l||v&2&&a!==(a=g[1].id))&&w(t,"data-id",a),(!l||v&2)&&ee(t,"disable",g[1].enabled===!1),(!l||v&18)&&ee(t,"hide",g[4]),(!l||v&3)&&ee(t,"withAnimation",g[0]),(!l||v&2)&&ee(t,"unClickable",g[1].mergedConfig.clickable===!1),v&2&&z(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),v&2&&z(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(k(s),l=!0)},o(g){M(s),l=!1},d(g){g&&_(t),~o&&u[o].d(),c=!1,d()}}}function Uw(i){let t,e,n,o,s,r,a;return e=new Fw({props:{tag:Ge(i[1])}}),{c(){t=V("div"),ie(e.$$.fragment),w(t,"class",n=Oe(nt("content__container",i[1].className))+" svelte-1r4fqvg"),w(t,"data-id",o=i[1].id),ee(t,"custom-tag-disable",i[1].enabled===!1),ee(t,"custom-tag-hide",i[4])},m(l,c){O(l,t,c),te(e,t,null),s=!0,r||(a=ke(t,"click",i[13]),r=!0)},p(l,c){const d={};c&2&&(d.tag=Ge(l[1])),e.$set(d),(!s||c&2&&n!==(n=Oe(nt("content__container",l[1].className))+" svelte-1r4fqvg"))&&w(t,"class",n),(!s||c&2&&o!==(o=l[1].id))&&w(t,"data-id",o),(!s||c&2)&&ee(t,"custom-tag-disable",l[1].enabled===!1),(!s||c&18)&&ee(t,"custom-tag-hide",l[4])},i(l){s||(k(e.$$.fragment,l),s=!0)},o(l){M(e.$$.fragment,l),s=!1},d(l){l&&_(t),ne(e),r=!1,a()}}}function qw(i){let t,e;return t=new Cw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Jw(i){let t,e;return t=new Rw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Zw(i){let t,e;return t=new Jy({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function Kw(i){let t,e;return t=new bw({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function $w(i){let t,e;return t=new Xy({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function eP(i){let t,e;return t=new hb({props:{tag:Ge(i[1])}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Ge(n[1])),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function tP(i){let t,e,n,o;const s=[Uw,Yw,Xw],r=[];function a(l,c){return l[1].element?0:l[3]?1:2}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=Ee()},m(l,c){r[t].m(l,c),O(l,n,c),o=!0},p(l,[c]){let d=t;t=a(l),t===d?r[t].p(l,c):(he(),M(r[d],1,1,()=>{r[d]=null}),ue(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),k(e,1),e.m(n.parentNode,n))},i(l){o||(k(e),o=!0)},o(l){M(e),o=!1},d(l){r[t].d(l),l&&_(n)}}}function nP(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:d}=t,{hooks:h}=t,{state:u}=t,{mediaStore:m}=t,{temporaryState:g}=t;Rs("hooks",h),Rs("mediaStore",m);let v,A;function b(x){x?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(x,I,T){var S,H;return!(!I.visible||!I.enabled||!T.visible||!((S=x.state)!=null&&S.visible)||((H=x.temporaryState)==null?void 0:H.visible)===!1||it(x)&&!x.mediaVisible)}const C=x=>h.emit("click",{event:x,target:"TagContent",tag:d}),D=x=>h.emit("click",{event:x,target:"TagContent",tag:d});return i.$$set=x=>{"withAnimation"in x&&e(0,c=x.withAnimation),"tag"in x&&e(1,d=x.tag),"hooks"in x&&e(2,h=x.hooks),"state"in x&&e(5,u=x.state),"mediaStore"in x&&e(6,m=x.mediaStore),"temporaryState"in x&&e(7,g=x.temporaryState)},i.$$.update=()=>{var x,I,T,S,H,X,N,G,j,R,Z;i.$$.dirty&2&&e(11,n=(x=d.state)==null?void 0:x.unfolded),i.$$.dirty&2&&e(10,o=(I=d.state)==null?void 0:I.visible),i.$$.dirty&162&&e(12,s=u.visible&&g.visible&&((T=d.state)==null?void 0:T.visible)),i.$$.dirty&2&&(r=d.id),i.$$.dirty&162&&e(4,a=!y(d,u,g)),i.$$.dirty&4096&&b(s),i.$$.dirty&3842&&d.hooks&&(n!==void 0&&n!==A&&(e(9,A=n),n?(H=(S=d.hooks).emit)==null||H.call(S,"unfolded"):(N=d==null?void 0:(X=d.hooks).emit)==null||N.call(X,"folded")),o!==void 0&&o!==v&&(e(8,v=o),o?(j=(G=d.hooks).emit)==null||j.call(G,"show"):(Z=(R=d.hooks).emit)==null||Z.call(R,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof d.mergedConfig.unfoldedConfig=="object"&&d.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,d,h,l,a,u,m,g,v,A,o,n,s,C,D]}let Vh=class extends de{constructor(t){super(),ce(this,t,nP,tP,le,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},Hw)}};function iP(i){me(i,"svelte-1jkrwn7",'@charset "UTF-8";.tag-point-click-helper.svelte-1jkrwn7.svelte-1jkrwn7{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-1jkrwn7.svelte-1jkrwn7{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-1jkrwn7.svelte-1jkrwn7,.tag-unfolded-point.svelte-1jkrwn7.svelte-1jkrwn7{transition:all 0.5s}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:1;scale:1}')}function oP(i){let t,e,n,o,s,r,a,l,c,d,h,u;return o=new _t({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new zh({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=V("div"),e=V("div"),n=se(),ie(o.$$.fragment),s=se(),r=V("div"),a=se(),l=V("div"),ie(c.$$.fragment),w(e,"class","tag-point-click-helper svelte-1jkrwn7"),w(r,"class","tag-unfolded-point svelte-1jkrwn7"),z(r,"transition-delay",(i[3]?i[5]:0)+"ms"),w(l,"class","tag-folded-point svelte-1jkrwn7"),z(l,"transition-delay",(i[3]?i[5]:0)+"ms"),w(t,"class","tag-point-wrapper svelte-1jkrwn7"),ee(t,"unfolded",i[0]),ee(t,"folded",i[3])},m(m,g){O(m,t,g),Q(t,e),Q(t,n),te(o,t,null),Q(t,s),Q(t,r),Q(t,a),Q(t,l),te(c,l,null),d=!0,h||(u=ke(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&z(r,"transition-delay",(m[3]?m[5]:0)+"ms");const v={};g&4&&(v.icon=m[2]),g&2&&(v.width=m[1]),c.$set(v),g&8&&z(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!d||g&1)&&ee(t,"unfolded",m[0]),(!d||g&8)&&ee(t,"folded",m[3])},i(m){d||(k(o.$$.fragment,m),k(c.$$.fragment,m),d=!0)},o(m){M(o.$$.fragment,m),M(c.$$.fragment,m),d=!1},d(m){m&&_(t),ne(o),ne(c),h=!1,u()}}}function sP(i,t,e){let n,o,s,r;const a=sn("hooks");let{tag:l}=t,c,d=!1;const h=()=>{l.style.point.enabled!==!1&&(c!==void 0&&clearTimeout(c),d=!0,c=setTimeout(()=>{d=!1},800))},u=v=>{l.style.point.enabled!==!1&&(d||a.emit("click",{event:v,target:"TagPoint",tag:l}))},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(v){Yn.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(6,l=v.tag)},i.$$.update=()=>{var v,A,b,y;i.$$.dirty&64&&e(0,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(b=(A=l.style)==null?void 0:A.point)!=null&&b.url?(y=l.style)==null?void 0:y.point:{url:BA}),i.$$.dirty&64&&e(1,r=(()=>{var x,I,T,S;const C=(I=(x=l.style)==null?void 0:x.point)==null?void 0:I.width;if(typeof C=="number")return C;const D=(S=(T=l.style)==null?void 0:T.point)==null?void 0:S.size;if(typeof D=="number")return D;if(D==="S")return 18;if(D==="M")return 20;if(D==="L")return 24;if(D==="XL")return 28})())},h(),[n,r,s,o,u,m,l,g]}class rP extends de{constructor(t){super(),ce(this,t,sP,oP,le,{tag:6},iP)}}function aP(i){me(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function lP(i){let t;return{c(){t=V("div"),w(t,"data-info","tag content is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&_(t)}}}function cP(i){let t,e;return t=new Vh({props:{mediaStore:i[2],withAnimation:i[0],tag:Ge(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Ge(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function dP(i){let t;return{c(){t=V("div"),w(t,"data-info","tag point is disable")},m(e,n){O(e,t,n)},p:J,i:J,o:J,d(e){e&&_(t)}}}function hP(i){let t,e;return t=new rP({props:{tag:i[1]}}),{c(){ie(t.$$.fragment)},m(n,o){te(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(k(t.$$.fragment,n),e=!0)},o(n){M(t.$$.fragment,n),e=!1},d(n){ne(t,n)}}}function uP(i){let t,e,n,o,s,r,a,l,c,d;const h=[cP,lP],u=[];function m(b,y){return b[12]?0:1}n=m(i),o=u[n]=h[n](i);const g=[hP,dP],v=[];function A(b,y){return b[13]?0:1}return r=A(i),a=v[r]=g[r](i),{c(){t=V("div"),e=V("div"),o.c(),s=se(),a.c(),w(e,"class",l=Oe(nt("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),w(e,"data-tag-unfolded",i[8]),w(e,"data-tag-id",i[11]),w(e,"data-content-type",c=i[1].contentType),z(e,"left",i[7]),z(e,"top",i[6]),z(e,"z-index",i[5]),w(t,"class","tag svelte-pzwdws"),w(t,"data-tag-id",i[11]),ee(t,"unClickable",i[1].mergedConfig.clickable===!1),ee(t,"disable",i[10]),ee(t,"hide",i[9]),ee(t,"withAnimation",i[0])},m(b,y){O(b,t,y),Q(t,e),u[n].m(e,null),Q(e,s),v[r].m(e,null),d=!0},p(b,[y]){let C=n;n=m(b),n===C?u[n].p(b,y):(he(),M(u[C],1,1,()=>{u[C]=null}),ue(),o=u[n],o?o.p(b,y):(o=u[n]=h[n](b),o.c()),k(o,1),o.m(e,s));let D=r;r=A(b),r===D?v[r].p(b,y):(he(),M(v[D],1,1,()=>{v[D]=null}),ue(),a=v[r],a?a.p(b,y):(a=v[r]=g[r](b),a.c()),k(a,1),a.m(e,null)),(!d||y&2&&l!==(l=Oe(nt("wrapper",b[1].className?`${b[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&w(e,"class",l),(!d||y&256)&&w(e,"data-tag-unfolded",b[8]),(!d||y&2048)&&w(e,"data-tag-id",b[11]),(!d||y&2&&c!==(c=b[1].contentType))&&w(e,"data-content-type",c),y&128&&z(e,"left",b[7]),y&64&&z(e,"top",b[6]),y&32&&z(e,"z-index",b[5]),(!d||y&2048)&&w(t,"data-tag-id",b[11]),(!d||y&2)&&ee(t,"unClickable",b[1].mergedConfig.clickable===!1),(!d||y&1024)&&ee(t,"disable",b[10]),(!d||y&512)&&ee(t,"hide",b[9]),(!d||y&1)&&ee(t,"withAnimation",b[0])},i(b){d||(k(o),k(a),d=!0)},o(b){M(o),M(a),d=!1},d(b){b&&_(t),u[n].d(),v[r].d()}}}function fP(i,t,e){let n,o,s,r,a,l,c,d,h,{withAnimation:u=!1}=t,{tag:m}=t,{mediaStore:g}=t,{state:v}=t,{temporaryState:A}=t;const b=sn("hooks");return i.$$set=y=>{"withAnimation"in y&&e(0,u=y.withAnimation),"tag"in y&&e(1,m=y.tag),"mediaStore"in y&&e(2,g=y.mediaStore),"state"in y&&e(3,v=y.state),"temporaryState"in y&&e(4,A=y.temporaryState)},i.$$.update=()=>{var y,C,D,x,I,T,S,H;i.$$.dirty&2&&e(13,n=(()=>{var X,N;return!(((N=(X=m.style)==null?void 0:X.point)==null?void 0:N.enabled)===!1||m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane")})()),i.$$.dirty&2&&e(12,o=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=m.id),i.$$.dirty&2&&e(10,r=!((y=m.pointTagStyle)!=null&&y.leftPercent)||!((C=m.pointTagStyle)!=null&&C.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(9,a=!((D=m.state)!=null&&D.visible)||((x=m.temporaryState)==null?void 0:x.visible)===!1),i.$$.dirty&2&&e(8,l=(I=m.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(7,c=((T=m.pointTagStyle)==null?void 0:T.leftPercent)+"%"),i.$$.dirty&2&&e(6,d=((S=m.pointTagStyle)==null?void 0:S.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(H=m.state)!=null&&H.unfolded?1:0)},[u,m,g,v,A,h,d,c,l,a,r,s,o,n,b]}class mP extends de{constructor(t){super(),ce(this,t,fP,uP,le,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},aP)}}function pP(i){me(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function Oh(i,t,e){const n=i.slice();return n[6]=t[e],n}function Bh(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Oh(i,s,a),c=r(l);n.set(c,e[a]=Qh(c,l))}return{c(){t=V("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","tag--container svelte-uq11d5"),ee(t,"hide",!i[3].visible||!i[4].visible),ee(t,"withAnimation",i[0])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],he(),e=xt(e,l,r,1,a,s,n,t,an,Qh,null,Oh),ue()),(!o||l&24)&&ee(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&ee(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)k(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)M(e[l]);o=!1},d(a){a&&_(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Qh(i,t){let e,n,o;return n=new mP({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=Ee(),ie(n.$$.fragment),this.first=e},m(s,r){O(s,e,r),te(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(k(n.$$.fragment,s),o=!0)},o(s){M(n.$$.fragment,s),o=!1},d(s){s&&_(e),ne(n,s)}}}function gP(i){let t,e,n=i[3].enabled&&Bh(i);return{c(){n&&n.c(),t=Ee()},m(o,s){n&&n.m(o,s),O(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&k(n,1)):(n=Bh(o),n.c(),k(n,1),n.m(t.parentNode,t)):n&&(he(),M(n,1,1,()=>{n=null}),ue())},i(o){e||(k(n),e=!0)},o(o){M(n),e=!1},d(o){n&&n.d(o),o&&_(t)}}}function vP(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Rs("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class AP extends de{constructor(t){super(),ce(this,t,vP,gP,le,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},pP)}}const bP=new Gt.GLTFLoader;function yP(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}bP.load(i,n,void 0,o)})}class Rh extends E.Mesh{constructor(e,n){super();f(this,"name","PanoTagPluginImagePlane");f(this,"imageSrc");this.imageSrc=e,Ro(e).then(o=>{const s=o.image.width,r=o.image.height,a=new E.MeshBasicMaterial({map:o,transparent:!0}),l=new E.PlaneGeometry(s,r);this.geometry=l,this.material=a;const c=n[0].distanceTo(n[1]),d=n[1].distanceTo(n[2]);this.scale.set(c/s,d/r,1);const h=s/r,u=c/d;h>u?this.scale.set(c/s,c/s,1):h<u?this.scale.set(d/r,d/r,1):this.scale.set(c/s,d/r,1)}).catch(o=>{console.error({e:o})})}setMatrixByCornerPoints(e){const n=new B.Vector3().subVectors(e[1],e[0]),o=new B.Vector3().subVectors(e[3],e[0]),s=xi(...e),r=new B.Vector3().crossVectors(n,o).normalize();this.lookAt(r);const a=this.up.clone().applyQuaternion(this.quaternion),l=o.clone(),c=new B.Vector3().crossVectors(a,l).normalize();this.rotateOnWorldAxis(c,a.angleTo(l)),this.position.copy(s)}}class wP extends PA{constructor(e){super(e);f(this,"group",new B.Group);f(this,"imagePlaneGroup",new B.Group);f(this,"gltfObjectGroup",new B.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>U(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=yP(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=this.getCurrentVisibleState(e),new B.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),s.visible=this.getVisibleByFloorIndex(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.imagePlane){const c=e.data.mediaPosition.map(It);e.imagePlane=new Rh(e.data.mediaData[0].url,e.data.mediaPosition.map(It));const d=new B.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.imagePlane.position.copy(d),s.add(e.imagePlane)}}else this.updateTagCss3DObjectMatrix(e,s);return this.gltfObjectGroup.add(s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}clearTags(){this.tags.forEach(e=>{var n,o;(o=(n=e.imagePlane)==null?void 0:n.parent)==null||o.remove(e.imagePlane)}),this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRender3DDomTag(),this.updateRenderModelTag(),this.updateRenderImagePlane()}updateRenderImagePlane(){this.sort(this.filterImagePlane).forEach(n=>{var r,a,l,c;const o=(r=n.data.mediaData[0])==null?void 0:r.url;if(!o||(n.imagePlane&&(n.imagePlane.visible=(l=(a=n.state)==null?void 0:a.visible)!=null?l:!0),((c=n.imagePlane)==null?void 0:c.imageSrc)===o))return;const s=n.position.map(It);n.imagePlane=new Rh(o,s),n.imagePlane.setMatrixByCornerPoints(s),this.imagePlaneGroup.add(n.imagePlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const d=new B.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(d)}return}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=_s(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const r=this.getPositions(n);if(!r)return;const a=this.getTagNormal(n);if(!a)return;const c=(s=this.getTagConfig(n).tag3DConfig)!=null?s:{};if(this.getRenderType(n)==="BehindDom"){c.mode="behind",c.container=document.createElement("div");const h="black";c.container.style.backgroundColor=h,c.container.style.border=`3px solid ${h}`,this.css3DRenderPlugin.hooks.on("render",()=>{var u;if(d.css3DObject.opacityMesh){const m=this.addObjectClickHandler(n,d.css3DObject.opacityMesh,g=>{this.hooks.emit("click",{event:g,target:"TagContent",tag:n})});(u=this.store.css3DRenderDisposer.get(n.id))==null||u.push(m)}})}const d=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!d)return;this.store.css3DRenderDisposer.set(n.id,[d.dispose]),n.tag3DContentSvelte={svelteApp:new Vh({target:d.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:d,initialNormal:a,currentNormal:a}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(it).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=this.getCurrentVisibleState(o)})})}updateTagModelVisible(){this.tags.forEach(e=>{var n;e.imagePlane&&(e.imagePlane.visible=this.getCurrentVisibleState(e)),(n=e.model)!=null&&n.object&&(e.model.object.visible=this.getCurrentVisibleState(e))})}updateTagCss3DObjectMatrix(e,n){var v,A,b,y;const o=(b=(A=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:A.ratio)!=null?b:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=it(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new B.Vector3().fromArray(r[0]),c=new B.Vector3().fromArray(r[2]),d=xi(l,c).add(new B.Vector3(0,0,5e-4)),h=new B.Matrix4().setPosition(d),u=new B.Matrix4().makeScale(o,o,o),m=new B.Matrix4().multiply(a).multiply(h).multiply(u);m.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return U(this,null,function*(){const n=e.filter(it).map(o=>this.loadModel(o));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag);if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new AP({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var o,s,r,a,l;(a=(s=(o=n.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null||a.setVisible((this.state.visible&&((r=n.state)==null?void 0:r.visible))!==!1),(l=n.tag3DContentSvelte)==null||l.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n.forEach(o=>o==null?void 0:o());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const Gh="Dnalogel-PanoTagPlugin",PP=i=>`${Gh}--${i}`;class rs extends wP{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>U(this,null,function*(){e.data=ct({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{it(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{it(e)&&(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});this.params=W({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,gA(1,{namespace:vr.PlayAudio});try{const o=window;Array.isArray(o.__PANOTAGPLUGIN_DEBUG_LIST__)||(o.__PANOTAGPLUGIN_DEBUG_LIST__=[]),o.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),o.__PANOTAGPLUGIN_DEBUG__=this}catch(o){}}load(e,n){return U(this,null,function*(){var s,r;this.clearTags(),console.info(Gh," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=ct({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{sA(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return U(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return Ie(W({},r),{state:W({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new ve.Subscribe,mergedConfig:a,unfold:()=>this.changeUnfoldedById(r.id,!0),fold:()=>this.changeUnfoldedById(r.id,!1),enable:()=>this.changeEnabledById(r.id,!0),disable:()=>this.changeEnabledById(r.id,!1),destroy:()=>this.destroyTagById(r.id)})}).filter(r=>r.position);return s.forEach(mA),this.tags.push(...s),dA(this.five).then(()=>U(this,null,function*(){var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),yield this.addMediaModelTag(s)}))})}changeConfig(e,n=!0){n?this.config=ct({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=ct({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=ct({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache(),this.updateRenderAllTags()}show(e){return U(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return U(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){if(this.checkDisposed())return;const{userAction:n=!0}=e!=null?e:{};this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}setState(e,n){if(this.checkDisposed())return;const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=W({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filterCSS3DTag.forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}changeUnfoldedById(e,n){var a;const o=this.getTagById(e);if(!o)return;const s=this.can("fold",o),r=this.can("unfold",o);if(s&&r){o.state.unfolded=n;const l=this.filterPointTag;(a=this.TagContainerSvelte)==null||a.$set({tags:l})}else console.warn(`tag ${e} cannot be ${n?"unfolded":"folded"}`)}changeEnabledById(e,n){const o=this.getTagById(e);o&&(o.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const o=this.getTagById(e);o&&o.tag3DContentSvelte&&(o.tag3DContentSvelte.currentNormal=It(n))}changeDataById(e,n,o=!0){const s=this.getTagById(e);s&&(o?s.data=ct({},s.data,n):s.data=W(W({},s.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);n&&(o?ct(s,n):Object.assign(s,n),s!=null&&s.tag3DContentSvelte&&(n!=null&&n.normal)&&(s.tag3DContentSvelte.currentNormal=It(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return U(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(this.isPanorama)return this.setVisible(),e?new Promise(n=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.updateTagContainerVisible(),this.updateTagModelVisible(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.updateRenderAllTags(),this.five.needsRender=!0}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),d=this.clickhandler.bind(this),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{this.state.enabled&&(this.show(),this.updateRenderAllTags())},o=()=>{this.state.enabled&&this.hide()},{observe:s,unobserve:r}=sd(uA(()=>{this.store.resizeObserverDisposer&&o()},500),e),{observe:a,unobserve:l}=sd(od(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{it(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=Ie(W({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=Ie(W({},e.temporaryState),{visible:!!n.visibleConfig.alwaysShowWhenMovePano}))}),this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return od(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return U(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=Ie(W({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);n.state&&o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var o,s,r,a,l,c;((o=this.getTagConfig(e))==null?void 0:o.renderType)!=="Mesh"&&((a=(r=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer)==null?void 0:r.css3DObject)==null?void 0:a.mode)!==n&&((l=e.config)!=null&&l.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(c=this.store.css3DRenderDisposer.get(e.id))==null||c.forEach(d=>d==null?void 0:d()),e.tag3DContentSvelte=void 0)}}var Nh=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(Nh||{}),Wh=(i=>(i.Two="2D",i.Three="3D",i))(Wh||{});const CP=(i,t)=>new rs(i,t);function IP(i){me(i,"svelte-1i0lthz",".guide-line__tag.svelte-1i0lthz{position:relative}.guide-line__tag-point.svelte-1i0lthz{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-1i0lthz{position:absolute;left:50%;bottom:0.0625rem;width:0.125rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-1i0lthz{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-1i0lthz{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-1i0lthz{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-source:url('https://vrlab-static.ljcdn.com/release/web/jsl/test2.2ea9ddee.png');border-image-slice:6 25 6 18 fill;color:#fff}")}function EP(i){let t,e,n,o,s,r,a,l,c,d;return{c(){t=V("div"),e=V("div"),n=se(),o=V("div"),s=se(),r=V("div"),a=V("div"),l=se(),c=V("div"),d=Be(i[0]),w(e,"class","guide-line__tag-point svelte-1i0lthz"),w(o,"class","guide-line__tag-line svelte-1i0lthz"),w(a,"class","guide-line__tag-icon svelte-1i0lthz"),z(a,"background-image",`url(${i[1]})`),w(c,"class","guide-line__tag-text svelte-1i0lthz"),z(c,"border-image-source",`url(${i[2]})`),w(r,"class","guide-line__tag-content svelte-1i0lthz"),w(t,"class","guide-line__tag svelte-1i0lthz")},m(h,u){O(h,t,u),Q(t,e),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,l),Q(r,c),Q(c,d)},p(h,[u]){u&2&&z(a,"background-image",`url(${h[1]})`),u&1&&Re(d,h[0])},i:J,o:J,d(h){h&&_(t)}}}function kP(i,t,e){let{text:n=""}=t,{icon_url:o=""}=t;const s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uLifn5/Dw8O6urqQkJC6urro6Ojt7e3o6OjU1NS3t7fBwcGjo6Ozs7Orq6u1tbXAwMCurq6rq6vy8vLx8fHr6+vp6enZ2dnd3d3a2trX19fV1dW/v7/IyMihoaGampqVlZWLi4uCgoK+vr6urq7m5ubw8PDk5OTu7u7i4uLg4ODe3t7q6urS0tLi4uLOzs7e3t7Hx8fa2tqrq6vExMTAwMCnp6efn5+WlpaHh4ezs7OoqKiJiYm6urqZmZmurq59fX29vb23t7e4uLipqanp6enc3Nza2trW1tbT09Pm5ubj4+PQ0NDg4ODExMTCwsK7u7vBwcG8vLy5ubm8vLy+vr64uLiysrKdnZ3CwsJoaGisrKzHx8ekpKTExMTv7+/i4uLa2trm5ubk5OTLy8vKysrExMTQ0NDX19ecnJzT09N/f3+dnZ12dnaQkJCXl5etra3Pz8+4uLiXl5fGxsaqqqrr6+vQ0NDKysrNzc3W1takpKShoaGsrKysrKyduRZkAAAAsHRSTlMATE1NTExMTUxNTExMTExNTExMTU1MTU1MTICFc313fnl0iIWAe3h3aYqIgXx7eXZzcnFwaGggxLiog4J0dG9mZF82FMfEtK2pkYqKh3x4cm1rZmEmH8G/vry6trOxoZ2clpKOe3ptbWZjYmFgXFpaVlFPSDYlx7CspaSjoJ6akY6HfXt4bGpmY1xUU0g2LSzCuK6lopiWhoF3YmFaVlZUUU5KPyEJCcl/fXNdXFxZUIUrIQsAAAV6SURBVFjDvZj3VxNBEMePBBIOQgmEQGghISSASSBBUQFBVIpUEaR3aVJExN4F6fbee6//opPN2507E3P7fD4+b54z+935zt7lvPsBYbZ5lyXT7R5xms2ppaVpV615eVeuXL48PPzw4YPBwYsX+/vPnT1bW1t75u7p0729PT13urs7O9vbt2/ffurUp1OQ2ts7O7u77/T09PaevnvmTG3t2XPn+vsvDg4+GH5UVjl/SAjGe29La2vr5EFgm4+WlpYDgNfrbW7etQuuKDPTPTIy4nSa4bJ8lKYBV69arXmA1WpN81FamgqYzU6n0+12ZwI+qzPtyvDlR0dPCoGsecW4FEZcShwEyUDIGvtD+DcOZlrzFvcE3qylFXZ1cTqIgGk0K1xRSL84abaWtwl/8KM5kTiok04B2BpAPUWXAoGnQK3gn0xNW90ryDhpafXvJsYlJuoSdRCyTJHqBOxR9IvbUl1/PN5pL9tFR4gTJJmi7N+wl8qf7k33S+YQE0VRJwZz42RogDZcAxx+sTn1jSDho6VFBKAbp9K1XqfXi3oRgmSqQ2AGePziNpfs2GN2lV5Pp+IJkkwIrDFz+Y+Y90h/Yvtz+f0o1YGnc/lVXvshASk8IHUm6ZMIYhI6YAEyqyHkE/n8Kkuh5AX6ZVdBlypJpRJVIgTJ0IluEGCb1BDYCzWFx79h/yl5ZV3PVUSVAQIDFhCyLO/h9E9KfuOPriOqzUFjmRYYueOqTWLGfhPfHZcGrkOlgcAGskZdAV7/eIVA2eN6qZGA3Yhcxxozn3+mkD3ZQ64Z3EnQJEBouMB+Xr+68LpAuTZBOokDoPXfNIK85vZP5AqUreNqdYI6AUINkBrAtUatgaA67mEft38GvxRThWopOAFrBbj9kYXsa3z0mnrTsLAHe3yRzxGhjoBQ0BT848foqfONkT6FAAWrce3PeEpA5vZPsDf23aIhgpfIiEiIiH/mKftPfKJxTjaNv8bM6zlSzk5dmIsMDk7EGrMEbj+e+q5xLjoyOrQbGiCCaZh5/PgLzy8YiIrgNPmaZtQovP6J3ezNafTvxEfHQ2An8v/2K47hV4J0ExVBDbNCD4e/nH0lKj1+1RBvMEQboiEMUJI1BOmmGq0pVOP1z3nYF3G53EAIN4SHx4djNyxAkutQA1QnGeD2z3rY199RIZ+EtVxDPaDm9VdspYcWj65pteFaonIDBghpzeXyzNNTbyy8CpgCyCehjnvYx+uf9RTTU9cbo7SbRPmKQBnzaKMI2igthD8jVAvIuM/rXytjfyz4MFqBDgLWPGuA05/sqRQobaOzsBMbFQsRhaAWco/A6Z92FAuU446wWL+aHJWcHJtMOzEDwWrU+PyvHEcFRlkutELInT4NFiCRGqA6yQDWfH5jWdFegXLL8V3qDIsNIySHoRsWIGMN/wBY8/mXRosFxrrDCE20EwJzCGQ9XP7crBN46AdHbthmkPvluICccLzgchnDjBD/eqaxKOOtIKGyiEzDqSFOCt7D4X/dlHFDkNCWPu3fjTHGQBgpbI06TkeIpuQ37bbltAlSKstM/g6EdYcEr0jJv2rLfrZXkFKcPhVjMsWY0GGSrTn00H7TakbD11sChd7qa+gCSKdJVitpyvWLlab6uifsieKtLk1N7QZWtvpYXl4aGxsrAtIJBQVNWVlZOTkZGRm2z7bHW0q2lJRkZ2c3NOTn19fV19fn5zfAsmQL8Nhmg66cHOhvKigoSC/Iysk+vH9//jd2n8g6TG7yjbXZYCAMq6s7fBiah4aGLl0aGLhw4f758zuBmpq+vurq6h07dnR1dXTcrqqq2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return i.$$set=r=>{"text"in r&&e(0,n=r.text),"icon_url"in r&&e(1,o=r.icon_url)},[n,o,s]}class xP extends de{constructor(t){super(),ce(this,t,kP,EP,le,{text:0,icon_url:1},IP)}}function DP(i){return i.length===0?[]:i.filter((t,e)=>t!==i[e-1])}const SP=`
569
569
  varying vec2 vUv;
570
570
 
571
571
  void main() {
@@ -583,6 +583,10 @@ void main() {
583
583
  uniform float mapOpacity;
584
584
  // 背景颜色
585
585
  uniform vec3 backgroundColor;
586
+ // 边框颜色
587
+ uniform vec3 borderColor;
588
+ // 边框透明度
589
+ uniform float borderOpacity;
586
590
  // 背景透明度
587
591
  uniform float backgroundOpacity;
588
592
  // 整体透明度
@@ -597,7 +601,7 @@ void main() {
597
601
  varying vec2 vUv;
598
602
 
599
603
  // 获取纹理颜色
600
- vec4 getTextureColor() {
604
+ vec4 getImage() {
601
605
  vec2 uv = vUv;
602
606
  uv.y = uv.y - vOffset;
603
607
  // 原始贴图颜色
@@ -613,30 +617,42 @@ void main() {
613
617
 
614
618
  // 获取线性渐变的透明度
615
619
  float linearGradientOpacity() {
616
- // 当前的 u
617
- float u = vUv.y;
620
+ // 当前的 v
621
+ float v = vUv.y;
618
622
  float gradientLength = 1.0;
619
- if (u <= gradientLength) {
620
- return u / gradientLength; // 在 [0, gradientLength] 范围内,透明度为 [0, 1]
621
- } else if (u <= maxU - gradientLength) {
623
+ if (v <= gradientLength) {
624
+ return v / gradientLength; // 在 [0, gradientLength] 范围内,透明度为 [0, 1]
625
+ } else if (v <= maxU - gradientLength) {
622
626
  return 1.0; // 在 (gradientLength, maxU - gradientLength) 范围内,透明度为 1
623
627
  } else {
624
- return (maxU - u) / gradientLength; // 在 [maxU - gradientLength, maxU] 范围内,透明度为 [1, 0]
628
+ return (maxU - v) / gradientLength; // 在 [maxU - gradientLength, maxU] 范围内,透明度为 [1, 0]
625
629
  }
626
630
  }
627
631
 
632
+ vec4 getBorder() {
633
+ float u = vUv.x;
634
+ float borderSize = 0.05;
635
+ if (u <= borderSize || u >= 1.0 - borderSize) {
636
+ return vec4(borderColor, borderOpacity);
637
+ }
638
+ return vec4(0.0, 0.0, 0.0, 0.0);
639
+ }
640
+
628
641
  void main() {
629
- vec4 image = getTextureColor();
642
+ vec4 image = getImage();
643
+ vec4 border = getBorder();
630
644
  // 设置背景颜色
631
645
  gl_FragColor = vec4(backgroundColor, backgroundOpacity);
632
646
  // 混合颜色和背景
633
647
  gl_FragColor = mix(gl_FragColor, image, image.a);
648
+ // 混合边框
649
+ gl_FragColor = mix(gl_FragColor, border, border.a);
634
650
  // 设置整体透明度
635
651
  gl_FragColor.a = gl_FragColor.a * opacity;
636
652
  gl_FragColor.a = gl_FragColor.a * linearGradientOpacity();
637
653
  gl_FragColor.a = gl_FragColor.a * flicker;
638
654
  }
639
- `;class Mr{constructor(t,e){f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_panoGroup",null);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"visible",!1);f(this,"modeVisible",!1);f(this,"defaultVisible",!0);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new po({progress:0}).to({progress:1}).duration(5e3).repeat(1/0));f(this,"flickerAnime",zs(300).yoyo(!0).repeat(5));f(this,"dispose",()=>{this.disposed||(this.disposed=!0,this.five.off("modeChange",this.onFiveModeChange),this.plugin.hooks.off("show",this.onPluginShow),this.plugin.hooks.off("hide",this.onPluginHide),this.plugin.hooks.off("enable",this.onPluginEnable),this.plugin.hooks.off("disable",this.onPluginDisable),this.doHide())});f(this,"onTagContainerChange",(t,e)=>new xP({target:t,intro:!0,props:e.data}).$destroy);f(this,"onPluginShow",()=>{this.updateVisible()});f(this,"onPluginHide",()=>{this.updateVisible()});f(this,"onPluginEnable",()=>{this.updateVisible()});f(this,"onPluginDisable",()=>{this.updateVisible()});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ms(t):Qa(t),this.updateVisible()});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.flicker.value=1-e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"logWarning",t=>Ov("GuideLineModeItem: ",t));f(this,"logError",t=>ed("GuideLineModeItem: ",t));this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new rs(this.five)},this.endTagContainer={tag:null,plugin:new rs(this.five)};const n=new E.BufferGeometry,o=new E.ShaderMaterial({vertexShader:SP,fragmentShader:LP,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new E.Mesh(n,o),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.plugin.hooks.on("show",this.onPluginShow),this.plugin.hooks.on("hide",this.onPluginHide),this.plugin.hooks.on("enable",this.onPluginEnable),this.plugin.hooks.on("disable",this.onPluginDisable),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.onFiveModeChange(this.five.getCurrentState().mode)}get panoGroup(){return this._panoGroup}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=DP(t);if(this._panoGroup=n,(e==null?void 0:e.skipPanoGroup)!==void 0){const s=e.skipPanoGroup?n.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=s}const o=this.getPathFromPanoGroup(n,this.five.work,e);this.path=o,this.setGeometryByPath(o,e)}setGeometryByPath(t,e){var l,c,d;if(this.disposed)return this.logError("disposed");const n=(l=e==null?void 0:e.scale)!=null?l:this.scale,o=(c=e==null?void 0:e.width)!=null?c:this.width,s=(d=e==null?void 0:e.unit_length)!=null?d:this.unitLength;this.path=t,this.scale=n,this.width=o,this.unitLength=s;const{geometry:r,maxU:a}=nA({path:t,width:o*n,unitLength:s*n,skipPositions:this.skippedPositions});this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniforms.mapColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Ro(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}setTag(t,e){const o=it({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"]}},style:{point:{enabled:!1}},data:{}},e),s=t==="start"?this.startTagContainer:this.endTagContainer;s.tag=o,MP(o)&&(s.tag.element=r=>this.onTagContainerChange(r,o)),s.plugin.load({tagList:[s.tag]})}updateVisible(){const t=(()=>!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){if(t.length<2)return[];const s=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[W({type:"CatmullRomCurve3",points:s},n)]}}function MP(i){return i.contentType==="Custom"}const TP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:Mr},Symbol.toStringTag,{value:"Module"}));function Fh(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function zP(i,t){const e=Fh(i),n=Fh(t);return e.angleTo(n)}const jP=i=>U(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),as=Math.PI*2;function _P(i){return i>=0&&i<as?i:(i%as+as)%as}function VP(i){return{longitude:_P(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function OP(i,t,e,n){const o=-i/e,s=i;return o*n+s}function BP(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Hh="v1.0.6",Xh="CruisePlugin",ls=`${Xh}@${Hh}`,Yh=()=>{console.error(`${ls} is disposed`)},QP=()=>{console.warn(`${ls} is disabled`)},RP=()=>{console.error(`${ls} is disabled`)},Tr=new Map;class Gi extends bn{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Xh}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return U(this,null,function*(){var d,h,u,m,g,v;if(this.state.disposed)return Yh();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);c.filter((A,b)=>{var y;return A.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var y,C;const b=(y=this.five.work.observers[A])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const D=a.length-1;a[D]=[...(C=a[D])!=null?C:[],A]}else{l=b;const D=a.length;a[D]=[A]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Zh(this.five,this.config)),console.log("🐶 ==> data.guildPluginOptions:",r.guildPluginOptions),(v=this.GuideLine)==null||v.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${ls} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(Ie(W({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return Yh();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return RP();const o=W({},this.state);this.state=W(W({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),zt(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return U(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:ut(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return Ie(W({id:(c=s.uuid)!=null?c:ut(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,d)=>{const h=(()=>{var A,b,y,C;const u=o.panoIndexList.slice(d).find(D=>D!==c);if(u===void 0)return;const m=(A=n[c])==null?void 0:A.position,g=(b=n[u])==null?void 0:b.position;if(!g||!m||((y=n[c])==null?void 0:y.floorIndex)!==((C=n[u])==null?void 0:C.floorIndex))return;const v=new E.Vector3().subVectors(g,m);return VP(v.normalize())})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:W({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:d,stay:o.stay,data:W({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:ut(),keyframes:s.map((c,d)=>W({id:ut(),index:d},c)),guildPluginOptions:o.guildPluginOptions,useGuildLine:o.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return U(this,null,function*(){var m;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=ut();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>U(this,null,function*(){var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(v=this.data)==null?void 0:v.keyframes.find(b=>b.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const b=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:b}),d=!0,A.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield BP(g.stay)),d===!1&&(d=!0)}catch(v){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return U(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return U(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(d);break;case"Rotate":this.rotate(s,n).then(d);break;default:this.rotate(s,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return U(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return U(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return U(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return U(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,u=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return zP(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{jP(()=>s.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,n){return U(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=n==null?void 0:n.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return U(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Tr.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Tr.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Tr.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&QP()}waitFiveLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-OP(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Gi,"PluginVersion",Hh);const GP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),NP=i=>new Gi(i);class Uh{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new ve.Subscribe);f(this,"plugin");f(this,"five");f(this,"logError",t=>ed("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new Mr(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new Mr(this.five,{mode:"model",plugin:this.plugin,parent:this})}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){const n=t==="panorama"?this.panoramaItem:this.modelItem,o=t==="panorama"?e.panorama_style:e.model_style,s=e.path,r={url:this.plugin.staticPrefix+"/release/web/arrow6.b6ce0c62.png"},a=o,l=it({texture:r},o);if(e.pano_group){const c=t==="panorama";n.setGeometryByPanoGroup(e.pano_group,W({skipPanoGroup:c},a))}else e.path&&n.setGeometryByPath(s,a);n.setMartial(l),o!=null&&o.start_tag&&n.setStartTag(o.start_tag),o!=null&&o.end_tag&&n.setEndTag(o.end_tag)}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return U(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=W({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[n]=yield ei(WP(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),n)return this.logError(n.message)})}}function WP(i,t){return U(this,null,function*(){if(t.panoIndexList.length===0)return;const e=i.getCurrentState();e.mode!=="Panorama"&&(yield er(i,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const n=new Gi(i,{useGuideLine:!1});yield n.load(t),yield new Promise((o,s)=>{const r=i.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),n.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const g=a[0];if(a=a.slice(1),m!==g)return h(new Error("panoIndex not match, wanted: "+g+", got: "+m));if(a.length===0)return u()}function d(){i.off("modeChange",l),i.off("panoArrived",c)}function h(m){d(),s(m)}function u(){d(),o()}i.on("modeChange",l),i.on("panoArrived",c)})})}const FP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Uh},Symbol.toStringTag,{value:"Module"})),qh="v1.1.0",zr="GuideLinePlugin",Jh=`${zr}@${qh}`;class HP extends bn{constructor(e,n){super(e,n);f(this,"version",qh);f(this,"name",zr);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${Jh} is disposed`)});this.cruisePlugin=new Gi(e,{useGuideLine:!1}),Object.assign(window,{[`__${zr}_DEBUG__`]:this})}get disposed(){return this._disposed}load(e,n,o=!0){return U(this,null,function*(){var u,m,g,v,A,b,y;if(this.disposed)return;const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r;const a=r.config,l={panorama_style:{visible:!0,unit_length:(u=a==null?void 0:a.unitHeight)!=null?u:.4,width:(m=a==null?void 0:a.unitWidth)!=null?m:.6,texture:{url:(g=a==null?void 0:a.arrowTextureUrl)!=null?g:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},c=(A=(v=r.routes)==null?void 0:v.map(C=>{var D;return it({},l,{id:(D=C.id)!=null?D:Date.now(),pano_group:C.panoIndexList})}))!=null?A:[],d=(y=(b=r.lines)==null?void 0:b.map(C=>it({},l,C)))!=null?y:[],h=[...c,...d];yield this.waitFiveLoaded(),this.clear(),h.forEach(C=>{this.addGuideLineItem(C)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",r),console.info(`${Jh} loaded`,r)})}formatData(e){return U(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,n){var s;if(this.disposed)return this.disposedErrorLog();const o=W({},this.state);this.state=W(W({},this.state),e),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),zt(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const n=e.render_id||e.id,o=this.itemMap.get(n);o&&this.removeGuideLineItem(o);const s=new Uh({five:this.five,id:n,plugin:this});return this.itemMap.set(n,s),e&&s.setData(e),s}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function n(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function o(r,a){return new E.Vector3().fromArray(r).distanceTo(new E.Vector3().fromArray(a))<.01}function s(r){const a=r.tag.position;return n(a)?e.every(l=>{var c;return n((c=l.tag)==null?void 0:c.position)?!o(a,l.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=s(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=s(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:n})}waitFiveLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Zh=(i,t)=>new HP(i,t);function Kh(i,t,e){if(e){const o=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class XP extends B.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class cs extends XP{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Kh(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new B.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class YP extends cs{}class UP extends cs{}class qP extends cs{}class $h extends cs{}class JP extends $h{}class ZP extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class eu extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function KP(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function jr(i,t,e){if(!t||!e||!i)return;const n=KP(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function $P(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class _r extends ZP{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((d=e.color)!=null?d:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new eu(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new eu(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Vr={X:15618642,Y:4765519,Z:4227839};class ui{static get X(){return new E.Color(Vr.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Vr.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Vr.Z).convertSRGBToLinear().clone()}}class eC extends YP{constructor(e){super(e);f(this,"xArrow",new _r({direction:"x",color:ui.X}));f(this,"yArrow",new _r({direction:"y",color:ui.Y}));f(this,"zArrow",new _r({direction:"z",color:ui.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function kn(i,t){return tC(document.createElement(t!=null?t:"div"),i)}function tC(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function nC(i){const t=kn(W({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class iC extends qP{constructor(e,n){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Or({direction:"x",color:ui.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Or({direction:"y",color:ui.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Or({direction:"z",color:ui.Z})),n!=null&&n.container&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=nC({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Or extends E.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new oC(e),this.ring=new sC(e),this.angleSector=new rC(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class oC extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class sC extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class rC extends E.Mesh{constructor(e){var o;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function aC(){const i=kn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=kn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=kn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:un({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:un({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:un({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:un({cursor:"ew-resize",right:n})},l={direction:"nesw",element:un({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:un({cursor:"ns-resize",top:n})},d={direction:"nwse",element:un({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:un({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,d).forEach(m=>t.appendChild(m.element)),{container:i,squares:[o,s,r,a,l,c,d,h]}}function un(i){const t=kn(W({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=kn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=kn({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class lC extends JP{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Qn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=aC();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function tu(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class cC extends UP{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=tu(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class Ni{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new On,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new Le(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(Rn),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(u=>u instanceof E.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=n}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=tu(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class dC extends Ni{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),d=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=jr(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),d=new E.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class Wi{constructor(t,e,n,o,s,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:d,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const Br="Object3DHelper@v1.0.1",hC=()=>{console.error(`${Br} is disposed`)},uC=()=>{console.warn(`${Br} is disabled`)},fC=()=>{console.error(`${Br} is disabled`)};class mC{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new On);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return U(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return U(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return hC();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return fC();const n=W({},this.state);this.state=W(W({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=W(W({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&uC()}}function Qr(i){return i*Math.PI/180}class pC extends Ni{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(d=n.yCircle)==null?void 0:d.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Qr(n),Qr(o),Qr(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;Kh(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new E.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,u),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=jr(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=o.projectPoint(c.clone(),new E.Vector3).clone().sub(d);if(n.angleTo(u)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const b=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=b,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(El(this.startInfo.angle)),d){const y=new E.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(y)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;n&&(n.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class gC extends Ni{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new B.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=jr(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var H,X;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new B.Vector3);if(!a||$P(a,this.camera.position))return;const l=new B.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=o,h=new B.Vector3().subVectors(r[1],r[0]),u=new B.Vector3().subVectors(r[3],r[0]),m=N=>{const G=new B.Vector3(0,0,0);if(!this.startInfo)return G;const j=(N==="ew"?h:u).clone(),R=c.clone().projectOnVector(j),Z=a.clone().projectOnVector(j),q=l.clone().projectOnVector(j);if(Z.equals(R))return G;if(N==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const ae=new B.Vector3().subVectors(Z,q),oe=ae.x<0&&j.x>=0,ye=ae.y<0&&j.y>=0,Pe=ae.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=oe||ye||Pe}if(N==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const ae=new B.Vector3().subVectors(Z,q),oe=ae.x<0&&j.x>=0,ye=ae.y<0&&j.y>=0,Pe=ae.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=oe||ye||Pe}const Y=new B.Vector3().subVectors(Z,R),K=Y.length();return K>.3?(console.warn("offset.length() > 0.3, skipped",K),G):Y},g=m("ew"),v=m("ns"),A=()=>{const N=g;this.helperObject3D.cornerPositions.forEach((G,j)=>{var R;(R=this.startInfo)!=null&&R.dragPointInCenterLeft?(j===0||j===3)&&G.add(N):(j===1||j===2)&&G.add(N)})},b=()=>{const N=v;this.helperObject3D.cornerPositions.forEach((G,j)=>{var R;(R=this.startInfo)!=null&&R.dragPointInCenterBottom?(j===0||j===1)&&G.add(N):(j===2||j===3)&&G.add(N)})};switch(d){case"ew":A();break;case"ns":b();break;case"nesw":case"nwse":A(),b()}const y=new B.Vector3().subVectors(r[1],r[0]).length()/h.length(),C=new B.Vector3().subVectors(r[3],r[0]).length()/u.length(),D=new B.Vector3(y,C,1),x=new E.Matrix4().scale(D);n.isCSS3DObjectPlus?n.applyScaleMatrix4(x):n.scale.applyMatrix4(x),o.position.copy(a);const I=new B.Vector3().addVectors(r[0],r[2]).divideScalar(2),T=new B.Vector3().subVectors(I,l),S=new E.Matrix4().setPosition(T);n.applyMatrix4(S),(H=this.helperObject3D.css3DInstance)==null||H.css3DObject.applyMatrix4(S),(X=this.helperObject3D.plane)==null||X.applyMatrix4(S),this.hooks.emit("applyObjectScale",{matrix:x}),this.hooks.emit("applyObjectPosition",{matrix:S}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class vC extends gC{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class AC extends Ni{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class bC extends $h{constructor(t){super(t)}}class yC extends Ni{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(d=e.z)!=null?d:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const Rr="Object3DHelperPlugin",ds=Rr,wC=()=>{console.error(`${ds} is disposed`)},PC=()=>{console.warn(`${ds} is disabled`)},CC=()=>{console.error(`${ds} is disabled`)};class nu extends zi{constructor(e){super(e);f(this,"name",Rr);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Qn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Rr.toUpperCase()}_DEBUG__`]:this})}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return wC();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return CC();const o=W({},this.state);this.state=W(W({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var m;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new mC,s=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=n,u=new ve.Subscribe;if(l){const g=new eC(e),v=this.getConfig(n.moveHelper),A=new Wi(this.five,dC,e,g,v,u);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new iC(e,W({container:r},g)),A=new Wi(this.five,pC,e,v,g,u);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new cC(e),v=new Wi(this.five,AC,e,g,void 0,u);o.addControllers({boundingBoxController:v.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const g=new lC(e,r,a,this.five.scene),v=new Wi(this.five,vC,e,g,void 0,u);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),Oa(this.five).then(()=>{var A,b;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const C=(A=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?A:Ba(this.five);C&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(C),(b=this.css3DRender.getBehindCSS3DObjectGroup())==null||b.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new bC(e),v=new Wi(this.five,yC,e,g,void 0,u);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&PC()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const IC=i=>new nu(i),EC=`
655
+ `;class Mr{constructor(t,e){f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_panoGroup",null);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"visible",!1);f(this,"modeVisible",!1);f(this,"defaultVisible",!0);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new po({progress:0}).to({progress:1}).duration(5e3).repeat(1/0));f(this,"flickerAnime",zs(300).yoyo(!0).repeat(5));f(this,"dispose",()=>{this.disposed||(this.disposed=!0,this.five.off("modeChange",this.onFiveModeChange),this.plugin.hooks.off("show",this.onPluginShow),this.plugin.hooks.off("hide",this.onPluginHide),this.plugin.hooks.off("enable",this.onPluginEnable),this.plugin.hooks.off("disable",this.onPluginDisable),this.doHide())});f(this,"onTagContainerChange",(t,e)=>new xP({target:t,intro:!0,props:e.data}).$destroy);f(this,"onPluginShow",()=>{this.updateVisible()});f(this,"onPluginHide",()=>{this.updateVisible()});f(this,"onPluginEnable",()=>{this.updateVisible()});f(this,"onPluginDisable",()=>{this.updateVisible()});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?Ms(t):Qa(t),this.updateVisible()});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.flicker.value=1-e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"logWarning",t=>Vv("GuideLineModeItem: ",t));f(this,"logError",t=>$c("GuideLineModeItem: ",t));this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new rs(this.five)},this.endTagContainer={tag:null,plugin:new rs(this.five)};const n=new E.BufferGeometry,o=new E.ShaderMaterial({vertexShader:SP,fragmentShader:LP,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},borderColor:{value:new E.Color},borderOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new E.Mesh(n,o),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.plugin.hooks.on("show",this.onPluginShow),this.plugin.hooks.on("hide",this.onPluginHide),this.plugin.hooks.on("enable",this.onPluginEnable),this.plugin.hooks.on("disable",this.onPluginDisable),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.onFiveModeChange(this.five.getCurrentState().mode)}get panoGroup(){return this._panoGroup}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=DP(t);if(this._panoGroup=n,(e==null?void 0:e.skipPanoGroup)!==void 0){const s=e.skipPanoGroup?n.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=s}const o=this.getPathFromPanoGroup(n,this.five.work,e);this.path=o,this.setGeometryByPath(o,e)}setGeometryByPath(t,e){var l,c,d;if(this.disposed)return this.logError("disposed");const n=(l=e==null?void 0:e.scale)!=null?l:this.scale,o=(c=e==null?void 0:e.width)!=null?c:this.width,s=(d=e==null?void 0:e.unit_length)!=null?d:this.unitLength;this.path=t,this.scale=n,this.width=o,this.unitLength=s;const{geometry:r,maxU:a}=tA({path:t,width:o*n,unitLength:s*n,skipPositions:this.skippedPositions});this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.mesh.material.uniforms.mapColor.value=new E.Color().set(t)),this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");console.log("🐶 ==> color:",t),this.mesh.material.uniforms.backgroundColor.value=new E.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Ro(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}setTag(t,e){const o=ct({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"]}},style:{point:{enabled:!1}},data:{}},e),s=t==="start"?this.startTagContainer:this.endTagContainer;s.tag=o,MP(o)&&(s.tag.element=r=>this.onTagContainerChange(r,o)),s.plugin.load({tagList:[s.tag]})}updateVisible(){const t=(()=>!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){if(t.length<2)return[];const s=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[W({type:"CatmullRomCurve3",points:s},n)]}}function MP(i){return i.contentType==="Custom"}const TP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:Mr},Symbol.toStringTag,{value:"Module"}));function Fh(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function zP(i,t){const e=Fh(i),n=Fh(t);return e.angleTo(n)}const jP=i=>U(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),as=Math.PI*2;function _P(i){return i>=0&&i<as?i:(i%as+as)%as}function VP(i){return{longitude:_P(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function OP(i,t,e,n){const o=-i/e,s=i;return o*n+s}function BP(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Hh="v1.0.6",Xh="CruisePlugin",ls=`${Xh}@${Hh}`,Yh=()=>{console.error(`${ls} is disposed`)},QP=()=>{console.warn(`${ls} is disabled`)},RP=()=>{console.error(`${ls} is disabled`)},Tr=new Map;class Gi extends bn{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Xh}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return U(this,null,function*(){var d,h,u,m,g,v;if(this.state.disposed)return Yh();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);c.filter((A,b)=>{var y;return A.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var y,C;const b=(y=this.five.work.observers[A])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const D=a.length-1;a[D]=[...(C=a[D])!=null?C:[],A]}else{l=b;const D=a.length;a[D]=[A]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=Zh(this.five,this.config)),console.log("🐶 ==> data.guildPluginOptions:",r.guildPluginOptions),(v=this.GuideLine)==null||v.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${ls} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(Ie(W({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return Yh();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return RP();const o=W({},this.state);this.state=W(W({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),zt(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return U(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:ut(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return Ie(W({id:(c=s.uuid)!=null?c:ut(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,d)=>{const h=(()=>{var A,b,y,C;const u=o.panoIndexList.slice(d).find(D=>D!==c);if(u===void 0)return;const m=(A=n[c])==null?void 0:A.position,g=(b=n[u])==null?void 0:b.position;if(!g||!m||((y=n[c])==null?void 0:y.floorIndex)!==((C=n[u])==null?void 0:C.floorIndex))return;const v=new E.Vector3().subVectors(g,m);return VP(v.normalize())})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:W({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:d,stay:o.stay,data:W({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:ut(),keyframes:s.map((c,d)=>W({id:ut(),index:d},c)),guildPluginOptions:o.guildPluginOptions,useGuildLine:o.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return U(this,null,function*(){var m;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=ut();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>U(this,null,function*(){var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(v=this.data)==null?void 0:v.keyframes.find(b=>b.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const b=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:b}),d=!0,A.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield BP(g.stay)),d===!1&&(d=!0)}catch(v){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return U(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return U(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(d);break;case"Rotate":this.rotate(s,n).then(d);break;default:this.rotate(s,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return U(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return U(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return U(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return U(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,u=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return zP(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{jP(()=>s.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,n){return U(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=n==null?void 0:n.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&o.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return U(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Tr.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Tr.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Tr.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&QP()}waitFiveLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-OP(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Gi,"PluginVersion",Hh);const GP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),NP=i=>new Gi(i);class Uh{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new ve.Subscribe);f(this,"plugin");f(this,"five");f(this,"logError",t=>$c("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new Mr(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new Mr(this.five,{mode:"model",plugin:this.plugin,parent:this})}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){const n=t==="panorama"?this.panoramaItem:this.modelItem,o=t==="panorama"?e.panorama_style:e.model_style,s=e.path,r=o,a=o;if(e.pano_group){const l=t==="panorama";n.setGeometryByPanoGroup(e.pano_group,W({skipPanoGroup:l},r))}else e.path&&n.setGeometryByPath(s,r);n.setMartial(a),o!=null&&o.start_tag&&n.setStartTag(o.start_tag),o!=null&&o.end_tag&&n.setEndTag(o.end_tag)}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return U(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=W({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[n]=yield ei(WP(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),n)return this.logError(n.message)})}}function WP(i,t){return U(this,null,function*(){if(t.panoIndexList.length===0)return;const e=i.getCurrentState();e.mode!=="Panorama"&&(yield er(i,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const n=new Gi(i,{useGuideLine:!1});yield n.load(t),yield new Promise((o,s)=>{const r=i.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),n.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const g=a[0];if(a=a.slice(1),m!==g)return h(new Error("panoIndex not match, wanted: "+g+", got: "+m));if(a.length===0)return u()}function d(){i.off("modeChange",l),i.off("panoArrived",c)}function h(m){d(),s(m)}function u(){d(),o()}i.on("modeChange",l),i.on("panoArrived",c)})})}const FP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Uh},Symbol.toStringTag,{value:"Module"})),qh="v1.1.0",zr="GuideLinePlugin",Jh=`${zr}@${qh}`;class HP extends bn{constructor(e,n){super(e,n);f(this,"version",qh);f(this,"name",zr);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${Jh} is disposed`)});this.cruisePlugin=new Gi(e,{useGuideLine:!1}),Object.assign(window,{[`__${zr}_DEBUG__`]:this})}get disposed(){return this._disposed}load(e,n,o=!0){return U(this,null,function*(){var u,m,g,v,A,b,y;if(this.disposed)return;const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r;const a=r.config,l={panorama_style:{visible:!0,unit_length:(u=a==null?void 0:a.unitHeight)!=null?u:.4,width:(m=a==null?void 0:a.unitWidth)!=null?m:.6,texture:{url:(g=a==null?void 0:a.arrowTextureUrl)!=null?g:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},c=(A=(v=r.routes)==null?void 0:v.map(C=>{var D;return ct({},l,{id:(D=C.id)!=null?D:Date.now(),pano_group:C.panoIndexList})}))!=null?A:[],d=(y=(b=r.lines)==null?void 0:b.map(C=>ct({},l,C)))!=null?y:[],h=[...c,...d];yield this.waitFiveLoaded(),this.clear(),h.forEach(C=>{this.addGuideLineItem(C)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",r),console.info(`${Jh} loaded`,r)})}formatData(e){return U(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,n){var s;if(this.disposed)return this.disposedErrorLog();const o=W({},this.state);this.state=W(W({},this.state),e),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),zt(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const n=e.render_id||e.id,o=this.itemMap.get(n);o&&this.removeGuideLineItem(o);const s=new Uh({five:this.five,id:n,plugin:this});return this.itemMap.set(n,s),e&&s.setData(e),s}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function n(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function o(r,a){return new E.Vector3().fromArray(r).distanceTo(new E.Vector3().fromArray(a))<.01}function s(r){var l;const a=(l=r.tag)==null?void 0:l.position;return n(a)?e.every(c=>{var d;return n((d=c.tag)==null?void 0:d.position)?!o(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=s(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=s(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:n})}waitFiveLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Zh=(i,t)=>new HP(i,t);function Kh(i,t,e){if(e){const o=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class XP extends B.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class cs extends XP{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){Kh(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new B.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class YP extends cs{}class UP extends cs{}class qP extends cs{}class $h extends cs{}class JP extends $h{}class ZP extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class eu extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function KP(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function jr(i,t,e){if(!t||!e||!i)return;const n=KP(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function $P(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class _r extends ZP{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((d=e.color)!=null?d:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new eu(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new eu(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Vr={X:15618642,Y:4765519,Z:4227839};class ui{static get X(){return new E.Color(Vr.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Vr.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Vr.Z).convertSRGBToLinear().clone()}}class eC extends YP{constructor(e){super(e);f(this,"xArrow",new _r({direction:"x",color:ui.X}));f(this,"yArrow",new _r({direction:"y",color:ui.Y}));f(this,"zArrow",new _r({direction:"z",color:ui.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function kn(i,t){return tC(document.createElement(t!=null?t:"div"),i)}function tC(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function nC(i){const t=kn(W({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class iC extends qP{constructor(e,n){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Or({direction:"x",color:ui.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Or({direction:"y",color:ui.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Or({direction:"z",color:ui.Z})),n!=null&&n.container&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=nC({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Or extends E.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new oC(e),this.ring=new sC(e),this.angleSector=new rC(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class oC extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class sC extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class rC extends E.Mesh{constructor(e){var o;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function aC(){const i=kn({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=kn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=kn({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:un({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:un({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:un({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:un({cursor:"ew-resize",right:n})},l={direction:"nesw",element:un({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:un({cursor:"ns-resize",top:n})},d={direction:"nwse",element:un({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:un({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,d).forEach(m=>t.appendChild(m.element)),{container:i,squares:[o,s,r,a,l,c,d,h]}}function un(i){const t=kn(W({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=kn({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=kn({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class lC extends JP{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Qn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=aC();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function tu(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class cC extends UP{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=tu(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class Ni{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new On,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new Le(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(Rn),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(u=>u instanceof E.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=n}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=tu(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class dC extends Ni{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),d=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=jr(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),d=new E.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class Wi{constructor(t,e,n,o,s,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:d,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const Br="Object3DHelper@v1.0.1",hC=()=>{console.error(`${Br} is disposed`)},uC=()=>{console.warn(`${Br} is disabled`)},fC=()=>{console.error(`${Br} is disabled`)};class mC{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new On);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return U(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return U(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return hC();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return fC();const n=W({},this.state);this.state=W(W({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=W(W({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&uC()}}function Qr(i){return i*Math.PI/180}class pC extends Ni{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(d=n.yCircle)==null?void 0:d.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Qr(n),Qr(o),Qr(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;Kh(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new E.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,u),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=jr(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=o.projectPoint(c.clone(),new E.Vector3).clone().sub(d);if(n.angleTo(u)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),u.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const b=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=b,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(El(this.startInfo.angle)),d){const y=new E.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(y)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;n&&(n.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class gC extends Ni{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new B.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=jr(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var H,X;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new B.Vector3);if(!a||$P(a,this.camera.position))return;const l=new B.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=o,h=new B.Vector3().subVectors(r[1],r[0]),u=new B.Vector3().subVectors(r[3],r[0]),m=N=>{const G=new B.Vector3(0,0,0);if(!this.startInfo)return G;const j=(N==="ew"?h:u).clone(),R=c.clone().projectOnVector(j),Z=a.clone().projectOnVector(j),q=l.clone().projectOnVector(j);if(Z.equals(R))return G;if(N==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const ae=new B.Vector3().subVectors(Z,q),oe=ae.x<0&&j.x>=0,ye=ae.y<0&&j.y>=0,Pe=ae.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=oe||ye||Pe}if(N==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const ae=new B.Vector3().subVectors(Z,q),oe=ae.x<0&&j.x>=0,ye=ae.y<0&&j.y>=0,Pe=ae.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=oe||ye||Pe}const Y=new B.Vector3().subVectors(Z,R),K=Y.length();return K>.3?(console.warn("offset.length() > 0.3, skipped",K),G):Y},g=m("ew"),v=m("ns"),A=()=>{const N=g;this.helperObject3D.cornerPositions.forEach((G,j)=>{var R;(R=this.startInfo)!=null&&R.dragPointInCenterLeft?(j===0||j===3)&&G.add(N):(j===1||j===2)&&G.add(N)})},b=()=>{const N=v;this.helperObject3D.cornerPositions.forEach((G,j)=>{var R;(R=this.startInfo)!=null&&R.dragPointInCenterBottom?(j===0||j===1)&&G.add(N):(j===2||j===3)&&G.add(N)})};switch(d){case"ew":A();break;case"ns":b();break;case"nesw":case"nwse":A(),b()}const y=new B.Vector3().subVectors(r[1],r[0]).length()/h.length(),C=new B.Vector3().subVectors(r[3],r[0]).length()/u.length(),D=new B.Vector3(y,C,1),x=new E.Matrix4().scale(D);n.isCSS3DObjectPlus?n.applyScaleMatrix4(x):n.scale.applyMatrix4(x),o.position.copy(a);const I=new B.Vector3().addVectors(r[0],r[2]).divideScalar(2),T=new B.Vector3().subVectors(I,l),S=new E.Matrix4().setPosition(T);n.applyMatrix4(S),(H=this.helperObject3D.css3DInstance)==null||H.css3DObject.applyMatrix4(S),(X=this.helperObject3D.plane)==null||X.applyMatrix4(S),this.hooks.emit("applyObjectScale",{matrix:x}),this.hooks.emit("applyObjectPosition",{matrix:S}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class vC extends gC{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class AC extends Ni{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class bC extends $h{constructor(t){super(t)}}class yC extends Ni{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(d=e.z)!=null?d:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const Rr="Object3DHelperPlugin",ds=Rr,wC=()=>{console.error(`${ds} is disposed`)},PC=()=>{console.warn(`${ds} is disabled`)},CC=()=>{console.error(`${ds} is disabled`)};class nu extends zi{constructor(e){super(e);f(this,"name",Rr);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Qn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Rr.toUpperCase()}_DEBUG__`]:this})}show(e){return U(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return U(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return wC();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return CC();const o=W({},this.state);this.state=W(W({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var m;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new mC,s=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=n,u=new ve.Subscribe;if(l){const g=new eC(e),v=this.getConfig(n.moveHelper),A=new Wi(this.five,dC,e,g,v,u);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),v=new iC(e,W({container:r},g)),A=new Wi(this.five,pC,e,v,g,u);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new cC(e),v=new Wi(this.five,AC,e,g,void 0,u);o.addControllers({boundingBoxController:v.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const g=new lC(e,r,a,this.five.scene),v=new Wi(this.five,vC,e,g,void 0,u);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),Oa(this.five).then(()=>{var A,b;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const C=(A=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?A:Ba(this.five);C&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(C),(b=this.css3DRender.getBehindCSS3DObjectGroup())==null||b.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new bC(e),v=new Wi(this.five,yC,e,g,void 0,u);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&PC()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const IC=i=>new nu(i),EC=`
640
656
  varying vec2 vUv;
641
657
  void main() {
642
658
  vUv = uv;
@@ -656,4 +672,4 @@ void main() {
656
672
  float match = (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5))) * (transX < transY ? transX : transY);
657
673
  gl_FragColor = vec4(texture2D(map, uv).xyz, match);
658
674
  }
659
- `;function xC(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class iu{constructor(t,e){f(this,"_id");f(this,"url");f(this,"five");f(this,"panoIndex");f(this,"observer");f(this,"origin");f(this,"video");f(this,"videoMesh");f(this,"_enabled",!0);f(this,"_disposed",!1);f(this,"videoDataLoaded",!1);f(this,"hasVideoEverPlayed",!1);f(this,"renderFiveDisposer");f(this,"uv2Position",(t,e)=>{var m;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new B.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(m=this.five.work)==null?void 0:m.observers[this.panoIndex];if(!c)return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);const d=c.position.clone(),h=c.quaternion.clone(),u=l.clone();return u.applyAxisAngle(new B.Vector3(0,1,0),Math.PI/2),u.applyQuaternion(h),u.add(d),u});f(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new B.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new B.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});f(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.error("🐶 ==> error:",e)}))});f(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("实例已被销毁");this.enabled&&this.panoIndex===t&&this.mount()});f(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});f(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});f(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});f(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("实例已被销毁");if(!this.enabled)return this.logWarning("实例已被禁用");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});f(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("视频数据未加载");if(this.video.paused===!0)return this.logWarning("视频已暂停");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=Li(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});f(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new B.VideoTexture(this.video);o.minFilter=B.LinearFilter,o.magFilter=B.LinearFilter;const s=new B.ShaderMaterial({vertexShader:EC,fragmentShader:kC,uniforms:{map:{value:o},size:{value:new B.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new B.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new B.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||this.enabled&&(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new B.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=xC(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("插件已经销毁,无法挂载。");if(this.url==="")return this.logWarning("视频资源不存在。");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"视频播放失败。"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"自动播放视频失败。")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("⛔ ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,d=s+a,h=c+l;return n>=s&&n<=d&&o>=c&&o<=h}}class DC extends zi{constructor(e){super(e);f(this,"enabled",!0);f(this,"controllerMap",new Map);f(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("插件已被销毁");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new iu(this.five,Ie(W({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("插件已被销毁");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("插件已被销毁");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("插件已被销毁");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID 为 ${e} 的点位视频不存在`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("插件已被销毁");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID 为 ${o.render_id} 的点位视频已存在`);const s=o.render_id;this.controllerMap.set(o.render_id,new iu(this.five,Ie(W({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("插件已被销毁");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID 为 ${e} 的点位视频不存在`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("插件已被销毁");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("插件已被销毁");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("⛔ ==> [PanoVideoPluginController]:",e)}}const SC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),LC=i=>new DC(i);console.info("@realsee/dnalogel %cv2.16.0-13","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px"),$.CSS3DRender=Qn,$.CSS3DRenderPlugin=_s,$.CameraMovementEffect=cc,$.CameraMovementPlugin=gg,$.ContentType=Nh,$.CruisePlugin=NP,$.CruisePluginController=Gi,$.CruisePluginTypes=GP,$.DIRECTION=ri,$.DISPLAY_STRATEGY_TYPE=wn,$.DimensionType=Wh,$.FLOOR_PLAN_ATTACHED_TO=ln,$.FLOOR_TYPE_MAP=rg,$.GuideLineItem=FP,$.GuideLineModeItem=TP,$.GuideLinePlugin=Zh,$.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Pn,$.ItemLabelPlugin=Pv,$.Magnifier=yc,$.MapviewFloorplanPlugin=Bp,$.ModelChassisCompassPlugin=cg,$.ModelEntryDoorGuidePlugin=ug,$.ModelFloorplanPlugin=jp,$.ModelItemLabelPlugin=nv,$.ModelRoomLabelPlugin=Xf,$.ModelTVVideoPlugin=sv,$.ModelViewPlugin=wu,$.Object3DHelperController=nu,$.Object3DHelperPlugin=IC,$.PLUGIN=ds,$.PaintBrush=yu,$.PaintBrushTypeEnum=Nt,$.PanoCompassPlugin=Og,$.PanoCursorRaycasterPlugin=nf,$.PanoDoorLabelPlugin=_v,$.PanoFloorplanRadarPlugin=og,$.PanoMeasurePlugin=S0,$.PanoMeasurePluginLine=yn,$.PanoMeasurePluginModel=Fo,$.PanoMeasurePluginPoint=Dt,$.PanoMeasurePluginPolyline=Wo,$.PanoRulerPlugin=wg,$.PanoRulerProPlugin=Tg,$.PanoSpatialTagPlugin=F0,$.PanoTagPlugin=CP,$.PanoTagPluginController=rs,$.PanoVideoPlugin=LC,$.PanoVideoPluginType=SC,$.ROOM_FETILE_TYPE_MAP=sg,$.ROOM_TYPE_MAP=ag,$.Rotation=jt,$.TopviewFloorplanPlugin=Rp,$.Util=ef,$.itemLabelPluginServerParams=Cv,$.modelItemLabelPluginServerParams=iv,$.modelRoomLabelPluginServerParams=Yf,$.pluginFlag=PP,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
675
+ `;function xC(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class iu{constructor(t,e){f(this,"_id");f(this,"url");f(this,"five");f(this,"panoIndex");f(this,"observer");f(this,"origin");f(this,"video");f(this,"videoMesh");f(this,"_enabled",!0);f(this,"_disposed",!1);f(this,"videoDataLoaded",!1);f(this,"hasVideoEverPlayed",!1);f(this,"renderFiveDisposer");f(this,"uv2Position",(t,e)=>{var m;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new B.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(m=this.five.work)==null?void 0:m.observers[this.panoIndex];if(!c)return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);const d=c.position.clone(),h=c.quaternion.clone(),u=l.clone();return u.applyAxisAngle(new B.Vector3(0,1,0),Math.PI/2),u.applyQuaternion(h),u.add(d),u});f(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new B.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new B.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});f(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.error("🐶 ==> error:",e)}))});f(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("实例已被销毁");this.enabled&&this.panoIndex===t&&this.mount()});f(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});f(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});f(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});f(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("实例已被销毁");if(!this.enabled)return this.logWarning("实例已被禁用");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});f(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("视频数据未加载");if(this.video.paused===!0)return this.logWarning("视频已暂停");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=Li(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});f(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new B.VideoTexture(this.video);o.minFilter=B.LinearFilter,o.magFilter=B.LinearFilter;const s=new B.ShaderMaterial({vertexShader:EC,fragmentShader:kC,uniforms:{map:{value:o},size:{value:new B.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new B.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new B.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||this.enabled&&(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new B.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=xC(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("插件已经销毁,无法挂载。");if(this.url==="")return this.logWarning("视频资源不存在。");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"视频播放失败。"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"自动播放视频失败。")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("⛔ ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,d=s+a,h=c+l;return n>=s&&n<=d&&o>=c&&o<=h}}class DC extends zi{constructor(e){super(e);f(this,"enabled",!0);f(this,"controllerMap",new Map);f(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("插件已被销毁");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new iu(this.five,Ie(W({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("插件已被销毁");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("插件已被销毁");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("插件已被销毁");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID 为 ${e} 的点位视频不存在`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("插件已被销毁");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID 为 ${o.render_id} 的点位视频已存在`);const s=o.render_id;this.controllerMap.set(o.render_id,new iu(this.five,Ie(W({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("插件已被销毁");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID 为 ${e} 的点位视频不存在`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("插件已被销毁");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("插件已被销毁");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("⛔ ==> [PanoVideoPluginController]:",e)}}const SC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),LC=i=>new DC(i);console.info("@realsee/dnalogel %cv2.16.0-14","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px"),$.CSS3DRender=Qn,$.CSS3DRenderPlugin=_s,$.CameraMovementEffect=cc,$.CameraMovementPlugin=gg,$.ContentType=Nh,$.CruisePlugin=NP,$.CruisePluginController=Gi,$.CruisePluginTypes=GP,$.DIRECTION=ri,$.DISPLAY_STRATEGY_TYPE=wn,$.DimensionType=Wh,$.FLOOR_PLAN_ATTACHED_TO=ln,$.FLOOR_TYPE_MAP=rg,$.GuideLineItem=FP,$.GuideLineModeItem=TP,$.GuideLinePlugin=Zh,$.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Pn,$.ItemLabelPlugin=Pv,$.Magnifier=yc,$.MapviewFloorplanPlugin=Bp,$.ModelChassisCompassPlugin=cg,$.ModelEntryDoorGuidePlugin=ug,$.ModelFloorplanPlugin=jp,$.ModelItemLabelPlugin=nv,$.ModelRoomLabelPlugin=Xf,$.ModelTVVideoPlugin=sv,$.ModelViewPlugin=wu,$.Object3DHelperController=nu,$.Object3DHelperPlugin=IC,$.PLUGIN=ds,$.PaintBrush=yu,$.PaintBrushTypeEnum=Nt,$.PanoCompassPlugin=Og,$.PanoCursorRaycasterPlugin=nf,$.PanoDoorLabelPlugin=_v,$.PanoFloorplanRadarPlugin=og,$.PanoMeasurePlugin=S0,$.PanoMeasurePluginLine=yn,$.PanoMeasurePluginModel=Fo,$.PanoMeasurePluginPoint=Dt,$.PanoMeasurePluginPolyline=Wo,$.PanoRulerPlugin=wg,$.PanoRulerProPlugin=Tg,$.PanoSpatialTagPlugin=F0,$.PanoTagPlugin=CP,$.PanoTagPluginController=rs,$.PanoVideoPlugin=LC,$.PanoVideoPluginType=SC,$.ROOM_FETILE_TYPE_MAP=sg,$.ROOM_TYPE_MAP=ag,$.Rotation=jt,$.TopviewFloorplanPlugin=Rp,$.Util=ef,$.itemLabelPluginServerParams=Cv,$.modelItemLabelPluginServerParams=iv,$.modelRoomLabelPluginServerParams=Yf,$.pluginFlag=PP,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});