@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19

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 (180) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
package/dist/index.js CHANGED
@@ -35,21 +35,6 @@ function _interopNamespace(e) {
35
35
  return Object.freeze(n);
36
36
  }
37
37
 
38
- function _mergeNamespaces(n, m) {
39
- m.forEach(function (e) {
40
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
41
- if (k !== 'default' && !(k in n)) {
42
- var d = Object.getOwnPropertyDescriptor(e, k);
43
- Object.defineProperty(n, k, d.get ? d : {
44
- enumerable: true,
45
- get: function () { return e[k]; }
46
- });
47
- }
48
- });
49
- });
50
- return Object.freeze(n);
51
- }
52
-
53
38
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
54
39
  var TWEEN__namespace = /*#__PURE__*/_interopNamespace(TWEEN);
55
40
  var TWEEN__default = /*#__PURE__*/_interopDefaultLegacy(TWEEN);
@@ -504,8 +489,8 @@ const ROOM_LABEL_BG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAY
504
489
 
505
490
  /* src/ModelRoomLabelPlugin/RoomLabelItem.svelte generated by Svelte v3.47.0 */
506
491
 
507
- function add_css$l(target) {
508
- internal.append_styles(target, "svelte-17nkflf", ".room-label-item.svelte-17nkflf{position:absolute;font-size:8px;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none}.room-label-item__text.svelte-17nkflf{position:absolute;left:0;top:-64px;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:20px;min-width:32px;padding:0 6px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-17nkflf{position:absolute;top:-44px;height:48px;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-17nkflf{font-size:10px}");
492
+ function add_css$m(target) {
493
+ internal.append_styles(target, "svelte-1ak9fbs", ".room-label-item.svelte-1ak9fbs{position:absolute;font-size:0.41667rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.room-label-item__text.svelte-1ak9fbs{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1ak9fbs{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1ak9fbs{font-size:0.52083rem}");
509
494
  }
510
495
 
511
496
  function create_fragment$q(ctx) {
@@ -525,11 +510,11 @@ function create_fragment$q(ctx) {
525
510
  t0 = internal.text(t0_value);
526
511
  t1 = internal.space();
527
512
  div0 = internal.element("div");
528
- internal.attr(span, "class", "room-label-item__text svelte-17nkflf");
513
+ internal.attr(span, "class", "room-label-item__text svelte-1ak9fbs");
529
514
  internal.set_style(span, "background-image", "url(" + ROOM_LABEL_BG + ")");
530
515
  internal.toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
531
- internal.attr(div0, "class", "room-label-item__bar svelte-17nkflf");
532
- internal.attr(div1, "class", "room-label-item svelte-17nkflf");
516
+ internal.attr(div0, "class", "room-label-item__bar svelte-1ak9fbs");
517
+ internal.attr(div1, "class", "room-label-item svelte-1ak9fbs");
533
518
  internal.set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
534
519
  internal.set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
535
520
  internal.set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
@@ -598,24 +583,24 @@ function instance$q($$self, $$props, $$invalidate) {
598
583
  class RoomLabelItem extends internal.SvelteComponent {
599
584
  constructor(options) {
600
585
  super();
601
- internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$l);
586
+ internal.init(this, options, instance$q, create_fragment$q, internal.safe_not_equal, { five: 2, roomLabel: 0 }, add_css$m);
602
587
  }
603
588
  }
604
589
 
605
590
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
606
591
 
607
- function add_css$k(target) {
608
- internal.append_styles(target, "svelte-185yvaa", ".room-labels-container.svelte-185yvaa{width:100%;height:100%;position:relative;color:#fff}");
592
+ function add_css$l(target) {
593
+ internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
609
594
  }
610
595
 
611
- function get_each_context$8(ctx, list, i) {
596
+ function get_each_context$9(ctx, list, i) {
612
597
  const child_ctx = ctx.slice();
613
598
  child_ctx[9] = list[i];
614
599
  return child_ctx;
615
600
  }
616
601
 
617
602
  // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
618
- function create_each_block$8(key_1, ctx) {
603
+ function create_each_block$9(key_1, ctx) {
619
604
  let first;
620
605
  let roomlabelitem;
621
606
  let current;
@@ -673,9 +658,9 @@ function create_fragment$p(ctx) {
673
658
  const get_key = ctx => /*roomLableItem*/ ctx[9].id;
674
659
 
675
660
  for (let i = 0; i < each_value.length; i += 1) {
676
- let child_ctx = get_each_context$8(ctx, each_value, i);
661
+ let child_ctx = get_each_context$9(ctx, each_value, i);
677
662
  let key = get_key(child_ctx);
678
- each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
663
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx));
679
664
  }
680
665
 
681
666
  return {
@@ -686,7 +671,7 @@ function create_fragment$p(ctx) {
686
671
  each_blocks[i].c();
687
672
  }
688
673
 
689
- internal.attr(div, "class", "room-labels-container svelte-185yvaa");
674
+ internal.attr(div, "class", "room-labels-container svelte-9eg4zi");
690
675
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[4].call(div));
691
676
  },
692
677
  m(target, anchor) {
@@ -703,7 +688,7 @@ function create_fragment$p(ctx) {
703
688
  if (dirty & /*roomLabels, five*/ 3) {
704
689
  each_value = /*roomLabels*/ ctx[0];
705
690
  internal.group_outros();
706
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
691
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$9, null, get_each_context$9);
707
692
  internal.check_outros();
708
693
  }
709
694
  },
@@ -826,7 +811,7 @@ function instance$p($$self, $$props, $$invalidate) {
826
811
  class RoomLabelItems extends internal.SvelteComponent {
827
812
  constructor(options) {
828
813
  super();
829
- internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$k);
814
+ internal.init(this, options, instance$p, create_fragment$p, internal.safe_not_equal, { five: 1, roomLabels: 0 }, add_css$l);
830
815
  }
831
816
  }
832
817
 
@@ -997,37 +982,11 @@ exports.FLOOR_PLAN_ATTACHED_TO = void 0;
997
982
  FLOOR_PLAN_ATTACHED_TO[FLOOR_PLAN_ATTACHED_TO["BOUNDING_CENTER"] = 3] = "BOUNDING_CENTER";
998
983
  })(exports.FLOOR_PLAN_ATTACHED_TO || (exports.FLOOR_PLAN_ATTACHED_TO = {}));
999
984
 
1000
- /*! *****************************************************************************
1001
- Copyright (c) Microsoft Corporation.
1002
-
1003
- Permission to use, copy, modify, and/or distribute this software for any
1004
- purpose with or without fee is hereby granted.
1005
-
1006
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1007
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1008
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1009
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1010
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1011
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1012
- PERFORMANCE OF THIS SOFTWARE.
1013
- ***************************************************************************** */
1014
-
1015
- function __awaiter(thisArg, _arguments, P, generator) {
1016
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1017
- return new (P || (P = Promise))(function (resolve, reject) {
1018
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1019
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1020
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1021
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1022
- });
1023
- }
1024
-
1025
985
  const pluginStyle$1 = {
1026
986
  position: 'absolute',
1027
987
  left: '50%',
1028
988
  top: '50%',
1029
989
  transform: 'translate(-50%, -50%)',
1030
- pointerEvents: 'none',
1031
990
  zIndex: '10',
1032
991
  };
1033
992
 
@@ -1054,9 +1013,9 @@ function pathD(points, options = {}) {
1054
1013
  return d + (needZ ? 'Z' : '');
1055
1014
  }
1056
1015
  /** 把户型图上点点位转换到 SVG 上的点位 */
1057
- function formatFloorplanPoint({ x, y }, pxmm, bounding) {
1016
+ function formatFloorplanPoint({ x, y }, bounding) {
1058
1017
  const { max, min } = bounding;
1059
- return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
1018
+ return { x: x - min.x, y: max.y - y };
1060
1019
  }
1061
1020
  /** 模型坐标转户型图坐标 */
1062
1021
  function modelPosition2FloorplanPosition(position, floorplanData) {
@@ -1084,26 +1043,22 @@ function getFloorIndexFromModelPosition(position, five) {
1084
1043
  return floorIndex;
1085
1044
  }
1086
1045
 
1087
- function formatOutlines(outlines) {
1088
- return __awaiter(this, void 0, void 0, function* () {
1089
- const headers = new Headers({ 'Content-Type': 'text/plain' });
1090
- const getOutlineItem = function (item) {
1091
- return __awaiter(this, void 0, void 0, function* () {
1092
- const outlineItem = {
1093
- index: item.index,
1094
- url: item.url,
1095
- svgUrl: item.svg_url,
1096
- };
1097
- if (item.svg_url) {
1098
- const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
1099
- outlineItem.svgContent = svgContent;
1100
- }
1101
- return outlineItem;
1102
- });
1046
+ async function formatOutlines(outlines) {
1047
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
1048
+ const getOutlineItem = async function (item) {
1049
+ const outlineItem = {
1050
+ index: item.index,
1051
+ url: item.url,
1052
+ svgUrl: item.svg_url,
1103
1053
  };
1104
- const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
1105
- return svgOutlineItems;
1106
- });
1054
+ if (item.svg_url) {
1055
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
1056
+ outlineItem.svgContent = svgContent;
1057
+ }
1058
+ return outlineItem;
1059
+ };
1060
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
1061
+ return svgOutlineItems;
1107
1062
  }
1108
1063
  function formatRoom(data) {
1109
1064
  const floorplanRoomItem = {
@@ -1149,21 +1104,19 @@ function formatFloorplanEntrance(data) {
1149
1104
  };
1150
1105
  return floorplanEntrance;
1151
1106
  }
1152
- function formatData(data) {
1153
- return __awaiter(this, void 0, void 0, function* () {
1154
- const outlines = yield formatOutlines(data.outlines);
1155
- const bounding = data.computed_data.bounding;
1156
- const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1157
- const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1158
- const floorplanData = {
1159
- outlines,
1160
- entrance,
1161
- bounding,
1162
- floorDatas,
1163
- observers: data.computed_data.observers.map(formateFloorplanObserver),
1164
- };
1165
- return floorplanData;
1166
- });
1107
+ async function formatData(data) {
1108
+ const outlines = await formatOutlines(data.outlines);
1109
+ const bounding = data.computed_data.bounding;
1110
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
1111
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
1112
+ const floorplanData = {
1113
+ outlines,
1114
+ entrance,
1115
+ bounding,
1116
+ floorDatas,
1117
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
1118
+ };
1119
+ return floorplanData;
1167
1120
  }
1168
1121
  function formatExtraObjects(data, five, floorplanData) {
1169
1122
  const extraObjects = data.map((object) => {
@@ -1183,35 +1136,6 @@ function formatExtraObjects(data, five, floorplanData) {
1183
1136
  return extraObjects;
1184
1137
  }
1185
1138
 
1186
- /**
1187
- * 把第一个参数传入第二个参数(函数)中并执行
1188
- * 一般用于执行函数后返回变量。
1189
- * @param {any} something
1190
- * @param {function} callback
1191
- * @return {any}
1192
- */
1193
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1194
- function tap(something, callback) {
1195
- callback(something);
1196
- return something;
1197
- }
1198
-
1199
- /**
1200
- * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1201
- * @param object
1202
- * @param props 排除的属性
1203
- * @return
1204
- */
1205
- function omit(object, props) {
1206
- return tap({}, (result) => {
1207
- for (const name in object) {
1208
- if (props.indexOf(name) !== -1)
1209
- continue;
1210
- result[name] = object[name];
1211
- }
1212
- });
1213
- }
1214
-
1215
1139
  /**
1216
1140
  * 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
1217
1141
  * @param five five
@@ -1245,16 +1169,45 @@ function getPxmm(five, container, floorIndex, options) {
1245
1169
  return pxmm;
1246
1170
  }
1247
1171
 
1172
+ /**
1173
+ * 把第一个参数传入第二个参数(函数)中并执行
1174
+ * 一般用于执行函数后返回变量。
1175
+ * @param {any} something
1176
+ * @param {function} callback
1177
+ * @return {any}
1178
+ */
1179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1180
+ function tap(something, callback) {
1181
+ callback(something);
1182
+ return something;
1183
+ }
1184
+
1185
+ /**
1186
+ * 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
1187
+ * @param object
1188
+ * @param props 排除的属性
1189
+ * @return
1190
+ */
1191
+ function omit(object, props) {
1192
+ return tap({}, (result) => {
1193
+ for (const name in object) {
1194
+ if (props.indexOf(name) !== -1)
1195
+ continue;
1196
+ result[name] = object[name];
1197
+ }
1198
+ });
1199
+ }
1200
+
1248
1201
  const CAMERA_IMAGE = 'data:image/png;base64,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';
1249
1202
 
1250
1203
  function rad2Deg$1(rad) {
1251
1204
  return (rad * 180) / Math.PI;
1252
1205
  }
1253
1206
 
1254
- /* src/floorplan/ModelFloorplanPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
1207
+ /* src/floorplan/Components/Camera.svelte generated by Svelte v3.47.0 */
1255
1208
 
1256
- function add_css$j(target) {
1257
- internal.append_styles(target, "svelte-e8a2kn", ".floorplan__camera-position.svelte-e8a2kn{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-e8a2kn{position:absolute;background-repeat:no-repeat;background-size:100%}");
1209
+ function add_css$k(target) {
1210
+ internal.append_styles(target, "svelte-17cl35n", ".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}");
1258
1211
  }
1259
1212
 
1260
1213
  function create_fragment$o(ctx) {
@@ -1265,7 +1218,7 @@ function create_fragment$o(ctx) {
1265
1218
  c() {
1266
1219
  div1 = internal.element("div");
1267
1220
  div0 = internal.element("div");
1268
- internal.attr(div0, "class", "floorplan__camera-rotate svelte-e8a2kn");
1221
+ internal.attr(div0, "class", "floorplan__camera-rotate svelte-17cl35n");
1269
1222
  internal.set_style(div0, "background-image", `url(${/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE})`);
1270
1223
  internal.set_style(div0, "width", /*domSizeStyle*/ ctx[4], false);
1271
1224
  internal.set_style(div0, "height", /*domSizeStyle*/ ctx[4], false);
@@ -1273,7 +1226,7 @@ function create_fragment$o(ctx) {
1273
1226
  internal.set_style(div0, "top", '-' + /*domSizeStyle*/ ctx[4], false);
1274
1227
  internal.set_style(div0, "transform", `rotate(${/*rotate*/ ctx[3]}deg)`, false);
1275
1228
  internal.set_style(div0, "transform-origin", `${/*domSizeStyle*/ ctx[4]} ${/*domSizeStyle*/ ctx[4]}`, false);
1276
- internal.attr(div1, "class", "floorplan__camera-position svelte-e8a2kn");
1229
+ internal.attr(div1, "class", "floorplan__camera-position svelte-17cl35n");
1277
1230
  internal.set_style(div1, "left", /*positionLeft*/ ctx[1], false);
1278
1231
  internal.set_style(div1, "top", /*positionTop*/ ctx[2], false);
1279
1232
  },
@@ -1349,17 +1302,17 @@ class Camera$1 extends internal.SvelteComponent {
1349
1302
  lastPanoramaLongitude: 7,
1350
1303
  cameraImageUrl: 0
1351
1304
  },
1352
- add_css$j
1305
+ add_css$k
1353
1306
  );
1354
1307
  }
1355
1308
  }
1356
1309
 
1357
1310
  const COMPASS_IMAGE = 'data:image/png;base64,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';
1358
1311
 
1359
- /* src/floorplan/ModelFloorplanPlugin/Components/Compass.svelte generated by Svelte v3.47.0 */
1312
+ /* src/floorplan/Components/Compass.svelte generated by Svelte v3.47.0 */
1360
1313
 
1361
- function add_css$i(target) {
1362
- internal.append_styles(target, "svelte-5l80pv", ".floorplan-plugin__compass.svelte-5l80pv{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-5l80pv{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-5l80pv{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
1314
+ function add_css$j(target) {
1315
+ internal.append_styles(target, "svelte-1q44ru9", ".floorplan-plugin__compass.svelte-1q44ru9{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-1q44ru9{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-1q44ru9{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}");
1363
1316
  }
1364
1317
 
1365
1318
  // (13:0) {#if northRad}
@@ -1377,10 +1330,10 @@ function create_if_block$8(ctx) {
1377
1330
  t0 = internal.space();
1378
1331
  span = internal.element("span");
1379
1332
  t1 = internal.text(/*northDesc*/ ctx[0]);
1380
- internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-5l80pv");
1333
+ internal.attr(div0, "class", "floorplan-plugin__compass-image svelte-1q44ru9");
1381
1334
  internal.set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
1382
- internal.attr(span, "class", "floorplan-plugin__compass-text svelte-5l80pv");
1383
- internal.attr(div1, "class", "floorplan-plugin__compass svelte-5l80pv");
1335
+ internal.attr(span, "class", "floorplan-plugin__compass-text svelte-1q44ru9");
1336
+ internal.attr(div1, "class", "floorplan-plugin__compass svelte-1q44ru9");
1384
1337
  internal.set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
1385
1338
  },
1386
1339
  m(target, anchor) {
@@ -1451,345 +1404,271 @@ function instance$n($$self, $$props, $$invalidate) {
1451
1404
  class Compass extends internal.SvelteComponent {
1452
1405
  constructor(options) {
1453
1406
  super();
1454
- internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$i);
1407
+ internal.init(this, options, instance$n, create_fragment$n, internal.safe_not_equal, { floorplanData: 3, northDesc: 0 }, add_css$j);
1455
1408
  }
1456
1409
  }
1457
1410
 
1458
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1411
+ /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
1459
1412
 
1460
- function add_css$h(target) {
1461
- internal.append_styles(target, "svelte-1ashbdx", ".floorplan-plugin__room-label-item.svelte-1ashbdx{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:15px;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-1ashbdx{opacity:0.45}");
1413
+ function add_css$i(target) {
1414
+ internal.append_styles(target, "svelte-1gfoniz", "img.svelte-1gfoniz{width:100%;height:100%}");
1462
1415
  }
1463
1416
 
1464
- // (22:30)
1465
- function create_if_block_1$4(ctx) {
1466
- let html_tag;
1467
- let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1468
- let html_anchor;
1417
+ function create_fragment$m(ctx) {
1418
+ let img;
1419
+ let img_src_value;
1469
1420
 
1470
1421
  return {
1471
1422
  c() {
1472
- html_tag = new internal.HtmlTag();
1473
- html_anchor = internal.empty();
1474
- html_tag.a = html_anchor;
1423
+ img = internal.element("img");
1424
+ if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
1425
+ internal.attr(img, "alt", "floorplan iamge");
1426
+ internal.attr(img, "class", "svelte-1gfoniz");
1475
1427
  },
1476
1428
  m(target, anchor) {
1477
- html_tag.m(raw_value, target, anchor);
1478
- internal.insert(target, html_anchor, anchor);
1429
+ internal.insert(target, img, anchor);
1479
1430
  },
1480
- p(ctx, dirty) {
1481
- if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1431
+ p(ctx, [dirty]) {
1432
+ if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
1433
+ internal.attr(img, "src", img_src_value);
1434
+ }
1482
1435
  },
1436
+ i: internal.noop,
1437
+ o: internal.noop,
1483
1438
  d(detaching) {
1484
- if (detaching) internal.detach(html_anchor);
1485
- if (detaching) html_tag.d();
1439
+ if (detaching) internal.detach(img);
1486
1440
  }
1487
1441
  };
1488
1442
  }
1489
1443
 
1490
- // (16:2) {#if getLabelElement === undefined}
1491
- function create_if_block$7(ctx) {
1492
- let span0;
1493
- let t0_value = /*room*/ ctx[0].name + "";
1494
- let t0;
1495
- let t1;
1496
- let span1;
1444
+ function instance$m($$self, $$props, $$invalidate) {
1445
+ let { url } = $$props;
1497
1446
 
1498
- return {
1499
- c() {
1500
- span0 = internal.element("span");
1501
- t0 = internal.text(t0_value);
1502
- t1 = internal.space();
1503
- span1 = internal.element("span");
1504
- span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1505
- internal.attr(span0, "class", "floorplan-plugin__room-name");
1506
- internal.attr(span1, "class", "floorplan-plugin__room-size svelte-1ashbdx");
1507
- },
1508
- m(target, anchor) {
1509
- internal.insert(target, span0, anchor);
1510
- internal.append(span0, t0);
1511
- internal.insert(target, t1, anchor);
1512
- internal.insert(target, span1, anchor);
1513
- },
1514
- p(ctx, dirty) {
1515
- if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1516
- },
1517
- d(detaching) {
1518
- if (detaching) internal.detach(span0);
1519
- if (detaching) internal.detach(t1);
1520
- if (detaching) internal.detach(span1);
1521
- }
1447
+ $$self.$$set = $$props => {
1448
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
1522
1449
  };
1523
- }
1524
1450
 
1525
- function create_fragment$m(ctx) {
1526
- let div;
1451
+ return [url];
1452
+ }
1527
1453
 
1528
- function select_block_type(ctx, dirty) {
1529
- if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$7;
1530
- if (/*userConfigElement*/ ctx[2]) return create_if_block_1$4;
1454
+ class Normalmage extends internal.SvelteComponent {
1455
+ constructor(options) {
1456
+ super();
1457
+ internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { url: 0 }, add_css$i);
1531
1458
  }
1459
+ }
1532
1460
 
1533
- let current_block_type = select_block_type(ctx);
1534
- let if_block = current_block_type && current_block_type(ctx);
1461
+ /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
1462
+
1463
+ function add_css$h(target) {
1464
+ internal.append_styles(target, "svelte-ub47ya", ".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}");
1465
+ }
1466
+
1467
+ function create_fragment$l(ctx) {
1468
+ let div;
1469
+ let html_tag;
1470
+ let t;
1471
+ let html_tag_1;
1535
1472
 
1536
1473
  return {
1537
1474
  c() {
1538
1475
  div = internal.element("div");
1539
- if (if_block) if_block.c();
1540
- internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-1ashbdx");
1541
- internal.set_style(div, "left", /*left*/ ctx[4], false);
1542
- internal.set_style(div, "top", /*top*/ ctx[5], false);
1543
- internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1476
+ html_tag = new internal.HtmlTag();
1477
+ t = internal.space();
1478
+ html_tag_1 = new internal.HtmlTag();
1479
+ html_tag.a = t;
1480
+ html_tag_1.a = null;
1481
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ub47ya");
1544
1482
  },
1545
1483
  m(target, anchor) {
1546
1484
  internal.insert(target, div, anchor);
1547
- if (if_block) if_block.m(div, null);
1485
+ html_tag.m(/*svgStyle*/ ctx[1], div);
1486
+ internal.append(div, t);
1487
+ html_tag_1.m(/*content*/ ctx[0], div);
1548
1488
  },
1549
1489
  p(ctx, [dirty]) {
1550
- if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1551
- if_block.p(ctx, dirty);
1552
- } else {
1553
- if (if_block) if_block.d(1);
1554
- if_block = current_block_type && current_block_type(ctx);
1555
-
1556
- if (if_block) {
1557
- if_block.c();
1558
- if_block.m(div, null);
1559
- }
1560
- }
1490
+ if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
1561
1491
  },
1562
1492
  i: internal.noop,
1563
1493
  o: internal.noop,
1564
1494
  d(detaching) {
1565
1495
  if (detaching) internal.detach(div);
1566
-
1567
- if (if_block) {
1568
- if_block.d();
1569
- }
1570
1496
  }
1571
1497
  };
1572
1498
  }
1573
1499
 
1574
- function instance$m($$self, $$props, $$invalidate) {
1575
- let userConfigElement;
1576
- let { room } = $$props;
1577
- let { getLabelElement } = $$props;
1578
-
1579
- // TODO: 统一这里的判断条件,目前写了多处
1580
- const bodyWidth = document.body.clientWidth;
1500
+ function instance$l($$self, $$props, $$invalidate) {
1501
+ let { content } = $$props;
1581
1502
 
1582
- const bodyHeight = document.body.clientHeight;
1583
- const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1584
- const roomLabel = room.roomLabel;
1585
- const left = roomLabel.positionInImage.x * 100 + '%';
1586
- const top = roomLabel.positionInImage.y * 100 + '%';
1587
- const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
1503
+ const svgStyle = `
1504
+ <style>
1505
+ svg [type='lineGroup'] path {
1506
+ fill: #ffffff;
1507
+ stroke: #ffffff;
1508
+ }
1509
+ svg [type='lineItemGroup'] g g g g {
1510
+ stroke: #ffffff;
1511
+ }</style>
1512
+ `;
1588
1513
 
1589
1514
  $$self.$$set = $$props => {
1590
- if ('room' in $$props) $$invalidate(0, room = $$props.room);
1591
- if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
1592
- };
1593
-
1594
- $$self.$$.update = () => {
1595
- if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1596
- $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1597
- ? void 0
1598
- : getLabelElement(room));
1599
- }
1515
+ if ('content' in $$props) $$invalidate(0, content = $$props.content);
1600
1516
  };
1601
1517
 
1602
- return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
1518
+ return [content, svgStyle];
1603
1519
  }
1604
1520
 
1605
- class RoomLabel extends internal.SvelteComponent {
1521
+ class SvgImage extends internal.SvelteComponent {
1606
1522
  constructor(options) {
1607
1523
  super();
1608
- internal.init(this, options, instance$m, create_fragment$m, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$h);
1524
+ internal.init(this, options, instance$l, create_fragment$l, internal.safe_not_equal, { content: 0 }, add_css$h);
1609
1525
  }
1610
1526
  }
1611
1527
 
1612
- /* src/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
1528
+ /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
1613
1529
 
1614
1530
  function add_css$g(target) {
1615
- internal.append_styles(target, "svelte-sw25w3", ".floorplan-plugin__room-labels.svelte-sw25w3{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20}");
1616
- }
1617
-
1618
- function get_each_context$7(ctx, list, i) {
1619
- const child_ctx = ctx.slice();
1620
- child_ctx[4] = list[i];
1621
- return child_ctx;
1531
+ internal.append_styles(target, "svelte-ozpg4a", ".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
1622
1532
  }
1623
1533
 
1624
- // (8:0) {#if rooms}
1625
- function create_if_block$6(ctx) {
1626
- let div;
1627
- let each_blocks = [];
1628
- let each_1_lookup = new Map();
1534
+ // (13:22)
1535
+ function create_if_block_1$4(ctx) {
1536
+ let normalimage;
1629
1537
  let current;
1630
- let each_value = /*rooms*/ ctx[1];
1631
- const get_key = ctx => /*room*/ ctx[4].id;
1632
-
1633
- for (let i = 0; i < each_value.length; i += 1) {
1634
- let child_ctx = get_each_context$7(ctx, each_value, i);
1635
- let key = get_key(child_ctx);
1636
- each_1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
1637
- }
1538
+ normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
1638
1539
 
1639
1540
  return {
1640
1541
  c() {
1641
- div = internal.element("div");
1642
-
1643
- for (let i = 0; i < each_blocks.length; i += 1) {
1644
- each_blocks[i].c();
1645
- }
1646
-
1647
- internal.attr(div, "class", "floorplan-plugin__room-labels svelte-sw25w3");
1542
+ internal.create_component(normalimage.$$.fragment);
1648
1543
  },
1649
1544
  m(target, anchor) {
1650
- internal.insert(target, div, anchor);
1651
-
1652
- for (let i = 0; i < each_blocks.length; i += 1) {
1653
- each_blocks[i].m(div, null);
1654
- }
1655
-
1545
+ internal.mount_component(normalimage, target, anchor);
1656
1546
  current = true;
1657
1547
  },
1658
1548
  p(ctx, dirty) {
1659
- if (dirty & /*rooms, getLabelElement*/ 3) {
1660
- each_value = /*rooms*/ ctx[1];
1661
- internal.group_outros();
1662
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$7, null, get_each_context$7);
1663
- internal.check_outros();
1664
- }
1549
+ const normalimage_changes = {};
1550
+ if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
1551
+ normalimage.$set(normalimage_changes);
1665
1552
  },
1666
1553
  i(local) {
1667
1554
  if (current) return;
1668
-
1669
- for (let i = 0; i < each_value.length; i += 1) {
1670
- internal.transition_in(each_blocks[i]);
1671
- }
1672
-
1555
+ internal.transition_in(normalimage.$$.fragment, local);
1673
1556
  current = true;
1674
1557
  },
1675
1558
  o(local) {
1676
- for (let i = 0; i < each_blocks.length; i += 1) {
1677
- internal.transition_out(each_blocks[i]);
1678
- }
1679
-
1559
+ internal.transition_out(normalimage.$$.fragment, local);
1680
1560
  current = false;
1681
1561
  },
1682
1562
  d(detaching) {
1683
- if (detaching) internal.detach(div);
1684
-
1685
- for (let i = 0; i < each_blocks.length; i += 1) {
1686
- each_blocks[i].d();
1687
- }
1563
+ internal.destroy_component(normalimage, detaching);
1688
1564
  }
1689
1565
  };
1690
1566
  }
1691
1567
 
1692
- // (10:4) {#each rooms as room (room.id)}
1693
- function create_each_block$7(key_1, ctx) {
1694
- let first;
1695
- let roomlabel;
1568
+ // (11:2) {#if svgContent}
1569
+ function create_if_block$7(ctx) {
1570
+ let svgimage;
1696
1571
  let current;
1697
1572
 
1698
- const roomlabel_spread_levels = [
1699
- {
1700
- room: /*room*/ ctx[4],
1701
- getLabelElement: /*getLabelElement*/ ctx[0]
1702
- }
1703
- ];
1704
-
1705
- let roomlabel_props = {};
1706
-
1707
- for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1708
- roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1709
- }
1710
-
1711
- roomlabel = new RoomLabel({ props: roomlabel_props });
1573
+ svgimage = new SvgImage({
1574
+ props: { content: /*svgContent*/ ctx[0] }
1575
+ });
1712
1576
 
1713
1577
  return {
1714
- key: key_1,
1715
- first: null,
1716
1578
  c() {
1717
- first = internal.empty();
1718
- internal.create_component(roomlabel.$$.fragment);
1719
- this.first = first;
1579
+ internal.create_component(svgimage.$$.fragment);
1720
1580
  },
1721
1581
  m(target, anchor) {
1722
- internal.insert(target, first, anchor);
1723
- internal.mount_component(roomlabel, target, anchor);
1582
+ internal.mount_component(svgimage, target, anchor);
1724
1583
  current = true;
1725
1584
  },
1726
- p(new_ctx, dirty) {
1727
- ctx = new_ctx;
1728
-
1729
- const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
1730
- ? internal.get_spread_update(roomlabel_spread_levels, [
1731
- {
1732
- room: /*room*/ ctx[4],
1733
- getLabelElement: /*getLabelElement*/ ctx[0]
1734
- }
1735
- ])
1736
- : {};
1737
-
1738
- roomlabel.$set(roomlabel_changes);
1585
+ p(ctx, dirty) {
1586
+ const svgimage_changes = {};
1587
+ if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
1588
+ svgimage.$set(svgimage_changes);
1739
1589
  },
1740
1590
  i(local) {
1741
1591
  if (current) return;
1742
- internal.transition_in(roomlabel.$$.fragment, local);
1592
+ internal.transition_in(svgimage.$$.fragment, local);
1743
1593
  current = true;
1744
1594
  },
1745
1595
  o(local) {
1746
- internal.transition_out(roomlabel.$$.fragment, local);
1596
+ internal.transition_out(svgimage.$$.fragment, local);
1747
1597
  current = false;
1748
1598
  },
1749
1599
  d(detaching) {
1750
- if (detaching) internal.detach(first);
1751
- internal.destroy_component(roomlabel, detaching);
1600
+ internal.destroy_component(svgimage, detaching);
1752
1601
  }
1753
1602
  };
1754
1603
  }
1755
1604
 
1756
- function create_fragment$l(ctx) {
1757
- let if_block_anchor;
1605
+ function create_fragment$k(ctx) {
1606
+ let div;
1607
+ let current_block_type_index;
1608
+ let if_block;
1758
1609
  let current;
1759
- let if_block = /*rooms*/ ctx[1] && create_if_block$6(ctx);
1610
+ const if_block_creators = [create_if_block$7, create_if_block_1$4];
1611
+ const if_blocks = [];
1612
+
1613
+ function select_block_type(ctx, dirty) {
1614
+ if (/*svgContent*/ ctx[0]) return 0;
1615
+ if (/*imageData*/ ctx[1]) return 1;
1616
+ return -1;
1617
+ }
1618
+
1619
+ if (~(current_block_type_index = select_block_type(ctx))) {
1620
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1621
+ }
1760
1622
 
1761
1623
  return {
1762
1624
  c() {
1625
+ div = internal.element("div");
1763
1626
  if (if_block) if_block.c();
1764
- if_block_anchor = internal.empty();
1627
+ internal.attr(div, "class", "floorplan-plugin__base-image svelte-ozpg4a");
1765
1628
  },
1766
1629
  m(target, anchor) {
1767
- if (if_block) if_block.m(target, anchor);
1768
- internal.insert(target, if_block_anchor, anchor);
1630
+ internal.insert(target, div, anchor);
1631
+
1632
+ if (~current_block_type_index) {
1633
+ if_blocks[current_block_type_index].m(div, null);
1634
+ }
1635
+
1769
1636
  current = true;
1770
1637
  },
1771
1638
  p(ctx, [dirty]) {
1772
- if (/*rooms*/ ctx[1]) {
1639
+ let previous_block_index = current_block_type_index;
1640
+ current_block_type_index = select_block_type(ctx);
1641
+
1642
+ if (current_block_type_index === previous_block_index) {
1643
+ if (~current_block_type_index) {
1644
+ if_blocks[current_block_type_index].p(ctx, dirty);
1645
+ }
1646
+ } else {
1773
1647
  if (if_block) {
1774
- if_block.p(ctx, dirty);
1648
+ internal.group_outros();
1775
1649
 
1776
- if (dirty & /*rooms*/ 2) {
1777
- internal.transition_in(if_block, 1);
1778
- }
1779
- } else {
1780
- if_block = create_if_block$6(ctx);
1781
- if_block.c();
1782
- internal.transition_in(if_block, 1);
1783
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
1650
+ internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
1651
+ if_blocks[previous_block_index] = null;
1652
+ });
1653
+
1654
+ internal.check_outros();
1784
1655
  }
1785
- } else if (if_block) {
1786
- internal.group_outros();
1787
1656
 
1788
- internal.transition_out(if_block, 1, 1, () => {
1789
- if_block = null;
1790
- });
1657
+ if (~current_block_type_index) {
1658
+ if_block = if_blocks[current_block_type_index];
1791
1659
 
1792
- internal.check_outros();
1660
+ if (!if_block) {
1661
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
1662
+ if_block.c();
1663
+ } else {
1664
+ if_block.p(ctx, dirty);
1665
+ }
1666
+
1667
+ internal.transition_in(if_block, 1);
1668
+ if_block.m(div, null);
1669
+ } else {
1670
+ if_block = null;
1671
+ }
1793
1672
  }
1794
1673
  },
1795
1674
  i(local) {
@@ -1802,434 +1681,230 @@ function create_fragment$l(ctx) {
1802
1681
  current = false;
1803
1682
  },
1804
1683
  d(detaching) {
1805
- if (if_block) if_block.d(detaching);
1806
- if (detaching) internal.detach(if_block_anchor);
1684
+ if (detaching) internal.detach(div);
1685
+
1686
+ if (~current_block_type_index) {
1687
+ if_blocks[current_block_type_index].d();
1688
+ }
1807
1689
  }
1808
1690
  };
1809
1691
  }
1810
1692
 
1811
- function instance$l($$self, $$props, $$invalidate) {
1812
- let rooms;
1693
+ function instance$k($$self, $$props, $$invalidate) {
1694
+ let imageData;
1695
+ let svgContent;
1696
+ var _a, _b;
1813
1697
  let { floorIndex } = $$props;
1814
1698
  let { floorplanData } = $$props;
1815
- let { getLabelElement } = $$props;
1816
1699
 
1817
1700
  $$self.$$set = $$props => {
1818
1701
  if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
1819
1702
  if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
1820
- if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
1821
1703
  };
1822
1704
 
1823
1705
  $$self.$$.update = () => {
1824
1706
  if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
1825
- $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
1707
+ $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
1708
+ }
1709
+
1710
+ if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
1711
+ $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
1712
+ ? void 0
1713
+ : _a[floorIndex]) === null || _b === void 0
1714
+ ? void 0
1715
+ : _b.svgContent);
1826
1716
  }
1827
1717
  };
1828
1718
 
1829
- return [getLabelElement, rooms, floorIndex, floorplanData];
1719
+ return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
1830
1720
  }
1831
1721
 
1832
- class RoomLabels extends internal.SvelteComponent {
1722
+ class BaseImage extends internal.SvelteComponent {
1833
1723
  constructor(options) {
1834
1724
  super();
1835
-
1836
- internal.init(
1837
- this,
1838
- options,
1839
- instance$l,
1840
- create_fragment$l,
1841
- internal.safe_not_equal,
1842
- {
1843
- floorIndex: 2,
1844
- floorplanData: 3,
1845
- getLabelElement: 0
1846
- },
1847
- add_css$g
1848
- );
1725
+ internal.init(this, options, instance$k, create_fragment$k, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$g);
1849
1726
  }
1850
1727
  }
1851
1728
 
1852
- /**
1853
- * 判断对象是否为`null`或`undefined`。
1854
- * @param
1855
- * @return
1856
- */
1857
- /**
1858
- * 判断对象不为`null`或`undefined`。
1859
- */
1860
- function notNil(value) {
1861
- return value !== null && value !== undefined;
1862
- }
1863
-
1864
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
1729
+ /* src/floorplan/Components/RoomLabels/RoomLabel.svelte generated by Svelte v3.47.0 */
1865
1730
 
1866
1731
  function add_css$f(target) {
1867
- internal.append_styles(target, "svelte-1rr09in", ".floorplan-plugin__rule-labels.svelte-1rr09in{position:absolute;height:5px;display:flex;align-items:center}.floorplan-plugin__rule-labels-top.svelte-1rr09in{left:0;top:0}.floorplan-plugin__rule-labels-bottom.svelte-1rr09in{left:0;bottom:0}.floorplan-plugin__rule-labels-left.svelte-1rr09in{bottom:0;left:0}.floorplan-plugin__rule-labels-right.svelte-1rr09in{bottom:0;right:0}.floorplan-plugin__rule-line.svelte-1rr09in{background:#fff;opacity:0.05;width:100%;height:1px}.floorplan-plugin__rule-scale.svelte-1rr09in{position:absolute;background:#fff;opacity:0.05;transform-origin:center;width:1px;height:5px}.floorplan-plugin__text-wrapper.svelte-1rr09in{width:0;height:0;position:absolute}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top.svelte-1rr09in{top:10px}.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom.svelte-1rr09in{bottom:10px}.floorplan-plugin__rule-text.svelte-1rr09in{position:absolute;width:max-content;display:block;transform:translate(-50%, -50%) rotate(180deg);font-size:10px;color:#fff;opacity:0.2}.floorplan-plugin__rule-text.is-row.svelte-1rr09in{transform:translate(-50%, -50%)}");
1868
- }
1869
-
1870
- function get_each_context$6(ctx, list, i) {
1871
- const child_ctx = ctx.slice();
1872
- child_ctx[24] = list[i];
1873
- child_ctx[26] = i;
1874
- return child_ctx;
1875
- }
1876
-
1877
- function get_each_context_1(ctx, list, i) {
1878
- const child_ctx = ctx.slice();
1879
- child_ctx[27] = list[i];
1880
- child_ctx[29] = i;
1881
- return child_ctx;
1732
+ internal.append_styles(target, "svelte-i2nwuk", ".floorplan-plugin__room-label-item.svelte-i2nwuk{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:0.78125rem;color:#fff;transform:translate(-50%, -50%);white-space:nowrap}.floorplan-plugin__room-size.svelte-i2nwuk{opacity:0.45}");
1882
1733
  }
1883
1734
 
1884
- // (66:2) {#each positionPxArray as position, positionIndex (positionIndex)}
1885
- function create_each_block_1(key_1, ctx) {
1886
- let div;
1887
- let style_left = `${/*position*/ ctx[27]}px`;
1735
+ // (22:30)
1736
+ function create_if_block_1$3(ctx) {
1737
+ let html_tag;
1738
+ let raw_value = /*userConfigElement*/ ctx[2].outerHTML + "";
1739
+ let html_anchor;
1888
1740
 
1889
1741
  return {
1890
- key: key_1,
1891
- first: null,
1892
1742
  c() {
1893
- div = internal.element("div");
1894
- internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-1rr09in");
1895
- internal.set_style(div, "left", style_left, false);
1896
- this.first = div;
1743
+ html_tag = new internal.HtmlTag();
1744
+ html_anchor = internal.empty();
1745
+ html_tag.a = html_anchor;
1897
1746
  },
1898
1747
  m(target, anchor) {
1899
- internal.insert(target, div, anchor);
1900
- },
1901
- p(new_ctx, dirty) {
1902
- ctx = new_ctx;
1748
+ html_tag.m(raw_value, target, anchor);
1749
+ internal.insert(target, html_anchor, anchor);
1750
+ },
1751
+ p(ctx, dirty) {
1752
+ if (dirty & /*userConfigElement*/ 4 && raw_value !== (raw_value = /*userConfigElement*/ ctx[2].outerHTML + "")) html_tag.p(raw_value);
1903
1753
  },
1904
1754
  d(detaching) {
1905
- if (detaching) internal.detach(div);
1755
+ if (detaching) internal.detach(html_anchor);
1756
+ if (detaching) html_tag.d();
1906
1757
  }
1907
1758
  };
1908
1759
  }
1909
1760
 
1910
- // (69:2) {#each textArray as textItem, textItemIndex (textItemIndex)}
1911
- function create_each_block$6(key_1, ctx) {
1912
- let div;
1913
- let span;
1914
- let t0_value = /*textItem*/ ctx[24].distance + "";
1761
+ // (16:2) {#if getLabelElement === undefined}
1762
+ function create_if_block$6(ctx) {
1763
+ let span0;
1764
+ let t0_value = /*room*/ ctx[0].name + "";
1915
1765
  let t0;
1916
1766
  let t1;
1917
- let style_left = `${/*textItem*/ ctx[24].positionPx}px`;
1767
+ let span1;
1918
1768
 
1919
1769
  return {
1920
- key: key_1,
1921
- first: null,
1922
1770
  c() {
1923
- div = internal.element("div");
1924
- span = internal.element("span");
1771
+ span0 = internal.element("span");
1925
1772
  t0 = internal.text(t0_value);
1926
1773
  t1 = internal.space();
1927
- internal.attr(span, "class", "floorplan-plugin__rule-text svelte-1rr09in");
1928
- internal.toggle_class(span, "is-row", /*isRow*/ ctx[5]);
1929
- internal.attr(div, "class", "floorplan-plugin__text-wrapper svelte-1rr09in");
1930
- internal.toggle_class(div, "floorplan-plugin__text-wrapper--is-left-or-top", /*isLeft*/ ctx[3] || /*isTop*/ ctx[1]);
1931
- internal.toggle_class(div, "floorplan-plugin__text-wrapper-is-right-or-bottom", /*isRight*/ ctx[4] || /*isBottom*/ ctx[2]);
1932
- internal.set_style(div, "left", style_left, false);
1933
- this.first = div;
1774
+ span1 = internal.element("span");
1775
+ span1.textContent = `${/*roomSizeDes*/ ctx[3]}`;
1776
+ internal.attr(span0, "class", "floorplan-plugin__room-name");
1777
+ internal.attr(span1, "class", "floorplan-plugin__room-size svelte-i2nwuk");
1934
1778
  },
1935
1779
  m(target, anchor) {
1936
- internal.insert(target, div, anchor);
1937
- internal.append(div, span);
1938
- internal.append(span, t0);
1939
- internal.append(div, t1);
1780
+ internal.insert(target, span0, anchor);
1781
+ internal.append(span0, t0);
1782
+ internal.insert(target, t1, anchor);
1783
+ internal.insert(target, span1, anchor);
1940
1784
  },
1941
- p(new_ctx, dirty) {
1942
- ctx = new_ctx;
1785
+ p(ctx, dirty) {
1786
+ if (dirty & /*room*/ 1 && t0_value !== (t0_value = /*room*/ ctx[0].name + "")) internal.set_data(t0, t0_value);
1943
1787
  },
1944
1788
  d(detaching) {
1945
- if (detaching) internal.detach(div);
1789
+ if (detaching) internal.detach(span0);
1790
+ if (detaching) internal.detach(t1);
1791
+ if (detaching) internal.detach(span1);
1946
1792
  }
1947
1793
  };
1948
1794
  }
1949
1795
 
1950
- function create_fragment$k(ctx) {
1951
- let div1;
1952
- let div0;
1953
- let t0;
1954
- let each_blocks_1 = [];
1955
- let each0_lookup = new Map();
1956
- let t1;
1957
- let each_blocks = [];
1958
- let each1_lookup = new Map();
1959
- let div1_class_value;
1960
- let each_value_1 = /*positionPxArray*/ ctx[6];
1961
- const get_key = ctx => /*positionIndex*/ ctx[29];
1796
+ function create_fragment$j(ctx) {
1797
+ let div;
1962
1798
 
1963
- for (let i = 0; i < each_value_1.length; i += 1) {
1964
- let child_ctx = get_each_context_1(ctx, each_value_1, i);
1965
- let key = get_key(child_ctx);
1966
- each0_lookup.set(key, each_blocks_1[i] = create_each_block_1(key, child_ctx));
1799
+ function select_block_type(ctx, dirty) {
1800
+ if (/*getLabelElement*/ ctx[1] === undefined) return create_if_block$6;
1801
+ if (/*userConfigElement*/ ctx[2]) return create_if_block_1$3;
1967
1802
  }
1968
1803
 
1969
- let each_value = /*textArray*/ ctx[10];
1970
- const get_key_1 = ctx => /*textItemIndex*/ ctx[26];
1971
-
1972
- for (let i = 0; i < each_value.length; i += 1) {
1973
- let child_ctx = get_each_context$6(ctx, each_value, i);
1974
- let key = get_key_1(child_ctx);
1975
- each1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
1976
- }
1804
+ let current_block_type = select_block_type(ctx);
1805
+ let if_block = current_block_type && current_block_type(ctx);
1977
1806
 
1978
1807
  return {
1979
1808
  c() {
1980
- div1 = internal.element("div");
1981
- div0 = internal.element("div");
1982
- t0 = internal.space();
1983
-
1984
- for (let i = 0; i < each_blocks_1.length; i += 1) {
1985
- each_blocks_1[i].c();
1986
- }
1987
-
1988
- t1 = internal.space();
1989
-
1990
- for (let i = 0; i < each_blocks.length; i += 1) {
1991
- each_blocks[i].c();
1992
- }
1993
-
1994
- internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-1rr09in");
1995
- internal.attr(div1, "class", div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in");
1996
- internal.set_style(div1, "width", /*width*/ ctx[9], false);
1997
- internal.set_style(div1, "transform", /*transform*/ ctx[7], false);
1998
- internal.set_style(div1, "transform-origin", /*transformOrigin*/ ctx[8], false);
1809
+ div = internal.element("div");
1810
+ if (if_block) if_block.c();
1811
+ internal.attr(div, "class", "floorplan-plugin__room-label-item svelte-i2nwuk");
1812
+ internal.set_style(div, "left", /*left*/ ctx[4], false);
1813
+ internal.set_style(div, "top", /*top*/ ctx[5], false);
1814
+ internal.set_style(div, "font-size", /*fontSize*/ ctx[6], false);
1999
1815
  },
2000
1816
  m(target, anchor) {
2001
- internal.insert(target, div1, anchor);
2002
- internal.append(div1, div0);
2003
- internal.append(div1, t0);
2004
-
2005
- for (let i = 0; i < each_blocks_1.length; i += 1) {
2006
- each_blocks_1[i].m(div1, null);
2007
- }
2008
-
2009
- internal.append(div1, t1);
2010
-
2011
- for (let i = 0; i < each_blocks.length; i += 1) {
2012
- each_blocks[i].m(div1, null);
2013
- }
1817
+ internal.insert(target, div, anchor);
1818
+ if (if_block) if_block.m(div, null);
2014
1819
  },
2015
1820
  p(ctx, [dirty]) {
2016
- if (dirty & /*positionPxArray*/ 64) {
2017
- each_value_1 = /*positionPxArray*/ ctx[6];
2018
- each_blocks_1 = internal.update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx, each_value_1, each0_lookup, div1, internal.destroy_block, create_each_block_1, t1, get_each_context_1);
2019
- }
2020
-
2021
- if (dirty & /*isLeft, isTop, isRight, isBottom, textArray, isRow*/ 1086) {
2022
- each_value = /*textArray*/ ctx[10];
2023
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx, each_value, each1_lookup, div1, internal.destroy_block, create_each_block$6, null, get_each_context$6);
2024
- }
1821
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
1822
+ if_block.p(ctx, dirty);
1823
+ } else {
1824
+ if (if_block) if_block.d(1);
1825
+ if_block = current_block_type && current_block_type(ctx);
2025
1826
 
2026
- if (dirty & /*type*/ 1 && div1_class_value !== (div1_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels-" + /*type*/ ctx[0] + " svelte-1rr09in")) {
2027
- internal.attr(div1, "class", div1_class_value);
1827
+ if (if_block) {
1828
+ if_block.c();
1829
+ if_block.m(div, null);
1830
+ }
2028
1831
  }
2029
1832
  },
2030
1833
  i: internal.noop,
2031
1834
  o: internal.noop,
2032
1835
  d(detaching) {
2033
- if (detaching) internal.detach(div1);
2034
-
2035
- for (let i = 0; i < each_blocks_1.length; i += 1) {
2036
- each_blocks_1[i].d();
2037
- }
1836
+ if (detaching) internal.detach(div);
2038
1837
 
2039
- for (let i = 0; i < each_blocks.length; i += 1) {
2040
- each_blocks[i].d();
1838
+ if (if_block) {
1839
+ if_block.d();
2041
1840
  }
2042
1841
  }
2043
1842
  };
2044
1843
  }
2045
1844
 
2046
- const padding = 1000;
2047
-
2048
- function instance$k($$self, $$props, $$invalidate) {
2049
- let { pxmm } = $$props;
2050
- let { type } = $$props;
2051
- let { data } = $$props;
2052
- let { bounding } = $$props;
2053
- const isTop = type === 'top';
2054
- const isBottom = type === 'bottom';
2055
- const isLeft = type === 'left';
2056
- const isRight = type === 'right';
2057
- const isRow = isTop || isBottom;
1845
+ function instance$j($$self, $$props, $$invalidate) {
1846
+ let userConfigElement;
1847
+ let { room } = $$props;
1848
+ let { getLabelElement } = $$props;
2058
1849
 
2059
- // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2060
- const positionArray = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2061
- if (index === 0) return true;
2062
- return x !== arr[index - 1];
2063
- });
1850
+ // TODO: 统一这里的判断条件,目前写了多处
1851
+ const bodyWidth = document.body.clientWidth;
2064
1852
 
2065
- const minPosition = positionArray[0];
2066
- const maxPosition = positionArray.slice(-1)[0];
2067
- const length = maxPosition - minPosition;
2068
- const minBounding = isRow ? bounding.min.x : bounding.min.y;
2069
- const lengthPx = length * pxmm;
2070
- const positionPxArray = positionArray.map(x => (x - minPosition) / length * lengthPx);
2071
-
2072
- // 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
2073
- const translateMain = (minPosition - minBounding) * pxmm;
2074
-
2075
- // 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
2076
- const translateSecond = 27 - padding * pxmm;
2077
-
2078
- const translate = (() => {
2079
- if (isTop) return `translate(${translateMain}px, ${-translateSecond}px)`;
2080
- if (isBottom) return `translate(${translateMain}px, ${translateSecond}px)`;
2081
- if (isLeft) return `translate(${-translateSecond}px, ${-translateMain}px)`;
2082
- if (isRight) return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
2083
- })();
2084
-
2085
- const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
2086
- const transform = `${translate} ${rotate}`;
2087
- const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
2088
- const width = lengthPx + 'px';
2089
-
2090
- // 把点位的户型图坐标转成距离起始位置的像素值
2091
- const textArray = positionArray.map((position, index, array) => {
2092
- if (index === 0) return null;
2093
- const distance = position - array[index - 1];
2094
- const positionPx = (array[index - 1] + distance / 2 - minPosition) / length * lengthPx;
2095
- return { distance, positionPx };
2096
- }).filter(notNil).filter(item => item.distance / length > 0.12);
1853
+ const bodyHeight = document.body.clientHeight;
1854
+ const roomSizeDes = room.size ? (room.size / 1000000).toFixed(1) + '㎡' : '';
1855
+ const roomLabel = room.roomLabel;
1856
+ const left = roomLabel.positionInImage.x * 100 + '%';
1857
+ const top = roomLabel.positionInImage.y * 100 + '%';
1858
+ const fontSize = (bodyWidth < 500 || bodyHeight < 500 ? 10 : 14) / 16 + 'rem';
2097
1859
 
2098
1860
  $$self.$$set = $$props => {
2099
- if ('pxmm' in $$props) $$invalidate(11, pxmm = $$props.pxmm);
2100
- if ('type' in $$props) $$invalidate(0, type = $$props.type);
2101
- if ('data' in $$props) $$invalidate(12, data = $$props.data);
2102
- if ('bounding' in $$props) $$invalidate(13, bounding = $$props.bounding);
1861
+ if ('room' in $$props) $$invalidate(0, room = $$props.room);
1862
+ if ('getLabelElement' in $$props) $$invalidate(1, getLabelElement = $$props.getLabelElement);
2103
1863
  };
2104
1864
 
2105
- return [
2106
- type,
2107
- isTop,
2108
- isBottom,
2109
- isLeft,
2110
- isRight,
2111
- isRow,
2112
- positionPxArray,
2113
- transform,
2114
- transformOrigin,
2115
- width,
2116
- textArray,
2117
- pxmm,
2118
- data,
2119
- bounding
2120
- ];
1865
+ $$self.$$.update = () => {
1866
+ if ($$self.$$.dirty & /*getLabelElement, room*/ 3) {
1867
+ $$invalidate(2, userConfigElement = getLabelElement === null || getLabelElement === void 0
1868
+ ? void 0
1869
+ : getLabelElement(room));
1870
+ }
1871
+ };
1872
+
1873
+ return [room, getLabelElement, userConfigElement, roomSizeDes, left, top, fontSize];
2121
1874
  }
2122
1875
 
2123
- class RuleItem extends internal.SvelteComponent {
1876
+ class RoomLabel extends internal.SvelteComponent {
2124
1877
  constructor(options) {
2125
1878
  super();
2126
-
2127
- internal.init(
2128
- this,
2129
- options,
2130
- instance$k,
2131
- create_fragment$k,
2132
- internal.safe_not_equal,
2133
- {
2134
- pxmm: 11,
2135
- type: 0,
2136
- data: 12,
2137
- bounding: 13
2138
- },
2139
- add_css$f
2140
- );
1879
+ internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { room: 0, getLabelElement: 1 }, add_css$f);
2141
1880
  }
2142
1881
  }
2143
1882
 
2144
- /* src/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
1883
+ /* src/floorplan/Components/RoomLabels/RoomLabels.svelte generated by Svelte v3.47.0 */
2145
1884
 
2146
- function get_each_context$5(ctx, list, i) {
2147
- const child_ctx = ctx.slice();
2148
- child_ctx[7] = list[i][0];
2149
- child_ctx[8] = list[i][1];
2150
- return child_ctx;
1885
+ function add_css$e(target) {
1886
+ internal.append_styles(target, "svelte-13xux0b", ".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}");
2151
1887
  }
2152
1888
 
2153
- // (12:2) {#each ruleLabelArray as [type, data] (type)}
2154
- function create_each_block$5(key_1, ctx) {
2155
- let first;
2156
- let ruleitem;
2157
- let current;
2158
-
2159
- const ruleitem_spread_levels = [
2160
- {
2161
- type: /*type*/ ctx[7],
2162
- data: /*data*/ ctx[8],
2163
- pxmm: /*pxmm*/ ctx[0],
2164
- bounding: /*bounding*/ ctx[2]
2165
- }
2166
- ];
2167
-
2168
- let ruleitem_props = {};
2169
-
2170
- for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2171
- ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2172
- }
2173
-
2174
- ruleitem = new RuleItem({ props: ruleitem_props });
2175
-
2176
- return {
2177
- key: key_1,
2178
- first: null,
2179
- c() {
2180
- first = internal.empty();
2181
- internal.create_component(ruleitem.$$.fragment);
2182
- this.first = first;
2183
- },
2184
- m(target, anchor) {
2185
- internal.insert(target, first, anchor);
2186
- internal.mount_component(ruleitem, target, anchor);
2187
- current = true;
2188
- },
2189
- p(new_ctx, dirty) {
2190
- ctx = new_ctx;
2191
-
2192
- const ruleitem_changes = (dirty & /*ruleLabelArray, pxmm, bounding*/ 7)
2193
- ? internal.get_spread_update(ruleitem_spread_levels, [
2194
- {
2195
- type: /*type*/ ctx[7],
2196
- data: /*data*/ ctx[8],
2197
- pxmm: /*pxmm*/ ctx[0],
2198
- bounding: /*bounding*/ ctx[2]
2199
- }
2200
- ])
2201
- : {};
2202
-
2203
- ruleitem.$set(ruleitem_changes);
2204
- },
2205
- i(local) {
2206
- if (current) return;
2207
- internal.transition_in(ruleitem.$$.fragment, local);
2208
- current = true;
2209
- },
2210
- o(local) {
2211
- internal.transition_out(ruleitem.$$.fragment, local);
2212
- current = false;
2213
- },
2214
- d(detaching) {
2215
- if (detaching) internal.detach(first);
2216
- internal.destroy_component(ruleitem, detaching);
2217
- }
2218
- };
1889
+ function get_each_context$8(ctx, list, i) {
1890
+ const child_ctx = ctx.slice();
1891
+ child_ctx[4] = list[i];
1892
+ return child_ctx;
2219
1893
  }
2220
1894
 
2221
- function create_fragment$j(ctx) {
1895
+ // (8:0) {#if rooms}
1896
+ function create_if_block$5(ctx) {
2222
1897
  let div;
2223
1898
  let each_blocks = [];
2224
1899
  let each_1_lookup = new Map();
2225
1900
  let current;
2226
- let each_value = /*ruleLabelArray*/ ctx[1];
2227
- const get_key = ctx => /*type*/ ctx[7];
1901
+ let each_value = /*rooms*/ ctx[1];
1902
+ const get_key = ctx => /*room*/ ctx[4].id;
2228
1903
 
2229
1904
  for (let i = 0; i < each_value.length; i += 1) {
2230
- let child_ctx = get_each_context$5(ctx, each_value, i);
1905
+ let child_ctx = get_each_context$8(ctx, each_value, i);
2231
1906
  let key = get_key(child_ctx);
2232
- each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx));
1907
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx));
2233
1908
  }
2234
1909
 
2235
1910
  return {
@@ -2240,7 +1915,7 @@ function create_fragment$j(ctx) {
2240
1915
  each_blocks[i].c();
2241
1916
  }
2242
1917
 
2243
- internal.attr(div, "class", "floorplan-plugin__rulelabels");
1918
+ internal.attr(div, "class", "floorplan-plugin__room-labels svelte-13xux0b");
2244
1919
  },
2245
1920
  m(target, anchor) {
2246
1921
  internal.insert(target, div, anchor);
@@ -2251,11 +1926,11 @@ function create_fragment$j(ctx) {
2251
1926
 
2252
1927
  current = true;
2253
1928
  },
2254
- p(ctx, [dirty]) {
2255
- if (dirty & /*ruleLabelArray, pxmm, bounding*/ 7) {
2256
- each_value = /*ruleLabelArray*/ ctx[1];
1929
+ p(ctx, dirty) {
1930
+ if (dirty & /*rooms, getLabelElement*/ 3) {
1931
+ each_value = /*rooms*/ ctx[1];
2257
1932
  internal.group_outros();
2258
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$5, null, get_each_context$5);
1933
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$8, null, get_each_context$8);
2259
1934
  internal.check_outros();
2260
1935
  }
2261
1936
  },
@@ -2285,373 +1960,670 @@ function create_fragment$j(ctx) {
2285
1960
  };
2286
1961
  }
2287
1962
 
2288
- function instance$j($$self, $$props, $$invalidate) {
2289
- let bounding;
2290
- let ruleLabelData;
2291
- let ruleLabelDataKeys;
2292
- let ruleLabelArray;
2293
- let { pxmm } = $$props;
2294
- let { floorIndex } = $$props;
2295
- let { floorplanData } = $$props;
2296
-
2297
- $$self.$$set = $$props => {
2298
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
2299
- if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
2300
- if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
2301
- };
2302
-
2303
- $$self.$$.update = () => {
2304
- if ($$self.$$.dirty & /*floorplanData*/ 16) {
2305
- $$invalidate(2, bounding = floorplanData.bounding);
2306
- }
1963
+ // (10:4) {#each rooms as room (room.id)}
1964
+ function create_each_block$8(key_1, ctx) {
1965
+ let first;
1966
+ let roomlabel;
1967
+ let current;
2307
1968
 
2308
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
2309
- $$invalidate(5, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
1969
+ const roomlabel_spread_levels = [
1970
+ {
1971
+ room: /*room*/ ctx[4],
1972
+ getLabelElement: /*getLabelElement*/ ctx[0]
2310
1973
  }
1974
+ ];
2311
1975
 
2312
- if ($$self.$$.dirty & /*ruleLabelData*/ 32) {
2313
- $$invalidate(6, ruleLabelDataKeys = Object.keys(ruleLabelData));
2314
- }
1976
+ let roomlabel_props = {};
2315
1977
 
2316
- if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 96) {
2317
- $$invalidate(1, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2318
- }
2319
- };
1978
+ for (let i = 0; i < roomlabel_spread_levels.length; i += 1) {
1979
+ roomlabel_props = internal.assign(roomlabel_props, roomlabel_spread_levels[i]);
1980
+ }
2320
1981
 
2321
- return [
2322
- pxmm,
2323
- ruleLabelArray,
2324
- bounding,
2325
- floorIndex,
2326
- floorplanData,
2327
- ruleLabelData,
2328
- ruleLabelDataKeys
2329
- ];
2330
- }
1982
+ roomlabel = new RoomLabel({ props: roomlabel_props });
2331
1983
 
2332
- class RuleLabels extends internal.SvelteComponent {
2333
- constructor(options) {
2334
- super();
2335
- internal.init(this, options, instance$j, create_fragment$j, internal.safe_not_equal, { pxmm: 0, floorIndex: 3, floorplanData: 4 });
2336
- }
2337
- }
1984
+ return {
1985
+ key: key_1,
1986
+ first: null,
1987
+ c() {
1988
+ first = internal.empty();
1989
+ internal.create_component(roomlabel.$$.fragment);
1990
+ this.first = first;
1991
+ },
1992
+ m(target, anchor) {
1993
+ internal.insert(target, first, anchor);
1994
+ internal.mount_component(roomlabel, target, anchor);
1995
+ current = true;
1996
+ },
1997
+ p(new_ctx, dirty) {
1998
+ ctx = new_ctx;
2338
1999
 
2339
- /* src/floorplan/Components/Normalmage.svelte generated by Svelte v3.47.0 */
2000
+ const roomlabel_changes = (dirty & /*rooms, getLabelElement*/ 3)
2001
+ ? internal.get_spread_update(roomlabel_spread_levels, [
2002
+ {
2003
+ room: /*room*/ ctx[4],
2004
+ getLabelElement: /*getLabelElement*/ ctx[0]
2005
+ }
2006
+ ])
2007
+ : {};
2340
2008
 
2341
- function add_css$e(target) {
2342
- internal.append_styles(target, "svelte-1cuuebb", "img.svelte-1cuuebb{width:100%;height:100%}");
2009
+ roomlabel.$set(roomlabel_changes);
2010
+ },
2011
+ i(local) {
2012
+ if (current) return;
2013
+ internal.transition_in(roomlabel.$$.fragment, local);
2014
+ current = true;
2015
+ },
2016
+ o(local) {
2017
+ internal.transition_out(roomlabel.$$.fragment, local);
2018
+ current = false;
2019
+ },
2020
+ d(detaching) {
2021
+ if (detaching) internal.detach(first);
2022
+ internal.destroy_component(roomlabel, detaching);
2023
+ }
2024
+ };
2343
2025
  }
2344
2026
 
2345
2027
  function create_fragment$i(ctx) {
2346
- let img;
2347
- let img_src_value;
2028
+ let if_block_anchor;
2029
+ let current;
2030
+ let if_block = /*rooms*/ ctx[1] && create_if_block$5(ctx);
2348
2031
 
2349
2032
  return {
2350
2033
  c() {
2351
- img = internal.element("img");
2352
- if (!internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) internal.attr(img, "src", img_src_value);
2353
- internal.attr(img, "alt", "floorplan iamge");
2354
- internal.attr(img, "class", "svelte-1cuuebb");
2034
+ if (if_block) if_block.c();
2035
+ if_block_anchor = internal.empty();
2355
2036
  },
2356
2037
  m(target, anchor) {
2357
- internal.insert(target, img, anchor);
2038
+ if (if_block) if_block.m(target, anchor);
2039
+ internal.insert(target, if_block_anchor, anchor);
2040
+ current = true;
2358
2041
  },
2359
2042
  p(ctx, [dirty]) {
2360
- if (dirty & /*url*/ 1 && !internal.src_url_equal(img.src, img_src_value = /*url*/ ctx[0])) {
2361
- internal.attr(img, "src", img_src_value);
2043
+ if (/*rooms*/ ctx[1]) {
2044
+ if (if_block) {
2045
+ if_block.p(ctx, dirty);
2046
+
2047
+ if (dirty & /*rooms*/ 2) {
2048
+ internal.transition_in(if_block, 1);
2049
+ }
2050
+ } else {
2051
+ if_block = create_if_block$5(ctx);
2052
+ if_block.c();
2053
+ internal.transition_in(if_block, 1);
2054
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2055
+ }
2056
+ } else if (if_block) {
2057
+ internal.group_outros();
2058
+
2059
+ internal.transition_out(if_block, 1, 1, () => {
2060
+ if_block = null;
2061
+ });
2062
+
2063
+ internal.check_outros();
2362
2064
  }
2363
2065
  },
2364
- i: internal.noop,
2365
- o: internal.noop,
2066
+ i(local) {
2067
+ if (current) return;
2068
+ internal.transition_in(if_block);
2069
+ current = true;
2070
+ },
2071
+ o(local) {
2072
+ internal.transition_out(if_block);
2073
+ current = false;
2074
+ },
2366
2075
  d(detaching) {
2367
- if (detaching) internal.detach(img);
2076
+ if (if_block) if_block.d(detaching);
2077
+ if (detaching) internal.detach(if_block_anchor);
2368
2078
  }
2369
2079
  };
2370
2080
  }
2371
2081
 
2372
2082
  function instance$i($$self, $$props, $$invalidate) {
2373
- let { url } = $$props;
2083
+ let rooms;
2084
+ let { floorIndex } = $$props;
2085
+ let { floorplanData } = $$props;
2086
+ let { getLabelElement } = $$props;
2374
2087
 
2375
2088
  $$self.$$set = $$props => {
2376
- if ('url' in $$props) $$invalidate(0, url = $$props.url);
2089
+ if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2090
+ if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2091
+ if ('getLabelElement' in $$props) $$invalidate(0, getLabelElement = $$props.getLabelElement);
2377
2092
  };
2378
2093
 
2379
- return [url];
2094
+ $$self.$$.update = () => {
2095
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2096
+ $$invalidate(1, rooms = floorplanData.floorDatas[floorIndex].rooms);
2097
+ }
2098
+ };
2099
+
2100
+ return [getLabelElement, rooms, floorIndex, floorplanData];
2380
2101
  }
2381
2102
 
2382
- class Normalmage extends internal.SvelteComponent {
2103
+ class RoomLabels extends internal.SvelteComponent {
2383
2104
  constructor(options) {
2384
2105
  super();
2385
- internal.init(this, options, instance$i, create_fragment$i, internal.safe_not_equal, { url: 0 }, add_css$e);
2106
+
2107
+ internal.init(
2108
+ this,
2109
+ options,
2110
+ instance$i,
2111
+ create_fragment$i,
2112
+ internal.safe_not_equal,
2113
+ {
2114
+ floorIndex: 2,
2115
+ floorplanData: 3,
2116
+ getLabelElement: 0
2117
+ },
2118
+ add_css$e
2119
+ );
2386
2120
  }
2387
2121
  }
2388
2122
 
2389
- /* src/floorplan/Components/SvgImage.svelte generated by Svelte v3.47.0 */
2123
+ /* src/floorplan/Components/RuleLabels/RuleItem.svelte generated by Svelte v3.47.0 */
2390
2124
 
2391
2125
  function add_css$d(target) {
2392
- internal.append_styles(target, "svelte-1qqy56u", ".floorplan-plugin__base-image.svelte-1qqy56u{width:100%;height:100%}");
2126
+ internal.append_styles(target, "svelte-xt7p1v", ".floorplan-plugin__rule-labels.svelte-xt7p1v.svelte-xt7p1v{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-xt7p1v.svelte-xt7p1v{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v.svelte-xt7p1v{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v.svelte-xt7p1v{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v.svelte-xt7p1v{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-xt7p1v.svelte-xt7p1v{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale-wrapper.svelte-xt7p1v{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-xt7p1v.svelte-xt7p1v{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-scale.svelte-xt7p1v{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-xt7p1v.svelte-xt7p1v{position:absolute}.floorplan-plugin__rule-labels--top.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-xt7p1v .floorplan-plugin__rule-text-wrapper.svelte-xt7p1v{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-xt7p1v.svelte-xt7p1v{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-xt7p1v .floorplan-plugin__rule-text-item.svelte-xt7p1v{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-xt7p1v.svelte-xt7p1v{width:-webkit-max-content;width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}");
2393
2127
  }
2394
2128
 
2395
- function create_fragment$h(ctx) {
2129
+ function get_each_context$7(ctx, list, i) {
2130
+ const child_ctx = ctx.slice();
2131
+ child_ctx[10] = list[i];
2132
+ child_ctx[12] = i;
2133
+ return child_ctx;
2134
+ }
2135
+
2136
+ function get_each_context_1(ctx, list, i) {
2137
+ const child_ctx = ctx.slice();
2138
+ child_ctx[13] = list[i];
2139
+ return child_ctx;
2140
+ }
2141
+
2142
+ // (53:4) {#each rulerLabels as rulerLabel}
2143
+ function create_each_block_1(ctx) {
2396
2144
  let div;
2397
- let html_tag;
2398
- let t;
2399
- let html_tag_1;
2400
2145
 
2401
2146
  return {
2402
2147
  c() {
2403
2148
  div = internal.element("div");
2404
- html_tag = new internal.HtmlTag();
2405
- t = internal.space();
2406
- html_tag_1 = new internal.HtmlTag();
2407
- html_tag.a = t;
2408
- html_tag_1.a = null;
2409
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-1qqy56u");
2149
+ internal.attr(div, "class", "floorplan-plugin__rule-scale svelte-xt7p1v");
2150
+ internal.set_style(div, "left", /*rulerLabel*/ ctx[13].left * 100 + '%', false);
2151
+ internal.set_style(div, "bottom", /*rulerLabel*/ ctx[13].bottom * 100 + '%', false);
2410
2152
  },
2411
2153
  m(target, anchor) {
2412
2154
  internal.insert(target, div, anchor);
2413
- html_tag.m(/*svgStyle*/ ctx[1], div);
2414
- internal.append(div, t);
2415
- html_tag_1.m(/*content*/ ctx[0], div);
2155
+ },
2156
+ p: internal.noop,
2157
+ d(detaching) {
2158
+ if (detaching) internal.detach(div);
2159
+ }
2160
+ };
2161
+ }
2162
+
2163
+ // (62:4) {#each rulerTexts as textItem, textItemIndex (textItemIndex)}
2164
+ function create_each_block$7(key_1, ctx) {
2165
+ let div1;
2166
+ let div0;
2167
+ let t0_value = /*textItem*/ ctx[10].distance + "";
2168
+ let t0;
2169
+ let t1;
2170
+
2171
+ return {
2172
+ key: key_1,
2173
+ first: null,
2174
+ c() {
2175
+ div1 = internal.element("div");
2176
+ div0 = internal.element("div");
2177
+ t0 = internal.text(t0_value);
2178
+ t1 = internal.space();
2179
+ internal.attr(div0, "class", "floorplan-plugin__rule-text svelte-xt7p1v");
2180
+ internal.toggle_class(div0, "is-row", /*isRow*/ ctx[1]);
2181
+ internal.attr(div1, "class", "floorplan-plugin__rule-text-item svelte-xt7p1v");
2182
+ internal.set_style(div1, "left", /*textItem*/ ctx[10].left * 100 + '%', false);
2183
+ internal.set_style(div1, "bottom", /*textItem*/ ctx[10].bottom * 100 + '%', false);
2184
+ this.first = div1;
2185
+ },
2186
+ m(target, anchor) {
2187
+ internal.insert(target, div1, anchor);
2188
+ internal.append(div1, div0);
2189
+ internal.append(div0, t0);
2190
+ internal.append(div1, t1);
2191
+ },
2192
+ p(new_ctx, dirty) {
2193
+ ctx = new_ctx;
2194
+ },
2195
+ d(detaching) {
2196
+ if (detaching) internal.detach(div1);
2197
+ }
2198
+ };
2199
+ }
2200
+
2201
+ function create_fragment$h(ctx) {
2202
+ let div3;
2203
+ let div0;
2204
+ let t0;
2205
+ let div1;
2206
+ let t1;
2207
+ let div2;
2208
+ let each_blocks = [];
2209
+ let each1_lookup = new Map();
2210
+ let div3_class_value;
2211
+ let each_value_1 = /*rulerLabels*/ ctx[2];
2212
+ let each_blocks_1 = [];
2213
+
2214
+ for (let i = 0; i < each_value_1.length; i += 1) {
2215
+ each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
2216
+ }
2217
+
2218
+ let each_value = /*rulerTexts*/ ctx[3];
2219
+ const get_key = ctx => /*textItemIndex*/ ctx[12];
2220
+
2221
+ for (let i = 0; i < each_value.length; i += 1) {
2222
+ let child_ctx = get_each_context$7(ctx, each_value, i);
2223
+ let key = get_key(child_ctx);
2224
+ each1_lookup.set(key, each_blocks[i] = create_each_block$7(key, child_ctx));
2225
+ }
2226
+
2227
+ return {
2228
+ c() {
2229
+ div3 = internal.element("div");
2230
+ div0 = internal.element("div");
2231
+ t0 = internal.space();
2232
+ div1 = internal.element("div");
2233
+
2234
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2235
+ each_blocks_1[i].c();
2236
+ }
2237
+
2238
+ t1 = internal.space();
2239
+ div2 = internal.element("div");
2240
+
2241
+ for (let i = 0; i < each_blocks.length; i += 1) {
2242
+ each_blocks[i].c();
2243
+ }
2244
+
2245
+ internal.attr(div0, "class", "floorplan-plugin__rule-line svelte-xt7p1v");
2246
+ internal.attr(div1, "class", "floorplan-plugin__rule-scale-wrapper svelte-xt7p1v");
2247
+ internal.toggle_class(div1, "is-row", /*isRow*/ ctx[1]);
2248
+ internal.attr(div2, "class", "floorplan-plugin__rule-text-wrapper svelte-xt7p1v");
2249
+ internal.attr(div3, "class", div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v");
2250
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2251
+ internal.set_style(div3, "width", /*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2252
+ internal.set_style(div3, "height", !/*isRow*/ ctx[1] ? '100%' : 1 / 16 + 'rem', false);
2253
+ },
2254
+ m(target, anchor) {
2255
+ internal.insert(target, div3, anchor);
2256
+ internal.append(div3, div0);
2257
+ internal.append(div3, t0);
2258
+ internal.append(div3, div1);
2259
+
2260
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
2261
+ each_blocks_1[i].m(div1, null);
2262
+ }
2263
+
2264
+ internal.append(div3, t1);
2265
+ internal.append(div3, div2);
2266
+
2267
+ for (let i = 0; i < each_blocks.length; i += 1) {
2268
+ each_blocks[i].m(div2, null);
2269
+ }
2416
2270
  },
2417
2271
  p(ctx, [dirty]) {
2418
- if (dirty & /*content*/ 1) html_tag_1.p(/*content*/ ctx[0]);
2272
+ if (dirty & /*rulerLabels*/ 4) {
2273
+ each_value_1 = /*rulerLabels*/ ctx[2];
2274
+ let i;
2275
+
2276
+ for (i = 0; i < each_value_1.length; i += 1) {
2277
+ const child_ctx = get_each_context_1(ctx, each_value_1, i);
2278
+
2279
+ if (each_blocks_1[i]) {
2280
+ each_blocks_1[i].p(child_ctx, dirty);
2281
+ } else {
2282
+ each_blocks_1[i] = create_each_block_1(child_ctx);
2283
+ each_blocks_1[i].c();
2284
+ each_blocks_1[i].m(div1, null);
2285
+ }
2286
+ }
2287
+
2288
+ for (; i < each_blocks_1.length; i += 1) {
2289
+ each_blocks_1[i].d(1);
2290
+ }
2291
+
2292
+ each_blocks_1.length = each_value_1.length;
2293
+ }
2294
+
2295
+ if (dirty & /*rulerTexts, isRow*/ 10) {
2296
+ each_value = /*rulerTexts*/ ctx[3];
2297
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div2, internal.destroy_block, create_each_block$7, null, get_each_context$7);
2298
+ }
2299
+
2300
+ if (dirty & /*type*/ 1 && div3_class_value !== (div3_class_value = "floorplan-plugin__rule-labels floorplan-plugin__rule-labels--" + /*type*/ ctx[0] + " svelte-xt7p1v")) {
2301
+ internal.attr(div3, "class", div3_class_value);
2302
+ }
2303
+
2304
+ if (dirty & /*type, isRow*/ 3) {
2305
+ internal.toggle_class(div3, "is-row", /*isRow*/ ctx[1]);
2306
+ }
2419
2307
  },
2420
2308
  i: internal.noop,
2421
2309
  o: internal.noop,
2422
2310
  d(detaching) {
2423
- if (detaching) internal.detach(div);
2311
+ if (detaching) internal.detach(div3);
2312
+ internal.destroy_each(each_blocks_1, detaching);
2313
+
2314
+ for (let i = 0; i < each_blocks.length; i += 1) {
2315
+ each_blocks[i].d();
2316
+ }
2424
2317
  }
2425
2318
  };
2426
2319
  }
2427
2320
 
2321
+ const padding$1 = 1000;
2322
+ const exteriorWallOffset$1 = 180;
2323
+
2428
2324
  function instance$h($$self, $$props, $$invalidate) {
2429
- let { content } = $$props;
2325
+ let { type } = $$props;
2326
+ let { data } = $$props;
2327
+ let { bounding } = $$props;
2328
+ const isRow = type === 'top' || type === 'bottom';
2329
+ const contentWidth = bounding.max.x - bounding.min.x - (padding$1 - exteriorWallOffset$1) * 2;
2330
+ const contentHeight = bounding.max.y - bounding.min.y - (padding$1 - exteriorWallOffset$1) * 2;
2430
2331
 
2431
- const svgStyle = `
2432
- <style>
2433
- svg [type='lineGroup'] path {
2434
- fill: #ffffff;
2435
- stroke: #ffffff;
2436
- }
2437
- svg [type='lineItemGroup'] g g g g {
2438
- stroke: #ffffff;
2439
- }
2440
- </style>
2441
- `;
2332
+ // 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
2333
+ const rulerPoints = data.map(([start, end]) => isRow ? [start.x, end.x] : [start.y, end.y]).flat().sort().filter((x, index, arr) => {
2334
+ // 筛除重复数据
2335
+ if (index === 0) return true;
2336
+
2337
+ return x !== arr[index - 1];
2338
+ });
2339
+
2340
+ const rulerLabels = rulerPoints.map(num => {
2341
+ const left = isRow
2342
+ ? (num - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2343
+ : 0;
2344
+
2345
+ const bottom = !isRow
2346
+ ? (num - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2347
+ : 0;
2348
+
2349
+ return { left, bottom };
2350
+ });
2351
+
2352
+ rulerLabels.unshift({ left: 0, bottom: 0 });
2353
+ rulerLabels.push(isRow ? { left: 1, bottom: 0 } : { left: 0, bottom: 1 });
2354
+ const length = rulerPoints[rulerPoints.length - 1] - rulerPoints[0];
2355
+
2356
+ const rulerTexts = rulerPoints.map((num, index, arr) => {
2357
+ const distance = index === 0 ? 0 : num - arr[index - 1];
2358
+ const positionNum = index === 0 ? 0 : (num + arr[index - 1]) / 2;
2359
+
2360
+ const left = isRow
2361
+ ? (positionNum - bounding.min.x - padding$1 + exteriorWallOffset$1) / contentWidth
2362
+ : 0;
2363
+
2364
+ const bottom = !isRow
2365
+ ? (positionNum - bounding.min.y - padding$1 + exteriorWallOffset$1) / contentHeight
2366
+ : 0;
2367
+
2368
+ return { left, bottom, distance };
2369
+ }).filter(({ distance }) => distance / length > 0.1);
2442
2370
 
2443
2371
  $$self.$$set = $$props => {
2444
- if ('content' in $$props) $$invalidate(0, content = $$props.content);
2372
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
2373
+ if ('data' in $$props) $$invalidate(4, data = $$props.data);
2374
+ if ('bounding' in $$props) $$invalidate(5, bounding = $$props.bounding);
2445
2375
  };
2446
2376
 
2447
- return [content, svgStyle];
2377
+ return [type, isRow, rulerLabels, rulerTexts, data, bounding];
2448
2378
  }
2449
2379
 
2450
- class SvgImage extends internal.SvelteComponent {
2380
+ class RuleItem extends internal.SvelteComponent {
2451
2381
  constructor(options) {
2452
2382
  super();
2453
- internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { content: 0 }, add_css$d);
2383
+ internal.init(this, options, instance$h, create_fragment$h, internal.safe_not_equal, { type: 0, data: 4, bounding: 5 }, add_css$d);
2454
2384
  }
2455
2385
  }
2456
2386
 
2457
- /* src/floorplan/Components/BaseImage.svelte generated by Svelte v3.47.0 */
2387
+ /* src/floorplan/Components/RuleLabels/RuleLabels.svelte generated by Svelte v3.47.0 */
2458
2388
 
2459
2389
  function add_css$c(target) {
2460
- internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
2390
+ internal.append_styles(target, "svelte-1mzj9p3", ".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}");
2461
2391
  }
2462
2392
 
2463
- // (13:22)
2464
- function create_if_block_1$3(ctx) {
2465
- let normalimage;
2393
+ function get_each_context$6(ctx, list, i) {
2394
+ const child_ctx = ctx.slice();
2395
+ child_ctx[12] = list[i][0];
2396
+ child_ctx[13] = list[i][1];
2397
+ return child_ctx;
2398
+ }
2399
+
2400
+ // (19:2) {#each ruleLabelArray as [type, data] (type)}
2401
+ function create_each_block$6(key_1, ctx) {
2402
+ let first;
2403
+ let ruleitem;
2466
2404
  let current;
2467
- normalimage = new Normalmage({ props: { url: /*imageData*/ ctx[1].url } });
2468
2405
 
2469
- return {
2470
- c() {
2471
- internal.create_component(normalimage.$$.fragment);
2472
- },
2473
- m(target, anchor) {
2474
- internal.mount_component(normalimage, target, anchor);
2475
- current = true;
2476
- },
2477
- p(ctx, dirty) {
2478
- const normalimage_changes = {};
2479
- if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
2480
- normalimage.$set(normalimage_changes);
2481
- },
2482
- i(local) {
2483
- if (current) return;
2484
- internal.transition_in(normalimage.$$.fragment, local);
2485
- current = true;
2486
- },
2487
- o(local) {
2488
- internal.transition_out(normalimage.$$.fragment, local);
2489
- current = false;
2490
- },
2491
- d(detaching) {
2492
- internal.destroy_component(normalimage, detaching);
2406
+ const ruleitem_spread_levels = [
2407
+ {
2408
+ type: /*type*/ ctx[12],
2409
+ data: /*data*/ ctx[13],
2410
+ bounding: /*bounding*/ ctx[0]
2493
2411
  }
2494
- };
2495
- }
2412
+ ];
2496
2413
 
2497
- // (11:2) {#if svgContent}
2498
- function create_if_block$5(ctx) {
2499
- let svgimage;
2500
- let current;
2414
+ let ruleitem_props = {};
2501
2415
 
2502
- svgimage = new SvgImage({
2503
- props: { content: /*svgContent*/ ctx[0] }
2504
- });
2416
+ for (let i = 0; i < ruleitem_spread_levels.length; i += 1) {
2417
+ ruleitem_props = internal.assign(ruleitem_props, ruleitem_spread_levels[i]);
2418
+ }
2419
+
2420
+ ruleitem = new RuleItem({ props: ruleitem_props });
2505
2421
 
2506
2422
  return {
2423
+ key: key_1,
2424
+ first: null,
2507
2425
  c() {
2508
- internal.create_component(svgimage.$$.fragment);
2426
+ first = internal.empty();
2427
+ internal.create_component(ruleitem.$$.fragment);
2428
+ this.first = first;
2509
2429
  },
2510
2430
  m(target, anchor) {
2511
- internal.mount_component(svgimage, target, anchor);
2431
+ internal.insert(target, first, anchor);
2432
+ internal.mount_component(ruleitem, target, anchor);
2512
2433
  current = true;
2513
2434
  },
2514
- p(ctx, dirty) {
2515
- const svgimage_changes = {};
2516
- if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
2517
- svgimage.$set(svgimage_changes);
2435
+ p(new_ctx, dirty) {
2436
+ ctx = new_ctx;
2437
+
2438
+ const ruleitem_changes = (dirty & /*ruleLabelArray, bounding*/ 9)
2439
+ ? internal.get_spread_update(ruleitem_spread_levels, [
2440
+ {
2441
+ type: /*type*/ ctx[12],
2442
+ data: /*data*/ ctx[13],
2443
+ bounding: /*bounding*/ ctx[0]
2444
+ }
2445
+ ])
2446
+ : {};
2447
+
2448
+ ruleitem.$set(ruleitem_changes);
2518
2449
  },
2519
2450
  i(local) {
2520
2451
  if (current) return;
2521
- internal.transition_in(svgimage.$$.fragment, local);
2452
+ internal.transition_in(ruleitem.$$.fragment, local);
2522
2453
  current = true;
2523
2454
  },
2524
2455
  o(local) {
2525
- internal.transition_out(svgimage.$$.fragment, local);
2456
+ internal.transition_out(ruleitem.$$.fragment, local);
2526
2457
  current = false;
2527
2458
  },
2528
2459
  d(detaching) {
2529
- internal.destroy_component(svgimage, detaching);
2460
+ if (detaching) internal.detach(first);
2461
+ internal.destroy_component(ruleitem, detaching);
2530
2462
  }
2531
2463
  };
2532
2464
  }
2533
2465
 
2534
2466
  function create_fragment$g(ctx) {
2535
2467
  let div;
2536
- let current_block_type_index;
2537
- let if_block;
2468
+ let each_blocks = [];
2469
+ let each_1_lookup = new Map();
2538
2470
  let current;
2539
- const if_block_creators = [create_if_block$5, create_if_block_1$3];
2540
- const if_blocks = [];
2541
-
2542
- function select_block_type(ctx, dirty) {
2543
- if (/*svgContent*/ ctx[0]) return 0;
2544
- if (/*imageData*/ ctx[1]) return 1;
2545
- return -1;
2546
- }
2471
+ let each_value = /*ruleLabelArray*/ ctx[3];
2472
+ const get_key = ctx => /*type*/ ctx[12];
2547
2473
 
2548
- if (~(current_block_type_index = select_block_type(ctx))) {
2549
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2474
+ for (let i = 0; i < each_value.length; i += 1) {
2475
+ let child_ctx = get_each_context$6(ctx, each_value, i);
2476
+ let key = get_key(child_ctx);
2477
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx));
2550
2478
  }
2551
2479
 
2552
2480
  return {
2553
2481
  c() {
2554
2482
  div = internal.element("div");
2555
- if (if_block) if_block.c();
2556
- internal.attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
2483
+
2484
+ for (let i = 0; i < each_blocks.length; i += 1) {
2485
+ each_blocks[i].c();
2486
+ }
2487
+
2488
+ internal.attr(div, "class", "floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3");
2489
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2490
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2557
2491
  },
2558
2492
  m(target, anchor) {
2559
2493
  internal.insert(target, div, anchor);
2560
2494
 
2561
- if (~current_block_type_index) {
2562
- if_blocks[current_block_type_index].m(div, null);
2495
+ for (let i = 0; i < each_blocks.length; i += 1) {
2496
+ each_blocks[i].m(div, null);
2563
2497
  }
2564
2498
 
2565
2499
  current = true;
2566
2500
  },
2567
2501
  p(ctx, [dirty]) {
2568
- let previous_block_index = current_block_type_index;
2569
- current_block_type_index = select_block_type(ctx);
2570
-
2571
- if (current_block_type_index === previous_block_index) {
2572
- if (~current_block_type_index) {
2573
- if_blocks[current_block_type_index].p(ctx, dirty);
2574
- }
2575
- } else {
2576
- if (if_block) {
2577
- internal.group_outros();
2578
-
2579
- internal.transition_out(if_blocks[previous_block_index], 1, 1, () => {
2580
- if_blocks[previous_block_index] = null;
2581
- });
2582
-
2583
- internal.check_outros();
2584
- }
2585
-
2586
- if (~current_block_type_index) {
2587
- if_block = if_blocks[current_block_type_index];
2502
+ if (dirty & /*ruleLabelArray, bounding*/ 9) {
2503
+ each_value = /*ruleLabelArray*/ ctx[3];
2504
+ internal.group_outros();
2505
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, internal.outro_and_destroy_block, create_each_block$6, null, get_each_context$6);
2506
+ internal.check_outros();
2507
+ }
2588
2508
 
2589
- if (!if_block) {
2590
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2591
- if_block.c();
2592
- } else {
2593
- if_block.p(ctx, dirty);
2594
- }
2509
+ if (dirty & /*width*/ 4) {
2510
+ internal.set_style(div, "width", /*width*/ ctx[2], false);
2511
+ }
2595
2512
 
2596
- internal.transition_in(if_block, 1);
2597
- if_block.m(div, null);
2598
- } else {
2599
- if_block = null;
2600
- }
2513
+ if (dirty & /*height*/ 2) {
2514
+ internal.set_style(div, "height", /*height*/ ctx[1], false);
2601
2515
  }
2602
2516
  },
2603
2517
  i(local) {
2604
2518
  if (current) return;
2605
- internal.transition_in(if_block);
2519
+
2520
+ for (let i = 0; i < each_value.length; i += 1) {
2521
+ internal.transition_in(each_blocks[i]);
2522
+ }
2523
+
2606
2524
  current = true;
2607
2525
  },
2608
2526
  o(local) {
2609
- internal.transition_out(if_block);
2527
+ for (let i = 0; i < each_blocks.length; i += 1) {
2528
+ internal.transition_out(each_blocks[i]);
2529
+ }
2530
+
2610
2531
  current = false;
2611
2532
  },
2612
2533
  d(detaching) {
2613
2534
  if (detaching) internal.detach(div);
2614
2535
 
2615
- if (~current_block_type_index) {
2616
- if_blocks[current_block_type_index].d();
2536
+ for (let i = 0; i < each_blocks.length; i += 1) {
2537
+ each_blocks[i].d();
2617
2538
  }
2618
2539
  }
2619
2540
  };
2620
2541
  }
2621
2542
 
2543
+ const padding = 1000;
2544
+ const exteriorWallOffset = 180;
2545
+
2622
2546
  function instance$g($$self, $$props, $$invalidate) {
2623
- let imageData;
2624
- let svgContent;
2625
- var _a, _b;
2547
+ let bounding;
2548
+ let ruleLabelData;
2549
+ let ruleLabelDataKeys;
2550
+ let ruleLabelArray;
2551
+ let boundingWidth;
2552
+ let boundingHeight;
2553
+ let contentWidth;
2554
+ let contentHeight;
2555
+ let width;
2556
+ let height;
2626
2557
  let { floorIndex } = $$props;
2627
2558
  let { floorplanData } = $$props;
2628
2559
 
2629
2560
  $$self.$$set = $$props => {
2630
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
2631
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
2561
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
2562
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
2632
2563
  };
2633
2564
 
2634
2565
  $$self.$$.update = () => {
2635
- if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
2636
- $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
2566
+ if ($$self.$$.dirty & /*floorplanData*/ 32) {
2567
+ $$invalidate(0, bounding = floorplanData.bounding);
2637
2568
  }
2638
2569
 
2639
- if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
2640
- $$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
2641
- ? void 0
2642
- : _a[floorIndex]) === null || _b === void 0
2643
- ? void 0
2644
- : _b.svgContent);
2570
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 48) {
2571
+ $$invalidate(10, ruleLabelData = floorplanData.floorDatas[floorIndex].rules);
2572
+ }
2573
+
2574
+ if ($$self.$$.dirty & /*ruleLabelData*/ 1024) {
2575
+ $$invalidate(11, ruleLabelDataKeys = Object.keys(ruleLabelData));
2576
+ }
2577
+
2578
+ if ($$self.$$.dirty & /*ruleLabelDataKeys, ruleLabelData*/ 3072) {
2579
+ $$invalidate(3, ruleLabelArray = ruleLabelDataKeys.map(key => [key, ruleLabelData[key]]));
2580
+ }
2581
+
2582
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2583
+ $$invalidate(8, boundingWidth = bounding.max.x - bounding.min.x);
2584
+ }
2585
+
2586
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2587
+ $$invalidate(6, boundingHeight = bounding.max.y - bounding.min.y);
2588
+ }
2589
+
2590
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2591
+ $$invalidate(9, contentWidth = bounding.max.x - bounding.min.x - (padding - exteriorWallOffset) * 2);
2592
+ }
2593
+
2594
+ if ($$self.$$.dirty & /*bounding*/ 1) {
2595
+ $$invalidate(7, contentHeight = bounding.max.y - bounding.min.y - (padding - exteriorWallOffset) * 2);
2596
+ }
2597
+
2598
+ if ($$self.$$.dirty & /*contentWidth, boundingWidth*/ 768) {
2599
+ $$invalidate(2, width = contentWidth / boundingWidth * 100 + '%');
2600
+ }
2601
+
2602
+ if ($$self.$$.dirty & /*contentHeight, boundingHeight*/ 192) {
2603
+ $$invalidate(1, height = contentHeight / boundingHeight * 100 + '%');
2645
2604
  }
2646
2605
  };
2647
2606
 
2648
- return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
2607
+ return [
2608
+ bounding,
2609
+ height,
2610
+ width,
2611
+ ruleLabelArray,
2612
+ floorIndex,
2613
+ floorplanData,
2614
+ boundingHeight,
2615
+ contentHeight,
2616
+ boundingWidth,
2617
+ contentWidth,
2618
+ ruleLabelData,
2619
+ ruleLabelDataKeys
2620
+ ];
2649
2621
  }
2650
2622
 
2651
- class BaseImage extends internal.SvelteComponent {
2623
+ class RuleLabels extends internal.SvelteComponent {
2652
2624
  constructor(options) {
2653
2625
  super();
2654
- internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css$c);
2626
+ internal.init(this, options, instance$g, create_fragment$g, internal.safe_not_equal, { floorIndex: 4, floorplanData: 5 }, add_css$c);
2655
2627
  }
2656
2628
  }
2657
2629
 
@@ -2922,20 +2894,20 @@ class RoomMaterial_2 extends internal.SvelteComponent {
2922
2894
  /* src/floorplan/Components/RoomMaterials/RoomMaterial.svelte generated by Svelte v3.47.0 */
2923
2895
 
2924
2896
  function add_css$b(target) {
2925
- internal.append_styles(target, "svelte-1b0icjc", "svg.svelte-1b0icjc{position:absolute;width:100%;height:100%;overflow:visible}");
2897
+ internal.append_styles(target, "svelte-1d4xj70", "svg.svelte-1d4xj70{position:absolute;width:100%;height:100%;overflow:visible}");
2926
2898
  }
2927
2899
 
2928
- function get_each_context$4(ctx, list, i) {
2900
+ function get_each_context$5(ctx, list, i) {
2929
2901
  const child_ctx = ctx.slice();
2930
- child_ctx[4] = list[i];
2902
+ child_ctx[5] = list[i];
2931
2903
  return child_ctx;
2932
2904
  }
2933
2905
 
2934
- // (18:6) {:else}
2906
+ // (19:6) {:else}
2935
2907
  function create_else_block(ctx) {
2936
2908
  let roommaterial_1;
2937
2909
  let current;
2938
- roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[4].path } });
2910
+ roommaterial_1 = new RoomMaterial_1({ props: { path: /*room*/ ctx[5].path } });
2939
2911
 
2940
2912
  return {
2941
2913
  c() {
@@ -2947,7 +2919,7 @@ function create_else_block(ctx) {
2947
2919
  },
2948
2920
  p(ctx, dirty) {
2949
2921
  const roommaterial_1_changes = {};
2950
- if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[4].path;
2922
+ if (dirty & /*rooms*/ 1) roommaterial_1_changes.path = /*room*/ ctx[5].path;
2951
2923
  roommaterial_1.$set(roommaterial_1_changes);
2952
2924
  },
2953
2925
  i(local) {
@@ -2965,11 +2937,11 @@ function create_else_block(ctx) {
2965
2937
  };
2966
2938
  }
2967
2939
 
2968
- // (16:37)
2940
+ // (17:37)
2969
2941
  function create_if_block_1$2(ctx) {
2970
2942
  let roommaterial_2;
2971
2943
  let current;
2972
- roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[4].path } });
2944
+ roommaterial_2 = new RoomMaterial_2({ props: { path: /*room*/ ctx[5].path } });
2973
2945
 
2974
2946
  return {
2975
2947
  c() {
@@ -2981,7 +2953,7 @@ function create_if_block_1$2(ctx) {
2981
2953
  },
2982
2954
  p(ctx, dirty) {
2983
2955
  const roommaterial_2_changes = {};
2984
- if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[4].path;
2956
+ if (dirty & /*rooms*/ 1) roommaterial_2_changes.path = /*room*/ ctx[5].path;
2985
2957
  roommaterial_2.$set(roommaterial_2_changes);
2986
2958
  },
2987
2959
  i(local) {
@@ -2999,11 +2971,11 @@ function create_if_block_1$2(ctx) {
2999
2971
  };
3000
2972
  }
3001
2973
 
3002
- // (14:6) {#if room.floorType === 1}
2974
+ // (15:6) {#if room.floorType === 1}
3003
2975
  function create_if_block$4(ctx) {
3004
2976
  let roommaterial_0;
3005
2977
  let current;
3006
- roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[4].path } });
2978
+ roommaterial_0 = new RoomMaterial_0({ props: { path: /*room*/ ctx[5].path } });
3007
2979
 
3008
2980
  return {
3009
2981
  c() {
@@ -3015,7 +2987,7 @@ function create_if_block$4(ctx) {
3015
2987
  },
3016
2988
  p(ctx, dirty) {
3017
2989
  const roommaterial_0_changes = {};
3018
- if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[4].path;
2990
+ if (dirty & /*rooms*/ 1) roommaterial_0_changes.path = /*room*/ ctx[5].path;
3019
2991
  roommaterial_0.$set(roommaterial_0_changes);
3020
2992
  },
3021
2993
  i(local) {
@@ -3033,18 +3005,19 @@ function create_if_block$4(ctx) {
3033
3005
  };
3034
3006
  }
3035
3007
 
3036
- // (12:2) {#each rooms as room}
3037
- function create_each_block$4(ctx) {
3008
+ // (13:2) {#each rooms as room}
3009
+ function create_each_block$5(ctx) {
3038
3010
  let svg;
3039
3011
  let current_block_type_index;
3040
3012
  let if_block;
3013
+ let svg_viewBox_value;
3041
3014
  let current;
3042
3015
  const if_block_creators = [create_if_block$4, create_if_block_1$2, create_else_block];
3043
3016
  const if_blocks = [];
3044
3017
 
3045
3018
  function select_block_type(ctx, dirty) {
3046
- if (/*room*/ ctx[4].floorType === 1) return 0;
3047
- if (/*room*/ ctx[4].floorType === 0) return 1;
3019
+ if (/*room*/ ctx[5].floorType === 1) return 0;
3020
+ if (/*room*/ ctx[5].floorType === 0) return 1;
3048
3021
  return 2;
3049
3022
  }
3050
3023
 
@@ -3055,7 +3028,10 @@ function create_each_block$4(ctx) {
3055
3028
  c() {
3056
3029
  svg = internal.svg_element("svg");
3057
3030
  if_block.c();
3058
- internal.attr(svg, "class", "svelte-1b0icjc");
3031
+ internal.attr(svg, "width", "100%");
3032
+ internal.attr(svg, "height", "100%");
3033
+ internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*boundingWidth*/ ctx[1]} ${/*boundingHeight*/ ctx[2]}`);
3034
+ internal.attr(svg, "class", "svelte-1d4xj70");
3059
3035
  },
3060
3036
  m(target, anchor) {
3061
3037
  internal.insert(target, svg, anchor);
@@ -3112,7 +3088,7 @@ function create_fragment$c(ctx) {
3112
3088
  let each_blocks = [];
3113
3089
 
3114
3090
  for (let i = 0; i < each_value.length; i += 1) {
3115
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3091
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3116
3092
  }
3117
3093
 
3118
3094
  const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
@@ -3139,18 +3115,18 @@ function create_fragment$c(ctx) {
3139
3115
  current = true;
3140
3116
  },
3141
3117
  p(ctx, [dirty]) {
3142
- if (dirty & /*rooms*/ 1) {
3118
+ if (dirty & /*boundingWidth, boundingHeight, rooms*/ 7) {
3143
3119
  each_value = /*rooms*/ ctx[0];
3144
3120
  let i;
3145
3121
 
3146
3122
  for (i = 0; i < each_value.length; i += 1) {
3147
- const child_ctx = get_each_context$4(ctx, each_value, i);
3123
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3148
3124
 
3149
3125
  if (each_blocks[i]) {
3150
3126
  each_blocks[i].p(child_ctx, dirty);
3151
3127
  internal.transition_in(each_blocks[i], 1);
3152
3128
  } else {
3153
- each_blocks[i] = create_each_block$4(child_ctx);
3129
+ each_blocks[i] = create_each_block$5(child_ctx);
3154
3130
  each_blocks[i].c();
3155
3131
  internal.transition_in(each_blocks[i], 1);
3156
3132
  each_blocks[i].m(div, null);
@@ -3194,37 +3170,37 @@ function create_fragment$c(ctx) {
3194
3170
  function instance$c($$self, $$props, $$invalidate) {
3195
3171
  let rooms;
3196
3172
  let { floorIndex } = $$props;
3197
- let { pxmm } = $$props;
3198
3173
  let { floorplanData } = $$props;
3174
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3175
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3199
3176
 
3200
3177
  $$self.$$set = $$props => {
3201
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3202
- if ('pxmm' in $$props) $$invalidate(2, pxmm = $$props.pxmm);
3203
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3178
+ if ('floorIndex' in $$props) $$invalidate(3, floorIndex = $$props.floorIndex);
3179
+ if ('floorplanData' in $$props) $$invalidate(4, floorplanData = $$props.floorplanData);
3204
3180
  };
3205
3181
 
3206
3182
  $$self.$$.update = () => {
3207
- if ($$self.$$.dirty & /*floorplanData, floorIndex, pxmm*/ 14) {
3183
+ if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 24) {
3208
3184
  $$invalidate(0, rooms = floorplanData.floorDatas[floorIndex].rooms.map(room => Object.assign(Object.assign({}, room), {
3209
- path: room.path.map(p => formatFloorplanPoint(p, pxmm, floorplanData.bounding))
3185
+ path: room.path.map(p => formatFloorplanPoint(p, floorplanData.bounding))
3210
3186
  })));
3211
3187
  }
3212
3188
  };
3213
3189
 
3214
- return [rooms, floorIndex, pxmm, floorplanData];
3190
+ return [rooms, boundingWidth, boundingHeight, floorIndex, floorplanData];
3215
3191
  }
3216
3192
 
3217
3193
  class RoomMaterial extends internal.SvelteComponent {
3218
3194
  constructor(options) {
3219
3195
  super();
3220
- internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 1, pxmm: 2, floorplanData: 3 }, add_css$b);
3196
+ internal.init(this, options, instance$c, create_fragment$c, internal.safe_not_equal, { floorIndex: 3, floorplanData: 4 }, add_css$b);
3221
3197
  }
3222
3198
  }
3223
3199
 
3224
3200
  /* src/floorplan/Components/RoomHighlight/Room.svelte generated by Svelte v3.47.0 */
3225
3201
 
3226
3202
  function add_css$a(target) {
3227
- internal.append_styles(target, "svelte-11takew", "path.svelte-11takew{opacity:0}path.svelte-11takew:hover{opacity:0.1}");
3203
+ internal.append_styles(target, "svelte-19uvvss", "path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}");
3228
3204
  }
3229
3205
 
3230
3206
  function create_fragment$b(ctx) {
@@ -3235,7 +3211,7 @@ function create_fragment$b(ctx) {
3235
3211
  path = internal.svg_element("path");
3236
3212
  internal.attr(path, "d", /*_pathD*/ ctx[0]);
3237
3213
  internal.attr(path, "fill", `#fff`);
3238
- internal.attr(path, "class", "svelte-11takew");
3214
+ internal.attr(path, "class", "svelte-19uvvss");
3239
3215
  },
3240
3216
  m(target, anchor) {
3241
3217
  internal.insert(target, path, anchor);
@@ -3250,55 +3226,52 @@ function create_fragment$b(ctx) {
3250
3226
  }
3251
3227
 
3252
3228
  function instance$b($$self, $$props, $$invalidate) {
3253
- let { pxmm } = $$props;
3254
3229
  let { room } = $$props;
3255
3230
  let { floorplanData } = $$props;
3256
3231
  const { bounding } = floorplanData;
3257
3232
 
3258
3233
  const _pathD = pathD(room.path, {
3259
3234
  needZ: true,
3260
- format: vector => formatFloorplanPoint(vector, pxmm, bounding)
3235
+ format: vector => formatFloorplanPoint(vector, bounding)
3261
3236
  });
3262
3237
 
3263
3238
  $$self.$$set = $$props => {
3264
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
3265
- if ('room' in $$props) $$invalidate(2, room = $$props.room);
3266
- if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
3239
+ if ('room' in $$props) $$invalidate(1, room = $$props.room);
3240
+ if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3267
3241
  };
3268
3242
 
3269
- return [_pathD, pxmm, room, floorplanData];
3243
+ return [_pathD, room, floorplanData];
3270
3244
  }
3271
3245
 
3272
3246
  class Room extends internal.SvelteComponent {
3273
3247
  constructor(options) {
3274
3248
  super();
3275
- internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { pxmm: 1, room: 2, floorplanData: 3 }, add_css$a);
3249
+ internal.init(this, options, instance$b, create_fragment$b, internal.safe_not_equal, { room: 1, floorplanData: 2 }, add_css$a);
3276
3250
  }
3277
3251
  }
3278
3252
 
3279
3253
  /* src/floorplan/Components/RoomHighlight/RoomHighlight.svelte generated by Svelte v3.47.0 */
3280
3254
 
3281
3255
  function add_css$9(target) {
3282
- internal.append_styles(target, "svelte-1aais5l", ".floorplan-plugin__room-highlight.svelte-1aais5l{position:absolute;width:100%;height:100%;pointer-events:all}svg.svelte-1aais5l{width:100%;height:100%;overflow:visible}");
3256
+ internal.append_styles(target, "svelte-1kqo6e4", ".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}");
3283
3257
  }
3284
3258
 
3285
- function get_each_context$3(ctx, list, i) {
3259
+ function get_each_context$4(ctx, list, i) {
3286
3260
  const child_ctx = ctx.slice();
3287
- child_ctx[12] = list[i];
3261
+ child_ctx[4] = list[i];
3288
3262
  return child_ctx;
3289
3263
  }
3290
3264
 
3291
- // (41:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3292
- function create_each_block$3(key_1, ctx) {
3265
+ // (10:4) {#each floorplanData.floorDatas[floorIndex].rooms as room (room.id)}
3266
+ function create_each_block$4(key_1, ctx) {
3293
3267
  let first;
3294
3268
  let room;
3295
3269
  let current;
3296
3270
 
3297
3271
  const room_spread_levels = [
3298
3272
  {
3299
- room: /*room*/ ctx[12],
3300
- floorplanData: /*floorplanData*/ ctx[2],
3301
- pxmm: /*pxmm*/ ctx[0]
3273
+ room: /*room*/ ctx[4],
3274
+ floorplanData: /*floorplanData*/ ctx[1]
3302
3275
  }
3303
3276
  ];
3304
3277
 
@@ -3326,12 +3299,11 @@ function create_each_block$3(key_1, ctx) {
3326
3299
  p(new_ctx, dirty) {
3327
3300
  ctx = new_ctx;
3328
3301
 
3329
- const room_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 7)
3302
+ const room_changes = (dirty & /*floorplanData, floorIndex*/ 3)
3330
3303
  ? internal.get_spread_update(room_spread_levels, [
3331
3304
  {
3332
- room: /*room*/ ctx[12],
3333
- floorplanData: /*floorplanData*/ ctx[2],
3334
- pxmm: /*pxmm*/ ctx[0]
3305
+ room: /*room*/ ctx[4],
3306
+ floorplanData: /*floorplanData*/ ctx[1]
3335
3307
  }
3336
3308
  ])
3337
3309
  : {};
@@ -3359,17 +3331,14 @@ function create_fragment$a(ctx) {
3359
3331
  let svg;
3360
3332
  let each_blocks = [];
3361
3333
  let each_1_lookup = new Map();
3362
- let div_resize_listener;
3363
3334
  let current;
3364
- let mounted;
3365
- let dispose;
3366
- let each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3367
- const get_key = ctx => /*room*/ ctx[12].id;
3335
+ let each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3336
+ const get_key = ctx => /*room*/ ctx[4].id;
3368
3337
 
3369
3338
  for (let i = 0; i < each_value.length; i += 1) {
3370
- let child_ctx = get_each_context$3(ctx, each_value, i);
3339
+ let child_ctx = get_each_context$4(ctx, each_value, i);
3371
3340
  let key = get_key(child_ctx);
3372
- each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx));
3341
+ each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3373
3342
  }
3374
3343
 
3375
3344
  return {
@@ -3381,9 +3350,11 @@ function create_fragment$a(ctx) {
3381
3350
  each_blocks[i].c();
3382
3351
  }
3383
3352
 
3384
- internal.attr(svg, "class", "svelte-1aais5l");
3385
- internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1aais5l");
3386
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
3353
+ internal.attr(svg, "width", "100%");
3354
+ internal.attr(svg, "height", "100%");
3355
+ internal.attr(svg, "viewBox", `0 0 ${/*boundingWidth*/ ctx[2]} ${/*boundingHeight*/ ctx[3]}`);
3356
+ internal.attr(svg, "class", "svelte-1kqo6e4");
3357
+ internal.attr(div, "class", "floorplan-plugin__room-highlight svelte-1kqo6e4");
3387
3358
  },
3388
3359
  m(target, anchor) {
3389
3360
  internal.insert(target, div, anchor);
@@ -3393,20 +3364,13 @@ function create_fragment$a(ctx) {
3393
3364
  each_blocks[i].m(svg, null);
3394
3365
  }
3395
3366
 
3396
- /*div_binding*/ ctx[9](div);
3397
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[10].bind(div));
3398
3367
  current = true;
3399
-
3400
- if (!mounted) {
3401
- dispose = internal.listen(div, "click", /*handleClick*/ ctx[6]);
3402
- mounted = true;
3403
- }
3404
3368
  },
3405
3369
  p(ctx, [dirty]) {
3406
- if (dirty & /*floorplanData, floorIndex, pxmm*/ 7) {
3407
- each_value = /*floorplanData*/ ctx[2].floorDatas[/*floorIndex*/ ctx[1]].rooms;
3370
+ if (dirty & /*floorplanData, floorIndex*/ 3) {
3371
+ each_value = /*floorplanData*/ ctx[1].floorDatas[/*floorIndex*/ ctx[0]].rooms;
3408
3372
  internal.group_outros();
3409
- each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$3, null, get_each_context$3);
3373
+ each_blocks = internal.update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, svg, internal.outro_and_destroy_block, create_each_block$4, null, get_each_context$4);
3410
3374
  internal.check_outros();
3411
3375
  }
3412
3376
  },
@@ -3432,127 +3396,46 @@ function create_fragment$a(ctx) {
3432
3396
  for (let i = 0; i < each_blocks.length; i += 1) {
3433
3397
  each_blocks[i].d();
3434
3398
  }
3435
-
3436
- /*div_binding*/ ctx[9](null);
3437
- div_resize_listener();
3438
- mounted = false;
3439
- dispose();
3440
3399
  }
3441
3400
  };
3442
3401
  }
3443
3402
 
3444
3403
  function instance$a($$self, $$props, $$invalidate) {
3445
- let { five } = $$props;
3446
- let { pxmm } = $$props;
3447
3404
  let { floorIndex } = $$props;
3448
3405
  let { floorplanData } = $$props;
3449
- let { onRoomHeightClick } = $$props;
3450
- let clientWidth;
3451
- let clientHeight;
3452
- let highlightContainerDom;
3453
- const { observers: floorplan_observers } = floorplanData;
3454
-
3455
- const handleClick = function (e) {
3456
- if ((onRoomHeightClick === null || onRoomHeightClick === void 0
3457
- ? void 0
3458
- : onRoomHeightClick(e)) === false) return;
3459
-
3460
- // 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
3461
- const boundingClientRect = highlightContainerDom.getBoundingClientRect();
3462
-
3463
- const mouseClientVector = new THREE.Vector2(e.clientX, e.clientY);
3464
- const domTopLeftVector = new THREE.Vector2(boundingClientRect.left, boundingClientRect.top);
3465
- const mouseOffsetVector = mouseClientVector.clone().sub(domTopLeftVector);
3466
-
3467
- // px 转换为 百分比
3468
- const mouseOffsetRelativeVector = new THREE.Vector2(mouseOffsetVector.x / clientWidth, mouseOffsetVector.y / clientHeight);
3469
-
3470
- const closestPoint = floorplan_observers.filter(observer => observer.floorIndex === floorIndex).sort((ob1, ob2) => {
3471
- const position1 = new THREE.Vector2(ob1.positionInImage.x, ob1.positionInImage.y);
3472
- const position2 = new THREE.Vector2(ob2.positionInImage.x, ob2.positionInImage.y);
3473
- return position1.distanceTo(mouseOffsetRelativeVector) - position2.distanceTo(mouseOffsetRelativeVector);
3474
- })[0];
3475
-
3476
- five.moveToPano(closestPoint.index);
3477
- };
3478
-
3479
- function div_binding($$value) {
3480
- internal.binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3481
- highlightContainerDom = $$value;
3482
- $$invalidate(5, highlightContainerDom);
3483
- });
3484
- }
3485
-
3486
- function div_elementresize_handler() {
3487
- clientWidth = this.clientWidth;
3488
- clientHeight = this.clientHeight;
3489
- $$invalidate(3, clientWidth);
3490
- $$invalidate(4, clientHeight);
3491
- }
3406
+ const boundingWidth = floorplanData.bounding.max.x - floorplanData.bounding.min.x;
3407
+ const boundingHeight = floorplanData.bounding.max.y - floorplanData.bounding.min.y;
3492
3408
 
3493
3409
  $$self.$$set = $$props => {
3494
- if ('five' in $$props) $$invalidate(7, five = $$props.five);
3495
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3496
- if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3497
- if ('floorplanData' in $$props) $$invalidate(2, floorplanData = $$props.floorplanData);
3498
- if ('onRoomHeightClick' in $$props) $$invalidate(8, onRoomHeightClick = $$props.onRoomHeightClick);
3410
+ if ('floorIndex' in $$props) $$invalidate(0, floorIndex = $$props.floorIndex);
3411
+ if ('floorplanData' in $$props) $$invalidate(1, floorplanData = $$props.floorplanData);
3499
3412
  };
3500
3413
 
3501
- return [
3502
- pxmm,
3503
- floorIndex,
3504
- floorplanData,
3505
- clientWidth,
3506
- clientHeight,
3507
- highlightContainerDom,
3508
- handleClick,
3509
- five,
3510
- onRoomHeightClick,
3511
- div_binding,
3512
- div_elementresize_handler
3513
- ];
3414
+ return [floorIndex, floorplanData, boundingWidth, boundingHeight];
3514
3415
  }
3515
3416
 
3516
3417
  class RoomHighlight extends internal.SvelteComponent {
3517
3418
  constructor(options) {
3518
3419
  super();
3519
-
3520
- internal.init(
3521
- this,
3522
- options,
3523
- instance$a,
3524
- create_fragment$a,
3525
- internal.safe_not_equal,
3526
- {
3527
- five: 7,
3528
- pxmm: 0,
3529
- floorIndex: 1,
3530
- floorplanData: 2,
3531
- onRoomHeightClick: 8
3532
- },
3533
- add_css$9
3534
- );
3420
+ internal.init(this, options, instance$a, create_fragment$a, internal.safe_not_equal, { floorIndex: 0, floorplanData: 1 }, add_css$9);
3535
3421
  }
3536
3422
  }
3537
3423
 
3538
- /* src/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte generated by Svelte v3.47.0 */
3424
+ /* src/floorplan/Components/CurrentFloor.svelte generated by Svelte v3.47.0 */
3539
3425
 
3540
3426
  function add_css$8(target) {
3541
- internal.append_styles(target, "svelte-3pdgs4", ".floorplan-current-floor.svelte-3pdgs4{position:relative;width:100%;height:100%}");
3427
+ internal.append_styles(target, "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}");
3542
3428
  }
3543
3429
 
3544
- // (19:2) {#if hoverEnable}
3430
+ // (17:2) {#if hoverEnable}
3545
3431
  function create_if_block_2(ctx) {
3546
3432
  let roomhighlight;
3547
3433
  let current;
3548
3434
 
3549
3435
  const roomhighlight_spread_levels = [
3550
3436
  {
3551
- five: /*five*/ ctx[1],
3552
- pxmm: /*pxmm*/ ctx[0],
3553
- floorIndex: /*floorIndex*/ ctx[2],
3554
- floorplanData: /*floorplanData*/ ctx[6],
3555
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3437
+ floorIndex: /*floorIndex*/ ctx[1],
3438
+ floorplanData: /*floorplanData*/ ctx[5]
3556
3439
  }
3557
3440
  ];
3558
3441
 
@@ -3573,14 +3456,11 @@ function create_if_block_2(ctx) {
3573
3456
  current = true;
3574
3457
  },
3575
3458
  p(ctx, dirty) {
3576
- const roomhighlight_changes = (dirty & /*five, pxmm, floorIndex, floorplanData, onRoomHeightClick*/ 199)
3459
+ const roomhighlight_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3577
3460
  ? internal.get_spread_update(roomhighlight_spread_levels, [
3578
3461
  {
3579
- five: /*five*/ ctx[1],
3580
- pxmm: /*pxmm*/ ctx[0],
3581
- floorIndex: /*floorIndex*/ ctx[2],
3582
- floorplanData: /*floorplanData*/ ctx[6],
3583
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[7]
3462
+ floorIndex: /*floorIndex*/ ctx[1],
3463
+ floorplanData: /*floorplanData*/ ctx[5]
3584
3464
  }
3585
3465
  ])
3586
3466
  : {};
@@ -3602,16 +3482,16 @@ function create_if_block_2(ctx) {
3602
3482
  };
3603
3483
  }
3604
3484
 
3605
- // (23:2) {#if roomLabelsEnable}
3485
+ // (21:2) {#if roomLabelsEnable}
3606
3486
  function create_if_block_1$1(ctx) {
3607
3487
  let roomlabels;
3608
3488
  let current;
3609
3489
 
3610
3490
  const roomlabels_spread_levels = [
3611
3491
  {
3612
- floorplanData: /*floorplanData*/ ctx[6],
3613
- floorIndex: /*floorIndex*/ ctx[2],
3614
- getLabelElement: /*getLabelElement*/ ctx[8]
3492
+ floorplanData: /*floorplanData*/ ctx[5],
3493
+ floorIndex: /*floorIndex*/ ctx[1],
3494
+ getLabelElement: /*getLabelElement*/ ctx[6]
3615
3495
  }
3616
3496
  ];
3617
3497
 
@@ -3632,12 +3512,12 @@ function create_if_block_1$1(ctx) {
3632
3512
  current = true;
3633
3513
  },
3634
3514
  p(ctx, dirty) {
3635
- const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 324)
3515
+ const roomlabels_changes = (dirty & /*floorplanData, floorIndex, getLabelElement*/ 98)
3636
3516
  ? internal.get_spread_update(roomlabels_spread_levels, [
3637
3517
  {
3638
- floorplanData: /*floorplanData*/ ctx[6],
3639
- floorIndex: /*floorIndex*/ ctx[2],
3640
- getLabelElement: /*getLabelElement*/ ctx[8]
3518
+ floorplanData: /*floorplanData*/ ctx[5],
3519
+ floorIndex: /*floorIndex*/ ctx[1],
3520
+ getLabelElement: /*getLabelElement*/ ctx[6]
3641
3521
  }
3642
3522
  ])
3643
3523
  : {};
@@ -3659,16 +3539,15 @@ function create_if_block_1$1(ctx) {
3659
3539
  };
3660
3540
  }
3661
3541
 
3662
- // (26:2) {#if ruleLabelsEnable}
3542
+ // (24:2) {#if ruleLabelsEnable}
3663
3543
  function create_if_block$3(ctx) {
3664
3544
  let rulelabels;
3665
3545
  let current;
3666
3546
 
3667
3547
  const rulelabels_spread_levels = [
3668
3548
  {
3669
- floorplanData: /*floorplanData*/ ctx[6],
3670
- floorIndex: /*floorIndex*/ ctx[2],
3671
- pxmm: /*pxmm*/ ctx[0]
3549
+ floorplanData: /*floorplanData*/ ctx[5],
3550
+ floorIndex: /*floorIndex*/ ctx[1]
3672
3551
  }
3673
3552
  ];
3674
3553
 
@@ -3689,12 +3568,11 @@ function create_if_block$3(ctx) {
3689
3568
  current = true;
3690
3569
  },
3691
3570
  p(ctx, dirty) {
3692
- const rulelabels_changes = (dirty & /*floorplanData, floorIndex, pxmm*/ 69)
3571
+ const rulelabels_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3693
3572
  ? internal.get_spread_update(rulelabels_spread_levels, [
3694
3573
  {
3695
- floorplanData: /*floorplanData*/ ctx[6],
3696
- floorIndex: /*floorIndex*/ ctx[2],
3697
- pxmm: /*pxmm*/ ctx[0]
3574
+ floorplanData: /*floorplanData*/ ctx[5],
3575
+ floorIndex: /*floorIndex*/ ctx[1]
3698
3576
  }
3699
3577
  ])
3700
3578
  : {};
@@ -3724,13 +3602,13 @@ function create_fragment$9(ctx) {
3724
3602
  let baseimage;
3725
3603
  let t2;
3726
3604
  let t3;
3605
+ let div_class_value;
3727
3606
  let current;
3728
3607
 
3729
3608
  const roommaterial_spread_levels = [
3730
3609
  {
3731
- floorIndex: /*floorIndex*/ ctx[2],
3732
- floorplanData: /*floorplanData*/ ctx[6],
3733
- pxmm: /*pxmm*/ ctx[0]
3610
+ floorIndex: /*floorIndex*/ ctx[1],
3611
+ floorplanData: /*floorplanData*/ ctx[5]
3734
3612
  }
3735
3613
  ];
3736
3614
 
@@ -3741,12 +3619,12 @@ function create_fragment$9(ctx) {
3741
3619
  }
3742
3620
 
3743
3621
  roommaterial = new RoomMaterial({ props: roommaterial_props });
3744
- let if_block0 = /*hoverEnable*/ ctx[3] && create_if_block_2(ctx);
3622
+ let if_block0 = /*hoverEnable*/ ctx[2] && create_if_block_2(ctx);
3745
3623
 
3746
3624
  const baseimage_spread_levels = [
3747
3625
  {
3748
- floorplanData: /*floorplanData*/ ctx[6],
3749
- floorIndex: /*floorIndex*/ ctx[2]
3626
+ floorplanData: /*floorplanData*/ ctx[5],
3627
+ floorIndex: /*floorIndex*/ ctx[1]
3750
3628
  }
3751
3629
  ];
3752
3630
 
@@ -3757,8 +3635,8 @@ function create_fragment$9(ctx) {
3757
3635
  }
3758
3636
 
3759
3637
  baseimage = new BaseImage({ props: baseimage_props });
3760
- let if_block1 = /*roomLabelsEnable*/ ctx[4] && create_if_block_1$1(ctx);
3761
- let if_block2 = /*ruleLabelsEnable*/ ctx[5] && create_if_block$3(ctx);
3638
+ let if_block1 = /*roomLabelsEnable*/ ctx[3] && create_if_block_1$1(ctx);
3639
+ let if_block2 = /*ruleLabelsEnable*/ ctx[4] && create_if_block$3(ctx);
3762
3640
 
3763
3641
  return {
3764
3642
  c() {
@@ -3772,7 +3650,10 @@ function create_fragment$9(ctx) {
3772
3650
  if (if_block1) if_block1.c();
3773
3651
  t3 = internal.space();
3774
3652
  if (if_block2) if_block2.c();
3775
- internal.attr(div, "class", "floorplan-current-floor svelte-3pdgs4");
3653
+
3654
+ internal.attr(div, "class", div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3655
+ ? ' floorplan-plugin__floor--is-current'
3656
+ : ''}`) + " svelte-bl8zrz"));
3776
3657
  },
3777
3658
  m(target, anchor) {
3778
3659
  internal.insert(target, div, anchor);
@@ -3788,23 +3669,22 @@ function create_fragment$9(ctx) {
3788
3669
  current = true;
3789
3670
  },
3790
3671
  p(ctx, [dirty]) {
3791
- const roommaterial_changes = (dirty & /*floorIndex, floorplanData, pxmm*/ 69)
3672
+ const roommaterial_changes = (dirty & /*floorIndex, floorplanData*/ 34)
3792
3673
  ? internal.get_spread_update(roommaterial_spread_levels, [
3793
3674
  {
3794
- floorIndex: /*floorIndex*/ ctx[2],
3795
- floorplanData: /*floorplanData*/ ctx[6],
3796
- pxmm: /*pxmm*/ ctx[0]
3675
+ floorIndex: /*floorIndex*/ ctx[1],
3676
+ floorplanData: /*floorplanData*/ ctx[5]
3797
3677
  }
3798
3678
  ])
3799
3679
  : {};
3800
3680
 
3801
3681
  roommaterial.$set(roommaterial_changes);
3802
3682
 
3803
- if (/*hoverEnable*/ ctx[3]) {
3683
+ if (/*hoverEnable*/ ctx[2]) {
3804
3684
  if (if_block0) {
3805
3685
  if_block0.p(ctx, dirty);
3806
3686
 
3807
- if (dirty & /*hoverEnable*/ 8) {
3687
+ if (dirty & /*hoverEnable*/ 4) {
3808
3688
  internal.transition_in(if_block0, 1);
3809
3689
  }
3810
3690
  } else {
@@ -3823,22 +3703,22 @@ function create_fragment$9(ctx) {
3823
3703
  internal.check_outros();
3824
3704
  }
3825
3705
 
3826
- const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 68)
3706
+ const baseimage_changes = (dirty & /*floorplanData, floorIndex*/ 34)
3827
3707
  ? internal.get_spread_update(baseimage_spread_levels, [
3828
3708
  {
3829
- floorplanData: /*floorplanData*/ ctx[6],
3830
- floorIndex: /*floorIndex*/ ctx[2]
3709
+ floorplanData: /*floorplanData*/ ctx[5],
3710
+ floorIndex: /*floorIndex*/ ctx[1]
3831
3711
  }
3832
3712
  ])
3833
3713
  : {};
3834
3714
 
3835
3715
  baseimage.$set(baseimage_changes);
3836
3716
 
3837
- if (/*roomLabelsEnable*/ ctx[4]) {
3717
+ if (/*roomLabelsEnable*/ ctx[3]) {
3838
3718
  if (if_block1) {
3839
3719
  if_block1.p(ctx, dirty);
3840
3720
 
3841
- if (dirty & /*roomLabelsEnable*/ 16) {
3721
+ if (dirty & /*roomLabelsEnable*/ 8) {
3842
3722
  internal.transition_in(if_block1, 1);
3843
3723
  }
3844
3724
  } else {
@@ -3857,11 +3737,11 @@ function create_fragment$9(ctx) {
3857
3737
  internal.check_outros();
3858
3738
  }
3859
3739
 
3860
- if (/*ruleLabelsEnable*/ ctx[5]) {
3740
+ if (/*ruleLabelsEnable*/ ctx[4]) {
3861
3741
  if (if_block2) {
3862
3742
  if_block2.p(ctx, dirty);
3863
3743
 
3864
- if (dirty & /*ruleLabelsEnable*/ 32) {
3744
+ if (dirty & /*ruleLabelsEnable*/ 16) {
3865
3745
  internal.transition_in(if_block2, 1);
3866
3746
  }
3867
3747
  } else {
@@ -3879,6 +3759,12 @@ function create_fragment$9(ctx) {
3879
3759
 
3880
3760
  internal.check_outros();
3881
3761
  }
3762
+
3763
+ if (!current || dirty & /*isCurrent*/ 1 && div_class_value !== (div_class_value = "" + (internal.null_to_empty(`floorplan-plugin__floor${/*isCurrent*/ ctx[0]
3764
+ ? ' floorplan-plugin__floor--is-current'
3765
+ : ''}`) + " svelte-bl8zrz"))) {
3766
+ internal.attr(div, "class", div_class_value);
3767
+ }
3882
3768
  },
3883
3769
  i(local) {
3884
3770
  if (current) return;
@@ -3909,37 +3795,31 @@ function create_fragment$9(ctx) {
3909
3795
  }
3910
3796
 
3911
3797
  function instance$9($$self, $$props, $$invalidate) {
3912
- let { pxmm } = $$props;
3913
- let { five } = $$props;
3798
+ let { isCurrent } = $$props;
3914
3799
  let { floorIndex } = $$props;
3915
3800
  let { hoverEnable } = $$props;
3916
3801
  let { roomLabelsEnable } = $$props;
3917
3802
  let { ruleLabelsEnable } = $$props;
3918
3803
  let { floorplanData } = $$props;
3919
- let { onRoomHeightClick } = $$props;
3920
3804
  let { getLabelElement } = $$props;
3921
3805
 
3922
3806
  $$self.$$set = $$props => {
3923
- if ('pxmm' in $$props) $$invalidate(0, pxmm = $$props.pxmm);
3924
- if ('five' in $$props) $$invalidate(1, five = $$props.five);
3925
- if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
3926
- if ('hoverEnable' in $$props) $$invalidate(3, hoverEnable = $$props.hoverEnable);
3927
- if ('roomLabelsEnable' in $$props) $$invalidate(4, roomLabelsEnable = $$props.roomLabelsEnable);
3928
- if ('ruleLabelsEnable' in $$props) $$invalidate(5, ruleLabelsEnable = $$props.ruleLabelsEnable);
3929
- if ('floorplanData' in $$props) $$invalidate(6, floorplanData = $$props.floorplanData);
3930
- if ('onRoomHeightClick' in $$props) $$invalidate(7, onRoomHeightClick = $$props.onRoomHeightClick);
3931
- if ('getLabelElement' in $$props) $$invalidate(8, getLabelElement = $$props.getLabelElement);
3807
+ if ('isCurrent' in $$props) $$invalidate(0, isCurrent = $$props.isCurrent);
3808
+ if ('floorIndex' in $$props) $$invalidate(1, floorIndex = $$props.floorIndex);
3809
+ if ('hoverEnable' in $$props) $$invalidate(2, hoverEnable = $$props.hoverEnable);
3810
+ if ('roomLabelsEnable' in $$props) $$invalidate(3, roomLabelsEnable = $$props.roomLabelsEnable);
3811
+ if ('ruleLabelsEnable' in $$props) $$invalidate(4, ruleLabelsEnable = $$props.ruleLabelsEnable);
3812
+ if ('floorplanData' in $$props) $$invalidate(5, floorplanData = $$props.floorplanData);
3813
+ if ('getLabelElement' in $$props) $$invalidate(6, getLabelElement = $$props.getLabelElement);
3932
3814
  };
3933
3815
 
3934
3816
  return [
3935
- pxmm,
3936
- five,
3817
+ isCurrent,
3937
3818
  floorIndex,
3938
3819
  hoverEnable,
3939
3820
  roomLabelsEnable,
3940
3821
  ruleLabelsEnable,
3941
3822
  floorplanData,
3942
- onRoomHeightClick,
3943
3823
  getLabelElement
3944
3824
  ];
3945
3825
  }
@@ -3955,65 +3835,56 @@ class CurrentFloor$1 extends internal.SvelteComponent {
3955
3835
  create_fragment$9,
3956
3836
  internal.safe_not_equal,
3957
3837
  {
3958
- pxmm: 0,
3959
- five: 1,
3960
- floorIndex: 2,
3961
- hoverEnable: 3,
3962
- roomLabelsEnable: 4,
3963
- ruleLabelsEnable: 5,
3964
- floorplanData: 6,
3965
- onRoomHeightClick: 7,
3966
- getLabelElement: 8
3838
+ isCurrent: 0,
3839
+ floorIndex: 1,
3840
+ hoverEnable: 2,
3841
+ roomLabelsEnable: 3,
3842
+ ruleLabelsEnable: 4,
3843
+ floorplanData: 5,
3844
+ getLabelElement: 6
3967
3845
  },
3968
3846
  add_css$8
3969
3847
  );
3970
3848
  }
3971
3849
  }
3972
3850
 
3973
- /* src/floorplan/ModelFloorplanPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
3851
+ /* src/floorplan/Components/Main.svelte generated by Svelte v3.47.0 */
3974
3852
 
3975
3853
  function add_css$7(target) {
3976
- internal.append_styles(target, "svelte-177x2q7", ".floorplan-main.svelte-177x2q7{width:100%;height:100%}");
3854
+ internal.append_styles(target, "svelte-q5wdnn", ".floorplan-main.svelte-q5wdnn{width:100%;height:100%}");
3855
+ }
3856
+
3857
+ function get_each_context$3(ctx, list, i) {
3858
+ const child_ctx = ctx.slice();
3859
+ child_ctx[13] = list[i];
3860
+ return child_ctx;
3977
3861
  }
3978
3862
 
3979
- // (24:0) {#if visible}
3863
+ // (21:0) {#if visible}
3980
3864
  function create_if_block$2(ctx) {
3981
3865
  let div;
3982
- let currentfloor;
3983
3866
  let t0;
3984
3867
  let camera;
3985
3868
  let t1;
3986
3869
  let div_intro;
3987
3870
  let current;
3871
+ let each_value = /*floorplanData*/ ctx[9].floorDatas;
3872
+ let each_blocks = [];
3988
3873
 
3989
- const currentfloor_spread_levels = [
3990
- {
3991
- five: /*five*/ ctx[2],
3992
- pxmm: /*pxmm*/ ctx[1],
3993
- floorIndex: /*floorIndex*/ ctx[6],
3994
- hoverEnable: /*hoverEnable*/ ctx[7],
3995
- floorplanData: /*floorplanData*/ ctx[11],
3996
- getLabelElement: /*getLabelElement*/ ctx[15],
3997
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
3998
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
3999
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
4000
- }
4001
- ];
4002
-
4003
- let currentfloor_props = {};
4004
-
4005
- for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4006
- currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
3874
+ for (let i = 0; i < each_value.length; i += 1) {
3875
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
4007
3876
  }
4008
3877
 
4009
- currentfloor = new CurrentFloor$1({ props: currentfloor_props });
3878
+ const out = i => internal.transition_out(each_blocks[i], 1, 1, () => {
3879
+ each_blocks[i] = null;
3880
+ });
4010
3881
 
4011
3882
  const camera_spread_levels = [
4012
3883
  {
4013
- panoIndex: /*panoIndex*/ ctx[5],
4014
- floorplanData: /*floorplanData*/ ctx[11],
4015
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4016
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3884
+ panoIndex: /*panoIndex*/ ctx[3],
3885
+ floorplanData: /*floorplanData*/ ctx[9],
3886
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3887
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4017
3888
  }
4018
3889
  ];
4019
3890
 
@@ -4024,21 +3895,29 @@ function create_if_block$2(ctx) {
4024
3895
  }
4025
3896
 
4026
3897
  camera = new Camera$1({ props: camera_props });
4027
- let if_block = /*compassEnable*/ ctx[8] && create_if_block_1(ctx);
3898
+ let if_block = /*compassEnable*/ ctx[6] && create_if_block_1(ctx);
4028
3899
 
4029
3900
  return {
4030
3901
  c() {
4031
3902
  div = internal.element("div");
4032
- internal.create_component(currentfloor.$$.fragment);
3903
+
3904
+ for (let i = 0; i < each_blocks.length; i += 1) {
3905
+ each_blocks[i].c();
3906
+ }
3907
+
4033
3908
  t0 = internal.space();
4034
3909
  internal.create_component(camera.$$.fragment);
4035
3910
  t1 = internal.space();
4036
3911
  if (if_block) if_block.c();
4037
- internal.attr(div, "class", "floorplan-main svelte-177x2q7");
3912
+ internal.attr(div, "class", "floorplan-main svelte-q5wdnn");
4038
3913
  },
4039
3914
  m(target, anchor) {
4040
3915
  internal.insert(target, div, anchor);
4041
- internal.mount_component(currentfloor, div, null);
3916
+
3917
+ for (let i = 0; i < each_blocks.length; i += 1) {
3918
+ each_blocks[i].m(div, null);
3919
+ }
3920
+
4042
3921
  internal.append(div, t0);
4043
3922
  internal.mount_component(camera, div, null);
4044
3923
  internal.append(div, t1);
@@ -4048,42 +3927,51 @@ function create_if_block$2(ctx) {
4048
3927
  p(new_ctx, dirty) {
4049
3928
  ctx = new_ctx;
4050
3929
 
4051
- const currentfloor_changes = (dirty & /*five, pxmm, floorIndex, hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, onRoomHeightClick*/ 52934)
4052
- ? internal.get_spread_update(currentfloor_spread_levels, [
4053
- {
4054
- five: /*five*/ ctx[2],
4055
- pxmm: /*pxmm*/ ctx[1],
4056
- floorIndex: /*floorIndex*/ ctx[6],
4057
- hoverEnable: /*hoverEnable*/ ctx[7],
4058
- floorplanData: /*floorplanData*/ ctx[11],
4059
- getLabelElement: /*getLabelElement*/ ctx[15],
4060
- roomLabelsEnable: /*roomLabelsEnable*/ ctx[9],
4061
- ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[10],
4062
- onRoomHeightClick: /*onRoomHeightClick*/ ctx[14]
3930
+ if (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040) {
3931
+ each_value = /*floorplanData*/ ctx[9].floorDatas;
3932
+ let i;
3933
+
3934
+ for (i = 0; i < each_value.length; i += 1) {
3935
+ const child_ctx = get_each_context$3(ctx, each_value, i);
3936
+
3937
+ if (each_blocks[i]) {
3938
+ each_blocks[i].p(child_ctx, dirty);
3939
+ internal.transition_in(each_blocks[i], 1);
3940
+ } else {
3941
+ each_blocks[i] = create_each_block$3(child_ctx);
3942
+ each_blocks[i].c();
3943
+ internal.transition_in(each_blocks[i], 1);
3944
+ each_blocks[i].m(div, t0);
4063
3945
  }
4064
- ])
4065
- : {};
3946
+ }
4066
3947
 
4067
- currentfloor.$set(currentfloor_changes);
3948
+ internal.group_outros();
3949
+
3950
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
3951
+ out(i);
3952
+ }
3953
+
3954
+ internal.check_outros();
3955
+ }
4068
3956
 
4069
- const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 14368)
3957
+ const camera_changes = (dirty & /*panoIndex, floorplanData, lastPanoramaLongitude, cameraImageUrl*/ 3592)
4070
3958
  ? internal.get_spread_update(camera_spread_levels, [
4071
3959
  {
4072
- panoIndex: /*panoIndex*/ ctx[5],
4073
- floorplanData: /*floorplanData*/ ctx[11],
4074
- lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[12],
4075
- cameraImageUrl: /*cameraImageUrl*/ ctx[13]
3960
+ panoIndex: /*panoIndex*/ ctx[3],
3961
+ floorplanData: /*floorplanData*/ ctx[9],
3962
+ lastPanoramaLongitude: /*lastPanoramaLongitude*/ ctx[10],
3963
+ cameraImageUrl: /*cameraImageUrl*/ ctx[11]
4076
3964
  }
4077
3965
  ])
4078
3966
  : {};
4079
3967
 
4080
3968
  camera.$set(camera_changes);
4081
3969
 
4082
- if (/*compassEnable*/ ctx[8]) {
3970
+ if (/*compassEnable*/ ctx[6]) {
4083
3971
  if (if_block) {
4084
3972
  if_block.p(ctx, dirty);
4085
3973
 
4086
- if (dirty & /*compassEnable*/ 256) {
3974
+ if (dirty & /*compassEnable*/ 64) {
4087
3975
  internal.transition_in(if_block, 1);
4088
3976
  }
4089
3977
  } else {
@@ -4104,14 +3992,18 @@ function create_if_block$2(ctx) {
4104
3992
  },
4105
3993
  i(local) {
4106
3994
  if (current) return;
4107
- internal.transition_in(currentfloor.$$.fragment, local);
3995
+
3996
+ for (let i = 0; i < each_value.length; i += 1) {
3997
+ internal.transition_in(each_blocks[i]);
3998
+ }
3999
+
4108
4000
  internal.transition_in(camera.$$.fragment, local);
4109
4001
  internal.transition_in(if_block);
4110
4002
 
4111
4003
  if (!div_intro) {
4112
4004
  internal.add_render_callback(() => {
4113
4005
  div_intro = internal.create_in_transition(div, transition.fade, {
4114
- duration: /*duration*/ ctx[3],
4006
+ duration: /*duration*/ ctx[0],
4115
4007
  easing: easing.linear
4116
4008
  });
4117
4009
 
@@ -4122,29 +4014,107 @@ function create_if_block$2(ctx) {
4122
4014
  current = true;
4123
4015
  },
4124
4016
  o(local) {
4125
- internal.transition_out(currentfloor.$$.fragment, local);
4017
+ each_blocks = each_blocks.filter(Boolean);
4018
+
4019
+ for (let i = 0; i < each_blocks.length; i += 1) {
4020
+ internal.transition_out(each_blocks[i]);
4021
+ }
4022
+
4126
4023
  internal.transition_out(camera.$$.fragment, local);
4127
4024
  internal.transition_out(if_block);
4128
4025
  current = false;
4129
4026
  },
4130
4027
  d(detaching) {
4131
4028
  if (detaching) internal.detach(div);
4132
- internal.destroy_component(currentfloor);
4029
+ internal.destroy_each(each_blocks, detaching);
4133
4030
  internal.destroy_component(camera);
4134
4031
  if (if_block) if_block.d();
4135
4032
  }
4136
4033
  };
4137
4034
  }
4138
4035
 
4139
- // (40:4) {#if compassEnable}
4036
+ // (23:4) {#each floorplanData.floorDatas as floorData}
4037
+ function create_each_block$3(ctx) {
4038
+ let currentfloor;
4039
+ let current;
4040
+
4041
+ const currentfloor_spread_levels = [
4042
+ {
4043
+ hoverEnable: /*hoverEnable*/ ctx[5],
4044
+ floorplanData: /*floorplanData*/ ctx[9],
4045
+ getLabelElement: /*getLabelElement*/ ctx[12],
4046
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4047
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4048
+ },
4049
+ {
4050
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4051
+ },
4052
+ {
4053
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4054
+ }
4055
+ ];
4056
+
4057
+ let currentfloor_props = {};
4058
+
4059
+ for (let i = 0; i < currentfloor_spread_levels.length; i += 1) {
4060
+ currentfloor_props = internal.assign(currentfloor_props, currentfloor_spread_levels[i]);
4061
+ }
4062
+
4063
+ currentfloor = new CurrentFloor$1({ props: currentfloor_props });
4064
+
4065
+ return {
4066
+ c() {
4067
+ internal.create_component(currentfloor.$$.fragment);
4068
+ },
4069
+ m(target, anchor) {
4070
+ internal.mount_component(currentfloor, target, anchor);
4071
+ current = true;
4072
+ },
4073
+ p(ctx, dirty) {
4074
+ const currentfloor_changes = (dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable, floorIndex*/ 5040)
4075
+ ? internal.get_spread_update(currentfloor_spread_levels, [
4076
+ dirty & /*hoverEnable, floorplanData, getLabelElement, roomLabelsEnable, ruleLabelsEnable*/ 5024 && {
4077
+ hoverEnable: /*hoverEnable*/ ctx[5],
4078
+ floorplanData: /*floorplanData*/ ctx[9],
4079
+ getLabelElement: /*getLabelElement*/ ctx[12],
4080
+ roomLabelsEnable: /*roomLabelsEnable*/ ctx[7],
4081
+ ruleLabelsEnable: /*ruleLabelsEnable*/ ctx[8]
4082
+ },
4083
+ dirty & /*floorplanData*/ 512 && {
4084
+ floorIndex: /*floorData*/ ctx[13].floorIndex
4085
+ },
4086
+ dirty & /*floorplanData, floorIndex*/ 528 && {
4087
+ isCurrent: /*floorData*/ ctx[13].floorIndex === /*floorIndex*/ ctx[4]
4088
+ }
4089
+ ])
4090
+ : {};
4091
+
4092
+ currentfloor.$set(currentfloor_changes);
4093
+ },
4094
+ i(local) {
4095
+ if (current) return;
4096
+ internal.transition_in(currentfloor.$$.fragment, local);
4097
+ current = true;
4098
+ },
4099
+ o(local) {
4100
+ internal.transition_out(currentfloor.$$.fragment, local);
4101
+ current = false;
4102
+ },
4103
+ d(detaching) {
4104
+ internal.destroy_component(currentfloor, detaching);
4105
+ }
4106
+ };
4107
+ }
4108
+
4109
+ // (37:4) {#if compassEnable}
4140
4110
  function create_if_block_1(ctx) {
4141
4111
  let compass;
4142
4112
  let current;
4143
4113
 
4144
4114
  compass = new Compass({
4145
4115
  props: {
4146
- floorplanData: /*floorplanData*/ ctx[11],
4147
- northDesc: /*northDesc*/ ctx[0]
4116
+ floorplanData: /*floorplanData*/ ctx[9],
4117
+ northDesc: /*northDesc*/ ctx[2]
4148
4118
  }
4149
4119
  });
4150
4120
 
@@ -4158,8 +4128,8 @@ function create_if_block_1(ctx) {
4158
4128
  },
4159
4129
  p(ctx, dirty) {
4160
4130
  const compass_changes = {};
4161
- if (dirty & /*floorplanData*/ 2048) compass_changes.floorplanData = /*floorplanData*/ ctx[11];
4162
- if (dirty & /*northDesc*/ 1) compass_changes.northDesc = /*northDesc*/ ctx[0];
4131
+ if (dirty & /*floorplanData*/ 512) compass_changes.floorplanData = /*floorplanData*/ ctx[9];
4132
+ if (dirty & /*northDesc*/ 4) compass_changes.northDesc = /*northDesc*/ ctx[2];
4163
4133
  compass.$set(compass_changes);
4164
4134
  },
4165
4135
  i(local) {
@@ -4180,7 +4150,7 @@ function create_if_block_1(ctx) {
4180
4150
  function create_fragment$8(ctx) {
4181
4151
  let if_block_anchor;
4182
4152
  let current;
4183
- let if_block = /*visible*/ ctx[4] && create_if_block$2(ctx);
4153
+ let if_block = /*visible*/ ctx[1] && create_if_block$2(ctx);
4184
4154
 
4185
4155
  return {
4186
4156
  c() {
@@ -4193,11 +4163,11 @@ function create_fragment$8(ctx) {
4193
4163
  current = true;
4194
4164
  },
4195
4165
  p(ctx, [dirty]) {
4196
- if (/*visible*/ ctx[4]) {
4166
+ if (/*visible*/ ctx[1]) {
4197
4167
  if (if_block) {
4198
4168
  if_block.p(ctx, dirty);
4199
4169
 
4200
- if (dirty & /*visible*/ 16) {
4170
+ if (dirty & /*visible*/ 2) {
4201
4171
  internal.transition_in(if_block, 1);
4202
4172
  }
4203
4173
  } else {
@@ -4233,11 +4203,9 @@ function create_fragment$8(ctx) {
4233
4203
  }
4234
4204
 
4235
4205
  function instance$8($$self, $$props, $$invalidate) {
4236
- let { northDesc } = $$props;
4237
- let { pxmm } = $$props;
4238
- let { five } = $$props;
4239
4206
  let { duration = 0 } = $$props;
4240
4207
  let { visible } = $$props;
4208
+ let { northDesc } = $$props;
4241
4209
  let { panoIndex } = $$props;
4242
4210
  let { floorIndex } = $$props;
4243
4211
  let { hoverEnable } = $$props;
@@ -4247,34 +4215,28 @@ function instance$8($$self, $$props, $$invalidate) {
4247
4215
  let { floorplanData } = $$props;
4248
4216
  let { lastPanoramaLongitude } = $$props;
4249
4217
  let { cameraImageUrl } = $$props;
4250
- let { onRoomHeightClick } = $$props;
4251
4218
  let { getLabelElement } = $$props;
4252
4219
 
4253
4220
  $$self.$$set = $$props => {
4254
- if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
4255
- if ('pxmm' in $$props) $$invalidate(1, pxmm = $$props.pxmm);
4256
- if ('five' in $$props) $$invalidate(2, five = $$props.five);
4257
- if ('duration' in $$props) $$invalidate(3, duration = $$props.duration);
4258
- if ('visible' in $$props) $$invalidate(4, visible = $$props.visible);
4259
- if ('panoIndex' in $$props) $$invalidate(5, panoIndex = $$props.panoIndex);
4260
- if ('floorIndex' in $$props) $$invalidate(6, floorIndex = $$props.floorIndex);
4261
- if ('hoverEnable' in $$props) $$invalidate(7, hoverEnable = $$props.hoverEnable);
4262
- if ('compassEnable' in $$props) $$invalidate(8, compassEnable = $$props.compassEnable);
4263
- if ('roomLabelsEnable' in $$props) $$invalidate(9, roomLabelsEnable = $$props.roomLabelsEnable);
4264
- if ('ruleLabelsEnable' in $$props) $$invalidate(10, ruleLabelsEnable = $$props.ruleLabelsEnable);
4265
- if ('floorplanData' in $$props) $$invalidate(11, floorplanData = $$props.floorplanData);
4266
- if ('lastPanoramaLongitude' in $$props) $$invalidate(12, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4267
- if ('cameraImageUrl' in $$props) $$invalidate(13, cameraImageUrl = $$props.cameraImageUrl);
4268
- if ('onRoomHeightClick' in $$props) $$invalidate(14, onRoomHeightClick = $$props.onRoomHeightClick);
4269
- if ('getLabelElement' in $$props) $$invalidate(15, getLabelElement = $$props.getLabelElement);
4221
+ if ('duration' in $$props) $$invalidate(0, duration = $$props.duration);
4222
+ if ('visible' in $$props) $$invalidate(1, visible = $$props.visible);
4223
+ if ('northDesc' in $$props) $$invalidate(2, northDesc = $$props.northDesc);
4224
+ if ('panoIndex' in $$props) $$invalidate(3, panoIndex = $$props.panoIndex);
4225
+ if ('floorIndex' in $$props) $$invalidate(4, floorIndex = $$props.floorIndex);
4226
+ if ('hoverEnable' in $$props) $$invalidate(5, hoverEnable = $$props.hoverEnable);
4227
+ if ('compassEnable' in $$props) $$invalidate(6, compassEnable = $$props.compassEnable);
4228
+ if ('roomLabelsEnable' in $$props) $$invalidate(7, roomLabelsEnable = $$props.roomLabelsEnable);
4229
+ if ('ruleLabelsEnable' in $$props) $$invalidate(8, ruleLabelsEnable = $$props.ruleLabelsEnable);
4230
+ if ('floorplanData' in $$props) $$invalidate(9, floorplanData = $$props.floorplanData);
4231
+ if ('lastPanoramaLongitude' in $$props) $$invalidate(10, lastPanoramaLongitude = $$props.lastPanoramaLongitude);
4232
+ if ('cameraImageUrl' in $$props) $$invalidate(11, cameraImageUrl = $$props.cameraImageUrl);
4233
+ if ('getLabelElement' in $$props) $$invalidate(12, getLabelElement = $$props.getLabelElement);
4270
4234
  };
4271
4235
 
4272
4236
  return [
4273
- northDesc,
4274
- pxmm,
4275
- five,
4276
4237
  duration,
4277
4238
  visible,
4239
+ northDesc,
4278
4240
  panoIndex,
4279
4241
  floorIndex,
4280
4242
  hoverEnable,
@@ -4284,7 +4246,6 @@ function instance$8($$self, $$props, $$invalidate) {
4284
4246
  floorplanData,
4285
4247
  lastPanoramaLongitude,
4286
4248
  cameraImageUrl,
4287
- onRoomHeightClick,
4288
4249
  getLabelElement
4289
4250
  ];
4290
4251
  }
@@ -4300,22 +4261,19 @@ class Main$1 extends internal.SvelteComponent {
4300
4261
  create_fragment$8,
4301
4262
  internal.safe_not_equal,
4302
4263
  {
4303
- northDesc: 0,
4304
- pxmm: 1,
4305
- five: 2,
4306
- duration: 3,
4307
- visible: 4,
4308
- panoIndex: 5,
4309
- floorIndex: 6,
4310
- hoverEnable: 7,
4311
- compassEnable: 8,
4312
- roomLabelsEnable: 9,
4313
- ruleLabelsEnable: 10,
4314
- floorplanData: 11,
4315
- lastPanoramaLongitude: 12,
4316
- cameraImageUrl: 13,
4317
- onRoomHeightClick: 14,
4318
- getLabelElement: 15
4264
+ duration: 0,
4265
+ visible: 1,
4266
+ northDesc: 2,
4267
+ panoIndex: 3,
4268
+ floorIndex: 4,
4269
+ hoverEnable: 5,
4270
+ compassEnable: 6,
4271
+ roomLabelsEnable: 7,
4272
+ ruleLabelsEnable: 8,
4273
+ floorplanData: 9,
4274
+ lastPanoramaLongitude: 10,
4275
+ cameraImageUrl: 11,
4276
+ getLabelElement: 12
4319
4277
  },
4320
4278
  add_css$7
4321
4279
  );
@@ -4425,32 +4383,58 @@ class TopviewFloorplanPluginController {
4425
4383
  value: () => {
4426
4384
  var _a, _b;
4427
4385
  this.hide();
4428
- (_a = this.container) === null || _a === void 0 ? void 0 : _a.remove();
4429
- (_b = this.app) === null || _b === void 0 ? void 0 : _b.$destroy();
4430
- this.five.off('modeChange', this.handleModeChange);
4431
- this.five.off('panoArrived', this.handlePanoArrived);
4432
- this.five.off('modelLoaded', this.handleModelLoaded);
4433
- this.five.off('wantsMoveToPano', this.handleWantsMoveToPano);
4434
- this.five.off('wantsPanGesture', this.handleWantsPanGesture);
4435
- this.five.off('initAnimationEnded', this.handleInitAnimationEnded);
4386
+ (_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
4387
+ (_b = this.container) === null || _b === void 0 ? void 0 : _b.remove();
4388
+ this.five.off('modeChange', this.onFiveModeChange);
4389
+ this.five.off('panGesture', this.onFivePanGesture);
4390
+ this.five.off('panoArrived', this.onFivePanoArrived);
4391
+ this.five.off('modelLoaded', this.onFiveModelLoaded);
4392
+ this.five.off('pinchGesture', this.onFivePinchGesture);
4393
+ this.five.off('wantsGesture', this.onFiveWantsGesture);
4394
+ this.five.off('wantsMoveToPano', this.onFiveWantsMoveToPano);
4395
+ this.five.off('initAnimationEnded', this.onFiveInitAnimationEnded);
4436
4396
  this.five.off('modelShownFloorChange', this.onModelShownFloorChange);
4437
4397
  }
4438
4398
  });
4439
- /** 模型楼层高亮改变时,自动进行楼层切换 */
4399
+ Object.defineProperty(this, "onFiveWantsMoveToPano", {
4400
+ enumerable: true,
4401
+ configurable: true,
4402
+ writable: true,
4403
+ value: () => {
4404
+ if (this.visible && this.configs.preventRoomClick)
4405
+ return false;
4406
+ }
4407
+ });
4408
+ Object.defineProperty(this, "onFiveWantsGesture", {
4409
+ enumerable: true,
4410
+ configurable: true,
4411
+ writable: true,
4412
+ value: (type) => {
4413
+ if (type !== 'pan' && type !== 'pinch' && type !== 'mouseWheel')
4414
+ return;
4415
+ if (this.visible && !this.configs.gestureEnable)
4416
+ return false;
4417
+ }
4418
+ });
4440
4419
  Object.defineProperty(this, "onModelShownFloorChange", {
4441
4420
  enumerable: true,
4442
4421
  configurable: true,
4443
4422
  writable: true,
4444
4423
  value: (shownFloor) => {
4445
- if (shownFloor === null)
4424
+ if (this.floorIndex === shownFloor)
4425
+ return;
4426
+ if (shownFloor === null) {
4427
+ const panoIndex = this.five.getCurrentState().panoIndex;
4428
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
4446
4429
  return;
4430
+ }
4431
+ // 模型楼层高亮改变时,自动进行楼层切换
4447
4432
  this.floorIndex = shownFloor;
4448
4433
  this.updateSize();
4449
4434
  this.render();
4450
4435
  }
4451
4436
  });
4452
- /** panoIndex 改变时,更新 floorIndex */
4453
- Object.defineProperty(this, "handlePanoArrived", {
4437
+ Object.defineProperty(this, "onFivePanoArrived", {
4454
4438
  enumerable: true,
4455
4439
  configurable: true,
4456
4440
  writable: true,
@@ -4462,31 +4446,28 @@ class TopviewFloorplanPluginController {
4462
4446
  this.floorIndex = this.five.work.observers[index].floorIndex;
4463
4447
  }
4464
4448
  });
4465
- /** 配置了 preventRoomClick 后,在户型图展示时阻止 Five 走点 */
4466
- Object.defineProperty(this, "handleWantsMoveToPano", {
4449
+ Object.defineProperty(this, "onFivePanGesture", {
4467
4450
  enumerable: true,
4468
4451
  configurable: true,
4469
4452
  writable: true,
4470
4453
  value: () => {
4471
4454
  if (!this.visible)
4472
4455
  return;
4473
- if (this.configs.preventRoomClick)
4474
- return false;
4475
- return;
4456
+ this.updatePosition();
4476
4457
  }
4477
4458
  });
4478
- /** 在户型图展示时阻止 Five 滑动行为 */
4479
- Object.defineProperty(this, "handleWantsPanGesture", {
4459
+ Object.defineProperty(this, "onFivePinchGesture", {
4480
4460
  enumerable: true,
4481
4461
  configurable: true,
4482
4462
  writable: true,
4483
4463
  value: () => {
4484
4464
  if (!this.visible)
4485
4465
  return;
4486
- return false;
4466
+ this.updatePosition();
4467
+ this.updateSize();
4487
4468
  }
4488
4469
  });
4489
- Object.defineProperty(this, "handleModelLoaded", {
4470
+ Object.defineProperty(this, "onFiveModelLoaded", {
4490
4471
  enumerable: true,
4491
4472
  configurable: true,
4492
4473
  writable: true,
@@ -4503,7 +4484,7 @@ class TopviewFloorplanPluginController {
4503
4484
  }
4504
4485
  });
4505
4486
  /** 非 Topview 态隐藏户型图 */
4506
- Object.defineProperty(this, "handleModeChange", {
4487
+ Object.defineProperty(this, "onFiveModeChange", {
4507
4488
  enumerable: true,
4508
4489
  configurable: true,
4509
4490
  writable: true,
@@ -4513,7 +4494,7 @@ class TopviewFloorplanPluginController {
4513
4494
  }
4514
4495
  });
4515
4496
  /** 动画结束后是 Topview 态就展示户型图 */
4516
- Object.defineProperty(this, "handleInitAnimationEnded", {
4497
+ Object.defineProperty(this, "onFiveInitAnimationEnded", {
4517
4498
  enumerable: true,
4518
4499
  configurable: true,
4519
4500
  writable: true,
@@ -4553,24 +4534,30 @@ class TopviewFloorplanPluginController {
4553
4534
  this.five = five;
4554
4535
  this.selector = params.selector;
4555
4536
  this.configs = omit(params, ['selector']);
4537
+ this.five.addExtraElement(this.container);
4556
4538
  // 设置 container 样式
4557
4539
  this.container.classList.add('floorplan-plugin');
4558
4540
  Object.assign(this.container.style, pluginStyle$1);
4559
4541
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
4560
- this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
4542
+ this.five.model.loaded
4543
+ ? this.onFiveModelLoaded()
4544
+ : five.once('modelLoaded', this.onFiveModelLoaded);
4561
4545
  this.five.once('dispose', this.dispose);
4562
- this.five.on('modeChange', this.handleModeChange);
4563
- this.five.on('panoArrived', this.handlePanoArrived);
4564
- this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
4546
+ this.five.on('modeChange', this.onFiveModeChange);
4547
+ this.five.on('panGesture', this.onFivePanGesture);
4548
+ this.five.on('mouseWheel', this.onFivePinchGesture);
4549
+ this.five.on('panoArrived', this.onFivePanoArrived);
4550
+ this.five.on('pinchGesture', this.onFivePinchGesture);
4551
+ this.five.on('wantsGesture', this.onFiveWantsGesture);
4552
+ this.five.on('wantsMoveToPano', this.onFiveWantsMoveToPano);
4553
+ this.five.on('initAnimationEnded', this.onFiveInitAnimationEnded);
4565
4554
  this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
4566
4555
  }
4567
4556
  /** 加载户型图数据 */
4568
- load(data) {
4569
- return __awaiter(this, void 0, void 0, function* () {
4570
- const copyData = JSON.parse(JSON.stringify(data));
4571
- this.floorplanData = yield formatData(copyData);
4572
- this.render();
4573
- });
4557
+ async load(data) {
4558
+ const copyData = JSON.parse(JSON.stringify(data));
4559
+ this.floorplanData = await formatData(copyData);
4560
+ this.render();
4574
4561
  }
4575
4562
  /** 把插件的渲染DOM插入到对应的容器中去 */
4576
4563
  appendTo(wrapper) {
@@ -4581,6 +4568,7 @@ class TopviewFloorplanPluginController {
4581
4568
  show() {
4582
4569
  this.visible = true;
4583
4570
  this.five.model.show(this.floorIndex);
4571
+ this.updatePosition();
4584
4572
  this.updateSize();
4585
4573
  const renderDuration = 500;
4586
4574
  const modelOpacity = this.configs.modelOpacity;
@@ -4588,8 +4576,6 @@ class TopviewFloorplanPluginController {
4588
4576
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4589
4577
  }
4590
4578
  this.render(renderDuration);
4591
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4592
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4593
4579
  }
4594
4580
  hide() {
4595
4581
  const modelOpacity = 1;
@@ -4597,20 +4583,28 @@ class TopviewFloorplanPluginController {
4597
4583
  this.visible = false;
4598
4584
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
4599
4585
  this.render();
4600
- this.five.on('wantsMoveToPano', this.handleWantsMoveToPano);
4601
- this.five.on('wantsPanGesture', this.handleWantsPanGesture);
4586
+ }
4587
+ /** 更新户型图位置 */
4588
+ updatePosition() {
4589
+ var _a;
4590
+ const modelCenter = (_a = this.five.model) === null || _a === void 0 ? void 0 : _a.bounding.getCenter(new THREE__namespace.Vector3());
4591
+ if (!modelCenter)
4592
+ return;
4593
+ const ndcModelCenter = modelCenter.clone().project(this.five.camera);
4594
+ const left = (ndcModelCenter.x + 1) / 2;
4595
+ const top = -(ndcModelCenter.y - 1) / 2;
4596
+ this.container.style.left = left * 100 + '%';
4597
+ this.container.style.top = top * 100 + '%';
4602
4598
  }
4603
4599
  render(duration) {
4604
4600
  if (!this.container || !this.floorplanData)
4605
4601
  return;
4606
4602
  if (this.size.width === 0)
4607
4603
  return;
4608
- const { northDesc, getLabelElement, cameraImageUrl, preventRoomClick, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4609
- const handleClick = preventRoomClick ? () => false : undefined;
4604
+ const { northDesc, getLabelElement, cameraImageUrl, hoverEnable, compassEnable, roomLabelsEnable, ruleLabelsEnable, } = this.configs;
4610
4605
  const props = {
4606
+ getLabelElement,
4611
4607
  northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
4612
- five: this.five,
4613
- pxmm: this.pxmm,
4614
4608
  cameraImageUrl,
4615
4609
  visible: this.visible,
4616
4610
  duration: duration !== null && duration !== void 0 ? duration : 0,
@@ -4622,8 +4616,6 @@ class TopviewFloorplanPluginController {
4622
4616
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
4623
4617
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
4624
4618
  lastPanoramaLongitude: this.lastPanoramaLongitude,
4625
- getLabelElement,
4626
- onRoomHeightClick: handleClick,
4627
4619
  };
4628
4620
  if (!this.app) {
4629
4621
  this.app = new Main$1({
@@ -4664,7 +4656,7 @@ function throttle(func, wait = 200) {
4664
4656
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte generated by Svelte v3.47.0 */
4665
4657
 
4666
4658
  function add_css$6(target) {
4667
- internal.append_styles(target, "svelte-o7uo2v", ".plugin-radar__camera-wrapper.svelte-o7uo2v{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-o7uo2v{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-o7uo2v{position:absolute;left:-15px;top:-15px;width:17px;height:17px;transform-origin:15px 15px;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
4659
+ internal.append_styles(target, "svelte-1ty3s4p", ".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}");
4668
4660
  }
4669
4661
 
4670
4662
  function create_fragment$7(ctx) {
@@ -4677,12 +4669,12 @@ function create_fragment$7(ctx) {
4677
4669
  div2 = internal.element("div");
4678
4670
  div1 = internal.element("div");
4679
4671
  div0 = internal.element("div");
4680
- internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-o7uo2v");
4672
+ internal.attr(div0, "class", "plugin-radar__camera-rotate svelte-1ty3s4p");
4681
4673
  internal.set_style(div0, "background-image", "url(" + (/*cameraImageUrl*/ ctx[0] || CAMERA_IMAGE) + ")");
4682
4674
  internal.set_style(div0, "transform", /*rotateTransform*/ ctx[1], false);
4683
- internal.attr(div1, "class", "plugin-radar__camera-position svelte-o7uo2v");
4675
+ internal.attr(div1, "class", "plugin-radar__camera-position svelte-1ty3s4p");
4684
4676
  internal.set_style(div1, "transform", /*positionTransform*/ ctx[2], false);
4685
- internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-o7uo2v");
4677
+ internal.attr(div2, "class", "plugin-radar__camera-wrapper svelte-1ty3s4p");
4686
4678
  },
4687
4679
  m(target, anchor) {
4688
4680
  internal.insert(target, div2, anchor);
@@ -4798,7 +4790,7 @@ class Camera extends internal.SvelteComponent {
4798
4790
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte generated by Svelte v3.47.0 */
4799
4791
 
4800
4792
  function add_css$5(target) {
4801
- internal.append_styles(target, "svelte-8n0d4v", ".plugin-pano-floorplan__extra-objects.svelte-8n0d4v{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-8n0d4v{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-8n0d4v{transform:translate(-50%, -50%)}");
4793
+ internal.append_styles(target, "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%)}");
4802
4794
  }
4803
4795
 
4804
4796
  function get_each_context$2(ctx, list, i) {
@@ -4824,11 +4816,11 @@ function create_each_block$2(key_1, ctx) {
4824
4816
  div1 = internal.element("div");
4825
4817
  div0 = internal.element("div");
4826
4818
  t = internal.space();
4827
- internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-8n0d4v");
4819
+ internal.attr(div0, "class", "plugin-pano-floorplan__extra-object-item svelte-1i87fz7");
4828
4820
  internal.set_style(div0, "background-image", `url(${/*extraObject*/ ctx[1].icon.url})`);
4829
4821
  internal.set_style(div0, "width", style_width, false);
4830
4822
  internal.set_style(div0, "height", style_height, false);
4831
- internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-8n0d4v");
4823
+ internal.attr(div1, "class", "plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7");
4832
4824
  internal.set_style(div1, "top", style_top, false);
4833
4825
  internal.set_style(div1, "left", style_left, false);
4834
4826
  this.first = div1;
@@ -4888,7 +4880,7 @@ function create_fragment$6(ctx) {
4888
4880
  each_blocks[i].c();
4889
4881
  }
4890
4882
 
4891
- internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-8n0d4v");
4883
+ internal.attr(div, "class", "plugin-pano-floorplan__extra-objects svelte-1i87fz7");
4892
4884
  },
4893
4885
  m(target, anchor) {
4894
4886
  internal.insert(target, div, anchor);
@@ -5162,7 +5154,7 @@ class CurrentFloor extends internal.SvelteComponent {
5162
5154
  /* src/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte generated by Svelte v3.47.0 */
5163
5155
 
5164
5156
  function add_css$4(target) {
5165
- internal.append_styles(target, "svelte-7d8ub2", ".plugin-floorplan-radar.svelte-7d8ub2{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-7d8ub2{position:relative}");
5157
+ internal.append_styles(target, "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}");
5166
5158
  }
5167
5159
 
5168
5160
  // (41:2) {#if clientWidth !== 0}
@@ -5217,7 +5209,7 @@ function create_if_block(ctx) {
5217
5209
  internal.create_component(currentfloor.$$.fragment);
5218
5210
  t = internal.space();
5219
5211
  internal.create_component(camera.$$.fragment);
5220
- internal.attr(div, "class", "plugin-floorplan-radar-container svelte-7d8ub2");
5212
+ internal.attr(div, "class", "plugin-floorplan-radar-container svelte-1mvqyqq");
5221
5213
  internal.set_style(div, "width", style_width, false);
5222
5214
  internal.set_style(div, "height", style_height, false);
5223
5215
  },
@@ -5294,7 +5286,7 @@ function create_fragment$4(ctx) {
5294
5286
  c() {
5295
5287
  div = internal.element("div");
5296
5288
  if (if_block) if_block.c();
5297
- internal.attr(div, "class", "plugin-floorplan-radar svelte-7d8ub2");
5289
+ internal.attr(div, "class", "plugin-floorplan-radar svelte-1mvqyqq");
5298
5290
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[11].call(div));
5299
5291
  },
5300
5292
  m(target, anchor) {
@@ -5505,9 +5497,9 @@ class PanoFloorplanRadarPluginController {
5505
5497
  enumerable: true,
5506
5498
  configurable: true,
5507
5499
  writable: true,
5508
- value: (data) => __awaiter(this, void 0, void 0, function* () {
5500
+ value: async (data) => {
5509
5501
  const copyData = JSON.parse(JSON.stringify(data));
5510
- const floorplanData = yield formatData(copyData);
5502
+ const floorplanData = await formatData(copyData);
5511
5503
  this.data = floorplanData;
5512
5504
  // const loadImage = async () => {
5513
5505
  // const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
@@ -5525,7 +5517,7 @@ class PanoFloorplanRadarPluginController {
5525
5517
  // }
5526
5518
  // await loadImage()
5527
5519
  this.render();
5528
- })
5520
+ }
5529
5521
  });
5530
5522
  this.five = five;
5531
5523
  (params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
@@ -5585,24 +5577,37 @@ const PanoFloorplanRadarPlugin = (five, params) => {
5585
5577
  return new PanoFloorplanRadarPluginController(five, params);
5586
5578
  };
5587
5579
 
5580
+ var FloorplanErrorType;
5581
+ (function (FloorplanErrorType) {
5582
+ FloorplanErrorType["UnknownError"] = "UnknowError";
5583
+ FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5584
+ FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5585
+ FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5586
+ FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5587
+ FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5588
+ FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5589
+ })(FloorplanErrorType || (FloorplanErrorType = {}));
5590
+ /** 户型图展示 & 模型消失的默认时间 */
5591
+ const SHOW_ANIME_DURATION = 500;
5592
+ /** Five camera 默认 fov */
5593
+ const FIVE_CAMERA_DEFAULT_FOV = 80;
5594
+
5588
5595
  /**
5589
5596
  * 传入一个 Promise
5590
5597
  * 无异常,返回 [null, data]
5591
5598
  * 有异常,则返回 [Error, undefined]
5592
5599
  * 用于替代 try&catch 处理 await 异常的方案
5593
5600
  */
5594
- function to(promise) {
5595
- return __awaiter(this, void 0, void 0, function* () {
5596
- try {
5597
- const data = yield promise;
5598
- return [null, data];
5599
- }
5600
- catch (error) {
5601
- if (error instanceof Error)
5602
- return [error, null];
5603
- return [new Error(''), null];
5604
- }
5605
- });
5601
+ async function to(promise) {
5602
+ try {
5603
+ const data = await promise;
5604
+ return [null, data];
5605
+ }
5606
+ catch (error) {
5607
+ if (error instanceof Error)
5608
+ return [error, null];
5609
+ return [new Error(''), null];
5610
+ }
5606
5611
  }
5607
5612
 
5608
5613
  /**
@@ -5710,38 +5715,21 @@ function equal(value, other, opt = { deep: false }) {
5710
5715
  return isDeepEqual(value, other);
5711
5716
  }
5712
5717
 
5713
- function changeMode(five, ...changeModeParams) {
5714
- return __awaiter(this, void 0, void 0, function* () {
5715
- const [changeModeError] = yield to(five.changeMode(...changeModeParams));
5716
- if (changeModeError)
5717
- throw changeModeError;
5718
- yield new Promise((reslove, reject) => {
5719
- five.once('initAnimationEnded', reslove);
5720
- const handleModeChange = (mode) => {
5721
- if (mode !== changeModeParams[0])
5722
- reject('changeMode 被中断');
5723
- five.off('modeChange', handleModeChange);
5724
- };
5725
- five.on('modeChange', handleModeChange);
5726
- });
5718
+ async function changeMode(five, ...changeModeParams) {
5719
+ const [changeModeError] = await to(five.changeMode(...changeModeParams));
5720
+ if (changeModeError)
5721
+ throw changeModeError;
5722
+ await new Promise((reslove, reject) => {
5723
+ five.once('initAnimationEnded', reslove);
5724
+ const handleModeChange = (mode) => {
5725
+ if (mode !== changeModeParams[0])
5726
+ reject('changeMode 被中断');
5727
+ five.off('modeChange', handleModeChange);
5728
+ };
5729
+ five.on('modeChange', handleModeChange);
5727
5730
  });
5728
5731
  }
5729
5732
 
5730
- var FloorplanErrorType;
5731
- (function (FloorplanErrorType) {
5732
- FloorplanErrorType["UnknownError"] = "UnknowError";
5733
- FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
5734
- FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
5735
- FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
5736
- FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
5737
- FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
5738
- FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
5739
- })(FloorplanErrorType || (FloorplanErrorType = {}));
5740
- /** 户型图展示 & 模型消失的默认时间 */
5741
- const SHOW_ANIME_DURATION = 500;
5742
- /** Five camera 默认 fov */
5743
- const FIVE_CAMERA_DEFAULT_FOV = 80;
5744
-
5745
5733
  /**
5746
5734
  * 比较两个数字近似相等
5747
5735
  * @param num1 数字1
@@ -5768,32 +5756,30 @@ function checkShowState(five$1, showState) {
5768
5756
  * 2. 内置了相应的动画时间计算
5769
5757
  * 3. 纠正成功会返回 true,失败「可能会被用户行为中断」会返回 false
5770
5758
  */
5771
- function correctFiveState(five$1, showState, userAction = true) {
5772
- return __awaiter(this, void 0, void 0, function* () {
5773
- // 当前已满足状态,不需要变更
5759
+ async function correctFiveState(five$1, showState, userAction = true) {
5760
+ // 当前已满足状态,不需要变更
5761
+ const result = checkShowState(five$1, showState);
5762
+ if (result === true)
5763
+ return;
5764
+ // 纠正 mode
5765
+ if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5766
+ const [changeModeError] = await to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5767
+ if (changeModeError)
5768
+ throw changeModeError;
5769
+ // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5774
5770
  const result = checkShowState(five$1, showState);
5775
- if (result === true)
5776
- return;
5777
- // 纠正 mode
5778
- if (five$1.currentMode !== five.Five.Mode.Floorplan) {
5779
- const [changeModeError] = yield to(changeMode(five$1, five.Five.Mode.Floorplan, showState, undefined, userAction));
5780
- if (changeModeError)
5781
- throw changeModeError;
5782
- // changeMode 是异步行为,可能会被打断,需要在结束后加一次判断
5783
- const result = checkShowState(five$1, showState);
5784
- if (result === false)
5785
- throw new Error(FloorplanErrorType.ChangeModeError);
5786
- return;
5787
- }
5788
- // 纠正相机状态
5789
- // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5790
- const { latitude, longitude, fov } = five$1.getCurrentState();
5791
- const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5792
- const [updateCameraError] = yield to(five$1.updateCamera(showState, time, userAction));
5793
- if (updateCameraError)
5794
- throw new Error(FloorplanErrorType.UpdateCameraError);
5771
+ if (result === false)
5772
+ throw new Error(FloorplanErrorType.ChangeModeError);
5795
5773
  return;
5796
- });
5774
+ }
5775
+ // 纠正相机状态
5776
+ // 根据 latitude、longitude、fov 计算动画时间,最多 1s
5777
+ const { latitude, longitude, fov } = five$1.getCurrentState();
5778
+ const time = Math.min(1000, Math.max(200, Math.abs(latitude - Math.PI / 2) * 1000, (longitude > Math.PI ? 2 * Math.PI - longitude : longitude) * 500, Math.abs(fov - showState.fov) * 10));
5779
+ const [updateCameraError] = await to(five$1.updateCamera(showState, time, userAction));
5780
+ if (updateCameraError)
5781
+ throw new Error(FloorplanErrorType.UpdateCameraError);
5782
+ return;
5797
5783
  }
5798
5784
 
5799
5785
  const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
@@ -5982,12 +5968,12 @@ class ModelFloorplanPluginController {
5982
5968
  enumerable: true,
5983
5969
  configurable: true,
5984
5970
  writable: true,
5985
- value: (opts) => __awaiter(this, void 0, void 0, function* () {
5986
- var _b, _c;
5971
+ value: async (opts) => {
5972
+ var _a, _b;
5987
5973
  // 已经在展示中了
5988
5974
  if (!this.showPromise && this.visible)
5989
5975
  return true;
5990
- if (!((_b = this.five.model) === null || _b === void 0 ? void 0 : _b.loaded))
5976
+ if (!((_a = this.five.model) === null || _a === void 0 ? void 0 : _a.loaded))
5991
5977
  throw new Error(FloorplanErrorType.ModelNotLoaded);
5992
5978
  if (!this.floorplanData)
5993
5979
  throw new Error(FloorplanErrorType.DataNotLoaded);
@@ -5997,18 +5983,18 @@ class ModelFloorplanPluginController {
5997
5983
  if (!!this.showPromise && sameWithLastOpts)
5998
5984
  return this.showPromise;
5999
5985
  if (!!this.showPromise && !sameWithLastOpts)
6000
- (_c = this.showRejection) === null || _c === void 0 ? void 0 : _c.call(this, FloorplanErrorType.DifferentShowParams);
5986
+ (_b = this.showRejection) === null || _b === void 0 ? void 0 : _b.call(this, FloorplanErrorType.DifferentShowParams);
6001
5987
  }
6002
5988
  this.ModelFloorplanPluginsShowOpts = opts;
6003
- const getShowPromise = () => __awaiter(this, void 0, void 0, function* () {
6004
- var _d, _e;
5989
+ const getShowPromise = async () => {
5990
+ var _a, _b;
6005
5991
  let hasRejected = false;
6006
5992
  let externalErrorMsg;
6007
5993
  this.showRejection = (errorMsg) => {
6008
5994
  hasRejected = true;
6009
5995
  externalErrorMsg = errorMsg;
6010
5996
  };
6011
- const [correctError] = yield to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
5997
+ const [correctError] = await to(correctFiveState(this.five, this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
6012
5998
  if (correctError)
6013
5999
  throw correctError;
6014
6000
  // 异步结束要判断当前是不是被中断了,是不是调用了隐藏
@@ -6027,7 +6013,7 @@ class ModelFloorplanPluginController {
6027
6013
  this.floorIndex = opts.floorIndex;
6028
6014
  this.five.model.show(this.floorIndex);
6029
6015
  // 模型消失, 渲染户型图
6030
- const modelOpacity = (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _d !== void 0 ? _d : this.configs.modelOpacity) !== null && _e !== void 0 ? _e : 1;
6016
+ const modelOpacity = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _a !== void 0 ? _a : this.configs.modelOpacity) !== null && _b !== void 0 ? _b : 1;
6031
6017
  const renderDuration = (opts === null || opts === void 0 ? void 0 : opts.immediately) ? 0 : SHOW_ANIME_DURATION;
6032
6018
  changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
6033
6019
  this.render(renderDuration);
@@ -6035,7 +6021,7 @@ class ModelFloorplanPluginController {
6035
6021
  this.five.on('wantsGesture', this.handleWantsGesture);
6036
6022
  this.five.on('wantsTapGesture', this.handleWantsTapGesture);
6037
6023
  return true;
6038
- });
6024
+ };
6039
6025
  const showPromise = getShowPromise()
6040
6026
  .then(() => {
6041
6027
  var _a;
@@ -6057,7 +6043,7 @@ class ModelFloorplanPluginController {
6057
6043
  });
6058
6044
  this.showPromise = showPromise;
6059
6045
  return showPromise;
6060
- })
6046
+ }
6061
6047
  });
6062
6048
  /** 隐藏户型图 */
6063
6049
  Object.defineProperty(this, "hide", {
@@ -6087,8 +6073,13 @@ class ModelFloorplanPluginController {
6087
6073
  configurable: true,
6088
6074
  writable: true,
6089
6075
  value: (shownFloor) => {
6090
- if (shownFloor === null)
6076
+ if (this.floorIndex === shownFloor)
6091
6077
  return;
6078
+ if (shownFloor === null) {
6079
+ const panoIndex = this.five.getCurrentState().panoIndex;
6080
+ this.floorIndex = this.five.work.observers[panoIndex].floorIndex;
6081
+ return;
6082
+ }
6092
6083
  this.floorIndex = shownFloor;
6093
6084
  this.updateSize();
6094
6085
  this.render();
@@ -6201,7 +6192,9 @@ class ModelFloorplanPluginController {
6201
6192
  enumerable: true,
6202
6193
  configurable: true,
6203
6194
  writable: true,
6204
- value: ({ latitude, longitude }, isFinal) => __awaiter(this, void 0, void 0, function* () {
6195
+ value: async ({ latitude, longitude }, isFinal) => {
6196
+ if (this.five.getCurrentState().mode !== 'Floorplan')
6197
+ return;
6205
6198
  if (this.configs.autoShowEnable === false)
6206
6199
  return;
6207
6200
  // 如果操作结束后,户型图还在展示中,初始化模型状态
@@ -6222,16 +6215,16 @@ class ModelFloorplanPluginController {
6222
6215
  const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
6223
6216
  if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
6224
6217
  // 当手指离开时需要等惯性结束之后在进行判断
6225
- const handleInteriaPan = (any, isFinal) => __awaiter(this, void 0, void 0, function* () {
6218
+ const handleInteriaPan = async (any, isFinal) => {
6226
6219
  if (!isFinal)
6227
6220
  return;
6228
6221
  this.five.off('interiaPan', handleInteriaPan);
6229
- yield this.show({ isAutoShow: true });
6230
- });
6222
+ await this.show({ isAutoShow: true });
6223
+ };
6231
6224
  this.five.on('interiaPan', handleInteriaPan);
6232
6225
  return;
6233
6226
  }
6234
- })
6227
+ }
6235
6228
  });
6236
6229
  this.five = five$1;
6237
6230
  this.hooks = new five.Subscribe();
@@ -6245,9 +6238,9 @@ class ModelFloorplanPluginController {
6245
6238
  left: '50%',
6246
6239
  top: '50%',
6247
6240
  transform: 'translate(-50%, -50%)',
6248
- pointerEvents: 'none',
6249
6241
  zIndex: 10,
6250
6242
  });
6243
+ this.five.addExtraElement(this.container);
6251
6244
  // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
6252
6245
  this.five.model.loaded ? this.handleModelLoaded() : five$1.once('modelLoaded', this.handleModelLoaded);
6253
6246
  five$1.once('dispose', this.dispose);
@@ -6258,12 +6251,10 @@ class ModelFloorplanPluginController {
6258
6251
  five$1.on('modelShownFloorChange', this.onModelShownFloorChange);
6259
6252
  }
6260
6253
  /** 加载户型图数据 */
6261
- load(data) {
6262
- return __awaiter(this, void 0, void 0, function* () {
6263
- const copyData = JSON.parse(JSON.stringify(data));
6264
- this.floorplanData = yield formatData(copyData);
6265
- this.render();
6266
- });
6254
+ async load(data) {
6255
+ const copyData = JSON.parse(JSON.stringify(data));
6256
+ this.floorplanData = await formatData(copyData);
6257
+ this.render();
6267
6258
  }
6268
6259
  /** 把插件的渲染DOM插入到对应的容器中去 */
6269
6260
  appendTo(wrapper) {
@@ -6274,8 +6265,6 @@ class ModelFloorplanPluginController {
6274
6265
  /** 更改户型图楼层 */
6275
6266
  changeFloor(floorIndex) {
6276
6267
  this.five.model.show(floorIndex);
6277
- this.floorIndex = floorIndex;
6278
- this.render();
6279
6268
  }
6280
6269
  changeConfigs(params) {
6281
6270
  Object.assign(this.configs, params);
@@ -6290,10 +6279,9 @@ class ModelFloorplanPluginController {
6290
6279
  return;
6291
6280
  const { northDesc, hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
6292
6281
  const props = {
6293
- northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6294
- five: this.five,
6295
- pxmm: this.pxmm,
6296
6282
  cameraImageUrl,
6283
+ getLabelElement,
6284
+ northDesc: northDesc !== null && northDesc !== void 0 ? northDesc : '北',
6297
6285
  visible: this.visible,
6298
6286
  duration: duration !== null && duration !== void 0 ? duration : 0,
6299
6287
  panoIndex: this.panoIndex,
@@ -6304,8 +6292,6 @@ class ModelFloorplanPluginController {
6304
6292
  ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
6305
6293
  roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
6306
6294
  lastPanoramaLongitude: this.lastPanoramaLongitude,
6307
- getLabelElement,
6308
- onRoomHeightClick: this.handleClick,
6309
6295
  };
6310
6296
  if (!this.app) {
6311
6297
  this.app = new Main$1({
@@ -6375,7 +6361,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6375
6361
  const defaultNorthRad = params.north_rad || undefined;
6376
6362
  // 局部状态
6377
6363
  const state = {};
6378
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6364
+ const load = async (data) => {
6379
6365
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
6380
6366
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
6381
6367
  if (!northRad) {
@@ -6386,7 +6372,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6386
6372
  const zOffset = bounding.max.z - bounding.min.z;
6387
6373
  const maxOffset = Math.max(xOffset, zOffset);
6388
6374
  const fbxLoader = new FBXLoader.FBXLoader();
6389
- const object = yield fbxLoader.loadAsync(fbxUrl);
6375
+ const object = await fbxLoader.loadAsync(fbxUrl);
6390
6376
  transfromToMeshBasicMaterial(object, {
6391
6377
  transparent: true,
6392
6378
  side: THREE__namespace.DoubleSide,
@@ -6400,7 +6386,7 @@ const ModelChassisCompassPlugin = (five, params) => {
6400
6386
  bject3d2LocalMatrix(object, { position, rotation, scale });
6401
6387
  state.object = object;
6402
6388
  return true;
6403
- });
6389
+ };
6404
6390
  const onCameraUpdate = ({ latitude }) => {
6405
6391
  if (!state.object)
6406
6392
  return;
@@ -6470,25 +6456,25 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6470
6456
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
6471
6457
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
6472
6458
  const mixers = [];
6473
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
6474
- var _d, _e, _f, _g, _h, _j, _k;
6475
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
6459
+ const load = async (data) => {
6460
+ var _a, _b, _c, _d, _e, _f, _g;
6461
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
6476
6462
  if (!position)
6477
6463
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
6478
6464
  const modelPosition = transformPositionToVector3(position);
6479
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
6480
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
6465
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
6466
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
6481
6467
  state.rad = rad;
6482
6468
  if (rad === undefined)
6483
6469
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
6484
6470
  // 加载模型
6485
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6471
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
6486
6472
  // 设置位置
6487
6473
  object.position.copy(modelPosition);
6488
6474
  object.rotation.z = rad;
6489
6475
  object.scale.set(0.8, 0.8, 0.8);
6490
6476
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
6491
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
6477
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
6492
6478
  if (!textMesh)
6493
6479
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
6494
6480
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -6496,7 +6482,7 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
6496
6482
  object.children[0].add(textMesh);
6497
6483
  state.object = object;
6498
6484
  return true;
6499
- });
6485
+ };
6500
6486
  const initAnimation = () => {
6501
6487
  if (state.animation)
6502
6488
  return;
@@ -6733,21 +6719,21 @@ const getLongitudeParams = (from, to, rotation) => {
6733
6719
  */
6734
6720
  const CameraMovementPlugin = (five$1) => {
6735
6721
  const state = {};
6736
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
6722
+ const move = async (args, duration, opts = { preload: true }) => {
6737
6723
  if (state.interruptCallback) {
6738
6724
  state.interruptCallback(false);
6739
6725
  }
6740
6726
  if (opts.asyncStartCallback) {
6741
- yield opts.asyncStartCallback();
6727
+ await opts.asyncStartCallback();
6742
6728
  }
6743
6729
  if (args.mode && args.mode !== five$1.currentMode) {
6744
- yield five$1.changeMode(args.mode);
6730
+ await five$1.changeMode(args.mode);
6745
6731
  }
6746
6732
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6747
- yield five$1.preloadPano(args.panoIndex);
6733
+ await five$1.preloadPano(args.panoIndex);
6748
6734
  }
6749
6735
  if (opts.asyncEndCallback) {
6750
- yield opts.asyncEndCallback();
6736
+ await opts.asyncEndCallback();
6751
6737
  }
6752
6738
  if (args.panoIndex === undefined &&
6753
6739
  args.fov === undefined &&
@@ -6755,7 +6741,7 @@ const CameraMovementPlugin = (five$1) => {
6755
6741
  args.longitude === undefined) {
6756
6742
  return true;
6757
6743
  }
6758
- return yield new Promise((resolve, reject) => {
6744
+ return await new Promise((resolve, reject) => {
6759
6745
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
6760
6746
  if (panoIndex !== undefined) {
6761
6747
  five$1.moveToPano(panoIndex, Object.assign({
@@ -6768,7 +6754,7 @@ const CameraMovementPlugin = (five$1) => {
6768
6754
  reject(false);
6769
6755
  }
6770
6756
  });
6771
- });
6757
+ };
6772
6758
  const getAnimeParams = (args) => {
6773
6759
  const currentFiveState = five$1.state;
6774
6760
  // latitude
@@ -6784,20 +6770,20 @@ const CameraMovementPlugin = (five$1) => {
6784
6770
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
6785
6771
  };
6786
6772
  };
6787
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
6773
+ const rotate = async (args, duration, opts = {}) => {
6788
6774
  if (state.interruptCallback) {
6789
6775
  state.interruptCallback(false);
6790
6776
  }
6791
6777
  if (opts.asyncStartCallback) {
6792
- yield opts.asyncStartCallback();
6778
+ await opts.asyncStartCallback();
6793
6779
  }
6794
6780
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
6795
- yield five$1.changeMode(five.Five.Mode.Panorama);
6781
+ await five$1.changeMode(five.Five.Mode.Panorama);
6796
6782
  }
6797
6783
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
6798
6784
  if (opts.preload)
6799
- yield five$1.preloadPano(args.panoIndex);
6800
- yield new Promise((resolve, reject) => {
6785
+ await five$1.preloadPano(args.panoIndex);
6786
+ await new Promise((resolve, reject) => {
6801
6787
  if (!args.panoIndex) {
6802
6788
  resolve(true);
6803
6789
  return;
@@ -6809,10 +6795,10 @@ const CameraMovementPlugin = (five$1) => {
6809
6795
  });
6810
6796
  }
6811
6797
  if (opts.asyncEndCallback) {
6812
- yield opts.asyncEndCallback();
6798
+ await opts.asyncEndCallback();
6813
6799
  }
6814
6800
  const { from, to } = getAnimeParams(args);
6815
- return yield new Promise((resolve) => {
6801
+ return await new Promise((resolve) => {
6816
6802
  const onUpdate = ({ progress }) => {
6817
6803
  const state = {};
6818
6804
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -6854,7 +6840,7 @@ const CameraMovementPlugin = (five$1) => {
6854
6840
  state.interruptCallback(true);
6855
6841
  }, duration);
6856
6842
  });
6857
- });
6843
+ };
6858
6844
  return {
6859
6845
  move,
6860
6846
  rotate,
@@ -7213,7 +7199,7 @@ const PanoRulerPlugin = (five$1, params) => {
7213
7199
  state.loaded = true;
7214
7200
  return true;
7215
7201
  };
7216
- const load = (_roomInfo, _roomRules, options) => __awaiter(void 0, void 0, void 0, function* () {
7202
+ const load = async (_roomInfo, _roomRules, options) => {
7217
7203
  const roomInfo = _roomInfo || params.roomInfo;
7218
7204
  const roomRules = _roomRules || params.roomRules;
7219
7205
  if (!roomInfo || !roomRules) {
@@ -7224,9 +7210,9 @@ const PanoRulerPlugin = (five$1, params) => {
7224
7210
  return _load(roomInfo, roomRules);
7225
7211
  }
7226
7212
  else {
7227
- return yield new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7213
+ return await new Promise((resolve) => five$1.once('modelLoaded', () => resolve(_load(roomInfo, roomRules))));
7228
7214
  }
7229
- });
7215
+ };
7230
7216
  if (params.roomInfo && params.roomRules) {
7231
7217
  load(params.roomInfo, params.roomRules);
7232
7218
  }
@@ -7491,14 +7477,12 @@ function getRoomInfoInstance() {
7491
7477
  }
7492
7478
 
7493
7479
  const textureLoader = new THREE__namespace.TextureLoader();
7494
- function loadTexture(url) {
7495
- return __awaiter(this, void 0, void 0, function* () {
7496
- return new Promise((resolve, reject) => {
7497
- textureLoader.load(url, resolve, undefined, reject);
7498
- }).then((texture) => {
7499
- texture.encoding = THREE__namespace.sRGBEncoding;
7500
- return texture;
7501
- });
7480
+ async function loadTexture(url) {
7481
+ return new Promise((resolve, reject) => {
7482
+ textureLoader.load(url, resolve, undefined, reject);
7483
+ }).then((texture) => {
7484
+ texture.encoding = THREE__namespace.sRGBEncoding;
7485
+ return texture;
7502
7486
  });
7503
7487
  }
7504
7488
 
@@ -7738,65 +7722,59 @@ class PanoCompassController {
7738
7722
  if (this.modelLoaded)
7739
7723
  this.init();
7740
7724
  }
7741
- init() {
7742
- return __awaiter(this, void 0, void 0, function* () {
7743
- if (!this.data || !this.modelLoaded)
7744
- return;
7745
- const northRad = this.data.north_rad;
7746
- if (northRad != null) {
7747
- this.compassMesh = yield this.loadCompassMesh();
7748
- this.compassMesh.rotateX(-Math.PI / 2);
7749
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
7750
- this.group.add(this.compassMesh);
7751
- }
7752
- if (this.data.entrance != null) {
7753
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
7754
- this.roomInfoWrapperInstance = this.loadRoomInfo();
7755
- this.roomInfoInstance = getRoomInfoInstance();
7756
- this.entryDoorMesh.rotateX(-Math.PI / 2);
7757
- if (this.roomInfoWrapperInstance)
7758
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7759
- this.group.add(this.entryDoorMesh);
7760
- }
7761
- this.onFivePanoArrived(this.five.panoIndex || 0);
7762
- this.five.needsRender = true;
7763
- });
7764
- }
7765
- loadCompassMesh() {
7725
+ async init() {
7726
+ if (!this.data || !this.modelLoaded)
7727
+ return;
7728
+ const northRad = this.data.north_rad;
7729
+ if (northRad != null) {
7730
+ this.compassMesh = await this.loadCompassMesh();
7731
+ this.compassMesh.rotateX(-Math.PI / 2);
7732
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
7733
+ this.group.add(this.compassMesh);
7734
+ }
7735
+ if (this.data.entrance != null) {
7736
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
7737
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
7738
+ this.roomInfoInstance = getRoomInfoInstance();
7739
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
7740
+ if (this.roomInfoWrapperInstance)
7741
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
7742
+ this.group.add(this.entryDoorMesh);
7743
+ }
7744
+ this.onFivePanoArrived(this.five.panoIndex || 0);
7745
+ this.five.needsRender = true;
7746
+ }
7747
+ async loadCompassMesh() {
7766
7748
  var _a;
7767
- return __awaiter(this, void 0, void 0, function* () {
7768
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7769
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7770
- const compassTexture = yield loadTexture(compassImageUrl);
7771
- const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7772
- const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7773
- map: compassTexture,
7774
- transparent: true,
7775
- opacity: 0,
7776
- depthTest: false,
7777
- });
7778
- const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7779
- compassMesh.name = 'pano-compass-mesh';
7780
- return compassMesh;
7749
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
7750
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
7751
+ const compassTexture = await loadTexture(compassImageUrl);
7752
+ const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
7753
+ const compassMaterial = new THREE__namespace.MeshBasicMaterial({
7754
+ map: compassTexture,
7755
+ transparent: true,
7756
+ opacity: 0,
7757
+ depthTest: false,
7781
7758
  });
7759
+ const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
7760
+ compassMesh.name = 'pano-compass-mesh';
7761
+ return compassMesh;
7782
7762
  }
7783
- loadEntryDoorMesh() {
7763
+ async loadEntryDoorMesh() {
7784
7764
  var _a;
7785
- return __awaiter(this, void 0, void 0, function* () {
7786
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7787
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7788
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
7789
- const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7790
- const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7791
- map: entryDoorTexture,
7792
- transparent: true,
7793
- opacity: 0.8,
7794
- depthTest: false,
7795
- });
7796
- const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7797
- entryDoorMesh.name = 'pano-compass-entry-door';
7798
- return entryDoorMesh;
7765
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
7766
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
7767
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
7768
+ const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
7769
+ const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
7770
+ map: entryDoorTexture,
7771
+ transparent: true,
7772
+ opacity: 0.8,
7773
+ depthTest: false,
7799
7774
  });
7775
+ const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
7776
+ entryDoorMesh.name = 'pano-compass-entry-door';
7777
+ return entryDoorMesh;
7800
7778
  }
7801
7779
  loadRoomInfo() {
7802
7780
  const points = [
@@ -10661,11 +10639,6 @@ if (typeof undefined$1 === 'function' && undefined$1.amd) {
10661
10639
 
10662
10640
  var Hammer = hammer.exports;
10663
10641
 
10664
- var Hammer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
10665
- __proto__: null,
10666
- 'default': Hammer
10667
- }, [hammer.exports]));
10668
-
10669
10642
  // uuid
10670
10643
  function S4() {
10671
10644
  return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
@@ -11661,7 +11634,7 @@ class EditController extends BaseController {
11661
11634
  const fiveElement = this.five.getElement();
11662
11635
  if (fiveElement) {
11663
11636
  this.fiveElement = fiveElement;
11664
- const hammer = new Hammer$1(fiveElement);
11637
+ const hammer = new Hammer(fiveElement);
11665
11638
  this.hammer = hammer;
11666
11639
  hammer.on('tap', this.onTap);
11667
11640
  hammer.on('pan', this.onPan);
@@ -13224,7 +13197,7 @@ const currentTarget = store.writable(null);
13224
13197
  /* src/PanoSpatialTagPlugin/Components/origins.svelte generated by Svelte v3.47.0 */
13225
13198
 
13226
13199
  function add_css$3(target) {
13227
- internal.append_styles(target, "svelte-scnx9u", ".PanoSpatialTagPlugin__tag-origin.svelte-scnx9u{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-scnx9u:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-scnx9u{transform:translate(-50%, -50%) scale(0.6);animation:svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-scnx9u-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}");
13200
+ internal.append_styles(target, "svelte-1kuu68s", ".PanoSpatialTagPlugin__tag-origin.svelte-1kuu68s{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;-webkit-animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin 1.2s forwards;animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-1kuu68s:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-1kuu68s{transform:translate(-50%, -50%) scale(0.6);-webkit-animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s;animation:svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@-webkit-keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@-webkit-keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}@keyframes svelte-1kuu68s-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}");
13228
13201
  }
13229
13202
 
13230
13203
  function get_each_context$1(ctx, list, i) {
@@ -13248,7 +13221,7 @@ function create_each_block$1(ctx) {
13248
13221
  return {
13249
13222
  c() {
13250
13223
  i = internal.element("i");
13251
- internal.attr(i, "class", "svelte-scnx9u");
13224
+ internal.attr(i, "class", "svelte-1kuu68s");
13252
13225
  internal.toggle_class(i, "PanoSpatialTagPlugin__tag-origin", true);
13253
13226
  internal.toggle_class(i, "PanoSpatialTagPlugin__tag-origin-destroy", /*origin*/ ctx[3].destroying);
13254
13227
  internal.set_style(i, "top", style_top, false);
@@ -13373,7 +13346,7 @@ class Origins extends internal.SvelteComponent {
13373
13346
  /* src/PanoSpatialTagPlugin/Components/tag.svelte generated by Svelte v3.47.0 */
13374
13347
 
13375
13348
  function add_css$2(target) {
13376
- internal.append_styles(target, "svelte-1c0xhg0", ".PanoSpatialTagPlugin__tag-x.svelte-1c0xhg0.svelte-1c0xhg0{position:relative;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0.svelte-1c0xhg0{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0{animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0{animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0.svelte-1c0xhg0{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line.svelte-1c0xhg0{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1c0xhg0.svelte-1c0xhg0{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-animate.svelte-1c0xhg0{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0.svelte-1c0xhg0{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-flagpole.svelte-1c0xhg0{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-shadow.svelte-1c0xhg0{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content.svelte-1c0xhg0{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-content .svelte-1c0xhg0{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line1.svelte-1c0xhg0{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1c0xhg0 .PanoSpatialTagPlugin__tag-line2.svelte-1c0xhg0{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1c0xhg0-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}");
13349
+ internal.append_styles(target, "svelte-1wukaol", ".PanoSpatialTagPlugin__tag-x.svelte-1wukaol.svelte-1wukaol{position:relative;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol.svelte-1wukaol{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1wukaol.svelte-1wukaol{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1wukaol.svelte-1wukaol{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-line1.svelte-1wukaol{-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-line2.svelte-1wukaol{-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol.svelte-1wukaol{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-line.svelte-1wukaol{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1wukaol.svelte-1wukaol{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-animate.svelte-1wukaol{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1wukaol.svelte-1wukaol{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-flagpole.svelte-1wukaol{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-shadow.svelte-1wukaol{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-content.svelte-1wukaol{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-content .svelte-1wukaol{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-line1.svelte-1wukaol{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1wukaol .PanoSpatialTagPlugin__tag-line2.svelte-1wukaol{opacity:0.5;transform:translate(-50%, 0) scaleY(0);-webkit-animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s;animation:svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@-webkit-keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1wukaol-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}");
13377
13350
  }
13378
13351
 
13379
13352
  function create_fragment$2(ctx) {
@@ -13407,19 +13380,19 @@ function create_fragment$2(ctx) {
13407
13380
  t3 = internal.space();
13408
13381
  div3 = internal.element("div");
13409
13382
  div2 = internal.element("div");
13410
- internal.attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-1c0xhg0");
13383
+ internal.attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-1wukaol");
13411
13384
  internal.set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
13412
- internal.attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-1c0xhg0");
13385
+ internal.attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-1wukaol");
13413
13386
  internal.set_style(i0, "width", /*lineWidthZoom*/ ctx[4] + "rem");
13414
- internal.attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-1c0xhg0");
13415
- internal.attr(i2, "class", "PanoSpatialTagPlugin__tag-line2 svelte-1c0xhg0");
13416
- internal.attr(div1, "class", "PanoSpatialTagPlugin__tag-line svelte-1c0xhg0");
13417
- internal.attr(div2, "class", "PanoSpatialTagPlugin__tag-content svelte-1c0xhg0");
13418
- internal.attr(div3, "class", "PanoSpatialTagPlugin__tag-animate svelte-1c0xhg0");
13387
+ internal.attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-1wukaol");
13388
+ internal.attr(i2, "class", "PanoSpatialTagPlugin__tag-line2 svelte-1wukaol");
13389
+ internal.attr(div1, "class", "PanoSpatialTagPlugin__tag-line svelte-1wukaol");
13390
+ internal.attr(div2, "class", "PanoSpatialTagPlugin__tag-content svelte-1wukaol");
13391
+ internal.attr(div3, "class", "PanoSpatialTagPlugin__tag-animate svelte-1wukaol");
13419
13392
  internal.set_style(div3, "transform", "scale(" + /*contentZoom*/ ctx[3] * 3 + ")");
13420
13393
  internal.attr(div4, "id", div4_id_value = 'PanoSpatialTagPlugin__' + /*id*/ ctx[0]);
13421
13394
  internal.set_style(div4, "height", 20 * /*lineHeightZoom*/ ctx[5] + "rem");
13422
- internal.attr(div4, "class", "svelte-1c0xhg0");
13395
+ internal.attr(div4, "class", "svelte-1wukaol");
13423
13396
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-x", true);
13424
13397
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-upside-down", /*upsideDown*/ ctx[1]);
13425
13398
  internal.toggle_class(div4, "PanoSpatialTagPlugin__tag-show", /*show*/ ctx[10]);
@@ -14286,7 +14259,7 @@ var DISPLAY_STRATEGY_TYPE;
14286
14259
  /* src/ModelItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
14287
14260
 
14288
14261
  function add_css$1(target) {
14289
- internal.append_styles(target, "svelte-1mttyji", ".item-label-item.svelte-1mttyji{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1mttyji{opacity:1;animation:svelte-1mttyji-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1mttyji::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(16px);z-index:-1}.item-label-item__text-wrap.svelte-1mttyji{padding:6px 6px 0;position:absolute;height:20px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:10px;font-size:11px;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1mttyji{padding-bottom:4px;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1mttyji{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1mttyji-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
14262
+ internal.append_styles(target, "svelte-1hzvil1", ".item-label-item.svelte-1hzvil1{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1hzvil1{opacity:1;-webkit-animation:svelte-1hzvil1-fadeIn .3s ease-in;animation:svelte-1hzvil1-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1hzvil1::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-1hzvil1{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1hzvil1{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1hzvil1{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@-webkit-keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}@keyframes svelte-1hzvil1-fadeIn{from{opacity:0\n }to{opacity:1\n }}");
14290
14263
  }
14291
14264
 
14292
14265
  function create_fragment$1(ctx) {
@@ -14313,12 +14286,12 @@ function create_fragment$1(ctx) {
14313
14286
  t0 = internal.text(t0_value);
14314
14287
  t1 = internal.space();
14315
14288
  div1 = internal.element("div");
14316
- internal.attr(span, "class", "item-label-item__text svelte-1mttyji");
14317
- internal.attr(div0, "class", "item-label-item__text-wrap svelte-1mttyji");
14289
+ internal.attr(span, "class", "item-label-item__text svelte-1hzvil1");
14290
+ internal.attr(div0, "class", "item-label-item__text-wrap svelte-1hzvil1");
14318
14291
  internal.set_style(div0, "top", `-${/*itemLabel*/ ctx[0].strokeLength + 26}px`);
14319
- internal.attr(div1, "class", "item-label-item__bar svelte-1mttyji");
14292
+ internal.attr(div1, "class", "item-label-item__bar svelte-1hzvil1");
14320
14293
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
14321
- internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"));
14294
+ internal.attr(div2, "class", div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"));
14322
14295
  internal.set_style(div2, "z-index", /*itemLabel*/ ctx[0].zIndex, false);
14323
14296
  internal.set_style(div2, "transform", /*itemLabel*/ ctx[0].transform, false);
14324
14297
  },
@@ -14348,7 +14321,7 @@ function create_fragment$1(ctx) {
14348
14321
  internal.set_style(div1, "height", `${/*itemLabel*/ ctx[0].strokeLength}px`);
14349
14322
  }
14350
14323
 
14351
- if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1mttyji"))) {
14324
+ if (dirty & /*itemLabel*/ 1 && div2_class_value !== (div2_class_value = "" + (internal.null_to_empty(classNames__default["default"]("item-label-item", { visible: /*itemLabel*/ ctx[0].visible })) + " svelte-1hzvil1"))) {
14352
14325
  internal.attr(div2, "class", div2_class_value);
14353
14326
  }
14354
14327
 
@@ -14412,7 +14385,7 @@ function debounce(func, wait = 200) {
14412
14385
  /* src/ModelItemLabelPlugin/ItemLabelComponent.svelte generated by Svelte v3.47.0 */
14413
14386
 
14414
14387
  function add_css(target) {
14415
- internal.append_styles(target, "svelte-rmdeb", ".item-labels-container.svelte-rmdeb{width:100%;height:100%;position:relative}");
14388
+ internal.append_styles(target, "svelte-gk8s47", ".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}");
14416
14389
  }
14417
14390
 
14418
14391
  function get_each_context(ctx, list, i) {
@@ -14493,7 +14466,7 @@ function create_fragment(ctx) {
14493
14466
  each_blocks[i].c();
14494
14467
  }
14495
14468
 
14496
- internal.attr(div, "class", "item-labels-container svelte-rmdeb");
14469
+ internal.attr(div, "class", "item-labels-container svelte-gk8s47");
14497
14470
  internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[10].call(div));
14498
14471
  internal.set_style(div, "opacity", /*itemsVisible*/ ctx[4] ? 1 : 0, false);
14499
14472
  },
@@ -15081,7 +15054,7 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15081
15054
  xhr.send();
15082
15055
  });
15083
15056
  };
15084
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
15057
+ const load = async (data, videoElement) => {
15085
15058
  const { video_src, video_poster_src, points } = data;
15086
15059
  state.videoSource = video_src;
15087
15060
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -15091,11 +15064,11 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
15091
15064
  if (videoElement) {
15092
15065
  state.videoElement = videoElement;
15093
15066
  }
15094
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
15067
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
15095
15068
  state.enabled = !!data.enable;
15096
15069
  if (state.enabled)
15097
15070
  enable();
15098
- });
15071
+ };
15099
15072
  const dispose = () => {
15100
15073
  disable();
15101
15074
  state.videoTexture = undefined;