@realsee/dnalogel 2.6.2-dev.0 → 2.6.2

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 (242) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.js +37 -37
  3. package/dist/index.umd.js +1 -1
  4. package/docs/classes/CSS3DRender.html +31 -31
  5. package/docs/classes/CruisePluginController.html +24 -24
  6. package/docs/classes/Magnifier.html +20 -20
  7. package/docs/classes/ModelRoomLabelController.html +11 -11
  8. package/docs/classes/Object3DHelperController.html +24 -24
  9. package/docs/classes/PaintBrush.html +15 -15
  10. package/docs/classes/PanoMeasurePluginLine.html +23 -23
  11. package/docs/classes/PanoMeasurePluginModel.html +22 -22
  12. package/docs/classes/PanoMeasurePluginPoint.html +14 -14
  13. package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
  14. package/docs/classes/PanoTagPluginController.html +41 -41
  15. package/docs/classes/Util.BetterTween.html +8 -8
  16. package/docs/classes/Util.FivePointSelector.html +12 -12
  17. package/docs/classes/Util.Interval.html +12 -12
  18. package/docs/classes/Util.Magnifier.html +17 -17
  19. package/docs/classes/Util.PointDomHelper.html +11 -11
  20. package/docs/classes/Util.PointHelper.html +11 -11
  21. package/docs/classes/Util.Rectangle.html +13 -13
  22. package/docs/enums/CameraMovementEffect.html +7 -7
  23. package/docs/enums/ContentType.html +16 -16
  24. package/docs/enums/DIRECTION.html +9 -9
  25. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  26. package/docs/enums/DimensionType.html +7 -7
  27. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  28. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  29. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  30. package/docs/enums/PointType.html +7 -7
  31. package/docs/enums/Rotation.html +8 -8
  32. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  33. package/docs/functions/CameraMovementPlugin.html +4 -4
  34. package/docs/functions/CruisePlugin.html +4 -4
  35. package/docs/functions/GuideLinePlugin.html +5 -5
  36. package/docs/functions/ItemLabelPlugin.html +4 -4
  37. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  38. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  39. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  40. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  41. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  42. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  43. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  44. package/docs/functions/ModelViewPlugin.html +4 -4
  45. package/docs/functions/Object3DHelperPlugin.html +4 -4
  46. package/docs/functions/PanoCompassPlugin.html +4 -4
  47. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  48. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  49. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  50. package/docs/functions/PanoMeasurePlugin.html +4 -4
  51. package/docs/functions/PanoRulerPlugin.html +4 -4
  52. package/docs/functions/PanoRulerProPlugin.html +4 -4
  53. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  54. package/docs/functions/PanoTagPlugin.html +4 -4
  55. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  56. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  57. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  58. package/docs/functions/Util.getFrameTime.html +5 -5
  59. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  60. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  61. package/docs/functions/Util.isNil.html +5 -5
  62. package/docs/functions/Util.nextFrame.html +5 -5
  63. package/docs/functions/Util.notNil.html +5 -5
  64. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  65. package/docs/functions/Util.tweenProgress.html +5 -5
  66. package/docs/functions/pluginFlag.html +5 -5
  67. package/docs/index.html +4 -4
  68. package/docs/interfaces/AddTagConfig.html +6 -6
  69. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  70. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  71. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  72. package/docs/interfaces/EventMap.html +15 -15
  73. package/docs/interfaces/FloorplanBounding.html +8 -8
  74. package/docs/interfaces/FloorplanData.html +10 -10
  75. package/docs/interfaces/FloorplanEntrance.html +11 -11
  76. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  77. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  78. package/docs/interfaces/FloorplanFloorData.html +9 -9
  79. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  80. package/docs/interfaces/FloorplanObserver.html +9 -9
  81. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  82. package/docs/interfaces/FloorplanPosition.html +7 -7
  83. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  84. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  85. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  86. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  87. package/docs/interfaces/FloorplanServerData.html +7 -7
  88. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  89. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  90. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  91. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  92. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  93. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  94. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  95. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  96. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  97. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  98. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  99. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  100. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  101. package/docs/interfaces/MinMax.html +7 -7
  102. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  103. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  104. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  105. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  106. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  107. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  108. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  109. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  110. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  111. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  112. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  113. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  114. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  115. package/docs/interfaces/Object3DHelperState.html +8 -8
  116. package/docs/interfaces/PaintBrushAction.html +12 -12
  117. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  118. package/docs/interfaces/PaintBrushState.html +10 -10
  119. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  120. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
  121. package/docs/interfaces/PanoMeasureParameterType.html +12 -12
  122. package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
  123. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
  124. package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
  125. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
  126. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  127. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  128. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  129. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  130. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  131. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  132. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  133. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
  134. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
  135. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  136. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  137. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  138. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  139. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  140. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  141. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  142. package/docs/interfaces/Point.html +8 -8
  143. package/docs/interfaces/Room.html +9 -9
  144. package/docs/interfaces/RoomInfo.html +7 -7
  145. package/docs/interfaces/RoomLabel.html +14 -14
  146. package/docs/interfaces/RoomRules.html +5 -5
  147. package/docs/interfaces/Rooms.html +5 -5
  148. package/docs/interfaces/Scissor.html +9 -9
  149. package/docs/interfaces/State.html +8 -8
  150. package/docs/interfaces/TagCache.html +10 -10
  151. package/docs/interfaces/TagConfig.html +10 -10
  152. package/docs/interfaces/TagIconUrl.html +9 -9
  153. package/docs/interfaces/Tags.html +9 -9
  154. package/docs/interfaces/TemporaryState.html +6 -6
  155. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  156. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  157. package/docs/modules/Util.html +5 -5
  158. package/docs/modules.html +4 -4
  159. package/docs/types/ArrayPosition.html +5 -5
  160. package/docs/types/AudioAppearance.html +5 -5
  161. package/docs/types/AudioTagTypeConfigKey.html +5 -5
  162. package/docs/types/CSS3DRenderExportType.html +5 -5
  163. package/docs/types/CSS3DRenderPluginExportType.html +5 -5
  164. package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
  165. package/docs/types/Color.html +5 -5
  166. package/docs/types/ContentTypeConfigKey.html +5 -5
  167. package/docs/types/ContentTypeConfigKeySplit.html +5 -5
  168. package/docs/types/ContentTypeMap.html +5 -5
  169. package/docs/types/Create3DDomContainerReturnType.html +5 -5
  170. package/docs/types/Create3DElementReturnType.html +5 -5
  171. package/docs/types/CruisePluginExportType.html +5 -5
  172. package/docs/types/Direction-1.html +5 -5
  173. package/docs/types/Direction4.html +5 -5
  174. package/docs/types/FloorplanRuleLabels.html +5 -5
  175. package/docs/types/FloorplanServerRuleLabels.html +5 -5
  176. package/docs/types/GuideLinePluginExportType.html +5 -5
  177. package/docs/types/HelperEventMap.html +5 -5
  178. package/docs/types/LoadTagConfig.html +5 -5
  179. package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
  180. package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
  181. package/docs/types/MediaData.html +5 -5
  182. package/docs/types/MediaStore.html +5 -5
  183. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
  184. package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
  185. package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
  186. package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
  187. package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
  188. package/docs/types/MoveArgs.html +5 -5
  189. package/docs/types/MoveOpts.html +5 -5
  190. package/docs/types/Object3DHelperEventMap.html +5 -5
  191. package/docs/types/ObjectFit.html +5 -5
  192. package/docs/types/PaintBrushEventMap.html +5 -5
  193. package/docs/types/PanoCompassPluginData.html +5 -5
  194. package/docs/types/PanoCompassPluginExportType.html +5 -5
  195. package/docs/types/PanoCompassPluginParameterType.html +5 -5
  196. package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
  197. package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
  198. package/docs/types/PanoIndex.html +5 -5
  199. package/docs/types/PanoMeasurePluginEvent.html +5 -5
  200. package/docs/types/PanoMeasureReturnType.html +5 -5
  201. package/docs/types/PanoSpatialTagPluginId.html +5 -5
  202. package/docs/types/PanoTagPluginExportInterface.html +5 -5
  203. package/docs/types/PanoTagPluginParamsInterface.html +5 -5
  204. package/docs/types/PlaneTag.html +5 -5
  205. package/docs/types/PlaneTagElement.html +5 -5
  206. package/docs/types/Point2DElement.html +5 -5
  207. package/docs/types/Point2DTag.html +5 -5
  208. package/docs/types/Point3DElement.html +5 -5
  209. package/docs/types/Point3DTag.html +5 -5
  210. package/docs/types/PointTag.html +5 -5
  211. package/docs/types/PointTagElement.html +5 -5
  212. package/docs/types/Position.html +5 -5
  213. package/docs/types/RotateArgs.html +5 -5
  214. package/docs/types/RotateOpts.html +5 -5
  215. package/docs/types/RuleLabelsKey.html +5 -5
  216. package/docs/types/RuleLabelsValue.html +5 -5
  217. package/docs/types/StickType.html +5 -5
  218. package/docs/types/Tag.html +5 -5
  219. package/docs/types/Tag2D.html +5 -5
  220. package/docs/types/Tag3D.html +5 -5
  221. package/docs/types/TagContentType.html +5 -5
  222. package/docs/types/TagDimensionType.html +5 -5
  223. package/docs/types/TagElement.html +5 -5
  224. package/docs/types/TagEvents.html +5 -5
  225. package/docs/types/TagHooks.html +5 -5
  226. package/docs/types/TagIconSize.html +5 -5
  227. package/docs/types/TagId.html +5 -5
  228. package/docs/types/TagPointType.html +5 -5
  229. package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
  230. package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
  231. package/docs/types/WorkCode.html +5 -5
  232. package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
  233. package/docs/variables/PLUGIN.html +5 -5
  234. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
  235. package/docs/variables/ROOM_TYPE_MAP.html +5 -5
  236. package/docs/variables/VERSION.html +5 -5
  237. package/docs/variables/itemLabelPluginServerParams.html +5 -5
  238. package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
  239. package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
  240. package/libs/CruisePlugin/Controller.js +124 -124
  241. package/libs/GuideLinePlugin/Controller.js +51 -51
  242. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -527,7 +527,7 @@ void main() {
527
527
  width: 100%;
528
528
  height: 100%;
529
529
  z-index: 5;
530
- `,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=gm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new pm({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==be.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}},bm={name:"ItemLabelPlugin",version:0};class ym extends li{constructor(e){super(e);m(this,"state");m(this,"container");m(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(he(G({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(G({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=G({},this.state);this.state=G(G(G({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(G({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function wm(i){le(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 Cm(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=ee(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ye.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){z(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Se(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=je(Ye.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Z,o:Z,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Pm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){Le[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class Em extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{props:0,onClick:1},wm)}}function Im(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 km(i){const{camera:t}=i,e=t.getWorldDirection(new H.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 xm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Dm(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 Lm={userAction:!0};class Sm extends ym{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new H.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,E,I;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 H.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),B=C.position.clone().add(new H.Vector3(0,this.OffsetHeight,0)),F=B.clone().sub(n.position).normalize().angleTo(a),X=B.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,R=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=R&&F<Math.PI/2,C.cameraToward=km(this.five),R?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:B,top:N}=l[L-1],{index:F,left:X,top:j}=l[L],P=this.container.children[D],R=this.container.children[F];if(!P||!R)return;const O={left:s*B/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=R.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(I=(E=(y=R.children)==null?void 0:y[0])==null?void 0:E.clientHeight)!=null?I:0};Im(O,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[F].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new H.Vector3(0,0,-1),f=r.clone(),u=new H.Quaternion;u.setFromUnitVectors(d,f);const h=new H.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=xm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new H.Vector3(f.x,f.y,f.z);p.add(new H.Vector3(-.2,1.8,0).applyEuler(new H.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:Dm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(G({},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:Lm.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 Em({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 Tm=i=>new Sm(i),Mm=2,zm=3,Bm=3,Vm=2;function jm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),E=d[g-1],I=E==null?void 0:E.distanceTo(p);if(g>u&&g-u>1){let C=g;E!==void 0&&I>.8&&(C=g+1),E!==void 0&&I>.2&&I<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const F=new H.Vector3().subVectors(d[L+1],d[L]),X=new H.Vector3().subVectors(N,d[L]);F.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),B=Os(D,e,n);f.push(B),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Os(d,e,n)]}}function Os(i,t,e){const n=t/2,o=e/t,s=i.length,r=jl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Mm*zm,c=2*s,d=c*Bm,f=c*Vm,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],E=i[v],{x:I,y:C,z:L}=E,D=new H.Vector3(I+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const B=new H.Vector3(I-w*n,C+.05,L-y*n);h[v*6+3]=B.x,h[v*6+4]=B.y,h[v*6+5]=B.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Qm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Rm(i){return!We(i)}function We(i){return i!=null}const Ya="v1.1.0",Ua="GuideLinePlugin",Gi=`${Ua}@${Ya}`,Hs=i=>`${Gi}--${i}`;class Ja extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Gi} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ua}_DEBUG__`]:this})}load(e,n,o=!0){return Y(this,null,function*(){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,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Gi} loaded`,r))})}formatData(e){return Y(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 this.disposedErrorLog();const o=G({},this.state);this.state=G(G({},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),Je(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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(We),s=new x.Group;if(s.name=Hs("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(We),r=jm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n.unitHeight)!=null?h:.4});if(!r)return;const a=Qm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Hs("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ja,"lasestVersion",Ya);const Za=(i,t)=>new Ja(i,t);function Fs(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Om(i,t){const e=Fs(i),n=Fs(t);return e.angleTo(n)}const Hm=i=>Y(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Tn=Math.PI*2;function Fm(i){return i>=0&&i<Tn?i:(i%Tn+Tn)%Tn}function Gm(i){return{longitude:Fm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Nm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Wm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const qa="v1.0.6",Ka="CruisePlugin",mi=`${Ka}@${qa}`,Gs=()=>{console.error(`${mi} is disposed`)},_m=()=>{console.warn(`${mi} is disabled`)},Xm=()=>{console.error(`${mi} is disabled`)},ki=new Map;class uo extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ka}_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 Y(this,null,function*(){var d,f,u,h,p;if(this.state.disposed)return Gs();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=Za(this.five,this.config)),(p=this.GuideLine)==null||p.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.log(`${mi} 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(he(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 Gs();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Xm();const o=G({},this.state);this.state=G(G({},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),Je(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 Y(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:He(),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 he(G({id:(c=s.uuid)!=null?c:He(),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 f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(E=>E!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return Gm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:G({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>G({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 Y(this,null,function*(){var h;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=He();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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Wm(p.stay)),d===!1&&(d=!0)}catch(A){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 Y(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(e,n){return Y(this,null,function*(){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return Y(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 Y(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 Y(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(e,n){return Y(this,null,function*(){const{five:o,privateState:s,state:r}=this,a=(()=>{var u,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.rotateSpeed)!=null?h:d==null?void 0:d.rotateSpeed;if((d==null?void 0:d.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return d.rotateSpeedUnit==="rad/ms"?f:f/1e3})(),l=(()=>{if(n.duration)return n.duration;if(a){const d=this.five.getCurrentState();return Om(d,e)/a}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const c=this.getSpeededDuration(l);return new Promise(d=>{Hm(()=>o.updateCamera(e,c)),setTimeout(()=>d(),c)})})}changePano(e,n){return Y(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,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/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,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 Y(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 ki.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return ki.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 ki.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&&_m()}waitFiveLoaded(){return Y(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-Nm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(uo,"PluginVersion",qa);const Ym=i=>new uo(i);function Um(i){le(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 Ns(i){let t,e,n,o,s,r,a,l=i[3]&&Ws(i);return{c(){t=V("div"),e=Ae("svg"),n=Ae("defs"),o=Ae("linearGradient"),s=Ae("stop"),r=Ae("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),te(t,"vertical",i[9]),te(t,"horizontal",!i[9]),T(t,"width",i[8]+"px"),T(t,"height",i[7]+"px")},m(c,d){z(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&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=Ws(c),l.c(),k(l,1),l.m(e,null)):l&&(se(),S(l,1,1,()=>{l=null}),re()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&te(t,"vertical",c[9]),d&512&&te(t,"horizontal",!c[9]),d&256&&T(t,"width",c[8]+"px"),d&128&&T(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function Ws(i){let t,e,n,o,s;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){z(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&De(()=>{o&&o.end(1),n=Rt(t,Kn,{duration:i[2],delay:i[0],easing:yt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=tn(t,Kn,{duration:i[2],delay:i[1],easing:yt})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Jm(i){let t,e=i[8]&&Ns(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Ns(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){e&&e.d(n),n&&M(t)}}}function Zm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class fo extends oe{constructor(t){super(),ie(this,t,Zm,Jm,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Um)}}function qm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function _s(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=gm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new pm({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==be.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}},bm={name:"ItemLabelPlugin",version:0};class ym extends li{constructor(e){super(e);m(this,"state");m(this,"container");m(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(he(G({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(G({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(G({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=G({},this.state);this.state=G(G(G({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(G({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function wm(i){le(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 Cm(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=ee(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ye.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){z(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Se(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=je(Ye.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Z,o:Z,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Pm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){Le[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class Em extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{props:0,onClick:1},wm)}}function Im(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 km(i){const{camera:t}=i,e=t.getWorldDirection(new H.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 xm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Dm(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 Lm={userAction:!0};class Sm extends ym{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new H.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,E,I;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 H.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),B=C.position.clone().add(new H.Vector3(0,this.OffsetHeight,0)),F=B.clone().sub(n.position).normalize().angleTo(a),X=B.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,R=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=R&&F<Math.PI/2,C.cameraToward=km(this.five),R?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:B,top:N}=l[L-1],{index:F,left:X,top:j}=l[L],P=this.container.children[D],R=this.container.children[F];if(!P||!R)return;const O={left:s*B/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=R.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(I=(E=(y=R.children)==null?void 0:y[0])==null?void 0:E.clientHeight)!=null?I:0};Im(O,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[F].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new H.Vector3(0,0,-1),f=r.clone(),u=new H.Quaternion;u.setFromUnitVectors(d,f);const h=new H.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=xm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new H.Vector3(f.x,f.y,f.z);p.add(new H.Vector3(-.2,1.8,0).applyEuler(new H.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:Dm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(G({},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:Lm.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 Em({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 Tm=i=>new Sm(i),Mm=2,zm=3,Bm=3,Vm=2;function jm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),E=d[g-1],I=E==null?void 0:E.distanceTo(p);if(g>u&&g-u>1){let C=g;E!==void 0&&I>.8&&(C=g+1),E!==void 0&&I>.2&&I<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const F=new H.Vector3().subVectors(d[L+1],d[L]),X=new H.Vector3().subVectors(N,d[L]);F.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),B=Os(D,e,n);f.push(B),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Os(d,e,n)]}}function Os(i,t,e){const n=t/2,o=e/t,s=i.length,r=jl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Mm*zm,c=2*s,d=c*Bm,f=c*Vm,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],E=i[v],{x:I,y:C,z:L}=E,D=new H.Vector3(I+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const B=new H.Vector3(I-w*n,C+.05,L-y*n);h[v*6+3]=B.x,h[v*6+4]=B.y,h[v*6+5]=B.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Qm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Rm(i){return!We(i)}function We(i){return i!=null}const Ya="v1.1.0",Ua="GuideLinePlugin",Gi=`${Ua}@${Ya}`,Hs=i=>`${Gi}--${i}`;class Ja extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Gi} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ua}_DEBUG__`]:this})}load(e,n,o=!0){return Y(this,null,function*(){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,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Gi} loaded`,r))})}formatData(e){return Y(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 this.disposedErrorLog();const o=G({},this.state);this.state=G(G({},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),Je(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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(We),s=new x.Group;if(s.name=Hs("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(We),r=jm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n==null?void 0:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n==null?void 0:n.unitHeight)!=null?h:.4});if(!r)return;const a=Qm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n==null?void 0:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Hs("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return Y(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ja,"lasestVersion",Ya);const Za=(i,t)=>new Ja(i,t);function Fs(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Om(i,t){const e=Fs(i),n=Fs(t);return e.angleTo(n)}const Hm=i=>Y(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Tn=Math.PI*2;function Fm(i){return i>=0&&i<Tn?i:(i%Tn+Tn)%Tn}function Gm(i){return{longitude:Fm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Nm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Wm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const qa="v1.0.6",Ka="CruisePlugin",mi=`${Ka}@${qa}`,Gs=()=>{console.error(`${mi} is disposed`)},_m=()=>{console.warn(`${mi} is disabled`)},Xm=()=>{console.error(`${mi} is disabled`)},ki=new Map;class uo extends Ht{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ka}_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 Y(this,null,function*(){var d,f,u,h,p;if(this.state.disposed)return Gs();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=Za(this.five,this.config)),(p=this.GuideLine)==null||p.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.log(`${mi} 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(he(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Y(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Y(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 Gs();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Xm();const o=G({},this.state);this.state=G(G({},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),Je(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 Y(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:He(),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 he(G({id:(c=s.uuid)!=null?c:He(),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 f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(E=>E!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return Gm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:G({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>G({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 Y(this,null,function*(){var h;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=He();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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>Y(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Wm(p.stay)),d===!1&&(d=!0)}catch(A){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 Y(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 Y(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 Y(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 Y(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 Y(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 Y(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var h,p;const f=(h=a.config)==null?void 0:h.speedConfig,u=(p=e.rotateSpeed)!=null?p:f==null?void 0:f.rotateSpeed;if((f==null?void 0:f.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return f.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const f=this.five.getCurrentState();return Om(f,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(f=>{Hm(()=>s.updateCamera(e,d)),setTimeout(()=>f(),d)})})}changePano(e,n){return Y(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,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/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,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 Y(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 ki.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return ki.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 ki.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&&_m()}waitFiveLoaded(){return Y(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-Nm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(uo,"PluginVersion",qa);const Ym=i=>new uo(i);function Um(i){le(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 Ns(i){let t,e,n,o,s,r,a,l=i[3]&&Ws(i);return{c(){t=V("div"),e=Ae("svg"),n=Ae("defs"),o=Ae("linearGradient"),s=Ae("stop"),r=Ae("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),te(t,"vertical",i[9]),te(t,"horizontal",!i[9]),T(t,"width",i[8]+"px"),T(t,"height",i[7]+"px")},m(c,d){z(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&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=Ws(c),l.c(),k(l,1),l.m(e,null)):l&&(se(),S(l,1,1,()=>{l=null}),re()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&te(t,"vertical",c[9]),d&512&&te(t,"horizontal",!c[9]),d&256&&T(t,"width",c[8]+"px"),d&128&&T(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function Ws(i){let t,e,n,o,s;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){z(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&De(()=>{o&&o.end(1),n=Rt(t,Kn,{duration:i[2],delay:i[0],easing:yt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=tn(t,Kn,{duration:i[2],delay:i[1],easing:yt})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Jm(i){let t,e=i[8]&&Ns(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),z(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Ns(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Z,o:Z,d(n){e&&e.d(n),n&&M(t)}}}function Zm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class fo extends oe{constructor(t){super(),ie(this,t,Zm,Jm,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Um)}}function qm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function _s(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${Ge(i[5])};
532
532
  bottom:${Ge(i[6])};
533
533
  box-shadow: 0 0 ${Ge(i[10])} ${Ge(i[11])} rgba(0, 0, 0, ${i[12]});
package/dist/index.js CHANGED
@@ -10932,13 +10932,13 @@ class Ka extends Ht {
10932
10932
  return (v = this.five.work.observers[g]) == null ? void 0 : v.standingPosition;
10933
10933
  }).filter(_e), r = Cm(s, {
10934
10934
  skipPanoIndexMesh: (c = (l = e.skipPanoIndexMesh) != null ? l : n == null ? void 0 : n.skipPanoIndexMesh) != null ? c : !0,
10935
- unitWidth: (f = (d = e.unitWidth) != null ? d : n.unitWidth) != null ? f : 0.6,
10936
- unitHeight: (h = (u = e.unitHeight) != null ? u : n.unitHeight) != null ? h : 0.4
10935
+ unitWidth: (f = (d = e.unitWidth) != null ? d : n == null ? void 0 : n.unitWidth) != null ? f : 0.6,
10936
+ unitHeight: (h = (u = e.unitHeight) != null ? u : n == null ? void 0 : n.unitHeight) != null ? h : 0.4
10937
10937
  });
10938
10938
  if (!r)
10939
10939
  return;
10940
10940
  const a = Em({
10941
- textureUrl: (A = (p = e.arrowTextureUrl) != null ? p : n.arrowTextureUrl) != null ? A : this.staticPrefix + "/release/web/arrow6.b6ce0c62.png"
10941
+ textureUrl: (A = (p = e.arrowTextureUrl) != null ? p : n == null ? void 0 : n.arrowTextureUrl) != null ? A : this.staticPrefix + "/release/web/arrow6.b6ce0c62.png"
10942
10942
  });
10943
10943
  return r.forEach((g) => {
10944
10944
  const v = new x.Mesh(g, a);
@@ -11243,34 +11243,34 @@ class tl extends Ht {
11243
11243
  this.five.off("gesture", o), this.five.once("wantsChangeMode", n);
11244
11244
  };
11245
11245
  }
11246
- getPlayPromise(e, n) {
11247
- return X(this, null, function* () {
11248
- var s;
11249
- const o = e.data;
11250
- if (n.duration = (s = n == null ? void 0 : n.duration) != null ? s : e.start !== void 0 && e.end !== void 0 ? e.end - e.start : void 0, !!o)
11251
- return new Promise((r, a) => {
11252
- let l = !1;
11246
+ getPlayPromise(o) {
11247
+ return X(this, arguments, function* (e, n = {}) {
11248
+ var r;
11249
+ const s = e.data;
11250
+ if (n.duration = (r = n.duration) != null ? r : e.start !== void 0 && e.end !== void 0 ? e.end - e.start : void 0, !!s)
11251
+ return new Promise((a, l) => {
11252
+ let c = !1;
11253
11253
  this.addInterruptListener(() => {
11254
- if (!l)
11255
- return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), l = !0, a(new Error("play is interupted"));
11254
+ if (!c)
11255
+ return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), c = !0, l(new Error("play is interupted"));
11256
11256
  });
11257
11257
  try {
11258
- if (l)
11258
+ if (c)
11259
11259
  return;
11260
- const c = () => {
11261
- r(), l = !0;
11260
+ const d = () => {
11261
+ a(), c = !0;
11262
11262
  };
11263
- switch (o.effect) {
11263
+ switch (s.effect) {
11264
11264
  case "Move":
11265
- this.move(o, n).then(c);
11265
+ this.move(s, n).then(d);
11266
11266
  break;
11267
11267
  case "Rotate":
11268
- this.rotate(o, n).then(c);
11268
+ this.rotate(s, n).then(d);
11269
11269
  break;
11270
11270
  default:
11271
- this.rotate(o, n).then(c);
11271
+ this.rotate(s, n).then(d);
11272
11272
  }
11273
- } catch (c) {
11273
+ } catch (d) {
11274
11274
  }
11275
11275
  });
11276
11276
  });
@@ -11311,28 +11311,28 @@ class tl extends Ht {
11311
11311
  yield this.updateCamera(e, n);
11312
11312
  });
11313
11313
  }
11314
- updateCamera(e, n) {
11315
- return X(this, null, function* () {
11316
- const { five: o, privateState: s, state: r } = this, a = (() => {
11317
- var u, h;
11318
- const d = (u = r.config) == null ? void 0 : u.speedConfig, f = (h = e.rotateSpeed) != null ? h : d == null ? void 0 : d.rotateSpeed;
11319
- if ((d == null ? void 0 : d.rotateSpeedUnit) === void 0)
11320
- return f;
11321
- if (f !== void 0)
11322
- return d.rotateSpeedUnit === "rad/ms" ? f : f / 1e3;
11323
- })(), l = (() => {
11314
+ updateCamera(o) {
11315
+ return X(this, arguments, function* (e, n = {}) {
11316
+ const { five: s, privateState: r, state: a } = this, l = (() => {
11317
+ var h, p;
11318
+ const f = (h = a.config) == null ? void 0 : h.speedConfig, u = (p = e.rotateSpeed) != null ? p : f == null ? void 0 : f.rotateSpeed;
11319
+ if ((f == null ? void 0 : f.rotateSpeedUnit) === void 0)
11320
+ return u;
11321
+ if (u !== void 0)
11322
+ return f.rotateSpeedUnit === "rad/ms" ? u : u / 1e3;
11323
+ })(), c = (() => {
11324
11324
  if (n.duration)
11325
11325
  return n.duration;
11326
- if (a) {
11327
- const d = this.five.getCurrentState();
11328
- return km(d, e) / a;
11326
+ if (l) {
11327
+ const f = this.five.getCurrentState();
11328
+ return km(f, e) / l;
11329
11329
  }
11330
11330
  return 800;
11331
11331
  })();
11332
- s.currentPlayKeyframe && (s.currentPlayKeyframe.originDuration = l);
11333
- const c = this.getSpeededDuration(l);
11334
- return new Promise((d) => {
11335
- xm(() => o.updateCamera(e, c)), setTimeout(() => d(), c);
11332
+ r.currentPlayKeyframe && (r.currentPlayKeyframe.originDuration = c);
11333
+ const d = this.getSpeededDuration(c);
11334
+ return new Promise((f) => {
11335
+ xm(() => s.updateCamera(e, d)), setTimeout(() => f(), d);
11336
11336
  });
11337
11337
  });
11338
11338
  }
package/dist/index.umd.js CHANGED
@@ -527,7 +527,7 @@ void main() {
527
527
  width: 100%;
528
528
  height: 100%;
529
529
  z-index: 5;
530
- `,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=tm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new em({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==fe.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}},om={name:"ItemLabelPlugin",version:0};class sm extends Kn{constructor(e){super(e);m(this,"state");m(this,"container");m(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(pe(H({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(pe(H({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(pe(H({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(pe(H({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=H({},this.state);this.state=H(H(H({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===fe.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(pe(H({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function rm(i){le(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 am(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=te(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(Ue.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){B(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Me(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=Oe(Ue.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:J,o:J,d(c){c&&z(t),i[10](null),a=!1,l()}}}function lm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){ze[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class cm extends se{constructor(t){super(),oe(this,t,lm,am,ie,{props:0,onClick:1},rm)}}function dm(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 um(i){const{camera:t}=i,e=t.getWorldDirection(new F.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 fm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function hm(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 mm={userAction:!0};class pm extends sm{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new F.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,I,E;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 F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),T=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),G=T.clone().sub(n.position).normalize().angleTo(a),X=T.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,O=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=O&&G<Math.PI/2,C.cameraToward=um(this.five),O?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:T,top:N}=l[L-1],{index:G,left:X,top:j}=l[L],P=this.container.children[D],O=this.container.children[G];if(!P||!O)return;const R={left:s*T/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=O.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(E=(I=(y=O.children)==null?void 0:y[0])==null?void 0:I.clientHeight)!=null?E:0};dm(R,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[G].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new F.Vector3(0,0,-1),f=r.clone(),u=new F.Quaternion;u.setFromUnitVectors(d,f);const h=new F.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=fm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new F.Vector3(f.x,f.y,f.z);p.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:hm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>pe(H({},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:mm.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 cm({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 gm=i=>new pm(i),Am=2,vm=3,bm=3,ym=2;function wm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),I=d[g-1],E=I==null?void 0:I.distanceTo(p);if(g>u&&g-u>1){let C=g;I!==void 0&&E>.8&&(C=g+1),I!==void 0&&E>.2&&E<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const G=new F.Vector3().subVectors(d[L+1],d[L]),X=new F.Vector3().subVectors(N,d[L]);G.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),T=Fr(D,e,n);f.push(T),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Fr(d,e,n)]}}function Fr(i,t,e){const n=t/2,o=e/t,s=i.length,r=kl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Am*vm,c=2*s,d=c*bm,f=c*ym,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],I=i[v],{x:E,y:C,z:L}=I,D=new F.Vector3(E+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const T=new F.Vector3(E-w*n,C+.05,L-y*n);h[v*6+3]=T.x,h[v*6+4]=T.y,h[v*6+5]=T.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Cm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Pm(i){return!Ye(i)}function Ye(i){return i!=null}const Gr="v1.1.0",Hr="GuideLinePlugin",eo=`${Hr}@${Gr}`,Nr=i=>`${eo}--${i}`;class Wr extends jt{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${eo} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Hr}_DEBUG__`]:this})}load(e,n,o=!0){return U(this,null,function*(){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,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${eo} loaded`,r))})}formatData(e){return U(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data: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 this.disposedErrorLog();const o=H({},this.state);this.state=H(H({},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),qe(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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(Ye),s=new x.Group;if(s.name=Nr("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(Ye),r=wm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n.unitHeight)!=null?h:.4});if(!r)return;const a=Cm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Nr("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Wr,"lasestVersion",Gr);const _r=(i,t)=>new Wr(i,t);function Xr(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Im(i,t){const e=Xr(i),n=Xr(t);return e.angleTo(n)}const Em=i=>U(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),fi=Math.PI*2;function km(i){return i>=0&&i<fi?i:(i%fi+fi)%fi}function xm(i){return{longitude:km(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Dm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Lm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Yr="v1.0.6",Ur="CruisePlugin",hi=`${Ur}@${Yr}`,Jr=()=>{console.error(`${hi} is disposed`)},Sm=()=>{console.warn(`${hi} is disabled`)},Mm=()=>{console.error(`${hi} is disabled`)},to=new Map;class no extends jt{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ur}_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,f,u,h,p;if(this.state.disposed)return Jr();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=_r(this.five,this.config)),(p=this.GuideLine)==null||p.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.log(`${hi} 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(pe(H({},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 Jr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Mm();const o=H({},this.state);this.state=H(H({},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),qe(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:He(),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 pe(H({id:(c=s.uuid)!=null?c:He(),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 f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(I=>I!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return xm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:H({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:H({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>H({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 h;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=He();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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>U(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Lm(p.stay)),d===!1&&(d=!0)}catch(A){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(e,n){return U(this,null,function*(){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}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(e,n){return U(this,null,function*(){const{five:o,privateState:s,state:r}=this,a=(()=>{var u,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.rotateSpeed)!=null?h:d==null?void 0:d.rotateSpeed;if((d==null?void 0:d.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return d.rotateSpeedUnit==="rad/ms"?f:f/1e3})(),l=(()=>{if(n.duration)return n.duration;if(a){const d=this.five.getCurrentState();return Im(d,e)/a}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const c=this.getSpeededDuration(l);return new Promise(d=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>d(),c)})})}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,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/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,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 to.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return to.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 to.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&&Sm()}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-Dm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(no,"PluginVersion",Yr);const zm=i=>new no(i);function Bm(i){le(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 Zr(i){let t,e,n,o,s,r,a,l=i[3]&&qr(i);return{c(){t=V("div"),e=ve("svg"),n=ve("defs"),o=ve("linearGradient"),s=ve("stop"),r=ve("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),ne(t,"vertical",i[9]),ne(t,"horizontal",!i[9]),M(t,"width",i[8]+"px"),M(t,"height",i[7]+"px")},m(c,d){B(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&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=qr(c),l.c(),k(l,1),l.m(e,null)):l&&(re(),S(l,1,1,()=>{l=null}),ae()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&ne(t,"vertical",c[9]),d&512&&ne(t,"horizontal",!c[9]),d&256&&M(t,"width",c[8]+"px"),d&128&&M(t,"height",c[7]+"px")},d(c){c&&z(t),l&&l.d()}}}function qr(i){let t,e,n,o,s;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){B(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&Se(()=>{o&&o.end(1),n=Bt(t,Jn,{duration:i[2],delay:i[0],easing:gt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=qt(t,Jn,{duration:i[2],delay:i[1],easing:gt})),s=!1},d(r){r&&z(t),r&&o&&o.end()}}}function Tm(i){let t,e=i[8]&&Zr(i);return{c(){e&&e.c(),t=me()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Zr(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&&z(t)}}}function Vm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class io extends se{constructor(t){super(),oe(this,t,Vm,Tm,ie,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Bm)}}function jm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Kr(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=tm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{d(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new em({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},d=()=>{i.off("modeChange",f)},f=g=>{if(g!==fe.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}},om={name:"ItemLabelPlugin",version:0};class sm extends Kn{constructor(e){super(e);m(this,"state");m(this,"container");m(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(pe(H({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(pe(H({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(pe(H({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(pe(H({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=H({},this.state);this.state=H(H(H({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===fe.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(pe(H({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function rm(i){le(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 am(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=te(),s=V("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(Ue.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,d){B(c,t,d),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Me(e,"click",i[9]),a=!0)},p(c,[d]){d&1&&r!==(r=Oe(Ue.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:J,o:J,d(c){c&&z(t),i[10](null),a=!1,l()}}}function lm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:d,cameraToward:f,name:u}=n,h=0;const p=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;d!==h&&(console.log("panoDoorLabelPlugin",d,"\u89E6\u53D1\u57CB\u70B9"),h=d)},A=v=>{o&&o()};function g(v){ze[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},p(),[n,o,s,r,a,l,c,f,u,A,g]}class cm extends se{constructor(t){super(),oe(this,t,lm,am,ie,{props:0,onClick:1},rm)}}function dm(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 um(i){const{camera:t}=i,e=t.getWorldDirection(new F.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 fm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function hm(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 mm={userAction:!0};class pm extends sm{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(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()})});m(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(f=>f.floor_index===c);if(d){const f=d.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(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(),f=d.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new F.Raycaster,h=d.clone().sub(s).normalize();u.set(s,h);const[p]=this.five.model.intersectRaycaster(u);p&&p.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var d,f,u,h,p,A,g,v,w,y,I,E;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 F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,L)=>{if(C.visible){const D=n.position.distanceTo(C.position),T=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),G=T.clone().sub(n.position).normalize().angleTo(a),X=T.clone().project(n),j=(X.x+1)/2.2*100,P=(-X.y+1)/2.2*100,O=j>=0&&j<=100&&P>=0&&P<=100&&D>this.MinVisibledistance&&D<=this.MaxVisibledistance;C.left=j,C.top=P,C.inSight=O&&G<Math.PI/2,C.cameraToward=um(this.five),O?l.push({disFromCameraToLabel:D,left:j,top:P,index:L}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((L,D)=>D.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:D,left:T,top:N}=l[L-1],{index:G,left:X,top:j}=l[L],P=this.container.children[D],O=this.container.children[G];if(!P||!O)return;const R={left:s*T/100,top:r*N/100,width:(u=(f=(d=P.children)==null?void 0:d[0])==null?void 0:f.clientWidth)!=null?u:0,height:(A=(p=(h=P.children)==null?void 0:h[0])==null?void 0:p.clientHeight)!=null?A:0},W={left:s*X/100,top:r*j/100,width:(w=(v=(g=O.children)==null?void 0:g[0])==null?void 0:v.clientWidth)!=null?w:0,height:(E=(I=(y=O.children)==null?void 0:y[0])==null?void 0:I.clientHeight)!=null?E:0};dm(R,W)&&(C++,c[D].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[G].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(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,f=n.distanceTo(d);f<a&&(s=l.panoIndex,r=d.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const d=new F.Vector3(0,0,-1),f=r.clone(),u=new F.Quaternion;u.setFromUnitVectors(d,f);const h=new F.Euler;h.setFromQuaternion(u,"YXZ"),l.longitude=h.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(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,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(d=>{const f=d.position;let u=1/0,h;l.forEach(A=>{const g=A.standingPosition,v={x:g.x,y:g.y,z:g.z},w=fm(f,v);w<u&&(u=w,h=v)}),h&&(f.y=h.y+.01);const p=new F.Vector3(f.x,f.y,f.z);p.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,d.rad,0))),this.doorLabels.push({roomName:r.name,name:d.name,position:p,toward:hm(d.rad)})})}),this.labelItems=this.doorLabels.map(r=>pe(H({},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:mm.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 cm({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 gm=i=>new pm(i),Am=2,vm=3,bm=3,ym=2;function wm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new x.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),d=s.getPoints(c),f=[];let u=0;const h=i;return h.forEach((p,A)=>{let g=0,v=99999999;d.forEach((C,L)=>{const D=C.distanceTo(p);D<v&&(g=L,v=D)});const w=d[g+1],y=w==null?void 0:w.distanceTo(p),I=d[g-1],E=I==null?void 0:I.distanceTo(p);if(g>u&&g-u>1){let C=g;I!==void 0&&E>.8&&(C=g+1),I!==void 0&&E>.2&&E<.3?C=g:v>.2&&v<.3&&(C=g+1);let L=u;if(w!==void 0&&y>.2&&y<.3?L=u+1:v>.2&&v<.3&&(L=u),d[L]&&d[L+1]){const N=h[A-1];if(N)if(N.equals(d[L]))L+=1;else{const G=new F.Vector3().subVectors(d[L+1],d[L]),X=new F.Vector3().subVectors(N,d[L]);G.angleTo(X)<Math.PI/2&&(L+=1)}}if(C<L||C-L<=1)return;const D=d.slice(L,C),T=Fr(D,e,n);f.push(T),u=g}}),f}else{const c=Math.ceil(s.getLength()),d=s.getPoints(c);return[Fr(d,e,n)]}}function Fr(i,t,e){const n=t/2,o=e/t,s=i.length,r=kl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Am*vm,c=2*s,d=c*bm,f=c*ym,u=new Uint32Array(l),h=new Float32Array(d),p=new Float32Array(f);i.forEach((v,w)=>{});let A=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],I=i[v],{x:E,y:C,z:L}=I,D=new F.Vector3(E+w*n,C+.05,L+y*n);h[v*6+0]=D.x,h[v*6+1]=D.y,h[v*6+2]=D.z;const T=new F.Vector3(E-w*n,C+.05,L-y*n);h[v*6+3]=T.x,h[v*6+4]=T.y,h[v*6+5]=T.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=A/t/o;p[v*4+0]=0,p[v*4+1]=N,p[v*4+2]=1,p[v*4+3]=N,v!==i.length-1&&(u[v*6+0]=v*2+0,u[v*6+1]=v*2+2,u[v*6+2]=v*2+1,u[v*6+3]=v*2+2,u[v*6+4]=v*2+3,u[v*6+5]=v*2+1)}const g=new x.BufferGeometry;return g.setAttribute("position",new x.BufferAttribute(h,3)),g.setAttribute("uv",new x.BufferAttribute(p,2)),g.setIndex(new x.BufferAttribute(u,1)),g}function Cm(i){const t=new x.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=x.RepeatWrapping,t.encoding=x.sRGBEncoding,new x.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Pm(i){return!Ye(i)}function Ye(i){return i!=null}const Gr="v1.1.0",Hr="GuideLinePlugin",eo=`${Hr}@${Gr}`,Nr=i=>`${eo}--${i}`;class Wr extends jt{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${eo} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Hr}_DEBUG__`]:this})}load(e,n,o=!0){return U(this,null,function*(){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,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${eo} loaded`,r))})}formatData(e){return U(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data: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 this.disposedErrorLog();const o=H({},this.state);this.state=H(H({},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),qe(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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(Ye),s=new x.Group;if(s.name=Nr("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,d,f,u,h,p,A;const o=new x.Group,s=e.panoIndexList.map(g=>{var v;return(v=this.five.work.observers[g])==null?void 0:v.standingPosition}).filter(Ye),r=wm(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(f=(d=e.unitWidth)!=null?d:n==null?void 0:n.unitWidth)!=null?f:.6,unitHeight:(h=(u=e.unitHeight)!=null?u:n==null?void 0:n.unitHeight)!=null?h:.4});if(!r)return;const a=Cm({textureUrl:(A=(p=e.arrowTextureUrl)!=null?p:n==null?void 0:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(g=>{const v=new x.Mesh(g,a);v.name=Nr("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return U(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Wr,"lasestVersion",Gr);const _r=(i,t)=>new Wr(i,t);function Xr(i){const t=Math.abs(Math.cos(i.latitude));return new x.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Im(i,t){const e=Xr(i),n=Xr(t);return e.angleTo(n)}const Em=i=>U(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),fi=Math.PI*2;function km(i){return i>=0&&i<fi?i:(i%fi+fi)%fi}function xm(i){return{longitude:km(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Dm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Lm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Yr="v1.0.6",Ur="CruisePlugin",hi=`${Ur}@${Yr}`,Jr=()=>{console.error(`${hi} is disposed`)},Sm=()=>{console.warn(`${hi} is disabled`)},Mm=()=>{console.error(`${hi} is disabled`)},to=new Map;class no extends jt{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ur}_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,f,u,h,p;if(this.state.disposed)return Jr();this.privateState.fiveOriginGetProgress||(f=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(h=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:h.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,g)=>{var v;return A.data.panoIndex!==((v=c[g-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const g=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(g!==void 0)if(l===g){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],A]}else{l=g;const y=a.length;a[y]=[A]}}),this.GuideLine||(this.GuideLine=_r(this.five,this.config)),(p=this.GuideLine)==null||p.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.log(`${hi} 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(pe(H({},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 Jr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Mm();const o=H({},this.state);this.state=H(H({},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),qe(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:He(),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 pe(H({id:(c=s.uuid)!=null?c:He(),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 f=(()=>{var g,v,w,y;const u=o.panoIndexList.slice(d).find(I=>I!==c);if(u===void 0)return;const h=(g=n[c])==null?void 0:g.position,p=(v=n[u])==null?void 0:v.position;if(!p||!h||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[u])==null?void 0:y.floorIndex))return;const A=new x.Vector3().subVectors(p,h);return xm(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:d,stay:o.stay,data:H({effect:"Move",panoIndex:c,moveEffect:r},f!=null?f:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:d,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),f&&s.push({moveIndex:d,stay:o.stay,data:H({effect:"Rotate",panoIndex:c},f)}))}),{keyframesId:He(),keyframes:s.map((c,d)=>H({id:He(),index:d},c)),guildPluginOptions:o.guildPluginOptions}}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 h;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=He();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:(h=e==null?void 0:e.userAction)!=null?h:!0});let d=!1;const u=yield(()=>U(this,null,function*(){var p,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(p=this.data)==null?void 0:p.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const p of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&p.index<u))try{r.emit("playIndexChange",p.index,p),yield this.playKeyframe(p,{moveEffect:d===!1?s.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),p.stay&&(yield Lm(p.stay)),d===!1&&(d=!0)}catch(A){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 h,p;const f=(h=a.config)==null?void 0:h.speedConfig,u=(p=e.rotateSpeed)!=null?p:f==null?void 0:f.rotateSpeed;if((f==null?void 0:f.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return f.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const f=this.five.getCurrentState();return Im(f,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(f=>{Em(()=>s.updateCamera(e,d)),setTimeout(()=>f(),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,h;const d=(u=r.config)==null?void 0:u.speedConfig,f=(h=e.moveSpeed)!=null?h:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return f;if(f!==void 0)return d.moveSpeedUnit==="m/ms"?f:f/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,f=o.work.observers[e.panoIndex].position;return d.distanceTo(f)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var f,u,h;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(h=(u=n==null?void 0:n.moveEffect)!=null?u:(f=this.state.config)==null?void 0:f.moveEffect)!=null?h: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 to.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return to.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 to.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&&Sm()}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-Dm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(no,"PluginVersion",Yr);const zm=i=>new no(i);function Bm(i){le(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 Zr(i){let t,e,n,o,s,r,a,l=i[3]&&qr(i);return{c(){t=V("div"),e=ve("svg"),n=ve("defs"),o=ve("linearGradient"),s=ve("stop"),r=ve("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),ne(t,"vertical",i[9]),ne(t,"horizontal",!i[9]),M(t,"width",i[8]+"px"),M(t,"height",i[7]+"px")},m(c,d){B(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&&b(s,"stop-color",c[5]),d&32&&b(r,"stop-color",c[5]),d&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,d),d&8&&k(l,1)):(l=qr(c),l.c(),k(l,1),l.m(e,null)):l&&(re(),S(l,1,1,()=>{l=null}),ae()),d&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),d&512&&ne(t,"vertical",c[9]),d&512&&ne(t,"horizontal",!c[9]),d&256&&M(t,"width",c[8]+"px"),d&128&&M(t,"height",c[7]+"px")},d(c){c&&z(t),l&&l.d()}}}function qr(i){let t,e,n,o,s;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){B(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&Se(()=>{o&&o.end(1),n=Bt(t,Jn,{duration:i[2],delay:i[0],easing:gt}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=qt(t,Jn,{duration:i[2],delay:i[1],easing:gt})),s=!1},d(r){r&&z(t),r&&o&&o.end()}}}function Tm(i){let t,e=i[8]&&Zr(i);return{c(){e&&e.c(),t=me()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Zr(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&&z(t)}}}function Vm(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:d}=t,{length:f}=t,{direction:u="horizontal"}=t,{useLinearColor:h=!1}=t,{color:p="white"}=t;const A=He();return i.$$set=g=>{"inDelay"in g&&e(0,a=g.inDelay),"outDelay"in g&&e(1,l=g.outDelay),"duration"in g&&e(2,c=g.duration),"unfolded"in g&&e(3,d=g.unfolded),"length"in g&&e(11,f=g.length),"direction"in g&&e(12,u=g.direction),"useLinearColor"in g&&e(4,h=g.useLinearColor),"color"in g&&e(5,p=g.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=u==="vertical"),i.$$.dirty&2048&&e(8,o=f),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${f}`)},e(7,s=1),[a,l,c,d,h,p,r,s,o,n,A,f,u]}class io extends se{constructor(t){super(),oe(this,t,Vm,Tm,ie,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Bm)}}function jm(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Kr(i){let t,e,n,o,s;return{c(){t=V("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${_e(i[5])};
532
532
  bottom:${_e(i[6])};
533
533
  box-shadow: 0 0 ${_e(i[10])} ${_e(i[11])} rgba(0, 0, 0, ${i[12]});