@realsee/dnalogel 2.3.1 → 2.3.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 (210) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.js +1 -1
  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 +16 -16
  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/PanoTagPluginController.html +39 -39
  11. package/docs/classes/Util.BetterTween.html +8 -8
  12. package/docs/classes/Util.FivePointSelector.html +12 -12
  13. package/docs/classes/Util.Interval.html +12 -12
  14. package/docs/classes/Util.Magnifier.html +17 -17
  15. package/docs/classes/Util.PointDomHelper.html +11 -11
  16. package/docs/classes/Util.PointHelper.html +11 -11
  17. package/docs/classes/Util.Rectangle.html +13 -13
  18. package/docs/enums/CameraMovementEffect.html +7 -7
  19. package/docs/enums/ContentType.html +12 -12
  20. package/docs/enums/DIRECTION.html +9 -9
  21. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  22. package/docs/enums/DimensionType.html +7 -7
  23. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  24. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  25. package/docs/enums/LinkType.html +7 -7
  26. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  27. package/docs/enums/PointType.html +7 -7
  28. package/docs/enums/Rotation.html +8 -8
  29. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  30. package/docs/functions/CameraMovementPlugin.html +4 -4
  31. package/docs/functions/CruisePlugin.html +4 -4
  32. package/docs/functions/GuideLinePlugin.html +5 -5
  33. package/docs/functions/ItemLabelPlugin.html +4 -4
  34. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  35. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  36. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  37. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  38. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  39. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  40. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  41. package/docs/functions/ModelViewPlugin.html +4 -4
  42. package/docs/functions/Object3DHelperPlugin.html +4 -4
  43. package/docs/functions/PanoCompassPlugin.html +4 -4
  44. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  45. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  46. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  47. package/docs/functions/PanoMeasurePlugin.html +4 -4
  48. package/docs/functions/PanoRulerPlugin.html +4 -4
  49. package/docs/functions/PanoRulerProPlugin.html +4 -4
  50. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  51. package/docs/functions/PanoTagPlugin.html +4 -4
  52. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  53. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  54. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  55. package/docs/functions/Util.getFrameTime.html +5 -5
  56. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  57. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  58. package/docs/functions/Util.isNil.html +5 -5
  59. package/docs/functions/Util.nextFrame.html +5 -5
  60. package/docs/functions/Util.notNil.html +5 -5
  61. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  62. package/docs/functions/Util.tweenProgress.html +5 -5
  63. package/docs/functions/pluginFlag.html +5 -5
  64. package/docs/index.html +4 -4
  65. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  66. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  67. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  68. package/docs/interfaces/ContentTypeMap.html +12 -12
  69. package/docs/interfaces/FloorplanBounding.html +8 -8
  70. package/docs/interfaces/FloorplanData.html +10 -10
  71. package/docs/interfaces/FloorplanEntrance.html +11 -11
  72. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  73. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  74. package/docs/interfaces/FloorplanFloorData.html +9 -9
  75. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  76. package/docs/interfaces/FloorplanObserver.html +9 -9
  77. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  78. package/docs/interfaces/FloorplanPosition.html +7 -7
  79. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  80. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  81. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  82. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  83. package/docs/interfaces/FloorplanServerData.html +7 -7
  84. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  85. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  86. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  87. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  88. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  89. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  90. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  91. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  92. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  93. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  94. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  95. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  96. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  97. package/docs/interfaces/LineJson.html +7 -7
  98. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  99. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  100. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  101. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  102. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  103. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  104. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  105. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  106. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  107. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  108. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  109. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  110. package/docs/interfaces/ModelViewPluginExportType.html +8 -8
  111. package/docs/interfaces/Object3DHelperState.html +8 -8
  112. package/docs/interfaces/OpenParameter.html +7 -7
  113. package/docs/interfaces/PaintBrushAction.html +12 -12
  114. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  115. package/docs/interfaces/PaintBrushState.html +10 -10
  116. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  117. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
  118. package/docs/interfaces/PanoMeasureParameterType.html +11 -11
  119. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  120. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  121. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  122. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  123. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  124. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  125. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  126. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
  127. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
  128. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  129. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  130. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  131. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  132. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  133. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  134. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  135. package/docs/interfaces/Point.html +8 -8
  136. package/docs/interfaces/PointJson.html +8 -8
  137. package/docs/interfaces/Room.html +9 -9
  138. package/docs/interfaces/RoomInfo.html +7 -7
  139. package/docs/interfaces/RoomLabel.html +14 -14
  140. package/docs/interfaces/RoomRules.html +5 -5
  141. package/docs/interfaces/Rooms.html +5 -5
  142. package/docs/interfaces/Scissor.html +9 -9
  143. package/docs/interfaces/TagConfig.html +10 -10
  144. package/docs/interfaces/Tags.html +9 -9
  145. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  146. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  147. package/docs/modules/Util.html +5 -5
  148. package/docs/modules.html +4 -4
  149. package/docs/types/ArrayPosition.html +5 -5
  150. package/docs/types/CSS3DRenderExportType.html +5 -5
  151. package/docs/types/CSS3DRenderPluginExportType.html +5 -5
  152. package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
  153. package/docs/types/Color.html +5 -5
  154. package/docs/types/ContentTypeConfigKey.html +5 -5
  155. package/docs/types/ContentTypeConfigKeyArray.html +5 -5
  156. package/docs/types/Create3DDomContainerReturnType.html +5 -5
  157. package/docs/types/Create3DElementReturnType.html +5 -5
  158. package/docs/types/CruisePluginExportType.html +5 -5
  159. package/docs/types/Direction-1.html +5 -5
  160. package/docs/types/Direction4.html +5 -5
  161. package/docs/types/FloorplanRuleLabels.html +5 -5
  162. package/docs/types/FloorplanServerRuleLabels.html +5 -5
  163. package/docs/types/GuideLinePluginExportType.html +5 -5
  164. package/docs/types/HelperEventMap.html +5 -5
  165. package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
  166. package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
  167. package/docs/types/MediaData.html +5 -5
  168. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
  169. package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
  170. package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
  171. package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
  172. package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
  173. package/docs/types/MoveArgs.html +5 -5
  174. package/docs/types/MoveOpts.html +5 -5
  175. package/docs/types/Object3DHelperEventMap.html +5 -5
  176. package/docs/types/ObjectFit.html +5 -5
  177. package/docs/types/PaintBrushEventMap.html +5 -5
  178. package/docs/types/PanoCompassPluginData.html +5 -5
  179. package/docs/types/PanoCompassPluginExportType.html +5 -5
  180. package/docs/types/PanoCompassPluginParameterType.html +5 -5
  181. package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
  182. package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
  183. package/docs/types/PanoMeasurePluginEvent.html +5 -5
  184. package/docs/types/PanoMeasureReturnType.html +5 -5
  185. package/docs/types/PanoSpatialTagPluginId.html +5 -5
  186. package/docs/types/PanoTagPluginExportInterface.html +5 -5
  187. package/docs/types/PanoTagPluginParamsInterface.html +5 -5
  188. package/docs/types/PlaneTag.html +5 -5
  189. package/docs/types/PointTag.html +5 -5
  190. package/docs/types/Position.html +5 -5
  191. package/docs/types/RotateArgs.html +5 -5
  192. package/docs/types/RotateOpts.html +5 -5
  193. package/docs/types/RuleLabelsKey.html +5 -5
  194. package/docs/types/RuleLabelsValue.html +5 -5
  195. package/docs/types/Tag.html +5 -5
  196. package/docs/types/Tag2D.html +5 -5
  197. package/docs/types/Tag3D.html +5 -5
  198. package/docs/types/TagId.html +5 -5
  199. package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
  200. package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
  201. package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
  202. package/docs/variables/PLUGIN.html +5 -5
  203. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
  204. package/docs/variables/ROOM_TYPE_MAP.html +5 -5
  205. package/docs/variables/VERSION.html +5 -5
  206. package/docs/variables/itemLabelPluginServerParams.html +5 -5
  207. package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
  208. package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
  209. package/libs/PanoDoorLabelPlugin/Controller.js +1 -1
  210. package/package.json +14 -15
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=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$h(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kh({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)},u=()=>{i.off("modeChange",f)},f=A=>{if(A!==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}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);h(this,"state");h(this,"container");h(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(fe(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(fe(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(fe(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(fe(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},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(fe(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(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 sm(i){let t,e,n,o,s,r,a,l;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),n.textContent=`${i[8]}`,o=Z(),s=Q("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ze.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,u){T(c,t,u),O(t,e),O(e,n),O(e,o),O(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=je(Ze.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:ee,o:ee,d(c){c&&z(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:f,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,C=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=C/2||a>=100-C/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Me[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)},m(),[n,o,s,r,a,l,c,f,d,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,te,{props:0,onClick:1},om)}}function lm(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 cm(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 um(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 fm={userAction:!0};class hm extends im{constructor(e){super(e);h(this,"MinVisibledistance",1.8);h(this,"MaxVisibledistance",5);h(this,"OffsetHeight",-1.3);h(this,"rooms");h(this,"floorplanServerData");h(this,"doorLabelItems");h(this,"visibleLabelMap",new Map);h(this,"labelItems",[]);h(this,"doorLabels");h(this,"roomObservers");h(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()})});h(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,u=e==null?void 0:e.find(f=>f.floor_index===c);if(u){const f=u.rooms.find(d=>d.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});h(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});h(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 u=l.position.clone(),f=u.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const d=new F.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});h(this,"fixDoorPosition",()=>{var u,f,d,p,m,g,A,v,C,w,x,D;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((y,L)=>{if(y.visible){const P=n.position.distanceTo(y.position),j=y.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),G=j.clone().sub(n.position).normalize().angleTo(a),U=j.clone().project(n),I=(U.x+1)/2.2*100,S=(-U.y+1)/2.2*100,R=I>=0&&I<=100&&S>=0&&S<=100&&P>this.MinVisibledistance&&P<=this.MaxVisibledistance;y.left=I,y.top=S,y.inSight=R&&G<Math.PI/2,y.cameraToward=cm(this.five),R?l.push({disFromCameraToLabel:P,left:I,top:S,index:L}):y.transform="translate(-50%, -50%)"}else y.inSight=!1}),l.length>1){let y=0;l.sort((L,P)=>P.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:P,left:j,top:B}=l[L-1],{index:G,left:U,top:I}=l[L],S=this.container.children[P],R=this.container.children[G];if(!S||!R)return;const W={left:s*j/100,top:r*B/100,width:(d=(f=(u=S.children)==null?void 0:u[0])==null?void 0:f.clientWidth)!=null?d:0,height:(g=(m=(p=S.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},Y={left:s*U/100,top:r*I/100,width:(C=(v=(A=R.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?C:0,height:(D=(x=(w=R.children)==null?void 0:w[0])==null?void 0:x.clientHeight)!=null?D:0};lm(W,Y)&&(y++,c[P].transform=`translate(-50%, ${(y-1)*100-50}%)`,c[G].transform=`translate(-50%, ${y*100-50}%)`)}}this.labelItems=c,this.render()});h(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(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,f=n.distanceTo(u);f<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),f=r.clone(),d=new F.Quaternion;d.setFromUnitVectors(u,f);const p=new F.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});h(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(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,f)=>!!r.observer_indexs.find(d=>d===f));a&&a.forEach(u=>{const f=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},C=um(f,v);C<d&&(d=C,p=v)}),p&&(f.y=p.y+.01);const m=new F.Vector3(f.x,f.y,f.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>fe(N({},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:fm.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 am({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){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 mm=i=>new hm(i),pm=2,gm=3,Am=3,vm=2;function bm(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 E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),f=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((y,L)=>{const P=y.distanceTo(m);P<v&&(A=L,v=P)});const C=u[A+1],w=C==null?void 0:C.distanceTo(m),x=u[A-1],D=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let y=A;x!==void 0&&D>.8&&(y=A+1),x!==void 0&&D>.2&&D<.3?y=A:v>.2&&v<.3&&(y=A+1);let L=d;if(C!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const B=p[g-1];if(B)if(B.equals(u[L]))L+=1;else{const G=new F.Vector3().subVectors(u[L+1],u[L]),U=new F.Vector3().subVectors(B,u[L]);G.angleTo(U)<Math.PI/2&&(L+=1)}}if(y<L||y-L<=1)return;const P=u.slice(L,y),j=Ms(P,e,n);f.push(j),d=A}}),f}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,f=c*vm,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(f);i.forEach((v,C)=>{});let g=0;for(let v=0;v<i.length;v++){const[C,w]=r[v][0],x=i[v],{x:D,y,z:L}=x,P=new F.Vector3(D+C*n,y+.05,L+w*n);p[v*6+0]=P.x,p[v*6+1]=P.y,p[v*6+2]=P.z;const j=new F.Vector3(D-C*n,y+.05,L-w*n);p[v*6+3]=j.x,p[v*6+4]=j.y,p[v*6+5]=j.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const B=g/t/o;m[v*4+0]=0,m[v*4+1]=B,m[v*4+2]=1,m[v*4+3]=B,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);h(this,"state",{visible:!1,enabled:!0,disposed:!1});h(this,"data");h(this,"linesGroup");h(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});h(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(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);!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(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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=N({},this.state);this.state=N(N({},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){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(f=>{var d;return(d=this.five.work.observers[f])==null?void 0:d.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(f=>{const d=new E.Mesh(f,r);d.name=Ts("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}h(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);h(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});h(this,"data");h(this,"config");h(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});h(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_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 J(this,null,function*(){var u,f,d,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(f=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.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(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,C;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(C=a[w])!=null?C:[],g]}else{l=A;const w=a.length;a[w]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),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(`${di} 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(fe(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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 js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},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 J(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 N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,C;const f=o.panoIndexList.slice(c).find(w=>w!==l);if(f===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[f])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((C=n[f])==null?void 0:C.floorIndex))return;const m=new E.Vector3().subVectors(p,d);return Im(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:He(),keyframes:s.map((l,c)=>N({id:He(),index:c},l))}}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 J(this,null,function*(){var p;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:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){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 J(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 J(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!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 J(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 J(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 J(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==null?void 0:n.duration)})}updateCamera(e,n=800){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,f=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const u=this.five.getCurrentState();a=Cm(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){var f;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(f=n==null?void 0:n.duration)!=null?f:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g: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 J(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 Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.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 Pi.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&&Dm()}waitFiveLoaded(){return J(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-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}h(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Na(i){if(i.length<3)return;const t=i.map(fn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(fn);return Wr(t[0],t[2])}else return fn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){T(a,t,l),O(t,e),O(e,n),O(n,o),O(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&k(r,1)):(r=Os(a),r.c(),k(r,1),r.m(t,null)):r&&(le(),M(r,1,1,()=>{r=null}),ce())},i(a){k(r)},o(a){M(r)},d(a){a&&z(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,te,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=Q("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$h(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kh({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)},u=()=>{i.off("modeChange",f)},f=A=>{if(A!==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}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);h(this,"state");h(this,"container");h(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(fe(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(fe(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(fe(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(fe(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},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(fe(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(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 sm(i){let t,e,n,o,s,r,a,l;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),n.textContent=`${i[8]}`,o=Z(),s=Q("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(Ze.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,u){T(c,t,u),O(t,e),O(e,n),O(e,o),O(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=je(Ze.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:ee,o:ee,d(c){c&&z(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:f,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,C=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=C/2||a>=100-C/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Me[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)},m(),[n,o,s,r,a,l,c,f,d,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,te,{props:0,onClick:1},om)}}function lm(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 cm(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 um(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 fm={userAction:!0};class hm extends im{constructor(e){super(e);h(this,"MinVisibledistance",1.8);h(this,"MaxVisibledistance",5);h(this,"OffsetHeight",-1.3);h(this,"rooms");h(this,"floorplanServerData");h(this,"doorLabelItems");h(this,"visibleLabelMap",new Map);h(this,"labelItems",[]);h(this,"doorLabels");h(this,"roomObservers");h(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()})});h(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,u=e==null?void 0:e.find(f=>f.floor_index===c);if(u){const f=u.rooms.find(d=>d.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});h(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});h(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 u=l.position.clone(),f=u.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const d=new F.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});h(this,"fixDoorPosition",()=>{var u,f,d,p,m,g,A,v,C,w,x,D;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((y,L)=>{if(y.visible){const P=n.position.distanceTo(y.position),j=y.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),G=j.clone().sub(n.position).normalize().angleTo(a),U=j.clone().project(n),I=(U.x+1)/2.2*100,S=(-U.y+1)/2.2*100,R=I>=0&&I<=100&&S>=0&&S<=100&&P>this.MinVisibledistance&&P<=this.MaxVisibledistance;y.left=I,y.top=S,y.inSight=R&&G<Math.PI/2,y.cameraToward=cm(this.five),R?l.push({disFromCameraToLabel:P,left:I,top:S,index:L}):y.transform="translate(-50%, -50%)"}else y.inSight=!1}),l.length>1){let y=0;l.sort((L,P)=>P.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:P,left:j,top:B}=l[L-1],{index:G,left:U,top:I}=l[L],S=this.container.children[P],R=this.container.children[G];if(!S||!R)return;const W={left:s*j/100,top:r*B/100,width:(d=(f=(u=S.children)==null?void 0:u[0])==null?void 0:f.clientWidth)!=null?d:0,height:(g=(m=(p=S.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},Y={left:s*U/100,top:r*I/100,width:(C=(v=(A=R.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?C:0,height:(D=(x=(w=R.children)==null?void 0:w[0])==null?void 0:x.clientHeight)!=null?D:0};lm(W,Y)&&(y++,c[P].transform=`translate(-50%, ${(y-1)*100-50}%)`,c[G].transform=`translate(-50%, ${y*100-50}%)`)}}this.labelItems=c,this.render()});h(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(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,f=n.distanceTo(u);f<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),f=r.clone(),d=new F.Quaternion;d.setFromUnitVectors(u,f);const p=new F.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});h(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(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,f)=>!!r.observer_indexs.find(d=>d===f));a&&a.forEach(u=>{const f=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},C=um(f,v);C<d&&(d=C,p=v)}),p&&(f.y=p.y+.01);const m=new F.Vector3(f.x,f.y,f.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>fe(N({},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:fm.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 am({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 mm=i=>new hm(i),pm=2,gm=3,Am=3,vm=2;function bm(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 E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),f=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((y,L)=>{const P=y.distanceTo(m);P<v&&(A=L,v=P)});const C=u[A+1],w=C==null?void 0:C.distanceTo(m),x=u[A-1],D=x==null?void 0:x.distanceTo(m);if(A>d&&A-d>1){let y=A;x!==void 0&&D>.8&&(y=A+1),x!==void 0&&D>.2&&D<.3?y=A:v>.2&&v<.3&&(y=A+1);let L=d;if(C!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const B=p[g-1];if(B)if(B.equals(u[L]))L+=1;else{const G=new F.Vector3().subVectors(u[L+1],u[L]),U=new F.Vector3().subVectors(B,u[L]);G.angleTo(U)<Math.PI/2&&(L+=1)}}if(y<L||y-L<=1)return;const P=u.slice(L,y),j=Ms(P,e,n);f.push(j),d=A}}),f}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,f=c*vm,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(f);i.forEach((v,C)=>{});let g=0;for(let v=0;v<i.length;v++){const[C,w]=r[v][0],x=i[v],{x:D,y,z:L}=x,P=new F.Vector3(D+C*n,y+.05,L+w*n);p[v*6+0]=P.x,p[v*6+1]=P.y,p[v*6+2]=P.z;const j=new F.Vector3(D-C*n,y+.05,L-w*n);p[v*6+3]=j.x,p[v*6+4]=j.y,p[v*6+5]=j.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const B=g/t/o;m[v*4+0]=0,m[v*4+1]=B,m[v*4+2]=1,m[v*4+3]=B,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);h(this,"state",{visible:!1,enabled:!0,disposed:!1});h(this,"data");h(this,"linesGroup");h(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});h(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(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);!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(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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=N({},this.state);this.state=N(N({},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){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(f=>{var d;return(d=this.five.work.observers[f])==null?void 0:d.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(f=>{const d=new E.Mesh(f,r);d.name=Ts("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}h(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);h(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});h(this,"data");h(this,"config");h(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});h(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_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 J(this,null,function*(){var u,f,d,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(f=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.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(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,C;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(C=a[w])!=null?C:[],g]}else{l=A;const w=a.length;a[w]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),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(`${di} 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(fe(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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 js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},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 J(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 N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,C;const f=o.panoIndexList.slice(c).find(w=>w!==l);if(f===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[f])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((C=n[f])==null?void 0:C.floorIndex))return;const m=new E.Vector3().subVectors(p,d);return Im(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:He(),keyframes:s.map((l,c)=>N({id:He(),index:c},l))}}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 J(this,null,function*(){var p;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:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){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 J(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 J(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!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 J(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 J(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 J(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==null?void 0:n.duration)})}updateCamera(e,n=800){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,f=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const u=this.five.getCurrentState();a=Cm(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){var f;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(f=n==null?void 0:n.duration)!=null?f:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g: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 J(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 Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.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 Pi.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&&Dm()}waitFiveLoaded(){return J(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-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}h(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Na(i){if(i.length<3)return;const t=i.map(fn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(fn);return Wr(t[0],t[2])}else return fn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){T(a,t,l),O(t,e),O(e,n),O(n,o),O(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&k(r,1)):(r=Os(a),r.c(),k(r,1),r.m(t,null)):r&&(le(),M(r,1,1,()=>{r=null}),ce())},i(a){k(r)},o(a){M(r)},d(a){a&&z(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,te,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=Q("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${Ne(i[5])};
532
532
  bottom:${Ne(i[6])};
533
533
  box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
package/dist/index.js CHANGED
@@ -10569,7 +10569,7 @@ class im extends Jf {
10569
10569
  return { enabled: !0, visible: !0 };
10570
10570
  }
10571
10571
  dispose() {
10572
- 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());
10572
+ 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());
10573
10573
  }
10574
10574
  }
10575
10575
  const mA = (i) => new im(i), om = 2, sm = 3, rm = 3, am = 2;
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=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Rf(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Of({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",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==de.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}},Hf={name:"ItemLabelPlugin",version:0};class Nf extends Zn{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===de.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Wf(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 Xf(i){let t,e,n,o,s,r,a,l;return{c(){t=T("div"),e=T("div"),n=T("span"),n.textContent=`${i[8]}`,o=_(),s=T("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(_e.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,u){B(c,t,u),O(t,e),O(e,n),O(e,o),O(e,s),i[10](t),a||(l=Ie(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Oe(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&z(t),i[10](null),a=!1,l()}}}function Yf(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,C=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=C/2||a>=100-C/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){je[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)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class Uf extends oe{constructor(t){super(),ie(this,t,Yf,Xf,ne,{props:0,onClick:1},Wf)}}function Vf(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 Jf(i){const{camera:t}=i,e=t.getWorldDirection(new G.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 Zf(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function _f(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 qf={userAction:!0};class Kf extends Nf{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new G.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,C,w,k,D;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 G.Vector3),l=[],c=[...this.labelItems];if(c.forEach((y,L)=>{if(y.visible){const I=n.position.distanceTo(y.position),Q=y.position.clone().add(new G.Vector3(0,this.OffsetHeight,0)),H=Q.clone().sub(n.position).normalize().angleTo(a),U=Q.clone().project(n),E=(U.x+1)/2.2*100,S=(-U.y+1)/2.2*100,R=E>=0&&E<=100&&S>=0&&S<=100&&I>this.MinVisibledistance&&I<=this.MaxVisibledistance;y.left=E,y.top=S,y.inSight=R&&H<Math.PI/2,y.cameraToward=Jf(this.five),R?l.push({disFromCameraToLabel:I,left:E,top:S,index:L}):y.transform="translate(-50%, -50%)"}else y.inSight=!1}),l.length>1){let y=0;l.sort((L,I)=>I.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:I,left:Q,top:j}=l[L-1],{index:H,left:U,top:E}=l[L],S=this.container.children[I],R=this.container.children[H];if(!S||!R)return;const W={left:s*Q/100,top:r*j/100,width:(d=(h=(u=S.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=S.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},Y={left:s*U/100,top:r*E/100,width:(C=(v=(A=R.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?C:0,height:(D=(k=(w=R.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?D:0};Vf(W,Y)&&(y++,c[I].transform=`translate(-50%, ${(y-1)*100-50}%)`,c[H].transform=`translate(-50%, ${y*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new G.Vector3(0,0,-1),h=r.clone(),d=new G.Quaternion;d.setFromUnitVectors(u,h);const p=new G.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},C=Zf(h,v);C<d&&(d=C,p=v)}),p&&(h.y=p.y+.01);const m=new G.Vector3(h.x,h.y,h.z);m.add(new G.Vector3(-.2,1.8,0).applyEuler(new G.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:_f(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(N({},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:qf.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 Uf({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){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 $f=i=>new Kf(i),em=2,tm=3,nm=3,im=2;function om(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 P.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((y,L)=>{const I=y.distanceTo(m);I<v&&(A=L,v=I)});const C=u[A+1],w=C==null?void 0:C.distanceTo(m),k=u[A-1],D=k==null?void 0:k.distanceTo(m);if(A>d&&A-d>1){let y=A;k!==void 0&&D>.8&&(y=A+1),k!==void 0&&D>.2&&D<.3?y=A:v>.2&&v<.3&&(y=A+1);let L=d;if(C!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const j=p[g-1];if(j)if(j.equals(u[L]))L+=1;else{const H=new G.Vector3().subVectors(u[L+1],u[L]),U=new G.Vector3().subVectors(j,u[L]);H.angleTo(U)<Math.PI/2&&(L+=1)}}if(y<L||y-L<=1)return;const I=u.slice(L,y),Q=Mr(I,e,n);h.push(Q),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Mr(u,e,n)]}}function Mr(i,t,e){const n=t/2,o=e/t,s=i.length,r=cl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*em*tm,c=2*s,u=c*nm,h=c*im,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,C)=>{});let g=0;for(let v=0;v<i.length;v++){const[C,w]=r[v][0],k=i[v],{x:D,y,z:L}=k,I=new G.Vector3(D+C*n,y+.05,L+w*n);p[v*6+0]=I.x,p[v*6+1]=I.y,p[v*6+2]=I.z;const Q=new G.Vector3(D-C*n,y+.05,L-w*n);p[v*6+3]=Q.x,p[v*6+4]=Q.y,p[v*6+5]=Q.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const j=g/t/o;m[v*4+0]=0,m[v*4+1]=j,m[v*4+2]=1,m[v*4+3]=j,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new P.BufferGeometry;return A.setAttribute("position",new P.BufferAttribute(p,3)),A.setAttribute("uv",new P.BufferAttribute(m,2)),A.setIndex(new P.BufferAttribute(d,1)),A}function sm(i){const t=new P.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function rm(i){return!Ot(i)}function Ot(i){return i!=null}const Br="v1.0.1",jr="GuideLinePlugin",$i=`${jr}@${Br}`,Tr=i=>`${$i}--${i}`;class Qr extends jt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${jr}_DEBUG__`]:this})}load(e,n,o=!0){return Z(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);!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(`${$i} loaded`,r))})}formatData(e){return Z(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Z(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Z(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=N({},this.state);this.state=N(N({},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(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){const n=e.map(this.getLine.bind(this)).filter(Ot),o=new P.Group;if(o.name=Tr("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new P.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Ot),s=om(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=sm({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new P.Mesh(h,r);d.name=Tr("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return Z(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Qr,"lasestVersion",Br);const Or=(i,t)=>new Qr(i,t);function Rr(i){const t=Math.abs(Math.cos(i.latitude));return new P.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function am(i,t){const e=Rr(i),n=Rr(t);return e.angleTo(n)}const lm=i=>Z(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),li=Math.PI*2;function cm(i){return i>=0&&i<li?i:(i%li+li)%li}function um(i){return{longitude:cm(-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 hm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fr="v1.0.6",Gr="CruisePlugin",ci=`${Gr}@${Fr}`,Hr=()=>{console.error(`${ci} is disposed`)},fm=()=>{console.warn(`${ci} is disabled`)},mm=()=>{console.error(`${ci} is disabled`)},eo=new Map;class to extends jt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Gr}_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 Z(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return Hr();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.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(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,C;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(C=a[w])!=null?C:[],g]}else{l=A;const w=a.length;a[w]=[g]}}),this.GuideLine||(this.GuideLine=Or(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),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(`${ci} 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(me(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Z(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Z(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 Hr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return mm();const o=N({},this.state);this.state=N(N({},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),$e(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 Z(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:Fe(),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 N({id:(c=s.uuid)!=null?c:Fe(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,C;const h=o.panoIndexList.slice(c).find(w=>w!==l);if(h===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[h])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((C=n[h])==null?void 0:C.floorIndex))return;const m=new P.Vector3().subVectors(p,d);return um(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:Fe(),keyframes:s.map((l,c)=>N({id:Fe(),index:c},l))}}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 Z(this,null,function*(){var p;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=Fe();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:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>Z(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield hm(m.stay)),u===!1&&(u=!0)}catch(g){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 Z(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 Z(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!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 Z(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 Z(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 Z(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==null?void 0:n.duration)})}updateCamera(e,n=800){return Z(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=am(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{lm(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return Z(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g: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 Z(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 eo.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return eo.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 eo.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&&fm()}waitFiveLoaded(){return Z(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)}}f(to,"PluginVersion",Fr);const pm=i=>new to(i);function gm(i,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),o=[],s=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new P.Mesh(n,l);c.position.copy(rt(r)),o.push(c)});else{const r=s[0],a=new P.Mesh(n,r);a.position.copy(rt(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Nr(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function ui(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Lo(t[0],t[2])}else return hn(i)}function di(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Am(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function vm(i,t,e){const o=new P.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new P.Vector3(0,1,0)).setLength(.01),r=new P.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new P.Vector3))}const Wr=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function ym(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Xr(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Je=(i=>(i.Two="2D",i.Three="3D",i))(Je||{}),We=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(We||{}),Xe=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(Xe||{}),hi=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(hi||{});function wm(i){le(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Yr(i){let t,e,n,o;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&De(()=>{n&&n.end(1),e=Mt(t,Un,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=_t(t,Un,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Cm(i){let t,e,n,o,s,r=i[3]&&Yr(i);return{c(){t=ve("svg"),e=ve("defs"),n=ve("linearGradient"),o=ve("stop"),s=ve("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),O(t,e),O(e,n),O(n,o),O(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&x(r,1)):(r=Yr(a),r.c(),x(r,1),r.m(t,null)):r&&(ce(),M(r,1,1,()=>{r=null}),ue())},i(a){x(r)},o(a){M(r)},d(a){a&&z(t),r&&r.d()}}}function Pm(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Fe();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Ur extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},wm)}}function Im(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Vr(i){let t,e,n,o,s;return{c(){t=T("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
530
+ `,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Rf(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Of({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",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==de.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}},Hf={name:"ItemLabelPlugin",version:0};class Nf extends Zn{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===de.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Wf(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 Xf(i){let t,e,n,o,s,r,a,l;return{c(){t=T("div"),e=T("div"),n=T("span"),n.textContent=`${i[8]}`,o=_(),s=T("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Oe(_e.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,u){B(c,t,u),O(t,e),O(e,n),O(e,o),O(e,s),i[10](t),a||(l=Ie(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Oe(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&z(t),i[10](null),a=!1,l()}}}function Yf(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,C=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=C/2||a>=100-C/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){je[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)},m(),[n,o,s,r,a,l,c,h,d,g,A]}class Uf extends oe{constructor(t){super(),ie(this,t,Yf,Xf,ne,{props:0,onClick:1},Wf)}}function Vf(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 Jf(i){const{camera:t}=i,e=t.getWorldDirection(new G.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 Zf(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function _f(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 qf={userAction:!0};class Kf extends Nf{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new G.Raycaster,p=u.clone().sub(s).normalize();d.set(s,p);const[m]=this.five.model.intersectRaycaster(d);m&&m.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,p,m,g,A,v,C,w,k,D;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 G.Vector3),l=[],c=[...this.labelItems];if(c.forEach((y,L)=>{if(y.visible){const I=n.position.distanceTo(y.position),Q=y.position.clone().add(new G.Vector3(0,this.OffsetHeight,0)),H=Q.clone().sub(n.position).normalize().angleTo(a),U=Q.clone().project(n),E=(U.x+1)/2.2*100,S=(-U.y+1)/2.2*100,R=E>=0&&E<=100&&S>=0&&S<=100&&I>this.MinVisibledistance&&I<=this.MaxVisibledistance;y.left=E,y.top=S,y.inSight=R&&H<Math.PI/2,y.cameraToward=Jf(this.five),R?l.push({disFromCameraToLabel:I,left:E,top:S,index:L}):y.transform="translate(-50%, -50%)"}else y.inSight=!1}),l.length>1){let y=0;l.sort((L,I)=>I.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:I,left:Q,top:j}=l[L-1],{index:H,left:U,top:E}=l[L],S=this.container.children[I],R=this.container.children[H];if(!S||!R)return;const W={left:s*Q/100,top:r*j/100,width:(d=(h=(u=S.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(g=(m=(p=S.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},Y={left:s*U/100,top:r*E/100,width:(C=(v=(A=R.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?C:0,height:(D=(k=(w=R.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?D:0};Vf(W,Y)&&(y++,c[I].transform=`translate(-50%, ${(y-1)*100-50}%)`,c[H].transform=`translate(-50%, ${y*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new G.Vector3(0,0,-1),h=r.clone(),d=new G.Quaternion;d.setFromUnitVectors(u,h);const p=new G.Euler;p.setFromQuaternion(d,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},C=Zf(h,v);C<d&&(d=C,p=v)}),p&&(h.y=p.y+.01);const m=new G.Vector3(h.x,h.y,h.z);m.add(new G.Vector3(-.2,1.8,0).applyEuler(new G.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:_f(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(N({},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:qf.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 Uf({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 $f=i=>new Kf(i),em=2,tm=3,nm=3,im=2;function om(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 P.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((y,L)=>{const I=y.distanceTo(m);I<v&&(A=L,v=I)});const C=u[A+1],w=C==null?void 0:C.distanceTo(m),k=u[A-1],D=k==null?void 0:k.distanceTo(m);if(A>d&&A-d>1){let y=A;k!==void 0&&D>.8&&(y=A+1),k!==void 0&&D>.2&&D<.3?y=A:v>.2&&v<.3&&(y=A+1);let L=d;if(C!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const j=p[g-1];if(j)if(j.equals(u[L]))L+=1;else{const H=new G.Vector3().subVectors(u[L+1],u[L]),U=new G.Vector3().subVectors(j,u[L]);H.angleTo(U)<Math.PI/2&&(L+=1)}}if(y<L||y-L<=1)return;const I=u.slice(L,y),Q=Mr(I,e,n);h.push(Q),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Mr(u,e,n)]}}function Mr(i,t,e){const n=t/2,o=e/t,s=i.length,r=cl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*em*tm,c=2*s,u=c*nm,h=c*im,d=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(h);i.forEach((v,C)=>{});let g=0;for(let v=0;v<i.length;v++){const[C,w]=r[v][0],k=i[v],{x:D,y,z:L}=k,I=new G.Vector3(D+C*n,y+.05,L+w*n);p[v*6+0]=I.x,p[v*6+1]=I.y,p[v*6+2]=I.z;const Q=new G.Vector3(D-C*n,y+.05,L-w*n);p[v*6+3]=Q.x,p[v*6+4]=Q.y,p[v*6+5]=Q.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const j=g/t/o;m[v*4+0]=0,m[v*4+1]=j,m[v*4+2]=1,m[v*4+3]=j,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new P.BufferGeometry;return A.setAttribute("position",new P.BufferAttribute(p,3)),A.setAttribute("uv",new P.BufferAttribute(m,2)),A.setIndex(new P.BufferAttribute(d,1)),A}function sm(i){const t=new P.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function rm(i){return!Ot(i)}function Ot(i){return i!=null}const Br="v1.0.1",jr="GuideLinePlugin",$i=`${jr}@${Br}`,Tr=i=>`${$i}--${i}`;class Qr extends jt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${jr}_DEBUG__`]:this})}load(e,n,o=!0){return Z(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);!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(`${$i} loaded`,r))})}formatData(e){return Z(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return Z(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Z(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=N({},this.state);this.state=N(N({},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(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){const n=e.map(this.getLine.bind(this)).filter(Ot),o=new P.Group;if(o.name=Tr("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new P.Group,o=e.panoIndexList.map(h=>{var d;return(d=this.five.work.observers[h])==null?void 0:d.standingPosition}).filter(Ot),s=om(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=sm({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(h=>{const d=new P.Mesh(h,r);d.name=Tr("route-line-mesh"),n.add(d)}),n}waitFiveModelLoaded(){return Z(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Qr,"lasestVersion",Br);const Or=(i,t)=>new Qr(i,t);function Rr(i){const t=Math.abs(Math.cos(i.latitude));return new P.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function am(i,t){const e=Rr(i),n=Rr(t);return e.angleTo(n)}const lm=i=>Z(this,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),li=Math.PI*2;function cm(i){return i>=0&&i<li?i:(i%li+li)%li}function um(i){return{longitude:cm(-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 hm(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fr="v1.0.6",Gr="CruisePlugin",ci=`${Gr}@${Fr}`,Hr=()=>{console.error(`${ci} is disposed`)},fm=()=>{console.warn(`${ci} is disabled`)},mm=()=>{console.error(`${ci} is disabled`)},eo=new Map;class to extends jt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Gr}_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 Z(this,null,function*(){var u,h,d,p,m;if(this.state.disposed)return Hr();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:p.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(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,C;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(C=a[w])!=null?C:[],g]}else{l=A;const w=a.length;a[w]=[g]}}),this.GuideLine||(this.GuideLine=Or(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),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(`${ci} 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(me(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return Z(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return Z(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 Hr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return mm();const o=N({},this.state);this.state=N(N({},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),$e(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 Z(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:Fe(),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 N({id:(c=s.uuid)!=null?c:Fe(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.forEach((l,c)=>{const u=(()=>{var g,A,v,C;const h=o.panoIndexList.slice(c).find(w=>w!==l);if(h===void 0)return;const d=(g=n[l])==null?void 0:g.position,p=(A=n[h])==null?void 0:A.position;if(!p||!d||((v=n[l])==null?void 0:v.floorIndex)!==((C=n[h])==null?void 0:C.floorIndex))return;const m=new P.Vector3().subVectors(p,d);return um(m)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:N({effect:"Move",panoIndex:l,moveEffect:r},u!=null?u:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),u&&s.push({moveIndex:c,stay:o.stay,data:N({effect:"Rotate",panoIndex:l},u)}))}),{keyframesId:Fe(),keyframes:s.map((l,c)=>N({id:Fe(),index:c},l))}}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 Z(this,null,function*(){var p;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=Fe();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:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const d=yield(()=>Z(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&m.index<d))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:800}),m.stay&&(yield hm(m.stay)),u===!1&&(u=!0)}catch(g){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 Z(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 Z(this,null,function*(){var s;const o=e.data;if((s=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!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 Z(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 Z(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 Z(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==null?void 0:n.duration)})}updateCamera(e,n=800){return Z(this,null,function*(){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var d,p;const u=(d=r.config)==null?void 0:d.speedConfig,h=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return h;if(h!==void 0)return u.rotateSpeedUnit==="rad/ms"?h:h/1e3})();if(l){const u=this.five.getCurrentState();a=am(u,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(u=>{lm(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return Z(this,null,function*(){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;o.getCurrentState().mode;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);let l=(h=n==null?void 0:n.duration)!=null?h:800;const c=(()=>{var m,g;const d=(m=r.config)==null?void 0:m.speedConfig,p=(g=e.moveSpeed)!=null?g:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return p;if(p!==void 0)return d.moveSpeedUnit==="m/ms"?p:p/1e3})();if(c&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=o.work.observers[o.panoIndex].position,p=o.work.observers[e.panoIndex].position;l=d.distanceTo(p)/c}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const u=this.getSpeededDuration(l);yield new Promise(d=>{var p,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(p=this.state.config)==null?void 0:p.moveEffect)!=null?g: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 Z(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 eo.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return eo.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 eo.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&&fm()}waitFiveLoaded(){return Z(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)}}f(to,"PluginVersion",Fr);const pm=i=>new to(i);function gm(i,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),o=[],s=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new P.Mesh(n,l);c.position.copy(rt(r)),o.push(c)});else{const r=s[0],a=new P.Mesh(n,r);a.position.copy(rt(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Nr(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function ui(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Lo(t[0],t[2])}else return hn(i)}function di(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Am(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function vm(i,t,e){const o=new P.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new P.Vector3(0,1,0)).setLength(.01),r=new P.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new P.Vector3))}const Wr=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function ym(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Xr(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Je=(i=>(i.Two="2D",i.Three="3D",i))(Je||{}),We=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(We||{}),Xe=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(Xe||{}),hi=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(hi||{});function wm(i){le(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Yr(i){let t,e,n,o;return{c(){t=ve("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&De(()=>{n&&n.end(1),e=Mt(t,Un,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=_t(t,Un,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&z(t),s&&n&&n.end()}}}function Cm(i){let t,e,n,o,s,r=i[3]&&Yr(i);return{c(){t=ve("svg"),e=ve("defs"),n=ve("linearGradient"),o=ve("stop"),s=ve("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),O(t,e),O(e,n),O(n,o),O(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&x(r,1)):(r=Yr(a),r.c(),x(r,1),r.m(t,null)):r&&(ce(),M(r,1,1,()=>{r=null}),ue())},i(a){x(r)},o(a){M(r)},d(a){a&&z(t),r&&r.d()}}}function Pm(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Fe();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Ur extends oe{constructor(t){super(),ie(this,t,Pm,Cm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},wm)}}function Im(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Vr(i){let t,e,n,o,s;return{c(){t=T("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
531
531
  left:${Ye(i[5])};
532
532
  bottom:${Ye(i[6])};
533
533
  box-shadow: 0 0 ${Ye(i[10])} ${Ye(i[11])} rgba(0, 0, 0, ${i[12]});