@realsee/dnalogel 2.14.0-dev.1 → 2.14.0-dev.3

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 (261) hide show
  1. package/dist/PanoTagPlugin/controller/TagUtil.d.ts +1 -1
  2. package/dist/index.cjs.js +2 -2
  3. package/dist/index.js +9 -11
  4. package/dist/index.umd.js +2 -2
  5. package/docs/classes/CSS3DRender.html +4 -4
  6. package/docs/classes/CruisePluginController.html +4 -4
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/Object3DHelperController.html +4 -4
  10. package/docs/classes/PaintBrush.html +4 -4
  11. package/docs/classes/PanoMeasurePluginLine.html +4 -4
  12. package/docs/classes/PanoMeasurePluginModel.html +4 -4
  13. package/docs/classes/PanoMeasurePluginPoint.html +4 -4
  14. package/docs/classes/PanoMeasurePluginPolyline.html +4 -4
  15. package/docs/classes/PanoTagPluginController.html +7 -7
  16. package/docs/classes/Util.BetterTween.html +4 -4
  17. package/docs/classes/Util.FivePointSelector.html +4 -4
  18. package/docs/classes/Util.Interval.html +4 -4
  19. package/docs/classes/Util.Magnifier.html +4 -4
  20. package/docs/classes/Util.PointDomHelper.html +4 -4
  21. package/docs/classes/Util.PointHelper.html +4 -4
  22. package/docs/classes/Util.Rectangle.html +4 -4
  23. package/docs/enums/CameraMovementEffect.html +4 -4
  24. package/docs/enums/ContentType.html +4 -4
  25. package/docs/enums/DIRECTION.html +4 -4
  26. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +4 -4
  27. package/docs/enums/DimensionType.html +4 -4
  28. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +4 -4
  29. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +4 -4
  30. package/docs/enums/PaintBrushTypeEnum.html +4 -4
  31. package/docs/enums/Rotation.html +4 -4
  32. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  33. package/docs/functions/CameraMovementPlugin.html +4 -4
  34. package/docs/functions/CruisePlugin.html +4 -4
  35. package/docs/functions/GuideLinePlugin.html +4 -4
  36. package/docs/functions/ItemLabelPlugin.html +4 -4
  37. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  38. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  39. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  40. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  41. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  42. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  43. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  44. package/docs/functions/ModelViewPlugin.html +4 -4
  45. package/docs/functions/Object3DHelperPlugin.html +4 -4
  46. package/docs/functions/PanoCompassPlugin.html +4 -4
  47. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  48. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  49. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  50. package/docs/functions/PanoMeasurePlugin.html +4 -4
  51. package/docs/functions/PanoRulerPlugin.html +4 -4
  52. package/docs/functions/PanoRulerProPlugin.html +4 -4
  53. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  54. package/docs/functions/PanoTagPlugin.html +4 -4
  55. package/docs/functions/PanoVideoPlugin.html +4 -4
  56. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  57. package/docs/functions/Util.getCoordsFromClient.html +4 -4
  58. package/docs/functions/Util.getCoordsFromElement.html +4 -4
  59. package/docs/functions/Util.getFrameTime.html +4 -4
  60. package/docs/functions/Util.getIntersectFromRelativePosition.html +4 -4
  61. package/docs/functions/Util.getRaycasterFromFivePointer.html +4 -4
  62. package/docs/functions/Util.isNil.html +4 -4
  63. package/docs/functions/Util.nextFrame.html +4 -4
  64. package/docs/functions/Util.notNil.html +4 -4
  65. package/docs/functions/Util.requestAnimationFrameInterval.html +4 -4
  66. package/docs/functions/Util.tweenProgress.html +4 -4
  67. package/docs/functions/pluginFlag.html +4 -4
  68. package/docs/index.html +4 -4
  69. package/docs/interfaces/AddTagConfig.html +4 -4
  70. package/docs/interfaces/CSS3DRenderPluginEventMap.html +4 -4
  71. package/docs/interfaces/CSS3DRenderPluginState.html +4 -4
  72. package/docs/interfaces/CameraMovementPluginExportType.html +4 -4
  73. package/docs/interfaces/EventMap.html +4 -4
  74. package/docs/interfaces/FloorplanBounding.html +4 -4
  75. package/docs/interfaces/FloorplanData.html +4 -4
  76. package/docs/interfaces/FloorplanEntrance.html +4 -4
  77. package/docs/interfaces/FloorplanExtraObject.html +4 -4
  78. package/docs/interfaces/FloorplanExtraObject3D.html +4 -4
  79. package/docs/interfaces/FloorplanFloorData.html +4 -4
  80. package/docs/interfaces/FloorplanImagePosition.html +4 -4
  81. package/docs/interfaces/FloorplanObserver.html +4 -4
  82. package/docs/interfaces/FloorplanOutlineItem.html +4 -4
  83. package/docs/interfaces/FloorplanPosition.html +4 -4
  84. package/docs/interfaces/FloorplanRoomItem.html +4 -4
  85. package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
  86. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  87. package/docs/interfaces/FloorplanServerComputedData.html +4 -4
  88. package/docs/interfaces/FloorplanServerData.html +4 -4
  89. package/docs/interfaces/FloorplanServerDoorItem.html +4 -4
  90. package/docs/interfaces/FloorplanServerDoorPosition.html +4 -4
  91. package/docs/interfaces/FloorplanServerEntrance.html +4 -4
  92. package/docs/interfaces/FloorplanServerFloorData.html +4 -4
  93. package/docs/interfaces/FloorplanServerImagePosition.html +4 -4
  94. package/docs/interfaces/FloorplanServerObserver.html +4 -4
  95. package/docs/interfaces/FloorplanServerOutlineItem.html +4 -4
  96. package/docs/interfaces/FloorplanServerPosition.html +4 -4
  97. package/docs/interfaces/FloorplanServerRoomItem.html +4 -4
  98. package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
  99. package/docs/interfaces/HelperOffset.html +4 -4
  100. package/docs/interfaces/ImagePlaneGroup.html +4 -4
  101. package/docs/interfaces/ItemLabelPluginData.html +4 -4
  102. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +4 -4
  103. package/docs/interfaces/ItemLabelPluginParametersType.html +4 -4
  104. package/docs/interfaces/MinMax.html +4 -4
  105. package/docs/interfaces/ModelChassisCompassPluginData.html +4 -4
  106. package/docs/interfaces/ModelChassisCompassPluginExportType.html +4 -4
  107. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +4 -4
  108. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +4 -4
  109. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +4 -4
  110. package/docs/interfaces/ModelItemLabelPluginData.html +4 -4
  111. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +4 -4
  112. package/docs/interfaces/ModelItemLabelPluginParametersType.html +4 -4
  113. package/docs/interfaces/ModelRoomLabelPluginData.html +4 -4
  114. package/docs/interfaces/ModelTVVideoPluginData.html +4 -4
  115. package/docs/interfaces/ModelTVVideoPluginExportType.html +4 -4
  116. package/docs/interfaces/ModelTVVideoPluginParameterType.html +4 -4
  117. package/docs/interfaces/ModelViewPluginExportType.html +4 -4
  118. package/docs/interfaces/Object3DHelperState.html +4 -4
  119. package/docs/interfaces/ObjectHelperControllers.html +4 -4
  120. package/docs/interfaces/PaintBrushAction.html +4 -4
  121. package/docs/interfaces/PaintBrushConfigs.html +4 -4
  122. package/docs/interfaces/PaintBrushState.html +4 -4
  123. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +4 -4
  124. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +4 -4
  125. package/docs/interfaces/PanoMeasureParameterType.html +4 -4
  126. package/docs/interfaces/PanoMeasurePluginLineJson.html +4 -4
  127. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +4 -4
  128. package/docs/interfaces/PanoMeasurePluginPointJson.html +4 -4
  129. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +4 -4
  130. package/docs/interfaces/PanoRulerPluginExportType.html +4 -4
  131. package/docs/interfaces/PanoRulerPluginOptions.html +4 -4
  132. package/docs/interfaces/PanoRulerPluginParameterType.html +4 -4
  133. package/docs/interfaces/PanoRulerProPluginExportType.html +4 -4
  134. package/docs/interfaces/PanoRulerProPluginOptions.html +4 -4
  135. package/docs/interfaces/PanoRulerProPluginParameterType.html +4 -4
  136. package/docs/interfaces/PanoRulerProPluginState.html +4 -4
  137. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +4 -4
  138. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +4 -4
  139. package/docs/interfaces/PanoSpatialTagPluginData.html +4 -4
  140. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +4 -4
  141. package/docs/interfaces/PanoSpatialTagPluginExportType.html +4 -4
  142. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +4 -4
  143. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +4 -4
  144. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +4 -4
  145. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +4 -4
  146. package/docs/interfaces/PanoVideoPluginType.LoadParams.html +4 -4
  147. package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +4 -4
  148. package/docs/interfaces/PanoVideoPluginType.PluginData.html +4 -4
  149. package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +4 -4
  150. package/docs/interfaces/PanoVideoPluginType.PluginState.html +4 -4
  151. package/docs/interfaces/PanoVideoPluginType.VideoItem.html +4 -4
  152. package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +4 -4
  153. package/docs/interfaces/Point.html +4 -4
  154. package/docs/interfaces/Room.html +4 -4
  155. package/docs/interfaces/RoomInfo.html +4 -4
  156. package/docs/interfaces/RoomLabel.html +4 -4
  157. package/docs/interfaces/RoomRules.html +4 -4
  158. package/docs/interfaces/Rooms.html +4 -4
  159. package/docs/interfaces/Scissor.html +4 -4
  160. package/docs/interfaces/State.html +4 -4
  161. package/docs/interfaces/TagCacheInterface.html +4 -4
  162. package/docs/interfaces/TagConfig.html +4 -4
  163. package/docs/interfaces/TagGLTFObjectGroup.html +4 -4
  164. package/docs/interfaces/TagIconUrl.html +4 -4
  165. package/docs/interfaces/TagObjectGroup.html +4 -4
  166. package/docs/interfaces/TagStyle.html +4 -4
  167. package/docs/interfaces/Tags.html +4 -4
  168. package/docs/interfaces/TemporaryState.html +4 -4
  169. package/docs/interfaces/Util.MagnifierParameter.html +4 -4
  170. package/docs/interfaces/Util.MouseGroupParameter.html +4 -4
  171. package/docs/modules/PanoVideoPluginType.html +4 -4
  172. package/docs/modules/Util.html +4 -4
  173. package/docs/modules.html +4 -4
  174. package/docs/types/ArrayPosition.html +4 -4
  175. package/docs/types/AudioAppearance.html +4 -4
  176. package/docs/types/AudioTagTypeConfigKey.html +4 -4
  177. package/docs/types/CSS3DRenderExportType.html +4 -4
  178. package/docs/types/CSS3DRenderPluginExportType.html +4 -4
  179. package/docs/types/CSS3DRenderPluginParameterType.html +4 -4
  180. package/docs/types/ClassFunctionParameters.html +4 -4
  181. package/docs/types/Color.html +4 -4
  182. package/docs/types/ContentTypeConfigKey.html +4 -4
  183. package/docs/types/ContentTypeConfigKeySplit.html +4 -4
  184. package/docs/types/ContentTypeMap.html +4 -4
  185. package/docs/types/Create3DDomContainerReturnType.html +4 -4
  186. package/docs/types/Create3DElementReturnType.html +4 -4
  187. package/docs/types/CruisePluginExportType.html +4 -4
  188. package/docs/types/Direction-1.html +4 -4
  189. package/docs/types/Direction4.html +4 -4
  190. package/docs/types/FloorplanRuleLabels.html +4 -4
  191. package/docs/types/FloorplanServerRuleLabels.html +4 -4
  192. package/docs/types/GuideLinePluginExportType.html +4 -4
  193. package/docs/types/HelperEventMap.html +4 -4
  194. package/docs/types/LoadTagConfig.html +4 -4
  195. package/docs/types/MapviewFloorplanPluginParameterType.html +4 -4
  196. package/docs/types/MapviewFloorplanPluginReturnType.html +4 -4
  197. package/docs/types/MediaData.html +4 -4
  198. package/docs/types/MediaStore.html +4 -4
  199. package/docs/types/ModelElement.html +4 -4
  200. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +4 -4
  201. package/docs/types/ModelFloorplanPluginParameterType.html +4 -4
  202. package/docs/types/ModelFloorplanPluginReturnType.html +4 -4
  203. package/docs/types/ModelRoomLabelPluginParameters.html +4 -4
  204. package/docs/types/ModelRoomLabelPluginReturnType.html +4 -4
  205. package/docs/types/MoveArgs.html +4 -4
  206. package/docs/types/MoveOpts.html +4 -4
  207. package/docs/types/Object3DHelperEventMap.html +4 -4
  208. package/docs/types/ObjectFit.html +4 -4
  209. package/docs/types/PaintBrushEventMap.html +4 -4
  210. package/docs/types/PanoCompassPluginData.html +4 -4
  211. package/docs/types/PanoCompassPluginExportType.html +4 -4
  212. package/docs/types/PanoCompassPluginParameterType.html +4 -4
  213. package/docs/types/PanoFloorplanRadarPluginParameterType.html +4 -4
  214. package/docs/types/PanoFloorplanRadarPluginReturnType.html +4 -4
  215. package/docs/types/PanoIndex.html +4 -4
  216. package/docs/types/PanoMeasurePluginEvent.html +4 -4
  217. package/docs/types/PanoMeasureReturnType.html +4 -4
  218. package/docs/types/PanoSpatialTagPluginId.html +4 -4
  219. package/docs/types/PanoTagPluginExportInterface.html +4 -4
  220. package/docs/types/PanoTagPluginParamsInterface.html +4 -4
  221. package/docs/types/PanoVideoPluginParameterType.html +4 -4
  222. package/docs/types/PanoVideoPluginReturnType.html +4 -4
  223. package/docs/types/PlaneTag.html +4 -4
  224. package/docs/types/PlaneTagElement.html +4 -4
  225. package/docs/types/Point2DElement.html +4 -4
  226. package/docs/types/Point2DTag.html +4 -4
  227. package/docs/types/Point3DElement.html +4 -4
  228. package/docs/types/Point3DTag.html +4 -4
  229. package/docs/types/PointTag.html +4 -4
  230. package/docs/types/PointTagElement.html +4 -4
  231. package/docs/types/Position.html +4 -4
  232. package/docs/types/RotateArgs.html +4 -4
  233. package/docs/types/RotateOpts.html +4 -4
  234. package/docs/types/RuleLabelsKey.html +4 -4
  235. package/docs/types/RuleLabelsValue.html +4 -4
  236. package/docs/types/StickType.html +4 -4
  237. package/docs/types/Tag.html +4 -4
  238. package/docs/types/Tag2D.html +4 -4
  239. package/docs/types/Tag3D.html +4 -4
  240. package/docs/types/TagContentType.html +4 -4
  241. package/docs/types/TagDimensionType.html +4 -4
  242. package/docs/types/TagElement.html +4 -4
  243. package/docs/types/TagEvents.html +4 -4
  244. package/docs/types/TagGLTFObject.html +4 -4
  245. package/docs/types/TagHooks.html +4 -4
  246. package/docs/types/TagIconSize.html +4 -4
  247. package/docs/types/TagId.html +4 -4
  248. package/docs/types/TopviewFloorplanPluginParameterType.html +4 -4
  249. package/docs/types/TopviewFloorplanPluginReturnType.html +4 -4
  250. package/docs/types/WorkCode.html +4 -4
  251. package/docs/variables/FLOOR_TYPE_MAP.html +4 -4
  252. package/docs/variables/PLUGIN.html +4 -4
  253. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +4 -4
  254. package/docs/variables/ROOM_TYPE_MAP.html +4 -4
  255. package/docs/variables/itemLabelPluginServerParams.html +4 -4
  256. package/docs/variables/modelItemLabelPluginServerParams.html +4 -4
  257. package/docs/variables/modelRoomLabelPluginServerParams.html +4 -4
  258. package/libs/PanoTagPlugin/controller/TagUtil.d.ts +1 -1
  259. package/libs/PanoTagPlugin/controller/TagUtil.js +34 -36
  260. package/libs/base/BasePlugin.js +1 -1
  261. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -112,7 +112,7 @@ transition: all 500ms;
112
112
  svg [type='lineItemGroup'] g g g g {
113
113
  stroke: #ffffff;
114
114
  }</style>
115
- `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Zu extends se{constructor(t){super(),oe(this,t,Ju,qu,ie,{content:0},Uu)}}function Ku(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function $u(i){let t,e;return t=new Yu({props:{url:i[1].url}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function ed(i){let t,e;return t=new Zu({props:{content:i[0]}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function td(i){let t,e,n,o;const s=[ed,$u],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=T("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(re(),x(r[u],1,1,()=>{r[u]=null}),ae()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)):n=null)},i(l){o||(P(n),o=!0)},o(l){x(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function nd(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class ks extends se{constructor(t){super(),oe(this,t,nd,td,ie,{floorIndex:2,floorplanData:3},Ku)}}function id(i){ce(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function od(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Un(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function sd(i){let t,e,n=i[1]&&xs(i),o=i[0]&&Ds(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=ge()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=xs(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Ds(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function xs(i){let t,e=i[2].name+"",n;return{c(){t=T("span"),n=De(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&ze(n,e)},d(o){o&&S(t)}}}function Ds(i){let t,e;return{c(){t=T("span"),e=De(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),V(t,e)},p(n,o){o&128&&ze(e,n[7])},d(n){n&&S(t)}}}function rd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return sd;if(a[8])return od}let s=o(i),r=s&&s(i);return{c(){t=T("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){M(a,t,l),r&&r.m(t,null),e||(n=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[19]),ve(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:X,o:X,d(a){a&&S(t),r&&r.d(),e=!1,We(n)}}}function ad(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function ld(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:d}=t,{hoveredRoom:h}=t,{getRoomAreaText:f}=t,{getLabelElement:v}=t,{adaptiveRoomLabelVisibleEnable:g}=t;function p(G,B){if(B.width===0||B.height===0)return()=>!1;const R=G.path.map(({x:he,y:Ae})=>[he,Ae]),N=G.roomLabel.position,{x:Y,y:_}=N,{width:te,height:U}=B,le=te/2,me=U/2;return function(Ae){const ke=Y*Ae,xe=_*Ae,Be=R.map(([be,Ee])=>[be*Ae,Ee*Ae]);return[[ke+le,xe-me],[ke-le,xe-me],[ke-le,xe+me],[ke+le,xe+me]].every(be=>ad(be,Be))}}const A=document.body.clientWidth,b=document.body.clientHeight,w=d.roomLabel,C=w.positionInImage.x*100+"%",L=w.positionInImage.y*100+"%",I=(A<500||b<500?10:14)+"px";let D=0,k=0,O=!1;h.subscribe(function(B){e(16,O=!!B&&B.id===d.id)});const H=G=>{e(4,D=G.detail)},Q=G=>{e(5,k=G.detail)};return i.$$set=G=>{"pxmm"in G&&e(12,l=G.pxmm),"roomAreaEnable"in G&&e(0,c=G.roomAreaEnable),"roomNameEnable"in G&&e(1,u=G.roomNameEnable),"room"in G&&e(2,d=G.room),"hoveredRoom"in G&&e(13,h=G.hoveredRoom),"getRoomAreaText"in G&&e(14,f=G.getRoomAreaText),"getLabelElement"in G&&e(3,v=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,g=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=v==null?void 0:v(d)),i.$$.dirty&16388&&e(7,o=d.size?f(d.size):""),i.$$.dirty&48&&e(18,s={width:D,height:k}),i.$$.dirty&262148&&e(17,r=s?p(d,s):void 0),i.$$.dirty&233472&&e(6,a=g?O?!0:!!(r!=null&&r(l)):!0)},[c,u,d,v,D,k,a,o,n,C,L,I,l,h,f,g,O,r,s,H,Q]}class cd extends se{constructor(t){super(),oe(this,t,ld,rd,ie,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},id)}}function ud(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ss(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Ls(i,a,c),d=l(u);n.set(d,e[c]=Ms(d,u))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],re(),e=Ze(e,u,l,1,c,a,n,t,Ct,Ms,null,Ls),ae())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)x(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,We(r)}}}function Ms(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new cd({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Fe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function dd(i){let t,e,n=i[8]&&Ss(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&P(n,1)):(n=Ss(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function hd(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:d}=t,h=0,f=0;const v=g=>{e(6,h=g.detail)};return i.$$set=g=>{"floorIndex"in g&&e(9,o=g.floorIndex),"roomAreaEnable"in g&&e(0,s=g.roomAreaEnable),"roomNameEnable"in g&&e(1,r=g.roomNameEnable),"floorplanData"in g&&e(10,a=g.floorplanData),"hoveredRoom"in g&&e(2,l=g.hoveredRoom),"getRoomAreaText"in g&&e(3,c=g.getRoomAreaText),"getLabelElement"in g&&e(4,u=g.getLabelElement),"adaptiveRoomLabelVisibleEnable"in g&&e(5,d=g.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:g,min:p}=a.bounding,A=g.x-p.x;e(7,f=h/A)}},[s,r,l,c,u,d,h,f,n,o,a,v]}class fd extends se{constructor(t){super(),oe(this,t,hd,dd,ie,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},ud)}}function md(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function zs(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ts(i,t,e){const n=i.slice();return n[14]=t[e],n}function Bs(i){let t;return{c(){t=T("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:X,d(e){e&&S(t)}}}function js(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=T("div"),n=T("div"),s=De(o),r=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),J(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),V(e,n),V(n,s),V(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&ze(s,o)},d(a){a&&S(e)}}}function pd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let v=0;v<u.length;v+=1)d[v]=Bs(Ts(i,u,v));let h=i[4];const f=v=>v[13];for(let v=0;v<h.length;v+=1){let g=zs(i,h,v),p=f(g);l.set(p,a[v]=js(p,g))}return{c(){t=T("div"),e=T("div"),n=ee(),o=T("div");for(let v=0;v<d.length;v+=1)d[v].c();s=ee(),r=T("div");for(let v=0;v<a.length;v+=1)a[v].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),J(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),J(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(v,g){M(v,t,g),V(t,e),V(t,n),V(t,o);for(let p=0;p<d.length;p+=1)d[p].m(o,null);V(t,s),V(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(v,[g]){if(g&8){u=v[3];let p;for(p=0;p<u.length;p+=1){const A=Ts(v,u,p);d[p]?d[p].p(A,g):(d[p]=Bs(A),d[p].c(),d[p].m(o,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=u.length}g&22&&(h=v[4],a=Ze(a,g,f,1,v,h,l,r,Xi,js,null,zs)),g&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+v[0]+" svelte-djlmk4")&&y(t,"class",c),g&5&&J(t,"is-row",v[2])},i:X,o:X,d(v){v&&S(t),dt(d,v);for(let g=0;g<a.length;g+=1)a[g].d()}}}const tn=1e3,nn=180;function gd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(tn-nn)*2,c=s.max.y-s.min.y-(tn-nn)*2,u=o.map(([v,g])=>a?[v.x,g.x]:[v.y,g.y]).flat().sort().filter((v,g,p)=>g===0?!0:v!==p[g-1]),d=u.map(v=>{const g=a?(v-s.min.x-tn+nn)/l:0,p=a?0:(v-s.min.y-tn+nn)/c;return{left:g,bottom:p}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],f=u.map((v,g,p)=>{const A=g===0?0:v-p[g-1],b=g===0?0:(v+p[g-1])/2,w=a?(b-s.min.x-tn+nn)/l:0,C=a?0:(b-s.min.y-tn+nn)/c;return{left:w,bottom:C,distance:A}}).filter(({distance:v})=>v/h>.1);return i.$$set=v=>{"type"in v&&e(0,n=v.type),"data"in v&&e(5,o=v.data),"bounding"in v&&e(6,s=v.bounding),"getRuleDistanceText"in v&&e(1,r=v.getRuleDistanceText)},[n,r,a,d,f,o,s]}class Ad extends se{constructor(t){super(),oe(this,t,gd,pd,ie,{type:0,data:5,bounding:6,getRuleDistanceText:1},md)}}function vd(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Vs(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Os(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Ad({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Fe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function bd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Vs(i,s,a),c=r(l);n.set(c,e[a]=Os(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],re(),e=Ze(e,l,r,1,a,s,n,t,Ct,Os,null,Vs),ae()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)x(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Qs=1e3,Fs=180;function yd(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:f}=t,{floorplanData:v}=t,{getRuleDistanceText:g}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,v=p.floorplanData),"getRuleDistanceText"in p&&e(0,g=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=v.bounding),i.$$.dirty&96&&e(11,o=v.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Qs-Fs)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Qs-Fs)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[g,n,h,d,r,f,v,l,u,a,c,o,s]}class wd extends se{constructor(t){super(),oe(this,t,yd,bd,ie,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},vd)}}function ui(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function Rs({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Cd(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Pd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function Id(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Ed(i){let t;return{c(){t=Pe("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:X,o:X,d(e){e&&S(t)}}}function kd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ui(o,{needZ:!0}))},[n,o]}class xd extends se{constructor(t){super(),oe(this,t,kd,Ed,ie,{path:1})}}function Dd(i){let t,e,n,o,s,r;return{c(){t=Pe("defs"),e=Pe("pattern"),n=Pe("rect"),o=Pe("path"),s=ee(),r=Pe("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),V(t,e),V(e,n),V(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:X,o:X,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const Ji=6;function Ld(i,t,e){let n,{path:o}=t;const s=Ji*2,r=`M0 ${Ji} h ${s} M${Ji} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=ui(o,{needZ:!0}))},[n,s,r,o]}class Sd extends se{constructor(t){super(),oe(this,t,Ld,Dd,ie,{path:3})}}function Md(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=Pe("defs"),e=Pe("pattern"),n=Pe("rect"),o=Pe("pattern"),s=Pe("rect"),r=ee(),a=Pe("path"),l=ee(),c=Pe("path"),u=ee(),d=Pe("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(d,"d",i[0]),y(d,"fill","url(#room-material-pattern-2)")},m(h,f){M(h,t,f),V(t,e),V(e,n),V(t,o),V(o,s),M(h,r,f),M(h,a,f),M(h,l,f),M(h,c,f),M(h,u,f),M(h,d,f)},p(h,[f]){f&1&&y(a,"d",h[0]),f&1&&y(c,"d",h[0]),f&1&&y(d,"d",h[0])},i:X,o:X,d(h){h&&S(t),h&&S(r),h&&S(a),h&&S(l),h&&S(c),h&&S(u),h&&S(d)}}}function zd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ui(o,{needZ:!0}))},[n,o]}class Td extends se{constructor(t){super(),oe(this,t,zd,Md,ie,{path:1})}}function Bd(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Gs(i,t,e){const n=i.slice();return n[5]=t[e],n}function jd(i){let t,e;return t=new Sd({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Vd(i){let t,e;return t=new Td({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Od(i){let t,e;return t=new xd({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Ws(i){let t,e,n,o;const s=[Od,Vd,jd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=Pe("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(re(),x(r[u],1,1,()=>{r[u]=null}),ae(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null))},i(l){o||(P(n),o=!0)},o(l){x(n),o=!1},d(l){l&&S(t),r[e].d()}}}function Qd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ws(Gs(i,n,r));const s=r=>x(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Gs(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=Ws(c),o[l].c(),P(o[l],1),o[l].m(t,null))}for(re(),l=n.length;l<o.length;l+=1)s(l);ae()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)P(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)x(o[a]);e=!1},d(r){r&&S(t),dt(o,r)}}}function Fd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>pe(F({},l),{path:l.path.map(c=>Rs(c,s.bounding))})))},[n,r,a,o,s]}class Rd extends se{constructor(t){super(),oe(this,t,Fd,Qd,ie,{floorIndex:3,floorplanData:4},Bd)}}function Gd(i){ce(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Wd(i){let t,e,n,o;return{c(){t=Pe("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){M(s,t,r),n||(o=[ve(t,"mouseenter",i[3]),ve(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:X,o:X,d(s){s&&S(t),n=!1,We(o)}}}function _d(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function d(){l.set(void 0)}const{bounding:h}=a,f=ui(s.path,{needZ:!0,format:v=>Rs(v,h)});return i.$$set=v=>{"room"in v&&e(0,s=v.room),"floorIndex"in v&&e(1,r=v.floorIndex),"floorplanData"in v&&e(6,a=v.floorplanData),"hoveredRoom"in v&&e(7,l=v.hoveredRoom),"highlightData"in v&&e(8,c=v.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,d,f,a,l,c,n]}class Nd extends se{constructor(t){super(),oe(this,t,_d,Wd,ie,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},Gd)}}function Hd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function _s(i,t,e){const n=i.slice();return n[6]=t[e],n}function Ns(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Nd({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Fe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function Xd(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=_s(i,r,l),u=a(c);o.set(u,n[l]=Ns(u,c))}return{c(){t=T("div"),e=Pe("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),V(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,re(),n=Ze(n,c,a,1,l,r,o,e,Ct,Ns,null,_s),ae())},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)x(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Yd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Hs extends se{constructor(t){super(),oe(this,t,Yd,Xd,ie,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},Hd)}}function Ud(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xs(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Hs({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&24834?Fe(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Ys(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new fd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&22370?Fe(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Us(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new wd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&2306?Fe(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function qd(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let d={};for(let A=0;A<u.length;A+=1)d=je(d,u[A]);e=new Rd({props:d});let h=(i[2]||i[3])&&Xs(i);const f=[{floorplanData:i[8],floorIndex:i[1]}];let v={};for(let A=0;A<f.length;A+=1)v=je(v,f[A]);s=new ks({props:v});let g=i[4]&&Ys(i),p=i[7]&&Us(i);return{c(){t=T("div"),$(e.$$.fragment),n=ee(),h&&h.c(),o=ee(),$(s.$$.fragment),r=ee(),g&&g.c(),a=ee(),p&&p.c(),y(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(A,b){M(A,t,b),Z(e,t,null),V(t,n),h&&h.m(t,null),V(t,o),Z(s,t,null),V(t,r),g&&g.m(t,null),V(t,a),p&&p.m(t,null),c=!0},p(A,[b]){const w=b&258?Fe(u,[{floorIndex:A[1],floorplanData:A[8]}]):{};e.$set(w),A[2]||A[3]?h?(h.p(A,b),b&12&&P(h,1)):(h=Xs(A),h.c(),P(h,1),h.m(t,o)):h&&(re(),x(h,1,1,()=>{h=null}),ae());const C=b&258?Fe(f,[{floorplanData:A[8],floorIndex:A[1]}]):{};s.$set(C),A[4]?g?(g.p(A,b),b&16&&P(g,1)):(g=Ys(A),g.c(),P(g,1),g.m(t,a)):g&&(re(),x(g,1,1,()=>{g=null}),ae()),A[7]?p?(p.p(A,b),b&128&&P(p,1)):(p=Us(A),p.c(),P(p,1),p.m(t,null)):p&&(re(),x(p,1,1,()=>{p=null}),ae()),(!c||b&1&&l!==(l=Te(`floorplan-plugin__floor${A[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(A){c||(P(e.$$.fragment,A),P(h),P(s.$$.fragment,A),P(g),P(p),c=!0)},o(A){x(e.$$.fragment,A),x(h),x(s.$$.fragment,A),x(g),x(p),c=!1},d(A){A&&S(t),K(e),h&&h.d(),K(s),g&&g.d(),p&&p.d()}}}function Jd(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:d}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:g}=t,{highlightData:p}=t;const A=qi(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,d=b.floorplanData),"getRoomAreaText"in b&&e(9,h=b.getRoomAreaText),"getLabelElement"in b&&e(10,f=b.getLabelElement),"getRuleDistanceText"in b&&e(11,v=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,g=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,p=b.highlightData)},[n,o,s,r,a,l,c,u,d,h,f,v,g,p,A]}class Zd extends se{constructor(t){super(),oe(this,t,Jd,qd,ie,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Ud)}}function Kd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function qs(i,t,e){const n=i.slice();return n[21]=t[e],n}function Js(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let d=0;d<r.length;d+=1)a[d]=Zs(qs(i,r,d));const l=d=>x(a[d],1,1,()=>{a[d]=null});let c=i[5]&&Ks(i),u=i[8]&&$s(i);return{c(){t=T("div");for(let d=0;d<a.length;d+=1)a[d].c();e=ee(),c&&c.c(),n=ee(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(d,h){M(d,t,h);for(let f=0;f<a.length;f+=1)a[f].m(t,null);V(t,e),c&&c.m(t,null),V(t,n),u&&u.m(t,null),s=!0},p(d,h){if(i=d,h&2047696){r=i[13].floorDatas;let f;for(f=0;f<r.length;f+=1){const v=qs(i,r,f);a[f]?(a[f].p(v,h),P(a[f],1)):(a[f]=Zs(v),a[f].c(),P(a[f],1),a[f].m(t,e))}for(re(),f=r.length;f<a.length;f+=1)l(f);ae()}i[5]?c?(c.p(i,h),h&32&&P(c,1)):(c=Ks(i),c.c(),P(c,1),c.m(t,n)):c&&(re(),x(c,1,1,()=>{c=null}),ae()),i[8]?u?(u.p(i,h),h&256&&P(u,1)):(u=$s(i),u.c(),P(u,1),u.m(t,null)):u&&(re(),x(u,1,1,()=>{u=null}),ae())},i(d){if(!s){for(let h=0;h<r.length;h+=1)P(a[h]);P(c),P(u),o||Qe(()=>{o=St(t,Mt,{duration:i[0],easing:At}),o.start()}),s=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)x(a[h]);x(c),x(u),s=!1},d(d){d&&S(t),dt(a,d),c&&c.d(),u&&u.d()}}}function Zs(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Zd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&2047696?Fe(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Ks(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Vu({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&57352?Fe(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function $s(i){let t,e;return t=new _u({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function $d(i){let t,e,n=i[1]&&Js(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Js(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function eh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:d}=t,{roomLabelsEnable:h}=t,{roomAreaEnable:f}=t,{roomNameEnable:v}=t,{ruleLabelsEnable:g}=t,{floorplanData:p}=t,{lastPanoramaLongitude:A}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:C}=t,{getRuleDistanceText:L}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:D}=t;return i.$$set=k=>{"duration"in k&&e(0,n=k.duration),"visible"in k&&e(1,o=k.visible),"northDesc"in k&&e(2,s=k.northDesc),"panoIndex"in k&&e(3,r=k.panoIndex),"floorIndex"in k&&e(4,a=k.floorIndex),"cameraEnable"in k&&e(5,l=k.cameraEnable),"hoverEnable"in k&&e(6,c=k.hoverEnable),"highlightEnable"in k&&e(7,u=k.highlightEnable),"compassEnable"in k&&e(8,d=k.compassEnable),"roomLabelsEnable"in k&&e(9,h=k.roomLabelsEnable),"roomAreaEnable"in k&&e(10,f=k.roomAreaEnable),"roomNameEnable"in k&&e(11,v=k.roomNameEnable),"ruleLabelsEnable"in k&&e(12,g=k.ruleLabelsEnable),"floorplanData"in k&&e(13,p=k.floorplanData),"lastPanoramaLongitude"in k&&e(14,A=k.lastPanoramaLongitude),"cameraImageUrl"in k&&e(15,b=k.cameraImageUrl),"getRoomAreaText"in k&&e(16,w=k.getRoomAreaText),"getLabelElement"in k&&e(17,C=k.getLabelElement),"getRuleDistanceText"in k&&e(18,L=k.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in k&&e(19,I=k.adaptiveRoomLabelVisibleEnable),"highlightData"in k&&e(20,D=k.highlightData)},[n,o,s,r,a,l,c,u,d,h,f,v,g,p,A,b,w,C,L,I,D]}class Zi extends se{constructor(t){super(),oe(this,t,eh,$d,ie,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Kd)}}const th="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function nh(i){return W(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return W(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function ih(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function oh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ih),rules:i.rules}}function sh(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function rh(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function Et(i){return W(this,null,function*(){const t=yield nh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(oh),o=i.computed_data.entrance?rh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(sh)}})}function ah(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:th,width:45,height:48},a=Id(s,t),l=Cd(s,e),c=Pd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function lh(i,t){return t(i),i}function di(i,t){return lh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function er(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function Ki(i,t,e=Pt.BOUNDING_CENTER){const n=er(i,t),o=er(i,t+1);return e===Pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===Pt.CEILING?o:n}function $i(i,t,e,n){const o=Ki(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class In{constructor(t,e){m(this,"VERSION","2.14.0-dev.1");m(this,"five");m(this,"hooks",new Ft);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends In{}var He=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(He||{});const tr=500,ch=80;function eo(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function nr(i,t){return W(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?eo(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function to(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!eo(e,s,2)||!eo(n,r,2)||o!==a)}function ir(i,t,e=!0){return W(this,null,function*(){if(to(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ri(nr(i,[t.mode,t,void 0,e]));if(u)throw new Error(He.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ri(i.updateCamera(t,l,e));if(c)throw new Error(He.UpdateCameraError)})}function on(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function uh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function dh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class hh extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!to(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,He.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(He.ModelNotLoaded);if(!this.data)throw new Error(He.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ri(ir(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(He.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:tr;on(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,He.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);on(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||dh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();uh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:ch/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const fh=(i,t)=>new hh(i,t);function mh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function ph(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class gh extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!to(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,He.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(He.ModelNotLoaded);if(!this.data)throw new Error(He.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ri(ir(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(He.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:tr;on(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,He.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);on(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),mh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(ph(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Ki(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const Ah=(i,t)=>new gh(i,t);class vh extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Ki(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}_show(e){return W(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield nr(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;on(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return W(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;on(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const bh=(i,t)=>new vh(i,t);function no(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function yh(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function wh(i){let t,e,n;return{c(){t=T("div"),e=T("div"),n=T("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||It)+")"),z(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),V(t,e),V(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||It)+")"),s&2&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:X,o:X,d(o){o&&S(t)}}}function Ch(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ph(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(v,g){const p=v.bounding,A=v.observers[g];if(!A)return"";const b=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,C=Math.floor(A.positionInImage.x*b),L=Math.floor(A.positionInImage.y*w);return`translate(${C}px, ${L}px)`}function h(v){e(6,c=v)}const f=no(v=>{e(7,u=v.longitude)},1e3/60);return Je(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",f)})),i.$$set=v=>{"five"in v&&e(3,s=v.five),"pxmm"in v&&e(4,r=v.pxmm),"floorplanData"in v&&e(5,a=v.floorplanData),"cameraImageUrl"in v&&e(0,l=v.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=Ch(u))},[l,o,n,s,r,a,c,u]}class Ih extends se{constructor(t){super(),oe(this,t,Ph,wh,ie,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},yh)}}function Eh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function or(i,t,e){const n=i.slice();return n[1]=t[e],n}function sr(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=T("div"),n=T("div"),r=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,u){M(c,e,u),V(e,n),V(e,r)},p(c,u){t=c,u&1&&z(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&z(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&z(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&S(e)}}}function kh(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=or(i,o,r),l=s(a);n.set(l,e[r]=sr(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ze(e,a,s,1,r,o,n,t,Xi,sr,null,or))},i:X,o:X,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function xh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Dh extends se{constructor(t){super(),oe(this,t,xh,kh,ie,{extraObjects:0},Eh)}}function rr(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Hs({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&87?Fe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Lh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new ks({props:l}),n=new Dh({props:{extraObjects:i[5]}});let c=i[3]&&rr(i);return{c(){$(t.$$.fragment),e=ee(),$(n.$$.fragment),o=ee(),c&&c.c(),s=ge()},m(u,d){Z(t,u,d),M(u,e,d),Z(n,u,d),M(u,o,d),c&&c.m(u,d),M(u,s,d),r=!0},p(u,[d]){const h=d&20?Fe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const f={};d&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,d),d&8&&P(c,1)):(c=rr(u),c.c(),P(c,1),c.m(s.parentNode,s)):c&&(re(),x(c,1,1,()=>{c=null}),ae())},i(u){r||(P(t.$$.fragment,u),P(n.$$.fragment,u),P(c),r=!0)},o(u){x(t.$$.fragment,u),x(n.$$.fragment,u),x(c),r=!1},d(u){K(t,u),u&&S(e),K(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function Sh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Mh extends se{constructor(t){super(),oe(this,t,Sh,Lh,ie,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function zh(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function ar(i){let t,e,n,o,s=i[6]!==0&&lr(i);return{c(){t=T("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[12]),ve(t,"clientHeight",i[13])],n=!0)},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&P(s,1)):(s=lr(r),s.c(),P(s,1),s.m(t,null)):s&&(re(),x(s,1,1,()=>{s=null}),ae())},i(r){e||(P(s),e=!0)},o(r){x(s),e=!1},d(r){r&&S(t),s&&s.d(),n=!1,We(o)}}}function lr(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=je(c,l[h]);e=new Mh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=je(d,u[h]);return o=new Ih({props:d}),{c(){t=T("div"),$(e.$$.fragment),n=ee(),$(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(h,f){M(h,t,f),Z(e,t,null),V(t,n),Z(o,t,null),a=!0},p(h,f){const v=f&1581?Fe(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(v);const g=f&537?Fe(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(g),f&256&&s!==(s=`${h[8]}px`)&&z(t,"width",s),f&2048&&r!==(r=`${h[11]}px`)&&z(t,"height",r)},i(h){a||(P(e.$$.fragment,h),P(o.$$.fragment,h),a=!0)},o(h){x(e.$$.fragment,h),x(o.$$.fragment,h),a=!1},d(h){h&&S(t),K(e),K(o)}}}function Th(i){let t,e,n=i[1]&&ar(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ar(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Bh(i,t,e){var b,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(b=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?w:0,d=0,h=0,f=0,v=0;function g(C){e(10,u=n.work.observers[C].floorIndex)}Je(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));const p=C=>{e(6,d=C.detail)},A=C=>{e(7,h=C.detail)};return i.$$set=C=>{"five"in C&&e(0,n=C.five),"visible"in C&&e(1,o=C.visible),"hoverEnable"in C&&e(2,s=C.hoverEnable),"floorplanData"in C&&e(3,r=C.floorplanData),"cameraImageUrl"in C&&e(4,a=C.cameraImageUrl),"extraObjects"in C&&e(5,l=C.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const C=Math.min(d,h),{max:L,min:I}=r.bounding,D=L.x-I.x,k=L.y-I.y,O=function(){return D>k?[C,C/D*k]:[C/k*D,C]}();e(8,f=O[0]),e(11,v=O[1]),e(9,c=f/D)}},[n,o,s,r,a,l,d,h,f,c,u,v,p,A]}class jh extends se{constructor(t){super(),oe(this,t,Bh,Th,ie,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},zh)}}class Vh extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:It},s=n!=null&&n.configs?n.configs:{},r=F(F({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return W(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield Et(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=ah(e,this.five,this.data),this.render())}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=F(F({},this.state),e),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=pe(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new jh({target:this.wrapper,props:e})}}const Oh=(i,t)=>new Vh(i,t),Qh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],Fh=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],Rh=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],io=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Gh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(io(o,0,0)),s&&i.applyMatrix4(io(0,s,0)),r&&i.applyMatrix4(io(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function cr(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=F({map:o.material.map||{}},t);o.material=new j.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Wh=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>W(this,null,function*(){var G;const h=(d==null?void 0:d.fbx_url)||e,f=(G=d==null?void 0:d.north_rad)!=null?G:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const v=i.model.bounding,g=v.max.x-v.min.x,p=v.max.z-v.min.z,A=Math.max(g,p),w=yield new Vn.FBXLoader().loadAsync(h);cr(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const C=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:L,z:I},min:{x:D,y:k,z:O}}}}=i;o.yBase=k;const H={x:(L+D)/2,y:k-1.6,z:(I+O)/2},Q=.0045*A;return Gh(w,{position:H,rotation:C,scale:Q}),o.object=w,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const f=d*(4/Math.PI);return o.yBase-(h*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function _h(i,t){var c,u,d,h,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new j.CanvasTexture(a)}const Nh=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),Hh=(i,t)=>{var g,p,A;const e={},n=(g=t.animationEnabled)!=null?g:!0,o=(p=t.position)!=null?p:void 0,s=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>W(this,null,function*(){var H,Q,G,B,R,N,Y,_;const w=(H=b==null?void 0:b.position)!=null?H:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const C=Nh(w),L=(Q=b==null?void 0:b.rad)!=null?Q:s,I=(G=b==null?void 0:b.fbx_url)!=null?G:r;if(e.rad=L,L===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${L}`));const D=yield new Vn.FBXLoader().loadAsync(I);D.position.copy(C),D.rotation.z=L,D.scale.set(.8,.8,.8),cr(D,{transparent:!0,side:E.DoubleSide});const k=(Y=(N=(R=(B=D.children)==null?void 0:B[0])==null?void 0:R.children)==null?void 0:N[3])==null?void 0:Y.clone();if(!k)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${k}`));const O=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return k.material=new j.MeshBasicMaterial({transparent:!0,map:_h(O)}),k.renderOrder=3,D.children[0].add(k),e.object=D,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new j.AnimationMixer(e.object);a.push(w);const C=w.clipAction(e.object.animations[0]);C.timeScale=b;let L;const I=()=>{let H=0,Q=0;const G=1e3/30,B=R=>{H=requestAnimationFrame(B);const N=R-Q;N<G||(Q=R,a.forEach(Y=>Y.update(N/1e3)),i.needsRender=!0)};return H=requestAnimationFrame(B),()=>{cancelAnimationFrame(H)}},O={play:()=>{L||(C.play(),L=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{C.stop(),L==null||L(),L=void 0}};e.animation=O},u=b=>{var C;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((C=b==null?void 0:b.animationEnable)!=null?C:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=b=>b==="Floorplan"?u():d();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class oo extends mn.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=kn(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],mn.default.remove(this)})}}function ur(i,t=mn.default.Easing.Linear.None){const e=new oo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const En=window.requestAnimationFrame||(i=>setTimeout(i,16)),Xh=window.cancelAnimationFrame||clearTimeout;function hi(i,t=0){t<=0?En(i):En(()=>hi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=En(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=En(r),function(){Xh(e)}}function Yh(){const i=Date.now();return new Promise(t=>{En(()=>{t(Date.now()-i)})})}const Uh=On.Easing;function qh(i,t,e,n=Uh.Linear.None){const o=new On.Tween(i).to(t,e).easing(n);hi(()=>o.start(0));const s=kn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Jh(i,t){return qh({progress:0},{progress:1},i,t)}var dr=(i=>(i.Move="Move",i.Rotate="Rotate",i))(dr||{}),nt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(nt||{});const fi=Math.PI*2;function hr(i){return(i%fi+fi)%fi}function fr(i){return i%fi}function so(i,t,e){return i+(t-i)*e}const ro=(i,t,e)=>{const n=Math.PI,o=n*2;return i=hr(i),t=hr(t),e===nt.Anticlockwise&&i<t&&(i+=o),e===nt.Clockwise&&t<i&&(t+=o),e===nt.Loop&&t-i>n?ro(i,t,nt.Anticlockwise):e===nt.Loop&&i-t>n?ro(i,t,nt.Clockwise):{from:i,to:t}},Zh=i=>{const t={},e=(l,c,...u)=>W(this,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((d,h)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=fr(r.latitude),l=fr(s.latitude),{from:c,to:u}=ro(r.longitude,s.longitude,s.rotation||nt.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>W(this,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==fe.Five.Mode.Panorama&&(yield i.changeMode(fe.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,v)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>v(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(f=>{const v=({progress:w})=>{const C={};C.longitude=so(d.longitude,h.longitude,w),C.latitude=so(d.latitude,h.latitude,w),C.fov=so(d.fov,h.fov,w),i.setState(C,!0)},g=()=>{f(!0)},p=()=>{f(!1)},A=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,b=Jh(A,On.Easing.Linear.None).onUpdate(v).onComplete(g).onDestroy(p);s.rotation===nt.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function mr(i,t){return i.x===t.x&&i.y===t.y}function pr(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function mi(i,t){return(t.y-i.y)/(t.x-i.x)}function gr(i,t,e){const n=mi(i[1],i[0]),o=mi(t[1],t[0]);if(isNaN(n)||isNaN(o)||pr(n,o))return!1;if(pi(i[0],t))return i[0];if(pi(i[1],t))return i[1];if(pi(t[0],i))return t[0];if(pi(t[1],i))return t[1];if(e&&!Kh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function pi(i,t){return mr(i,t[0])||mr(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&pr(mi(t[0],i),mi(i,t[1]))}function gi(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Kh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&gi(t[0],i[1],i[0])*gi(i[1],t[1],i[0])>0&&gi(i[0],t[1],t[0])*gi(t[1],i[1],t[0])>0?1:0}function Ar(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ar(i,t-1))}const $h=`<style type="text/css">
115
+ `;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Zu extends se{constructor(t){super(),oe(this,t,Ju,qu,ie,{content:0},Uu)}}function Ku(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function $u(i){let t,e;return t=new Yu({props:{url:i[1].url}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function ed(i){let t,e;return t=new Zu({props:{content:i[0]}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function td(i){let t,e,n,o;const s=[ed,$u],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=T("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(re(),x(r[u],1,1,()=>{r[u]=null}),ae()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)):n=null)},i(l){o||(P(n),o=!0)},o(l){x(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function nd(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class ks extends se{constructor(t){super(),oe(this,t,nd,td,ie,{floorIndex:2,floorplanData:3},Ku)}}function id(i){ce(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function od(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new Un(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function sd(i){let t,e,n=i[1]&&xs(i),o=i[0]&&Ds(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=ge()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=xs(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Ds(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function xs(i){let t,e=i[2].name+"",n;return{c(){t=T("span"),n=De(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&ze(n,e)},d(o){o&&S(t)}}}function Ds(i){let t,e;return{c(){t=T("span"),e=De(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),V(t,e)},p(n,o){o&128&&ze(e,n[7])},d(n){n&&S(t)}}}function rd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return sd;if(a[8])return od}let s=o(i),r=s&&s(i);return{c(){t=T("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){M(a,t,l),r&&r.m(t,null),e||(n=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[19]),ve(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:X,o:X,d(a){a&&S(t),r&&r.d(),e=!1,We(n)}}}function ad(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function ld(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:d}=t,{hoveredRoom:h}=t,{getRoomAreaText:f}=t,{getLabelElement:v}=t,{adaptiveRoomLabelVisibleEnable:g}=t;function p(G,B){if(B.width===0||B.height===0)return()=>!1;const R=G.path.map(({x:he,y:Ae})=>[he,Ae]),N=G.roomLabel.position,{x:Y,y:_}=N,{width:te,height:U}=B,le=te/2,me=U/2;return function(Ae){const ke=Y*Ae,xe=_*Ae,Be=R.map(([be,Ee])=>[be*Ae,Ee*Ae]);return[[ke+le,xe-me],[ke-le,xe-me],[ke-le,xe+me],[ke+le,xe+me]].every(be=>ad(be,Be))}}const A=document.body.clientWidth,b=document.body.clientHeight,w=d.roomLabel,C=w.positionInImage.x*100+"%",L=w.positionInImage.y*100+"%",I=(A<500||b<500?10:14)+"px";let D=0,k=0,O=!1;h.subscribe(function(B){e(16,O=!!B&&B.id===d.id)});const H=G=>{e(4,D=G.detail)},Q=G=>{e(5,k=G.detail)};return i.$$set=G=>{"pxmm"in G&&e(12,l=G.pxmm),"roomAreaEnable"in G&&e(0,c=G.roomAreaEnable),"roomNameEnable"in G&&e(1,u=G.roomNameEnable),"room"in G&&e(2,d=G.room),"hoveredRoom"in G&&e(13,h=G.hoveredRoom),"getRoomAreaText"in G&&e(14,f=G.getRoomAreaText),"getLabelElement"in G&&e(3,v=G.getLabelElement),"adaptiveRoomLabelVisibleEnable"in G&&e(15,g=G.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=v==null?void 0:v(d)),i.$$.dirty&16388&&e(7,o=d.size?f(d.size):""),i.$$.dirty&48&&e(18,s={width:D,height:k}),i.$$.dirty&262148&&e(17,r=s?p(d,s):void 0),i.$$.dirty&233472&&e(6,a=g?O?!0:!!(r!=null&&r(l)):!0)},[c,u,d,v,D,k,a,o,n,C,L,I,l,h,f,g,O,r,s,H,Q]}class cd extends se{constructor(t){super(),oe(this,t,ld,rd,ie,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},id)}}function ud(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ss(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Ls(i,a,c),d=l(u);n.set(d,e[c]=Ms(d,u))}return{c(){t=T("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],re(),e=Ze(e,u,l,1,c,a,n,t,Ct,Ms,null,Ls),ae())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)x(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,We(r)}}}function Ms(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new cd({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Fe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function dd(i){let t,e,n=i[8]&&Ss(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&P(n,1)):(n=Ss(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function hd(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:d}=t,h=0,f=0;const v=g=>{e(6,h=g.detail)};return i.$$set=g=>{"floorIndex"in g&&e(9,o=g.floorIndex),"roomAreaEnable"in g&&e(0,s=g.roomAreaEnable),"roomNameEnable"in g&&e(1,r=g.roomNameEnable),"floorplanData"in g&&e(10,a=g.floorplanData),"hoveredRoom"in g&&e(2,l=g.hoveredRoom),"getRoomAreaText"in g&&e(3,c=g.getRoomAreaText),"getLabelElement"in g&&e(4,u=g.getLabelElement),"adaptiveRoomLabelVisibleEnable"in g&&e(5,d=g.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:g,min:p}=a.bounding,A=g.x-p.x;e(7,f=h/A)}},[s,r,l,c,u,d,h,f,n,o,a,v]}class fd extends se{constructor(t){super(),oe(this,t,hd,dd,ie,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},ud)}}function md(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function zs(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ts(i,t,e){const n=i.slice();return n[14]=t[e],n}function Bs(i){let t;return{c(){t=T("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:X,d(e){e&&S(t)}}}function js(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=T("div"),n=T("div"),s=De(o),r=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),J(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),V(e,n),V(n,s),V(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&ze(s,o)},d(a){a&&S(e)}}}function pd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let v=0;v<u.length;v+=1)d[v]=Bs(Ts(i,u,v));let h=i[4];const f=v=>v[13];for(let v=0;v<h.length;v+=1){let g=zs(i,h,v),p=f(g);l.set(p,a[v]=js(p,g))}return{c(){t=T("div"),e=T("div"),n=ee(),o=T("div");for(let v=0;v<d.length;v+=1)d[v].c();s=ee(),r=T("div");for(let v=0;v<a.length;v+=1)a[v].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),J(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),J(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(v,g){M(v,t,g),V(t,e),V(t,n),V(t,o);for(let p=0;p<d.length;p+=1)d[p].m(o,null);V(t,s),V(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(v,[g]){if(g&8){u=v[3];let p;for(p=0;p<u.length;p+=1){const A=Ts(v,u,p);d[p]?d[p].p(A,g):(d[p]=Bs(A),d[p].c(),d[p].m(o,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=u.length}g&22&&(h=v[4],a=Ze(a,g,f,1,v,h,l,r,Xi,js,null,zs)),g&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+v[0]+" svelte-djlmk4")&&y(t,"class",c),g&5&&J(t,"is-row",v[2])},i:X,o:X,d(v){v&&S(t),dt(d,v);for(let g=0;g<a.length;g+=1)a[g].d()}}}const tn=1e3,nn=180;function gd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(tn-nn)*2,c=s.max.y-s.min.y-(tn-nn)*2,u=o.map(([v,g])=>a?[v.x,g.x]:[v.y,g.y]).flat().sort().filter((v,g,p)=>g===0?!0:v!==p[g-1]),d=u.map(v=>{const g=a?(v-s.min.x-tn+nn)/l:0,p=a?0:(v-s.min.y-tn+nn)/c;return{left:g,bottom:p}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],f=u.map((v,g,p)=>{const A=g===0?0:v-p[g-1],b=g===0?0:(v+p[g-1])/2,w=a?(b-s.min.x-tn+nn)/l:0,C=a?0:(b-s.min.y-tn+nn)/c;return{left:w,bottom:C,distance:A}}).filter(({distance:v})=>v/h>.1);return i.$$set=v=>{"type"in v&&e(0,n=v.type),"data"in v&&e(5,o=v.data),"bounding"in v&&e(6,s=v.bounding),"getRuleDistanceText"in v&&e(1,r=v.getRuleDistanceText)},[n,r,a,d,f,o,s]}class Ad extends se{constructor(t){super(),oe(this,t,gd,pd,ie,{type:0,data:5,bounding:6,getRuleDistanceText:1},md)}}function vd(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Vs(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Os(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Ad({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Fe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function bd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Vs(i,s,a),c=r(l);n.set(c,e[a]=Os(c,l))}return{c(){t=T("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],re(),e=Ze(e,l,r,1,a,s,n,t,Ct,Os,null,Vs),ae()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)x(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Qs=1e3,Fs=180;function yd(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:f}=t,{floorplanData:v}=t,{getRuleDistanceText:g}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,v=p.floorplanData),"getRuleDistanceText"in p&&e(0,g=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=v.bounding),i.$$.dirty&96&&e(11,o=v.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Qs-Fs)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Qs-Fs)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[g,n,h,d,r,f,v,l,u,a,c,o,s]}class wd extends se{constructor(t){super(),oe(this,t,yd,bd,ie,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},vd)}}function ui(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function Rs({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Cd(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Pd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function Id(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Ed(i){let t;return{c(){t=Pe("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:X,o:X,d(e){e&&S(t)}}}function kd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ui(o,{needZ:!0}))},[n,o]}class xd extends se{constructor(t){super(),oe(this,t,kd,Ed,ie,{path:1})}}function Dd(i){let t,e,n,o,s,r;return{c(){t=Pe("defs"),e=Pe("pattern"),n=Pe("rect"),o=Pe("path"),s=ee(),r=Pe("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),V(t,e),V(e,n),V(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:X,o:X,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const Ji=6;function Ld(i,t,e){let n,{path:o}=t;const s=Ji*2,r=`M0 ${Ji} h ${s} M${Ji} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=ui(o,{needZ:!0}))},[n,s,r,o]}class Sd extends se{constructor(t){super(),oe(this,t,Ld,Dd,ie,{path:3})}}function Md(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=Pe("defs"),e=Pe("pattern"),n=Pe("rect"),o=Pe("pattern"),s=Pe("rect"),r=ee(),a=Pe("path"),l=ee(),c=Pe("path"),u=ee(),d=Pe("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(d,"d",i[0]),y(d,"fill","url(#room-material-pattern-2)")},m(h,f){M(h,t,f),V(t,e),V(e,n),V(t,o),V(o,s),M(h,r,f),M(h,a,f),M(h,l,f),M(h,c,f),M(h,u,f),M(h,d,f)},p(h,[f]){f&1&&y(a,"d",h[0]),f&1&&y(c,"d",h[0]),f&1&&y(d,"d",h[0])},i:X,o:X,d(h){h&&S(t),h&&S(r),h&&S(a),h&&S(l),h&&S(c),h&&S(u),h&&S(d)}}}function zd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ui(o,{needZ:!0}))},[n,o]}class Td extends se{constructor(t){super(),oe(this,t,zd,Md,ie,{path:1})}}function Bd(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Gs(i,t,e){const n=i.slice();return n[5]=t[e],n}function jd(i){let t,e;return t=new Sd({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Vd(i){let t,e;return t=new Td({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Od(i){let t,e;return t=new xd({props:{path:i[5].path}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function Ws(i){let t,e,n,o;const s=[Od,Vd,jd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=Pe("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(re(),x(r[u],1,1,()=>{r[u]=null}),ae(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null))},i(l){o||(P(n),o=!0)},o(l){x(n),o=!1},d(l){l&&S(t),r[e].d()}}}function Qd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ws(Gs(i,n,r));const s=r=>x(o[r],1,1,()=>{o[r]=null});return{c(){t=T("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Gs(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=Ws(c),o[l].c(),P(o[l],1),o[l].m(t,null))}for(re(),l=n.length;l<o.length;l+=1)s(l);ae()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)P(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)x(o[a]);e=!1},d(r){r&&S(t),dt(o,r)}}}function Fd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>pe(F({},l),{path:l.path.map(c=>Rs(c,s.bounding))})))},[n,r,a,o,s]}class Rd extends se{constructor(t){super(),oe(this,t,Fd,Qd,ie,{floorIndex:3,floorplanData:4},Bd)}}function Gd(i){ce(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Wd(i){let t,e,n,o;return{c(){t=Pe("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){M(s,t,r),n||(o=[ve(t,"mouseenter",i[3]),ve(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:X,o:X,d(s){s&&S(t),n=!1,We(o)}}}function _d(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function d(){l.set(void 0)}const{bounding:h}=a,f=ui(s.path,{needZ:!0,format:v=>Rs(v,h)});return i.$$set=v=>{"room"in v&&e(0,s=v.room),"floorIndex"in v&&e(1,r=v.floorIndex),"floorplanData"in v&&e(6,a=v.floorplanData),"hoveredRoom"in v&&e(7,l=v.hoveredRoom),"highlightData"in v&&e(8,c=v.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,d,f,a,l,c,n]}class Nd extends se{constructor(t){super(),oe(this,t,_d,Wd,ie,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},Gd)}}function Hd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function _s(i,t,e){const n=i.slice();return n[6]=t[e],n}function Ns(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Nd({props:r}),{key:i,first:null,c(){e=ge(),$(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),Z(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Fe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){x(n.$$.fragment,a),o=!1},d(a){a&&S(e),K(n,a)}}}function Xd(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=_s(i,r,l),u=a(c);o.set(u,n[l]=Ns(u,c))}return{c(){t=T("div"),e=Pe("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),V(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,re(),n=Ze(n,c,a,1,l,r,o,e,Ct,Ns,null,_s),ae())},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)x(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Yd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Hs extends se{constructor(t){super(),oe(this,t,Yd,Xd,ie,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},Hd)}}function Ud(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xs(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Hs({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&24834?Fe(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Ys(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new fd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&22370?Fe(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Us(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new wd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&2306?Fe(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function qd(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let d={};for(let A=0;A<u.length;A+=1)d=je(d,u[A]);e=new Rd({props:d});let h=(i[2]||i[3])&&Xs(i);const f=[{floorplanData:i[8],floorIndex:i[1]}];let v={};for(let A=0;A<f.length;A+=1)v=je(v,f[A]);s=new ks({props:v});let g=i[4]&&Ys(i),p=i[7]&&Us(i);return{c(){t=T("div"),$(e.$$.fragment),n=ee(),h&&h.c(),o=ee(),$(s.$$.fragment),r=ee(),g&&g.c(),a=ee(),p&&p.c(),y(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(A,b){M(A,t,b),Z(e,t,null),V(t,n),h&&h.m(t,null),V(t,o),Z(s,t,null),V(t,r),g&&g.m(t,null),V(t,a),p&&p.m(t,null),c=!0},p(A,[b]){const w=b&258?Fe(u,[{floorIndex:A[1],floorplanData:A[8]}]):{};e.$set(w),A[2]||A[3]?h?(h.p(A,b),b&12&&P(h,1)):(h=Xs(A),h.c(),P(h,1),h.m(t,o)):h&&(re(),x(h,1,1,()=>{h=null}),ae());const C=b&258?Fe(f,[{floorplanData:A[8],floorIndex:A[1]}]):{};s.$set(C),A[4]?g?(g.p(A,b),b&16&&P(g,1)):(g=Ys(A),g.c(),P(g,1),g.m(t,a)):g&&(re(),x(g,1,1,()=>{g=null}),ae()),A[7]?p?(p.p(A,b),b&128&&P(p,1)):(p=Us(A),p.c(),P(p,1),p.m(t,null)):p&&(re(),x(p,1,1,()=>{p=null}),ae()),(!c||b&1&&l!==(l=Te(`floorplan-plugin__floor${A[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(A){c||(P(e.$$.fragment,A),P(h),P(s.$$.fragment,A),P(g),P(p),c=!0)},o(A){x(e.$$.fragment,A),x(h),x(s.$$.fragment,A),x(g),x(p),c=!1},d(A){A&&S(t),K(e),h&&h.d(),K(s),g&&g.d(),p&&p.d()}}}function Jd(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:d}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:g}=t,{highlightData:p}=t;const A=qi(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,d=b.floorplanData),"getRoomAreaText"in b&&e(9,h=b.getRoomAreaText),"getLabelElement"in b&&e(10,f=b.getLabelElement),"getRuleDistanceText"in b&&e(11,v=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,g=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,p=b.highlightData)},[n,o,s,r,a,l,c,u,d,h,f,v,g,p,A]}class Zd extends se{constructor(t){super(),oe(this,t,Jd,qd,ie,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Ud)}}function Kd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function qs(i,t,e){const n=i.slice();return n[21]=t[e],n}function Js(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let d=0;d<r.length;d+=1)a[d]=Zs(qs(i,r,d));const l=d=>x(a[d],1,1,()=>{a[d]=null});let c=i[5]&&Ks(i),u=i[8]&&$s(i);return{c(){t=T("div");for(let d=0;d<a.length;d+=1)a[d].c();e=ee(),c&&c.c(),n=ee(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(d,h){M(d,t,h);for(let f=0;f<a.length;f+=1)a[f].m(t,null);V(t,e),c&&c.m(t,null),V(t,n),u&&u.m(t,null),s=!0},p(d,h){if(i=d,h&2047696){r=i[13].floorDatas;let f;for(f=0;f<r.length;f+=1){const v=qs(i,r,f);a[f]?(a[f].p(v,h),P(a[f],1)):(a[f]=Zs(v),a[f].c(),P(a[f],1),a[f].m(t,e))}for(re(),f=r.length;f<a.length;f+=1)l(f);ae()}i[5]?c?(c.p(i,h),h&32&&P(c,1)):(c=Ks(i),c.c(),P(c,1),c.m(t,n)):c&&(re(),x(c,1,1,()=>{c=null}),ae()),i[8]?u?(u.p(i,h),h&256&&P(u,1)):(u=$s(i),u.c(),P(u,1),u.m(t,null)):u&&(re(),x(u,1,1,()=>{u=null}),ae())},i(d){if(!s){for(let h=0;h<r.length;h+=1)P(a[h]);P(c),P(u),o||Qe(()=>{o=St(t,Mt,{duration:i[0],easing:At}),o.start()}),s=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)x(a[h]);x(c),x(u),s=!1},d(d){d&&S(t),dt(a,d),c&&c.d(),u&&u.d()}}}function Zs(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Zd({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&2047696?Fe(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Ks(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Vu({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&57352?Fe(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function $s(i){let t,e;return t=new _u({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){$(t.$$.fragment)},m(n,o){Z(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){x(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function $d(i){let t,e,n=i[1]&&Js(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Js(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function eh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:d}=t,{roomLabelsEnable:h}=t,{roomAreaEnable:f}=t,{roomNameEnable:v}=t,{ruleLabelsEnable:g}=t,{floorplanData:p}=t,{lastPanoramaLongitude:A}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:C}=t,{getRuleDistanceText:L}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:D}=t;return i.$$set=k=>{"duration"in k&&e(0,n=k.duration),"visible"in k&&e(1,o=k.visible),"northDesc"in k&&e(2,s=k.northDesc),"panoIndex"in k&&e(3,r=k.panoIndex),"floorIndex"in k&&e(4,a=k.floorIndex),"cameraEnable"in k&&e(5,l=k.cameraEnable),"hoverEnable"in k&&e(6,c=k.hoverEnable),"highlightEnable"in k&&e(7,u=k.highlightEnable),"compassEnable"in k&&e(8,d=k.compassEnable),"roomLabelsEnable"in k&&e(9,h=k.roomLabelsEnable),"roomAreaEnable"in k&&e(10,f=k.roomAreaEnable),"roomNameEnable"in k&&e(11,v=k.roomNameEnable),"ruleLabelsEnable"in k&&e(12,g=k.ruleLabelsEnable),"floorplanData"in k&&e(13,p=k.floorplanData),"lastPanoramaLongitude"in k&&e(14,A=k.lastPanoramaLongitude),"cameraImageUrl"in k&&e(15,b=k.cameraImageUrl),"getRoomAreaText"in k&&e(16,w=k.getRoomAreaText),"getLabelElement"in k&&e(17,C=k.getLabelElement),"getRuleDistanceText"in k&&e(18,L=k.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in k&&e(19,I=k.adaptiveRoomLabelVisibleEnable),"highlightData"in k&&e(20,D=k.highlightData)},[n,o,s,r,a,l,c,u,d,h,f,v,g,p,A,b,w,C,L,I,D]}class Zi extends se{constructor(t){super(),oe(this,t,eh,$d,ie,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},Kd)}}const th="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function nh(i){return W(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return W(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function ih(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function oh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ih),rules:i.rules}}function sh(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function rh(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function Et(i){return W(this,null,function*(){const t=yield nh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(oh),o=i.computed_data.entrance?rh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(sh)}})}function ah(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:th,width:45,height:48},a=Id(s,t),l=Cd(s,e),c=Pd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function lh(i,t){return t(i),i}function di(i,t){return lh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function er(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function Ki(i,t,e=Pt.BOUNDING_CENTER){const n=er(i,t),o=er(i,t+1);return e===Pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===Pt.CEILING?o:n}function $i(i,t,e,n){const o=Ki(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class In{constructor(t,e){m(this,"VERSION","2.14.0-dev.3");m(this,"five");m(this,"hooks",new Ft);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends In{}var He=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(He||{});const tr=500,ch=80;function eo(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function nr(i,t){return W(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?eo(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function to(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!eo(e,s,2)||!eo(n,r,2)||o!==a)}function ir(i,t,e=!0){return W(this,null,function*(){if(to(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ri(nr(i,[t.mode,t,void 0,e]));if(u)throw new Error(He.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ri(i.updateCamera(t,l,e));if(c)throw new Error(He.UpdateCameraError)})}function on(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function uh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function dh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class hh extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!to(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,He.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(He.ModelNotLoaded);if(!this.data)throw new Error(He.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ri(ir(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(He.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:tr;on(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,He.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);on(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||dh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();uh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:ch/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const fh=(i,t)=>new hh(i,t);function mh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function ph(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class gh extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!to(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,He.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(He.ModelNotLoaded);if(!this.data)throw new Error(He.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ri(ir(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(He.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:tr;on(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,He.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);on(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),mh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(ph(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Ki(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const Ah=(i,t)=>new gh(i,t);class vh extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"highlightData",{});m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=$i(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});m(this,"unhighlight",()=>{this.highlightData={},this.render()});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:It,attachedTo:Pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?di(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield Et(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Ki(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}_show(e){return W(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield nr(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;on(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return W(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;on(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=pe(F(F({},this.state),e),{config:s}),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=pe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new Zi({target:this.container,intro:!0,props:n})}}const bh=(i,t)=>new vh(i,t);function no(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function yh(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function wh(i){let t,e,n;return{c(){t=T("div"),e=T("div"),n=T("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||It)+")"),z(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),V(t,e),V(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||It)+")"),s&2&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:X,o:X,d(o){o&&S(t)}}}function Ch(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ph(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(v,g){const p=v.bounding,A=v.observers[g];if(!A)return"";const b=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,C=Math.floor(A.positionInImage.x*b),L=Math.floor(A.positionInImage.y*w);return`translate(${C}px, ${L}px)`}function h(v){e(6,c=v)}const f=no(v=>{e(7,u=v.longitude)},1e3/60);return Je(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",f)})),i.$$set=v=>{"five"in v&&e(3,s=v.five),"pxmm"in v&&e(4,r=v.pxmm),"floorplanData"in v&&e(5,a=v.floorplanData),"cameraImageUrl"in v&&e(0,l=v.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=Ch(u))},[l,o,n,s,r,a,c,u]}class Ih extends se{constructor(t){super(),oe(this,t,Ph,wh,ie,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},yh)}}function Eh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function or(i,t,e){const n=i.slice();return n[1]=t[e],n}function sr(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=T("div"),n=T("div"),r=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,u){M(c,e,u),V(e,n),V(e,r)},p(c,u){t=c,u&1&&z(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&z(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&z(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&S(e)}}}function kh(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=or(i,o,r),l=s(a);n.set(l,e[r]=sr(l,a))}return{c(){t=T("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ze(e,a,s,1,r,o,n,t,Xi,sr,null,or))},i:X,o:X,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function xh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Dh extends se{constructor(t){super(),oe(this,t,xh,kh,ie,{extraObjects:0},Eh)}}function rr(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Hs({props:o}),{c(){$(t.$$.fragment)},m(s,r){Z(t,s,r),e=!0},p(s,r){const a=r&87?Fe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){x(t.$$.fragment,s),e=!1},d(s){K(t,s)}}}function Lh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new ks({props:l}),n=new Dh({props:{extraObjects:i[5]}});let c=i[3]&&rr(i);return{c(){$(t.$$.fragment),e=ee(),$(n.$$.fragment),o=ee(),c&&c.c(),s=ge()},m(u,d){Z(t,u,d),M(u,e,d),Z(n,u,d),M(u,o,d),c&&c.m(u,d),M(u,s,d),r=!0},p(u,[d]){const h=d&20?Fe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const f={};d&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,d),d&8&&P(c,1)):(c=rr(u),c.c(),P(c,1),c.m(s.parentNode,s)):c&&(re(),x(c,1,1,()=>{c=null}),ae())},i(u){r||(P(t.$$.fragment,u),P(n.$$.fragment,u),P(c),r=!0)},o(u){x(t.$$.fragment,u),x(n.$$.fragment,u),x(c),r=!1},d(u){K(t,u),u&&S(e),K(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function Sh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Mh extends se{constructor(t){super(),oe(this,t,Sh,Lh,ie,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function zh(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function ar(i){let t,e,n,o,s=i[6]!==0&&lr(i);return{c(){t=T("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ut(Kt.call(null,t)),ve(t,"clientWidth",i[12]),ve(t,"clientHeight",i[13])],n=!0)},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&P(s,1)):(s=lr(r),s.c(),P(s,1),s.m(t,null)):s&&(re(),x(s,1,1,()=>{s=null}),ae())},i(r){e||(P(s),e=!0)},o(r){x(s),e=!1},d(r){r&&S(t),s&&s.d(),n=!1,We(o)}}}function lr(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=je(c,l[h]);e=new Mh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=je(d,u[h]);return o=new Ih({props:d}),{c(){t=T("div"),$(e.$$.fragment),n=ee(),$(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(h,f){M(h,t,f),Z(e,t,null),V(t,n),Z(o,t,null),a=!0},p(h,f){const v=f&1581?Fe(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(v);const g=f&537?Fe(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(g),f&256&&s!==(s=`${h[8]}px`)&&z(t,"width",s),f&2048&&r!==(r=`${h[11]}px`)&&z(t,"height",r)},i(h){a||(P(e.$$.fragment,h),P(o.$$.fragment,h),a=!0)},o(h){x(e.$$.fragment,h),x(o.$$.fragment,h),a=!1},d(h){h&&S(t),K(e),K(o)}}}function Th(i){let t,e,n=i[1]&&ar(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ar(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),x(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){x(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Bh(i,t,e){var b,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(b=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?w:0,d=0,h=0,f=0,v=0;function g(C){e(10,u=n.work.observers[C].floorIndex)}Je(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));const p=C=>{e(6,d=C.detail)},A=C=>{e(7,h=C.detail)};return i.$$set=C=>{"five"in C&&e(0,n=C.five),"visible"in C&&e(1,o=C.visible),"hoverEnable"in C&&e(2,s=C.hoverEnable),"floorplanData"in C&&e(3,r=C.floorplanData),"cameraImageUrl"in C&&e(4,a=C.cameraImageUrl),"extraObjects"in C&&e(5,l=C.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const C=Math.min(d,h),{max:L,min:I}=r.bounding,D=L.x-I.x,k=L.y-I.y,O=function(){return D>k?[C,C/D*k]:[C/k*D,C]}();e(8,f=O[0]),e(11,v=O[1]),e(9,c=f/D)}},[n,o,s,r,a,l,d,h,f,c,u,v,p,A]}class jh extends se{constructor(t){super(),oe(this,t,Bh,Th,ie,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},zh)}}class Vh extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:It},s=n!=null&&n.configs?n.configs:{},r=F(F({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return W(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield Et(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=ah(e,this.five,this.data),this.render())}formatData(e){return W(this,null,function*(){return yield Et(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=F(F({},this.state),e),!tt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=pe(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new jh({target:this.wrapper,props:e})}}const Oh=(i,t)=>new Vh(i,t),Qh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],Fh=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],Rh=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],io=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Gh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(io(o,0,0)),s&&i.applyMatrix4(io(0,s,0)),r&&i.applyMatrix4(io(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function cr(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=F({map:o.material.map||{}},t);o.material=new j.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Wh=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>W(this,null,function*(){var G;const h=(d==null?void 0:d.fbx_url)||e,f=(G=d==null?void 0:d.north_rad)!=null?G:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const v=i.model.bounding,g=v.max.x-v.min.x,p=v.max.z-v.min.z,A=Math.max(g,p),w=yield new Vn.FBXLoader().loadAsync(h);cr(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const C=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:L,z:I},min:{x:D,y:k,z:O}}}}=i;o.yBase=k;const H={x:(L+D)/2,y:k-1.6,z:(I+O)/2},Q=.0045*A;return Gh(w,{position:H,rotation:C,scale:Q}),o.object=w,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const f=d*(4/Math.PI);return o.yBase-(h*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function _h(i,t){var c,u,d,h,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new j.CanvasTexture(a)}const Nh=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),Hh=(i,t)=>{var g,p,A;const e={},n=(g=t.animationEnabled)!=null?g:!0,o=(p=t.position)!=null?p:void 0,s=(A=t.rad)!=null?A:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>W(this,null,function*(){var H,Q,G,B,R,N,Y,_;const w=(H=b==null?void 0:b.position)!=null?H:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const C=Nh(w),L=(Q=b==null?void 0:b.rad)!=null?Q:s,I=(G=b==null?void 0:b.fbx_url)!=null?G:r;if(e.rad=L,L===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${L}`));const D=yield new Vn.FBXLoader().loadAsync(I);D.position.copy(C),D.rotation.z=L,D.scale.set(.8,.8,.8),cr(D,{transparent:!0,side:E.DoubleSide});const k=(Y=(N=(R=(B=D.children)==null?void 0:B[0])==null?void 0:R.children)==null?void 0:N[3])==null?void 0:Y.clone();if(!k)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${k}`));const O=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return k.material=new j.MeshBasicMaterial({transparent:!0,map:_h(O)}),k.renderOrder=3,D.children[0].add(k),e.object=D,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new j.AnimationMixer(e.object);a.push(w);const C=w.clipAction(e.object.animations[0]);C.timeScale=b;let L;const I=()=>{let H=0,Q=0;const G=1e3/30,B=R=>{H=requestAnimationFrame(B);const N=R-Q;N<G||(Q=R,a.forEach(Y=>Y.update(N/1e3)),i.needsRender=!0)};return H=requestAnimationFrame(B),()=>{cancelAnimationFrame(H)}},O={play:()=>{L||(C.play(),L=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{C.stop(),L==null||L(),L=void 0}};e.animation=O},u=b=>{var C;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((C=b==null?void 0:b.animationEnable)!=null?C:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=b=>b==="Floorplan"?u():d();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class oo extends mn.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=kn(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],mn.default.remove(this)})}}function ur(i,t=mn.default.Easing.Linear.None){const e=new oo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const En=window.requestAnimationFrame||(i=>setTimeout(i,16)),Xh=window.cancelAnimationFrame||clearTimeout;function hi(i,t=0){t<=0?En(i):En(()=>hi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=En(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=En(r),function(){Xh(e)}}function Yh(){const i=Date.now();return new Promise(t=>{En(()=>{t(Date.now()-i)})})}const Uh=On.Easing;function qh(i,t,e,n=Uh.Linear.None){const o=new On.Tween(i).to(t,e).easing(n);hi(()=>o.start(0));const s=kn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Jh(i,t){return qh({progress:0},{progress:1},i,t)}var dr=(i=>(i.Move="Move",i.Rotate="Rotate",i))(dr||{}),nt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(nt||{});const fi=Math.PI*2;function hr(i){return(i%fi+fi)%fi}function fr(i){return i%fi}function so(i,t,e){return i+(t-i)*e}const ro=(i,t,e)=>{const n=Math.PI,o=n*2;return i=hr(i),t=hr(t),e===nt.Anticlockwise&&i<t&&(i+=o),e===nt.Clockwise&&t<i&&(t+=o),e===nt.Loop&&t-i>n?ro(i,t,nt.Anticlockwise):e===nt.Loop&&i-t>n?ro(i,t,nt.Clockwise):{from:i,to:t}},Zh=i=>{const t={},e=(l,c,...u)=>W(this,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((d,h)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=fr(r.latitude),l=fr(s.latitude),{from:c,to:u}=ro(r.longitude,s.longitude,s.rotation||nt.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>W(this,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==fe.Five.Mode.Panorama&&(yield i.changeMode(fe.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,v)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>v(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(f=>{const v=({progress:w})=>{const C={};C.longitude=so(d.longitude,h.longitude,w),C.latitude=so(d.latitude,h.latitude,w),C.fov=so(d.fov,h.fov,w),i.setState(C,!0)},g=()=>{f(!0)},p=()=>{f(!1)},A=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,b=Jh(A,On.Easing.Linear.None).onUpdate(v).onComplete(g).onDestroy(p);s.rotation===nt.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function mr(i,t){return i.x===t.x&&i.y===t.y}function pr(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function mi(i,t){return(t.y-i.y)/(t.x-i.x)}function gr(i,t,e){const n=mi(i[1],i[0]),o=mi(t[1],t[0]);if(isNaN(n)||isNaN(o)||pr(n,o))return!1;if(pi(i[0],t))return i[0];if(pi(i[1],t))return i[1];if(pi(t[0],i))return t[0];if(pi(t[1],i))return t[1];if(e&&!Kh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function pi(i,t){return mr(i,t[0])||mr(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&pr(mi(t[0],i),mi(i,t[1]))}function gi(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Kh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&gi(t[0],i[1],i[0])*gi(i[1],t[1],i[0])>0&&gi(i[0],t[1],t[0])*gi(t[1],i[1],t[0])>0?1:0}function Ar(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ar(i,t-1))}const $h=`<style type="text/css">
116
116
  .PanoRulerPlugin-rule-line {
117
117
  position: absolute;
118
118
  transform-origin: left center;
@@ -542,7 +542,7 @@ void main() {
542
542
  float match = 1.0 - uv.x;
543
543
  gl_FragColor = vec4(1.0,1.0,1.0,match);
544
544
  }
545
- `;function eg(){const i=new E.PlaneGeometry(.4,.4),t=Zp,e=new E.TextureLoader().load(t);e.encoding=E.sRGBEncoding,e.minFilter=E.LinearFilter;const n=new E.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new E.Mesh(i,n)}function tg(){const i=new E.CurvePath;i.add(new E.LineCurve3(new E.Vector3(0,0,0),new E.Vector3(0,0,.1)));const t=new E.TubeGeometry(i,8,.003),e=new E.ShaderMaterial({vertexShader:Kp,fragmentShader:$p,depthTest:!1,transparent:!0});return new E.Mesh(t,e)}function ng(){const i=new E.SphereGeometry(.01,20,20),t=new E.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:E.DoubleSide}),e=new E.Mesh(i,t);return e.position.set(0,0,.1),e}class wa extends E.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=eg(),this.lineMesh=tg(),this.ballMesh=ng(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new E.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class Ca{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=Wt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Mr})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new oo({progress:0}).to({progress:[1,0]}).duration(500).easing(On.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class ig{constructor(t,e){m(this,"five");m(this,"hooks",new fe.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new ba(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new wa:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new Ca(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const og=Object.freeze(Object.defineProperty({__proto__:null,Interval:bo,Rectangle:Xp,Magnifier:ba,getCoordsFromClient:Up,getCoordsFromElement:ya,getRaycasterFromFivePointer:qp,getIntersectFromRelativePosition:Jp,PointHelper:wa,PointDomHelper:Ca,FivePointSelector:ig,isNil:Pp,notNil:kt,BetterTween:oo,tweenProgress:ur,nextFrame:hi,requestAnimationFrameInterval:kn,getFrameTime:Yh},Symbol.toStringTag,{value:"Module"})),sg={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class rg extends In{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,d,h;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(d=(u=s.work)==null?void 0:u.workCode)!=null?d:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const f=l.get(n);return f||(l.set(n,{}),l.get(n))}return(h=l.get(n))==null?void 0:h[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const ag=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;function ye(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}ye.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},ye.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],ye.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}},ye.prototype._objectCtxInit=function(i){i._3xDomEvent={}},ye.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent},ye.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent},ye.prototype._objectCtxGet=function(i){return i._3xDomEvent},ye.prototype.camera=function(i){return i&&(this._camera=i),this._camera},ye.prototype.bind=function(i,t,e,n){console.assert(ye.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)},ye.prototype.addEventListener=ye.prototype.bind,ye.prototype.unbind=function(i,t,e,n){console.assert(ye.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)},ye.prototype.removeEventListener=ye.prototype.unbind,ye.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1},ye.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,d=r[0],h=d.object;this._selected=h,u=this._bound("mousemove",h),a!=h&&(l=this._bound("mouseover",h),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",h,n,d),l&&this._notify("mouseover",h,n,d),c&&this._notify("mouseout",a,n,d)}},ye.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}},ye.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}},ye.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)},ye.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)},ye.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)},ye.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)},ye.prototype._onClick=function(i){this._onMouseEvent("click",i)},ye.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)},ye.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)},ye.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)},ye.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)},ye.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}},ye.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){t.preventDefault();var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class lg extends rg{constructor(e){super(e);m(this,"tags",[]);m(this,"config",sg);m(this,"mediaStore",qi({currentMediaElement:null}));m(this,"css3DRenderPlugin");m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"domEvents");m(this,"mouseInfo");m(this,"fiveWantMovePanoHandler",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new ye(this.five.camera,n)),this.five.on("wantsMoveToPano",this.fiveWantMovePanoHandler),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.fiveWantMovePanoHandler)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",d="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===d||d==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",d,h]=c;if(d==="Audio"&&e.contentType==="Audio"){const f=e;(f.stickType===u||u==="Any")&&f.data.appearance===h&&(n[l]=this.config.contentTypeConfig[l])}}});const o=mt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){ag&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}if(e==="renderByMesh")if(Vp(o)||Re(o)){const r=o.data.mediaData;return r.length===1&&r[0].type==="Image"&&s.renderType==="Mesh"}else return!1;return!0}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?vn(e.normal):Ao(e.position))();if(!u)return;const d=ki(e.position);if(!d)return;const h=new E.Vector3().copy(c).sub(d),f=u.angleTo(h)*180/Math.PI;return s.angle=f,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=Op(e);if(!u)return-1;const d=c.distanceTo(u);return s.distance=d,d}}getPositions(e){if(Bp(e))return e.position;if(Re(e))return e.data.mediaPosition;const n=e;return Fp(this.five.camera.position,Ue(n.position),Ue(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=Re(e)&&!e.mediaVisible||!e.state.visible||!this.state.visible;console.log({doNoting:s});const r=u=>{if(s){this.mouseInfo=void 0;return}const d=u.origDomEvent;this.mouseInfo={x:d.clientX,y:d.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=u=>{if(s){this.mouseInfo=void 0;return}const d=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===d.clientX&&this.mouseInfo.y===d.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(d),this.mouseInfo=void 0)},l=u=>{if(s){this.mouseInfo=void 0;return}const d=u.origDomEvent;this.mouseInfo={x:Math.floor(d.touches[0].clientX),y:Math.floor(d.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=u=>{if(s){this.mouseInfo=void 0;return}const d=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(d.changedTouches[d.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(d.changedTouches[d.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(d),this.mouseInfo=void 0)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{!this.domEvents||(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return Ue(e.normal);if(e.stickType==="Plane")return Ao(e.position);if(e.stickType==="Model")return Ao(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.can("renderByMesh",e))}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane"||e.stickType==="Model").filter(e=>!this.can("renderByMesh",e))}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class cg extends lg{constructor(e){super(e);m(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,d,h;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((d=e.fiveState)==null?void 0:d.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(h=e.fiveState)==null?void 0:h.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Ln(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const f=this.getRaycasterFromPanoIndex(e,s);if(!f)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${f}`};const v=this.getTagEnableByIntersect(e,f);if(v.value===!1)return v}if(l.angleRange&&jp(e)){const f=this.getAngle(e);if(Ln(f,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${f}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&Ln(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Ln(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag.filter(h=>this.getVisibleByPanoIndex(h)).filter(h=>{const f=this.getTagProject(h);if(!f)return!1;const{x:v,y:g,z:p}=f;return!(Math.abs(p)>1||Math.abs(v)>1||Math.abs(g)>1)}).map(h=>({tag:h,id:h.id,tagConfig:this.getTagConfig(h).unfoldedConfig})).filter(({tag:h,tagConfig:f})=>{var v,g;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((v=f.autoUnfold)==null?void 0:v.enable)===!1||((g=f.autoUnfold)==null?void 0:g.strategy)!=="MinimumDistance")}).map(h=>pe(F({},h),{distance:this.getDistance(h.tag)})).filter(({distance:h,tagConfig:f})=>{var v,g;return!(h===void 0||typeof f!="object"||f.autoUnfold===!1||((v=f.autoUnfold)==null?void 0:v.enable)===!1||((g=f.autoUnfold)==null?void 0:g.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&Ln(h,f.autoUnfold.distance)===!1)}).sort((h,f)=>h.distance-f.distance).findIndex(h=>h.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!Re(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=ki(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var u,d,h;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const f=this.tags.filter(Re).map(g=>{var p;return(p=g.model)==null?void 0:p.object}).filter(kt);return n.intersectObjects(f,!0)[0]})(),l=(()=>{var f;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(f=o.intersectRaycaster.distanceAccuracy)!=null?f:.01})(),c=Math.min((d=r==null?void 0:r.distance)!=null?d:1/0,(h=a==null?void 0:a.distance)!=null?h:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
545
+ `;function eg(){const i=new E.PlaneGeometry(.4,.4),t=Zp,e=new E.TextureLoader().load(t);e.encoding=E.sRGBEncoding,e.minFilter=E.LinearFilter;const n=new E.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new E.Mesh(i,n)}function tg(){const i=new E.CurvePath;i.add(new E.LineCurve3(new E.Vector3(0,0,0),new E.Vector3(0,0,.1)));const t=new E.TubeGeometry(i,8,.003),e=new E.ShaderMaterial({vertexShader:Kp,fragmentShader:$p,depthTest:!1,transparent:!0});return new E.Mesh(t,e)}function ng(){const i=new E.SphereGeometry(.01,20,20),t=new E.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:E.DoubleSide}),e=new E.Mesh(i,t);return e.position.set(0,0,.1),e}class wa extends E.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=eg(),this.lineMesh=tg(),this.ballMesh=ng(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new E.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class Ca{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=Wt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Mr})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new oo({progress:0}).to({progress:[1,0]}).duration(500).easing(On.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class ig{constructor(t,e){m(this,"five");m(this,"hooks",new fe.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new ba(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new wa:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new Ca(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const og=Object.freeze(Object.defineProperty({__proto__:null,Interval:bo,Rectangle:Xp,Magnifier:ba,getCoordsFromClient:Up,getCoordsFromElement:ya,getRaycasterFromFivePointer:qp,getIntersectFromRelativePosition:Jp,PointHelper:wa,PointDomHelper:Ca,FivePointSelector:ig,isNil:Pp,notNil:kt,BetterTween:oo,tweenProgress:ur,nextFrame:hi,requestAnimationFrameInterval:kn,getFrameTime:Yh},Symbol.toStringTag,{value:"Module"})),sg={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class rg extends In{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,d,h;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(d=(u=s.work)==null?void 0:u.workCode)!=null?d:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const f=l.get(n);return f||(l.set(n,{}),l.get(n))}return(h=l.get(n))==null?void 0:h[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const ag=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;function ye(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}ye.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)},ye.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"],ye.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}},ye.prototype._objectCtxInit=function(i){i._3xDomEvent={}},ye.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent},ye.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent},ye.prototype._objectCtxGet=function(i){return i._3xDomEvent},ye.prototype.camera=function(i){return i&&(this._camera=i),this._camera},ye.prototype.bind=function(i,t,e,n){console.assert(ye.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)},ye.prototype.addEventListener=ye.prototype.bind,ye.prototype.unbind=function(i,t,e,n){console.assert(ye.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)},ye.prototype.removeEventListener=ye.prototype.unbind,ye.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1},ye.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,d=r[0],h=d.object;this._selected=h,u=this._bound("mousemove",h),a!=h&&(l=this._bound("mouseover",h),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",h,n,d),l&&this._notify("mouseover",h,n,d),c&&this._notify("mouseout",a,n,d)}},ye.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}},ye.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}},ye.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)},ye.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)},ye.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)},ye.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)},ye.prototype._onClick=function(i){this._onMouseEvent("click",i)},ye.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)},ye.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)},ye.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)},ye.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)},ye.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}},ye.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){t.preventDefault();var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class lg extends rg{constructor(e){super(e);m(this,"tags",[]);m(this,"config",sg);m(this,"mediaStore",qi({currentMediaElement:null}));m(this,"css3DRenderPlugin");m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"domEvents");m(this,"mouseInfo");m(this,"preventWhenMouseDown",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new ye(this.five.camera,n)),this.five.on("wantsMoveToPano",this.preventWhenMouseDown),this.five.on("wantsTapGesture",this.preventWhenMouseDown),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.preventWhenMouseDown),this.five.off("wantsTapGesture",this.preventWhenMouseDown)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",d="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===d||d==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",d,h]=c;if(d==="Audio"&&e.contentType==="Audio"){const f=e;(f.stickType===u||u==="Any")&&f.data.appearance===h&&(n[l]=this.config.contentTypeConfig[l])}}});const o=mt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){ag&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}if(e==="renderByMesh")if(Vp(o)||Re(o)){const r=o.data.mediaData;return r.length===1&&r[0].type==="Image"&&s.renderType==="Mesh"}else return!1;return!0}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?vn(e.normal):Ao(e.position))();if(!u)return;const d=ki(e.position);if(!d)return;const h=new E.Vector3().copy(c).sub(d),f=u.angleTo(h)*180/Math.PI;return s.angle=f,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=Op(e);if(!u)return-1;const d=c.distanceTo(u);return s.distance=d,d}}getPositions(e){if(Bp(e))return e.position;if(Re(e))return e.data.mediaPosition;const n=e;return Fp(this.five.camera.position,Ue(n.position),Ue(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=()=>!(Re(e)&&!e.mediaVisible||!e.state.visible||!this.state.visible),r=u=>{if(!s()){this.mouseInfo=void 0;return}const d=u.origDomEvent;this.mouseInfo={x:d.clientX,y:d.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=u=>{if(!s()){this.mouseInfo=void 0;return}const d=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===d.clientX&&this.mouseInfo.y===d.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(d),this.mouseInfo=void 0)},l=u=>{if(!s()){this.mouseInfo=void 0;return}const d=u.origDomEvent;this.mouseInfo={x:Math.floor(d.touches[0].clientX),y:Math.floor(d.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=u=>{if(!s()){this.mouseInfo=void 0;return}const d=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(d.changedTouches[d.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(d.changedTouches[d.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(d),this.mouseInfo=void 0)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{!this.domEvents||(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return Ue(e.normal);if(e.stickType==="Plane")return Ao(e.position);if(e.stickType==="Model")return Ao(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.can("renderByMesh",e))}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane"||e.stickType==="Model").filter(e=>!this.can("renderByMesh",e))}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class cg extends lg{constructor(e){super(e);m(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,d,h;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((d=e.fiveState)==null?void 0:d.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(h=e.fiveState)==null?void 0:h.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Ln(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const f=this.getRaycasterFromPanoIndex(e,s);if(!f)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${f}`};const v=this.getTagEnableByIntersect(e,f);if(v.value===!1)return v}if(l.angleRange&&jp(e)){const f=this.getAngle(e);if(Ln(f,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${f}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&Ln(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Ln(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag.filter(h=>this.getVisibleByPanoIndex(h)).filter(h=>{const f=this.getTagProject(h);if(!f)return!1;const{x:v,y:g,z:p}=f;return!(Math.abs(p)>1||Math.abs(v)>1||Math.abs(g)>1)}).map(h=>({tag:h,id:h.id,tagConfig:this.getTagConfig(h).unfoldedConfig})).filter(({tag:h,tagConfig:f})=>{var v,g;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((v=f.autoUnfold)==null?void 0:v.enable)===!1||((g=f.autoUnfold)==null?void 0:g.strategy)!=="MinimumDistance")}).map(h=>pe(F({},h),{distance:this.getDistance(h.tag)})).filter(({distance:h,tagConfig:f})=>{var v,g;return!(h===void 0||typeof f!="object"||f.autoUnfold===!1||((v=f.autoUnfold)==null?void 0:v.enable)===!1||((g=f.autoUnfold)==null?void 0:g.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&Ln(h,f.autoUnfold.distance)===!1)}).sort((h,f)=>h.distance-f.distance).findIndex(h=>h.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!Re(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=ki(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var u,d,h;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const f=this.tags.filter(Re).map(g=>{var p;return(p=g.model)==null?void 0:p.object}).filter(kt);return n.intersectObjects(f,!0)[0]})(),l=(()=>{var f;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(f=o.intersectRaycaster.distanceAccuracy)!=null?f:.01})(),c=Math.min((d=r==null?void 0:r.distance)!=null?d:1/0,(h=a==null?void 0:a.distance)!=null?h:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
546
546
  customModelIntersection.point is ${a==null?void 0:a.point.toArray()}, minIntersectionDistance is ${c}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var a;const o=(a=this.five.work.observers[n])==null?void 0:a.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=ki(e.position);if(!s)return;const r=s.sub(o).normalize();return this.raycaster.set(o,r),this.raycaster}}function ug(i){ce(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function Pa(i){let t,e,n,o,s,r,a,l=i[3]&&Ia(i);return{c(){t=T("div"),e=Pe("svg"),n=Pe("defs"),o=Pe("linearGradient"),s=Pe("stop"),r=Pe("stop"),l&&l.c(),y(s,"offset","25%"),y(s,"stop-color",i[5]),y(s,"stop-opacity","1"),y(r,"offset","100%"),y(r,"stop-color",i[5]),y(r,"stop-opacity","0.5"),y(o,"x1",.5),y(o,"y1",.5),y(o,"x2",i[8]),y(o,"y2",.5),y(o,"id",i[10]),y(o,"gradientUnits","userSpaceOnUse"),y(e,"class","straight-line svelte-xuejcm"),y(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),y(e,"preserveAspectRatio","none"),y(t,"class","line svelte-xuejcm"),J(t,"vertical",i[9]),J(t,"horizontal",!i[9]),z(t,"width",i[8]+"px"),z(t,"height",i[7]+"px")},m(c,u){M(c,t,u),V(t,e),V(e,n),V(n,o),V(o,s),V(o,r),l&&l.m(e,null)},p(c,u){u&32&&y(s,"stop-color",c[5]),u&32&&y(r,"stop-color",c[5]),u&256&&y(o,"x2",c[8]),c[3]?l?(l.p(c,u),u&8&&P(l,1)):(l=Ia(c),l.c(),P(l,1),l.m(e,null)):l&&(re(),x(l,1,1,()=>{l=null}),ae()),u&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&y(e,"viewBox",a),u&512&&J(t,"vertical",c[9]),u&512&&J(t,"horizontal",!c[9]),u&256&&z(t,"width",c[8]+"px"),u&128&&z(t,"height",c[7]+"px")},d(c){c&&S(t),l&&l.d()}}}function Ia(i){let t,e,n,o,s;return{c(){t=Pe("path"),y(t,"fill","none"),y(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),y(t,"stroke-width",1),y(t,"d",i[6])},m(r,a){M(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&y(t,"stroke",e),(!s||a&64)&&y(t,"d",i[6])},i(r){s||(r&&Qe(()=>{o&&o.end(1),n=St(t,ci,{duration:i[2],delay:i[0],easing:At}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=Jt(t,ci,{duration:i[2],delay:i[1],easing:At})),s=!1},d(r){r&&S(t),r&&o&&o.end()}}}function dg(i){let t,e=i[8]&&Pa(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Pa(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:X,o:X,d(n){e&&e.d(n),n&&S(t)}}}function hg(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:u}=t,{length:d}=t,{direction:h="horizontal"}=t,{useLinearColor:f=!1}=t,{color:v="white"}=t;const g=Ne();return i.$$set=p=>{"inDelay"in p&&e(0,a=p.inDelay),"outDelay"in p&&e(1,l=p.outDelay),"duration"in p&&e(2,c=p.duration),"unfolded"in p&&e(3,u=p.unfolded),"length"in p&&e(11,d=p.length),"direction"in p&&e(12,h=p.direction),"useLinearColor"in p&&e(4,f=p.useLinearColor),"color"in p&&e(5,v=p.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=h==="vertical"),i.$$.dirty&2048&&e(8,o=d),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${d}`)},e(7,s=1),[a,l,c,u,f,v,r,s,o,n,g,d,h]}class yo extends se{constructor(t){super(),oe(this,t,hg,dg,ie,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},ug)}}function fg(i){ce(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Ea(i){let t,e,n,o,s;return{c(){t=T("div"),y(t,"class","shadow svelte-faoauy"),y(t,"style",e=`
547
547
  left:${Ye(i[5])};
548
548
  bottom:${Ye(i[6])};